]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiUser/LdapUpper.php
rcs_id no longer makes sense with Subversion global version number
[SourceForge/phpwiki.git] / lib / WikiUser / LdapUpper.php
1 <?php //-*-php-*-
2 // rcs_id('$Id$');
3 /* Copyright (C) 2007,2009 Reini Urban
4  * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2)
5  */
6 include_once("lib/WikiUser/LDAP.php");
7
8 /**
9  * Overrides for LDAP (Windows domain) usernames:
10  *   Search lowercase, but convert it then to uppercase to match the WINDOWS name.
11  * Define the vars LDAP_AUTH_HOST, LDAP_BASE_DN, LDAP_SEARCH_FILTER in config/config.ini
12  * Preferences are handled in _PassUser
13  */
14 class _LdapUpperPassUser
15 extends _LDAPPassUser
16 {
17
18     function checkPass($submitted_password) {
19         return parent::checkPass($submitted_password);
20     }
21
22     function UserName() {
23         if (!empty($this->_userid)) {
24             $this->_userid = trim(strtoupper($this->_userid));
25             if (!empty($this->_HomePagehandle) and is_object($this->_HomePagehandle))
26                 $this->_HomePagehandle->_pagename = $this->_userid;
27             return strtoupper($this->_userid);
28         }
29     }
30
31     function userExists() {
32         // lowercase check and uppercase visibility
33         $this->_userid = trim(strtoupper($this->_userid));
34         return parent::userExists();
35     }
36 }
37
38 // Local Variables:
39 // mode: php
40 // tab-width: 8
41 // c-basic-offset: 4
42 // c-hanging-comment-ender-p: nil
43 // indent-tabs-mode: nil
44 // End:
45 ?>