[Fusionforge-commits] r12902 - in trunk/src: common/include plugins/authcas/www

Olivier Berger olberger at fusionforge.org
Thu Mar 24 16:35:26 CET 2011


Author: olberger
Date: 2011-03-24 16:35:25 +0100 (Thu, 24 Mar 2011)
New Revision: 12902

Modified:
   trunk/src/common/include/AuthPlugin.class.php
   trunk/src/plugins/authcas/www/post-login.php
Log:
more doc strings and proper redirect functions

Modified: trunk/src/common/include/AuthPlugin.class.php
===================================================================
--- trunk/src/common/include/AuthPlugin.class.php	2011-03-24 15:18:04 UTC (rev 12901)
+++ trunk/src/common/include/AuthPlugin.class.php	2011-03-24 15:35:25 UTC (rev 12902)
@@ -96,8 +96,9 @@
 	
 	
 	/**
-	 * TODO: Enter description here ...
-	 * @var unknown_type
+	 * Current forge user
+	 * 
+	 * @var object GFUser
 	 */
 	protected $saved_user;
 	
@@ -179,6 +180,11 @@
 	// FIXME : where is $this->cookie_name set ?
 	protected $cookie_name;
 
+	/**
+	 * Returns the session cookie name for the auth plugin (by default forge_session_AUTHPLUGINNAME)
+	 * 
+	 * @return string
+	 */
 	protected function getCookieName() {
 		if ($this->cookie_name) {
 			return $this->cookie_name;

Modified: trunk/src/plugins/authcas/www/post-login.php
===================================================================
--- trunk/src/plugins/authcas/www/post-login.php	2011-03-24 15:18:04 UTC (rev 12901)
+++ trunk/src/plugins/authcas/www/post-login.php	2011-03-24 15:35:25 UTC (rev 12902)
@@ -48,7 +48,8 @@
 if (forge_get_config('use_ssl') && !session_issecure()) {
 	//force use of SSL for login
 	// redirect
-	header('Location: https://'.getStringFromServer('HTTP_HOST').getStringFromServer('REQUEST_URI'));
+	session_redirect_external('https://'.getStringFromServer('HTTP_HOST').getStringFromServer('REQUEST_URI'))
+	//header('Location: https://'.getStringFromServer('HTTP_HOST').getStringFromServer('REQUEST_URI'));
 }
 
 // Here comes CAS standard magic (which will redirect to the CAS server, etc.)
@@ -61,12 +62,13 @@
 	}
 	if ($return_to) {
 		validate_return_to($return_to);
-
-		header ("Location: " . util_make_url($return_to));
-		exit;
+		session_redirect($return_to);
+		//header ("Location: " . util_make_url($return_to));
+		//exit;
 	} else {
-		header ("Location: " . util_make_url("/my"));
-		exit;
+		session_redirect("/my");
+		//header ("Location: " . util_make_url("/my"));
+		//exit;
 	}
 } else {
 	if ($login) {		     // The user just clicked the Login button
@@ -86,11 +88,13 @@
 			if ($return_to) {
 				validate_return_to($return_to);
 				
-				header ("Location: " . util_make_url($return_to));
-				exit;
+				session_redirect($return_to);
+				//header ("Location: " . util_make_url($return_to));
+				//exit;
 			} else {
-				header ("Location: " . util_make_url("/my"));
-				exit;
+				session_redirect("/my");
+				//header ("Location: " . util_make_url("/my"));
+				//exit;
 			}
 		} 
 	}




More information about the Fusionforge-commits mailing list