Commit Graph

97 Commits

Author SHA1 Message Date
Boone Gorges 07b8be1177 Allow apostrophes in email address during wp-login.php registration.
See #18039 for a related fix when creating users via the Dashboard.

Props tomdxw.
Fixes #34483.

git-svn-id: https://develop.svn.wordpress.org/trunk@39544 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-08 03:57:08 +00:00
John Blackbourn 347040745d I18n: Introduce more translator comments for strings that contain placeholders but don't have an accompanying translator comment.
See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39326 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 02:45:53 +00:00
John Blackbourn f6f0e6098d I18n: Begin introducing translator comments for strings which include placeholders but no accompanying translator comment.
Adds context to one string used in two different contexts for the new user and new site signup email notification.

More to come.

See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39323 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 01:21:01 +00:00
Jeremy Felt 2979167ba7 Multisite: Use `get_network()` and `get_current_network_id()` for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`.

This effectively deprecates `get_current_site()`, something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.


git-svn-id: https://develop.svn.wordpress.org/trunk@38814 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-19 04:46:14 +00:00
Helen Hou-Sandi 7cc095a1a0 Login: Don't rely on `wp_is_mobile()` for functionality.
Making behavior changes based on some broad definition of what mobile is rarely, if ever, makes sense. Each bit of functionality should be more clearly targeted, whether that's for screen size, performance, or some kind of touch capability.

props akibjorklund.
see #33704.


git-svn-id: https://develop.svn.wordpress.org/trunk@38739 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-06 15:51:53 +00:00
Sergey Biryukov 73c5683903 Login and Registration: Change login label to `Username or Email Address` for clarity.
Props GaryJ.
Fixes #37871.

git-svn-id: https://develop.svn.wordpress.org/trunk@38477 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 18:50:34 +00:00
Scott Taylor 2078dda129 Multisite: use `get_current_site()` instead of `$GLOBALS['current_site']` (stop yelling!) in a few remaining spots.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38458 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 05:03:37 +00:00
John Blackbourn 16bb82eb76 I18N: Correct various instances of incorrect usage of `esc_attr_e()`.
Fixes #37457
Props henry.wright, afercia


git-svn-id: https://develop.svn.wordpress.org/trunk@38424 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-28 18:05:02 +00:00
Scott Taylor 3a4811afb4 Load: load `class-phpass.php` (`PasswordHash` class) early in `wp-settings.php`, instead of `require_once()`'ing it in several places.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38371 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 17:39:37 +00:00
Drew Jaynes b4fca4a558 Hooks: Standardize naming of dynamic hooks to use interpolation vs concatenation.
Benefits gained in discoverability and self-documentation throughout core trump the negligible performance hit in using interpolation in hook names.

Props ramiy.
See #37748.


git-svn-id: https://develop.svn.wordpress.org/trunk@38307 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 18:24:48 +00:00
Scott Taylor 92d8f4afdc Login: `retrieve_password()` does not need to import 2 globals that it does not use.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38304 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 04:47:19 +00:00
Sergey Biryukov 45d7737eb2 I18N: Add context and translator comments to `Back to %s` strings.
Fixes #37095.

git-svn-id: https://develop.svn.wordpress.org/trunk@37703 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 21:50:57 +00:00
Sergey Biryukov 4eab8aab82 Users: `wp_signon()` expects an array as the `$credentials` argument, not a string.
If an empty string was passed, redeclare it as an empty array to avoid a warning and a fatal error in PHP 7.1.0 Alpha 1.

Props simonvik.
Fixes #37071.

git-svn-id: https://develop.svn.wordpress.org/trunk@37697 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 15:33:06 +00:00
Drew Jaynes a1ee08a6db Docs: Standardize filter docs in root folder files to use third-person singular verbs per the inline documentation standards for PHP.
Fixes #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37535 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-23 16:43:20 +00:00
Boone Gorges 91f18f3d45 During password reset, user-submitted login/email should be stripslashed.
This prevents errors when an email address contains an apostrophe. See [29966]
for similar treatment of a related problem.

Props dcavins.
Fixes #36322.

git-svn-id: https://develop.svn.wordpress.org/trunk@37474 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-20 19:20:44 +00:00
Sergey Biryukov 8b8b0909d4 Login/Registration: Add `login_header` action that fires in the login page header after the body tag is opened and complements `login_footer`.
Props borkweb, iamfriendly, voldemortensen.
Fixes #22139.

git-svn-id: https://develop.svn.wordpress.org/trunk@37243 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-18 23:53:34 +00:00
Jeremy Felt e3feb63e33 Multisite: Handle redirect to a user's subdomain properly during login
`wp-login.php` uses `wp_safe_redirect()` for all redirects, even those that do not involve unsafe data from the request or referer.

When a user of a subdomain site attempts to login to a network site they do not have access to, the host in the redirect URL is treated as unsafe by `wp_safe_redirect()` as it has no immediate awareness as to which hosts are valid on the network. On a subdirectoy network, everything works as expected because the host is the same.

In this specific block of `wp-login.php`, all URLs are generated by WordPress and we can use `wp_redirect()` to handle the redirects. Users authenticating via other network sites will now be redirected properly. Hosts passed via the `redirect_to` query var will continue to be handled by `wp_safe_redirect()`.

Fixes #30598.


git-svn-id: https://develop.svn.wordpress.org/trunk@36867 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-06 03:05:46 +00:00
Dominik Schilling (ocean90) 12cf07c669 Authentication: Allow users to log in using their email address.
Introduces `wp_authenticate_email_password()` which is hooked into `authenticate` after `wp_authenticate_username_password()`.

Props Denis-de-Bernardy, ericlewis, vhomenko, MikeHansenMe, swissspidy, ocean90.
Fixes #9568.

git-svn-id: https://develop.svn.wordpress.org/trunk@36617 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 23:14:27 +00:00
Sergey Biryukov 0ac4ed2e67 Login: In `login_header()`, use correct separator for RTL locales.
Props ramiy.
Fixes #35737.


git-svn-id: https://develop.svn.wordpress.org/trunk@36487 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-06 22:55:41 +00:00
Dion Hulse 834ba4367f CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`.
We still generate the `wp-admin.*` files for compabitility purposes, however they only include the `@import()` lines.

Fixes #35229


git-svn-id: https://develop.svn.wordpress.org/trunk@36341 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 09:56:06 +00:00
John Blackbourn da011967e7 Login: Revert [34213] and [35897]. It has become apparent that there is a need for a separate function (and corresponding filter) which allows for the login form action URL to differ from the URL used to access the login form, so that plugins or implementations which change the login URL do not need to worry about handling the form submission at the same URL.
For now, we'll revert to the pre-4.4 behaviour of hard-coding the login form action URL as `wp-login.php` and look at implementing a separate function and corresponding filter in 4.5.

Props KrissieV, salcode, JPry
Fixes #34925
See #35103


git-svn-id: https://develop.svn.wordpress.org/trunk@36042 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-21 03:22:32 +00:00
Pascal Birchler 5d302ca4d2 Login: After [34213], use the `login_post` scheme again for login forms.
See #34925.

git-svn-id: https://develop.svn.wordpress.org/trunk@35897 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-13 14:02:04 +00:00
Drew Jaynes fb5997f206 Administration: Improve the message displayed in the login form modal when a user's session has expired.
Props obrienlabs.
Fixes #34340.


git-svn-id: https://develop.svn.wordpress.org/trunk@35865 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-11 16:00:36 +00:00
Andrea Fercia 08f67db8a3 Accessibility: remove no-purpose title attributes from the login screen.
Also, it's hard to convey the ironic tone of the sentences used for these title attributes in languages other than English.

