public function authenticateHash($hash) { if (version_compare(VERSION, '2.0', '>=')) { $hash_real = $this->connection->query("SELECT `value` FROM {$this->getTableName('setting')} WHERE `code` = 'monkey_data_tmp' && `key` = 'monkey_data_hash' LIMIT 0,1;")->fetchObject(); } elseif (version_compare(VERSION, '1.5', '>=')) { $hash_real = $this->connection->query("SELECT `value` FROM {$this->getTableName('setting')} WHERE `group` = 'monkey_data' && `key` = 'hash' LIMIT 0,1;")->fetchObject(); } $this->config['security']['hash'] = $hash_real->value; return parent::authenticateHash($hash); }
private function authenticate() { if ($this->secureAsHash) { if (strlen($this->hash) == 0) { $this->exitWithError("EMPTY HASH"); } if (!$this->model->authenticateHash($this->hash)) { $this->exitWithError("WRONG HASH"); } } else { if (!$this->model->authenticateLogin($this->login, $this->password)) { $this->exitWithError("NOT USER FOUND"); } } }