Commit graph

394 commits

Author SHA1 Message Date
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Bryan Tong Minh
50bcc3c8f5 Force reindexation of User::mRights. Hooks have the possibility to unset rights, leaving the array out of order. 2008-05-20 08:06:43 +00:00
Aaron Schulz
5276838fbb Respect $wgShowUpdatedMarker 2008-05-17 23:39:20 +00:00
Brion Vibber
bc79cb0f6f Trigger load of user data in User::getBlockStatus() before we
start changing member variables.

Otherwise something ends up stomping on $this->mBlockedby when
things get lazy-loaded later, causing false positive block hits
due to -1 !== 0. Probably session-related... Nothing should be
overwriting mBlockedby, surely?

This was giving me blank "you are blocked" messages.... but only
when doing *section edits on SSL*, not regular edits, nor section
edits on non-SSL wikipedia. Weeeeeeird
2008-05-14 23:42:15 +00:00
Tim Starling
8ae900c46b DB schema change.
In CentralAuth (and related changes interface changes in Newuserlog and the core):

* Moved the AutoAuthenticate hook to User::loadFromSession(), to defer processing for longer and avoid unstub loops
* Undeprecated User::setID()
* Added partial support for new user log registration and IP-based blocking of automatically created accounts. Still needs the same support implemented in Special:Userlogin.
* Fixed all inappropriate uses of the term "DB name", changing them to "wiki" or "wiki ID". Renamed the relevant database fields.
* Refactored central session and cache support
2008-05-14 00:35:14 +00:00
Tim Starling
451e87a875 * Rename wfGetAvailableRights() to User::getAllRights()
* Reintroduce $wgAvailableRights so that the above function is not so terribly slow and broken
2008-05-07 06:42:16 +00:00
Rotem Liss
4682961a11 Remove emailconfirmed group from comment. 2008-05-05 18:04:48 +00:00
Brion Vibber
6b16f44108 * (bug 13905) Blacklist Mac IE from HttpOnly cookies; it eats them sometimes
God I wish this browser would finish dying. :D

The particular situation was that the session cookie was getting eaten as "disabled", thus not sent back to the server so your session state never quite happened. Other cookies on submit seemed to come in intact, but without the session cookie you'd get a big fat error message, even if you set the long-term login cookie option.

Mac/IE seems to always *see* the HttpOnly cookies, but it sometimes marks them as "disabled". It seems to be incorrectly parsing the options after the path, sometimes seeing "/;" as the path instead of "/". Failure is more likely if there's no expiration option (as with the session cookie), or if there *is* a secure option set.

Anyway, just set up a user-agent blacklist $wgHttpOnlyBlacklist and copied the Mac/IE entry over. The HttpOnly setting now gets ignored for blacklist hits as well as for old PHP versions, the check being encapsulated into wfHttpOnlySafe().

Also added some logging for cookie settings, around the setcookie() and session_set_cookie_params() calls.
2008-05-01 20:25:17 +00:00
Brion Vibber
b335579d02 Revert r33836 and bump cached user object version so any bad cached items get cleared.
* mEmail was already cached, don't need it twice.
* mRights isn't safe to cache -- it may change due to updates to $wgGroupRights, which won't clear the cached User entries.
2008-04-24 22:34:42 +00:00
Andrew Garrett
3b154e1ed2 Two new cache vars in User
* Cache mRights. If a hook adds some rights, then that hook needs to be called again and again without caching (e.g. upcoming changes to CentralAuth to add global groups)
* Cache mEmail.
2008-04-24 13:41:05 +00:00
Andrew Garrett
b960ecccda Also, include includes when committing changes (haw haw) 2008-04-24 08:58:39 +00:00
Brion Vibber
d25bf51dc0 Fix regression with confirmation e-mails sent via Special:Confirmemail.
Recent changes to User object made User::sendConfirmationEmail() *not* save the new confirmation token to the database, which seems rather odd. As a result, you got a mail with a bogus value.

Since the function has side-effects, it pretty clearly needs to be saving its changes. Went ahead and had it do that rather than forcing all callers to fix its internal failing.
2008-04-22 23:47:27 +00:00
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