[Fusionforge-commits] r9817 - in trunk/gforge: common/include www/reporting www/stats

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


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

Modified:
   trunk/gforge/common/include/Navigation.class.php
   trunk/gforge/common/include/RBAC.php
   trunk/gforge/www/reporting/groupadded.php
   trunk/gforge/www/reporting/groupadded_graph.php
   trunk/gforge/www/reporting/groupcum.php
   trunk/gforge/www/reporting/groupcum_graph.php
   trunk/gforge/www/reporting/index.php
   trunk/gforge/www/reporting/projectact.php
   trunk/gforge/www/reporting/projecttime.php
   trunk/gforge/www/reporting/projecttime_graph.php
   trunk/gforge/www/reporting/rebuild.php
   trunk/gforge/www/reporting/siteact.php
   trunk/gforge/www/reporting/siteact_graph.php
   trunk/gforge/www/reporting/sitetime.php
   trunk/gforge/www/reporting/sitetime_graph.php
   trunk/gforge/www/reporting/sitetimebar.php
   trunk/gforge/www/reporting/sitetimebar_graph.php
   trunk/gforge/www/reporting/timecategory.php
   trunk/gforge/www/reporting/toolspie.php
   trunk/gforge/www/reporting/toolspie_graph.php
   trunk/gforge/www/reporting/trackerpie_graph.php
   trunk/gforge/www/reporting/useract.php
   trunk/gforge/www/reporting/useract_graph.php
   trunk/gforge/www/reporting/useradded.php
   trunk/gforge/www/reporting/useradded_graph.php
   trunk/gforge/www/reporting/usercum.php
   trunk/gforge/www/reporting/usercum_graph.php
   trunk/gforge/www/reporting/usersummary.php
   trunk/gforge/www/reporting/usertime.php
   trunk/gforge/www/reporting/usertime_graph.php
   trunk/gforge/www/stats/graphs.php
   trunk/gforge/www/stats/i18n.php
   trunk/gforge/www/stats/index.php
   trunk/gforge/www/stats/projects.php
   trunk/gforge/www/stats/users_graph.php
   trunk/gforge/www/stats/views_graph.php
Log:
More usage of session_require_perm (and new global permission setting: forge_stats)

Modified: trunk/gforge/common/include/Navigation.class.php
===================================================================
--- trunk/gforge/common/include/Navigation.class.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/common/include/Navigation.class.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -281,29 +281,21 @@
 		}
                  
 		// Admin and Reporting 
