當前位置: 首頁>>代碼示例>>PHP>>正文


PHP jAuth::verifyPassword方法代碼示例

本文整理匯總了PHP中jAuth::verifyPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP jAuth::verifyPassword方法的具體用法?PHP jAuth::verifyPassword怎麽用?PHP jAuth::verifyPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jAuth的用法示例。


在下文中一共展示了jAuth::verifyPassword方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testAll

 public function testAll()
 {
     if ($this->config === null) {
         $this->sendMessage('Ldap plugin for jauth is not tested because there isn\'t configuration.' . ' To test it, you should create and configure an auth_ldap.coord.ini.php file.');
         return;
     }
     for ($i = 1; $i <= NB_USERS_LDAP; $i++) {
         $myUser = jAuth::createUserObject("testldap usr {$i}", "pass{$i}");
         $this->assertTrue($myUser instanceof jAuthUserLDAP);
         jAuth::saveNewUser($myUser);
         $myUserLDAP = jAuth::getUser("testldap usr {$i}");
         $user = "\n            <object class=\"jAuthUserLDAP\">\n                <string property=\"login\" value=\"testldap usr {$i}\" />\n                <string property=\"email\" value=\"\" />\n                <array property=\"cn\">array('testldap usr {$i}')</array>\n                <array property=\"distinguishedName\">array('CN=testldap usr {$i},{$this->config['ldap']['searchBaseDN']}')</array>\n                <array property=\"name\">array('testldap usr {$i}')</array>\n                <string property=\"password\" value=\"\" />\n            </object>\n            ";
         $this->assertComplexIdenticalStr($myUserLDAP, $user);
         $myUser->email = "usr{$i}.testldap@domain.com";
         jAuth::updateUser($myUser);
         $myUserLDAP = jAuth::getUser("testldap usr {$i}");
         $user = "\n            <object>\n                <string property=\"login\" value=\"testldap usr {$i}\" />\n                <array property=\"email\">array('usr{$i}.testldap@domain.com')</array>\n                <array property=\"cn\">array('testldap usr {$i}')</array>\n                <array property=\"distinguishedName\">array('CN=testldap usr {$i},{$this->config['ldap']['searchBaseDN']}')</array>\n                <array property=\"name\">array('testldap usr {$i}')</array>\n                <string property=\"password\" value=\"\" />\n            </object>\n            ";
         $this->assertComplexIdenticalStr($myUserLDAP, $user);
         $this->assertTrue(jAuth::verifyPassword("testldap usr {$i}", "pass{$i}"));
         $this->assertTrue(jAuth::changePassword("testldap usr {$i}", "newpass{$i}"));
     }
     $myUsersLDAP = jAuth::getUserList('testldap usr*');
     $users = "<array>";
     for ($i = 1; $i <= NB_USERS_LDAP; $i++) {
         $users .= "\n            <object>\n                <array property=\"login\">array('testldap usr {$i}')</array>\n                <array property=\"email\">array('usr{$i}.testldap@domain.com')</array>\n                <array property=\"cn\">array('testldap usr {$i}')</array>\n                <array property=\"distinguishedName\">array('CN=testldap usr {$i},{$this->config['ldap']['searchBaseDN']}')</array>\n                <array property=\"name\">array('testldap usr {$i}')</array>\n                <string property=\"password\" value=\"\" />\n            </object>\n            ";
     }
     $users .= "</array>";
     $this->assertComplexIdenticalStr($myUsersLDAP, $users);
     for ($i = 1; $i <= NB_USERS_LDAP; $i++) {
         $this->assertTrue(jAuth::removeUser("testldap usr {$i}"));
     }
     $myUsersLDAP = jAuth::getUserList('testldap usr*');
     $this->assertFalse(count($myUsersLDAP) > 0);
 }
開發者ID:hadrienl,項目名稱:jelix,代碼行數:34,代碼來源:jauth.ldap_api.html.php

示例2: delete

 /**
  * delete a record
  */
 function delete()
 {
     $id = $this->param('id');
     $pwd = $this->param('pwd_confirm');
     $rep = $this->getResponse('redirect');
     if (jAuth::verifyPassword(jAuth::getUserSession()->login, $pwd) == false) {
         jMessage::add(jLocale::get('crud.message.delete.invalid.pwd'), 'error');
         $rep->action = 'default:confirmdelete';
         $rep->params['id'] = $id;
         return $rep;
     }
     if ($id !== null && jAuth::getUserSession()->login != $id) {
         if (jAuth::removeUser($id)) {
             jMessage::add(jLocale::get('crud.message.delete.ok', $id), 'notice');
             $rep->action = 'default:index';
         } else {
             jMessage::add(jLocale::get('crud.message.delete.notok'), 'error');
             $rep->action = 'default:view';
             $rep->params['id'] = $id;
         }
     } else {
         jMessage::add(jLocale::get('crud.message.delete.notok'), 'error');
         $rep->action = 'default:index';
     }
     return $rep;
 }
開發者ID:alienpham,項目名稱:helenekling,代碼行數:29,代碼來源:default.classic.php


注:本文中的jAuth::verifyPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。