1 | <?php |
||
10 | class Jetpack_SSO_Helpers { |
||
11 | /** |
||
12 | * Determine if the login form should be hidden or not |
||
13 | * |
||
14 | * @return bool |
||
15 | **/ |
||
16 | static function should_hide_login_form() { |
||
28 | |||
29 | /** |
||
30 | * Returns a boolean value for whether logging in by matching the WordPress.com user email to a |
||
31 | * Jetpack site user's email is allowed. |
||
32 | * |
||
33 | * @return bool |
||
34 | */ |
||
35 | static function match_by_email() { |
||
50 | |||
51 | /** |
||
52 | * Returns a boolean for whether users are allowed to register on the Jetpack site with SSO, |
||
53 | * even though the site disallows normal registrations. |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | static function new_user_override() { |
||
71 | |||
72 | /** |
||
73 | * Returns a boolean value for whether two-step authentication is required for SSO. |
||
74 | * |
||
75 | * @since 4.1.0 |
||
76 | * |
||
77 | * @return bool |
||
78 | */ |
||
79 | static function is_two_step_required() { |
||
91 | |||
92 | /** |
||
93 | * Returns a boolean for whether a user that is attempting to log in will be automatically |
||
94 | * redirected to WordPress.com to begin the SSO flow. |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | static function bypass_login_forward_wpcom() { |
||
110 | |||
111 | /** |
||
112 | * Returns a boolean for whether the SSO login form should be displayed as the default |
||
113 | * when both the default and SSO login form allowed. |
||
114 | * |
||
115 | * @since 4.1.0 |
||
116 | * |
||
117 | * @return bool |
||
118 | */ |
||
119 | static function show_sso_login() { |
||
135 | |||
136 | /** |
||
137 | * Returns a boolean for whether the two step required checkbox, displayed on the Jetpack admin page, should be disabled. |
||
138 | * |
||
139 | * @since 4.1.0 |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | static function is_require_two_step_checkbox_disabled() { |
||
146 | |||
147 | /** |
||
148 | * Returns a boolean for whether the match by email checkbox, displayed on the Jetpack admin page, should be disabled. |
||
149 | * |
||
150 | * @since 4.1.0 |
||
151 | * |
||
152 | * @return bool |
||
153 | */ |
||
154 | static function is_match_by_email_checkbox_disabled() { |
||
157 | |||
158 | /** |
||
159 | * Returns an array of hosts that SSO will redirect to. |
||
160 | * |
||
161 | * Instead of accessing JETPACK__API_BASE within the method directly, we set it as the |
||
162 | * default for $api_base due to restrictions with testing constants in our tests. |
||
163 | * |
||
164 | * @since 4.3.0 |
||
165 | * |
||
166 | * @param array $hosts |
||
167 | * @param string $api_base |
||
168 | * |
||
169 | * @return array |
||
170 | */ |
||
171 | static function allowed_redirect_hosts( $hosts, $api_base = JETPACK__API_BASE ) { |
||
191 | |||
192 | static function generate_user( $user_data ) { |
||
230 | } |
||
231 | |||
233 |