本文整理匯總了PHP中Base_Controller::input方法的典型用法代碼示例。如果您正苦於以下問題:PHP Base_Controller::input方法的具體用法?PHP Base_Controller::input怎麽用?PHP Base_Controller::input使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Base_Controller
的用法示例。
在下文中一共展示了Base_Controller::input方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: input
protected function input()
{
parent::input();
if (isset($param['logout'])) {
$logout = $this->clear_int($param['logout']);
if ($logout) {
$this->ob_user->logout();
}
}
$this->ob_user = Model_User::get_instance();
$this->ob_model = Model::get_instance();
$this->title = 'Massage Practice | ';
/// разбан через час
$time_clean = time() - 3600 * UNBAN;
$this->ob_user->clear_fail($time_clean);
//проверяем неудачные попытки
$ip = $_SERVER['REMOTE_ADDR'];
$fail = $this->ob_user->get_fails($ip);
$fail = $fail[0]['counter'];
if (isset($_POST['auth_submit'])) {
if ($fail < 3) {
$login = $this->clear_str($_POST['auth_login']);
$pass = $this->clear_str($_POST['auth_pass']);
try {
$id = $this->ob_user->check_user($login, $pass);
//записываем id
$this->user_id = $id;
$this->ob_user->set();
$this->redirect();
} catch (AuthException $e) {
if (!$fail) {
$this->ob_user->first_fail($ip);
} else {
$this->ob_user->update_fail($ip, $fail);
}
}
} else {
try {
throw new AuthException('Превышено число неправильных попыток! Повторите через 1 час');
} catch (AuthException $e) {
$e->getMessage();
}
}
}
if (isset($_COOKIE['NOU'])) {
$id_update = $this->ob_user->unpackage();
$this->user_id = $id_update[0];
$this->i_user = $this->ob_user->get_user($this->user_id);
}
}