public function unset_secret_key() { $id = $this->_user->get_id(); if (!$id) { return FALSE; } $secret_data = array('secret_key' => ''); Session::set_server_data($secret_data); db::simple_query(self::Q_UPDATE_USER_KEY, array('%user_id' => $id, '%secret_key' => '')); return TRUE; }
public function check($code) { $server_captcha = Session::get_server_data('captcha'); Session::set_server_data(array('captcha' => '')); if (!empty($server_captcha) and $server_captcha == $code) { return TRUE; } return FALSE; }