]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiUser/IMAP.php
required dummy file
[SourceForge/phpwiki.git] / lib / WikiUser / IMAP.php
1 <?php //-*-php-*-
2 rcs_id('$Id: IMAP.php,v 1.1 2004-11-01 10:43:58 rurban Exp $');
3 /* Copyright (C) 2004 $ThePhpWikiProgrammingTeam
4  */
5
6 class _IMAPPassUser
7 extends _PassUser
8 /**
9  * Define the var IMAP_AUTH_HOST in config/config.ini (with port probably)
10  *
11  * Preferences are handled in _PassUser
12  */
13 {
14     function checkPass($submitted_password) {
15         if (!$this->isValidName()) {
16             return $this->_tryNextPass($submitted_password);
17         }
18         $userid = $this->_userid;
19         $mbox = @imap_open( "{" . IMAP_AUTH_HOST . "}",
20                             $userid, $submitted_password, OP_HALFOPEN );
21         if ($mbox) {
22             imap_close($mbox);
23             $this->_authmethod = 'IMAP';
24             $this->_level = WIKIAUTH_USER;
25             return $this->_level;
26         } else {
27             trigger_error(_("Unable to connect to IMAP server "). IMAP_AUTH_HOST, 
28                           E_USER_WARNING);
29         }
30
31         return $this->_tryNextPass($submitted_password);
32     }
33
34     //CHECKME: this will not be okay for the auth policy strict
35     function userExists() {
36         return true;
37
38         if (checkPass($this->_prefs->get('passwd')))
39             return true;
40         return $this->_tryNextUser();
41     }
42
43     function mayChangePass() {
44         return false;
45     }
46 }
47
48 // $Log: not supported by cvs2svn $
49
50 // Local Variables:
51 // mode: php
52 // tab-width: 8
53 // c-basic-offset: 4
54 // c-hanging-comment-ender-p: nil
55 // indent-tabs-mode: nil
56 // End:
57 ?>