my.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. if (!isset($_POST['id']) or !isset($_POST['dateExpire'])) {
  3. exit('No hack 1');
  4. }
  5. $id = $_POST['id'];
  6. if (!preg_match('/^[0-9]+-[0-9]{1,2}$/', $id)) {
  7. exit('No Hack ID');
  8. }
  9. $idSplit = explode('-', $id);
  10. $config = yaml_parse_file('./config.yaml');
  11. include('./lib/functions.php');
  12. $uploadDirId=$config['uploadDir'].'/'.$id;
  13. if (is_dir($uploadDirId)) {
  14. $nbFile=0;
  15. $contentType = null;
  16. $contentTypeMultiple = false;
  17. $filesSize=0;
  18. foreach (scandir($uploadDirId) as $file) {
  19. if (is_file($uploadDirId.'/'.$file)
  20. && $file != $id.'.zip'
  21. && !preg_match('/^\.(.+)\.cfg$/', $file)
  22. && !preg_match('/^\.(.+)\.small$/', $file)) {
  23. $nbFile++;
  24. $filesSize=filesize($uploadDirId.'/'.$file)+$filesSize;
  25. $contentTypeNew=mime_content_type($uploadDirId.'/'.$file);
  26. if ($contentType == null) {
  27. $contentType = $contentTypeNew;
  28. } elseif ($contentType != $contentTypeNew) {
  29. $contentTypeMultiple = true;
  30. }
  31. }
  32. }
  33. echo '<tr onclick="location.href=\''.$config['baseUrl'].'/'.$id.'/'.'\'">';
  34. if ($contentTypeMultiple) {
  35. echo '<td><div class="fi fi-size-xs fi-any">
  36. <div class="fi-content">'._('Multi').'</div>
  37. </div></td>';
  38. } else {
  39. $contentTypeSplit = explode('/', $contentType);
  40. echo '<td><div class="fi fi-size-xs fi-'.$contentTypeSplit[1].'">
  41. <div class="fi-content">'.$contentTypeSplit[1].'</div>
  42. </div></td>';
  43. }
  44. echo '<td>'.$nbFile.'</td>';
  45. echo '<td>'.date("Y/m/d", filectime($uploadDirId)).'</td>';
  46. echo '<td>'.date("Y/m/d", $idSplit[0]).'</td>';
  47. echo '<td>'.convertOctect2humain($filesSize).'</td>';
  48. if (is_file($uploadDirId.'/.access.cfg') ) {
  49. echo '<td>'.file_get_contents($uploadDirId.'/.access.cfg').'</td>';
  50. }else{
  51. echo '<td>'._('Unlimited').'</td>';
  52. }
  53. if (is_file($uploadDirId.'/.password.cfg') ) {
  54. echo '<td> '._('Yes').' </td>';
  55. }else{
  56. echo '<td> '._('No').' </td>';
  57. }
  58. echo '<td><a href="'.$config['baseUrl'].'/'.$id.'/'.'">'._('Link').'</a></td>';
  59. echo '</tr>';
  60. }
  61. ?>