SourceForge logo
SourceForge logo
Menu

phpwiki-checkins

From: <ru...@us...> - 2009年01月16日 06:26:33
Revision: 6404
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6404&view=rev
Author: rurban
Date: 2009年01月16日 06:26:31 +0000 (2009年1月16日)
Log Message:
-----------
Temp. fix a php-5.2.8 problem reported by Charles Sprickman:
 _PearDbPassUser::_PearDbPassUser() cannot be called statically, assuming 
 $this from incompatible context in /usr/local/www/data/wiki/lib/WikiUserNew.php 
 on line 1118
This is not yet ready.
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年01月15日 10:21:34 UTC (rev 6403)
+++ trunk/lib/WikiUserNew.php	2009年01月16日 06:26:31 UTC (rev 6404)
@@ -1164,18 +1164,18 @@
 	// FIXME: strange why this should be needed...
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/AdoDb.php");
- _AdoDbPassUser::_AdoDbPassUser($this->_userid, $this->_prefs);
- return _AdoDbPassUser::getPreferences();
+ $user = new _AdoDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
 } elseif ($this->_prefs->_method == 'SQL') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PearDb.php");
- _PearDbPassUser::_PearDbPassUser($this->_userid, $this->_prefs);
- return _PearDbPassUser::getPreferences();
+ $user = new _PearDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
 } elseif ($this->_prefs->_method == 'PDO') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PdoDb.php");
- _PdoDbPassUser::_PdoDbPassUser($this->_userid, $this->_prefs);
- return _PdoDbPassUser::getPreferences();
+ $user = new _PdoDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
 }
 }
 
@@ -1202,20 +1202,20 @@
 	// FIXME: strange why this should be needed...
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/AdoDb.php");
- _AdoDbPassUser::_AdoDbPassUser($this->_userid, $prefs);
- return _AdoDbPassUser::setPreferences($prefs, $id_only);
+ $user = new _AdoDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
 }
 elseif ($this->_prefs->_method == 'SQL') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PearDb.php");
- _PearDbPassUser::_PearDbPassUser($this->_userid, $prefs);
- return _PearDbPassUser::setPreferences($prefs, $id_only);
+ $user = new _PearDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
 }
 elseif ($this->_prefs->_method == 'PDO') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PdoDb.php");
- _PdoDbPassUser::_PdoDbPassUser($this->_userid, $prefs);
- return _PdoDbPassUser::setPreferences($prefs, $id_only);
+ $user = new _PdoDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
 }
 }
 if ($updated = _AnonUser::setPreferences($prefs, $id_only)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2009年02月27日 10:18:30
Revision: 6594
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6594&view=rev
Author: vargenau
Date: 2009年02月27日 10:18:23 +0000 (2009年2月27日)
Log Message:
-----------
Remove history
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年02月27日 03:46:53 UTC (rev 6593)
+++ trunk/lib/WikiUserNew.php	2009年02月27日 10:18:23 UTC (rev 6594)
@@ -2217,424 +2217,6 @@
 }
 */
 
-// $Log: not supported by cvs2svn $
-// Revision 1.147 2007年09月15日 12:55:56 rurban
-// Fix Bug#1795420 by Sven Ginka: Use /U in preg_match
-//
-// Revision 1.146 2007年08月25日 18:34:08 rurban
-// add LOGIN_LOG to check possible external auth problems
-//
-// Revision 1.145 2007年06月07日 16:56:27 rurban
-// protect against empty username
-//
-// Revision 1.144 2007年06月01日 06:36:57 rurban
-// allow space in user names. backends should tighten it
-//
-// Revision 1.143 2007年05月24日 18:37:53 rurban
-// silence AdminUser HomePagehandle warning
-//
-// Revision 1.142 2007年05月15日 16:32:34 rurban
-// Refactor class upgrading at ->UserExists
-//
-// Revision 1.141 2007年05月13日 18:31:24 rurban
-// Refactor UpgradeUser. Added EMailHosts
-//
-// Revision 1.140 2006年12月22日 01:20:14 rurban
-// Automatically create a Users homepage, when no SQL method exists
-// not to rely on cookies.
-//
-// Revision 1.139 2006年09月03日 09:55:37 rurban
-// Remove too early and too strict isValidName check in _PassUser. This really should be done in
-// the method, when we know it. This fixes NTLM auth. (userid=domain\user)
-//
-// Revision 1.138 2006年06月18日 11:02:55 rurban
-// pref->value > -name, fix bug #1355533
-//
-// Revision 1.137 2006年05月03日 06:05:37 rurban
-// Fix default preferences for editheight maxrows, by Manuel Vacelet.
-//
-// Revision 1.136 2006年04月16日 11:07:48 rurban
-// Dont crypt the passwd twice on storing prefs. Patch by Thomas Harding.
-// Fixes bug #1327470
-//
-// Revision 1.135 2006年03月19日 16:26:39 rurban
-// fix DBAUTH arguments to be position independent, fixes bug #1358973
-//
-// Revision 1.134 2006年03月19日 15:01:00 rurban
-// sf.net patch #1333957 by Matt Brown: Authentication cookie identical across all wikis on a host
-//
-// Revision 1.133 2006年03月07日 18:39:21 rurban
-// add PdoDb, rename hash to wikihash (php-5.1), fix output of Homepage prefs update
-//
-// Revision 1.132 2006年03月04日 13:19:12 rurban
-// fix for fatal error on empty pref value (sign out). Thanks to Jim Ford and Joel Schaubert. rename hash for php-5.1
-//
-// Revision 1.131 2005年10月12日 06:16:48 rurban
-// add new _insert statement
-//
-// Revision 1.129 2005年06月10日 06:10:35 rurban
-// ensure Update Preferences gets through
-//
-// Revision 1.128 2005年06月05日 05:38:02 rurban
-// Default ENABLE_DOUBLECLICKEDIT = false. Moved to UserPreferences
-//
-// Revision 1.127 2005年04月02日 18:01:41 uckelman
-// Fixed regex for RFC822 addresses.
-//
-// Revision 1.126 2005年02月28日 20:30:46 rurban
-// some stupid code for _AdminUser (probably not needed)
-//
-// Revision 1.125 2005年02月08日 13:25:50 rurban
-// encrypt password. fix strict logic.
-// both bugs reported by Mikhail Vladimirov
-//
-// Revision 1.124 2005年01月30日 23:11:00 rurban
-// allow self-creating passuser on login
-//
-// Revision 1.123 2005年01月25日 06:58:21 rurban
-// reformatting
-//
-// Revision 1.122 2005年01月08日 22:51:56 rurban
-// remove deprecated workaround
-//
-// Revision 1.121 2004年12月19日 00:58:01 rurban
-// Enforce PASSWORD_LENGTH_MINIMUM in almost all PassUser checks,
-// Provide an errormessage if so. Just PersonalPage and BogoLogin not.
-// Simplify httpauth logout handling and set sessions for all methods.
-// fix main.php unknown index "x" getLevelDescription() warning.
-//
-// Revision 1.120 2004年12月17日 12:31:57 rurban
-// better logout, fake httpauth not yet
-//
-// Revision 1.119 2004年11月21日 11:59:17 rurban
-// remove final \n to be ob_cache independent
-//
-// Revision 1.118 2004年11月19日 19:22:03 rurban
-// ModeratePage part1: change status
-//
-// Revision 1.117 2004年11月10日 15:29:21 rurban
-// * requires newer Pear_DB (as the internal one): quote() uses now escapeSimple for strings
-// * ACCESS_LOG_SQL: fix cause request not yet initialized
-// * WikiDB: moved SQL specific methods upwards
-// * new Pear_DB quoting: same as ADODB and as newer Pear_DB.
-// fixes all around: WikiGroup, WikiUserNew SQL methods, SQL logging
-//
-// Revision 1.116 2004年11月05日 21:03:27 rurban
-// new DEBUG flag: _DEBUG_LOGIN (64)
-// verbose login debug-msg (settings and reason for failure)
-//
-// Revision 1.115 2004年11月05日 20:53:35 rurban
-// login cleanup: better debug msg on failing login,
-// checked password less immediate login (bogo or anon),
-// checked olduser pref session error,
-// better PersonalPage without password warning on minimal password length=0
-// (which is default now)
-//
-// Revision 1.114 2004年11月05日 16:15:57 rurban
-// forgot the BogoLogin inclusion with the latest rewrite
-//
-// Revision 1.113 2004年11月03日 17:13:49 rurban
-// make it easier to disable EmailVerification
-// Bug #1053681
-//
-// Revision 1.112 2004年11月01日 10:43:57 rurban
-// seperate PassUser methods into seperate dir (memory usage)
-// fix WikiUser (old) overlarge data session
-// remove wikidb arg from various page class methods, use global ->_dbi instead
-// ...
-//
-// Revision 1.111 2004年10月21日 21:03:50 rurban
-// isAdmin must be signed and authenticated
-// comment out unused sections (memory)
-//
-// Revision 1.110 2004年10月14日 19:19:33 rurban
-// loadsave: check if the dumped file will be accessible from outside.
-// and some other minor fixes. (cvsclient native not yet ready)
-//
-// Revision 1.109 2004年10月07日 16:08:58 rurban
-// fixed broken FileUser session handling.
-// thanks to Arnaud Fontaine for detecting this.
-// enable file user Administrator membership.
-//
-// Revision 1.108 2004年10月05日 17:00:04 rurban
-// support paging for simple lists
-// fix RatingDb sql backend.
-// remove pages from AllPages (this is ListPages then)
-//
-// Revision 1.107 2004年10月04日 23:42:15 rurban
-// HttpAuth admin group logic. removed old logs
-//
-// Revision 1.106 2004年07月01日 08:49:38 rurban
-// obsolete php5-patch.php: minor php5 login problem though
-//
-// Revision 1.105 2004年06月29日 06:48:03 rurban
-// Improve LDAP auth and GROUP_LDAP membership:
-// no error message on false password,
-// added two new config vars: LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP
-// fixed two group queries (this -> user)
-// stdlib: ConvertOldMarkup still flawed
-//
-// Revision 1.104 2004年06月28日 15:39:37 rurban
-// fixed endless recursion in WikiGroup: isAdmin()
-//
-// Revision 1.103 2004年06月28日 15:01:07 rurban
-// fixed LDAP_SET_OPTION handling, LDAP error on connection problem
-//
-// Revision 1.102 2004年06月27日 10:23:48 rurban
-// typo detected by Philippe Vanhaesendonck
-//
-// Revision 1.101 2004年06月25日 14:29:19 rurban
-// WikiGroup refactoring:
-// global group attached to user, code for not_current user.
-// improved helpers for special groups (avoid double invocations)
-// new experimental config option ENABLE_XHTML_XML (fails with IE, and document.write())
-// fixed a XHTML validation error on userprefs.tmpl
-//
-// Revision 1.100 2004年06月21日 06:29:35 rurban
-// formatting: linewrap only
-//
-// Revision 1.99 2004年06月20日 15:30:05 rurban
-// get_class case-sensitivity issues
-//
-// Revision 1.98 2004年06月16日 21:24:31 rurban
-// do not display no-connect warning: #2662
-//
-// Revision 1.97 2004年06月16日 13:21:16 rurban
-// stabilize on failing ldap queries or bind
-//
-// Revision 1.96 2004年06月16日 12:42:06 rurban
-// fix homepage prefs
-//
-// Revision 1.95 2004年06月16日 10:38:58 rurban
-// Disallow refernces in calls if the declaration is a reference
-// ("allow_call_time_pass_reference clean").
-// PhpWiki is now allow_call_time_pass_reference = Off clean,
-// but several external libraries may not.
-// In detail these libs look to be affected (not tested):
-// * Pear_DB odbc
-// * adodb oracle
-//
-// Revision 1.94 2004年06月15日 10:40:35 rurban
-// minor WikiGroup cleanup: no request param, start of current user independency
-//
-// Revision 1.93 2004年06月15日 09:15:52 rurban
-// IMPORTANT: fixed passwd handling for passwords stored in prefs:
-// fix encrypted usage, actually store and retrieve them from db
-// fix bogologin with passwd set.
-// fix php crashes with call-time pass-by-reference (references wrongly used
-// in declaration AND call). This affected mainly Apache2 and IIS.
-// (Thanks to John Cole to detect this!)
-//
-// Revision 1.92 2004年06月14日 11:31:36 rurban
-// renamed global $Theme to $WikiTheme (gforge nameclash)
-// inherit PageList default options from PageList
-// default sortby=pagename
-// use options in PageList_Selectable (limit, sortby, ...)
-// added action revert, with button at action=diff
-// added option regex to WikiAdminSearchReplace
-//
-// Revision 1.91 2004年06月08日 14:57:43 rurban
-// stupid ldap bug detected by John Cole
-//
-// Revision 1.90 2004年06月08日 09:31:15 rurban
-// fixed typo detected by lucidcarbon (line 1663 assertion)
-//
-// Revision 1.89 2004年06月06日 16:58:51 rurban
-// added more required ActionPages for foreign languages
-// install now english ActionPages if no localized are found. (again)
-// fixed default anon user level to be 0, instead of -1
-// (wrong "required administrator to view this page"...)
-//
-// Revision 1.88 2004年06月04日 20:32:53 rurban
-// Several locale related improvements suggested by Pierrick Meignen
-// LDAP fix by John Cole
-// reanable admin check without ENABLE_PAGEPERM in the admin plugins
-//
-// Revision 1.87 2004年06月04日 12:40:21 rurban
-// Restrict valid usernames to prevent from attacks against external auth or compromise
-// possible holes.
-// Fix various WikiUser old issues with default IMAP,LDAP,POP3 configs. Removed these.
-// Fxied more warnings
-//
-// Revision 1.86 2004年06月03日 18:06:29 rurban
-// fix file locking issues (only needed on write)
-// fixed immediate LANG and THEME in-session updates if not stored in prefs
-// advanced editpage toolbars (search & replace broken)
-//
-// Revision 1.85 2004年06月03日 12:46:03 rurban
-// fix signout, level must be 0 not -1
-//
-// Revision 1.84 2004年06月03日 12:36:03 rurban
-// fix eval warning on signin
-//
-// Revision 1.83 2004年06月03日 10:18:19 rurban
-// fix User locking issues, new config ENABLE_PAGEPERM
-//
-// Revision 1.82 2004年06月03日 09:39:51 rurban
-// fix LDAP injection (wildcard in username) detected by Steve Christey, MITRE
-//
-// Revision 1.81 2004年06月02日 18:01:45 rurban
-// init global FileFinder to add proper include paths at startup
-// adds PHPWIKI_DIR if started from another dir, lib/pear also
-// fix slashify for Windows
-// fix USER_AUTH_POLICY=old, use only USER_AUTH_ORDER methods (besides HttpAuth)
-//
-// Revision 1.80 2004年06月02日 14:20:27 rurban
-// fix adodb DbPassUser login
-//
-// Revision 1.79 2004年06月01日 15:27:59 rurban
-// AdminUser only ADMIN_USER not member of Administrators
-// some RateIt improvements by dfrankow
-// edit_toolbar buttons
-//
-// Revision 1.78 2004年05月27日 17:49:06 rurban
-// renamed DB_Session to DbSession (in CVS also)
-// added WikiDB->getParam and WikiDB->getAuthParam method to get rid of globals
-// remove leading slash in error message
-// added force_unlock parameter to File_Passwd (no return on stale locks)
-// fixed adodb session AffectedRows
-// added FileFinder helpers to unify local filenames and DATA_PATH names
-// editpage.php: new edit toolbar javascript on ENABLE_EDIT_TOOLBAR
-//
-// Revision 1.77 2004年05月18日 14:49:51 rurban
-// Simplified strings for easier translation
-//
-// Revision 1.76 2004年05月18日 13:30:04 rurban
-// prevent from endless loop with oldstyle warnings
-//
-// Revision 1.75 2004年05月16日 22:07:35 rurban
-// check more config-default and predefined constants
-// various PagePerm fixes:
-// fix default PagePerms, esp. edit and view for Bogo and Password users
-// implemented Creator and Owner
-// BOGOUSERS renamed to BOGOUSER
-// fixed syntax errors in signin.tmpl
-//
-// Revision 1.74 2004年05月15日 19:48:33 rurban
-// fix some too loose PagePerms for signed, but not authenticated users
-// (admin, owner, creator)
-// no double login page header, better login msg.
-// moved action_pdf to lib/pdf.php
-//
-// Revision 1.73 2004年05月15日 18:31:01 rurban
-// some action=pdf Request fixes: With MSIE it works now. Now the work with the page formatting begins.
-//
-// Revision 1.72 2004年05月12日 10:49:55 rurban
-// require_once fix for those libs which are loaded before FileFinder and
-// its automatic include_path fix, and where require_once doesn't grok
-// dirname(__FILE__) != './lib'
-// upgrade fix with PearDB
-// navbar.tmpl: remove spaces for IE &nbsp; button alignment
-//
-// Revision 1.71 2004年05月10日 12:34:47 rurban
-// stabilize DbAuthParam statement pre-prozessor:
-// try old-style and new-style (double-)quoting
-// reject unknown $variables
-// use ->prepare() for all calls (again)
-//
-// Revision 1.70 2004年05月06日 19:26:16 rurban
-// improve stability, trying to find the InlineParser endless loop on sf.net
-//
-// remove end-of-zip comments to fix sf.net bug #777278 and probably #859628
-//
-// Revision 1.69 2004年05月06日 13:56:40 rurban
-// Enable the Administrators group, and add the WIKIPAGE group default root page.
-//
-// Revision 1.68 2004年05月05日 13:37:54 rurban
-// Support to remove all UserPreferences
-//
-// Revision 1.66 2004年05月03日 21:44:24 rurban
-// fixed sf,net bug #947264: LDAP options are constants, not strings!
-//
-// Revision 1.65 2004年05月03日 13:16:47 rurban
-// fixed UserPreferences update, esp for boolean and int
-//
-// Revision 1.64 2004年05月02日 15:10:06 rurban
-// new finally reliable way to detect if /index.php is called directly
-// and if to include lib/main.php
-// new global AllActionPages
-// SetupWiki now loads all mandatory pages: HOME_PAGE, action pages, and warns if not.
-// WikiTranslation what=buttons for Carsten to create the missing MacOSX buttons
-// PageGroupTestOne => subpages
-// renamed PhpWikiRss to PhpWikiRecentChanges
-// more docs, default configs, ...
-//
-// Revision 1.63 2004年05月01日 15:59:29 rurban
-// more php-4.0.6 compatibility: superglobals
-//
-// Revision 1.62 2004年04月29日 18:31:24 rurban
-// Prevent from warning where no db pref was previously stored.
-//
-// Revision 1.61 2004年04月29日 17:18:19 zorloc
-// Fixes permission failure issues. With PagePermissions and Disabled Actions when user did not have permission WIKIAUTH_FORBIDDEN was returned. In WikiUser this was ok because WIKIAUTH_FORBIDDEN had a value of 11 -- thus no user could perform that action. But WikiUserNew has a WIKIAUTH_FORBIDDEN value of -1 -- thus a user without sufficent permission to do anything. The solution is a new high value permission level (WIKIAUTH_UNOBTAINABLE) to be the default level for access failure.
-//
-// Revision 1.60 2004年04月27日 18:20:54 rurban
-// sf.net patch #940359 by rassie
-//
-// Revision 1.59 2004年04月26日 12:35:21 rurban
-// POP3_AUTH_PORT deprecated, use "host:port" similar to IMAP
-// File_Passwd is already loaded
-//
-// Revision 1.58 2004年04月20日 17:08:28 rurban
-// Some IniConfig fixes: prepend our private lib/pear dir
-// switch from " to ' in the auth statements
-// use error handling.
-// WikiUserNew changes for the new "'$variable'" syntax
-// in the statements
-// TODO: optimization to put config vars into the session.
-//
-// Revision 1.57 2004年04月19日 18:27:45 rurban
-// Prevent from some PHP5 warnings (ref args, no :: object init)
-// php5 runs now through, just one wrong XmlElement object init missing
-// Removed unneccesary UpgradeUser lines
-// Changed WikiLink to omit version if current (RecentChanges)
-//
-// Revision 1.56 2004年04月19日 09:13:24 rurban
-// new pref: googleLink
-//
-// Revision 1.54 2004年04月18日 00:24:45 rurban
-// re-use our simple prepare: just for table prefix warnings
-//
-// Revision 1.53 2004年04月12日 18:29:15 rurban
-// exp. Session auth for already authenticated users from another app
-//
-// Revision 1.52 2004年04月12日 13:04:50 rurban
-// added auth_create: self-registering Db users
-// fixed IMAP auth
-// removed rating recommendations
-// ziplib reformatting
-//
-// Revision 1.51 2004年04月11日 10:42:02 rurban
-// pgsrc/CreatePagePlugin
-//
-// Revision 1.50 2004年04月10日 05:34:35 rurban
-// sf bug#830912
-//
-// Revision 1.49 2004年04月07日 23:13:18 rurban
-// fixed pear/File_Passwd for Windows
-// fixed FilePassUser sessions (filehandle revive) and password update
-//
-// Revision 1.48 2004年04月06日 20:00:10 rurban
-// Cleanup of special PageList column types
-// Added support of plugin and theme specific Pagelist Types
-// Added support for theme specific UserPreferences
-// Added session support for ip-based throttling
-// sql table schema change: ALTER TABLE session ADD sess_ip CHAR(15);
-// Enhanced postgres schema
-// Added DB_Session_dba support
-//
-// Revision 1.47 2004年04月02日 15:06:55 rurban
-// fixed a nasty ADODB_mysql session update bug
-// improved UserPreferences layout (tabled hints)
-// fixed UserPreferences auth handling
-// improved auth stability
-// improved old cookie handling: fixed deletion of old cookies with paths
-//
-// Revision 1.46 2004年04月01日 06:29:51 rurban
-// better wording
-// RateIt also for ADODB
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2009年03月31日 10:01:38
Revision: 6740
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6740&view=rev
Author: vargenau
Date: 2009年03月31日 10:01:27 +0000 (2009年3月31日)
Log Message:
-----------
Special isValidName for Gforge
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年03月31日 09:07:51 UTC (rev 6739)
+++ trunk/lib/WikiUserNew.php	2009年03月31日 10:01:27 UTC (rev 6740)
@@ -557,6 +557,9 @@
 function isValidName ($userid = false) {
 if (!$userid) $userid = $this->_userid;
 if (!$userid) return false;
+ if (defined('GFORGE') and GFORGE) {
+ return true;
+ }
 return preg_match("/^[\-\w\.@ ]+$/U", $userid) and strlen($userid) < 32;
 }
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2009年06月03日 14:23:11
Revision: 6849
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6849&view=rev
Author: vargenau
Date: 2009年06月03日 13:49:28 +0000 (2009年6月03日)
Log Message:
-----------
Protect modification from revision 6404 with check_php_version
Revision Links:
--------------
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6404&view=rev
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年06月03日 11:59:14 UTC (rev 6848)
+++ trunk/lib/WikiUserNew.php	2009年06月03日 13:49:28 UTC (rev 6849)
@@ -1167,18 +1167,33 @@
 	// FIXME: strange why this should be needed...
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/AdoDb.php");
- $user = new _AdoDbPassUser($this->_userid, $this->_prefs);
- return $user->getPreferences();
+ if (check_php_version(5)) {
+ $user = new _AdoDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
+ } else {
+ _AdoDbPassUser::_AdoDbPassUser($this->_userid, $this->_prefs);
+ return _AdoDbPassUser::getPreferences();
+ }
 } elseif ($this->_prefs->_method == 'SQL') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PearDb.php");
