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 along
19 * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 /** Without stored password. A _BogoLoginPassUser with password
24 * is automatically upgraded to a PersonalPagePassUser.
26 class _BogoLoginPassUser extends _PassUser
29 public $_authmethod = 'BogoLogin';
33 if (isWikiWord($this->_userid)) {
34 $this->_level = WIKIAUTH_BOGO;
37 $this->_level = WIKIAUTH_ANON;
42 /** A BogoLoginUser requires no password at all
43 * But if there's one stored, we override it with the PersonalPagePassUser instead
45 function checkPass($submitted_password)
47 if ($this->_prefs->get('passwd')) {
48 if (isset($this->_prefs->_method) and $this->_prefs->_method == 'HomePage') {
49 $user = new _PersonalPagePassUser($this->_userid, $this->_prefs);
50 if ($user->checkPass($submitted_password)) {
51 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