当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_User::authenticate方法代码示例

本文整理汇总了PHP中Model_User::authenticate方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_User::authenticate方法的具体用法?PHP Model_User::authenticate怎么用?PHP Model_User::authenticate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model_User的用法示例。


在下文中一共展示了Model_User::authenticate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: authenticate

 public function authenticate()
 {
     try {
         $this->user = Model_User::authenticate($this->username, $this->password);
     } catch (Exception $e) {
         if ($e->getMessage() == Model_User::WRONG_PW) {
             return $this->result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, self::BAD_PW_MSG);
         }
         if ($e->getMessage() == Model_User::NOT_FOUND) {
             return $this->result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, self::NOT_FOUND_MSG);
         }
     }
     return $this->result(Zend_Auth_Result::SUCCESS);
 }
开发者ID:jaspermeijaard,项目名称:home-booking-system,代码行数:14,代码来源:Adapter.php

示例2: _login

 protected function _login($user, $password, $remember)
 {
     if (!is_object($user)) {
         $username = $user;
         $user = Model_User::authenticate($username, $password);
         if ($user) {
             return $this->complete_login($user);
         }
         return FALSE;
     }
     if ($user) {
         return TRUE;
     }
     return FALSE;
 }
开发者ID:creat2012,项目名称:hustoj_official,代码行数:15,代码来源:Hoj.php

示例3: force_login

 /**
  * Forces a user to be logged in, without specifying a password.
  *
  * @param mixed $username_or_email_or_id
  *
  * @return bool
  */
 public function force_login($username_or_email_or_id)
 {
     $user = \Model_User::authenticate($username_or_email_or_id, true);
     return $user && $this->complete_login($user);
 }
开发者ID:nsbasicus,项目名称:warden,代码行数:12,代码来源:driver.php

示例4: action_login

 /**
 Handles the login action - initializes the session verifying the credentials
 */
 public function action_login()
 {
     $error = null;
     if (isset($_POST['submit'])) {
         if (Model_User::authenticate($_POST, $this)) {
             $this->request->redirect(SIGNED_IN_HOME);
         } else {
             $error = "Oops! Email and Password do not match.";
         }
     }
     $this->add_to_header(new View("user/login", array('error_message' => $error)));
     $this->_view = new View("pages/home");
     $this->_enable_sidebar = false;
 }
开发者ID:kanikaN,项目名称:qload,代码行数:17,代码来源:user.php

示例5: force_login

 /**
  * Forces a user to be logged in, without specifying a password.
  *
  * @param mixed $username_or_email_or_id
  *
  * @return bool
  */
 public function force_login($username_or_email_or_id, $check_confirmation = false)
 {
     $user = \Model_User::authenticate($username_or_email_or_id, !$check_confirmation);
     return $user && $this->complete_login($user);
 }
开发者ID:jkapelner,项目名称:chatroom-web-server,代码行数:12,代码来源:driver.php


注:本文中的Model_User::authenticate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。