Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- if (!defined('IN_AEVITAS'))
- exit('<b>Aevitas Compiler</b>: Object reference not set to instance of an object.');
- class register
- {
- string $token, $username, $password;
- bool $token_required;
- public function __constructor(null $token, $username, $password, $token_required)
- {
- if ($token != null)
- $this -> token = $token;
- $this -> username = $username;
- $this -> password = $password;
- }
- public bool check_token()
- {
- if ($this -> token == '') throw new exception('register::check_token() -> invalid token specified.');
- if (!$this -> token_required) throw new exception('register::check_token() -> token not required for action.');
- if ($this -> token != '' && $this -> token_required) // All seems OK, and we have no exceptions thrown!
- {
- $this -> result = mysql_query('SELECT * FROM `tokens` WHERE key=`"' .$this -> token. '"`');
- $this -> row = mysql_fetch_array($this -> result);
- if ($this -> row && count($this -> row) >= 0) // Ensure we actually have some results.
- {
- return true;
- }
- }
- return false;
- }
- }
- ?>
Add Comment
Please, Sign In to add comment