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