, Jam Warehouse (Pty) Ltd, South Africa
* @package tests.authentication
*/
if (checkSession()) {
require_once("$default->fileSystemRoot/lib/authentication/DBAuthenticator.inc");
echo "Testing DB searching";
// user attributes to search for
$aAttributes = array ("username", "name", "email", "mobile", "email_notification", "sms_notification");
$oDbAuth = new DBAuthenticator();
$sSearch = "user";
echo "
";
require_once("$default->fileSystemRoot/lib/authentication/LDAPAuthenticator.inc");
echo "Testing LDAP searching";
// user attributes to search for
$aAttributes = array ("dn", "uid", "givenname", "sn", "mail", "mobile");
$oLdapAuth = new LDAPAuthenticator();
$sSearch = "michael";
echo "";
echo "Testing LDAP authentication";
// user credentials to authenticate
$sUserName = "michael"; $sPassword = "pass123";
echo "- Authenticating ($sUserName, $sPassword) : " . ($oLdapAuth->checkPassword($sUserName, $sPassword) ? "true" : "false") . "
";
$sUserName = "rob"; $sPassword = "rob123";
echo "- Authenticating ($sUserName, $sPassword) : " . ($oLdapAuth->checkPassword($sUserName, $sPassword) ? "true" : "false") . "
";
$sUserName = "mukhtar"; $sPassword = "mukhtar123";
echo "- Authenticating ($sUserName, $sPassword) : " . ($oLdapAuth->checkPassword($sUserName, $sPassword) ? "true" : "false") . "
";
}
?>