- $user = new _PearDbPassUser($this->_userid, $this->_prefs);
- return $user->getPreferences();
+ if (check_php_version(5)) {
+ $user = new _PearDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
+ } else {
+ _PearDbPassUser::_PearDbPassUser($this->_userid, $this->_prefs);
+ return _PearDbPassUser::getPreferences();
+ }
 } elseif ($this->_prefs->_method == 'PDO') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PdoDb.php");
- $user = new _PdoDbPassUser($this->_userid, $this->_prefs);
- return $user->getPreferences();
+ if (check_php_version(5)) {
+ $user = new _PdoDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
+ } else {
+ _PdoDbPassUser::_PdoDbPassUser($this->_userid, $this->_prefs);
+ return _PdoDbPassUser::getPreferences();
+ }
 }
 }
 
@@ -1205,20 +1220,35 @@
 	// FIXME: strange why this should be needed...
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/AdoDb.php");
- $user = new _AdoDbPassUser($this->_userid, $prefs);
- return $user->setPreferences($prefs, $id_only);
+ if (check_php_version(5)) {
+ $user = new _AdoDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
+ } else {
+ _AdoDbPassUser::_AdoDbPassUser($this->_userid, $prefs);
+ return _AdoDbPassUser::setPreferences($prefs, $id_only);
+ }
 }
 elseif ($this->_prefs->_method == 'SQL') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PearDb.php");