-		$user_is_super=false;
-		if (session_loggedin()) {
-			$projectmaster =& group_get_object(GROUP_IS_MASTER);
-			$projectstats =& group_get_object(GROUP_IS_STATS);
-			$permmaster =& $projectmaster->getPermission ();
-			$permstats =& $projectstats->getPermission ();
-                         
-			if ($permmaster->isAdmin()) {
-				$user_is_super = true;
-				$menu['titles'][] = _('Site Admin');
-				$menu['urls'][] = util_make_url('/admin/') ;
-				if (strstr($request_uri, util_make_uri('/admin/'))) {
-					$selected=count($menu['urls'])-1;
-				}
+		if (forge_check_global_perm ('forge_admin')) {
+			$user_is_super = true;
+			$menu['titles'][] = _('Site Admin');
+			$menu['urls'][] = util_make_url('/admin/') ;
+			if (strstr($request_uri, util_make_uri('/admin/'))) {
+				$selected=count($menu['urls'])-1;
 			}
-			if ($permstats->isMember()) {
-				$menu['titles'][] = _('Reporting');
-				$menu['urls'][] = util_make_url ('/reporting/') ;
-				if (strstr($request_uri, util_make_uri('/reporting/'))) {
-					$selected=count($menu['urls'])-1;
-				}
-                        }
 		}
+		if (forge_check_global_perm ('forge_stats', 'read')) {
+			$menu['titles'][] = _('Reporting');
+			$menu['urls'][] = util_make_url ('/reporting/') ;
+			if (strstr($request_uri, util_make_uri('/reporting/'))) {
+				$selected=count($menu['urls'])-1;
+			}
+		}
  
 		// Project
 		if (isset($GLOBALS['group_id'])) { 

Modified: trunk/gforge/common/include/RBAC.php
===================================================================
--- trunk/gforge/common/include/RBAC.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/common/include/RBAC.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -104,17 +104,24 @@
 
 			// ...and map section names and values to the new values
 
+			if ($this->data_array['group_id'] == forge_get_config ('stats_group')) {
+				$this->perms_array['forge_stats'][-1] = 1 ;
+			}
+
 			$this->perms_array=array();
 			foreach ($this->setting_array as $oldsection => $t) {
 				switch ($oldsection) {
 				case 'projectadmin':
 					$newsection = 'project_admin' ;
 					if ($this->data_array['group_id'] == 1 && $t[0] == 'A') {
-						$this->perms_array['forge_admin'][-1] = true ;
+						$this->perms_array['forge_admin'][-1] = 1 ;
 					}
 					if ($this->data_array['group_id'] == forge_get_config ('news_group') && $t[0] == 'A') {
-						$this->perms_array['approve_news'][-1] = true ;
+						$this->perms_array['approve_news'][-1] = 1 ;
 					}
+					if ($this->data_array['group_id'] == forge_get_config ('stats_group') && $t[0] == 'A') {
+						$this->perms_array['forge_stats'][-1] = 2 ;
+					}
 					break ;
 				case 'trackeradmin':
 					$newsection = 'tracker_admin' ;
@@ -227,6 +234,21 @@
 			}
 		break ;
 		
+		case 'forge_stats':
+			switch ($action) {
+			case 'read':
+				$min = 1 ;
+				break ;
+			case 'admin':
+				$min = 2 ;
+				break ;
+			}
+			if (($value >= $min)
+			    || $this->hasGlobalPermission('forge_admin')) {
+				return true ;
+			}
+		break ;
+		
 		case 'project_admin':
 			if (($value == 1)
 			    || $this->hasGlobalPermission('forge_admin')) {

Modified: trunk/gforge/www/reporting/groupadded.php
===================================================================
--- trunk/gforge/www/reporting/groupadded.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/groupadded.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -47,7 +47,7 @@
 	$end = $z[count($z)-1];
 }
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 echo report_header(_('Projects Added'));
 

Modified: trunk/gforge/www/reporting/groupadded_graph.php
===================================================================
--- trunk/gforge/www/reporting/groupadded_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/groupadded_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -30,7 +30,7 @@
 require_once(forge_get_config('jpgraph_path').'/jpgraph_line.php');
 require_once $gfcommon.'reporting/ReportGroupAdded.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats','read') ;
 
 $SPAN = getIntFromRequest('SPAN');
 $start = getIntFromRequest('start');

Modified: trunk/gforge/www/reporting/groupcum.php
===================================================================
--- trunk/gforge/www/reporting/groupcum.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/groupcum.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -47,7 +47,7 @@
 	$end = $z[count($z)-1];
 }
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 echo report_header(_('Cumulative Projects'));
 

Modified: trunk/gforge/www/reporting/groupcum_graph.php
===================================================================
--- trunk/gforge/www/reporting/groupcum_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/groupcum_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -30,7 +30,7 @@
 require_once(forge_get_config('jpgraph_path').'/jpgraph_line.php');
 require_once $gfcommon.'reporting/ReportGroupCum.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $SPAN = getIntFromRequest('SPAN');
 $start = getIntFromRequest('start');

Modified: trunk/gforge/www/reporting/index.php
===================================================================
--- trunk/gforge/www/reporting/index.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/index.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -30,7 +30,7 @@
 require_once $gfcommon.'reporting/Report.class.php';
 require_once $gfcommon.'reporting/ReportSetup.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
 
@@ -64,12 +64,15 @@
 <a href="sitetimebar.php"><?php echo _('Site-Wide Total Hours Graph (graph)'); ?></a> <a href="sitetimebar.php?typ=r">(<?php echo _('report'); ?>)</a><br />
 <a href="usersummary.php"><?php echo _('Site-Wide Task &amp; Hours (report)'); ?></a><br />
 </p>
+
+<?php if (forge_check_perm ('forge_stats', 'admin')) { ?>
 <h2><?php echo _('Administrative'); ?></h2>
 <p>
 <a href="rebuild.php"><?php echo _('Initialize / Rebuild Reporting Tables'); ?></a><br />
 <a href="timecategory.php"><?php echo _('Manage Time Tracker Categories'); ?></a><br />
 </p>
 <?php
+}
 
 plugin_hook ("reporting_reference", array());
 echo report_footer();

Modified: trunk/gforge/www/reporting/projectact.php
===================================================================
--- trunk/gforge/www/reporting/projectact.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/projectact.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/Report.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/projecttime.php
===================================================================
--- trunk/gforge/www/reporting/projecttime.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/projecttime.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/ReportProjectTime.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/projecttime_graph.php
===================================================================
--- trunk/gforge/www/reporting/projecttime_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/projecttime_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -32,7 +32,7 @@
 require_once $gfcommon.'reporting/ReportProjectTime.class.php';
 require_once $gfcommon.'reporting/report_utils.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $g_id = getStringFromRequest('g_id');
 $type = getStringFromRequest('type');

Modified: trunk/gforge/www/reporting/rebuild.php
===================================================================
--- trunk/gforge/www/reporting/rebuild.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/rebuild.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -30,7 +30,7 @@
 require_once $gfcommon.'reporting/Report.class.php';
 require_once $gfcommon.'reporting/ReportSetup.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group'),'A') );
+session_require_global_perm ('forge_stats', 'admin') ;
 
 echo report_header(_('Main Page'));
 if (getStringFromRequest('submit') && getStringFromRequest('im_sure')) {

Modified: trunk/gforge/www/reporting/siteact.php
===================================================================
--- trunk/gforge/www/reporting/siteact.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/siteact.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/Report.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/siteact_graph.php
===================================================================
--- trunk/gforge/www/reporting/siteact_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/siteact_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -31,7 +31,7 @@
 require_once $gfcommon.'reporting/ReportSiteAct.class.php';
 require_once $gfwww.'include/unicode.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $area = getStringFromRequest('area');
 $SPAN = getIntFromRequest('SPAN');

Modified: trunk/gforge/www/reporting/sitetime.php
===================================================================
--- trunk/gforge/www/reporting/sitetime.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/sitetime.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/ReportSiteTime.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/sitetime_graph.php
===================================================================
--- trunk/gforge/www/reporting/sitetime_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/sitetime_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -32,7 +32,7 @@
 require_once $gfcommon.'reporting/ReportSiteTime.class.php';
 require_once $gfcommon.'reporting/report_utils.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $start = getIntFromRequest('start');
 $end = getIntFromRequest('end');

Modified: trunk/gforge/www/reporting/sitetimebar.php
===================================================================
--- trunk/gforge/www/reporting/sitetimebar.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/sitetimebar.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/Report.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/sitetimebar_graph.php
===================================================================
--- trunk/gforge/www/reporting/sitetimebar_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/sitetimebar_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -30,7 +30,7 @@
 require_once(forge_get_config('jpgraph_path').'/jpgraph_bar.php');
 require_once $gfcommon.'reporting/Report.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 //
 //	Create Report

Modified: trunk/gforge/www/reporting/timecategory.php
===================================================================
--- trunk/gforge/www/reporting/timecategory.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/timecategory.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/ReportSetup.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group'),'A') );
+session_require_global_perm ('forge_stats', 'admin') ;
 
 $time_code = getIntFromRequest('time_code');
 $category_name = trim(getStringFromRequest('category_name'));

Modified: trunk/gforge/www/reporting/toolspie.php
===================================================================
--- trunk/gforge/www/reporting/toolspie.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/toolspie.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -43,7 +43,7 @@
 	$start = $z[count($z)-1];
 }
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 echo report_header(_('Tool Pie Graphs'));
 

Modified: trunk/gforge/www/reporting/toolspie_graph.php
===================================================================
--- trunk/gforge/www/reporting/toolspie_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/toolspie_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -32,7 +32,7 @@
 require_once $gfcommon.'reporting/Report.class.php';
 require_once $gfcommon.'reporting/report_utils.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 //
 //	Create Report

Modified: trunk/gforge/www/reporting/trackerpie_graph.php
===================================================================
--- trunk/gforge/www/reporting/trackerpie_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/trackerpie_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -33,7 +33,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 //
 //	Create Report

Modified: trunk/gforge/www/reporting/useract.php
===================================================================
--- trunk/gforge/www/reporting/useract.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/useract.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/Report.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/useract_graph.php
===================================================================
--- trunk/gforge/www/reporting/useract_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/useract_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -31,7 +31,7 @@
 require_once $gfcommon.'reporting/ReportUserAct.class.php';
 require_once $gfwww.'include/unicode.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $dev_id = getStringFromRequest('dev_id');
 $SPAN = getIntFromRequest('SPAN');

Modified: trunk/gforge/www/reporting/useradded.php
===================================================================
--- trunk/gforge/www/reporting/useradded.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/useradded.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -47,7 +47,7 @@
 	$end = $z[count($z)-1];
 }
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 echo report_header(_('Users Added'));
 

Modified: trunk/gforge/www/reporting/useradded_graph.php
===================================================================
--- trunk/gforge/www/reporting/useradded_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/useradded_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -30,7 +30,7 @@
 require_once(forge_get_config('jpgraph_path').'/jpgraph_line.php');
 require_once $gfcommon.'reporting/ReportUserAdded.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $SPAN = getIntFromRequest('SPAN');
 $start = getIntFromRequest('start');

Modified: trunk/gforge/www/reporting/usercum.php
===================================================================
--- trunk/gforge/www/reporting/usercum.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/usercum.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -47,7 +47,7 @@
 	$end = $z[count($z)-1];
 }
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 echo report_header(_('Cumulative Users'));
 

Modified: trunk/gforge/www/reporting/usercum_graph.php
===================================================================
--- trunk/gforge/www/reporting/usercum_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/usercum_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -30,7 +30,7 @@
 require_once(forge_get_config('jpgraph_path').'/jpgraph_line.php');
 require_once $gfcommon.'reporting/ReportUserCum.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $SPAN = getIntFromRequest('SPAN');
 $start = getIntFromRequest('start');

Modified: trunk/gforge/www/reporting/usersummary.php
===================================================================
--- trunk/gforge/www/reporting/usersummary.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/usersummary.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/Report.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/usertime.php
===================================================================
--- trunk/gforge/www/reporting/usertime.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/usertime.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -29,7 +29,7 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/ReportUserTime.class.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $report=new Report();
 if ($report->isError()) {

Modified: trunk/gforge/www/reporting/usertime_graph.php
===================================================================
--- trunk/gforge/www/reporting/usertime_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/reporting/usertime_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -32,7 +32,7 @@
 require_once $gfcommon.'reporting/ReportUserTime.class.php';
 require_once $gfcommon.'reporting/report_utils.php';
 
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $dev_id = getStringFromRequest('dev_id');
 $type = getStringFromRequest('type');

Modified: trunk/gforge/www/stats/graphs.php
===================================================================
--- trunk/gforge/www/stats/graphs.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/stats/graphs.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -12,8 +12,7 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'stats/site_stats_utils.php';
 
-// require you to be a member of the sfstats group (group_id = 11084)
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $HTML->header(array('title'=>sprintf(_('%1$s Site Statistics'), forge_get_config ('forge_name'))));
 

Modified: trunk/gforge/www/stats/i18n.php
===================================================================
--- trunk/gforge/www/stats/i18n.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/stats/i18n.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -12,8 +12,7 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'stats/site_stats_utils.php';
 
-// require you to be a member of the sfstats group
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $HTML->header(array('title' => sprintf(_('%1$s I18n Statistics'), forge_get_config ('forge_name'))));
 echo "<h1>".sprintf(_('Languages Distributions'), forge_get_config ('forge_name'))." </h1>";

Modified: trunk/gforge/www/stats/index.php
===================================================================
--- trunk/gforge/www/stats/index.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/stats/index.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -14,8 +14,7 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'stats/site_stats_utils.php';
 
-// require you to be a member of the sfstats group
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $HTML->header(array('title'=>sprintf(_('%1$s Site Statistics'), forge_get_config ('forge_name'))));
 

Modified: trunk/gforge/www/stats/projects.php
===================================================================
--- trunk/gforge/www/stats/projects.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/stats/projects.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -20,8 +20,7 @@
 $projects=getIntFromRequest('projects'); 
 $trovecatid=getIntFromRequest('trovecatid');
 
-// require you to be a member of the sfstats group (group_id = 11084)
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $HTML->header(array('title'=>sprintf(_('%1$s Site Statistics'), forge_get_config ('forge_name'))));
 

Modified: trunk/gforge/www/stats/users_graph.php
===================================================================
--- trunk/gforge/www/stats/users_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/stats/users_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -14,8 +14,7 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'include/graph_lib.php';
 
-   // require you to be a member of the sfstats group (group_id = 11084)
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $group_id = getIntFromRequest('group_id');
 $year = getIntFromRequest('year');

Modified: trunk/gforge/www/stats/views_graph.php
===================================================================
--- trunk/gforge/www/stats/views_graph.php	2010-05-21 07:51:03 UTC (rev 9816)
+++ trunk/gforge/www/stats/views_graph.php	2010-05-21 07:51:20 UTC (rev 9817)
@@ -14,8 +14,7 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'include/graph_lib.php';
 
-   // require you to be a member of the sfstats group (group_id = 11084)
-session_require( array('group'=>forge_get_config('stats_group')) );
+session_require_global_perm ('forge_stats', 'read') ;
 
 $group_id = getIntFromRequest('group_id');
 $year = getIntFromRequest('year');




More information about the Fusionforge-commits mailing list