Commit graph

831 commits

Author SHA1 Message Date
Tim Starling
34db0956e1 (bug 35316) On autocreate, use $this as the "doer" in the newuser log entry, since unlike User::addNewUserLogEntry(), there is no way the action could have been triggered by a different user. Usually $wgUser is set correctly, but there's no need to rely on it here. 2012-03-20 06:19:02 +00:00
Daniel Friesen
e2ee009e5c Commit the cryptrand project worked on in git:
- MWCryptRand: A new api for generating cryptographic randomness for security tokens. Uses whatever cryptographic source is available and if not falls back to using random state and clock drift.
- wfRandomString - A simple non-cryptographic pesudo-random string generation function to replace wfGenerateToken which was written pretending to be secure when it's really not.
- Core updates to use MWCryptRand in various places:
-- user_token generation (to do this we stop generating user_token implicitly and only generate it when needed to avoid depleting the system's entropy pool by reading random data we'll never use)
-- email confirmation token generation
-- password salt generation
-- temporary password generation
-- Generation of the automatic watchlist token
-- login and create user tokens
-- session ids when php's entropy sources are not set
-- the installer when generating wgSecretKey and the upgrade key
2012-03-20 05:17:40 +00:00
Alexandre Emsenhuber
eb5e031f31 * (bug 35303) Make proxy and DNS blacklist blocking work again 2012-03-18 22:19:00 +00:00
Aaron Schulz
0abb52ae76 Reverted r113177 per CR 2012-03-13 20:09:49 +00:00
Alexandre Emsenhuber
a7e20dd87f Move delcaration of User::$mAllowUsertalk out of the "cache variables" block since it's not part of it; also reorder the cache variables for consistency. 2012-03-13 19:03:59 +00:00
Alexandre Emsenhuber
8263743db1 Revert r113650 and reapply r113619 and r113649 with one modification: User::createNew() was missing a DatabaseBase::timestamp() call 2012-03-12 21:17:23 +00:00
Marcin Cieślak
f65f4456b2 Revert r113619, r113649: Breaks unit tests
https://integration.mediawiki.org/ci/job/MediaWiki-postgres-phpunit/3210/console

Maybe a new property with unpredictable
value breaks some tests. Need to investigate.
2012-03-12 19:58:27 +00:00
Marcin Cieślak
7a5ec916b4 Fix r113619: Convert timestamp to the backend database value 2012-03-12 19:35:38 +00:00
Alexandre Emsenhuber
91f9e6b721 Removed the remaining parts of "cookie password" stuff, does nothing and no longer used since ages 2012-03-12 14:04:20 +00:00
Alexandre Emsenhuber
b51076f9f7 Set the user_touched field directly when adding a new user to the database so that the field is correct when someone does not call saveSettings() after addToDatabase() 2012-03-12 13:07:50 +00:00
Alexandre Emsenhuber
21ac31f144 No need to do a database query when passing an IP address to User::idFromName() 2012-03-06 20:52:42 +00:00
Alexandre Emsenhuber
e6441b8f6c * Don't issue a write query to the database if the wl_notificationtimestamp is already null, so we don't to do at COMMIT et al. on every view request on an user watching the page
* Made WatchedItem select wl_notificationtimestamp instead of "1"
* Added loading mechanism, accessor to wl_notificationtimestamp and method to reset that timestamp
2012-02-10 19:35:14 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Max Semenik
586503f33c (bug 28936, bug 5280) Broken or invalid titles can't be removed from watchlist. Now titles are fixed or deleted, if unfixable, upon loading Special:EditWatchlist. 2012-02-09 20:39:16 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Tim Starling
40469f56bd Fixed a bug in User::loadOptions(), probably introduced in r49925, causing the User::loadOptions() query to be done after a cache load if the user had no option overrides at the time of cache save. Store an empty array to the cache's mOptionOverrides instead of null. 2012-02-08 05:25:19 +00:00
Daniel Friesen
877ef150d3 (bug 34237) Regenerate an empty user_token and save to the database when we try to set the user's cookies for login.
This allows the entire user_token column to be regenerated after a leak by running `UPDATE user SET user_token = NULL;` and letting the user_tokens be regenerated as users try to log back in.
2012-02-07 08:07:28 +00:00
Chad Horohoe
f3a6fc1576 Revert r102624, r104262 (user display name stuff). Per CR there isn't consensus on this yet. 2012-01-11 00:53:08 +00:00
Niklas Laxström
b61f0adad9 r98539 - make a note of change in comments 2011-12-16 09:22:07 +00:00
Jeroen De Dauw
43f00eb80c follow up to r106393 - re-add these notices, since now they wont show for people that change the depr limit to see them 2011-12-16 00:24:00 +00:00
Antoine Musso
28cec38f86 Comment out wfDeprecated() call in User::getSkin(), there's over 300 uses in /trunk
reverts r106174
2011-12-14 13:00:30 +00:00
Antoine Musso
f731b9cb92 revert r106183 : type / not setting followup 2011-12-14 12:59:05 +00:00
Sam Reed
649d7f84d7 Comment out wfDeprecated() call in User::getSkin(), there's over 300 uses in /trunk
Follows up some (cba to find) rev
2011-12-14 12:54:35 +00:00
Raimond Spekking
409703b854 Self revert r106076 which was a revert of r106070. 2011-12-14 11:50:50 +00:00
Jeroen De Dauw
04b9a5d834 comment out another to soon placed warning 2011-12-13 21:37:19 +00:00
Raimond Spekking
dbd39d7b1e Partly revert r106070 for now: Flooding of translatewiki.net log/channel:
PHP Notice: Use of User::getSkin was deprecated in MediaWiki 1.18. [Called from TalkpageView::show in /www/w/extensions/LiquidThreads/pages/TalkpageView.php at line 251] in /www/w/includes/GlobalFunctions.php on line 3520
PHP Notice: Use of User::getSkin was deprecated in MediaWiki 1.18. [Called from MessageTable::contents in /www/w/extensions/Translate/utils/MessageTable.php at line 98] in /www/w/includes/GlobalFunctions.php on line 3520
PHP Notice: Use of User::getSkin was deprecated in MediaWiki 1.18. [Called from TranslationHelpers::ajaxEditLink in /www/w/extensions/Translate/utils/TranslationHelpers.php at line 1186] in /www/w/includes/GlobalFunctions.php on line 3520
PHP Notice: Use of User::getSkin was deprecated in MediaWiki 1.18. [Called from ThreadPermalinkView::getSubtitle in /www/w/extensions/LiquidThreads/pages/ThreadPermalinkView.php at line 153] in /www/w/includes/GlobalFunctions.php on line 3520
and maybe more
2011-12-13 20:10:30 +00:00
Jeroen De Dauw
0b105ebf1d added missing deprecation notices 2011-12-13 19:51:03 +00:00
Tim Starling
3da36a9103 Reverted r92364 (per-namespace permissions).
This is the wrong configuration format for such a feature, and the wrong interface. We already have certain per-namespace permissions in the Title class, and we didn't need to add extra formal parameters to a whole lot of User methods in order to get them. The feature should be implemented wholly in Title, and the concept of user rights should remain relatively simple and easy to understand, and independent of its many applications, i.e. a user either has a right or doesn't. Rights are just a tool for developing access policies; the complexity should be in the caller.

The revert was mostly done by hand, since there were a lot of conflicts. I tried to preserve the gist of conflicting changes in r102187 and r102873. The test changes are not simple reverts, rather I just edited out the per-namespace tests. I reverted the followups r92589 and r104310.
2011-12-12 06:03:01 +00:00
Sam Reed
b5f11fa813 * (bug 32960) remove EmailAuthenticationTimestamp from database when a
email address is removed

In Preferences::trySetUserEmail no point trying to reset the users email if it's the same

Same for User::setEmail

After setting the email though, invalidate email auth tokens
2011-12-11 15:31:17 +00:00
Sam Reed
361deca215 Fix whitespace 2011-12-06 15:38:51 +00:00
Sam Reed
ffbd299b04 Another artefact of the disable account merge
Remove disableaccount userright from core
2011-12-01 00:24:22 +00:00
Chad Horohoe
7914b2ee68 (bug 29475) Remove "trackback" feature entirely from core. This has been disabled-by-default since its inception and nobody uses it.
If someone really really wants this, they can write an extension.

Language files need rebuilding, but I took care of En and messages.inc.
2011-11-23 17:14:03 +00:00
Antoine Musso
61ef7cb305 User: document 2 returns 2011-11-23 15:53:03 +00:00
John Du Hart
aa6a4828af Followup r103294, remove a space that got added on the end of the method 2011-11-16 04:39:21 +00:00
John Du Hart
93e50f7eed Following r100264, update usages in core 2011-11-16 04:37:17 +00:00
Aaron Schulz
54e44e573a Removed transaction in saveOptions(). No reason was given for it and it could break any callers that have transactions. 2011-11-13 12:35:28 +00:00
Daniel Friesen
44ab4a9448 Add a new User::getDisplayName() to return the name that should be displayed in the interface.
Add a UserDisplayName hook to allow extensions to give custom display names for users.
Add a $wgRealNameInInterface to use the real name of a user as the display name.
To start of the first use of the display name functionality tweak SkinTemplate to declare the userdisplayname and use it inside of personal_urls.
2011-11-10 06:55:21 +00:00
Chad Horohoe
db97d8d85e Drop "selenium" user right. As far as I can tell, this isn't actually used anywhere (core or exts) and is leftover from the special page for selenium that was removed. 2011-11-09 17:01:09 +00:00
Roan Kattouw
698f9e9c00 Revert r101488, breaks parser test. Add a comment explaining why there is no caching currently being done, and document the fact that the hook is called a zillion times in hooks.txt 2011-11-01 16:25:26 +00:00
Roan Kattouw
42a360b069 Cache the result of User::getDefaultOptions(), so the UserGetDefaultOptions hook (introduced in r97365) is run only once rather than on every call. Discovered this issue after seeing an insane number of memcached fetches in my RL2 code, caused by a UserGetDefaultOptions hook accessing the Gadgets storage backend (which has a memc layer) and being called a zillion times due to this bug. 2011-11-01 15:55:57 +00:00
Aaron Schulz
5dfe3d6444 Revision objects now always use the current name of users, loading it on demand if necessary (e.g. when given a $row with no user_name but rev_user is not 0) 2011-10-21 23:20:52 +00:00
Jeroen De Dauw
da250a635c we want to get the edit token, not edit the token... 2011-10-19 19:38:17 +00:00
Max Semenik
0c097b01eb (bug 31674) Can't edit watchlist if it contains special pages 2011-10-15 21:06:34 +00:00
Aaron Schulz
c0bb3a6e2b * Only spread blocks on page edit/move attempts via spreadAnyEditBlock(). We don't want to spread everytime the user's block status is checked as the user may just be viewing something rather than attempting to do anything. For example, if the 'edit' tab were changed to reflect block status, the autoblocks would trigger by a user just *looking* at the page. An example "in the wild" would be the UI checks in r93246.
* Made spreadBlock() protected, no outside callers.
2011-10-08 20:22:53 +00:00
Niklas Laxström
c04ace5435 Part of bug 31503 - Allow gender distinction also for user groups 2011-10-08 14:13:17 +00:00
Aaron Schulz
71c25a126d Made addNewUserLogEntry() return the ID of the new log entry to be more useful 2011-09-30 17:31:36 +00:00
Sam Reed
eda06e8593 * (bug 31204) Remove old user.user_options
Added run of ConvertUserOptions maintenance script into update.php before dropping the column

Removed usages of user_options in code

Marked User::decodeOptions() deprecated as of 1.19.

Made ConvertUserOptions drop out early if the user_options field doesn't exist

Made ConvertUserOptions update user_options to '' after migration of user options to mOptions
2011-09-28 18:08:48 +00:00
Tim Starling
59623dc0d1 Fixed User::getGroups(), apparently broken since r33333. User::load() doesn't load groups anymore, so calling $this->getGroups() was the same as just accessing $this->mGroups. Usually it doesn't matter, since most factory functions are funnelled into loadFromId() which calls loadGroups() or loads the groups from the cache, but loadFromRow() was potentially broken.
It's necessary for User::loadFromRow() to set $this->mGroups to null, same as the calling code in User::loadFromDatabase(), so that they will be loaded dynamically when User::newFromRow() is called.

No bugs found that are caused by this but it couldn't hurt to have working accessors. Tested from eval.php.
2011-09-22 06:17:26 +00:00
Aaron Schulz
b93198d111 Added array type hinting too getGroupPermissions() 2011-09-22 03:21:43 +00:00