4 * Copyright (C) 2004 ReiniUrban
6 * This file is part of PhpWiki.
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.
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.
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
23 /** Without stored password. A _BogoLoginPassUser with password
24 * is automatically upgraded to a PersonalPagePassUser.
26 class _BogoLoginPassUser extends _PassUser {
28 var $_authmethod = 'BogoLogin';
30 function userExists() {
31 if (isWikiWord($this->_userid)) {
32 $this->_level = WIKIAUTH_BOGO;
35 $this->_level = WIKIAUTH_ANON;
40 /** A BogoLoginUser requires no password at all
41 * But if there's one stored, we override it with the PersonalPagePassUser instead
43 function checkPass($submitted_password) {
44 if ($this->_prefs->get('passwd')) {
45 if (isset($this->_prefs->_method) and $this->_prefs->_method == 'HomePage') {
46 $user = new _PersonalPagePassUser($this->_userid, $this->_prefs);
47 if ($user->checkPass($submitted_password)) {
48 if (!check_php_version(5))
49 eval("\$this = \$user;");
50 // /*PHP5 patch*/$this = $user;
51 $user = UpgradeUser($this, $user);
52 $this->_level = WIKIAUTH_USER;
55 $this->_level = WIKIAUTH_ANON;
59 $stored_password = $this->_prefs->get('passwd');
60 if ($this->_checkPass($submitted_password, $stored_password)) {
61 $this->_level = WIKIAUTH_USER;
63 } elseif (USER_AUTH_POLICY === 'strict') {
64 $this->_level = WIKIAUTH_FORBIDDEN;
67 return $this->_tryNextPass($submitted_password);
71 if (isWikiWord($this->_userid)) {
72 $this->_level = WIKIAUTH_BOGO;
74 $this->_level = WIKIAUTH_ANON;
84 // c-hanging-comment-ender-p: nil
85 // indent-tabs-mode: nil