- $user = new _PearDbPassUser($this->_userid, $prefs);
- return $user->setPreferences($prefs, $id_only);
+ if (check_php_version(5)) {
+ $user = new _PearDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
+ } else {
+ _PearDbPassUser::_PearDbPassUser($this->_userid, $prefs);
+ return _PearDbPassUser::setPreferences($prefs, $id_only);
+ }
 }
 elseif ($this->_prefs->_method == 'PDO') {
 	include_once("lib/WikiUser/Db.php");
 	include_once("lib/WikiUser/PdoDb.php");
- $user = new _PdoDbPassUser($this->_userid, $prefs);
- return $user->setPreferences($prefs, $id_only);
+ if (check_php_version(5)) {
+ $user = new _PdoDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
+ } else {
+ _PdoDbPassUser::_PdoDbPassUser($this->_userid, $prefs);
+ return _PdoDbPassUser::setPreferences($prefs, $id_only);
+ }
 }
 }
 if ($updated = _AnonUser::setPreferences($prefs, $id_only)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ru...@us...> - 2009年06月04日 11:47:38
Revision: 6879
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6879&view=rev
Author: rurban
Date: 2009年06月04日 11:46:17 +0000 (2009年6月04日)
Log Message:
-----------
add new copyright year
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年06月04日 11:45:56 UTC (rev 6878)
+++ trunk/lib/WikiUserNew.php	2009年06月04日 11:46:17 UTC (rev 6879)
@@ -1,6 +1,6 @@
 <?php //-*-php-*-
 rcs_id('$Id$');
-/* Copyright (C) 2004,2005,2006,2007 $ThePhpWikiProgrammingTeam
+/* Copyright (C) 2004,2005,2006,2007,2009 $ThePhpWikiProgrammingTeam
 *
 * This file is part of PhpWiki.
 * 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2009年06月06日 16:07:27
Revision: 6904
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6904&view=rev
Author: vargenau
Date: 2009年06月06日 16:07:23 +0000 (2009年6月06日)
Log Message:
-----------
Avoid "PHP Fatal error" in PHP5: test type
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年06月06日 10:07:24 UTC (rev 6903)
+++ trunk/lib/WikiUserNew.php	2009年06月06日 16:07:23 UTC (rev 6904)
@@ -815,14 +815,16 @@
 // COOKIE_EXPIRATION_DAYS, COOKIE_DOMAIN);
 }
 }
- $packed = $prefs->store();
- $unpacked = $prefs->unpack($packed);
- if (count($unpacked)) {
- foreach (array('_method','_select','_update','_insert') as $param) {
- 	if (!empty($this->_prefs->{$param}))
- 	 $prefs->{$param} = $this->_prefs->{$param};
+ if (is_object($prefs)) {
+ $packed = $prefs->store();
+ $unpacked = $prefs->unpack($packed);
+ if (count($unpacked)) {
+ foreach (array('_method','_select','_update','_insert') as $param) {
+ 	 if (!empty($this->_prefs->{$param}))
+ 	 $prefs->{$param} = $this->_prefs->{$param};
+ }
+ $this->_prefs = $prefs;
 }
- $this->_prefs = $prefs;
 }
 return $updated;
 }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ru...@us...> - 2009年08月26日 10:47:13
Revision: 7090
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7090&view=rev
Author: rurban
Date: 2009年08月26日 10:47:03 +0000 (2009年8月26日)
Log Message:
-----------
log cleartext password on login failure and logon debugging
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年08月25日 16:39:53 UTC (rev 7089)
+++ trunk/lib/WikiUserNew.php	2009年08月26日 10:47:03 UTC (rev 7090)
@@ -630,6 +630,7 @@
 		elseif (ord($c) < 127) $manglepasswd[$i] = "x";
 		elseif (ord($c) >= 127) $manglepasswd[$i] = ">";
 	 }
+ if ((DEBUG & _DEBUG_LOGIN) and $authlevel <= 0) $manglepasswd = $passwd;
 	 $entry = sprintf('%s - %s - [%s %s] "%s" %s - "%s" "%s"',
 			 $request->get('REMOTE_HOST'),
 			 (string) $request->_user->_userid,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2009年09月10日 16:09:07
Revision: 7108
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7108&view=rev
Author: vargenau
Date: 2009年09月10日 16:08:56 +0000 (2009年9月10日)
Log Message:
-----------
Whitespace only
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年09月10日 14:54:37 UTC (rev 7107)
+++ trunk/lib/WikiUserNew.php	2009年09月10日 16:08:56 UTC (rev 7108)
@@ -1171,9 +1171,9 @@
 function getPreferences() {
 if (!empty($this->_prefs->_method)) {
 if ($this->_prefs->_method == 'ADODB') {
- 	// FIXME: strange why this should be needed...
- 	include_once("lib/WikiUser/Db.php");
- 	include_once("lib/WikiUser/AdoDb.php");
+ // FIXME: strange why this should be needed...
+ include_once("lib/WikiUser/Db.php");
+ include_once("lib/WikiUser/AdoDb.php");
 if (check_php_version(5)) {
 $user = new _AdoDbPassUser($this->_userid, $this->_prefs);
 return $user->getPreferences();
@@ -1182,8 +1182,8 @@
 return _AdoDbPassUser::getPreferences();
 }
 } elseif ($this->_prefs->_method == 'SQL') {
- 	include_once("lib/WikiUser/Db.php");
- 	include_once("lib/WikiUser/PearDb.php");
+ include_once("lib/WikiUser/Db.php");
+ include_once("lib/WikiUser/PearDb.php");
 if (check_php_version(5)) {
 $user = new _PearDbPassUser($this->_userid, $this->_prefs);
 return $user->getPreferences();
@@ -1192,8 +1192,8 @@
 return _PearDbPassUser::getPreferences();
 }
 } elseif ($this->_prefs->_method == 'PDO') {
- 	include_once("lib/WikiUser/Db.php");
- 	include_once("lib/WikiUser/PdoDb.php");
+ include_once("lib/WikiUser/Db.php");
+ include_once("lib/WikiUser/PdoDb.php");
 if (check_php_version(5)) {
 $user = new _PdoDbPassUser($this->_userid, $this->_prefs);
 return $user->getPreferences();
@@ -1224,9 +1224,9 @@
 function setPreferences($prefs, $id_only=false) {
 if (!empty($this->_prefs->_method)) {
 if ($this->_prefs->_method == 'ADODB') {
- 	// FIXME: strange why this should be needed...
- 	include_once("lib/WikiUser/Db.php");
- 	include_once("lib/WikiUser/AdoDb.php");
+ // FIXME: strange why this should be needed...
+ include_once("lib/WikiUser/Db.php");
+ include_once("lib/WikiUser/AdoDb.php");
 if (check_php_version(5)) {
 $user = new _AdoDbPassUser($this->_userid, $prefs);
 return $user->setPreferences($prefs, $id_only);
@@ -1236,8 +1236,8 @@
 }
 }
 elseif ($this->_prefs->_method == 'SQL') {
- 	include_once("lib/WikiUser/Db.php");
- 	include_once("lib/WikiUser/PearDb.php");
+ include_once("lib/WikiUser/Db.php");
+ include_once("lib/WikiUser/PearDb.php");
 if (check_php_version(5)) {
 $user = new _PearDbPassUser($this->_userid, $prefs);
 return $user->setPreferences($prefs, $id_only);
@@ -1247,8 +1247,8 @@
 }
 }
 elseif ($this->_prefs->_method == 'PDO') {
- 	include_once("lib/WikiUser/Db.php");
- 	include_once("lib/WikiUser/PdoDb.php");
+ include_once("lib/WikiUser/Db.php");
+ include_once("lib/WikiUser/PdoDb.php");
 if (check_php_version(5)) {
 $user = new _PdoDbPassUser($this->_userid, $prefs);
 return $user->setPreferences($prefs, $id_only);
@@ -2112,9 +2112,9 @@
 if (!is_array($packed)) return false;
 $prefs = array();
 foreach ($packed as $name => $packed_pref) {
- if (is_string($packed_pref) 
- and isSerialized($packed_pref) 
- and substr($packed_pref, 0, 2) == "O:") 
+ if (is_string($packed_pref)
+ and isSerialized($packed_pref)
+ and substr($packed_pref, 0, 2) == "O:")
 {
 //legacy: check if it's an old array of objects
 // Looks like a serialized object. 
@@ -2130,7 +2130,7 @@
 	 $prefs[$name] = $value;
 	}
 } else {
- 	if (isSerialized($packed_pref))
+ if (isSerialized($packed_pref))
 $prefs[$name] = @unserialize($packed_pref);
 if (empty($prefs[$name]) and isSerialized(base64_decode($packed_pref)))
 $prefs[$name] = @unserialize(base64_decode($packed_pref));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2009年09月22日 12:35:53
Revision: 7148
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7148&view=rev
Author: vargenau
Date: 2009年09月22日 12:35:44 +0000 (2009年9月22日)
Log Message:
-----------
Add Gforge menu items preferences and page notification per project
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年09月21日 12:20:37 UTC (rev 7147)
+++ trunk/lib/WikiUserNew.php	2009年09月22日 12:35:44 UTC (rev 7148)
@@ -1,6 +1,7 @@
 <?php //-*-php-*-
 rcs_id('$Id$');
 /* Copyright (C) 2004,2005,2006,2007,2009 $ThePhpWikiProgrammingTeam
+ * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent
 *
 * This file is part of PhpWiki.
 * 
@@ -1920,6 +1921,8 @@
 */
 class UserPreferences
 {
+ var $notifyPagesAll;
+	
 function UserPreferences($saved_prefs = false) {
 // userid stored too, to ensure the prefs are being loaded for
 // the correct (currently signing in) userid if stored in a
@@ -1954,6 +1957,31 @@
 'googleLink' => new _UserPreference_bool(), // 1.3.10
 'doubleClickEdit' => new _UserPreference_bool(), // 1.3.11
 );
+
+ // This should be probably be done with $customUserPreferenceColumns
+ // For now, we use GFORGE define
+ if (defined('GFORGE') and GFORGE) {
+ $gforgeprefs = array(
+ 'pageTrail' => new _UserPreference_bool(),
+ 'diffMenuItem' => new _UserPreference_bool(),
+ 'pageInfoMenuItem' => new _UserPreference_bool(),
+ 'pdfMenuItem' => new _UserPreference_bool(),
+ 'lockMenuItem' => new _UserPreference_bool(),
+ 'chownMenuItem' => new _UserPreference_bool(),
+ 'setaclMenuItem' => new _UserPreference_bool(),
+ 'removeMenuItem' => new _UserPreference_bool(),
+ 'renameMenuItem' => new _UserPreference_bool(),
+ 'revertMenuItem' => new _UserPreference_bool(),
+ 'backLinksMenuItem' => new _UserPreference_bool(),
+ 'watchPageMenuItem' => new _UserPreference_bool(),
+ 'recentChangesMenuItem' => new _UserPreference_bool(),
+ 'randomPageMenuItem' => new _UserPreference_bool(),
+ 'likePagesMenuItem' => new _UserPreference_bool(),
+ 'specialPagesMenuItem' => new _UserPreference_bool(),
+ );
+ $this->_prefs = array_merge($this->_prefs, $gforgeprefs);
+ }
+
 // add custom theme-specific pref types:
 // FIXME: on theme changes the wiki_user session pref object will fail. 
 // We will silently ignore this.
@@ -2101,6 +2129,17 @@
 $prefs['passwd'] = $value;
 }
 }
+
+ if (defined('GFORGE') and GFORGE) {
+ // Merge current notifyPages with notifyPagesAll
+ // notifyPages are pages to notify in the current project
+ // while $notifyPagesAll is used to store all the monitored pages.
+ if (isset($prefs['notifyPages'])) {
+ $this->notifyPagesAll[PAGE_PREFIX] = $prefs['notifyPages'];
+ $prefs['notifyPages'] = @serialize($this->notifyPagesAll);
+ }
+ }
+
 return $this->pack($prefs);
 }
 
@@ -2139,6 +2178,21 @@
 $prefs[$name] = $packed_pref;
 }
 }
+ 
+ if (defined('GFORGE') and GFORGE) {
+ // Restore notifyPages from notifyPagesAll
+ // notifyPages are pages to notify in the current project
+ // while $notifyPagesAll is used to store all the monitored pages.
+ if (isset($prefs['notifyPages'])) {
+ $this->notifyPagesAll = $prefs['notifyPages'];
+ if (isset($this->notifyPagesAll[PAGE_PREFIX])) {
+ $prefs['notifyPages'] = $this->notifyPagesAll[PAGE_PREFIX];
+ } else {
+ $prefs['notifyPages'] = '';
+ }
+ }
+ }
+
 return $prefs;
 }
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2010年01月18日 19:13:13
Revision: 7283
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7283&view=rev
Author: vargenau
Date: 2010年01月18日 19:13:06 +0000 (2010年1月18日)
Log Message:
-----------
Make saving preferences work in PHP 5
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2009年12月04日 17:08:19 UTC (rev 7282)
+++ trunk/lib/WikiUserNew.php	2010年01月18日 19:13:06 UTC (rev 7283)
@@ -2,6 +2,7 @@
 rcs_id('$Id$');
 /* Copyright (C) 2004,2005,2006,2007,2009 $ThePhpWikiProgrammingTeam
 * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ * Copyright (C) 2009 Roger Guignard, Alcatel-Lucent
 *
 * This file is part of PhpWiki.
 * 
@@ -1175,33 +1176,15 @@
 // FIXME: strange why this should be needed...
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/AdoDb.php");
- if (check_php_version(5)) {
- $user = new _AdoDbPassUser($this->_userid, $this->_prefs);
- return $user->getPreferences();
- } else {
- _AdoDbPassUser::_AdoDbPassUser($this->_userid, $this->_prefs);
- return _AdoDbPassUser::getPreferences();
- }
+ return _AdoDbPassUser::getPreferences();
 } elseif ($this->_prefs->_method == 'SQL') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PearDb.php");
- if (check_php_version(5)) {
- $user = new _PearDbPassUser($this->_userid, $this->_prefs);
- return $user->getPreferences();
- } else {
- _PearDbPassUser::_PearDbPassUser($this->_userid, $this->_prefs);
- return _PearDbPassUser::getPreferences();
- }
+ return _PearDbPassUser::getPreferences();
 } elseif ($this->_prefs->_method == 'PDO') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PdoDb.php");
- if (check_php_version(5)) {
- $user = new _PdoDbPassUser($this->_userid, $this->_prefs);
- return $user->getPreferences();
- } else {
- _PdoDbPassUser::_PdoDbPassUser($this->_userid, $this->_prefs);
- return _PdoDbPassUser::getPreferences();
- }
+ return _PdoDbPassUser::getPreferences();
 }
 }
 
@@ -1228,35 +1211,17 @@
 // FIXME: strange why this should be needed...
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/AdoDb.php");
- if (check_php_version(5)) {
- $user = new _AdoDbPassUser($this->_userid, $prefs);
- return $user->setPreferences($prefs, $id_only);
- } else {
- _AdoDbPassUser::_AdoDbPassUser($this->_userid, $prefs);
- return _AdoDbPassUser::setPreferences($prefs, $id_only);
- }
+ return _AdoDbPassUser::setPreferences($prefs, $id_only);
 }
 elseif ($this->_prefs->_method == 'SQL') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PearDb.php");
- if (check_php_version(5)) {
- $user = new _PearDbPassUser($this->_userid, $prefs);
- return $user->setPreferences($prefs, $id_only);
- } else {
- _PearDbPassUser::_PearDbPassUser($this->_userid, $prefs);
- return _PearDbPassUser::setPreferences($prefs, $id_only);
- }
+ return _PearDbPassUser::setPreferences($prefs, $id_only);
 }
 elseif ($this->_prefs->_method == 'PDO') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PdoDb.php");
- if (check_php_version(5)) {
- $user = new _PdoDbPassUser($this->_userid, $prefs);
- return $user->setPreferences($prefs, $id_only);
- } else {
- _PdoDbPassUser::_PdoDbPassUser($this->_userid, $prefs);
- return _PdoDbPassUser::setPreferences($prefs, $id_only);
- }
+ return _PdoDbPassUser::setPreferences($prefs, $id_only);
 }
 }
 if ($updated = _AnonUser::setPreferences($prefs, $id_only)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2010年03月04日 13:42:25
Revision: 7305
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7305&view=rev
Author: vargenau
Date: 2010年03月04日 13:42:18 +0000 (2010年3月04日)
Log Message:
-----------
email address is already checked by Gforge
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2010年03月04日 12:39:07 UTC (rev 7304)
+++ trunk/lib/WikiUserNew.php	2010年03月04日 13:42:18 UTC (rev 7305)
@@ -1731,6 +1731,11 @@
 extends _UserPreference
 {
 function sanify($value) {
+
+ // email address is already checked by Gforge
+ if (defined('GFORGE') and GFORGE) {
+ return $value;
+ }
 // check for valid email address
 if ($this->get('email') == $value and $this->getraw('emailVerified'))
 return $value;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2010年03月04日 15:12:05
Revision: 7306
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7306&view=rev
Author: vargenau
Date: 2010年03月04日 15:11:56 +0000 (2010年3月04日)
Log Message:
-----------
Test GFORGE in update() and get()
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2010年03月04日 13:42:18 UTC (rev 7305)
+++ trunk/lib/WikiUserNew.php	2010年03月04日 15:11:56 UTC (rev 7306)
@@ -1,8 +1,8 @@
 <?php //-*-php-*-
 rcs_id('$Id$');
 /* Copyright (C) 2004,2005,2006,2007,2009 $ThePhpWikiProgrammingTeam
- * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent
- * Copyright (C) 2009 Roger Guignard, Alcatel-Lucent
+ * Copyright (C) 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent
+ * Copyright (C) 2009-2010 Roger Guignard, Alcatel-Lucent
 *
 * This file is part of PhpWiki.
 * 
@@ -1756,6 +1756,10 @@
 * For true verification (value = 2), we'd need a mailserver hook.
 */
 function update($value) {
+ // email address is already checked by Gforge
+ if (defined('GFORGE') and GFORGE) {
+ return;
+ }
 	if (!empty($this->_init)) return;
 $verified = $this->getraw('emailVerified');
 // hack!
@@ -1772,6 +1776,17 @@
 }
 }
 }
