Skip to content
Snippets Groups Projects
Commit f71e8970 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

work on getemail page that appears during first time CAS sign in. changes...

work on getemail page that appears during first time CAS sign in.  changes include: moving files arround into the correct elgg structure, adding tokens to the action calls
parent 462f1afc
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Elgg UNL SSO get email registration action
*
* @package Elgg
* @subpackage Core
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd
* @copyright Curverider Ltd 2008-2009
* @link http://elgg.org/
*/
global $CONFIG;
action_gatekeeper();
$email = get_input('email');
$email = sanitise_string($email);
if (is_email_address($email)) {
if (!get_user_by_email($email)) {
$ts = time();
$token = generate_action_token($ts);
forward($CONFIG->url.'action/login?usecas=yes&email='.$email.'&__elgg_ts='.$ts.'&__elgg_token='.$token);
} 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."));
}
forward($CONFIG->url . 'pg/getemail?e=' . urlencode($email));
?>
\ No newline at end of file
......@@ -21,6 +21,8 @@
$password = get_input("password");
$persistent = get_input("persistent", false);
$usecas = get_input('usecas');
//this is available once they have given their email
$email = get_input('email');
// 1. Do the regular elgg login if username and password are set
$result = false;
......@@ -41,7 +43,7 @@
$casObject->forceCas();
} else {
$cas_user = $casObject->getUserCas();
if ($user = $casObject->casAuthenticate($cas_user)) {
if ($user = $casObject->casAuthenticate($cas_user,$email)) {
$result = login($user);
if ($result)
$_SESSION['loggedInWithCas'] = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment