3 /* Copyright (C) 2004 ReiniUrban
4 * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2)
7 /** Without stored password. A _BogoLoginPassUser with password
8 * is automatically upgraded to a PersonalPagePassUser.
10 class _BogoLoginPassUser extends _PassUser {
12 var $_authmethod = 'BogoLogin';
14 function userExists() {
15 if (isWikiWord($this->_userid)) {
16 $this->_level = WIKIAUTH_BOGO;
19 $this->_level = WIKIAUTH_ANON;
24 /** A BogoLoginUser requires no password at all
25 * But if there's one stored, we override it with the PersonalPagePassUser instead
27 function checkPass($submitted_password) {
28 if ($this->_prefs->get('passwd')) {
29 if (isset($this->_prefs->_method) and $this->_prefs->_method == 'HomePage') {
30 $user = new _PersonalPagePassUser($this->_userid, $this->_prefs);
31 if ($user->checkPass($submitted_password)) {
32 if (!check_php_version(5))
33 eval("\$this = \$user;");
34 // /*PHP5 patch*/$this = $user;
35 $user = UpgradeUser($this, $user);
36 $this->_level = WIKIAUTH_USER;
39 $this->_level = WIKIAUTH_ANON;
43 $stored_password = $this->_prefs->get('passwd');
44 if ($this->_checkPass($submitted_password, $stored_password)) {
45 $this->_level = WIKIAUTH_USER;
47 } elseif (USER_AUTH_POLICY === 'strict') {
48 $this->_level = WIKIAUTH_FORBIDDEN;
51 return $this->_tryNextPass($submitted_password);
55 if (isWikiWord($this->_userid)) {
56 $this->_level = WIKIAUTH_BOGO;
58 $this->_level = WIKIAUTH_ANON;
68 // c-hanging-comment-ender-p: nil
69 // indent-tabs-mode: nil