Fixes #34943.

git-svn-id: https://develop.svn.wordpress.org/trunk@35846 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-09 22:19:01 +00:00
Sergey Biryukov 9cd8c7e2c0 Reset Password: Improve wording for a string used in password reset email.
Props obrienlabs.
Fixes #34605.

git-svn-id: https://develop.svn.wordpress.org/trunk@35559 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-06 22:35:25 +00:00
Drew Jaynes 3f756da63a Login: Pass the username and `WP_User` object to the `retrieve_password_title` filter.
Adding these parameters creates parity with the `retrieve_password_message` filter, used for modifying the message body of the same password reset email.

Props sudar.
Fixes #34252.


git-svn-id: https://develop.svn.wordpress.org/trunk@35093 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-13 00:50:28 +00:00
John Blackbourn 9b156ee2a9 Correctly set the `secure` flag on the post password cookie based on the scheme of the referring URL, if it's available, instead of the home URL.
Fixes #29641


git-svn-id: https://develop.svn.wordpress.org/trunk@34932 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 03:08:05 +00:00
John Blackbourn 855991c578 Correctly set the `secure` flag for the test cookie based on the login URL scheme, and the same for the user settings cookies based on the admin URL scheme.
Fixes #34159


git-svn-id: https://develop.svn.wordpress.org/trunk@34931 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 03:04:41 +00:00
Sergey Biryukov 6cc5757f10 Reset Password: Move the code for creating password reset key into a new function, `get_password_reset_key()`, and use it in `retrieve_password()`.
Previously: [25231].

Props DH-Shredder.
Fixes #34180.

git-svn-id: https://develop.svn.wordpress.org/trunk@34923 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 00:10:41 +00:00
John Blackbourn 61280672d2 Prevent a PHP notice when POSTing to `wp-login.php?action=register` without a `user_login` or `user_email` field in the POST request.
Fixes #34192


git-svn-id: https://develop.svn.wordpress.org/trunk@34910 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 14:42:39 +00:00
John Blackbourn c4dd769f22 Prevent a PHP notice from appearing on `wp-login.php?action=postpass` when there's no `$_POST['post_password']` parameter. Redirects to the referer if there is one (if there isn't one it'll just exit with a blank screen; no need for a user-friendly error message here).
Fixes #34160
Props iamfriendly


git-svn-id: https://develop.svn.wordpress.org/trunk@34909 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 14:29:29 +00:00
Drew Jaynes f2188269ce Login: Pass the `$errors` object as a parameter to the `lostpassword_post` hook.
Props iamfriendly.
Fixes #32116.


git-svn-id: https://develop.svn.wordpress.org/trunk@34885 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-06 22:59:30 +00:00
Scott Taylor 8a33422bfc Passwords: fix the markup on the Reset Password Form for `user-pass1` so the JavaScript operates properly.
Props ldinclaux.
See #33892.
Fixes #33908.


git-svn-id: https://develop.svn.wordpress.org/trunk@34371 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-22 03:56:25 +00:00
Sergey Biryukov 04c1c825e9 Reset Password: Move `<div>` out of `<p>` in `wp-login.php`.
Props ldinclaux.
Fixes #33892.

git-svn-id: https://develop.svn.wordpress.org/trunk@34232 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 11:45:09 +00:00
John Blackbourn 1a352d56f9 Implement `wp_login_url()` and `wp_registration_url()` in places where `wp-login.php` is currently hard-coded.
See #31495
Props GregLone


git-svn-id: https://develop.svn.wordpress.org/trunk@34213 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 17:10:24 +00:00
John Blackbourn 43340fe787 When a user with no role logs in, redirect them to the home page rather than their profile screen which they do not have access to.
See #25162


git-svn-id: https://develop.svn.wordpress.org/trunk@33924 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 21:34:01 +00:00
Helen Hou-Sandi 0c19c94561 Drop the hyphen from e-mail and standardize on email.
The AP Stylebook changed this in 2011, and we're woefully inconsistent, so let's go with the standard.

