]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiUser/LdapUpper.php
include [all] Include and file path should be devided with single space. File path...
[SourceForge/phpwiki.git] / lib / WikiUser / LdapUpper.php
1 <?php //-*-php-*-
2
3 /*
4  * Copyright (C) 2007,2009 Reini Urban
5  *
6  * This file is part of PhpWiki.
7  *
8  * PhpWiki is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * PhpWiki is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 include_once 'lib/WikiUser/LDAP.php';
23
24 /**
25  * Overrides for LDAP (Windows domain) usernames:
26  *   Search lowercase, but convert it then to uppercase to match the WINDOWS name.
27  * Define the vars LDAP_AUTH_HOST, LDAP_BASE_DN, LDAP_SEARCH_FILTER in config/config.ini
28  * Preferences are handled in _PassUser
29  */
30 class _LdapUpperPassUser
31 extends _LDAPPassUser
32 {
33
34     function checkPass($submitted_password) {
35         return parent::checkPass($submitted_password);
36     }
37
38     function UserName() {
39         if (!empty($this->_userid)) {
40             $this->_userid = trim(strtoupper($this->_userid));
41             if (!empty($this->_HomePagehandle) and is_object($this->_HomePagehandle))
42                 $this->_HomePagehandle->_pagename = $this->_userid;
43             return strtoupper($this->_userid);
44         }
45     }
46
47     function userExists() {
48         // lowercase check and uppercase visibility
49         $this->_userid = trim(strtoupper($this->_userid));
50         return parent::userExists();
51     }
52 }
53
54 // Local Variables:
55 // mode: php
56 // tab-width: 8
57 // c-basic-offset: 4
58 // c-hanging-comment-ender-p: nil
59 // indent-tabs-mode: nil
60 // End: