getPass.php 561 B

12345678910111213141516171819
  1. #!/usr/bin/env php
  2. <?php
  3. $_SERVER['SERVER_NAME'] = gethostname();
  4. $curDir = dirname(__FILE__);
  5. if (!preg_match('/(^.*)stuff.*$/', $curDir, $matches)) die('ScriptLocationError');;
  6. @require_once $matches[1] . 'se-lib' . DIRECTORY_SEPARATOR . 'bootstrap.php';
  7. date_default_timezone_set('Europe/Warsaw');
  8. try {
  9. Lib::loadClass('Token');
  10. $tokenObj = new Token(Config::getConfFile('default_db')['pass']);
  11. $token = $tokenObj->genToken();
  12. error_log($token);
  13. $hash = readline();
  14. echo $tokenObj->verify($hash);
  15. } catch (Exception $e) {
  16. echo "Unknown error";
  17. }
  18. ?>