class-activation.php
7 months ago
class-admin-menu-organizer.php
7 months ago
class-admin-menu-svg-icon-mask.php
7 months ago
class-auto-publish-posts-with-missed-schedule.php
7 months ago
class-avif-upload.php
7 months ago
class-captcha-protection.php
7 months ago
class-change-login-url.php
7 months ago
class-cleanup-admin-bar.php
7 months ago
class-common-methods.php
7 months ago
class-content-duplication.php
7 months ago
class-content-order.php
7 months ago
class-custom-admin-footer-text.php
7 months ago
class-custom-body-class.php
7 months ago
class-custom-css.php
7 months ago
class-custom-nav-menu-items-in-new-tab.php
7 months ago
class-deactivation.php
7 months ago
class-disable-author-archives.php
7 months ago
class-disable-comments.php
7 months ago
class-disable-dashboard-widgets.php
7 months ago
class-disable-embeds.php
7 months ago
class-disable-feeds.php
7 months ago
class-disable-gutenberg.php
7 months ago
class-disable-rest-api.php
7 months ago
class-disable-smaller-components.php
7 months ago
class-disable-updates.php
7 months ago
class-disable-xml-rpc.php
7 months ago
class-display-system-summary.php
7 months ago
class-email-address-obfuscator.php
7 months ago
class-email-delivery.php
7 months ago
class-enhance-list-tables.php
7 months ago
class-external-permalinks.php
7 months ago
class-heartbeat-control.php
7 months ago
class-hide-admin-bar.php
7 months ago
class-hide-admin-notices.php
7 months ago
class-image-sizes-panel.php
7 months ago
class-image-upload-control.php
7 months ago
class-insert-head-body-footer-code.php
7 months ago
class-last-login-column.php
7 months ago
class-limit-login-attempts.php
7 months ago
class-login-id-type.php
7 months ago
class-login-logout-menu.php
7 months ago
class-maintenance-mode.php
7 months ago
class-manage-ads-appads-txt.php
7 months ago
class-manage-robots-txt.php
7 months ago
class-media-replacement.php
7 months ago
class-multiple-user-roles.php
7 months ago
class-obfuscate-author-slugs.php
7 months ago
class-open-external-links-in-new-tab.php
7 months ago
class-password-protection.php
7 months ago
class-redirect-after-login.php
7 months ago
class-redirect-after-logout.php
7 months ago
class-redirect-fourofour.php
7 months ago
class-registration-date-column.php
7 months ago
class-revisions-control.php
7 months ago
class-search-engines-visibility.php
7 months ago
class-settings-fields-render.php
7 months ago
class-settings-sanitization.php
7 months ago
class-settings-sections-fields.php
7 months ago
class-show-custom-taxonomy-filters.php
7 months ago
class-site-identity-on-login-page.php
7 months ago
class-svg-upload.php
7 months ago
class-various-admin-ui-enhancements.php
7 months ago
class-view-admin-as-role.php
7 months ago
class-wider-admin-menu.php
7 months ago
class-wp-config-transformer.php
7 months ago
class-view-admin-as-role.php
526 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ASENHA\Classes; |
| 4 | |
| 5 | /** |
| 6 | * Class for View Admin as Role module |
| 7 | * |
| 8 | * @since 6.9.5 |
| 9 | */ |
| 10 | class View_Admin_As_Role { |
| 11 | |
| 12 | /** |
| 13 | * Add menu bar item to view admin as one of the user roles |
| 14 | * |
| 15 | * @param $wp_admin_bar The WP_Admin_Bar instance |
| 16 | * @link https://developer.wordpress.org/reference/hooks/admin_bar_menu/ |
| 17 | * @link https://developer.wordpress.org/reference/classes/wp_admin_bar/ |
| 18 | * @since 1.8.0 |
| 19 | */ |
| 20 | public function view_admin_as_admin_bar_menu( $wp_admin_bar ) { |
| 21 | |
| 22 | $options = get_option( ASENHA_SLUG_U, array() ); |
| 23 | $usernames = isset( $options['viewing_admin_as_role_are'] ) ? $options['viewing_admin_as_role_are'] : array(); |
| 24 | |
| 25 | $current_user = wp_get_current_user(); |
| 26 | $current_user_roles = array_values( $current_user->roles ); // indexed array |
| 27 | $current_user_username = $current_user->user_login; |
| 28 | |
| 29 | // Get which role slug is currently set to "View as" |
| 30 | $viewing_admin_as = get_user_meta( get_current_user_id(), '_asenha_viewing_admin_as', true ); |
| 31 | |
| 32 | if ( empty( $viewing_admin_as ) ) { |
| 33 | update_user_meta( get_current_user_id(), '_asenha_viewing_admin_as', 'administrator' ); |
| 34 | } |
| 35 | |
| 36 | // Get the role name, translated if available, from the role slug |
| 37 | $wp_roles = wp_roles()->roles; |
| 38 | |
| 39 | foreach ( $wp_roles as $wp_role_slug => $wp_role_info ) { |
| 40 | |
| 41 | if ( $wp_role_slug == $viewing_admin_as ) { |
| 42 | |
| 43 | $viewing_admin_as_role_name = $wp_role_info['name']; |
| 44 | |
| 45 | } |
| 46 | |
| 47 | } |
| 48 | |
| 49 | if ( ! isset( $viewing_admin_as_role_name ) ) { |
| 50 | |
| 51 | $viewing_admin_as_role_name = $viewing_admin_as; |
| 52 | |
| 53 | } |
| 54 | |
| 55 | $translated_name_for_viewing_admin_as = ucfirst( $viewing_admin_as_role_name ); |
| 56 | |
| 57 | // Add parent menu based on the role being set to "View as" |
| 58 | |
| 59 | if ( 'administrator' == $viewing_admin_as ) { |
| 60 | |
| 61 | if ( in_array( 'administrator', $current_user_roles ) ) { |
| 62 | |
| 63 | // Add parent menu for administrators |
| 64 | $wp_admin_bar->add_menu( array( |
| 65 | 'id' => 'asenha-view-admin-as-role', |
| 66 | 'parent' => 'top-secondary', |
| 67 | 'title' => 'View as <span style="font-size:0.8125em;">▼</span>', |
| 68 | 'href' => '#', |
| 69 | 'meta' => array( |
| 70 | 'title' => 'View admin pages and the site (logged-in) as one of the following user roles.' |
| 71 | ), |
| 72 | ) ); |
| 73 | |
| 74 | } |
| 75 | |
| 76 | } else { |
| 77 | |
| 78 | // Limit to users performing role switching only. i.e. Don't show role switcher to regularly logging in users. |
| 79 | if ( in_array( $current_user_username, $usernames ) ) { |
| 80 | |
| 81 | // Add parent menu |
| 82 | $wp_admin_bar->add_menu( array( |
| 83 | 'id' => 'asenha-view-admin-as-role', |
| 84 | 'parent' => 'top-secondary', |
| 85 | 'title' => 'Viewing as ' . $translated_name_for_viewing_admin_as . ' <span style="font-size:0.8125em;">▼</span>', |
| 86 | 'href' => '#', |
| 87 | ) ); |
| 88 | |
| 89 | } |
| 90 | |
| 91 | } |
| 92 | |
| 93 | // Get available role(s) to switch to |
| 94 | $roles_to_switch_to = $this->get_roles_to_switch_to(); |
| 95 | |
| 96 | // Add role(s) to switch to as sub-menu |
| 97 | |
| 98 | if ( 'administrator' == $viewing_admin_as ) { |
| 99 | |
| 100 | if ( in_array( 'administrator', $current_user_roles ) ) { |
| 101 | |
| 102 | // Add submenu for each role other than Administrator |
| 103 | |
| 104 | $i = 1; |
| 105 | |
| 106 | foreach ( $roles_to_switch_to as $role_slug => $data ) { |
| 107 | |
| 108 | $wp_admin_bar->add_menu( array( |
| 109 | 'id' => 'role' . $i . '_' . $role_slug, // id based on role slug, e.g. role1_editor, role5_shop_manager |
| 110 | 'parent' => 'asenha-view-admin-as-role', |
| 111 | 'title' => $data['role_name'], // role name, e.g. Editor, Shop Manager |
| 112 | 'href' => $data['nonce_url'], // nonce URL for each role |
| 113 | ) ); |
| 114 | |
| 115 | $i++; |
| 116 | |
| 117 | } |
| 118 | |
| 119 | } |
| 120 | |
| 121 | } else { |
| 122 | |
| 123 | // Add submenu to switch back to Administrator role |
| 124 | // Limit to users performing role switching only. i.e. Don't show role switcher to regularly logging in users. |
| 125 | |
| 126 | if ( in_array( $current_user_username, $usernames ) ) { |
| 127 | |
| 128 | foreach ( $roles_to_switch_to as $role_slug => $data ) { |
| 129 | |
| 130 | $wp_admin_bar->add_menu( array( |
| 131 | 'id' => 'role_' . $role_slug, // id based on role slug, e.g. role1_editor, role5_shop_manager |
| 132 | 'parent' => 'asenha-view-admin-as-role', |
| 133 | 'title' => 'Switch back to ' . $data['role_name'], // role name, e.g. Editor, Shop Manager |
| 134 | 'href' => $data['nonce_url'], // nonce URL for each role |
| 135 | |
| 136 | ) ); |
| 137 | |
| 138 | } |
| 139 | |
| 140 | } |
| 141 | |
| 142 | } |
| 143 | |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Get roles availble to switch to |
| 148 | * |
| 149 | * @since 1.8.0 |
| 150 | */ |
| 151 | private function get_roles_to_switch_to() { |
| 152 | |
| 153 | $current_user = wp_get_current_user(); |
| 154 | $current_user_role_slugs = $current_user->roles; // indexed array of current user role slug(s) |
| 155 | |
| 156 | // Get full list of roles defined in WordPress |
| 157 | $wp_roles = wp_roles()->roles; |
| 158 | |
| 159 | $roles_to_switch_to = array(); |
| 160 | |
| 161 | // Get which role slug is currently active for viewing |
| 162 | $viewing_admin_as = get_user_meta( get_current_user_id(), '_asenha_viewing_admin_as', true ); |
| 163 | |
| 164 | if ( 'administrator' == $viewing_admin_as ) { |
| 165 | |
| 166 | // Exclude 'Administrator' from the "View as" menu |
| 167 | |
| 168 | foreach ( $wp_roles as $wp_role_slug => $wp_role_info ) { |
| 169 | |
| 170 | if ( ! in_array( $wp_role_slug,$current_user_role_slugs ) ) { |
| 171 | |
| 172 | $roles_to_switch_to[$wp_role_slug] = array( |
| 173 | 'role_name' => $wp_role_info['name'], // role name, e.g. Editor, Shop Manager |
| 174 | 'nonce_url' => wp_nonce_url( |
| 175 | add_query_arg( array( |
| 176 | 'action' => 'switch_role_to', |
| 177 | 'role' => $wp_role_slug, |
| 178 | ) ), // add query parameters to current URl, this is the $actionurl that will be appended with the nonce action |
| 179 | 'asenha_view_admin_as_' . $wp_role_slug, // the nonce $action name |
| 180 | 'nonce' // the nonce url parameter name |
| 181 | ) // will result in a URL that looks like https://www.example.com/wp-admin/index.php?action=switch_role_to&role=editor&nonce=2ced3a40df |
| 182 | ); |
| 183 | |
| 184 | } |
| 185 | |
| 186 | } |
| 187 | |
| 188 | } else { |
| 189 | |
| 190 | // Only show switch back to Administrator in the "View as" menu |
| 191 | |
| 192 | $roles_to_switch_to['administrator'] = array( |
| 193 | 'role_name' => 'Administrator', // role name, e.g. Editor, Shop Manager |
| 194 | 'nonce_url' => wp_nonce_url( |
| 195 | add_query_arg( array( |
| 196 | 'action' => 'switch_back_to_administrator', |
| 197 | 'role' => 'administrator', |
| 198 | ) ), // add query parameters to current URl, this is the $actionurl that will be appended with the nonce action |
| 199 | 'asenha_view_admin_as_administrator', // the nonce $action name |
| 200 | 'nonce' // the nonce url parameter name |
| 201 | ) // will result in a URL that looks like https://www.example.com/wp-admin/index.php?action=switch_role_to&role=editor&nonce=2ced3a40df |
| 202 | ); |
| 203 | } |
| 204 | |
| 205 | return $roles_to_switch_to; // array of $role_slug => $nonce_url |
| 206 | |
| 207 | } |
| 208 | |
| 209 | /** |
| 210 | * Switch user role to view admin and site |
| 211 | * |
| 212 | * @since 1.8.0 |
| 213 | */ |
| 214 | public function role_switcher_to_view_admin_as() { |
| 215 | |
| 216 | $current_user = wp_get_current_user(); |
| 217 | $current_user_role_slugs = $current_user->roles; // indexed array of current user role slug(s) |
| 218 | $current_user_username = $current_user->user_login; |
| 219 | |
| 220 | $options = get_option( ASENHA_SLUG_U, array() ); |
| 221 | $options['viewing_admin_as_role_are'] = array(); |
| 222 | |
| 223 | if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['role'] ) && isset( $_REQUEST['nonce'] ) ) { |
| 224 | |
| 225 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 226 | $new_role = sanitize_text_field( $_REQUEST['role'] ); |
| 227 | $nonce = sanitize_text_field( $_REQUEST['nonce'] ); |
| 228 | |
| 229 | if ( 'switch_role_to' === $action ) { |
| 230 | |
| 231 | // Check nonce validity and role existence |
| 232 | |
| 233 | $wp_roles = array_keys( wp_roles()->roles ); // indexed array of all WP roles |
| 234 | |
| 235 | if ( ! wp_verify_nonce( $nonce, 'asenha_view_admin_as_' . $new_role ) || ! in_array( $new_role, $wp_roles ) ) { |
| 236 | return; // cancel role switching |
| 237 | } |
| 238 | |
| 239 | // Get original roles (before role switching) of the current user |
| 240 | $original_role_slugs = get_user_meta( get_current_user_id(), '_asenha_view_admin_as_original_roles', true ); |
| 241 | |
| 242 | // Store original user role(s) before switching it to another role |
| 243 | |
| 244 | if ( empty( $original_role_slugs ) ) { |
| 245 | |
| 246 | update_user_meta( get_current_user_id(), '_asenha_view_admin_as_original_roles', $current_user_role_slugs ); |
| 247 | |
| 248 | } |
| 249 | |
| 250 | // Store current user's username in options |
| 251 | $options['viewing_admin_as_role_are'][] = $current_user_username; |
| 252 | update_option( ASENHA_SLUG_U, $options, true ); |
| 253 | |
| 254 | // Remove all current roles from current user. |
| 255 | foreach ( $current_user_role_slugs as $current_user_role_slug ) { |
| 256 | |
| 257 | $current_user->remove_role( $current_user_role_slug ); |
| 258 | |
| 259 | } |
| 260 | |
| 261 | // Add new role to current user |
| 262 | $current_user->add_role( $new_role ); |
| 263 | |
| 264 | // Mark that the user has switched to a non-administrator role |
| 265 | update_user_meta( get_current_user_id(), '_asenha_viewing_admin_as', $new_role ); |
| 266 | |
| 267 | // if ( ! in_array( $new_role, array( 'administrator', 'editor', 'author', 'contributor' ) ) ) { |
| 268 | |
| 269 | // Redirect to profile edit page |
| 270 | // wp_safe_redirect( get_edit_profile_url() ); |
| 271 | |
| 272 | // } else { |
| 273 | |
| 274 | // Redirect to admin dashboard |
| 275 | wp_safe_redirect( get_admin_url() ); |
| 276 | |
| 277 | // } |
| 278 | |
| 279 | exit; |
| 280 | |
| 281 | } |
| 282 | |
| 283 | if ( 'switch_back_to_administrator' === $action ) { |
| 284 | |
| 285 | // Check nonce validity |
| 286 | |
| 287 | if ( ! wp_verify_nonce( $nonce, 'asenha_view_admin_as_administrator' ) || ( $new_role != 'administrator' ) ) { |
| 288 | return; // cancel role switching |
| 289 | } |
| 290 | |
| 291 | // Remove all current roles from current user. |
| 292 | foreach ( $current_user_role_slugs as $current_role_slug ) { |
| 293 | |
| 294 | $current_user->remove_role( $current_role_slug ); |
| 295 | |
| 296 | } |
| 297 | |
| 298 | // Get original roles (before role switching) of the current user |
| 299 | $original_role_slugs = get_user_meta( get_current_user_id(), '_asenha_view_admin_as_original_roles', true ); |
| 300 | |
| 301 | // Add the original roles to the current user |
| 302 | foreach ( $original_role_slugs as $original_role_slug ) { |
| 303 | |
| 304 | $current_user->add_role( $original_role_slug ); |
| 305 | |
| 306 | } |
| 307 | |
| 308 | // Remove current user's username from stored usernames. |
| 309 | $usernames = $options['viewing_admin_as_role_are']; |
| 310 | foreach ( $usernames as $key => $username ) { |
| 311 | if ( $current_user_username == $username ) { |
| 312 | unset( $usernames[$key] ); |
| 313 | } |
| 314 | } |
| 315 | $options['viewing_admin_as_role_are'] = $usernames; |
| 316 | update_option( ASENHA_SLUG_U, $options, true ); |
| 317 | |
| 318 | // Mark that the user has switched back to an administrator role |
| 319 | update_user_meta( get_current_user_id(), '_asenha_viewing_admin_as', 'administrator' ); |
| 320 | |
| 321 | } |
| 322 | |
| 323 | } elseif ( isset( $_REQUEST['reset-for'] ) ) { |
| 324 | |
| 325 | $reset_for_username = sanitize_text_field( $_REQUEST['reset-for'] ); |
| 326 | |
| 327 | $options = get_option( ASENHA_SLUG_U, array() ); |
| 328 | $usernames = isset( $options['viewing_admin_as_role_are'] ) ? $options['viewing_admin_as_role_are'] : array(); |
| 329 | |
| 330 | if ( ! empty( $reset_for_username ) ) { |
| 331 | |
| 332 | if ( in_array( $reset_for_username, $usernames ) ) { |
| 333 | |
| 334 | $current_user = get_user_by( 'login', $reset_for_username ); |
| 335 | $current_user_role_slugs = $current_user->roles; // indexed array of current user role slug(s) |
| 336 | |
| 337 | // Remove all current roles from current user. |
| 338 | foreach ( $current_user_role_slugs as $current_role_slug ) { |
| 339 | |
| 340 | $current_user->remove_role( $current_role_slug ); |
| 341 | |
| 342 | } |
| 343 | |
| 344 | // Get original roles (before role switching) of the current user |
| 345 | $original_role_slugs = get_user_meta( $current_user->ID, '_asenha_view_admin_as_original_roles', true ); |
| 346 | |
| 347 | // Add the original roles to the current user |
| 348 | foreach ( $original_role_slugs as $original_role_slug ) { |
| 349 | |
| 350 | $current_user->add_role( $original_role_slug ); |
| 351 | |
| 352 | } |
| 353 | |
| 354 | // Mark that the user has switched back to an administrator role |
| 355 | update_user_meta( $current_user->ID, '_asenha_viewing_admin_as', 'administrator' ); |
| 356 | |
| 357 | // Remove current user's username from stored usernames. |
| 358 | foreach ( $usernames as $key => $username ) { |
| 359 | if ( $reset_for_username == $username ) { |
| 360 | unset( $usernames[$key] ); |
| 361 | } |
| 362 | } |
| 363 | $options['viewing_admin_as_role_are'] = $usernames; |
| 364 | update_option( ASENHA_SLUG_U, $options, true ); |
| 365 | |
| 366 | // Redirect to login URL, including when custom login slug is set and active |
| 367 | if ( array_key_exists( 'change_login_url', $options ) && $options['change_login_url'] ) { |
| 368 | if ( array_key_exists( 'custom_login_slug', $options ) && ! empty( $options['custom_login_slug'] ) ) { |
| 369 | $login_url = get_site_url( null, $options['custom_login_slug'] ); |
| 370 | } |
| 371 | } else { |
| 372 | $login_url = wp_login_url(); |
| 373 | } |
| 374 | |
| 375 | // Redirect to admin dashboard |
| 376 | // wp_safe_redirect( $login_url ); |
| 377 | // exit; |
| 378 | |
| 379 | // Use JS redirect, which works more reliably on the frontend |
| 380 | ?> |
| 381 | <script> |
| 382 | window.location.href='<?php echo esc_url( $login_url ); ?>'; |
| 383 | </script> |
| 384 | <?php |
| 385 | |
| 386 | } |
| 387 | |
| 388 | } |
| 389 | |
| 390 | } |
| 391 | |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * When changing a user's role via their profile edit screen, maybe we sbould remove the user's username from a list of usernames that can switch back to the administrator role. This addresses a vulnerability in a rare scenario disclosed by Pathstack. |
| 396 | * |
| 397 | * @since 7.6.3 |
| 398 | */ |
| 399 | public function maybe_prevent_switchback_to_administrator( $user_id ) { |
| 400 | $viewing_admin_as = get_user_meta( $user_id, '_asenha_viewing_admin_as', true ); |
| 401 | |
| 402 | if ( 'administrator' != $viewing_admin_as ) { |
| 403 | $user = get_user_by( 'id', $user_id ); |
| 404 | $current_user_username = $user->user_login; |
| 405 | |
| 406 | // Remove current user's username from stored usernames. |
| 407 | // Once removed, that user won't be able to switch back to the administrator role from the ?reset-for=username URL |
| 408 | $options = get_option( ASENHA_SLUG_U, array() ); |
| 409 | $usernames = isset( $options['viewing_admin_as_role_are'] ) ? $options['viewing_admin_as_role_are'] : array(); |
| 410 | |
| 411 | if ( ! empty( $usernames ) ) { |
| 412 | foreach ( $usernames as $key => $username ) { |
| 413 | if ( $current_user_username == $username ) { |
| 414 | unset( $usernames[$key] ); |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | $options['viewing_admin_as_role_are'] = $usernames; |
| 419 | update_option( ASENHA_SLUG_U, $options, true ); |
| 420 | } |
| 421 | |
| 422 | // Delete user meta related to View Admin As Role module |
| 423 | delete_user_meta( $user_id, '_asenha_viewing_admin_as' ); |
| 424 | delete_user_meta( $user_id, '_asenha_view_admin_as_original_roles' ); |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Add floating button to reset the view/account back to the administrator |
| 430 | * |
| 431 | * @since 6.1.3 |
| 432 | */ |
| 433 | public function add_floating_reset_button() { |
| 434 | $options = get_option( ASENHA_SLUG_U, array() ); |
| 435 | $admin_usernames_viewing_as_role = isset( $options['viewing_admin_as_role_are'] ) ? $options['viewing_admin_as_role_are'] : array();; |
| 436 | $current_user = wp_get_current_user(); |
| 437 | $username = $current_user->user_login; |
| 438 | |
| 439 | // Show for non-admins |
| 440 | if ( ! current_user_can( 'manage_options' ) && in_array( $username, $admin_usernames_viewing_as_role ) ) { |
| 441 | ?> |
| 442 | <div id="role-view-reset"> |
| 443 | <a href="<?php echo esc_url( get_site_url() ); ?>/?reset-for=<?php echo esc_attr( $username ); ?>" class="button button-primary">Switch back to Administrator</a> |
| 444 | </div> |
| 445 | <?php |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * Show custom error page on switch failure, which causes inability to view admin dashboard/pages |
| 451 | * |
| 452 | * @since 1.8.0 |
| 453 | */ |
| 454 | public function custom_error_page_on_switch_failure( $callback ) { |
| 455 | |
| 456 | ?> |
| 457 | <!DOCTYPE html> |
| 458 | <html> |
| 459 | <head> |
| 460 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8; ?>" /> |
| 461 | <meta name="viewport" content="width=device-width"> |
| 462 | <title>WordPress Error</title> |
| 463 | <style type="text/css"> |
| 464 | html { |
| 465 | background: #f1f1f1; |
| 466 | } |
| 467 | body { |
| 468 | background: #fff; |
| 469 | border: 1px solid #ccd0d4; |
| 470 | color: #444; |
| 471 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
| 472 | margin: 2em auto; |
| 473 | padding: 1em 2em; |
| 474 | max-width: 700px; |
| 475 | -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04); |
| 476 | box-shadow: 0 1px 1px rgba(0, 0, 0, .04); |
| 477 | } |
| 478 | h1 { |
| 479 | border-bottom: 1px solid #dadada; |
| 480 | clear: both; |
| 481 | color: #666; |
| 482 | font-size: 24px; |
| 483 | margin: 30px 0 0 0; |
| 484 | padding: 0; |
| 485 | padding-bottom: 7px; |
| 486 | } |
| 487 | #error-page { |
| 488 | margin-top: 50px; |
| 489 | } |
| 490 | #error-page p, |
| 491 | #error-page .wp-die-message { |
| 492 | font-size: 14px; |
| 493 | line-height: 1.5; |
| 494 | margin: 20px 0; |
| 495 | } |
| 496 | #error-page code { |
| 497 | font-family: Consolas, Monaco, monospace; |
| 498 | } |
| 499 | a { |
| 500 | color: #0073aa; |
| 501 | } |
| 502 | a:hover, |
| 503 | a:active { |
| 504 | color: #006799; |
| 505 | } |
| 506 | a:focus { |
| 507 | color: #124964; |
| 508 | -webkit-box-shadow: |
| 509 | 0 0 0 1px #5b9dd9, |
| 510 | 0 0 2px 1px rgba(30, 140, 190, 0.8); |
| 511 | box-shadow: |
| 512 | 0 0 0 1px #5b9dd9, |
| 513 | 0 0 2px 1px rgba(30, 140, 190, 0.8); |
| 514 | outline: none; |
| 515 | } |
| 516 | </style> |
| 517 | </head> |
| 518 | <body id="error-page"> |
| 519 | <div class="wp-die-message">Something went wrong. Please try logging in.</div> |
| 520 | </body> |
| 521 | </html> |
| 522 | <?php |
| 523 | |
| 524 | } |
| 525 | |
| 526 | } |