Commit graph

699 commits

Author SHA1 Message Date
Antoine Musso
8a3dcccbda Remove second parameters from wfEmptyMsg() calls
The second parameter was removed in r64178 and is now useless.
There is probably no need to backport this in 1.17.
2011-03-07 17:10:22 +00:00
Sam Reed
0e38c2cdce Documentation and explicit variable definitions
Followup r80069, swap private to protected
2011-03-07 14:45:11 +00:00
Alexandre Emsenhuber
a17b065156 Follow-up r83080: forogt to commit this (oops) 2011-03-02 13:13:51 +00:00
Alexandre Emsenhuber
60f1302644 Per Platonides, fix for r82686: make ApiUploadTest work again
Added option request parameter to User::editToken() and User::matchEditToken() and use them where possible from the api.
Also removed $_SESSION usage since it's no longer needed
2011-03-02 12:52:47 +00:00
Platonides
36999e2bf9 Disable the old conversion from Windows-1252 unless the wiki has $wgLegacyEncoding set.
Has been done since r6920 (code added in r4438).
Also skipping the hashing if the windows-1252 password is the same we already probed.
The function_exists is not needed, since in such case GlobalFunctions would make it a wrapper to Fallback::iconv()
2011-02-26 22:30:41 +00:00
Alexandre Emsenhuber
be4f26f8da Don't even try to get user's IP address if he has 'ipblock-exempt' right 2011-02-26 13:28:02 +00:00
Alexandre Emsenhuber
3381453178 Use $wgRequest to get and set session items instead of $_SESSION (as for cookies) 2011-02-23 17:54:02 +00:00
Happy-melon
ef6041d750 revert r82283, loads of unrelated changes 2011-02-16 19:51:25 +00:00
Happy-melon
d64cd26a7c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:49:37 +00:00
Niklas Laxström
31971c6eba Use self:: when it's possible 2011-02-11 19:03:05 +00:00
Sam Reed
6dc7225794 *(bug 27159) make email confirmation code expiration time configurable
Added "$wgUserEmailConfirmationTokenExpiry"
2011-02-10 02:32:34 +00:00
Alexandre Emsenhuber
ebcd89f35b Fix for r81675: Skin::getTitle() will return null when $wgTitle is null and $wgOut->setTitle() not called, resulting in the following when passing a non-null parameter to User::getSkin():
Catchable fatal error: Argument 1 passed to Title::equals() must be an instance of Title, null given, called in includes/User.php on line 2255 and defined in includes/Title.php on line 3689
2011-02-09 17:05:52 +00:00
Chad Horohoe
4abff25966 Followup r81812: per CR, this could be 0 2011-02-09 14:59:44 +00:00
Chad Horohoe
670b92b065 preg_match() yells about undefined offsets when $wgInvalidUsernameCharacters is empty. Noticed by wolog on IRC 2011-02-09 13:42:02 +00:00
Chad Horohoe
9ff0216ee2 Cleanup to r70900, r72481: don't construct new skin objects just because the Title is passed. Use the skin object we already have if the titles are the same 2011-02-08 01:08:06 +00:00
Bryan Tong Minh
e942dc69fc Per CR r66438 and IRC, revert User::leaveNewMessage for now. Copied the function and stripped it down for use in NewUserMessage. Could probably need some cleanup. 2011-02-06 22:44:01 +00:00
Roan Kattouw
4b8d8353bb Followup r81446: and mergehistory too 2011-02-03 13:21:25 +00:00
Roan Kattouw
621f231154 Add editusercss and edituserjs rights to User::$mCoreRights. Pointed out by Scalable on IRC 2011-02-03 13:20:14 +00:00
Alexandre Emsenhuber
c96c0d9553 * (bug 22606) Follow-up r63059: don't send the "someone registred an account" message when setting email address (i.e. old one empty) in user preferences 2011-01-29 09:32:02 +00:00
Antoine Musso
ff5fb5ea3e Bug 26948 - hyphens incorrectly interpreted as range
This is the kind of easy to fix, hard to review bug. Email validation
make uses of strings listing characters, those strings are then
enclosed between brackets "[]". Inside brackets, the hyphen is used
to describe a range of character [a-d] being a b c d.
The string containing an unescaped hyphen, made JS/PHP validation
to match the incorrect comma ",".

* Backslash hyphen
* JS,PHP: add tests for commas and hyphens in username or domain
* JS: add var to rfc_1034_ldh_str
* JS: minor code cleanup

TESTS:

php phpunit.php -c suite.xml --filter ValidEmail
OK (13 tests, 32 assertions)

Special:BlankPage?action=mwutiltest&debug=true
Ran 66 tests. 66 passed test(s). 0 error(s). 0 partially passed test(s).
2011-01-27 20:52:12 +00:00
Mark A. Hershberger
23ad60e630 * Whitespace fixups
* followup r66675 - Robla caught a problem with the parameter munging
2011-01-26 17:48:58 +00:00
Alexandre Emsenhuber
de4a9c6b9a Reset the cache used in User::idFromName(), otherwise tests will try to add the user '127.0.0.1' multiple times, resulting in a database error (duplicate key for user_name field) 2011-01-25 16:32:43 +00:00
Alexandre Emsenhuber
bc650e89e7 Allow the $result parameter of the isValidPassword hook to be an array if the message requires parameters 2011-01-25 15:36:36 +00:00
Brion Vibber
794bc9a816 Tweak comments on User::isValidEmailAddr to replace the old @todo for RFC 2822 validation with a brief explanation of why we're using this instead. (followup r80913) 2011-01-24 21:18:47 +00:00
Antoine Musso
e1be34e477 User::isValidEmailAddr comment update
Follow up r75682
2011-01-24 20:31:16 +00:00
Antoine Musso
4868ccbf3d Hack invalid w3 spec to validate @localhost email
In r75682, I have implemented a PHP function to validate email address
based on bug 22449.  Siebrand pointed a w3.org specification which I
implemented. The spec is bugged since it requires a domain and a top
level domain!

