]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiUser/EMailConfirm.php
Initialize $html
[SourceForge/phpwiki.git] / lib / WikiUser / EMailConfirm.php
1 <?php
2
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 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
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     {
39         if (!$this->_prefs and isa($this, "_EMailPassUser")) {
40             if ($prefs) $this->_prefs = $prefs;
41             if (!isset($this->_prefs->_method))
42                 _PassUser::_PassUser($UserName);
43         }
44         $this->_userid = $UserName;
45         return $this;
46     }
47
48     function userExists()
49     {
50         if (!$this->isValidName($this->_userid)) {
51             return $this->_tryNextUser();
52         }
53         $this->_authmethod = 'EMailConfirm';
54         // check the prefs for emailVerified
55         if ($this->_prefs->get('emailVerified'))
56             return true;
57         return $this->_tryNextUser();
58     }
59 }
60
61 // Local Variables:
62 // mode: php
63 // tab-width: 8
64 // c-basic-offset: 4
65 // c-hanging-comment-ender-p: nil
66 // indent-tabs-mode: nil
67 // End: