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


PHP auth_verifyPassword函数代码示例

本文整理汇总了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 <andi@splitbrain.org>
  * @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 <andi@splitbrain.org>
  * @author  Matthias Grimm <matthiasgrimm@users.sourceforge.net>
  */
 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;未经允许,请勿转载。