Commit graph

361 commits

Author SHA1 Message Date
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
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Rob Church
32a7750855 * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information
* Add User::getRegistration() accessor
2007-06-27 14:32:31 +00:00
Tim Starling
47cf9cbe63 When you log in from cookie, make the session valid for login as well. Not sure what the point of it is otherwise. Necessary for BoardVote session transfer stuff. 2007-06-26 20:40:02 +00:00
Tim Starling
0b68a403d7 * Make $wgUser->editToken() work for either logged-in or logged-out users.
* Fix escaping of edit tokens, removed FIXME note.
* Added + to EDIT_TOKEN_SUFFIX on report of broken proxy from mutante
* Two random minor changes
2007-06-23 10:15:10 +00:00
Daniel Cannon
7d3eb4accd (bug 7997) Added ability to Special:Blockip to block users from using Special:Emailuser. 2007-06-07 17:31:08 +00:00
Rob Church
e424d8dc69 (bug 9813) Reject usernames containing '#' to avoid silent truncation of fragments during the normalisation process
This adds an explicit check to User::getCanonicalName() which is required to run before title normalisation, since it's too late once that's been done. This won't affect existing accounts.
2007-05-19 19:55:57 +00:00
Tim Starling
4a35dbd30e Replace spaces with underscores in parser cache rendering hash. Caused a bug where people with ISO 8601 date format had a non-functional parser cache 2007-05-05 18:08:25 +00:00
Aaron Schulz
cd4d9d6c0d *only sanitize IPs, preserve mName 2007-04-27 13:03:42 +00:00
Brion Vibber
1dbaeb19dd * (bug 3348) Some additional weak password checks: password which is same as username will now be rejected.
There are some UI issues still with handling of bad/weak passwords. It's not too clear to the legit user who tries to log in again. There's also some bad behavior on the create account form; short or bad passwords just give an exception backtrace. Nice. :) But that's existing problems...
2007-04-26 21:45:11 +00:00
Brion Vibber
7cf4ba8e8a Correct test which was reversed in r20158 2007-04-26 20:51:31 +00:00
Antoine Musso
861b66021b Method User::loadFromSession() is private. If you want to create a user
object from a session, use the static method User::newFromSession().
2007-04-25 20:00:18 +00:00
Nick Jenkins
bd23ec29c6 Doc tweaks:
* Seems like an opportune time to introduce "@addtogroup Media" documentation tags.
* Merge "@addtogroup Metadata" (used by Exif.php) into "@addtogroup Media".
* Few more moving comment blocks to above classes.
2007-04-24 06:53:31 +00:00
Nick Jenkins
f9619da3f0 Yet more doc tweaks:
* Add @addtogroup tags to various classes, to try and group conceptually-related classes together.
* Add brief descriptions to various Special pages, thanks to Phil Boswell.
* Moving some docs to be right above the classes they represent, so that they are picked up.
2007-04-20 08:55:14 +00:00
Rob Church
66fbffe0d1 whoops... 2007-04-11 10:00:32 +00:00
Rob Church
f87ac721eb * (bug 9554) Extension-provided group name messages not used
* Clean up SpecialListusers::formatRow() a bit, make group link building a touch more efficient
2007-04-11 01:59:32 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Aaron Schulz
4e744eba7c *Clean up IPv6 usernames to avoid title errors 2007-03-14 15:23:52 +00:00
Aaron Schulz
3eef97f50d *Users with hidden names can't edit their talk page 2007-03-14 05:36:47 +00:00
Ryan Lane
32b36bf7dc Adding setInternalPassword(), and changing the behavior of setPassword in User.php.
Adding a check into SpecialUserLogin's initUser() function to only set a password if authentication plugins allow it.
2007-03-09 19:31:52 +00:00