Guest User

Untitled

a guest
Jun 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #!/usr/bin/php
  2.  
  3. <?php
  4.  
  5. // set PHP include path
  6. $newIncludePath = array();
  7. $newIncludePath[] = '/opt/apps/zend_framework/';
  8. $newIncludePath[] = 'include';
  9. $newIncludePath[] = get_include_path();
  10. $newIncludePath = implode(PATH_SEPARATOR, $newIncludePath);
  11. set_include_path($newIncludePath);
  12.  
  13. // load Zend Framework
  14. require_once 'Zend/Loader/Autoloader.php';
  15. $autoloader = Zend_Loader_Autoloader::getInstance();
  16. $autoloader->setFallbackAutoloader(true);
  17.  
  18. require_once('classes/User.class.php');
  19.  
  20. // incoming pipe
  21. $file_stdin = fopen('php://stdin', 'r');
  22. $user = trim(fgets($file_stdin));
  23. $pass = trim(fgets($file_stdin));
  24.  
  25. // aaa check
  26. #$user = new User();
  27. #$auth_result = $user->logon($user, $pass, '12');
  28. #if ($auth_result == 1) {
  29. # exit(0);
  30. #}
  31.  
  32. ## debug file (NEVER ENABLE THIS! ALL PASSWORDS WILL BE RECORDED IN PLAINTEXT ON THE FILESYSTEM)
  33. #$file_log = fopen('/tmp/auth_test', 'a');
  34. #fwrite($file_log, "$user");
  35. #fwrite($file_log, "$pass");
  36.  
  37. // return FAIL flag by default
  38. exit(0)
  39. ?>
Add Comment
Please, Sign In to add comment