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


PHP identity::is_correct_password方法代码示例

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


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

示例1: index

 public function index()
 {
     $username = Input::instance()->post("user");
     $password = Input::instance()->post("password");
     $user = identity::lookup_user_by_name($username);
     if (empty($user) || !identity::is_correct_password($user, $password)) {
         throw new Rest_Exception("Forbidden", 403);
     }
     $key = rest::get_access_token($user->id);
     rest::reply($key->access_key);
 }
开发者ID:joericochuyt,项目名称:gallery3,代码行数:11,代码来源:rest.php

示例2: index

 public function index()
 {
     $username = Input::instance()->post("user");
     $password = Input::instance()->post("password");
     if (empty($username) || auth::too_many_failures($username)) {
         throw new Rest_Exception("Forbidden", 403);
     }
     $user = identity::lookup_user_by_name($username);
     if (empty($user) || !identity::is_correct_password($user, $password)) {
         module::event("user_login_failed", $username);
         throw new Rest_Exception("Forbidden", 403);
     }
     auth::login($user);
     rest::reply(rest::access_key());
 }
开发者ID:kandsten,项目名称:gallery3,代码行数:15,代码来源:rest.php

示例3: _authenticate

 private function _authenticate()
 {
     $auth = new Sabre_HTTP_BasicAuth();
     $auth->setRealm(item::root()->title);
     $authResult = $auth->getUserPass();
     list($username, $password) = $authResult;
     if (!$username || !$password) {
         $auth->requireLogin();
         return false;
     }
     $user = identity::lookup_user_by_name($username);
     if (empty($user) || !identity::is_correct_password($user, $password)) {
         $auth->requireLogin();
         return false;
     }
     identity::set_active_user($user);
     return true;
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:18,代码来源:webdav.php

示例4: _auth

 private function _auth($url)
 {
     $form = auth::get_login_form($url);
     $valid = $form->validate();
     if ($valid) {
         $user = identity::lookup_user_by_name($form->login->inputs["name"]->value);
         if (empty($user) || !identity::is_correct_password($user, $form->login->password->value)) {
             log::warning("user", t("Failed login for %name", array("name" => $form->login->inputs["name"]->value)));
             $form->login->inputs["name"]->add_error("invalid_login", 1);
             $valid = false;
         }
     }
     if ($valid) {
         auth::login($user);
     }
     // Either way, regenerate the session id to avoid session trapping
     Session::instance()->regenerate();
     return array($valid, $form);
 }
开发者ID:joericochuyt,项目名称:gallery3,代码行数:19,代码来源:login.php

示例5: __construct

 public function __construct($name, $pass)
 {
     $user = identity::lookup_user_by_name($name);
     $this->result = identity::is_correct_password($user, $pass);
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:5,代码来源:gallery.php

示例6: valid_password

 static function valid_password($password_input)
 {
     if (!identity::is_correct_password(identity::active_user(), $password_input->value)) {
         $password_input->add_error("invalid_password", 1);
     }
 }
开发者ID:JasonWiki,项目名称:docs,代码行数:6,代码来源:reauthenticate.php


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