+
+ function get($name) {
+ // get email address from Gforge
+ if (defined('GFORGE') && GFORGE && session_loggedin()) {
+ $user = session_get_user();
+ return $user->getEmail();
+ } else {
+ parent::get($name);
+ }
+ }
+
 }
 
 /** Check for valid email address
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ru...@us...> - 2010年06月07日 09:47:18
Revision: 7469
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7469&view=rev
Author: rurban
Date: 2010年06月07日 09:47:12 +0000 (2010年6月07日)
Log Message:
-----------
unbreak whitespace garbage
defined('GFORGE') is never needed as it is set by IniConfig to true or false
fix important login recursion bug, i.e. php crash:
 new user => false does not return false, but the _userid is empty then
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2010年06月07日 09:11:29 UTC (rev 7468)
+++ trunk/lib/WikiUserNew.php	2010年06月07日 09:47:12 UTC (rev 7469)
@@ -1,25 +1,25 @@
 <?php //-*-php-*-
-// rcs_id('$Id$');
-/* Copyright (C) 2004,2005,2006,2007,2009 $ThePhpWikiProgrammingTeam
- * Copyright (C) 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent
- * Copyright (C) 2009-2010 Roger Guignard, Alcatel-Lucent
- *
- * This file is part of PhpWiki.
- * 
- * PhpWiki is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * PhpWiki is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with PhpWiki; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+//rcs_id('$Id$');
+/* Copyright (C) 2004,2005,2006,2007,2009,2010 $ThePhpWikiProgrammingTeam
+* Copyright (C) 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent
+* Copyright (C) 2009-2010 Roger Guignard, Alcatel-Lucent
+*
+* This file is part of PhpWiki.
+*
+* PhpWiki is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* PhpWiki is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with PhpWiki; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
 /**
 * This is a complete OOP rewrite of the old WikiUser code with various
 * configurable external authentication methods.
@@ -92,6 +92,10 @@
 * but storage must be extended to the Get/SetPreferences methods.
 * <theme>/themeinfo.php must provide CustomUserPreferences:
 * A list of name => _UserPreference class pairs.
+ * 2010年06月07日 rurban
+ * Fixed a nasty recursion bug (i.e. php crash), when user = new class 
+ * which returned false, did not return false on php-4.4.7. Check for 
+ * a object member now.
 */
 
 define('WIKIAUTH_FORBIDDEN', -1); // Completely not allowed.
@@ -353,7 +357,7 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
-/** 
+/**
 * Base WikiUser class.
 */
 class _WikiUser
@@ -425,17 +429,16 @@
 return false;
 }
 
- // 
 function createHomePage() {
 global $request;
 $versiondata = array('author' => ADMIN_USER);
 $request->_dbi->save(_("Automatically created user homepage to be able to store UserPreferences.").
- 		 "\n{{Template/UserPage}}",
+ "\n{{Template/UserPage}}",
 1, $versiondata);
- $request->_dbi->touch(); 
+ $request->_dbi->touch();
 $this->_HomePagehandle = $request->getPage($this->_userid);
 }
- 
+
 // innocent helper: case-insensitive position in _auth_methods
 function array_position ($string, $array) {
 $string = strtolower($string);
@@ -559,7 +562,7 @@
 function isValidName ($userid = false) {
 if (!$userid) $userid = $this->_userid;
 if (!$userid) return false;
- if (defined('GFORGE') and GFORGE) {
+ if (GFORGE) {
 return true;
 }
 return preg_match("/^[\-\w\.@ ]+$/U", $userid) and strlen($userid) < 32;
@@ -850,7 +853,7 @@
 
 }
 
-/** 
+/**
 * Helper class to finish the PassUser auth loop. 
 * This is added automatically to USER_AUTH_ORDER.
 */
@@ -1080,7 +1083,7 @@
 $dbh = $request->getDbh(); // use phpwiki database 
 } elseif ($dbh->getAuthParam('auth_dsn') == $dbh->getParam('dsn')) {
 $dbh = $request->getDbh(); // same phpwiki database 
- } else { // use another external database handle.
+ } else { // use another external database handle. needs PHP >= 4.1
 $local_params = array_merge($GLOBALS['DBParams'],$GLOBALS['DBAuthParams']);
 $local_params['dsn'] = $local_params['auth_dsn'];
 $dbh = WikiDB::open($local_params);
@@ -1176,15 +1179,33 @@
 // FIXME: strange why this should be needed...
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/AdoDb.php");
- return _AdoDbPassUser::getPreferences();
+ if (check_php_version(5)) {
+ $user = new _AdoDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
+ } else {
+ _AdoDbPassUser::_AdoDbPassUser($this->_userid, $this->_prefs);
+ return _AdoDbPassUser::getPreferences();
+ }
 } elseif ($this->_prefs->_method == 'SQL') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PearDb.php");
- return _PearDbPassUser::getPreferences();
+ if (check_php_version(5)) {
+ $user = new _PearDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
+ } else {
+ _PearDbPassUser::_PearDbPassUser($this->_userid, $this->_prefs);
+ return _PearDbPassUser::getPreferences();
+ }
 } elseif ($this->_prefs->_method == 'PDO') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PdoDb.php");
- return _PdoDbPassUser::getPreferences();
+ if (check_php_version(5)) {
+ $user = new _PdoDbPassUser($this->_userid, $this->_prefs);
+ return $user->getPreferences();
+ } else {
+ _PdoDbPassUser::_PdoDbPassUser($this->_userid, $this->_prefs);
+ return _PdoDbPassUser::getPreferences();
+ }
 }
 }
 
@@ -1211,17 +1232,35 @@
 // FIXME: strange why this should be needed...
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/AdoDb.php");
- return _AdoDbPassUser::setPreferences($prefs, $id_only);
+ if (check_php_version(5)) {
+ $user = new _AdoDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
+ } else {
+ _AdoDbPassUser::_AdoDbPassUser($this->_userid, $prefs);
+ return _AdoDbPassUser::setPreferences($prefs, $id_only);
+ }
 }
 elseif ($this->_prefs->_method == 'SQL') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PearDb.php");
- return _PearDbPassUser::setPreferences($prefs, $id_only);
+ if (check_php_version(5)) {
+ $user = new _PearDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
+ } else {
+ _PearDbPassUser::_PearDbPassUser($this->_userid, $prefs);
+ return _PearDbPassUser::setPreferences($prefs, $id_only);
+ }
 }
 elseif ($this->_prefs->_method == 'PDO') {
 include_once("lib/WikiUser/Db.php");
 include_once("lib/WikiUser/PdoDb.php");
- return _PdoDbPassUser::setPreferences($prefs, $id_only);
+ if (check_php_version(5)) {
+ $user = new _PdoDbPassUser($this->_userid, $prefs);
+ return $user->setPreferences($prefs, $id_only);
+ } else {
+ _PdoDbPassUser::_PdoDbPassUser($this->_userid, $prefs);
+ return _PdoDbPassUser::setPreferences($prefs, $id_only);
+ }
 }
 }
 if ($updated = _AnonUser::setPreferences($prefs, $id_only)) {
@@ -1254,7 +1293,8 @@
 } else {
 $user = $this;
 }
