From 94d5632901d62628c910542615cab73be42e3352 Mon Sep 17 00:00:00 2001
From: Eric Rasmussen <erasmussen2@unl.edu>
Date: Wed, 29 Sep 2010 19:22:14 +0000
Subject: [PATCH] Move $ts and $token up on the page before calling them; Add
 in needed ?

---
 .../views/default/account/forms/login.php       | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/plugins/cas_auth_unl/views/default/account/forms/login.php b/plugins/cas_auth_unl/views/default/account/forms/login.php
index 120bcea4..50e6357e 100644
--- a/plugins/cas_auth_unl/views/default/account/forms/login.php
+++ b/plugins/cas_auth_unl/views/default/account/forms/login.php
@@ -9,29 +9,28 @@
 	 * @link http://www.unl.edu/
 	 */
 
-	if($vars['config']->input['view'] == 'mobile')
+	if ($vars['config']->input['view'] == 'mobile') {
 		$viewmobile = 'view=mobile';
-	else
-		$viewmobile = '';	
+	} else {
+		$viewmobile = '';
+	}
+    $ts = time();
+    $token = generate_action_token($ts); 
 ?>
 <div id="actionBar" class="casLogin">
     <div id="casOption">
 	    <a href="<?php echo $vars['url'] ?>action/login?usecas=yes&__elgg_ts=<?php echo $ts; ?>&__elgg_token=<?php echo $token; ?>&<?php echo $viewmobile;?>" id="casLogin">Login</a>
-	    <?php 
-	        $ts = time();
-	        $token = generate_action_token($ts); 
-	    ?>
 	    <div class="loginMessage">
 	        with your My.UNL Account<br />
 	        <span>for Faculty, Staff and Students</span>
         </div>
     </div>
     <div id="elggOption">
-	    <a href="<?php echo $vars['url'] .'pg/login'.$viewmobile?>" class="switchAction"></a>
+	    <a href="<?php echo $vars['url'] .'pg/login?'.$viewmobile?>" class="switchAction"></a>
 	    <div class="optionMessage">
 	        Don't have a My.UNL Account?
 		    <ul>
-		        <li><a href="<?php echo $vars['url'] .'pg/login'.$viewmobile?>" class="switchAction">Login</a></li>
+		        <li><a href="<?php echo $vars['url'] .'pg/login?'.$viewmobile?>" class="switchAction">Login</a></li>
 		        <li><a href="<?php echo $vars['url'] .'account/register.php?'.$viewmobile?>">Register</a></li>
 		    </ul>
 	    </div>
-- 
GitLab