Skip to content
Snippets Groups Projects
Commit 462f1afc 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 3dc9dd82
Branches
Tags
No related merge requests found
......@@ -24,7 +24,7 @@
}
register_action("getemail",true,$CONFIG->pluginspath . "cas_auth_unl/views/default/actions/getemail.php");
register_action("getemail",true,$CONFIG->pluginspath . "cas_auth_unl/actions/getemail.php");
register_action("login",false,$CONFIG->pluginspath. "cas_auth_unl/actions/login.php");
register_action("logout",false,$CONFIG->pluginspath. "cas_auth_unl/actions/logout.php");
......@@ -34,17 +34,27 @@
// Set up login page, this creates the url /pg/login to be used as our login page
register_page_handler('login', 'login_page_handler');
function login_page_handler($page) {
// If we're not logged in, display the login page
if (!isloggedin()) {
page_draw(elgg_echo('login'), elgg_view("account/forms/login"));
// Otherwise, forward to the index page
} else {
forward();
}
}
register_page_handler('login', 'login_page_handler');
/* set up getemail page */
register_page_handler('getemail', 'getemail_page_handler');
function login_page_handler($page) {
// If we're not logged in, display the login page
if (!isloggedin()) {
page_draw(elgg_echo('login'), elgg_view("account/forms/login"));
// Otherwise, forward to the index page
} else {
forward();
}
}
function getemail_page_handler($page) {
if (!isloggedin()) {
page_draw(elgg_echo('Your Email'), elgg_view("account/forms/getemail"));
} else {
forward();
}
}
......@@ -102,7 +112,7 @@ class elggSimpleCas {
return true;
}
public function casAuthenticate($username){
public function casAuthenticate($username,$email=""){
if (empty($username))
return false;
......@@ -125,16 +135,13 @@ class elggSimpleCas {
} else {
// Valid login but user doesn't exist
$pf_user_info = peoplefinderServices($casusername);
$name = $pf_user_info->cn;
if (isset($_REQUEST['email'])) {
$email = $_REQUEST['email'];
} else {
if (empty($email)){
if($pf_user_info->mail)
forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php?e=' . $pf_user_info->mail);
forward($CONFIG->url . 'pg/getemail?e=' . $pf_user_info->mail);
else
forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php');
forward($CONFIG->url . 'pg/getemail');
}
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment