[Fusionforge-commits] r12831 - in trunk/src/plugins/authhttpd: include www

Roland Mas lolando at fusionforge.org
Thu Mar 17 12:21:20 CET 2011


Author: lolando
Date: 2011-03-17 12:21:20 +0100 (Thu, 17 Mar 2011)
New Revision: 12831

Modified:
   trunk/src/plugins/authhttpd/include/AuthHTTPDPlugin.class.php
   trunk/src/plugins/authhttpd/www/post-login.php
Log:
Fixes to authhttpd

Modified: trunk/src/plugins/authhttpd/include/AuthHTTPDPlugin.class.php
===================================================================
--- trunk/src/plugins/authhttpd/include/AuthHTTPDPlugin.class.php	2011-03-17 11:15:23 UTC (rev 12830)
+++ trunk/src/plugins/authhttpd/include/AuthHTTPDPlugin.class.php	2011-03-17 11:21:20 UTC (rev 12831)
@@ -71,8 +71,7 @@
 		
 		$params['html_snippets'][$this->name] = $result;
 
-		$params['transparent_redirect_urls'][$this->name] = util_make_url('/plugins/authhttpd/post-login.php?return_to
-='.htmlspecialchars(stripslashes($return_to)));
+		$params['transparent_redirect_urls'][$this->name] = util_make_url('/plugins/authhttpd/post-login.php?return_to='.htmlspecialchars(stripslashes($return_to)));
 	}
 
 	/**
@@ -83,7 +82,11 @@
 		$this->saved_user = NULL;
 		$user = NULL;
 
-		$username = $GLOBALS['REMOTE_USER'];
+		if (isset($GLOBALS['REMOTE_USER'])) {
+			$username = $GLOBALS['REMOTE_USER'];
+		} else {
+			$username = NULL;
+		}
 
 		if ($username) {
 			$user = user_get_object_by_name($username);

Modified: trunk/src/plugins/authhttpd/www/post-login.php
===================================================================
--- trunk/src/plugins/authhttpd/www/post-login.php	2011-03-17 11:15:23 UTC (rev 12830)
+++ trunk/src/plugins/authhttpd/www/post-login.php	2011-03-17 11:21:20 UTC (rev 12831)
@@ -51,7 +51,7 @@
 	header('Location: https://'.getStringFromServer('HTTP_HOST').getStringFromServer('REQUEST_URI'));
 }
 
-if ($plugin->isSufficient()) {
+if ($plugin->isSufficient() && isset($GLOBALS['REMOTE_USER'])) {
 	$plugin->startSession($GLOBALS['REMOTE_USER']);
 }
 if ($return_to) {




More information about the Fusionforge-commits mailing list