本文整理汇总了PHP中jAuth::getUserList方法的典型用法代码示例。如果您正苦于以下问题:PHP jAuth::getUserList方法的具体用法?PHP jAuth::getUserList怎么用?PHP jAuth::getUserList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jAuth
的用法示例。
在下文中一共展示了jAuth::getUserList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}