create.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. include_once("config.php");
  3. if(isset($config_var[0])) { $validation_key = $config_var[0]; }
  4. if($_POST['filezusername']!="" && $_POST['filezpassword']!="" && $_POST['filezpasswordagain']!="")
  5. {
  6. $username = stripcslashes(htmlentities(str_replace($badchars, '', $_POST['filezusername'])));
  7. $password = $_POST['filezpassword'];
  8. $password_again = $_POST['filezpasswordagain'];
  9. //$validation_input = $_POST['filezvalidation'];
  10. if($password == $password_again)
  11. {
  12. if($password!="")
  13. {
  14. if($username!="")
  15. {
  16. if(!file_exists("users/$username.php"))
  17. {
  18. //if($validation_key==$validation_input)
  19. //{
  20. mkdir("users/$username", 0777);
  21. //file_put_contents("users/$username/index.html", "<html><meta http-equiv='refresh' content='0;url=/'></html>");
  22. file_put_contents("users/$username.php", "<?php\n \$user_password = \"$password\";\n ?>\n");
  23. file_put_contents("users/$username.usage", "0");
  24. exec("ln -s /opt/eeze/users/$username /opt/eezeusers/$username"); // create symlink to web server
  25. header("Location: login.php");
  26. //}
  27. //else
  28. //{
  29. // header("Location: register.php?error=5");
  30. //}
  31. }
  32. else
  33. {
  34. header("Location: register.php?error=4");
  35. }
  36. }
  37. else
  38. {
  39. header("Location: register.php?error=1");
  40. }
  41. }
  42. else
  43. {
  44. header("Location: register.php?error=2");
  45. }
  46. }
  47. else
  48. {
  49. header("Location: register.php?error=3");
  50. }
  51. }
  52. else
  53. {
  54. header("Location: register.php?error=8");
  55. }
  56. ?>