From: <var...@us...> - 2008-09-07 14:48:02
|
Revision: 6246 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6246&view=rev Author: vargenau Date: 2008-09-07 14:48:12 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Removed history Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2008-09-07 14:45:58 UTC (rev 6245) +++ trunk/lib/WikiUser.php 2008-09-07 14:48:12 UTC (rev 6246) @@ -758,245 +758,6 @@ } } -// $Log: not supported by cvs2svn $ -// Revision 1.69 2008/02/14 18:32:36 rurban -// signin fixes for !ENABLE_USER_NEW (to overcome php-5.2 recursion login problems) -// -// Revision 1.68 2007/07/14 17:55:30 rurban -// SemanticWeb.php -// -// Revision 1.67 2006/03/19 15:01:01 rurban -// sf.net patch #1333957 by Matt Brown: Authentication cookie identical across all wikis on a host -// -// Revision 1.66 2006/03/07 20:45:44 rurban -// wikihash for php-5.1 -// -// Revision 1.65 2005/06/05 05:38:02 rurban -// Default ENABLE_DOUBLECLICKEDIT = false. Moved to UserPreferences -// -// Revision 1.64 2005/02/08 13:25:50 rurban -// encrypt password. fix strict logic. -// both bugs reported by Mikhail Vladimirov -// -// Revision 1.63 2005/01/21 14:07:50 rurban -// reformatting -// -// Revision 1.62 2004/11/21 11:59:16 rurban -// remove final \n to be ob_cache independent -// -// Revision 1.61 2004/10/21 21:02:04 rurban -// fix seperate page login -// -// Revision 1.60 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.59 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.58 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.57 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.56 2004/06/03 12:36:03 rurban -// fix eval warning on signin -// -// Revision 1.55 2004/06/03 09:39:51 rurban -// fix LDAP injection (wildcard in username) detected by Steve Christey, MITRE -// -// Revision 1.54 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.53 2004/04/10 05:34:35 rurban -// sf bug#830912 -// -// Revision 1.52 2004/04/10 02:55:48 rurban -// fixed old WikiUser -// -// Revision 1.51 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.50 2004/02/26 01:32:03 rurban -// fixed session login with old WikiUser object. strangely, the errormask gets corruoted to 1, Pear??? -// -// Revision 1.49 2004/02/15 21:34:37 rurban -// PageList enhanced and improved. -// fixed new WikiAdmin... plugins -// editpage, Theme with exp. htmlarea framework -// (htmlarea yet committed, this is really questionable) -// WikiUser... code with better session handling for prefs -// enhanced UserPreferences (again) -// RecentChanges for show_deleted: how should pages be deleted then? -// -// Revision 1.48 2004/02/01 09:14:11 rurban -// Started with Group_Ldap (not yet ready) -// added new _AuthInfo plugin to help in auth problems (warning: may display passwords) -// fixed some configurator vars -// renamed LDAP_AUTH_SEARCH to LDAP_BASE_DN -// changed PHPWIKI_VERSION from 1.3.8a to 1.3.8pre -// USE_DB_SESSION defaults to true on SQL -// changed GROUP_METHOD definition to string, not constants -// changed sample user DBAuthParams from UPDATE to REPLACE to be able to -// create users. (Not to be used with external databases generally, but -// with the default internal user table) -// -// fixed the IndexAsConfigProblem logic. this was flawed: -// scripts which are the same virtual path defined their own lib/main call -// (hmm, have to test this better, phpwiki.sf.net/demo works again) -// -// Revision 1.47 2004/01/27 23:23:39 rurban -// renamed ->Username => _userid for consistency -// renamed mayCheckPassword => mayCheckPass -// fixed recursion problem in WikiUserNew -// fixed bogo login (but not quite 100% ready yet, password storage) -// -// Revision 1.46 2004/01/26 09:17:48 rurban -// * changed stored pref representation as before. -// the array of objects is 1) bigger and 2) -// less portable. If we would import packed pref -// objects and the object definition was changed, PHP would fail. -// This doesn't happen with an simple array of non-default values. -// * use $prefs->retrieve and $prefs->store methods, where retrieve -// understands the interim format of array of objects also. -// * simplified $prefs->get() and fixed $prefs->set() -// * added $user->_userid and class '_WikiUser' portability functions -// * fixed $user object ->_level upgrading, mostly using sessions. -// this fixes yesterdays problems with loosing authorization level. -// * fixed WikiUserNew::checkPass to return the _level -// * fixed WikiUserNew::isSignedIn -// * added explodePageList to class PageList, support sortby arg -// * fixed UserPreferences for WikiUserNew -// * fixed WikiPlugin for empty defaults array -// * UnfoldSubpages: added pagename arg, renamed pages arg, -// removed sort arg, support sortby arg -// -// Revision 1.45 2003/12/09 20:00:43 carstenklapp -// Bugfix: The last BogoUserPrefs-bugfix prevented the admin from saving -// prefs into his own homepage, fixed broken logic. Tightened up BogoUser -// prefs saving ability by checking for true existance of homepage -// (previously a page revision of 0 also counted as valid, again due to -// somewhat flawed logic). -// -// Revision 1.44 2003/12/06 04:56:23 carstenklapp -// Security bugfix (minor): Prevent BogoUser~s from saving extraneous -// _pref object meta-data within locked pages. -// -// Previously, BogoUser~s who signed in with a (valid) WikiWord such as -// "HomePage" could actually save preferences into that page, even though -// it was already locked by the administrator. Thus, any subsequent -// WikiLink~s to that page would become prefixed with "that nice little" -// UserIcon, as if that page represented a valid user. -// -// Note that the admin can lock (even) non-existant pages as desired or -// necessary (i.e. any DB page whose revision==0), to prevent the -// arbitrary BogoUser from saving preference metadata into such a page; -// for example, the silly WikiName "@qmgi`Vcft_x|" (that is the -// \$examplechars presented in login.tmpl, in case it is not visible here -// in the CVS comments). -// -// http://phpwiki.sourceforge.net/phpwiki/ -// %C0%F1%ED%E7%E9%E0%D6%E3%E6%F4%DF%F8%FC?action=lock -// -// To remove the prefs metadata from a page, the admin can use the -// EditMetaData plugin, enter pref as the key, leave the value box empty -// and then submit the change. For example: -// -// http://phpwiki.sourceforge.net/phpwiki/ -// _EditMetaData?page=%C0%F1%ED%E7%E9%E0%D6%E3%E6%F4%DF%F8%FC -// -// (It seems a rethinking of WikiUserNew.php with its WikiUser and -// UserPreferences classes is in order. Ideally the WikiDB would -// transparently handle such a situation, perhaps BogoUser~s should -// simply be restricted to saving preferences into a cookie until his/her -// e-mail address has been verified.) -// -// Revision 1.43 2003/12/04 19:33:30 carstenklapp -// Bugfix: Under certain PhpWiki installations (such as the PhpWiki at -// SF), the user was unable to select a theme other than the server's -// default. (Use the more robust Theme::findFile instead of PHP's -// file_exists function to detect installed themes). -// -// Revision 1.42 2003/11/30 18:18:13 carstenklapp -// Minor code optimization: use include_once instead of require_once -// inside functions that might not always called. -// -// Revision 1.41 2003/11/21 21:32:39 carstenklapp -// Bugfix: When DEFAULT_LANGUAGE was not 'en', a user's language prefs -// would revert to 'en' when the default <system language> was selected -// in UserPreferences and the user saved his preferences. (Check for -// empty or blank language pref in sanify function of class -// _UserPreference_language and return DEFAULT_LANGUAGE if nothing or -// default selected in UserPreferences.) -// -// Revision 1.40 2003/11/21 16:54:58 carstenklapp -// Bugfix: login.tmpl was always displayed in English despite -// DEFAULT_LANGUAGE set in index.php. (Added call to -// update_locale(DEFAULT_LANGUAGE) before printing login form). -// -// Revision 1.39 2003/10/28 21:13:46 carstenklapp -// Security bug fix for admin password, submitted by Julien Charbon. -// -// Revision 1.38 2003/09/13 22:25:38 carstenklapp -// Hook for new user preference 'noLinkIcons'. -// -// Revision 1.37 2003/02/22 20:49:55 dairiki -// Fixes for "Call-time pass by reference has been deprecated" errors. -// -// Revision 1.36 2003/02/21 22:50:51 dairiki -// Ensure that language preference is a string. -// -// Revision 1.35 2003/02/16 20:04:47 dairiki -// Refactor the HTTP validator generation/checking code. -// -// This also fixes a number of bugs with yesterdays validator mods. -// -// Revision 1.34 2003/02/15 02:21:54 dairiki -// API Change! Explicit $request argument added to contructor for WikiUser. -// -// This seemed the best way to fix a problem whereby the WikiDB -// was being opened twice. (Which while being merely inefficient -// when using an SQL backend causes hangage when using a dba backend.) -// -// Revision 1.33 2003/01/22 03:21:40 zorloc -// Modified WikiUser constructor to move the DB request for the homepage to -// the end of the logic to prevent it from being requested and then dropped. -// Added more phpdoc comments. -// -// Revision 1.32 2003/01/21 07:40:50 zorloc -// Modified WikiUser::_ok() -- Inverted the logic so the default is to return -// false and to return true only in the desired condition. Added phpdoc -// comments -// -// Revision 1.31 2003/01/15 05:37:20 carstenklapp -// code reformatting -// -// Revision 1.30 2003/01/15 04:59:27 carstenklapp -// Bugfix: Previously stored preferences were not loading when user -// signed in. (Fixed... I hope.) -// - // Local Variables: // mode: php // tab-width: 8 @@ -1004,4 +765,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-29 12:27:38
|
Revision: 9130 http://sourceforge.net/p/phpwiki/code/9130 Author: vargenau Date: 2014-09-29 12:27:30 +0000 (Mon, 29 Sep 2014) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-09-27 17:53:55 UTC (rev 9129) +++ trunk/lib/WikiUser.php 2014-09-29 12:27:30 UTC (rev 9130) @@ -1929,7 +1929,7 @@ { public $notifyPagesAll; - function UserPreferences($saved_prefs = false) + function __construct($saved_prefs = false) { // userid stored too, to ensure the prefs are being loaded for // the correct (currently signing in) userid if stored in a This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 13:35:45
|
Revision: 9164 http://sourceforge.net/p/phpwiki/code/9164 Author: vargenau Date: 2014-10-03 13:35:42 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function crypt exists Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-10-02 14:47:14 UTC (rev 9163) +++ trunk/lib/WikiUser.php 2014-10-03 13:35:42 UTC (rev 9164) @@ -1308,29 +1308,20 @@ } if (ENCRYPTED_PASSWD) { // Verify against encrypted password. - if (function_exists('crypt')) { - if (crypt($submitted_password, $stored_password) == $stored_password) - return true; // matches encrypted password - else - return false; - } else { - trigger_error(_("The crypt function is not available in this version of PHP.") . " " - . _("Please set ENCRYPTED_PASSWD to false in config/config.ini and probably change ADMIN_PASSWD."), - E_USER_WARNING); + if (crypt($submitted_password, $stored_password) == $stored_password) + return true; // matches encrypted password + else return false; - } } else { // Verify against cleartext password. if ($submitted_password == $stored_password) return true; else { // Check whether we forgot to enable ENCRYPTED_PASSWD - if (function_exists('crypt')) { - if (crypt($submitted_password, $stored_password) == $stored_password) { - trigger_error(_("Please set ENCRYPTED_PASSWD to true in config/config.ini."), - E_USER_WARNING); - return true; - } + if (crypt($submitted_password, $stored_password) == $stored_password) { + trigger_error(_("Please set ENCRYPTED_PASSWD to true in config/config.ini."), + E_USER_WARNING); + return true; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-13 20:10:21
|
Revision: 9310 http://sourceforge.net/p/phpwiki/code/9310 Author: vargenau Date: 2014-11-13 20:10:04 +0000 (Thu, 13 Nov 2014) Log Message: ----------- GeneratePage is void Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-11-12 17:14:28 UTC (rev 9309) +++ trunk/lib/WikiUser.php 2014-11-13 20:10:04 UTC (rev 9310) @@ -500,8 +500,7 @@ } //Fixme: for _HttpAuthPassUser - function PrintLoginForm(&$request, $args, $fail_message = false, - $separate_page = false) + function PrintLoginForm(&$request, $args, $fail_message = '', $separate_page = false) { include_once 'lib/Template.php'; // Call update_locale in case the system's default language is not 'en'. @@ -524,9 +523,9 @@ if ($separate_page) { $page = $request->getPage($pagename); $revision = $page->getCurrentRevision(); - return GeneratePage($login, _("Sign In"), $revision); + GeneratePage($login, _("Sign In"), $revision); } else { - return $login->printExpansion(); + $login->printExpansion(); } } @@ -1035,10 +1034,10 @@ function getAuthDbh() { - global $request; //, $DBParams, $DBAuthParams; + global $request; $dbh = $request->getDbh(); - // session restauration doesn't re-connect to the database automatically, + // session restoration doesn't re-connect to the database automatically, // so dirty it here, to force a reconnect. if (isset($this->_auth_dbi)) { if (($dbh->getParam('dbtype') == 'SQL') and empty($this->_auth_dbi->connection)) @@ -1082,10 +1081,10 @@ } // TODO: use it again for the auth and member tables - // sprintfstyle vs prepare style: %s or ? + // sprintf style vs prepare style: %s or ? // multiple vars should be executed via prepare(?,?)+execute, // single vars with execute(sprintf(quote(var))) - // help with position independency + // help with position independence function prepare($stmt, $variables, $oldstyle = false, $sprintfstyle = true) { global $request; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-17 16:33:05
|
Revision: 9327 http://sourceforge.net/p/phpwiki/code/9327 Author: vargenau Date: 2014-11-17 16:33:00 +0000 (Mon, 17 Nov 2014) Log Message: ----------- Add class variables Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-11-17 16:25:16 UTC (rev 9326) +++ trunk/lib/WikiUser.php 2014-11-17 16:33:00 UTC (rev 9327) @@ -370,6 +370,9 @@ public $_level = WIKIAUTH_ANON; public $_prefs = false; public $_HomePagehandle = false; + public $_auth_methods; + public $_current_method; + public $_current_index; // constructor function _WikiUser($UserName = '', $prefs = false) @@ -937,8 +940,6 @@ { //global $DBAuthParams, $DBParams; if ($UserName) { - /*if (!$this->isValidName($UserName)) - return false;*/ $this->_userid = $UserName; if ($this->hasHomePage()) $this->_HomePagehandle = $GLOBALS['request']->getPage($this->_userid); @@ -1030,6 +1031,7 @@ return $this; } } + return null; } function getAuthDbh() @@ -1739,7 +1741,7 @@ $user = session_get_user(); return $user->getEmail(); } else { - parent::get($name); + return parent::get($name); } } @@ -1917,6 +1919,7 @@ class UserPreferences { public $notifyPagesAll; + public $_init; function __construct($saved_prefs = false) { @@ -2067,7 +2070,8 @@ function updatePrefs($prefs, $init = false) { $count = 0; - if ($init) $this->_init = $init; + if ($init) + $this->_init = $init; if (is_object($prefs)) { $type = 'emailVerified'; $obj =& $this->_prefs['email']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-12-01 09:23:41
|
Revision: 9391 http://sourceforge.net/p/phpwiki/code/9391 Author: vargenau Date: 2014-12-01 09:23:39 +0000 (Mon, 01 Dec 2014) Log Message: ----------- global $request; Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-11-28 16:16:21 UTC (rev 9390) +++ trunk/lib/WikiUser.php 2014-12-01 09:23:39 UTC (rev 9391) @@ -549,12 +549,19 @@ function isAdmin() { + /** + * @var WikiRequest $request + */ + global $request; + static $group; + if ($this->_level == WIKIAUTH_ADMIN) return true; if (!$this->isSignedIn()) return false; if (!$this->isAuthenticated()) return false; - if (!$group) $group = &$request->getGroup(); + if (!$group) + $group = &$request->getGroup(); return ($this->_level > WIKIAUTH_BOGO and $group->isMember(GROUP_ADMIN)); } @@ -616,7 +623,11 @@ if ($logout) { // Log out if (LOGIN_LOG and is_writeable(LOGIN_LOG)) { + /** + * @var WikiRequest $request + */ global $request; + $zone_offset = Request_AccessLogEntry::_zone_offset(); $ncsa_time = date("d/M/Y:H:i:s", time()); $entry = sprintf('%s - %s - [%s %s] "%s" %s - "%s" "%s"', @@ -654,7 +665,11 @@ $authlevel = $this->checkPass($passwd === false ? '' : $passwd); if (LOGIN_LOG and is_writeable(LOGIN_LOG)) { + /** + * @var WikiRequest $request + */ global $request; + $zone_offset = Request_AccessLogEntry::_zone_offset(); $ncsa_time = date("d/M/Y:H:i:s", time()); $manglepasswd = $passwd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-12-02 13:30:45
|
Revision: 9402 http://sourceforge.net/p/phpwiki/code/9402 Author: vargenau Date: 2014-12-02 13:30:43 +0000 (Tue, 02 Dec 2014) Log Message: ----------- abstract class _WikiUser Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-12-02 13:07:03 UTC (rev 9401) +++ trunk/lib/WikiUser.php 2014-12-02 13:30:43 UTC (rev 9402) @@ -304,6 +304,11 @@ */ function UpgradeUser($user, $newuser) { + /** + * @var WikiRequest $request + */ + global $request; + if (is_a($user, '_WikiUser') and is_a($newuser, '_WikiUser')) { // populate the upgraded class $newuser with the values from the current user object //only _auth_level, _current_method, _current_index, @@ -333,37 +338,12 @@ } } -/** - * Probably not needed, since we use the various user objects methods so far. - * Anyway, here it is, looping through all available objects. - */ -function UserExists($UserName) -{ - global $request; - if (!($user = $request->getUser())) - $user = WikiUser($UserName); - if (!$user) - return false; - if ($user->userExists($UserName)) { - $request->_user = $user; - return true; - } - if (is_a($user, '_BogoUser')) - $user = new _PassUser($UserName, $user->_prefs); - $class = $user->nextClass(); - if ($user = new $class($UserName, $user->_prefs)) { - return $user->userExists($UserName); - } - $request->_user = $GLOBALS['ForbiddenUser']; - return false; -} - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Base WikiUser class. */ -class _WikiUser +abstract class _WikiUser { public $_userid = ''; public $_level = WIKIAUTH_ANON; @@ -397,34 +377,16 @@ } } - function getPreferences() - { - trigger_error("DEBUG: Note: undefined _WikiUser class trying to load prefs." . " " - . "New subclasses of _WikiUser must override this function."); - return false; - } + abstract function getPreferences(); - function setPreferences($prefs, $id_only) - { - trigger_error("DEBUG: Note: undefined _WikiUser class trying to save prefs." - . " " - . "New subclasses of _WikiUser must override this function."); - return false; - } + abstract function setPreferences($prefs, $id_only); function userExists() { return $this->hasHomePage(); } - function checkPass($submitted_password) - { - // By definition, an undefined user class cannot sign in. - trigger_error("DEBUG: Warning: undefined _WikiUser class trying to sign in." - . " " - . "New subclasses of _WikiUser must override this function."); - return false; - } + abstract function checkPass($submitted_password); // returns page_handle to user's home page or false if none function hasHomePage() @@ -446,7 +408,11 @@ function createHomePage() { + /** + * @var WikiRequest $request + */ global $request; + $versiondata = array('author' => ADMIN_USER); $request->_dbi->save(_("Automatically created user homepage to be able to store UserPreferences.") . "\n{{Template/UserPage}}", @@ -747,6 +713,9 @@ */ function getPreferences() { + /** + * @var WikiRequest $request + */ global $request; if (empty($this->_prefs)) @@ -847,7 +816,11 @@ } if ($updated) { if ($id_only and !headers_sent()) { + /** + * @var WikiRequest $request + */ global $request; + // new 1.3.8 policy: no array cookies, only plain userid string as in // the pre 1.3.x versions. // prefs should be stored besides the session in the homepagehandle or in a db. @@ -951,8 +924,13 @@ * @tables: pref */ { - public $_auth_dbi, $_prefs; - public $_current_method, $_current_index; + public $_auth_dbi; + /** + * @var UserPreferences $_prefs + */ + public $_prefs; + public $_current_method; + public $_current_index; // check and prepare the auth and pref methods only once function _PassUser($UserName = '', $prefs = false) @@ -1059,6 +1037,9 @@ function getAuthDbh() { + /** + * @var WikiRequest $request + */ global $request; $dbh = $request->getDbh(); @@ -1112,7 +1093,11 @@ // help with position independence function prepare($stmt, $variables, $oldstyle = false, $sprintfstyle = true) { + /** + * @var WikiRequest $request + */ global $request; + $dbi = $request->getDbh(); $this->getAuthDbh(); // "'\$userid"' => %s @@ -1212,6 +1197,11 @@ function setPreferences($prefs, $id_only = false) { + /** + * @var WikiRequest $request + */ + global $request; + if (!empty($this->_prefs->_method)) { if ($this->_prefs->_method == 'ADODB') { // FIXME: strange why this should be needed... @@ -1636,6 +1626,11 @@ function update($newvalue) { + /** + * @var WikiRequest $request + */ + global $request; + if (!$this->_init) { // invalidate etag to force fresh output $request->setValidators(array('%mtime' => false)); @@ -1807,6 +1802,11 @@ */ function update($value) { + /** + * @var WikiRequest $request + */ + global $request; + // e-mail address is already checked by FusionForge if (defined('FUSIONFORGE') and FUSIONFORGE) { return; @@ -1958,6 +1958,10 @@ { public $notifyPagesAll; public $_init; + public $_prefs; + public $_select; + public $_method; + public $_update; function __construct($saved_prefs = false) { @@ -2301,8 +2305,6 @@ if (substr($packed, 0, 2) == "a:") { return unserialize($packed); } - //trigger_error("DEBUG: Can't unpack bad UserPreferences", - //E_USER_WARNING); return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-03-04 16:07:34
|
Revision: 9600 http://sourceforge.net/p/phpwiki/code/9600 Author: vargenau Date: 2015-03-04 16:07:32 +0000 (Wed, 04 Mar 2015) Log Message: ----------- Extend scope of global $request Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2015-03-04 16:01:30 UTC (rev 9599) +++ trunk/lib/WikiUser.php 2015-03-04 16:07:32 UTC (rev 9600) @@ -587,13 +587,13 @@ extract($args); $require_level = max(0, min(WIKIAUTH_ADMIN, (int)$require_level)); + /** + * @var WikiRequest $request + */ + global $request; + if ($logout) { // Log out if (LOGIN_LOG and is_writeable(LOGIN_LOG)) { - /** - * @var WikiRequest $request - */ - global $request; - $zone_offset = Request_AccessLogEntry::_zone_offset(); $ncsa_time = date("d/M/Y:H:i:s", time()); $entry = sprintf('%s - %s - [%s %s] "%s" %s - "%s" "%s"', @@ -631,11 +631,6 @@ $authlevel = $this->checkPass($passwd === false ? '' : $passwd); if (LOGIN_LOG and is_writeable(LOGIN_LOG)) { - /** - * @var WikiRequest $request - */ - global $request; - $zone_offset = Request_AccessLogEntry::_zone_offset(); $ncsa_time = date("d/M/Y:H:i:s", time()); $manglepasswd = $passwd; @@ -697,7 +692,6 @@ $this->_level = $authlevel; return $this; } - } /** @@ -826,8 +820,6 @@ // prefs should be stored besides the session in the homepagehandle or in a db. $request->setCookieVar(getCookieName(), $this->_userid, COOKIE_EXPIRATION_DAYS, COOKIE_DOMAIN); - //$request->setCookieVar(WIKI_NAME, array('userid' => $prefs->get('userid')), - // COOKIE_EXPIRATION_DAYS, COOKIE_DOMAIN); } } if (is_object($prefs)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-07 09:38:22
|
Revision: 9758 http://sourceforge.net/p/phpwiki/code/9758 Author: vargenau Date: 2016-01-07 09:38:20 +0000 (Thu, 07 Jan 2016) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2016-01-07 09:32:29 UTC (rev 9757) +++ trunk/lib/WikiUser.php 2016-01-07 09:38:20 UTC (rev 9758) @@ -353,10 +353,8 @@ public $_current_method; public $_current_index; - // constructor - function _WikiUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { - $this->_userid = $UserName; $this->_HomePagehandle = false; if ($UserName) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-01-11 12:14:45
|
Revision: 9996 http://sourceforge.net/p/phpwiki/code/9996 Author: vargenau Date: 2017-01-11 12:14:43 +0000 (Wed, 11 Jan 2017) Log Message: ----------- Remove obsolete comment Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2016-12-16 14:53:55 UTC (rev 9995) +++ trunk/lib/WikiUser.php 2017-01-11 12:14:43 UTC (rev 9996) @@ -1298,8 +1298,6 @@ * the db password method is 'plain', which means that the DB SQL * statement just returns 1 or 0. To use CRYPT() or PASSWORD() and * don't store plain passwords in the DB. - * - * TODO: remove crypt() function check from config.php:396 ?? */ function _checkPass($submitted_password, $stored_password) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-01-11 15:07:20
|
Revision: 9998 http://sourceforge.net/p/phpwiki/code/9998 Author: vargenau Date: 2017-01-11 15:07:17 +0000 (Wed, 11 Jan 2017) Log Message: ----------- Remove obsolete comment Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2017-01-11 12:26:18 UTC (rev 9997) +++ trunk/lib/WikiUser.php 2017-01-11 15:07:17 UTC (rev 9998) @@ -1096,7 +1096,6 @@ $this->getAuthDbh(); // "'\$userid"' => %s // variables can be old-style: '"\$userid"' or new-style: "'$userid'" or just "userid" - // old-style strings don't survive pear/Config/IniConfig treatment, that's why we changed it. $new = array(); if (is_array($variables)) { //$sprintfstyle = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2020-12-31 17:52:45
|
Revision: 10217 http://sourceforge.net/p/phpwiki/code/10217 Author: vargenau Date: 2020-12-31 17:52:38 +0000 (Thu, 31 Dec 2020) Log Message: ----------- Fix "Automatically created user homepage to be able to store UserPreferences." Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2020-12-31 16:53:59 UTC (rev 10216) +++ trunk/lib/WikiUser.php 2020-12-31 17:52:38 UTC (rev 10217) @@ -416,10 +416,12 @@ global $request; $versiondata = array('author' => ADMIN_USER); - $request->_dbi->save(_("Automatically created user homepage to be able to store UserPreferences.") . + $dbi =& $request->_dbi; + $page = $dbi->getPage(ADMIN_USER); + $page->save(_("Automatically created user homepage to be able to store UserPreferences.") . "\n{{Template/UserPage}}", 1, $versiondata); - $request->_dbi->touch(); + $dbi->touch(); $this->_HomePagehandle = $request->getPage($this->_userid); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2019-07-20 16:34:33
|
Revision: 10128 http://sourceforge.net/p/phpwiki/code/10128 Author: vargenau Date: 2019-07-20 16:34:29 +0000 (Sat, 20 Jul 2019) Log Message: ----------- Make login work in PHP 7 Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2019-07-20 03:42:55 UTC (rev 10127) +++ trunk/lib/WikiUser.php 2019-07-20 16:34:29 UTC (rev 10128) @@ -1159,15 +1159,18 @@ // FIXME: strange why this should be needed... include_once 'lib/WikiUser/Db.php'; include_once 'lib/WikiUser/AdoDb.php'; - return _AdoDbPassUser::getPreferences(); + $pref = new _AdoDbPassUser(); + return $pref->getPreferences(); } elseif ($this->_prefs->_method == 'SQL') { include_once 'lib/WikiUser/Db.php'; include_once 'lib/WikiUser/PearDb.php'; - return _PearDbPassUser::getPreferences(); + $pref = new _PearDbPassUser(); + return $pref->getPreferences(); } elseif ($this->_prefs->_method == 'PDO') { include_once 'lib/WikiUser/Db.php'; include_once 'lib/WikiUser/PdoDb.php'; - return _PdoDbPassUser::getPreferences(); + $pref = new _PdoDbPassUser(); + return $pref->getPreferences(); } } @@ -1200,15 +1203,18 @@ // 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); + $pref = new _AdoDbPassUser(); + return $pref->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); + $pref = new _PearDbPassUser(); + return $pref->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); + $pref = new _PdoDbPassUser(); + return $pref->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...> - 2019-09-02 16:15:35
|
Revision: 10146 http://sourceforge.net/p/phpwiki/code/10146 Author: vargenau Date: 2019-09-02 16:15:33 +0000 (Mon, 02 Sep 2019) Log Message: ----------- Improve getPreferences() Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2019-09-02 16:05:04 UTC (rev 10145) +++ trunk/lib/WikiUser.php 2019-09-02 16:15:33 UTC (rev 10146) @@ -1159,18 +1159,21 @@ // FIXME: strange why this should be needed... include_once 'lib/WikiUser/Db.php'; include_once 'lib/WikiUser/AdoDb.php'; - $pref = new _AdoDbPassUser(); - return $pref->getPreferences(); + $user = new _AdoDbPassUser(); + $this->_prefs = $user->getPreferences(); + return $this->_prefs; } elseif ($this->_prefs->_method == 'SQL') { include_once 'lib/WikiUser/Db.php'; include_once 'lib/WikiUser/PearDb.php'; - $pref = new _PearDbPassUser(); - return $pref->getPreferences(); + $user = new _PearDbPassUser(); + $this->_prefs = $user->getPreferences(); + return $this->_prefs; } elseif ($this->_prefs->_method == 'PDO') { include_once 'lib/WikiUser/Db.php'; include_once 'lib/WikiUser/PdoDb.php'; - $pref = new _PdoDbPassUser(); - return $pref->getPreferences(); + $user = new _PdoDbPassUser(); + $this->_prefs = $user->getPreferences(); + return $this->_prefs; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2020-12-30 08:40:38
|
Revision: 10212 http://sourceforge.net/p/phpwiki/code/10212 Author: vargenau Date: 2020-12-30 08:40:36 +0000 (Wed, 30 Dec 2020) Log Message: ----------- Fix typo: $this->_prefs Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2020-12-28 21:15:19 UTC (rev 10211) +++ trunk/lib/WikiUser.php 2020-12-30 08:40:36 UTC (rev 10212) @@ -1452,7 +1452,7 @@ // Should not happen! Only ADMIN_USER should use this class. // return $this->_tryNextPass($submitted_password); // ??? // TODO: safety check if really member of the ADMIN group? - $stored_password = $this->_pref->get('passwd'); + $stored_password = $this->_prefs->get('passwd'); } if ($this->_checkPass($submitted_password, $stored_password)) { $this->_level = WIKIAUTH_ADMIN; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2020-12-30 08:42:50
|
Revision: 10213 http://sourceforge.net/p/phpwiki/code/10213 Author: vargenau Date: 2020-12-30 08:42:48 +0000 (Wed, 30 Dec 2020) Log Message: ----------- Remove redundant ; Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2020-12-30 08:40:36 UTC (rev 10212) +++ trunk/lib/WikiUser.php 2020-12-30 08:42:48 UTC (rev 10213) @@ -628,7 +628,6 @@ if (!$this->isValidName($userid)) return _("Invalid username."); - ; $authlevel = $this->checkPass($passwd === false ? '' : $passwd); @@ -1538,7 +1537,6 @@ // default: no side-effects function update($value) { - ; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2020-12-30 08:46:58
|
Revision: 10214 http://sourceforge.net/p/phpwiki/code/10214 Author: vargenau Date: 2020-12-30 08:46:50 +0000 (Wed, 30 Dec 2020) Log Message: ----------- Use same parameter name as parent Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2020-12-30 08:42:48 UTC (rev 10213) +++ trunk/lib/WikiUser.php 2020-12-30 08:46:50 UTC (rev 10214) @@ -1624,7 +1624,7 @@ return (string)$value; } - function update($newvalue) + function update($value) { /** * @var WikiRequest $request @@ -1634,7 +1634,7 @@ if (!$this->_init) { // invalidate etag to force fresh output $request->setValidators(array('%mtime' => false)); - update_locale($newvalue ? $newvalue : $GLOBALS['LANG']); + update_locale($value ? $value : $GLOBALS['LANG']); } } } @@ -1654,7 +1654,7 @@ return $this->default_value; } - function update($newvalue) + function update($value) { global $WikiTheme; /** @@ -1665,8 +1665,8 @@ // invalidate etag to force fresh output if (!$this->_init) $request->setValidators(array('%mtime' => false)); - if ($newvalue) - include_once($this->_themefile($newvalue)); + if ($value) + include_once($this->_themefile($value)); if (empty($WikiTheme)) include_once($this->_themefile(THEME)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-01-05 18:39:07
|
Revision: 10228 http://sourceforge.net/p/phpwiki/code/10228 Author: vargenau Date: 2021-01-05 18:39:04 +0000 (Tue, 05 Jan 2021) Log Message: ----------- Already true Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2021-01-05 10:36:14 UTC (rev 10227) +++ trunk/lib/WikiUser.php 2021-01-05 18:39:04 UTC (rev 10228) @@ -720,7 +720,7 @@ $UserName = $this->UserName(); if (!$UserName) { - if (!$UserName and !headers_sent()) + if (!headers_sent()) $request->deleteCookieVar(getCookieName()); else $this->_userid = $UserName; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-01-16 17:44:57
|
Revision: 10237 http://sourceforge.net/p/phpwiki/code/10237 Author: vargenau Date: 2021-01-16 17:44:56 +0000 (Sat, 16 Jan 2021) Log Message: ----------- Add default value for id_only in function setPreferences Modified Paths: -------------- trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2021-01-09 12:07:29 UTC (rev 10236) +++ trunk/lib/WikiUser.php 2021-01-16 17:44:56 UTC (rev 10237) @@ -381,7 +381,7 @@ abstract function getPreferences(); - abstract function setPreferences($prefs, $id_only); + abstract function setPreferences($prefs, $id_only = false); function userExists() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |