1 | <?php |
||
10 | class Jetpack_SSO_Notices { |
||
11 | /** |
||
12 | * Error message displayed on the login form when two step is required and |
||
13 | * the user's account on WordPress.com does not have two step enabled. |
||
14 | * |
||
15 | * @since 2.7 |
||
16 | * @param string $message |
||
17 | * @return string |
||
18 | **/ |
||
19 | public static function error_msg_enable_two_step( $message ) { |
||
36 | |||
37 | /** |
||
38 | * Error message displayed when the user tries to SSO, but match by email |
||
39 | * is off and they already have an account with their email address on |
||
40 | * this site. |
||
41 | * |
||
42 | * @param string $message |
||
43 | * @return string |
||
44 | */ |
||
45 | public static function error_msg_email_already_exists( $message ) { |
||
61 | |||
62 | /** |
||
63 | * Error message that is displayed when the current site is in an identity crisis and SSO can not be used. |
||
64 | * |
||
65 | * @since 4.3.2 |
||
66 | * |
||
67 | * @param $message |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | public static function error_msg_identity_crisis( $message ) { |
||
76 | |||
77 | /** |
||
78 | * Error message that is displayed when we are not able to verify the SSO nonce due to an XML error or |
||
79 | * failed validation. In either case, we prompt the user to try again or log in with username and password. |
||
80 | * |
||
81 | * @since 4.3.2 |
||
82 | * |
||
83 | * @param $message |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | public static function error_invalid_response_data( $message ) { |
||
95 | |||
96 | /** |
||
97 | * Error message that is displayed when we were not able to automatically create an account for a user |
||
98 | * after a user has logged in via SSO. By default, this message is triggered after trying to create an account 5 times. |
||
99 | * |
||
100 | * @since 4.3.2 |
||
101 | * |
||
102 | * @param $message |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public static function error_unable_to_create_user( $message ) { |
||
114 | |||
115 | /** |
||
116 | * When the default login form is hidden, this method is called on the 'authenticate' filter with a priority of 30. |
||
117 | * This method disables the ability to submit the default login form. |
||
118 | * |
||
119 | * @param $user |
||
120 | * |
||
121 | * @return WP_Error |
||
122 | */ |
||
123 | public static function disable_default_login_form( $user ) { |
||
135 | |||
136 | /** |
||
137 | * Message displayed when the site admin has disabled the default WordPress |
||
138 | * login form in Settings > General > Single Sign On |
||
139 | * |
||
140 | * @since 2.7 |
||
141 | * @param string $message |
||
142 | * |
||
143 | * @return string |
||
144 | **/ |
||
145 | public static function msg_login_by_jetpack( $message ) { |
||
149 | |||
150 | public static function get_sso_required_message() { |
||
167 | |||
168 | /** |
||
169 | * Message displayed when the user can not be found after approving the SSO process on WordPress.com |
||
170 | * |
||
171 | * @param string $message |
||
172 | * @return string |
||
173 | */ |
||
174 | public static function cant_find_user( $message ) { |
||
183 | |||
184 | /** |
||
185 | * Error message that is displayed when the current site is in an identity crisis and SSO can not be used. |
||
186 | * |
||
187 | * @since 4.4.0 |
||
188 | * |
||
189 | * @param $message |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | public static function sso_not_allowed_in_staging( $message ) { |
||
201 | } |
||
202 | |||
204 |