- while ($user) {
+ /* new user => false does not return false, but the _userid is empty then */
+ while ($user and $user->_userid) {
 if (!check_php_version(5))
 eval("\$this = \$user;");
 $user = UpgradeUser($this, $user);
@@ -1730,12 +1770,19 @@
 class _UserPreference_email
 extends _UserPreference
 {
+ function get($name) {
+ // get email address from Gforge
+ if (GFORGE && session_loggedin()) {
+ $user = session_get_user();
+ return $user->getEmail();
+ } else {
+ parent::get($name);
+ }
+ }
+
 function sanify($value) {
-
 // email address is already checked by Gforge
- if (defined('GFORGE') and GFORGE) {
- return $value;
- }
+ if (GFORGE) return $value;
 // check for valid email address
 if ($this->get('email') == $value and $this->getraw('emailVerified'))
 return $value;
@@ -1757,9 +1804,7 @@
 */
 function update($value) {
 // email address is already checked by Gforge
- if (defined('GFORGE') and GFORGE) {
- return;
- }
+ if (GFORGE) return $value;
 	if (!empty($this->_init)) return;
 $verified = $this->getraw('emailVerified');
 // hack!
@@ -1776,17 +1821,6 @@
 }
 }
 }
-
- function get($name) {
- // get email address from Gforge
- if (defined('GFORGE') && GFORGE && session_loggedin()) {
- $user = session_get_user();
- return $user->getEmail();
- } else {
- parent::get($name);
- }
- }
-
 }
 
 /** Check for valid email address
@@ -1945,7 +1979,7 @@
 
 // This should be probably be done with $customUserPreferenceColumns
 // For now, we use GFORGE define
- if (defined('GFORGE') and GFORGE) {
+ if (GFORGE) {
 $gforgeprefs = array(
 'pageTrail' => new _UserPreference_bool(),
 'diffMenuItem' => new _UserPreference_bool(),
@@ -2123,7 +2157,7 @@
 }
 }
 
- if (defined('GFORGE') and GFORGE) {
+ if (GFORGE) {
 // Merge current notifyPages with notifyPagesAll
 // notifyPages are pages to notify in the current project
 // while $notifyPagesAll is used to store all the monitored pages.
@@ -2172,7 +2206,7 @@
 }
 }
 
- if (defined('GFORGE') and GFORGE) {
+ if (GFORGE) {
 // Restore notifyPages from notifyPagesAll
 // notifyPages are pages to notify in the current project
 // while $notifyPagesAll is used to store all the monitored pages.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ru...@us...> - 2010年06月08日 06:01:42
Revision: 7487
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7487&view=rev
Author: rurban
Date: 2010年06月08日 06:01:36 +0000 (2010年6月08日)
Log Message:
-----------
one more check to stop cycles
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2010年06月07日 14:12:27 UTC (rev 7486)
+++ trunk/lib/WikiUserNew.php	2010年06月08日 06:01:36 UTC (rev 7487)
@@ -1460,6 +1460,7 @@
 $user = UpgradeUser($this, $user);
 return true;
 }
+ if ($class == "_ForbiddenPassUser") return false;
 $class = $this->nextClass();
 }
 }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ru...@us...> - 2010年06月09日 08:46:51
Revision: 7504
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7504&view=rev
Author: rurban
Date: 2010年06月09日 08:46:45 +0000 (2010年6月09日)
Log Message:
-----------
In case if unsuccessfull authmethod, the ->_userid is lost.
pass userid to stacked methods so that the 2nd methods succeed.
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2010年06月09日 08:45:23 UTC (rev 7503)
+++ trunk/lib/WikiUserNew.php	2010年06月09日 08:46:45 UTC (rev 7504)
@@ -222,7 +222,8 @@
 	 	 $class = $_PassUser->nextClass();
 	 	else
 		 $class = get_class($_PassUser);
- 		if ($user = new $class($UserName, $_PassUser->_prefs)) {
+ 		if ($user = new $class($UserName, $_PassUser->_prefs)
+ 		 and $user->_userid) {
 	 return $user;
 	} else {
 	 return $_PassUser;
@@ -1293,19 +1294,19 @@
 } else {
 $user = $this;
 }
+ $UserName = $this->_userid;
 /* new user => false does not return false, but the _userid is empty then */
- while ($user and $user->_userid) {
+ if ($user and $user->_userid) {
 if (!check_php_version(5))
 eval("\$this = \$user;");
 $user = UpgradeUser($this, $user);
- if ($user->userExists()) {
- $user = UpgradeUser($this, $user);
+ if ($user->userExists())
 return true;
- }
+ }
+ while (!$this->_tryNextUser($UserName)) {
 // prevent endless loop. does this work on all PHP's?
 // it just has to set the classname, what it correctly does.
- $class = $user->nextClass();
- if ($class == "_ForbiddenPassUser")
+ if ($this->nextClass() == "_ForbiddenPassUser")
 return false;
 }
 return false;
@@ -1429,7 +1430,7 @@
 }
 if (USER_AUTH_POLICY === 'strict') {
 $class = $this->nextClass();
- if ($user = new $class($this->_userid,$this->_prefs)) {
+ if ($user = new $class($this->_userid, $this->_prefs)) {
 if ($user->userExists()) {
 return $user->checkPass($submitted_password);
 }
@@ -1437,27 +1438,29 @@
 }
 if (USER_AUTH_POLICY === 'stacked' or USER_AUTH_POLICY === 'old') {
 $class = $this->nextClass();
- if ($user = new $class($this->_userid,$this->_prefs))
+ if ($user = new $class($this->_userid, $this->_prefs))
 return $user->checkPass($submitted_password);
 }
 return $this->_level;
 }
 
- function _tryNextUser() {
+ function _tryNextUser($username = false) {
 if (DEBUG & _DEBUG_LOGIN) {
 $class = strtolower(get_class($this));
 if (substr($class,-10) == "dbpassuser") $class = "_dbpassuser";
 $GLOBALS['USER_AUTH_ERROR'][$class] = 'nosuchuser';
 }
+ if (!$username) $username = $this->_userid;
 if (USER_AUTH_POLICY === 'strict'
-	 or USER_AUTH_POLICY === 'stacked') {
+	 or USER_AUTH_POLICY === 'stacked') 
+	{
 $class = $this->nextClass();
- while ($user = new $class($this->_userid, $this->_prefs)) {
+ while ($user = new $class($username, $this->_prefs)) {
 if (!check_php_version(5))
 eval("\$this = \$user;");
 	 $user = UpgradeUser($this, $user);
 if ($user->userExists()) {
- $user = UpgradeUser($this, $user);
+ //$user = UpgradeUser($this, $user);
 return true;
 }
 if ($class == "_ForbiddenPassUser") return false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ru...@us...> - 2010年09月21日 06:08:38
Revision: 7702
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7702&view=rev
Author: rurban
Date: 2010年09月21日 06:08:32 +0000 (2010年9月21日)
Log Message:
-----------
new may return an empty object. we must check for _userid to avoid recursion cycles
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2010年09月20日 16:09:07 UTC (rev 7701)
+++ trunk/lib/WikiUserNew.php	2010年09月21日 06:08:32 UTC (rev 7702)
@@ -222,7 +222,8 @@
 	 	 $class = $_PassUser->nextClass();
 	 	else
 		 $class = get_class($_PassUser);
- 		if ($user = new $class($UserName, $_PassUser->_prefs)) {
+ 		if ($user = new $class($UserName, $_PassUser->_prefs)
+ 		 and $user->_userid) {
 	 return $user;
 	} else {
 	 return $_PassUser;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2011年04月04日 15:27:26
Revision: 8012
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8012&view=rev
Author: vargenau
Date: 2011年04月04日 15:27:20 +0000 (2011年4月04日)
Log Message:
-----------
Translate strings
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2011年04月04日 15:20:14 UTC (rev 8011)
+++ trunk/lib/WikiUserNew.php	2011年04月04日 15:27:20 UTC (rev 8012)
@@ -1867,27 +1867,27 @@
 fputs ($Connect, "QUIT\r\n");
 fclose($Connect);
 if (!ereg ("^250", $From)) {
- $result[0]=false;
- $result[1]="Server rejected address: ". $From;
+ $result[0] = false;
+ $result[1] = _("Server rejected address: ") . $From;
 return $result;
 }
 if (!ereg ( "^250", $To )) {
- $result[0]=false;
- $result[1]="Server rejected address: ". $To;
+ $result[0] = false;
+ $result[1] = _("Server rejected address: ") . $To;
 return $result;
 }
 } else {
 $result[0] = false;
- $result[1] = "No response from server";
+ $result[1] = _("No response from server");
 return $result;
 }
 } else {
- $result[0]=false;
- $result[1]="Cannot connect e-mail server.";
+ $result[0] = false;
+ $result[1] = _("Cannot connect e-mail server.");
 return $result;
 }
- $result[0]=true;
- $result[1]="E-mail address '$email' appears to be valid.";
+ $result[0] = true;
+ $result[1] = sprintf(_("E-mail address '%s' appears to be valid."), $email);
 return $result;
 } // end of function
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2011年04月08日 12:54:02
Revision: 8024
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8024&view=rev
Author: vargenau
Date: 2011年04月08日 12:53:56 +0000 (2011年4月08日)
Log Message:
-----------
Translate strings
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2011年04月08日 12:52:26 UTC (rev 8023)
+++ trunk/lib/WikiUserNew.php	2011年04月08日 12:53:56 UTC (rev 8024)
@@ -1867,27 +1867,27 @@
 fputs ($Connect, "QUIT\r\n");
 fclose($Connect);
 if (!ereg ("^250", $From)) {
- $result[0] = false;
- $result[1] = _("Server rejected address: ") . $From;
+ $result[0]=false;
+ $result[1]="Server rejected address: ". $From;
 return $result;
 }
 if (!ereg ( "^250", $To )) {
- $result[0] = false;
- $result[1] = _("Server rejected address: ") . $To;
+ $result[0]=false;
+ $result[1]="Server rejected address: ". $To;
 return $result;
 }
 } else {
 $result[0] = false;
- $result[1] = _("No response from server");
+ $result[1] = "No response from server";
 return $result;
 }
 } else {
- $result[0] = false;
- $result[1] = _("Cannot connect e-mail server.");
+ $result[0]=false;
+ $result[1]="Cannot connect e-mail server.";
 return $result;
 }
- $result[0] = true;
- $result[1] = sprintf(_("E-mail address '%s' appears to be valid."), $email);
+ $result[0]=true;
+ $result[1]="E-mail address '$email' appears to be valid.";
 return $result;
 } // end of function
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2011年05月18日 15:45:09
Revision: 8072
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8072&view=rev
Author: vargenau
Date: 2011年05月18日 15:45:03 +0000 (2011年5月18日)
Log Message:
-----------
Fix header
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2011年05月18日 14:56:14 UTC (rev 8071)
+++ trunk/lib/WikiUserNew.php	2011年05月18日 15:45:03 UTC (rev 8072)
@@ -1,25 +1,26 @@
 <?php //-*-php-*-
 //$Id$
 /* Copyright (C) 2004,2005,2006,2007,2009,2010 $ThePhpWikiProgrammingTeam
-* Copyright (C) 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent
-* Copyright (C) 2009-2010 Roger Guignard, Alcatel-Lucent
-*
-* This file is part of PhpWiki.
-*
-* PhpWiki is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* PhpWiki is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with PhpWiki; if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
+ * Copyright (C) 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent
+ * Copyright (C) 2009-2010 Roger Guignard, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
 /**
 * This is a complete OOP rewrite of the old WikiUser code with various
 * configurable external authentication methods.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2012年11月26日 14:54:41
Revision: 8541
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8541&view=rev
Author: vargenau
Date: 2012年11月26日 14:54:34 +0000 (2012年11月26日)
Log Message:
-----------
Add {}
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2012年11月26日 14:35:56 UTC (rev 8540)
+++ trunk/lib/WikiUserNew.php	2012年11月26日 14:54:34 UTC (rev 8541)
@@ -1769,13 +1769,17 @@
 function sanify($value)
 {
 // e-mail address is already checked by FusionForge
- if (FUSIONFORGE) return $value;
+ if (FUSIONFORGE) {
+ return $value;
+ }
 // check for valid email address
- if ($this->get('email') == $value and $this->getraw('emailVerified'))
+ if ($this->get('email') == $value and $this->getraw('emailVerified')) {
 return $value;
+ }
 // hack!
- if ($value == 1 or $value === true)
+ if ($value == 1 or $value === true) {
 return $value;
+ }
 list($ok, $msg) = ValidateMail($value, 'noconnect');
 if ($ok) {
 return $value;
@@ -1792,12 +1796,17 @@
 function update($value)
 {
 // e-mail address is already checked by FusionForge
- if (FUSIONFORGE) return $value;
- if (!empty($this->_init)) return;
+ if (FUSIONFORGE) {
+ return $value;
+ }
+ if (!empty($this->_init)) {
+ return;
+ }
 $verified = $this->getraw('emailVerified');
 // hack!
- if (($value == 1 or $value === true) and $verified)
+ if (($value == 1 or $value === true) and $verified) {
 return;
+ }
 if (!empty($value) and !$verified) {
 list($ok, $msg) = ValidateMail($value);
 if ($ok and mail($value, "[" . WIKI_NAME . "] " . _("E-mail address confirmation"),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2012年11月26日 15:13:47
Revision: 8542
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8542&view=rev
Author: vargenau
Date: 2012年11月26日 15:13:37 +0000 (2012年11月26日)
Log Message:
-----------
Always return
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2012年11月26日 14:54:34 UTC (rev 8541)
+++ trunk/lib/WikiUserNew.php	2012年11月26日 15:13:37 UTC (rev 8542)
@@ -395,8 +395,11 @@
 
 function UserName()
 {
- if (!empty($this->_userid))
+ if (!empty($this->_userid)) {
 return $this->_userid;
+ } else {
+ return '';
+ }
 }
 
 function getPreferences()
@@ -1519,8 +1522,11 @@
 
 function getraw($name)
 {
- if (!empty($this->{$name}))
+ if (!empty($this->{$name})) {
 return $this->{$name};
+ } else {
+ return '';
+ }
 }
 
 // stores the value as $this->$name, and not as $this->value (clever?)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2012年11月26日 15:21:13
Revision: 8543
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8543&view=rev
Author: vargenau
Date: 2012年11月26日 15:21:04 +0000 (2012年11月26日)
Log Message:
-----------
Do not return value
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2012年11月26日 15:13:37 UTC (rev 8542)
+++ trunk/lib/WikiUserNew.php	2012年11月26日 15:21:04 UTC (rev 8543)
@@ -1803,7 +1803,7 @@
 {
 // e-mail address is already checked by FusionForge
 if (FUSIONFORGE) {
- return $value;
+ return;
 }
 if (!empty($this->_init)) {
 return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <var...@us...> - 2012年12月27日 11:05:55
Revision: 8691
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8691&view=rev
Author: vargenau
Date: 2012年12月27日 11:05:49 +0000 (2012年12月27日)
Log Message:
-----------
Remove commented code
Modified Paths:
--------------
 trunk/lib/WikiUserNew.php
Modified: trunk/lib/WikiUserNew.php
===================================================================
--- trunk/lib/WikiUserNew.php	2012年12月27日 11:04:56 UTC (rev 8690)
+++ trunk/lib/WikiUserNew.php	2012年12月27日 11:05:49 UTC (rev 8691)
@@ -750,8 +750,7 @@
 * function too!).
 */
 if (!$UserName || $UserName == @$unboxedcookie['userid']) {
- $updated = $this->_prefs->updatePrefs($unboxedcookie);
- //$this->_prefs = new UserPreferences($unboxedcookie);
+ $this->_prefs->updatePrefs($unboxedcookie);
 $UserName = @$unboxedcookie['userid'];
 if (is_string($UserName) and (substr($UserName, 0, 2) != 's:'))
 $this->_userid = $UserName;
@@ -766,8 +765,7 @@
 if (!$UserName and ($cookie = $request->cookies->get_old("WIKI_PREF2"))) {
 if (!$unboxedcookie = $this->_prefs->retrieve($cookie)) {
 if (!$UserName || $UserName == $unboxedcookie['userid']) {
- $updated = $this->_prefs->updatePrefs($unboxedcookie);
- //$this->_prefs = new UserPreferences($unboxedcookie);
+ $this->_prefs->updatePrefs($unboxedcookie);
 $UserName = $unboxedcookie['userid'];
 if (is_string($UserName) and (substr($UserName, 0, 2) != 's:'))
 $this->_userid = $UserName;
@@ -816,7 +814,7 @@
 $updated = $this->_prefs->updatePrefs($prefs);
 $prefs =& $this->_prefs;
 } else {
- // update the prefs values from scratch. This could leed to unnecessary
+ // update the prefs values from scratch. This could lead to unnecessary
 // side-effects: duplicate emailVerified, ...
 $this->_prefs = new UserPreferences($prefs);
 $updated = true;
@@ -1183,8 +1181,7 @@
 if ($restored_from_page = $this->_prefs->retrieve
 ($this->_HomePagehandle->get('pref'))
 ) {
- $updated = $this->_prefs->updatePrefs($restored_from_page, 'init');
- //$this->_prefs = new UserPreferences($restored_from_page);
+ $this->_prefs->updatePrefs($restored_from_page, 'init');
 return $this->_prefs;
 }
 }
@@ -2285,74 +2282,6 @@
 }
 }
 
-/** TODO: new pref storage classes
- * These are currently user specific and should be rewritten to be pref specific.
- * i.e. $this == $user->_prefs
- */
-/*
-class CookieUserPreferences
-extends UserPreferences
-{
- function CookieUserPreferences ($saved_prefs = false) {
- //_AnonUser::_AnonUser('',$saved_prefs);
- UserPreferences::UserPreferences($saved_prefs);
- }
-}
-
-class PageUserPreferences
-extends UserPreferences
-{
- function PageUserPreferences ($saved_prefs = false) {
- UserPreferences::UserPreferences($saved_prefs);
- }
-}
-
-class PearDbUserPreferences
-extends UserPreferences
-{
- function PearDbUserPreferences ($saved_prefs = false) {
- UserPreferences::UserPreferences($saved_prefs);
- }
-}
-
-class AdoDbUserPreferences
-extends UserPreferences
-{
- function AdoDbUserPreferences ($saved_prefs = false) {
- UserPreferences::UserPreferences($saved_prefs);
- }
- function getPreferences() {
- // override the generic slow method here for efficiency
- _AnonUser::getPreferences();
- $this->getAuthDbh();
- if (isset($this->_select)) {
- $dbh = & $this->_auth_dbi;
- $rs = $dbh->Execute(sprintf($this->_select,$dbh->qstr($this->_userid)));
- if ($rs->EOF) {
- $rs->Close();
- } else {
- $prefs_blob = $rs->fields['pref_blob'];
- $rs->Close();
- if ($restored_from_db = $this->_prefs->retrieve($prefs_blob)) {
- $updated = $this->_prefs->updatePrefs($restored_from_db);
- //$this->_prefs = new UserPreferences($restored_from_db);
- return $this->_prefs;
- }
- }
- }
- if (empty($this->_prefs->_prefs) and $this->_HomePagehandle) {
- if ($restored_from_page = $this->_prefs->retrieve
- ($this->_HomePagehandle->get('pref'))) {
- $updated = $this->_prefs->updatePrefs($restored_from_page);
- //$this->_prefs = new UserPreferences($restored_from_page);
- return $this->_prefs;
- }
- }
- return $this->_prefs;
- }
-}
-*/
-
 // Local Variables:
 // mode: php
 // tab-width: 8
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /