Skip to content
Snippets Groups Projects
Commit a5fb3fc1 authored by Tim Steiner's avatar Tim Steiner
Browse files

Automatically redirect to CAS when a user who isn't loged in attempts to register a new blog.

parent c5ad55a8
No related branches found
No related tags found
No related merge requests found
...@@ -49,8 +49,13 @@ if (!function_exists('wp_validate_auth_cookie')) { ...@@ -49,8 +49,13 @@ if (!function_exists('wp_validate_auth_cookie')) {
function unl_set_current_user() function unl_set_current_user()
{ {
$auth = NULL;
if (array_key_exists('unl_sso', $_COOKIE)) { if (array_key_exists('unl_sso', $_COOKIE)) {
$auth = phpCAS::checkAuthentication(); $auth = phpCAS::checkAuthentication();
}
if ($GLOBALS['blogname'] == 'wp-signup.php') {
$auth = phpCAS::forceAuthentication();
}
if ($auth) { if ($auth) {
$username = phpCAS::getUser(); $username = phpCAS::getUser();
$user = new WP_User($username); $user = new WP_User($username);
...@@ -62,7 +67,6 @@ function unl_set_current_user() ...@@ -62,7 +67,6 @@ function unl_set_current_user()
$GLOBALS['current_user'] = $user; $GLOBALS['current_user'] = $user;
} }
} }
}
function unl_import_user($username) function unl_import_user($username)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment