2 rcs_id('$Id: PersonalPage.php,v 1.5 2005-02-14 12:28:27 rurban Exp $');
3 /* Copyright (C) 2004 ReiniUrban
4 * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2)
8 * This class is only to simplify the auth method dispatcher.
9 * It inherits almost all all methods from _PassUser.
11 class _PersonalPagePassUser
14 var $_authmethod = 'PersonalPage';
16 function userExists() {
17 return $this->_HomePagehandle and $this->_HomePagehandle->exists();
20 /** A PersonalPagePassUser requires PASSWORD_LENGTH_MINIMUM.
21 * BUT if the user already has a homepage with an empty password
22 * stored, allow login but warn him to change it.
24 function checkPass($submitted_password) {
25 if ($this->userExists()) {
26 $stored_password = $this->_prefs->get('passwd');
27 if (empty($stored_password)) {
28 if (PASSWORD_LENGTH_MINIMUM > 0) {
29 trigger_error(sprintf(
30 _("PersonalPage login method:")."\n".
31 _("You stored an empty password in your '%s' page.")."\n".
32 _("Your access permissions are only for a BogoUser.")."\n".
33 _("Please set a password in UserPreferences."),
34 $this->_userid), E_USER_WARNING);
35 $this->_level = WIKIAUTH_BOGO;
37 if (!empty($submitted_password))
38 trigger_error(sprintf(
39 _("PersonalPage login method:")."\n".
40 _("You stored an empty password in your '%s' page.")."\n".
41 _("Given password ignored.")."\n".
42 _("Please set a password in UserPreferences."),
43 $this->_userid), E_USER_WARNING);
44 $this->_level = WIKIAUTH_USER;
48 if ($this->_checkPass($submitted_password, $stored_password))
49 return ($this->_level = WIKIAUTH_USER);
50 return _PassUser::checkPass($submitted_password);
57 // $Log: not supported by cvs2svn $
58 // Revision 1.4 2004/12/26 17:11:17 rurban
61 // Revision 1.3 2004/11/05 22:09:39 rurban
62 // empty passwd PersonalPage case
64 // Revision 1.2 2004/11/05 20:53:36 rurban
65 // login cleanup: better debug msg on failing login,
66 // checked password less immediate login (bogo or anon),
67 // checked olduser pref session error,
68 // better PersonalPage without password warning on minimal password length=0
69 // (which is default now)
71 // Revision 1.1 2004/11/01 10:43:58 rurban
72 // seperate PassUser methods into seperate dir (memory usage)
73 // fix WikiUser (old) overlarge data session
74 // remove wikidb arg from various page class methods, use global ->_dbi instead
82 // c-hanging-comment-ender-p: nil
83 // indent-tabs-mode: nil