本文整理汇总了PHP中Model_User::authorize方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_User::authorize方法的具体用法?PHP Model_User::authorize怎么用?PHP Model_User::authorize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_User
的用法示例。
在下文中一共展示了Model_User::authorize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginAction
public function loginAction()
{
$formLogin = new Form_Login();
if ($this->_request->isPost()) {
if ($formLogin->isValid($this->_request->getParams())) {
$user = new Model_User();
if ($user->authorize($formLogin->getValue('email'), $formLogin->getValue('password'))) {
$this->_helper->redirector('index');
} else {
$this->view->error = 'Неверные данные авторизации';
}
}
}
$this->view->form = $formLogin;
}
示例2: loginAction
public function loginAction()
{
$this->view->title = "User Login.";
$this->view->headTitle($this->view->title, 'PREPEND');
$form = new Form_Login();
if ($this->getRequest()->isPost()) {
if ($form->isValid($this->getRequest()->getPost())) {
$user = new Model_User();
if ($user->authorize($form->getValue('vUsername'), $form->getValue('vPassword'))) {
$this->_redirect('/index/');
} else {
$this->view->error = "Wrong E-mail or Password.";
}
}
}
$this->view->form = $form;
}
示例3: loginAction
public function loginAction()
{
$form = new Form_Login();
if ($this->getRequest()->isPost()) {
if ($form->isValid($this->getRequest()->getPost())) {
$user = new Model_User();
//authorize() - фу-я описана в моделі,
//повертає true, якщо авторизація пройшла успішно
if ($user->authorize($form->getValue('username'), $form->getValue('password'))) {
$this->_helper->redirector('login');
} else {
$this->view->error = "Невірні дані авторизації";
}
}
}
$this->view->form = $form;
}