props morganestes, voldemortensen, niallkennedy (for patching on the previous AP style).
fixes #26156.


git-svn-id: https://develop.svn.wordpress.org/trunk@33774 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-28 03:16:02 +00:00
Mark Jaquith fff891b1d9 Autogenerate passwords that more reliably fit within their inputs.
fixes #33166

git-svn-id: https://develop.svn.wordpress.org/trunk@33474 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-29 03:55:56 +00:00
Scott Taylor 68ff8b1a80 Passwords UI: clean up the new JS in `wp-admin/js/user-profile.js`.
Instead of wrapping `#pass1` in a `<span>` dynamically, add the `<span>` to the HTML in PHP. It currently has no styling.

Fixes #33145.


git-svn-id: https://develop.svn.wordpress.org/trunk@33450 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-27 21:24:36 +00:00
Konstantin Obenland 2ab769b1b9 Passwords: Add password strength meter feedback for screen readers.
Also gives context to the show/hide button.

Props rianrietveld, afercia.
Fixes #33032.



git-svn-id: https://develop.svn.wordpress.org/trunk@33353 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-22 00:14:37 +00:00
Konstantin Obenland f645e3767a Login: Reflect new password flow in registration form.
Props Ipstenu.
Fixes #32428.



git-svn-id: https://develop.svn.wordpress.org/trunk@33265 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 16:07:46 +00:00
Konstantin Obenland 8560ac41f1 Password: Improve display of password meter on login screen.
Fixes #32925.


git-svn-id: https://develop.svn.wordpress.org/trunk@33251 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 03:31:35 +00:00
Mark Jaquith ef9f9c1a24 Fix small typo from [33019].
see #32429

git-svn-id: https://develop.svn.wordpress.org/trunk@33034 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 18:15:42 +00:00
Mark Jaquith cc23659078 New password change/set UI.
* Generate the password for the user
* More tightly integrate password strength meter
* Warn on weak passwords

see #32589

props MikeHansenMe, adamsilverstein, binarykitten

git-svn-id: https://develop.svn.wordpress.org/trunk@33023 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 14:47:24 +00:00
Dion Hulse 5b58664439 Expire password reset links after 24 hours (by default). This causes existing password reset links to become invalid.
Props markjaquith, voldemortensen, johnbillion, MikeHansenMe, dd32
See #32429


git-svn-id: https://develop.svn.wordpress.org/trunk@33019 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 06:32:07 +00:00
Scott Taylor 986990163f Add doc blocks to functions that are missing them.
If the function has no need for `@param` or `@return`, do an archeaological dig to find `@since`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32672 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-31 03:17:50 +00:00
Dominik Schilling (ocean90) b0d6757918 Use HTTPS URLs for codex.wordpress.org.
see #27115.

git-svn-id: https://develop.svn.wordpress.org/trunk@32116 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-12 21:28:58 +00:00
John Blackbourn d6b90486d1 Implement an `aria-describedby` attribute for login screen errors, and improve the "Forgot password?" anchor text.
Props aferica, rianrietveld
Fixes #31143


git-svn-id: https://develop.svn.wordpress.org/trunk@31871 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-24 16:28:56 +00:00
John Blackbourn 66548dcb82 Introduce a `logout_redirect` filter so the redirect destination can be changed when a user logs out. Parameters:
* string  $redirect_to           The redirect destination URL.
 * string  $requested_redirect_to The requested redirect destination URL passed as a parameter.
 * WP_User $user                  The WP_User object for the user that's logging out. 

Fixes #27617
Props SergeyBiryukov, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@31417 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 19:18:19 +00:00
Scott Taylor 6fd11624d1 The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. 

See #30799.


git-svn-id: https://develop.svn.wordpress.org/trunk@31090 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-08 07:04:40 +00:00