]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiUser/EMailConfirm.php
Remove rcs_id
[SourceForge/phpwiki.git] / lib / WikiUser / EMailConfirm.php
1 <?php //-*-php-*-
2 // $Id$
3 /*
4  * Copyright (C) 2006 ReiniUrban
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
19  * along with PhpWiki; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 class _EMailConfirmPassUser
24 extends _PassUser
25 /**
26  * Unconfirmed users have ANON access,
27  * confirmed users are equal to passusers WIKIAUTH_USER.
28  *
29  * Users give their email at registration, phpwiki sends a link per email,
30  * user clicks on url link to verify, user is confirmed.
31  *
32  * Preferences are handled in _PassUser
33  */
34 {
35     // This can only be called from _PassUser, because the parent class
36     // sets the pref methods, before this class is initialized.
37     function _EMailConfirmPassUser($UserName='', $prefs=false, $file='') {
38         if (!$this->_prefs and isa($this, "_EMailPassUser")) {
39             if ($prefs) $this->_prefs = $prefs;
40             if (!isset($this->_prefs->_method))
41               _PassUser::_PassUser($UserName);
42         }
43         $this->_userid = $UserName;
44         return $this;
45     }
46
47     function userExists() {
48         if (!$this->isValidName($this->_userid)) {
49             return $this->_tryNextUser();
50         }
51         $this->_authmethod = 'EMailConfirm';
52         // check the prefs for emailVerified
53         if ($this->_prefs->get('emailVerified'))
54             return true;
55         return $this->_tryNextUser();
56     }
57 }
58
59 // Local Variables:
60 // mode: php
61 // tab-width: 8
62 // c-basic-offset: 4
63 // c-hanging-comment-ender-p: nil
64 // indent-tabs-mode: nil
65 // End:
66 ?>