Commit graph

683 commits

Author SHA1 Message Date
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
Sam Reed
c40d38a5be Remove a few more unused variables
Add a couple of braces to unobvious if
2010-10-31 23:19:40 +00:00
Antoine Musso
011d4043a3 Follow up r75627. Implements r75670 in PHP to validate emails.
* Server side validation of email according to an HTML5 specifications provided by Simetrical :
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state
* This is NOT a fix of bug 959 (which wants RFC 2822 validation)
* Basic unit tests
2010-10-29 22:03:17 +00:00
Philip Tzou
e6c51a4143 1. Revert the complicated redirection I made in r59754;
2. Add more Accept-Language XVO cache name for IE;
3. Use hreflang to specify canonical and alternate links, it's search engine friendly
   when a wiki has multiple variant languages.
2010-10-28 16:58:39 +00:00
Platonides
4fbf6ecfa0 Add feature to block common (weak) passwords.
This closes the hole of passwords hardcoded in r72475,r74213. Also see r75589.
2010-10-27 22:26:39 +00:00
Antoine Musso
f720cbd4a4 Make some wfDebug() messages nicer to look at in debug log file. 2010-10-18 19:56:33 +00:00
Platonides
6e90b27d5a Deprecate User::getPageRenderingHash() as follow-up to r70783. 2010-10-17 17:28:25 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Sam Reed
a2589ff8c6 Assignment in loop conditions suck
while ( $row = $dbw->fetchObject( $res ) ) { to foreach ( $res as $row ) in includes

Add some braces
2010-10-13 23:11:40 +00:00
Roan Kattouw
7dcc7872aa When reading an old-style user_options blob, use the default value for any preferences not set in the blob. This'll hopefully fix bug 25416 ($options['editfont'] not set even though editfont is a legit pref) 2010-10-11 14:10:23 +00:00
Sam Reed
2ca24c9de1 Fix comment typo 2010-10-03 18:23:31 +00:00
Sam Reed
22764a53f8 Braces, spaces, and a few unused arrays 2010-09-21 06:55:49 +00:00
Trevor Parscal
0df196f2c6 Fixed bug caused by unset( $this->mSkin ) in User::setOption which was removing the member, not just setting it to null, which would cause errors when later on checking if ( ! $this->mSkin ) such as in User::getSkin. By using $this->mSkin = null instead, the same effect of showing the new skin preference immediately on change in Special:Preferences without causing errors. 2010-09-20 19:04:16 +00:00
Raimond Spekking
5b66949b49 (bug 16574) Allow administrators to temporarily disable the account creation limit for IP addresses: [[MediaWiki:Ratelimit-excluded-ips]] 2010-09-14 08:58:07 +00:00
Andrew Garrett
99357479ea Rewrite User::getSkin, broken in r49493 because requesting the skin for a particular title had the side-effect of changing the title associated with the stored Skin object, causing weirdness like the wrong namespace tabs. 2010-09-06 12:11:57 +00:00
Bryan Tong Minh
a502ecd52e Made user global constants class constants so that autoloader magic can be used. 2010-09-05 13:16:23 +00:00
Chad Horohoe
9e6c7cc8ef Get rid of PHP4-style constructors 2010-08-30 16:52:51 +00:00