1 user.module user_custom_theme()

Implements hook_custom_theme().

Activates the admin theme for login, register, and reset pages if configured to use the simple login page. Note this by-passes the "view the administration theme" permission to show the admin theme to anonymous users.

File

core/modules/user/user.module, line 1852
Enables the user registration and login system.

Code

function user_custom_theme() {
  if (!user_is_login_path() || user_is_logged_in()) {
    return NULL;
  }
  $user_login_appearance = config_get('system.core', 'user_login_appearance');
  if ($user_login_appearance == 'simplified') {
    $login_theme = config_get('system.core', 'login_admin_theme');
    if ($login_theme) {
      $login_theme = config_get('system.core', 'admin_theme');
    }
    else {
      $login_theme = config_get('system.core', 'theme_default');
    }
    return $login_theme;
  }
  return NULL;
}