]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiUser/EMailConfirm.php
rcs_id no longer makes sense with Subversion global version number
[SourceForge/phpwiki.git] / lib / WikiUser / EMailConfirm.php
1 <?php //-*-php-*-
2 // rcs_id('$Id$');
3 /* Copyright (C) 2006 ReiniUrban
4  * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2)
5  */
6
7 class _EMailConfirmPassUser
8 extends _PassUser
9 /**
10  * Unconfirmed users have ANON access,
11  * confirmed users are equal to passusers WIKIAUTH_USER.
12  *
13  * Users give their email at registration, phpwiki sends a link per email,
14  * user clicks on url link to verify, user is confirmed.
15  *
16  * Preferences are handled in _PassUser
17  */
18 {
19     // This can only be called from _PassUser, because the parent class
20     // sets the pref methods, before this class is initialized.
21     function _EMailConfirmPassUser($UserName='', $prefs=false, $file='') {
22         if (!$this->_prefs and isa($this, "_EMailPassUser")) {
23             if ($prefs) $this->_prefs = $prefs;
24             if (!isset($this->_prefs->_method))
25               _PassUser::_PassUser($UserName);
26         }
27         $this->_userid = $UserName;
28         return $this;
29     }
30
31     function userExists() {
32         if (!$this->isValidName($this->_userid)) {
33             return $this->_tryNextUser();
34         }
35         $this->_authmethod = 'EMailConfirm';
36         // check the prefs for emailVerified
37         if ($this->_prefs->get('emailVerified'))
38             return true;
39         return $this->_tryNextUser();
40     }
41 }
42
43 // Local Variables:
44 // mode: php
45 // tab-width: 8
46 // c-basic-offset: 4
47 // c-hanging-comment-ender-p: nil
48 // indent-tabs-mode: nil
49 // End:
50 ?>