Commit graph

382 commits

Author SHA1 Message Date
Alexandre Emsenhuber
b1b5f90a9d Remove unused global declaration of $wgCookiePrefix in User::clearCookie() 2008-04-17 13:13:51 +00:00
Brion Vibber
887d579543 * Clean up cookie setting code in User
* Don't clear the token cookie when mailing a password -- this may belong to a different user entirely! If it's the same user, then no harm; the old cookie just won't have any affect. If they're making someone else's account, this will avoid clearing their own token.
2008-04-16 22:59:13 +00:00
Andrew Garrett
5b8231ddba Don't give PHP warnings for PHP<5.2 2008-04-15 11:55:23 +00:00
Tim Starling
41d4882681 In User:
* Defer load of groups data
* Introduce newFromRow()/loadFromRow() to allow bulk loading of user objects from a result set
* Hook email and email authentication save/load to allow CentralAuth to provide a global email address
* Defer save of user data after confirmEmail() and invalidateEmail(). Caller must now also call saveSettings(). This reduces the master query count in some code paths.

Elsewhere:
* Introduce UserArray class, for bulk loading of user objects. Immediately useful in email notification, potentially useful for proposed user alias feature.
* In Special:Confirmemail, remove useless handling for impossible false return from confirmEmail()/invalidateEmail().
2008-04-15 09:04:45 +00:00
Andrew Garrett
32bb81359b Allow setting httponly on auth cookies. 2008-04-15 00:06:32 +00:00
Aaron Schulz
a4ccdcf18f Add comment 2008-04-14 19:20:17 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Aaron Schulz
7dbb373ef2 * Move useRCPatrol() to User
* Add useNPPatrol()
2008-04-13 17:37:41 +00:00
Andrew Garrett
ac930bf819 Modify UserLoginComplete and UserLogoutComplete hooks to allow HTML injection into the success page by hooks. For CentralAuth 'global logging in' 2008-04-09 12:44:53 +00:00
Brion Vibber
d5e9d4e3f5 * (bug 13540) Date format in confirmation e-mail now matches message language 2008-03-28 20:17:55 +00:00
Greg Sabino Mullane
3df1272003 Apply timestampOrNull in the correct place, thanks to Brion for catching this. 2008-03-28 03:35:12 +00:00
Brion Vibber
bdee5a4f1a Revert r32525 -- general processing should use TS_MW format consistently.
$db->timestamp() & $db->timestampOrNull() are to be used at the border between general processing and database access.
2008-03-28 00:48:40 +00:00
Greg Sabino Mullane
4cf4172c14 Use database's timestampOrNull(), not the global one, as we're writing the values back to the DB. 2008-03-27 21:50:04 +00:00
Brion Vibber
2666b3c035 * (bug 13450) Email confirmation can now be canceled before the expiration
patch by MrZ-man - https://bugzilla.wikimedia.org/attachment.cgi?id=4764
Plus text strings copied back from https://bugzilla.wikimedia.org/attachment.cgi?id=4761
2008-03-25 22:03:00 +00:00
Aryeh Gregor
b9a8ffba8b Actually, revert r32370. It might be a good idea, but it breaks the UserGetRights hook (more than it already is). Could use some more thought. 2008-03-24 13:47:16 +00:00
Aryeh Gregor
73c025c25c Moving some optimization code into User::isAllowed instead of higher up in Title.php. Also, adding a comment so that people maybe aren't going to randomly remove it without thinking what it does. ;) 2008-03-24 13:40:45 +00:00
Aryeh Gregor
c2f8e932d8 Improve on r32014 with a helper function to avoid code duplication/possible inconsistency. Would it be nice to start using this more, or should we just keep all the deprecated functions forever and not whine about it? 2008-03-16 00:50:14 +00:00
Niklas Laxström
9df197441a * Throw some E_USER_NOTICES that developers may actually notice if they are still using deprecated functions 2008-03-15 10:50:51 +00:00
Brion Vibber
a8b32e0e3c Add some debugging notes to User::isValidUserName() rejections 2008-03-05 00:08:34 +00:00
Tim Starling
792e155bd2 * Put both hidden categories and normal categories into the view page HTML, but with hidden categories being unconditionally hidden with CSS. A JS show/hide toggle can be added in user/site JS.
* Add user preference to always show hidden categories
* Add all hidden categories to [[Category:Hidden categories]], localised by hidden-category-category
* Add wgVariantArticlePath and wgActionPaths to the JS variables script, needed to determine title from link href.
2008-02-25 16:38:25 +00:00
Brion Vibber
3ddc44c0aa * (bug 11567) Fix error checking for PEAR::Mail. UserMailer::send() now returns
true-or-WikiError, which seems to be the calling convention expected by half
  its callers already
