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
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ ...@@ -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("login",false,$CONFIG->pluginspath. "cas_auth_unl/actions/login.php");
register_action("logout",false,$CONFIG->pluginspath. "cas_auth_unl/actions/logout.php"); register_action("logout",false,$CONFIG->pluginspath. "cas_auth_unl/actions/logout.php");
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
// Set up login page, this creates the url /pg/login to be used as our login page // Set up login page, this creates the url /pg/login to be used as our login page
register_page_handler('login', 'login_page_handler'); register_page_handler('login', 'login_page_handler');
/* set up getemail page */
register_page_handler('getemail', 'getemail_page_handler');
function login_page_handler($page) { function login_page_handler($page) {
// If we're not logged in, display the login page // If we're not logged in, display the login page
...@@ -45,6 +47,14 @@ ...@@ -45,6 +47,14 @@
forward(); 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 { ...@@ -102,7 +112,7 @@ class elggSimpleCas {
return true; return true;
} }
public function casAuthenticate($username){ public function casAuthenticate($username,$email=""){
if (empty($username)) if (empty($username))
return false; return false;
...@@ -125,16 +135,13 @@ class elggSimpleCas { ...@@ -125,16 +135,13 @@ class elggSimpleCas {
} else { } else {
// Valid login but user doesn't exist // Valid login but user doesn't exist
$pf_user_info = peoplefinderServices($casusername); $pf_user_info = peoplefinderServices($casusername);
$name = $pf_user_info->cn; $name = $pf_user_info->cn;
if (isset($_REQUEST['email'])) { if (empty($email)){
$email = $_REQUEST['email'];
} else {
if($pf_user_info->mail) 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 else
forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php'); forward($CONFIG->url . 'pg/getemail');
} }
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment