From cdb8dcbfbc300fa0533df7059e8980f80de8e7bd Mon Sep 17 00:00:00 2001 From: Eric Rasmussen <erasmussen2@unl.edu> Date: Tue, 22 Dec 2009 20:30:56 +0000 Subject: [PATCH] cleanup some formatting --- cas_auth/start.php | 10 ++-- .../views/default/account/forms/login.php | 2 +- cas_auth/views/default/actions/getemail.php | 52 +++++++------------ 3 files changed, 23 insertions(+), 41 deletions(-) diff --git a/cas_auth/start.php b/cas_auth/start.php index 160228c9..88191e2b 100644 --- a/cas_auth/start.php +++ b/cas_auth/start.php @@ -119,12 +119,11 @@ system_message(elgg_echo('loginok')); $cas_user = str_replace('-','_',$cas_user); - //user is logged in now, this is the last step - forward based on whether they have logged in before - $lastlogin_date = $_SESSION['user']->last_login; - if (!$lastlogin_date) { + //user is logged in now, this is the last step - forward based on whether they have logged in before + if (!$_SESSION['user']->last_login) forward('mod/profile/edit.php?firstlogin=yes'); - } - forward("pg/profile/unl_" . $cas_user); + else + forward("pg/profile/unl_" . $cas_user); } else { register_error(elgg_echo('loginerror')); } @@ -243,7 +242,6 @@ //Replace the hyphen in a student's name with an underscore $username = str_replace('-','_',$username); - if ($user = get_user_by_username($username)) { // User exists, login return login($user); diff --git a/cas_auth/views/default/account/forms/login.php b/cas_auth/views/default/account/forms/login.php index d71c56d2..acb4a00a 100644 --- a/cas_auth/views/default/account/forms/login.php +++ b/cas_auth/views/default/account/forms/login.php @@ -24,7 +24,7 @@ //<input name=\"username\" type=\"text\" class="general-textarea" /></label> ?> -<div id="login" class="loginPage"> + <div id="login" class="loginPage"> <div class="two_col left"> <h2 class="sec_main">Students, Faculty, Staff</h2> diff --git a/cas_auth/views/default/actions/getemail.php b/cas_auth/views/default/actions/getemail.php index 8847eefc..49147433 100644 --- a/cas_auth/views/default/actions/getemail.php +++ b/cas_auth/views/default/actions/getemail.php @@ -10,44 +10,28 @@ * @copyright Curverider Ltd 2008-2009 * @link http://elgg.org/ */ - -// require_once(dirname(dirname(__FILE__)) . "/engine/start.php"); + global $CONFIG; -// action_gatekeeper(); - - - // Get variables - - $email = get_input('email'); - // var_dump($email); - - $email = sanitise_string($email); - // var_dump($email); + action_gatekeeper(); + + $email = get_input('email'); + $email = sanitise_string($email); - if (is_email_address($email)) - { - if (!get_user_by_email($email)) - { - forward('?loginwith=UNLlogin&email=' . $email); - } - else - { - register_error(elgg_echo("Sorry, that email has already been registered. Please try again.")); - } + if (is_email_address($email)) { + if (!get_user_by_email($email)) { + forward('?loginwith=UNLlogin&email=' . $email); + } else { + register_error(elgg_echo("Sorry, that email has already been registered. Please try again.")); } - else - { - register_error(elgg_echo("Sorry, that is not a complete email address. Please try again.")); - } - - + } else { + register_error(elgg_echo("Sorry, that is not a complete email address. Please try again.")); + } - - $qs = explode('?',$_SERVER['HTTP_REFERER']); - $qs = $qs[0]; - $qs .= "?e=" . urlencode($email); - - forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php?e=' . urlencode($email)); + $qs = explode('?',$_SERVER['HTTP_REFERER']); + $qs = $qs[0]; + $qs .= "?e=" . urlencode($email); + + forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php?e=' . urlencode($email)); ?> \ No newline at end of file -- GitLab