authentication.php
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once("../../config/dmsDefaults.php");
/**
* $Id$
*
* Contains unit test code for authentication classes: lib/authentication
*
* Tests are:
* - creation of document subscription object
* - setting/getting of values
* - storing of object
* - updating of object
* - deletion of object
*
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* @version $Revision$
* @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
* @package tests.authentication
*/
if (checkSession()) {
require_once("$default->owl_fs_root/lib/authentication/DBAuthenticator.inc");
echo "<b>Testing DB searching</b>";
// user attributes to search for
$aAttributes = array ("username", "name", "email", "mobile", "email_notification", "sms_notification");
$oDbAuth = new DBAuthenticator();
$sSearch = "admin";
echo "<ul><li>searching for $sSearch with attributes=<pre>" . arrayToString($aAttributes) . "</pre></li>";
$aResults = $oDbAuth->searchUsers("admin", $aAttributes);
echo "<li><pre>" . arrayToString($aResults) . "</pre></li></ul>";
require_once("$default->owl_fs_root/lib/authentication/LDAPAuthenticator.inc");
echo "<b>Testing LDAP searching</b>";
// user attributes to search for
$aAttributes = array ("dn", "uid", "givenname", "sn", "mail", "mobile");
}
?>