2008-02-13 05:05:53 +00:00
Roan Kattouw
e4ea6b1e47 Removing unused global from User::pingLimiter() 2008-02-01 14:40:14 +00:00
Brion Vibber
a3e1c7fa4f Apply live hack from Wikimedia codebase: add a hook UserCanSendEmail to override User::canSendEmail(); make canReceiveEmail() indenpedent of sending permission check. 2008-01-29 00:29:38 +00:00
Aryeh Gregor
b5c6742eec Comment tweak, remove strcmp(). 2008-01-24 02:00:33 +00:00
Victor Vasiliev
017a62fa5a Autopromotion:
* Add APCOND_INGROUPS
* Fix comment
* Don't use array_unique() since we have groups as *keys* of $wgAutopromote
2008-01-14 18:52:55 +00:00
Tim Starling
7f6453944e Revert r29671, it was based on a misunderstanding of the purpose of the LoggedOut cookie. The LoggedOut cookie is there to suppress the client-side cache, not the server-side cache. It prevents privately cached logged-in pages from being displayed after the user logs out. Feel free to special-case it in squid if you're worried about the server-side cache hit ratio, but note that IMS requests would need special handling.
* Credential data in the session is destroyed, so the session is harmless. But it is still useful for abuse tracking (logout/login sequences) and similar analysis. 
* Not much point in removing the username persistence feature if you can't improve the squid cache hit ratio, which was obviously your goal.
2008-01-13 03:47:07 +00:00
Domas Mituzas
990d7679ed Well, logging out is an action, where people don't want to have any of their their credentials still sit in browser.
Actually, keeping a session is still bad. And trying to ensure that they don't see cached content... Well, thats wrong idea. 
See, if someone is logged out, he is anonymous and deserves to see cached content as everyone else. 

So, let's destroy all cookies.
2008-01-12 23:10:08 +00:00
Thomas Bleher
60731518db Fix some places where globals where used without being declared as
being global. Also remove one unused variable.
2008-01-10 16:51:45 +00:00
Victor Vasiliev
4cc099d5d1 API: add action=logout 2008-01-08 18:10:58 +00:00
Rotem Liss
405c1c356c 'Special-case optimization' seems to be already included in User::getId, in a smarter way; it shouldn't be done in User::isLoggedIn too. 2007-12-27 17:04:17 +00:00
Brion Vibber
e971a41692 User::isAnon() via User::isLoggedIn() has unexpected behavior from an optimization if the data isn't loaded and the referenced name doesn't exist. Not sure if that's desired or not; adding a comment note on the code and using a clearer check in special:userrights 2007-12-27 05:10:03 +00:00
Aryeh Gregor
1ed4c2f2a3 Fixes for r28797.
* Mark private methods private using a keyword.
* Reject arrays with count == 2: these will fail when you do array_slice( ... , 1 ).
* Treat xor consistent with the other operations: if there's only one parameter the result should just evaluate that, not always return false; and any number of parameters should be allowed.
* Fail fast on bad input: throw an exception if Autopromote encounters a condition it can't understand (after asking extensions).
* Code documentation!  There were five lines of comments in the original commit.
* APCONDS_INGROUPS is not used, or for that matter defined.
* Editcount should use >=, not >, for consistency with past behavior and intuitiveness.
* "autopromoteUser" sounds like it's actually promoting the user somehow.  Renamed the function to getAutopromoteGroups.
* Make sure we don't return the same group more than once, when we're returning a group.  Probably not going to hurt, but may as well be clean.
2007-12-23 19:53:49 +00:00
Victor Vasiliev
8a7c8bdec6 Introduce new autopromotion system 2007-12-23 11:38:24 +00:00
Aryeh Gregor
1c1399a3c9 There's no such thing as $this in static functions. Thanks, Nikerabbit. 2007-10-21 18:48:55 +00:00
Aryeh Gregor
5ee4c051b4 isValidEmailAddr hook added to User method of that name, to allow, e.g., restricting e-mail addresses to a specific domain 2007-10-21 17:15:37 +00:00
Tim Starling
353f203ce2 WARNING! NEEDS CAREFUL DEPLOYMENT
* Bug 9213: Fixed the plainly broken user_newtalk updating and caching scheme. I tried to keep my changes roughly performance-neutral, but the update on Wikimedia should be watched carefully for performance problems.
* Made UserMailer a class, use the autoloader to load it
* General UserMailer refactoring
* If the user has email-on-newtalk enabled, send them an email for every change, not just the first one before they view the page again.
* Don't add a watchlist entry automatically on change of user talk page
2007-10-03 08:46:17 +00:00
Brion Vibber
4f379f91c1 * AuthPlugin added strictUserAuth() method to allow per-user override
of the strict() authentication behavior.

Fixes the hole where old local passwords could still be used to log into the global account after merging.
Based on patch by Rotem Liss from http://he.wikipedia.org/wiki/%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:Rotemliss/CentralAuth#2
Changed function name from authenticateLocally() to strictUserAuth() and reversed return value to mesh a little better with strict()
2007-10-02 19:02:44 +00:00
Daniel Cannon
99d5ecc3e3 Fix typo. "wfGetDb" -> "wfGetDB" 2007-09-10 18:29:05 +00:00
Tim Starling
164bb322f2 Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.

Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
Rob Church
7f177a5fe9 Tweak confusing comment for User::whoIsReal() 2007-08-14 01:17:08 +00:00
Rob Church
5c9be75df6 Tweak comment, "usable" is the purpose of this method, it's just confusing otherwise 2007-08-13 17:49:40 +00:00
Rob Church
03ef70741d * (bug 10859) Introduce 'UserGetImplicitGroups' hook; see docs/hooks.txt for more information
* Move the list of implicit groups in User::getAllGroups() to a new User::getImplicitGroups() method so there's no confusion over where to add these
2007-08-09 16:36:15 +00:00
Aryeh Gregor
5ac50ed94d Optimize User::getID() for special cases, and User::isLoggedIn() generally (the latter seems to have always required a database query in the past, when in fact it never should). 2007-07-23 19:39:53 +00:00
Rob Church
3811372d73 Introduce 'UserGetRights' hook; see docs/hooks.txt for more information 2007-07-21 01:00:42 +00:00
Rob Church
396524f674 Pass the user as an argument to 'isValidPassword' hook callbacks; see docs/hooks.txt for more information 2007-07-17 22:30:52 +00:00
Rob Church
b41b5d0547 Fix 2007-07-17 16:52:55 +00:00
Rob Church
e9aa9d20b9 * Clean up User::isValidPassword()
* Document 'isValidPassword' hook
2007-07-17 16:44:40 +00:00
Nick Jenkins
d466cf6e86 A few comment tag tweaks. 2007-07-11 08:09:21 +00:00
Rob Church
3eb2f669d6 Ditch redundant trim-and-length check 2007-07-10 15:08:48 +00:00
Tim Starling
9b9682904e Display a distinctive message when the edit token suffix is mangled. On report of widespread bot breakage, due to adding "+". 2007-07-01 22:22:16 +00:00