I could either make the first part optional or alter the second part
to require 0 to x elements.  I choose the later: s/+/*/

Should fix bug 22449 for good.

TESTS:

Added testEmailDoesNotNeedATopLevelDomain:

Made following emails valid:
  user.@localdaomin
  .@localdomain
  user@a

Test output (please add more):
$ php phpunit.php -c suite.xml --filter alidEmail --tap
TAP version 13
ok 1 - UserIsValidEmailAddrTest::testEmailWellKnownUserAtHostDotTldAreValid
ok 2 - UserIsValidEmailAddrTest::testEmailWithUpperCaseCharactersAreValid
ok 3 - UserIsValidEmailAddrTest::testEmailWithAPlusInUserName
ok 4 - UserIsValidEmailAddrTest::testEmailDoesNotNeedATopLevelDomain
ok 5 - UserIsValidEmailAddrTest::testEmailWithWhiteSpacesBeforeOrAfterAreInvalids
ok 6 - UserIsValidEmailAddrTest::testEmailWithWhiteSpacesAreInvalids
ok 7 - UserIsValidEmailAddrTest::testEmailDomainCanNotBeginWithDot
ok 8 - UserIsValidEmailAddrTest::testEmailWithFunnyCharacters
ok 9 - UserIsValidEmailAddrTest::testEmailTopLevelDomainCanBeNumerical
ok 10 - UserIsValidEmailAddrTest::testEmailWithoutAtSignIsInvalid
ok 11 - UserIsValidEmailAddrTest::testEmailWithOneCharacterDomainIsValid
1..11
2011-01-21 18:01:47 +00:00
Daniel Friesen
f5cbd0c5c2 Fix another bad boolean from r80248. 2011-01-16 02:29:53 +00:00
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Antoine Musso
73b63cc778 Fix RFC 5322 'atext'
An additional character was introducted in the RFC 5322 atext fragment.
Spotted with r79924 which send the file as latin1 encoding.
2011-01-10 19:55:30 +00:00
Happy-melon
355717054f Remove ancient deprecated functions:
* Article::getDB(), deprecated in 1.13 (r36334)
* Article::showArticle() - 1.7 (r14809)
* User::SetupSession() - 1.8 (r15823)
* User::isBot() - 1.8 (r15689)
Annotate other deprecated functions with @since <version>
2011-01-06 18:04:04 +00:00
Happy-melon
e6c1611379 More documentation formatting 2011-01-06 15:55:56 +00:00
Sam Reed
58df1dc895 Rest of * (bug 25767) Add userrights properties to allusers and users query lists
Add missing parameter from r79545
2011-01-04 02:06:55 +00:00
Platonides
7846165d81 (Bug 26434) - Generated password from "Create account by email" does not work.
Another consequence of the $ts === 0 from r71751.
Fixed in a more verbose way. Behavior documented in tables.sql
2010-12-27 17:17:45 +00:00
Platonides
575accae58 Revert r75588 and r77381. Block just the tainted pairs of username/passwords until a proper solution for weak passwords is added, hopefully for 1.18. 2010-12-26 22:55:32 +00:00
Niklas Laxström
75393882f7 Reduce debug log spamming, which I assume is related to this line:
1340:	function isBlocked( $bFromSlave = true ) { // hacked from false due to horrible probs on site
2010-12-10 14:44:01 +00:00
Alexandre Emsenhuber
4d19be865b * Converted UserMailer stuff to return a Status object instead of true-or-WikiError
* Made WikiError::isError() compatible with Status objects
* Added Status::getMessage() for backward compatibility

Extensions using WikiError::isError() to detect a failure of UserMailer::send() and realted methods should still work like before
2010-12-04 13:27:05 +00:00
Andrew Garrett
db7616d207 Add disableaccount to User::$mCoreRights 2010-12-02 05:28:36 +00:00
Mark A. Hershberger
a465346c6e random w/s cleanup 2010-12-01 20:22:45 +00:00
Sam Reed
7320879184 Few braces and spaces
Fixing up documentation
2010-11-30 19:06:28 +00:00
Platonides
fdd0e32d02 Use always DatabaseBase::timestampoOrNull for user_newpass_time field, as done in loadFromRow()/saveSettings()
-- línea y las que están debajo serán ignoradas--

M    User.php
2010-11-28 22:44:14 +00:00
Sam Reed
1361d07049 Tweak some documentation 2010-11-28 15:40:15 +00:00
Andrew Garrett
9d8ff9317e Remove isValidPassword check from User::checkPassword. It is hugely annoying to suddenly have the system decide that your password is not strong enough and decide that, as a consequence, you are not allowed to log in anymore. Password strength checking should only be there for changing passwords, not using them! 2010-11-28 03:21:16 +00:00
Sam Reed
be47c0a884 Tweak param documentation 2010-11-21 23:18:52 +00:00
Sam Reed
de3300a49d Clearing up this working copy. Adding a couple of braces 2010-11-16 23:02:08 +00:00
Sam Reed
a54a1ee178 Fixup some more documentation 2010-11-13 00:47:51 +00:00
Platonides
6b1f0fa6d2 Revert r72959 2010-11-08 20:51:15 +00:00
Alexandre Emsenhuber
95580b06ed * (bug 25728) Added $wgPasswordSenderName to allow customise the name associed with $wgPasswordSender 2010-11-07 09:30:42 +00:00
Chad Horohoe
e94995bd90 Per CR, revert r75873. Does not match docs 2010-11-03 13:55:22 +00:00
Antoine Musso
e3af1df354 Fix misinterpration of HTML5 specification for email validation.
Follow up: r75670 (JS), r75682 (PHP)
2010-11-02 20:39:20 +00:00
Chad Horohoe
a31a935e0e Cleanup r49493, r72481: Adding skin to $wgHiddenPrefs disabled the useskin parameter 2010-11-02 20:18:15 +00:00