From: <var...@us...> - 2014-09-26 16:39:57
|
Revision: 9126 http://sourceforge.net/p/phpwiki/code/9126 Author: vargenau Date: 2014-09-26 16:39:46 +0000 (Fri, 26 Sep 2014) Log Message: ----------- Remove ENABLE_USER_NEW (always true), remove lib/WikiUser.php Modified Paths: -------------- trunk/SOAP.php trunk/config/config-default.ini trunk/config/config-dist.ini trunk/configurator.php trunk/doc/README.phpwiki-auth trunk/doc/README.security trunk/lib/IniConfig.php trunk/lib/MailNotify.php trunk/lib/PagePerm.php trunk/lib/Request.php trunk/lib/WikiGroup.php trunk/lib/WikiUserNew.php trunk/lib/XmlRpcServer.php trunk/lib/imagecache.php trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/plugin/DebugAuthInfo.php trunk/lib/plugin/UserRatings.php trunk/lib/plugin/WikiAdminUtils.php trunk/themes/default/templates/userprefs.tmpl Removed Paths: ------------- trunk/lib/WikiUser.php Modified: trunk/SOAP.php =================================================================== --- trunk/SOAP.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/SOAP.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -58,11 +58,7 @@ if (!isset($credentials['password'])) $credentials['password'] = ''; global $request; - if (ENABLE_USER_NEW) { - $request->_user = WikiUser($credentials['username']); - } else { - $request->_user = new WikiUser($request, $credentials['username']); - } + $request->_user = WikiUser($credentials['username']); $request->_user->AuthCheck(array('userid' => $credentials['username'], 'passwd' => $credentials['password'])); if (!mayAccessPage($access, $pagename)) Modified: trunk/config/config-default.ini =================================================================== --- trunk/config/config-default.ini 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/config/config-default.ini 2014-09-26 16:39:46 UTC (rev 9126) @@ -2,7 +2,6 @@ ; recent development and debugging features: DEBUG = 0 -ENABLE_USER_NEW = true ENABLE_PAGEPERM = true ENABLE_EDIT_TOOLBAR = true JS_SEARCHREPLACE = true Modified: trunk/config/config-dist.ini =================================================================== --- trunk/config/config-dist.ini 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/config/config-dist.ini 2014-09-26 16:39:46 UTC (rev 9126) @@ -666,11 +666,6 @@ ; Note: May result in crashes on endless recursion USER_AUTH_POLICY = first-only -; Enable the new extended method of handling WikiUsers to support external auth and PAGEPERM. -; Servers with memory-limit problems might want to turn it off. It costs ~300KB -; Default: true -;ENABLE_USER_NEW = false - ; Use access control lists (as in Solaris and Windows NTFS) per page and group, ; not per user for the whole wiki. ; Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/configurator.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -981,9 +981,6 @@ <dd>check the given user - password combination for all methods and return true on the first success.</dd></dl>"); -$properties["ENABLE_USER_NEW"] = - new boolean_define_commented_optional('ENABLE_USER_NEW'); - $properties["ENABLE_PAGEPERM"] = new boolean_define_commented_optional('ENABLE_PAGEPERM'); Modified: trunk/doc/README.phpwiki-auth =================================================================== --- trunk/doc/README.phpwiki-auth 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/doc/README.phpwiki-auth 2014-09-26 16:39:46 UTC (rev 9126) @@ -36,10 +36,6 @@ * USER_AUTH_POLICY default: "old" * $DBAuthParams~[~] see below -Temporarily: -; ENABLE_USER_NEW : This will be removed with the 1.3.9 release. -;: It's just to decide if ~WikiUserNew.php should be loaded instead of the old ~WikiUser.php - ! ALLOW_ANON_USER To establish a COMPLETELY private wiki, such as an internal corporate one Modified: trunk/doc/README.security =================================================================== --- trunk/doc/README.security 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/doc/README.security 2014-09-26 16:39:46 UTC (rev 9126) @@ -25,9 +25,6 @@ webserver. ---- <pre> -; require the new login code - the default -;ENABLE_USER_NEW = true - ; allow ACL based permissions on pages - the default ;ENABLE_PAGEPERM = true Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/IniConfig.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -184,7 +184,7 @@ // List of all valid config options to be define()d which take booleans. $_IC_VALID_BOOL = array - ('ENABLE_USER_NEW', 'ENABLE_PAGEPERM', 'ENABLE_EDIT_TOOLBAR', 'JS_SEARCHREPLACE', + ('ENABLE_PAGEPERM', 'ENABLE_EDIT_TOOLBAR', 'JS_SEARCHREPLACE', 'ENABLE_XHTML_XML', 'ENABLE_DOUBLECLICKEDIT', 'ENABLE_LIVESEARCH', 'ENABLE_ACDROPDOWN', 'USECACHE', 'WIKIDB_NOCACHE_MARKUP', 'ENABLE_REVERSE_DNS', 'ENCRYPTED_PASSWD', 'ZIPDUMP_AUTH', @@ -856,22 +856,12 @@ } } // legacy: - if (!defined('ENABLE_USER_NEW')) define('ENABLE_USER_NEW', true); if (!defined('ALLOW_USER_LOGIN')) define('ALLOW_USER_LOGIN', defined('ALLOW_USER_PASSWORDS') && ALLOW_USER_PASSWORDS); if (!defined('ALLOW_ANON_USER')) define('ALLOW_ANON_USER', true); if (!defined('ALLOW_ANON_EDIT')) define('ALLOW_ANON_EDIT', false); if (!defined('REQUIRE_SIGNIN_BEFORE_EDIT')) define('REQUIRE_SIGNIN_BEFORE_EDIT', !ALLOW_ANON_EDIT); if (!defined('ALLOW_BOGO_LOGIN')) define('ALLOW_BOGO_LOGIN', true); - if (!ENABLE_USER_NEW) { - if (!defined('ALLOW_HTTP_AUTH_LOGIN')) - define('ALLOW_HTTP_AUTH_LOGIN', false); - if (!defined('ALLOW_LDAP_LOGIN')) - define('ALLOW_LDAP_LOGIN', function_exists('ldap_connect') and defined('LDAP_AUTH_HOST')); - if (!defined('ALLOW_IMAP_LOGIN')) - define('ALLOW_IMAP_LOGIN', function_exists('imap_open') and defined('IMAP_AUTH_HOST')); - } - if (ALLOW_USER_LOGIN and !empty($DBAuthParams) and empty($DBAuthParams['auth_dsn'])) { if (isset($DBParams['dsn'])) $DBAuthParams['auth_dsn'] = $DBParams['dsn']; Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/MailNotify.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -97,14 +97,9 @@ $email = ''; } } else { // not current user - if (ENABLE_USER_NEW) { - $u = WikiUser($userid); - $u->getPreferences(); - $prefs = &$u->_prefs; - } else { - $u = new WikiUser($request, $userid); - $prefs = $u->getPreferences(); - } + $u = WikiUser($userid); + $u->getPreferences(); + $prefs = &$u->_prefs; $email = $prefs->get('email'); if ($doverify and !$prefs->get('emailVerified')) { $email = ''; @@ -431,12 +426,8 @@ $request->_user->_level = WIKIAUTH_USER; $request->_prefs->set('emailVerified', true); } else { // not current user - if (ENABLE_USER_NEW) { - $u = WikiUser($userid); - $u->getPreferences(); - } else { - $u = new WikiUser($request, $userid); - } + $u = WikiUser($userid); + $u->getPreferences(); $u->_level = WIKIAUTH_USER; $request->setUser($u); $request->_prefs->set('emailVerified', true); Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/PagePerm.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -412,10 +412,8 @@ if ($group === ACL_ANONYMOUS) return !$user->isSignedIn(); if ($group === ACL_BOGOUSER) - if (ENABLE_USER_NEW) - return isa($user, '_BogoUser') or + return isa($user, '_BogoUser') or (isWikiWord($user->_userid) and $user->_level >= WIKIAUTH_BOGO); - else return isWikiWord($user->UserName()); if ($group === ACL_HASHOMEPAGE) return $user->hasHomePage(); if ($group === ACL_SIGNED) Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/Request.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -506,15 +506,8 @@ unset($val->_group->_request); unset($val->_group->user); } - if (ENABLE_USER_NEW) { - unset($val->_HomePagehandle); - unset($val->_auth_dbi); - } else { - unset($val->_dbi); - unset($val->_authdbi); - unset($val->_homepage); - unset($val->_request); - } + unset($val->_HomePagehandle); + unset($val->_auth_dbi); } return $this->session->set($key, $val); } Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/WikiGroup.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -267,10 +267,7 @@ } /* WikiDB users from prefs (not from users): */ - if (ENABLE_USER_NEW) - $dbi = _PassUser::getAuthDbh(); - else - $dbi = false; + $dbi = _PassUser::getAuthDbh(); if ($dbi and $dbh->getAuthParam('pref_select')) { //get prefs table @@ -632,7 +629,6 @@ E_USER_WARNING); return new GroupNone(); } - // FIXME: This only works with ENABLE_USER_NEW if (empty($this->user)) { // use _PassUser::prepare instead if (isa($request->getUser(), '_PassUser')) Deleted: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/WikiUser.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -1,813 +0,0 @@ -<?php - -// It is anticipated that when userid support is added to phpwiki, -// this object will hold much more information (e-mail, -// home(wiki)page, etc.) about the user. - -// There seems to be no clean way to "log out" a user when using HTTP -// authentication. So we'll hack around this by storing the currently -// logged in username and other state information in a cookie. - -// 2002-09-08 11:44:04 rurban -// Todo: Fix prefs cookie/session handling: -// _userid and _homepage cookie/session vars still hold the -// serialized string. -// If no homepage, fallback to prefs in cookie as in 1.3.3. - -define('WIKIAUTH_FORBIDDEN', -1); // Completely not allowed. -define('WIKIAUTH_ANON', 0); -define('WIKIAUTH_BOGO', 1); // any valid WikiWord is enough -define('WIKIAUTH_USER', 2); // real auth from a database/file/server. - -define('WIKIAUTH_ADMIN', 10); // Wiki Admin -define('WIKIAUTH_UNOBTAINABLE', 100); // Permissions that no user can achieve - -if (!defined('COOKIE_EXPIRATION_DAYS')) define('COOKIE_EXPIRATION_DAYS', 365); -if (!defined('COOKIE_DOMAIN')) define('COOKIE_DOMAIN', '/'); - -$UserPreferences = array( - 'userid' => new _UserPreference(''), // really store this also? - 'passwd' => new _UserPreference(''), - 'email' => new _UserPreference(''), - 'emailVerified' => new _UserPreference_bool(), - 'notifyPages' => new _UserPreference(''), - 'theme' => new _UserPreference_theme(THEME), - 'lang' => new _UserPreference_language(DEFAULT_LANGUAGE), - 'editWidth' => new _UserPreference_int(80, 30, 150), - 'noLinkIcons' => new _UserPreference_bool(), - 'editHeight' => new _UserPreference_int(22, 5, 80), - 'timeOffset' => new _UserPreference_numeric(0, -26, 26), - 'relativeDates' => new _UserPreference_bool(), - 'googleLink' => new _UserPreference_bool(), // 1.3.10 - 'doubleClickEdit' => new _UserPreference_bool(), // 1.3.11 -); - -function WikiUserClassname() -{ - return 'WikiUser'; -} - -function UpgradeUser($olduser, $user) -{ - if (isa($user, 'WikiUser') and isa($olduser, 'WikiUser')) { - // populate the upgraded class with the values from the old object - foreach (get_object_vars($olduser) as $k => $v) { - $user->$k = $v; - } - $GLOBALS['request']->_user = $user; - return $user; - } else { - return false; - } -} - -class WikiUser -{ - public $_userid = false; - public $_level = false; - public $_request, $_dbi, $_authdbi, $_homepage; - public $_authmethod = '', $_authhow = ''; - - /** - * Populates the instance variables and calls $this->_ok() - * to ensure that the parameters are valid. - * @param Request $request - * @param mixed $userid String of username or WikiUser object. - * @param int|bool $authlevel Authorization level. - */ - function __construct(&$request, $userid = false, $authlevel = false) - { - $this->_request =& $request; - $this->_dbi =& $this->_request->getDbh(); - - if (isa($userid, 'WikiUser')) { - $this->_userid = $userid->_userid; - $this->_level = $userid->_level; - } else { - $this->_userid = $userid; - $this->_level = $authlevel; - } - if (!$this->_ok()) { - // Paranoia: if state is at all inconsistent, log out... - $this->_userid = false; - $this->_level = false; - $this->_homepage = false; - $this->_authhow .= ' paranoia logout'; - } - if ($this->_userid) { - $this->_homepage = $this->_dbi->getPage($this->_userid); - } - } - - /** - * Get the string indicating how the user was authenticated. - * - * Get the string indicating how the user was authenticated. - * Does not seem to be set - jbw - * @return string The method of authentication. - */ - function auth_how() - { - return $this->_authhow; - } - - /** - * Invariant - * - * If the WikiUser object has a valid authorization level and the - * userid is a string returns true, else false. - * @return boolean If valid level and username string true, else false - */ - function _ok() - { - if ((in_array($this->_level, array(WIKIAUTH_BOGO, - WIKIAUTH_USER, - WIKIAUTH_ADMIN)) - && - (is_string($this->_userid))) - ) { - return true; - } - return false; - } - - function UserName() - { - return $this->_userid; - } - - function getId() - { - if ($this->_userid) - return $this->_userid; - if (!empty($this->_request)) - return $this->_request->get('REMOTE_ADDR'); - if (empty($this->_request)) - return Request::get('REMOTE_ADDR'); - return ($this->isSignedIn() - ? $this->_userid - : $this->_request->get('REMOTE_ADDR')); // FIXME: globals - } - - function getAuthenticatedId() - { - //assert($this->_request); - return ($this->isAuthenticated() - ? $this->_userid - : $this->_request->get('REMOTE_ADDR')); // FIXME: globals - } - - function isSignedIn() - { - return $this->_level >= WIKIAUTH_BOGO; - } - - function isAuthenticated() - { - return $this->_level >= WIKIAUTH_BOGO; - } - - function isAdmin() - { - return $this->_level == WIKIAUTH_ADMIN; - } - - function hasAuthority($require_level) - { - return $this->_level >= $require_level; - } - - function isValidName($userid = false) - { - if (!$userid) - $userid = $this->_userid; - return preg_match("/^[\w\.@\-]+$/", $userid) and strlen($userid) < 32; - } - - function AuthCheck($postargs) - { - // Normalize args, and extract. - $keys = array('userid', 'passwd', 'require_level', 'login', 'logout', - 'cancel'); - foreach ($keys as $key) - $args[$key] = isset($postargs[$key]) ? $postargs[$key] : false; - extract($args); - $require_level = max(0, min(WIKIAUTH_ADMIN, (int)$require_level)); - - if ($logout) - return new WikiUser($this->_request); // Log out - elseif ($cancel) - return false; // User hit cancel button. - elseif (!$login && !$userid) - return false; // Nothing to do? - - if (!$this->isValidName($userid)) - return _("Invalid username."); - - $authlevel = $this->_pwcheck($userid, $passwd); - if (!$authlevel) - return _("Invalid password or userid."); - elseif ($authlevel < $require_level) - return _("Insufficient permissions."); - - // Successful login. - $user = new WikiUser($this->_request, $userid, $authlevel); - return $user; - } - - function PrintLoginForm(&$request, $args, $fail_message = false, - $separate_page = true) - { - include_once 'lib/Template.php'; - // Call update_locale in case the system's default language is not 'en'. - // (We have no user pref for lang at this point yet, no one is logged in.) - update_locale(DEFAULT_LANGUAGE); - $userid = ''; - $require_level = 0; - extract($args); // fixme - - $require_level = max(0, min(WIKIAUTH_ADMIN, (int)$require_level)); - - $pagename = $request->getArg('pagename'); - $login = new Template('login', $request, - compact('pagename', 'userid', 'require_level', - 'fail_message', 'pass_required')); - if ($separate_page) { - $request->discardOutput(); - $page = $request->getPage($pagename); - $revision = $page->getCurrentRevision(); - return GeneratePage($login, _("Sign In"), $revision); - } else { - return $login; - } - } - - /** - * Check password. - */ - function _pwcheck($userid, $passwd) - { - global $WikiNameRegexp; - - if (!empty($userid) && $userid == ADMIN_USER) { - // $this->_authmethod = 'pagedata'; - if (defined('ENCRYPTED_PASSWD') && ENCRYPTED_PASSWD) - if (!empty($passwd) - && crypt($passwd, ADMIN_PASSWD) == ADMIN_PASSWD - ) - return WIKIAUTH_ADMIN; - else - return false; - if (!empty($passwd)) { - if ($passwd == ADMIN_PASSWD) - return WIKIAUTH_ADMIN; - else { - // maybe we forgot to enable ENCRYPTED_PASSWD? - if (function_exists('crypt') - && crypt($passwd, ADMIN_PASSWD) == ADMIN_PASSWD - ) { - trigger_error(_("You forgot to set ENCRYPTED_PASSWD to true. Please update your config/config.ini"), - E_USER_WARNING); - return WIKIAUTH_ADMIN; - } - } - } - return false; - } // HTTP Authentication - elseif (ALLOW_HTTP_AUTH_LOGIN && !empty($PHP_AUTH_USER)) { - // if he ignored the password field, because he is already - // authenticated try the previously given password. - if (empty($passwd)) - $passwd = $PHP_AUTH_PW; - } - - // WikiDB_User DB/File Authentication from $DBAuthParams - // Check if we have the user. If not try other methods. - if (ALLOW_USER_LOGIN) { // && !empty($passwd)) { - if (!$this->isValidName($userid)) { - trigger_error(_("Invalid username."), E_USER_WARNING); - return false; - } - $request = $this->_request; - // first check if the user is known - if ($this->exists($userid)) { - $this->_authmethod = 'pagedata'; - return ($this->checkPassword($passwd)) ? WIKIAUTH_USER : false; - } else { - // else try others such as LDAP authentication: - if (ALLOW_LDAP_LOGIN && defined(LDAP_AUTH_HOST) && !empty($passwd) && !strstr($userid, '*')) { - if ($ldap = ldap_connect(LDAP_AUTH_HOST)) { // must be a valid LDAP server! - $r = @ldap_bind($ldap); // this is an anonymous bind - $st_search = "uid=$userid"; - // Need to set the right root search information. see ../index.php - $sr = ldap_search($ldap, LDAP_BASE_DN, - "$st_search"); - $info = ldap_get_entries($ldap, $sr); // there may be more hits with this userid. try every - for ($i = 0; $i < $info["count"]; $i++) { - $dn = $info[$i]["dn"]; - // The password is still plain text. - if ($r = @ldap_bind($ldap, $dn, $passwd)) { - // ldap_bind will return TRUE if everything matches - ldap_close($ldap); - $this->_authmethod = 'LDAP'; - return WIKIAUTH_USER; - } - } - } else { - trigger_error("Unable to connect to LDAP server " - . LDAP_AUTH_HOST, E_USER_WARNING); - } - } - // imap authentication. added by limako - if (ALLOW_IMAP_LOGIN && !empty($passwd)) { - $mbox = @imap_open("{" . IMAP_AUTH_HOST . "}INBOX", - $userid, $passwd, OP_HALFOPEN); - if ($mbox) { - imap_close($mbox); - $this->_authmethod = 'IMAP'; - return WIKIAUTH_USER; - } - } - } - } - if (ALLOW_BOGO_LOGIN - && preg_match('/\A' . $WikiNameRegexp . '\z/', $userid) - ) { - $this->_authmethod = 'BOGO'; - return WIKIAUTH_BOGO; - } - return false; - } - - // Todo: try our WikiDB backends. - function getPreferences() - { - // Restore saved preferences. - - // I'd rather prefer only to store the UserId in the cookie or - // session, and get the preferences from the db or page. - if (isset($this->_request)) { - if (!($prefs = $this->_request->getCookieVar('WIKI_PREFS2'))) - $prefs = $this->_request->getSessionVar('wiki_prefs'); - } - - //if (!$this->_userid && !empty($GLOBALS['HTTP_COOKIE_VARS']['WIKI_ID'])) { - // $this->_userid = $GLOBALS['HTTP_COOKIE_VARS']['WIKI_ID']; - //} - - // before we get his prefs we should check if he is signed in - if (USE_PREFS_IN_PAGE && $this->homePage()) { // in page metadata - // old array - if ($pref = $this->_homepage->get('pref')) { - //trigger_error("pref=".$pref);//debugging - $prefs = unserialize($pref); - } - } - return new UserPreferences($prefs); - } - - // No cookies anymore for all prefs, only the userid. PHP creates - // a session cookie in memory, which is much more efficient, - // but not persistent. Get persistency with a homepage or DB Prefs - // - // Return the number of changed entries - function setPreferences($prefs, $id_only = false) - { - if (!is_object($prefs)) { - $prefs = new UserPreferences($prefs); - } - // update the session and id - $this->_request->setSessionVar('wiki_prefs', $prefs); - // $this->_request->setCookieVar('WIKI_PREFS2', $this->_prefs, 365); - // simple unpacked cookie - if ($this->_userid) setcookie(getCookieName(), $this->_userid, 365, '/'); - - // We must ensure that any password is encrypted. - // We don't need any plaintext password. - if (!$id_only) { - if ($this->isSignedIn()) { - if ($this->isAdmin()) - $prefs->set('passwd', ''); - // already stored in config/config.ini, and it might be - // plaintext! well oh well - if ($homepage = $this->homePage()) { - // check for page revision 0 - if (!$this->_dbi->isWikiPage($this->_userid)) { - trigger_error(_("Your home page has not been created yet so your preferences cannot not be saved."), - E_USER_WARNING); - } else { - if ($this->isAdmin() || !$homepage->get('locked')) { - $homepage->set('pref', serialize($prefs->_prefs)); - return sizeof($prefs->_prefs); - } else { - // An "empty" page could still be - // intentionally locked by admin to - // prevent its creation. - // - // FIXME: This permission situation should - // probably be handled by the DB backend, - // once the new WikiUser code has been - // implemented. - trigger_error(_("Your home page is locked so your preferences cannot not be saved.") - . " " . _("Please contact your PhpWiki administrator for assistance."), - E_USER_WARNING); - } - } - } else { - trigger_error("No homepage for user found. Creating one...", - E_USER_WARNING); - $this->createHomepage($prefs); - //$homepage->set('pref', serialize($prefs->_prefs)); - return sizeof($prefs->_prefs); - } - } else { - trigger_error("you must be signed in", E_USER_WARNING); - } - } - return 0; - } - - // check for homepage with user flag. - // can be overriden from the auth backends - function exists() - { - $homepage = $this->homePage(); - return ($this->_userid && $homepage && $homepage->get('pref')); - } - - // doesn't check for existance!!! hmm. - // how to store metadata in not existing pages? how about versions? - function homePage() - { - if (!$this->_userid) - return false; - if (!empty($this->_homepage)) { - return $this->_homepage; - } else { - if (empty($this->_dbi)) { - if (DEBUG) printSimpleTrace(debug_backtrace()); - } else { - $this->_homepage = $this->_dbi->getPage($this->_userid); - } - return $this->_homepage; - } - } - - function hasHomePage() - { - return !$this->homePage(); - } - - // create user by checking his homepage - function createUser($pref, $createDefaultHomepage = true) - { - if ($this->exists()) - return; - if ($createDefaultHomepage) { - $this->createHomepage($pref); - } else { - // empty page - include 'lib/loadsave.php'; - $pageinfo = array('pagedata' => array('pref' => serialize($pref->_pref)), - 'versiondata' => array('author' => $this->_userid), - 'pagename' => $this->_userid, - 'content' => _('CategoryHomepage')); - SavePage($this->_request, $pageinfo, false, false); - } - $this->setPreferences($pref); - } - - // create user and default user homepage - function createHomepage($pref) - { - $pagename = $this->_userid; - include 'lib/loadsave.php'; - - // create default homepage: - // properly expanded template and the pref metadata - $template = Template('homepage.tmpl', $this->_request); - $text = $template->getExpansion(); - $pageinfo = array('pagedata' => array('pref' => serialize($pref->_pref)), - 'versiondata' => array('author' => $this->_userid), - 'pagename' => $pagename, - 'content' => $text); - SavePage($this->_request, $pageinfo, false, false); - - // create Calendar - $pagename = $this->_userid . SUBPAGE_SEPARATOR . _('Calendar'); - if (!isWikiPage($pagename)) { - $pageinfo = array('pagedata' => array(), - 'versiondata' => array('author' => $this->_userid), - 'pagename' => $pagename, - 'content' => "<?plugin Calendar ?>\n"); - SavePage($this->_request, $pageinfo, false, false); - } - - // create Preferences - $pagename = $this->_userid . SUBPAGE_SEPARATOR . _('Preferences'); - if (!isWikiPage($pagename)) { - $pageinfo = array('pagedata' => array(), - 'versiondata' => array('author' => $this->_userid), - 'pagename' => $pagename, - 'content' => "<?plugin UserPreferences ?>\n"); - SavePage($this->_request, $pageinfo, false, false); - } - } - - function tryAuthBackends() - { - return ''; // crypt('') will never be '' - } - - // Auth backends must store the crypted password where? - // Not in the preferences. - function checkPassword($passwd) - { - $prefs = $this->getPreferences(); - $stored_passwd = $prefs->get('passwd'); // crypted - if (empty($prefs->_prefs['passwd'])) // not stored in the page - // allow empty passwords? At least store a '*' then. - // try other backend. hmm. - $stored_passwd = $this->tryAuthBackends($this->_userid); - if (empty($stored_passwd)) { - trigger_error(sprintf(_("Old UserPage %s without stored password updated with empty password. Set a password in your UserPreferences."), - $this->_userid), E_USER_NOTICE); - $prefs->set('passwd', '*'); - return true; - } - if ($stored_passwd == '*') - return true; - if (!empty($passwd) - && crypt($passwd, $stored_passwd) == $stored_passwd - ) - return true; - else - return false; - } - - function changePassword($newpasswd, $passwd2 = false) - { - if (!$this->mayChangePass()) { - trigger_error(sprintf("Attempt to change an external password for “%s”. Not allowed!", - $this->_userid), E_USER_ERROR); - return false; - } - if ($passwd2 && $passwd2 != $newpasswd) { - trigger_error("The second password must be the same as the first to change it", - E_USER_ERROR); - return false; - } - if (!$this->isAuthenticated()) return false; - - $prefs = $this->getPreferences(); - if (ENCRYPTED_PASSWD) - $prefs->set('passwd', crypt($newpasswd)); - else - $prefs->set('passwd', $newpasswd); - $this->setPreferences($prefs); - return true; - } - - function mayChangePass() - { - // on external DBAuth maybe. on IMAP or LDAP not - // on internal DBAuth yes - if (in_array($this->_authmethod, array('IMAP', 'LDAP'))) - return false; - if ($this->isAdmin()) - return false; - if ($this->_authmethod == 'pagedata') - return true; - if ($this->_authmethod == 'authdb') - return true; - } -} - -// create user and default user homepage -// FIXME: delete this, not used? -/* -function createUser ($userid, $pref) { - global $request; - $user = new WikiUser ($request, $userid); - $user->createUser($pref); -} -*/ - -class _UserPreference -{ - function _UserPreference($default_value) - { - $this->default_value = $default_value; - } - - function sanify($value) - { - return (string)$value; - } - - function update($value) - { - } -} - -class _UserPreference_numeric - extends _UserPreference -{ - function __construct($default, $minval = false, $maxval = false) - { - parent::__construct((double)$default); - $this->_minval = (double)$minval; - $this->_maxval = (double)$maxval; - } - - function sanify($value) - { - $value = (double)$value; - if ($this->_minval !== false && $value < $this->_minval) - $value = $this->_minval; - if ($this->_maxval !== false && $value > $this->_maxval) - $value = $this->_maxval; - return $value; - } -} - -class _UserPreference_int - extends _UserPreference_numeric -{ - function __construct($default, $minval = false, $maxval = false) - { - parent::__construct((int)$default, (int)$minval, (int)$maxval); - } - - function sanify($value) - { - return (int)parent::sanify((int)$value); - } -} - -class _UserPreference_bool - extends _UserPreference -{ - function __construct($default = false) - { - parent::__construct((bool)$default); - } - - function sanify($value) - { - if (is_array($value)) { - /* This allows for constructs like: - * - * <input type="hidden" name="pref[boolPref][]" value="0" /> - * <input type="checkbox" name="pref[boolPref][]" value="1" /> - * - * (If the checkbox is not checked, only the hidden input - * gets sent. If the checkbox is sent, both inputs get - * sent.) - */ - foreach ($value as $val) { - if ($val) - return true; - } - return false; - } - return (bool)$value; - } -} - -class _UserPreference_language - extends _UserPreference -{ - function __construct($default = DEFAULT_LANGUAGE) - { - parent::__construct($default); - } - - // FIXME: check for valid locale - function sanify($value) - { - // Revert to DEFAULT_LANGUAGE if user does not specify - // language in UserPreferences or chooses <system language>. - if ($value == '' or empty($value)) - $value = DEFAULT_LANGUAGE; - - return (string)$value; - } -} - -class _UserPreference_theme - extends _UserPreference -{ - function __construct($default = THEME) - { - parent::__construct($default); - } - - function sanify($value) - { - if (findFile($this->_themefile($value), true)) - return $value; - return $this->default_value; - } - - function update($newvalue) - { - global $WikiTheme; - include_once($this->_themefile($newvalue)); - if (empty($WikiTheme)) - include_once($this->_themefile(THEME)); - } - - function _themefile($theme) - { - return "themes/$theme/themeinfo.php"; - } -} - -// don't save default preferences for efficiency. -class UserPreferences -{ - function UserPreferences($saved_prefs = false) - { - $this->_prefs = array(); - - if (isa($saved_prefs, 'UserPreferences') && $saved_prefs->_prefs) { - foreach ($saved_prefs->_prefs as $name => $value) - $this->set($name, $value); - } elseif (is_array($saved_prefs)) { - foreach ($saved_prefs as $name => $value) - $this->set($name, $value); - } - } - - function _getPref($name) - { - global $UserPreferences; - if (!isset($UserPreferences[$name])) { - if ($name == 'passwd2') return false; - trigger_error("$name: unknown preference", E_USER_NOTICE); - return false; - } - return $UserPreferences[$name]; - } - - function get($name) - { - if (isset($this->_prefs[$name])) - return $this->_prefs[$name]; - if (!($pref = $this->_getPref($name))) - return false; - return $pref->default_value; - } - - function set($name, $value) - { - if (!($pref = $this->_getPref($name))) - return false; - - $newvalue = $pref->sanify($value); - $oldvalue = $this->get($name); - - // update on changes - if ($newvalue != $oldvalue) - $pref->update($newvalue); - - // don't set default values to save space (in cookies, db and - // sesssion) - if ($value == $pref->default_value) - unset($this->_prefs[$name]); - else - $this->_prefs[$name] = $newvalue; - } - - function pack($nonpacked) - { - return serialize($nonpacked); - } - - function unpack($packed) - { - if (!$packed) - return false; - if (substr($packed, 0, 2) == "O:") { - // Looks like a serialized object - return unserialize($packed); - } - //trigger_error("DEBUG: Can't unpack bad UserPreferences", - //E_USER_WARNING); - return false; - } - - function hash() - { - return wikihash($this->_prefs); - } -} - -// Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil -// End: Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/WikiUserNew.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -60,7 +60,6 @@ * * Random architectural notes, sorted by date: * 2004-01-25 rurban - * Test it by defining ENABLE_USER_NEW in config/config.ini * 1) Now a ForbiddenUser is returned instead of false. * 2) Previously ALLOW_ANON_USER = false meant that anon users cannot edit, * but may browse. Now with ALLOW_ANON_USER = false he may not browse, Modified: trunk/lib/XmlRpcServer.php =================================================================== --- trunk/lib/XmlRpcServer.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/XmlRpcServer.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -445,12 +445,7 @@ $userid = $_ENV['REMOTE_ADDR']; elseif (isset($GLOBALS['REMOTE_ADDR'])) $userid = $GLOBALS['REMOTE_ADDR']; } - - if (ENABLE_USER_NEW) { - return WikiUser($userid); - } else { - return new WikiUser($request, $userid); - } + return WikiUser($userid); } function putPage($params) Modified: trunk/lib/imagecache.php =================================================================== --- trunk/lib/imagecache.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/imagecache.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -29,10 +29,8 @@ include_once 'lib/config.php'; require_once(dirname(__FILE__) . "/stdlib.php"); require_once 'lib/Request.php'; -if (ENABLE_USER_NEW) require_once("lib/WikiUserNew.php"); -else require_once("lib/WikiUser.php"); +require_once("lib/WikiUserNew.php"); require_once 'lib/WikiDB.php'; - require_once 'lib/WikiPluginCached.php'; // ----------------------------------------------------------------------- @@ -75,7 +73,7 @@ if ($user = $request->getSessionVar('wiki_user')) { $request->_user = $user; $request->_user->_authhow = 'session'; - return ENABLE_USER_NEW ? $user->UserName() : $request->_user; + return $user->UserName(); } if ($userid = $request->getCookieVar(getCookieName())) { if (!empty($userid) and substr($userid, 0, 2) != 's:') { @@ -100,13 +98,8 @@ $request->setArg('pagename', deducePagename($request)); $pagename = $request->getArg('pagename'); $request->_dbi = WikiDB::open($GLOBALS['DBParams']); - if (ENABLE_USER_NEW) { - $request->_user = new _AnonUser(); - $request->_prefs =& $request->_user->_prefs; - } else { - $request->_user = new WikiUser($request); - $request->_prefs = new UserPreferences(); - } + $request->_user = new _AnonUser(); + $request->_prefs =& $request->_user->_prefs; // Enable the output of most of the warning messages. // The warnings will screw up zip files and setpref though. Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/loadsave.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -1484,12 +1484,8 @@ // This really needs to be cleaned up... // (I'm working on it.) $real_user = $request->_user; - if (ENABLE_USER_NEW) - $request->_user = new _BogoUser(ADMIN_USER); + $request->_user = new _BogoUser(ADMIN_USER); - else - $request->_user = new WikiUser($request, ADMIN_USER, WIKIAUTH_BOGO); - StartLoadDump($request, _("Loading up virgin wiki")); $pgsrc = FindLocalizedFile(WIKI_PGSRC); Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/main.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -28,10 +28,7 @@ require_once(dirname(__FILE__) . "/stdlib.php"); require_once 'lib/Request.php'; require_once 'lib/WikiDB.php'; -if (ENABLE_USER_NEW) - require_once 'lib/WikiUserNew.php'; -else - require_once 'lib/WikiUser.php'; +require_once 'lib/WikiUserNew.php'; require_once 'lib/WikiGroup.php'; if (ENABLE_PAGEPERM) require_once 'lib/PagePerm.php'; @@ -61,30 +58,28 @@ // force our local copy, until the pear version is fixed. include_once(dirname(__FILE__) . "/pear/File_Passwd.php"); } - if (ENABLE_USER_NEW) { - // Preload all necessary userclasses. Otherwise session => __PHP_Incomplete_Class_Name - // There's no way to demand-load it later. This way it's much slower, but needs slightly - // less memory than loading all. - if (ALLOW_BOGO_LOGIN) - include_once 'lib/WikiUser/BogoLogin.php'; - // UserPreferences POST Update doesn't reach this. - foreach ($GLOBALS['USER_AUTH_ORDER'] as $method) { - include_once("lib/WikiUser/$method.php"); - if ($method == 'Db') - switch (DATABASE_TYPE) { - case 'SQL' : - include_once 'lib/WikiUser/PearDb.php'; - break; - case 'ADODB': - include_once 'lib/WikiUser/AdoDb.php'; - break; - case 'PDO' : - include_once 'lib/WikiUser/PdoDb.php'; - break; - } - } - unset($method); + // Preload all necessary userclasses. Otherwise session => __PHP_Incomplete_Class_Name + // There's no way to demand-load it later. This way it's much slower, but needs slightly + // less memory than loading all. + if (ALLOW_BOGO_LOGIN) + include_once 'lib/WikiUser/BogoLogin.php'; + // UserPreferences POST Update doesn't reach this. + foreach ($GLOBALS['USER_AUTH_ORDER'] as $method) { + include_once("lib/WikiUser/$method.php"); + if ($method == 'Db') + switch (DATABASE_TYPE) { + case 'SQL' : + include_once 'lib/WikiUser/PearDb.php'; + break; + case 'ADODB': + include_once 'lib/WikiUser/AdoDb.php'; + break; + case 'PDO' : + include_once 'lib/WikiUser/PdoDb.php'; + break; + } } + unset($method); if (USE_DB_SESSION) { include_once 'lib/DbSession.php'; $dbi =& $this->_dbi; @@ -116,52 +111,47 @@ // Restore auth state. This doesn't check for proper authorization! $userid = $this->_deduceUsername(); - if (ENABLE_USER_NEW) { - if (isset($this->_user) and - !empty($this->_user->_authhow) and + if (isset($this->_user) and + !empty($this->_user->_authhow) and $this->_user->_authhow == 'session' ) { - // users might switch in a session between the two objects. - // restore old auth level here or in updateAuthAndPrefs? - //$user = $this->getSessionVar('wiki_user'); - // revive db handle, because these don't survive sessions - if (isset($this->_user) and - (!isa($this->_user, WikiUserClassname()) - or (strtolower(get_class($this->_user)) == '_passuser') - or (strtolower(get_class($this->_user)) == '_fusionforgepassuser')) - ) { - $this->_user = WikiUser($userid, $this->_user->_prefs); - } - // revive other db handle - if (isset($this->_user->_prefs->_method) - and ($this->_user->_prefs->_method == 'SQL' - or $this->_user->_prefs->_method == 'ADODB' - or $this->_user->_prefs->_method == 'PDO' - or $this->_user->_prefs->_method == 'HomePage') - ) { - $this->_user->_HomePagehandle = $this->getPage($userid); - } - // need to update the lockfile filehandle - if (isa($this->_user, '_FilePassUser') - and $this->_user->_file->lockfile - and !$this->_user->_file->fplock - ) { - //$level = $this->_user->_level; - $this->_user = UpgradeUser($this->_user, - new _FilePassUser($userid, - $this->_user->_prefs, - $this->_user->_file->filename)); - //$this->_user->_level = $level; - } - $this->_prefs = & $this->_user->_prefs; - } else { - $user = WikiUser($userid); - $this->_user = & $user; - $this->_prefs = & $this->_user->_prefs; + // users might switch in a session between the two objects. + // restore old auth level here or in updateAuthAndPrefs? + //$user = $this->getSessionVar('wiki_user'); + // revive db handle, because these don't survive sessions + if (isset($this->_user) and + (!isa($this->_user, WikiUserClassname()) + or (strtolower(get_class($this->_user)) == '_passuser') + or (strtolower(get_class($this->_user)) == '_fusionforgepassuser')) + ) { + $this->_user = WikiUser($userid, $this->_user->_prefs); } + // revive other db handle + if (isset($this->_user->_prefs->_method) + and ($this->_user->_prefs->_method == 'SQL' + or $this->_user->_prefs->_method == 'ADODB' + or $this->_user->_prefs->_method == 'PDO' + or $this->_user->_prefs->_method == 'HomePage') + ) { + $this->_user->_HomePagehandle = $this->getPage($userid); + } + // need to update the lockfile filehandle + if (isa($this->_user, '_FilePassUser') + and $this->_user->_file->lockfile + and !$this->_user->_file->fplock + ) { + //$level = $this->_user->_level; + $this->_user = UpgradeUser($this->_user, + new _FilePassUser($userid, + $this->_user->_prefs, + $this->_user->_file->filename)); + //$this->_user->_level = $level; + } + $this->_prefs = & $this->_user->_prefs; } else { - $this->_user = new WikiUser($this, $userid); - $this->_prefs = $this->_user->getPreferences(); + $user = WikiUser($userid); + $this->_user = & $user; + $this->_prefs = & $this->_user->_prefs; } } @@ -440,16 +430,11 @@ */ private function _signIn($userid) { - if (ENABLE_USER_NEW) { - if (!$this->_user) - $this->_user = new _BogoUser($userid); - // FIXME: is this always false? shouldn't we try passuser first? - if (!$this->_user) - $this->_user = new _PassUser($userid); - } else { - if (!$this->_user) - $this->_user = new WikiUser($this, $userid); - } + if (!$this->_user) + $this->_user = new _BogoUser($userid); + // FIXME: is this always false? shouldn't we try passuser first? + if (!$this->_user) + $this->_user = new _PassUser($userid); $user = $this->_user->AuthCheck(array('userid' => $userid)); if (isa($user, WikiUserClassname())) { $this->_setUser($user); // success! @@ -477,12 +462,6 @@ $this->setSessionVar('wiki_user', $user); $this->_prefs->set('userid', $isSignedIn ? $user->getId() : ''); - if (!ENABLE_USER_NEW) { - if (empty($this->_user->_request)) - $this->_user->_request =& $this; - if (empty($this->_user->_dbi)) - $this->_user->_dbi =& $this->_dbi; - } $this->initializeTheme($isSignedIn ? 'login' : 'logout'); define('MAIN_setUser', true); } @@ -1002,7 +981,7 @@ } elseif (isa($user, WikiUserClassname())) { $this->_user = $user; $this->_user->_authhow = 'session'; - return ENABLE_USER_NEW ? $user->UserName() : $this->_user; + return $user->UserName(); } } Modified: trunk/lib/plugin/DebugAuthInfo.php =================================================================== --- trunk/lib/plugin/DebugAuthInfo.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/plugin/DebugAuthInfo.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -60,7 +60,7 @@ $table = HTML::table(array('class' => 'bordered')); $table->pushContent($this->show_hash("AUTH DEFINES", $this->buildConstHash( - array("ENABLE_USER_NEW", "ALLOW_ANON_USER", + array("ALLOW_ANON_USER", "ALLOW_ANON_EDIT", "ALLOW_BOGO_LOGIN", "REQUIRE_SIGNIN_BEFORE_EDIT", "ALLOW_USER_PASSWORDS", "PASSWORD_LENGTH_MINIMUM", "USE_DB_SESSION")))); @@ -102,20 +102,18 @@ } } $table->pushContent($this->show_hash("User: Object of " . get_class($user), $userdata)); - if (ENABLE_USER_NEW) { - $group = &$request->getGroup(); - $groups = $group->getAllGroupsIn(); - $groupdata = obj2hash($group, array('_dbi', '_request', 'password', 'passwd')); - unset($groupdata['request']); - $table->pushContent($this->show_hash("Group: Object of " . get_class($group), $groupdata)); - $groups = $group->getAllGroupsIn(); - $groupdata = array('getAllGroupsIn' => $groups); - foreach ($groups as $g) { - $groupdata["getMembersOf($g)"] = $group->getMembersOf($g); - $groupdata["isMember($g)"] = $group->isMember($g); - } - $table->pushContent($this->show_hash("Group Methods: ", $groupdata)); + $group = &$request->getGroup(); + $groups = $group->getAllGroupsIn(); + $groupdata = obj2hash($group, array('_dbi', '_request', 'password', 'passwd')); + unset($groupdata['request']); + $table->pushContent($this->show_hash("Group: Object of " . get_class($group), $groupdata)); + $groups = $group->getAllGroupsIn(); + $groupdata = array('getAllGroupsIn' => $groups); + foreach ($groups as $g) { + $groupdata["getMembersOf($g)"] = $group->getMembersOf($g); + $groupdata["isMember($g)"] = $group->isMember($g); } + $table->pushContent($this->show_hash("Group Methods: ", $groupdata)); $html->pushContent($table); } return $html; Modified: trunk/lib/plugin/UserRatings.php =================================================================== --- trunk/lib/plugin/UserRatings.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/plugin/UserRatings.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -23,12 +23,8 @@ require_once 'lib/PageList.php'; require_once 'lib/wikilens/Buddy.php'; require_once 'lib/wikilens/PageListColumns.php'; +require_once 'lib/WikiUserNew.php'; -if (ENABLE_USER_NEW) - require_once 'lib/WikiUserNew.php'; -else - require_once 'lib/WikiUser.php'; - /** * Show a user's ratings in a table, using PageList. * Usage: Modified: trunk/lib/plugin/WikiAdminUtils.php =================================================================== --- trunk/lib/plugin/WikiAdminUtils.php 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/lib/plugin/WikiAdminUtils.php 2014-09-26 16:39:46 UTC (rev 9126) @@ -249,10 +249,7 @@ $allusers = array(); } foreach ($allusers as $username) { - if (ENABLE_USER_NEW) - $user = WikiUser($username); - else - $user = new WikiUser($request, $username); + $user = WikiUser($username); $prefs = $user->getPreferences(); if ($prefs->get('email')) { if (!$prefs->get('userid')) Modified: trunk/themes/default/templates/userprefs.tmpl =================================================================== --- trunk/themes/default/templates/userprefs.tmpl 2014-09-26 14:39:38 UTC (rev 9125) +++ trunk/themes/default/templates/userprefs.tmpl 2014-09-26 16:39:46 UTC (rev 9126) @@ -123,14 +123,14 @@ <?php } else { $fill = " "; // See also plugin DebugAuthInfo - $authmethod = ENABLE_USER_NEW ? @$user->_authmethod : @$user->auth_how; + $authmethod = @$user->_authmethod; ?> <?php echo HTML::pre(sprintf("%12s: [% 10s] %s\n",_("UserId"),$pref->get('userid'), " from " . $authmethod), sprintf("%12s: [% 10s] %16s: [% 10s] | %8s: [%2s]\n","getId",$user->getId(),"getAuthenticatedId",$user->getAuthenticatedId(),"isSignedIn", $user->isSignedIn()), //sprintf("%12s: [% 10s]\n",_("Password"),empty($pref->get('passwd')) ? _("<empty>") : _("<not empty>")), sprintf("%12s: [% 10s] %15s: [% 8s]\n", _("Auth Level"),$user->_level,_("Auth Method"),$authmethod), - sprintf("%12s: [% 10s]\n",_("HomePage"),$user->hasHomePage() ? (ENABLE_USER_NEW ? $user->_HomePagehandle->_pagename : $user->_homepage->_pagename ) : ''), + sprintf("%12s: [% 10s]\n",_("HomePage"),$user->hasHomePage() ? $user->_HomePagehandle->_pagename : ''), sprintf("%12s: [% 10s]\n",_("E-mail"),$pref->get('email')), //sprintf("%12s: [% 10s]\n",_("Notify"),$pref->get('notifyPages')), sprintf("%12s: [% 10s] %16s: [% 10s] \n",_("Theme"), $pref->get('theme'), _("Current theme"),$WikiTheme->_name), @@ -150,7 +150,6 @@ <td></td></tr> <?php } ?> -<?php if (ENABLE_USER_NEW) { ?> <tr><td colspan="2"><h2><?php echo _("E-mail")?></h2></td></tr> <tr><td> @@ -210,8 +209,6 @@ </td> </tr> -<?php } ?> - <tr><td colspan="2"><h2><?php echo _("Appearance")?></h2></td></tr> <tr><td colspan="2"><?php echo _("Here you can override site-specific default values.") ?></td></tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |