[Fusionforge-commits] r9818 - in trunk/gforge: common/include www/account www/docman www/include

Roland Mas lolando at libremir.placard.fr.eu.org
Fri May 21 09:51:37 CEST 2010


Author: lolando
Date: 2010-05-21 09:51:36 +0200 (Fri, 21 May 2010)
New Revision: 9818

Modified:
   trunk/gforge/common/include/session.php
   trunk/gforge/www/account/change_email.php
   trunk/gforge/www/account/change_pw.php
   trunk/gforge/www/account/editsshkeys.php
   trunk/gforge/www/account/index.php
   trunk/gforge/www/docman/view.php
   trunk/gforge/www/include/html.php
Log:
Removed last invocations of session_require()

Modified: trunk/gforge/common/include/session.php
===================================================================
--- trunk/gforge/common/include/session.php	2010-05-21 07:51:20 UTC (rev 9817)
+++ trunk/gforge/common/include/session.php	2010-05-21 07:51:36 UTC (rev 9818)
@@ -401,7 +401,7 @@
 }
 
 /**
- *	session_require_perm() - Convenience function to easily enforce permissions
+ *	session_require_global_perm() - Convenience function to easily enforce permissions
  *
  *	Calling page will terminate with error message if current user
  *	fails checks.
@@ -414,6 +414,19 @@
 }
 
 /**
+ *	session_require_login() - Convenience function to easily enforce permissions
+ *
+ *	Calling page will terminate with error message if current user
+ *	fails checks.
+ *
+ */
+function session_require_login () {
+	if (!session_loggedin()) {
+		exit_not_logged_in () ;
+	}
+}
+
+/**
  *	session_set_new() - Setup session for the given user
  *
  *	This function sets up SourceForge session for the given user,

Modified: trunk/gforge/www/account/change_email.php
===================================================================
--- trunk/gforge/www/account/change_email.php	2010-05-21 07:51:20 UTC (rev 9817)
+++ trunk/gforge/www/account/change_email.php	2010-05-21 07:51:36 UTC (rev 9818)
@@ -24,9 +24,8 @@
 require_once('../env.inc.php');
 require_once $gfwww.'include/pre.php';
 
-session_require(array('isloggedin'=>1));
+session_require_login () ;
 
-
 if (getStringFromRequest('submit')) {
 	if (!form_key_is_valid(getStringFromRequest('form_key'))) {
 		exit_form_double_submit();

Modified: trunk/gforge/www/account/change_pw.php
===================================================================
--- trunk/gforge/www/account/change_pw.php	2010-05-21 07:51:20 UTC (rev 9817)
+++ trunk/gforge/www/account/change_pw.php	2010-05-21 07:51:36 UTC (rev 9818)
@@ -25,7 +25,7 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfcommon.'include/account.php';
 
-session_require(array('isloggedin'=>1));
+session_require_login () ;
 
 $u =& user_get_object(user_getid());
 if (!$u || !is_object($u)) {

Modified: trunk/gforge/www/account/editsshkeys.php
===================================================================
--- trunk/gforge/www/account/editsshkeys.php	2010-05-21 07:51:20 UTC (rev 9817)
+++ trunk/gforge/www/account/editsshkeys.php	2010-05-21 07:51:36 UTC (rev 9818)
@@ -50,7 +50,8 @@
 	}
 }
 
-session_require(array('isloggedin'=>1));
+session_require_login () ;
+
 $u =& user_get_object(user_getid());
 if (!$u || !is_object($u)) {
 	exit_error('Error','Could Not Get User');

Modified: trunk/gforge/www/account/index.php
===================================================================
--- trunk/gforge/www/account/index.php	2010-05-21 07:51:20 UTC (rev 9817)
+++ trunk/gforge/www/account/index.php	2010-05-21 07:51:36 UTC (rev 9818)
@@ -27,7 +27,7 @@
 
 $feedback = '';
 
-session_require(array('isloggedin'=>'1'));
+session_require_login () ;
 
 // get global users vars
 $u =& user_get_object(user_getid());

Modified: trunk/gforge/www/docman/view.php
===================================================================
--- trunk/gforge/www/docman/view.php	2010-05-21 07:51:20 UTC (rev 9817)
+++ trunk/gforge/www/docman/view.php	2010-05-21 07:51:36 UTC (rev 9818)
@@ -36,9 +36,7 @@
 	} elseif ($g->isError()) {
 		exit_error('Error',$g->getErrorMessage());
 	}
-	if(!$g->isPublic()) {
-		session_require(array('group' => $group_id));
-	}
+	session_require_perm ('project', $group_id));
 
 	$d = new Document($g,$docid);
 	if (!$d || !is_object($d)) {

Modified: trunk/gforge/www/include/html.php
===================================================================
--- trunk/gforge/www/include/html.php	2010-05-21 07:51:20 UTC (rev 9817)
+++ trunk/gforge/www/include/html.php	2010-05-21 07:51:36 UTC (rev 9818)
@@ -657,14 +657,12 @@
 
 	//group is private
 	if (!$project->isPublic()) {
-		//if it's a private group, you must be a member of that group
-		session_require(array('group'=>$group_id));
+		session_require_perm ('project', $group_id) ;
 	}
 
 	//for dead projects must be member of admin project
 	if (!$project->isActive()) {
-		//only SF group can view non-active, non-holding groups
-		session_require(array('group'=>'1'));
+		session_require_global_perm ('forge_admin') ;
 	}
 
 	if (isset($params['title'])){




More information about the Fusionforge-commits mailing list