• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP auth_verifyPassword函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中auth_verifyPassword函数的典型用法代码示例。如果您正苦于以下问题:PHP auth_verifyPassword函数的具体用法?PHP auth_verifyPassword怎么用?PHP auth_verifyPassword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: checkPass

 /**
  * Check user+password [required auth function]
  *
  * Checks if the given user exists and the given
  * plaintext password is correct
  *
  * @author  Andreas Gohr <[email protected]>
  * @return  bool
  */
 function checkPass($user, $pass)
 {
     $userinfo = $this->getUserData($user);
     if ($userinfo === false) {
         return false;
     }
     return auth_verifyPassword($pass, $this->users[$user]['pass']);
 }
开发者ID:projectesIF,项目名称:Ateneu,代码行数:17,代码来源:plain.class.php


示例2: test_verifyPassword_pmd5Exception

 /**
  * pmd5 checking should throw an exception when a hash with a too high
  * iteration count is passed
  */
 function test_verifyPassword_pmd5Exception()
 {
     $except = false;
     try {
         auth_verifyPassword('foopmd5', '$H$abcdefgh1ZbJodHxmeXVAhEzTG7IAp.');
     } catch (Exception $e) {
         $except = true;
     }
     $this->assertTrue($except);
 }
开发者ID:kbuildsyourdotcom,项目名称:Door43,代码行数:14,代码来源:auth_password.test.php


示例3: login

function login($user, $pass)
{
    $sql = "SELECT pass, id\n                  FROM lylina_users\n                 WHERE login = '" . addslashes($user) . "'";
    $result = runSQL($sql);
    if (count($result) != 1 || !auth_verifyPassword($pass, $result[0]['pass'])) {
        return 0;
    }
    setAuthToken($result[0]['id']);
    return $result[0]['id'];
}
开发者ID:eharmon,项目名称:yelly,代码行数:10,代码来源:auth.php


示例4: checkPass

 /**
  * Checks if the given user exists and the given plaintext password
  * is correct. Furtheron it might be checked wether the user is
  * member of the right group
  *
  * Depending on which SQL string is defined in the config, password
  * checking is done here (getpass) or by the database (passcheck)
  *
  * @param  $user  user who would like access
  * @param  $pass  user's clear text password to check
  * @return bool
  *
  * @author  Andreas Gohr <[email protected]>
  * @author  Matthias Grimm <[email protected]>
  */
 function checkPass($user, $pass)
 {
     $rc = false;
     if ($this->_openDB()) {
         $sql = str_replace('%{user}', $this->_escape($user), $this->cnf['checkPass']);
         $sql = str_replace('%{pass}', $this->_escape($pass), $sql);
         $sql = str_replace('%{dgroup}', $this->_escape($this->defaultgroup), $sql);
         $result = $this->_queryDB($sql);
         if ($result !== false && count($result) == 1) {
             if ($this->cnf['forwardClearPass'] == 1) {
                 $rc = true;
             } else {
                 $rc = auth_verifyPassword($pass, $result[0]['pass']);
             }
         }
         $this->_closeDB();
     }
     return $rc;
 }
开发者ID:projectesIF,项目名称:Ateneu,代码行数:34,代码来源:mysql.class.php


示例5: test_verifyPassword_fixedpmd5

 function test_verifyPassword_fixedpmd5()
 {
     $this->assertTrue(auth_verifyPassword('test12345', '$P$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0'));
     $this->assertTrue(auth_verifyPassword('test12345', '$H$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0'));
 }
开发者ID:nefercheprure,项目名称:dokuwiki,代码行数:5,代码来源:auth_password.test.php


示例6: test_verifyPassword_nohash

 function test_verifyPassword_nohash()
 {
     $this->assertTrue(auth_verifyPassword('foo', '$1$$n1rTiFE0nRifwV/43bVon/'));
 }
开发者ID:pyfun,项目名称:dokuwiki,代码行数:4,代码来源:auth_password.test.php


示例7: findUserByUsernameAndPassword

 /**
  * Finds user by username and password
  *
  */
 public function findUserByUsernameAndPassword($username, $password)
 {
     $username = preg_replace('/[^\\w\\d\\.-_]/', '', $username);
     $password = preg_replace('/[^\\w\\d\\.-_]/', '', $password);
     $userdata = $this->getUserData($username);
     if ($userdata) {
         if (auth_verifyPassword($password, $userdata['pass'])) {
             $userdata['username'] = $username;
             msg('You have logged in with username and password');
             return $userdata;
         }
     }
     return false;
 }
开发者ID:voime,项目名称:dokuwiki-autheid,代码行数:18,代码来源:auth.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP auth_visiteur函数代码示例发布时间:2022-05-24
下一篇:
PHP auth_usermanagement函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap