[Fusionforge-commits] r10544 - in trunk/src: common/docman common/docman/include common/docman/views common/include common/reporting plugins/blocks/www plugins/contribtracker/www plugins/extratabs/www plugins/mantisbt/www plugins/quota_management/www plugins/scmcvs/www plugins/wiki/www www www/docman www/frs/admin www/include

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Sun Sep 19 11:53:04 CEST 2010


Author: nerville
Date: 2010-09-19 11:53:04 +0200 (Sun, 19 Sep 2010)
New Revision: 10544

Added:
   trunk/src/common/include/exit.php
Removed:
   trunk/src/www/include/exit.php
Modified:
   trunk/src/common/docman/DocumentFactory.class.php
   trunk/src/common/docman/include/utils.php
   trunk/src/common/docman/views/admin.php
   trunk/src/common/include/PluginManager.class.php
   trunk/src/common/include/pre.php
   trunk/src/common/include/session.php
   trunk/src/common/include/squal_exit.php
   trunk/src/common/reporting/ReportTrackerAct.class.php
   trunk/src/common/reporting/TimeEntry.class.php
   trunk/src/plugins/blocks/www/index.php
   trunk/src/plugins/contribtracker/www/actor_logo.php
   trunk/src/plugins/contribtracker/www/global_admin.php
   trunk/src/plugins/contribtracker/www/index.php
   trunk/src/plugins/extratabs/www/index.php
   trunk/src/plugins/mantisbt/www/getAttachment.php
   trunk/src/plugins/mantisbt/www/index.php
   trunk/src/plugins/quota_management/www/index.php
   trunk/src/plugins/quota_management/www/quota_project.php
   trunk/src/plugins/scmcvs/www/acl.php
   trunk/src/plugins/wiki/www/g
   trunk/src/plugins/wiki/www/wikiadmin.php
   trunk/src/www/docman/index.php
   trunk/src/www/docman/view.php
   trunk/src/www/frs/admin/editrelease.php
   trunk/src/www/include/project_home.php
   trunk/src/www/projects
Log:
start exit functions migration

Modified: trunk/src/common/docman/DocumentFactory.class.php
===================================================================
--- trunk/src/common/docman/DocumentFactory.class.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/docman/DocumentFactory.class.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -178,7 +178,7 @@
 		$result = db_query_params ('SELECT * FROM docdata_vw ORDER BY title',
 					   array());
 		if (!$result) {
-			exit_error('Error', db_error(),'docman');
+			exit_error(db_error(),'docman');
 		}
 		
 		while ($arr = db_fetch_array($result)) {
@@ -201,7 +201,7 @@
 			ORDER BY doc_states.name ASC',
 					   array());
 		if (!$result) {
-			exit_error('error', db_error(),'docman');
+			exit_error(db_error(),'docman');
 		}
 		
 		$return = array();

Modified: trunk/src/common/docman/include/utils.php
===================================================================
--- trunk/src/common/docman/include/utils.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/docman/include/utils.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -170,11 +170,11 @@
 	global $g,$dirid,$group_id;
 	$dgh = new DocumentGroupHTML($g);
         if ($dgh->isError())
-                exit_error('Error',$dgh->getErrorMessage());
+                exit_error($dgh->getErrorMessage(),'docman');
 
 	$dgf = new DocumentGroupFactory($g);
         if ($dgf->isError())
-                exit_error('Error',$dgf->getErrorMessage());
+                exit_error($dgf->getErrorMessage(),'docman');
 
 ?>
 <div class="docmanDivIncluded">

Modified: trunk/src/common/docman/views/admin.php
===================================================================
--- trunk/src/common/docman/views/admin.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/docman/views/admin.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -67,8 +67,13 @@
 	include ('docman/views/listtrashfile.php');
 	echo '</div>';
 
-	echo '<a href="#" onclick="javascript:displayAdminDiv(\'adminsearchengine\')" ><h4>'. _('Admin Engine Options') .'</h4></a>';
-	echo '<div id="adminsearchengine" style="display:none;" >';
+	echo '<a href="#" onclick="javascript:displayAdminDiv(\'adminoptions\')" ><h4>'. _('Admin Options') .'</h4></a>';
+	echo '<div id="adminoptions" style="display:none;" >';
+	echo '<form id="backup" name="backup" method="post" action="'. util_make_url ('/docman/view.php/'.$group_id.'/backup') .'" >';
+	echo '<ul>';
+	echo '<li>'. _('Extract documents and directories as an archive') .' <input id="submitbackup" type="button" value="Yes" onclick="javascript:doIt(\'backup\')"></li>';
+	echo '</ul>';
+	echo '</form>';
 	echo '<form id="searchengine" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updateenginesearch" >';
 	echo '<ul>';
 

Modified: trunk/src/common/include/PluginManager.class.php
===================================================================
--- trunk/src/common/include/PluginManager.class.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/include/PluginManager.class.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -203,7 +203,7 @@
 	 */
 	function RegisterPlugin (&$pluginobject) {
 		if (!$pluginobject->GetName ()) {
-			exit_error ("Some plugin did not provide a name.  I'd gladly tell you which one, but obviously I can't.  Sorry.") ;
+			exit_error (_("Some plugin did not provide a name. I'd gladly tell you which one, but obviously I can't. Sorry."),'') ;
 		}
 		$p_name = $pluginobject->GetName () ;
 		$this->plugins_objects [$p_name] =& $pluginobject ;

Copied: trunk/src/common/include/exit.php (from rev 10541, trunk/src/www/include/exit.php)
===================================================================
--- trunk/src/common/include/exit.php	                        (rev 0)
+++ trunk/src/common/include/exit.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -0,0 +1,118 @@
+<?php
+/**
+ * FusionForge : Exit functions
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010, Franck Villaume
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * exit_error() - Exit PHP with error
+ *
+ * @param	string	Error text
+ * @param	string  toptab for navigation bar
+ */
+function exit_error($text="", $toptab='') {
+	global $HTML,$group_id;
+	$HTML->header(array('title'=>_('Exiting with error'), 'group'=>$group_id, 'toptab'=>$toptab));
+	echo '<h1>' . _('Exiting with error') . '</h1>';
+	echo $HTML->error_msg(htmlspecialchars($text));
+	$HTML->footer(array());
+	exit;
+}
+
+/**
+ * exit_permission_denied() - Exit with permission denied error
+ *
+ * @param	string	$reason_descr
+ * @param   string  toptab needed for navigation
+ */
+function exit_permission_denied($reason_descr='',$toptab='') {
+	if(!session_loggedin()) {
+		exit_not_logged_in();
+	} else {
+		if (!$reason_descr) {
+			$reason_descr=_('This project\'s administrator will have to grant you permission to view this page.');
+		}
+		exit_error($reason_descr,$toptab);
+	}
+}
+
+/**
+ * exit_not_logged_in() - Exit with not logged in error
+ */
+function exit_not_logged_in() {
+	//instead of a simple error page, now take them to the login page
+	session_redirect ("/account/login.php?triggered=1&return_to=".urlencode(getStringFromServer('REQUEST_URI')));
+}
+
+/**
+ * exit_no_group() - Exit with no group chosen error
+ */
+function exit_no_group() {
+	exit_error(_('No project was chosen, project does not exist or you can\'t access it.'));
+}
+
+/**
+ * exit_missing_param() - Exit with missing required parameters error
+ *
+ * @param   string  URL : usually $_SERVER['HTTP_REFERER']
+ * @param   array   array of missing parameters
+ * @param   string  toptab needed for navigation
+ */
+function exit_missing_param($url='',$missing_params=array(),$toptab='') {
+    if (!empty($url)) {
+        if (!empty($missing_params)) {
+            $error = _('Missing required parameters : ');
+            foreach ($missing_params as $missing_param) {
+                $error .= $missing_param.' ';
+            }
+        } else {
+            $error = sprintf(_('Missing required parameters.'));
+        }
+        session_redirect($url.'&error_msg='.urlencode($error));
+    } else {
+	    exit_error(_('Missing required parameters.'),$toptab);
+    }
+}
+
+/**
+ * exit_disabled() - Exit with disabled feature error.
+ *
+ * @param   string  toptab needed for navigation
+ */
+function exit_disabled($toptab='') {
+	exit_error(_('The Site Administrator has turned off this feature.'),$toptab);
+}
+
+/**
+ * exit_form_double_submit() - Exit with double submit error.
+ *
+ * @param   string  toptab needed for navigation
+ */
+function exit_form_double_submit($toptab='') {
+	exit_error(_('You Attempted To Double-submit this item. Please avoid double-clicking.'),$toptab);
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Modified: trunk/src/common/include/pre.php
===================================================================
--- trunk/src/common/include/pre.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/include/pre.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -196,7 +196,7 @@
 
 if (isset($_SERVER['SERVER_SOFTWARE'])) { // We're on the web
 	// exit_error() and variants (for the web)
-	require_once $gfwww.'include/exit.php';
+	require_once $gfcommon.'include/exit.php';
 
 	// Library to determine browser settings
 	require_once $gfwww.'include/browser.php';

Modified: trunk/src/common/include/session.php
===================================================================
--- trunk/src/common/include/session.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/include/session.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -365,7 +365,7 @@
 	$user =& user_get_object(user_getid());
 	if (! $user->isActive()) {
 		session_logout();
-		exit_error('Error','Your account is no longer active ; you have been disconnected');
+		exit_error(_('Your account is no longer active ; you have been disconnected'),'');
 	}
 
 	if (array_key_exists('group', $req)) {
@@ -373,7 +373,7 @@
 		if (!$group || !is_object($group)) {
 			exit_no_group();
 		} elseif ($group->isError()) {
-			exit_error('Error',$reason == '' ? $group->getErrorMessage() : $reason);
+			exit_error($reason == '' ? $group->getErrorMessage() : $reason, '');
 		}
 
 		$perm =& $group->getPermission ();
@@ -469,10 +469,10 @@
 	$res = session_getdata($user_id);
 
 	if (!$res) {
-		exit_error(_('ERROR'),_('ERROR').": ".db_error());
+		exit_error(db_error(),'');
 	}
 	else if (db_numrows($res) < 1) {
-		exit_error(_('ERROR'),_('ERROR').": could not fetch user session data");
+		exit_error(_('Could not fetch user session data'),'');
 	} else {
 
 		//set up the new user object
@@ -498,12 +498,10 @@
 	$res = db_query_params ('SELECT user_id FROM user_group WHERE admin_flags=$1 AND group_id=1',
 				array ('A'));
 	if (!$res) {
-		echo db_error();
-		exit (1);
+		exit_error(db_error(),'');
 	}
 	if (db_numrows($res) == 0) {
-		echo "No admin users?\n" ;
-		exit (1);
+		exit_error(_('No admin users ?'),'');
 	}
 	$id = db_result ($res, 0, 0);
 	session_set_new ($id);

Modified: trunk/src/common/include/squal_exit.php
===================================================================
--- trunk/src/common/include/squal_exit.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/include/squal_exit.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,57 +1,78 @@
 <?php
 /**
- * squal_exit.php
+ * FusionForge : Exit functions for cronjob
  *
- * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
+ * Copyright 2010, Franck Villaume
+ * http://fusionforge.org
  *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * exit_error() - Exit with error
  *
- * @param		string	Error title
  * @param		string	Error text
+ * @param		string	Error toptab
  */
-function exit_error($title,$text) {
+function exit_error($title,$toptab='') {
 	print 'ERROR - '.$text;
 	exit;
 }
 
 /**
  * exit_permission_denied() - Return a 'Permission Denied' error
+ * @param   string  $reason_descr
+ * @param   string  toptab needed for navigation
  */
-function exit_permission_denied() {
-	exit_error('','PERMISSION DENIED');
+function exit_permission_denied($reason_descr='',$toptab='') {
+	exit_error('PERMISSION DENIED');
 }
 
 /**
  * exit_not_logged_in() - Return a 'Not Logged in' error
  */
 function exit_not_logged_in() {
-	exit_error('','NOT LOGGED IN');
+	exit_error('NOT LOGGED IN');
 }
 
 /**
  * exit_no_group() - Return a 'Choose A Project/Group' error
  */
 function exit_no_group() {
-	exit_error('','CHOOSE A PROJECT/GROUP');
+	exit_error('CHOOSE A PROJECT/GROUP');
 }
 
 /**
  * exit_missing_param() - Return a 'Missing Required Parameters' error
+ * @param   string  URL : usually $_SERVER['HTTP_REFERER']
+ * @param   array   array of missing parameters
+ * @param   string  toptab needed for navigation
  */
-function exit_missing_param() {
-	exit_error('','MISSING REQUIRED PARAMETERS');
+function exit_missing_param(($url='',$missing_params=array(),$toptab='') {
+	exit_error('MISSING REQUIRED PARAMETERS');
 }
 
 /**
  * exit_disabled() - Return a 'Disabled Feature' error
+ * @param   string  toptab needed for navigation
  */
-function exit_disabled() {
-       exit_error('','DISABLED FEATURE');
+function exit_disabled($toptab='') {
+       exit_error('DISABLED FEATURE');
 }
 
 ?>

Modified: trunk/src/common/reporting/ReportTrackerAct.class.php
===================================================================
--- trunk/src/common/reporting/ReportTrackerAct.class.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/reporting/ReportTrackerAct.class.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -39,9 +39,9 @@
 	$at = new ArtifactType($group, $atid);
 	if ($at->isError()) {
 		if ($at->isPermissionDeniedError()) {
-			exit_permission_denied();
+			exit_permission_denied('','tracker');
 		} else {
-			exit_error('Error',$at->getErrorMessage());
+			exit_error($at->getErrorMessage(),'tracker');
 		}
 	}
 
@@ -114,7 +114,7 @@
 				array ($atid,
 				       $start,
 				       $end));
-	echo db_error();
+	exit_error(db_error(),'tracker');
 	return db_result($res,0,0);
 }
 
@@ -127,7 +127,7 @@
 				array ($atid,
 				       $start,
 				       $end));
-	echo db_error();
+	exit_error(db_error(),'tracker');
 	return db_result($res,0,0);
 }
 
@@ -141,7 +141,7 @@
 				array ($atid,
 				       $end, // Yes, really.
 				       $end)) ;
-	echo db_error();
+	exit_error(db_error(),'tracker');
 	return db_result($res,0,0);
 }
 

Modified: trunk/src/common/reporting/TimeEntry.class.php
===================================================================
--- trunk/src/common/reporting/TimeEntry.class.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/common/reporting/TimeEntry.class.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -89,7 +89,7 @@
 				       $timeCode,
 				       $hours)) ;
         if (!$res) {
-            exit_error('Error',db_error());
+            exit_error(db_error(),'tracker');
         } else {
             $feedback.=_('Successfully Added');
         }

Modified: trunk/src/plugins/blocks/www/index.php
===================================================================
--- trunk/src/plugins/blocks/www/index.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/blocks/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -146,10 +146,15 @@
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
-	exit_error("Invalid User", "Cannot Process your request for this user.");
+if (!$user || !is_object($user) ) {|| $user->isError() || !$user->isActive()) {
+	exit_error(_('Invalid User'),'home');
+} else if ( $user->isError() ) {
+	exit_error($user->getErrorMessage(),'home');
+} else if ( !$user->isActive()) {
+	exit_error(_('Invalid User : Not active'), 'home');
 }
 
+
 $type = getStringFromRequest('type');
 $id = getStringFromRequest('id');
 $pluginname = getStringFromRequest('pluginname');
@@ -171,17 +176,17 @@
 );
 
 if (!$type) {
-	exit_error("Cannot Process your request","No TYPE specified"); // you can create items in Base.tab and customize this messages
+	exit_error(_('Cannot Process your request : No TYPE specified'),'home'); // you can create items in Base.tab and customize this messages
 } elseif (!$id) {
-	exit_error("Cannot Process your request","No ID specified");
+	exit_error(_('Cannot Process your request : No ID specified'),'home');
 } else {
 	if ($type == 'group') {
 		$group = group_get_object($id);
 		if ( !$group) {
-			exit_error("Invalid Project", "Inexistent Project");
+			exit_no_group();
 		}
 		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
-			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home');
 		}
 
 		session_require_perm ('project_admin', $id) ;
@@ -193,29 +198,29 @@
 	} elseif ($type == 'admin') {
 		$group = group_get_object($id);
 		if ( !$group) {
-			exit_error("Invalid Project", "Inexistent Project");
+			exit_no_group();
 		}
 		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
-			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interfacer'),$pluginname),'home');			
 		}
 		session_require_perm ('project_admin', $id) ;
 
 		blocks_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
 		// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
-		
+
 		$res = db_query_params('SELECT name, status FROM plugin_blocks WHERE group_id=$1',
 				       array($id));
 		while ($row = db_fetch_array($res)) {
 			$status[ $row['name'] ] = $row['status'];
 		}
-		
+
 		print _("Blocks are customizable HTML boxes in the left or right side of the pages the web site. They are created manually.");
-		
+
 		print "<form action=\"/plugins/blocks/\" method=\"post\">";
 		print "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
 		print "<input type=\"hidden\" name=\"pluginname\" value=\"$pluginname\" />\n";
 		print "<input type=\"hidden\" name=\"type\" value=\"admin_post\" />\n";
-		
+
 		print "<table class=\"listing\" align=\"center\">";
 		print "<thead><tr><th>".
 			_("Name").
@@ -232,16 +237,16 @@
 			"</tr></thead>";
 		$blocks = getAvailableBlocks($group);
 		foreach ($blocks as $b => $help) {
-			
+
 			$class = (! isset($class) || $class == 'bgcolor-white') ? "bgcolor-grey" : "bgcolor-white";
-			
+
 			$match = '';
 			if (preg_match('/(.*) index$/', $b, $match)) {
 				print '<tr><td colspan="4"><b>'.$blocks_text[$match[1]].'</b></td></tr>';
 			}
-			
+
 			$checked = (isset($status[$b]) && $status[$b] == 1) ? ' checked="checked"' : '';
-			
+
 			print "<tr class=\"$class\"><td>$b</td>\n" .
 				"<td align=\"center\">" .
 				"<input type=\"checkbox\" name=\"activate[$b]\" value=\"1\"$checked /></td>\n" .
@@ -256,10 +261,10 @@
 	} elseif ($type == 'admin_post') {
 		$group = group_get_object($id);
 		if ( !$group) {
-			exit_error("Invalid Project", "Inexistent Project");
+			exit_no_group();
 		}
 		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
-			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home');			
 		}
 		session_require_perm ('project_admin', $id) ;
 
@@ -304,10 +309,10 @@
 	} elseif ($type == 'configure') {
 		$group = group_get_object($id);
 		if ( !$group) {
-			exit_error("Invalid Project", "Inexistent Project");
+			exit_no_group();
 		}
 		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
-			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginnname),'home');
 		}
 		session_require_perm ('project_admin', $id) ;
 
@@ -364,10 +369,10 @@
 	} elseif ($type == 'configure_post') {
 		$group = group_get_object($id);
 		if ( !$group) {
-			exit_error("Invalid Project", "Inexistent Project");
+			exit_no_group();
 		}
 		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
-			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home');			
 		}
 		session_require_perm ('project_admin', $id) ;
 
@@ -386,7 +391,7 @@
 		session_redirect('/plugins/blocks/index.php?id='.$id.'&type=admin&pluginname=blocks&feedback='.urlencode($msg));
 	}
 }
-	
+
 site_project_footer(array());
 
 ?>

Modified: trunk/src/plugins/contribtracker/www/actor_logo.php
===================================================================
--- trunk/src/plugins/contribtracker/www/actor_logo.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/contribtracker/www/actor_logo.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,10 +1,27 @@
 <?php
 
-/*
+/**
  * ContribTracker plugin
  *
  * Copyright 2009, Roland Mas
+ * Copyright 2010 (c) Franck Villaume
+ * http://fusionforge.org/
  *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('../../env.inc.php');
@@ -16,14 +33,12 @@
 if ($actor_id) {
 	$actor = new ContribTrackerActor ($actor_id) ;
 	if (!is_object ($actor) || $actor->isError()) {
-		exit_error (_('Invalid actor'),
-			    _('Invalid actor specified.')) ;
+		exit_error (_('Invalid actor'),'contribtracker');
 	}
 	Header ("Content-type: image/png");
 	echo $actor->getLogo();
 } else {
-		exit_error (_('Invalid actor'),
-			    _('Invalid actor specified.')) ;
+		exit_error (_('Invalid actor'),'contribtracker');
 }	
 
 // Local Variables:

Modified: trunk/src/plugins/contribtracker/www/global_admin.php
===================================================================
--- trunk/src/plugins/contribtracker/www/global_admin.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/contribtracker/www/global_admin.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,10 +1,27 @@
 <?php
 
-/*
+/**
  * ContribTracker plugin
  *
  * Copyright 2009, Roland Mas
+ * Copyright 2010 (c) Franck Villaume
+ * http://fusionforge.org/
  *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('../../env.inc.php');
@@ -39,19 +56,19 @@
 function check_role_id ($r_id) {
 	$role = new ContribTrackerRole ($r_id) ;
 	if (!$role || !is_object ($role)) {
-		exit_permission_denied () ;
+		exit_permission_denied ('','home') ;
 	}
 }
 function check_actor_id ($a_id) {
 	$actor = new ContribTrackerActor ($a_id) ;
 	if (!$actor || !is_object ($actor)) {
-		exit_permission_denied () ;
+		exit_permission_denied ('','home') ;
 	}
 }
 function check_structure_id ($s_id) {
 	$structure = new ContribTrackerLegalStructure ($s_id) ;
 	if (!$structure || !is_object ($structure)) {
-		exit_permission_denied () ;
+		exit_permission_denied ('','home') ;
 	}
 }
 function check_logo ($arr, $a_id=false) {
@@ -155,7 +172,7 @@
 case 'post_add_role':
 	$role = new ContribTrackerRole () ;
 	if (!$role->create ($name, $desc)) {
-		exit_error ($role->getErrorMessage()) ;
+		exit_error ($role->getErrorMessage(),'contribtracker') ;
 	}
 	$role_id = $role->getId() ;
 	$action = 'display' ;
@@ -174,7 +191,7 @@
 case 'post_add_structure':
 	$structure = new ContribTrackerLegalStructure () ;
 	if (!$structure->create ($name, $desc)) {
-		exit_error ($structure->getErrorMessage()) ;
+		exit_error ($structure->getErrorMessage(),'contribtracker') ;
 	}
 	$structure_id = $structure->getId() ;
 	$action = 'display' ;
@@ -194,7 +211,7 @@
 	$actor = new ContribTrackerActor () ;
 	$structure = new ContribTrackerLegalStructure ($structure_id) ;
 	if (!$actor->create ($name, $url, $email, $desc, $logo, $structure)) {
-		exit_error ($actor->getErrorMessage()) ;
+		exit_error ($actor->getErrorMessage(),'contribtracker') ;
 	}
 	$actor_id = $actor->getId() ;
 	$action = 'display' ;
@@ -259,7 +276,7 @@
 					 </td>
 					 <?php
 					 print '</tr>';
-		}	
+		}
 		print '</tbody></table>' ;
 	} else {
 		print _('No legal structures currently defined.') ;

Modified: trunk/src/plugins/contribtracker/www/index.php
===================================================================
--- trunk/src/plugins/contribtracker/www/index.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/contribtracker/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,10 +1,27 @@
 <?php
 
-/*
+/**
  * ContribTracker plugin
  *
  * Copyright 2009, Roland Mas
+ * Copyright 2010 (c) Franck Villaume
+ * http://fusionforge.org/
  *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('../../env.inc.php');
@@ -73,7 +90,7 @@
 		$contrib = new ContribTrackerContribution ($contrib_id) ;
 		if (!$contrib || !is_object ($contrib)
 		    || $contrib->getGroup()->getId() != $group_id) {
-			exit_permission_denied () ;
+			exit_permission_denied ('','home') ;
 		}
 
 		$params = array () ;
@@ -115,8 +132,7 @@
 } elseif ($actor_id) {
 	$actor = new ContribTrackerActor ($actor_id) ;
 	if (!is_object ($actor) || $actor->isError()) {
-		exit_error (_('Invalid actor'),
-			    _('Invalid actor specified.')) ;
+		exit_error (_('Invalid actor'),'contribtracker');
 	}
 
 	$HTML->header(array('title'=>_('Actor details'),'pagename'=>'contribtracker'));

Modified: trunk/src/plugins/extratabs/www/index.php
===================================================================
--- trunk/src/plugins/extratabs/www/index.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/extratabs/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,10 +1,28 @@
 <?php
-/*
+
+/**
  * Extra tabs plugin
- *
  * Copyright 2005, Raphaël Hertzog
  * Copyright 2006-2009, Roland Mas
  * Copyright 2009-2010, Alain Peyrat
+ * Copyright 2010, Franck Villaume
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once ('../../../www/env.inc.php');
@@ -22,9 +40,9 @@
 // get current information
 $group =& group_get_object($group_id);
 if (!$group || !is_object($group)) {
-        exit_error('Error','Could Not Get Group');
+	exit_no_group();
 } elseif ($group->isError()) {
-        exit_error('Error',$group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'home')
 }
 
 db_begin();
@@ -55,7 +73,7 @@
 						       $tab_name,
 						       $tab_url)) ;
 			if (!$res || db_affected_rows($res) < 1) {
-				$feedback = sprintf (_('Cannot insert new tab entry: %s'),
+				$error_msg = sprintf (_('Cannot insert new tab entry: %s'),
 						      db_error());
 			} else {
 				$tab_name = '';

Modified: trunk/src/plugins/mantisbt/www/getAttachment.php
===================================================================
--- trunk/src/plugins/mantisbt/www/getAttachment.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/mantisbt/www/getAttachment.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -34,22 +34,30 @@
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
-        exit_error("Invalid User", "Cannot Process your request for this user.");
+if (!$user || !is_object($user)) {
+        exit_error(_('Invalid User'),'mantisbt');
+} else if ( $user->isError() ) {
+        exit_error($user->isError(),'mantisbt');
+} else if ( !$user->isActive()) {
+        exit_error(_('Invalid User not active'),'mantisbt');
 }
 
 $password = getPasswordFromLDAP($user);
 $username = $user->getUnixName();
 
 if ($idAttachment) {
-	$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-	$content = $clientSOAP->__soapCall('mc_issue_attachment_get', array("username" => $username, "password" => $password, "issue_attachment_id" => $idAttachment));
+	try {
+		$clientSOAP = new SoapClient("http://".forge_get_config('server','mantisbt')."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+		$content = $clientSOAP->__soapCall('mc_issue_attachment_get', array("username" => $username, "password" => $password, "issue_attachment_id" => $idAttachment));
+	} catch (SoapFault $soapFault) {
+		session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($soapFault->faultstring));
+	}
+
 	$data = unserialize($content);
 	header( 'Content-Type: ' . $data['file_type'] );
 	header( 'Content-Disposition: filename="'.urlencode($data['filename']).'"' );
 	echo base64_decode($data['payload']);
 } else {
-	exit_error("No idAttachment", "Cannot process your request");
+	exit_missing_params($_SERVER['HTTP_REFERER'],array(_('No idAttachment')),'mantisbt');
 }
-
 ?>

Modified: trunk/src/plugins/mantisbt/www/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/index.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/mantisbt/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -3,9 +3,9 @@
  * MantisBT plugin
  *
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
- * Author: Fabien Dubois - Capgemini
- * Author: Antoine Mercadal - Capgemini
+ * Authors: Franck Villaume - Capgemini
+ *          Fabien Dubois - Capgemini
+ *          Antoine Mercadal - Capgemini
  *
  * This file is part of FusionForge.
  *
@@ -50,23 +50,18 @@
 	site_user_header($params);
 }
 
-/*
- * Ce page est proteger par SSO lemonLDAP
- */
-
 if (!session_loggedin()) {
-	if(isset($_SERVER['HTTP_AUTH_USER']) && $_SERVER['HTTP_AUTH_USER'] != ''){
-		$userId = $_SERVER['HTTP_AUTH_USER'];
-		$authorized = verifyEtConstructCookie($userId);
-	}else{
-		exit_permission_denied();	
-	}	
+	exit_not_logged_in();
 }
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
-	exit_error("Invalid User", "Cannot Process your request for this user.");
+if (!$user || !is_object($user)) { || $user->isError() || !$user->isActive()) {
+	exit_error(_('Invalid User'),'home');
+} else if ( $user->isError()) {
+	exit_error($user->isError(),'home');
+} else if ( !$user->isActive()) {
+	exit_error(_('User not active'),'home');
 }
 
 $type = getStringFromRequest('type');
@@ -82,22 +77,22 @@
 $username = $user->getUnixName();
 
 if (!$type) {
-	exit_error("Cannot Process your request","No TYPE specified"); // you can create items in Base.tab and customize this messages
+	exit_missing_params($_SERVER['HTTP_REFERER'],array('No TYPE specified'),'mantisbt');
 } elseif (!$id) {
-	exit_error("Cannot Process your request","No ID specified");
+	exit_missing_params($_SERVER['HTTP_REFERER'],array('No ID specified'),'mantisbt');
 } else {
     switch ($type) {
 	    case 'group':
 		    $group = group_get_object($id);
 		    if ( !$group) {
-			    exit_error("Invalid Project", "Inexistent Project");
+			    exit_no_group();
 		    }
 		    if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the MantisBT plugin active
-			    exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+			    exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home');
 		    }
 		    $userperm = $group->getPermission($user);//we'll check if the user belongs to the group (optional)
 		    if ( !$userperm->IsMember()) {
-			    exit_error("Access Denied", "You are not a member of this project");
+				exit_permission_denied(_('You are not a member of this project'),'home');
 		    }
 		    // other perms checks here...
 		    mantisbt_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
@@ -120,14 +115,13 @@
 		    else {
 			    $pageActuelle=1; // La page actuelle est la n°1 
 		    }
-			
+
 		    $format = "%07d";
 
-
 		    if($idProjetMantis == 0){
-		 	    echo "Projet non initialisé. Pour forcer son activation, il faut désactiver/activer mantis pour ce projet";
+		 	    exit_error(_('Projet non initialisé. Pour forcer son activation, il faut désactiver/activer mantis pour ce projet'),'home');
 		    } else if (is_int($password)){
-			    echo "Impossible de récupérer les identifiants de connexions depuis le LDAP";
+		 	    exit_error(_('Impossible de récupérer les identifiants de connexions depuis le LDAP'),'home');
 		    } else {
 			    // do the job
 			    include ('mantisbt/www/group/index.php');
@@ -136,22 +130,23 @@
         case 'user':
 		    $realuser = user_get_object($id);//
 		    if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
-			    exit_error("Error", "First activate the User's $pluginname plugin through Account Manteinance Page");
+			    exit_error(sprintf(_('First activate the User\'s %s plugin through Account Maintenance Page'),$pluginname),'my');
 		    }
 		    if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private MantisBT part of this user
-			    exit_error("Access Denied", "You cannot access other user's personal $pluginname");
+			    exit_permission_denied(sprintf(_('You cannot access other user\'s personal %s'),$pluginname),'my');
 		    }
 		    mantisbt_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));
-			
-		    $password = getPasswordFromLDAP($realuser);
+
+		    //$password = getPasswordFromLDAP($realuser);
+			$password ='';
 		    $username = $realuser->getUnixName();
-			
+
 		    // recuperer les info de URL
 		    $sort = getStringFromRequest('sort');
 		    $dir = getStringFromRequest('dir');
 		    $action = getStringFromRequest('action');
 		    $idBug = getStringFromRequest('idBug');
-			
+
 		    $idNote = getStringFromRequest('idNote');
 		    $page = getStringFromRequest('page');
 		    // Si la variable $_GET['page'] existe...
@@ -160,27 +155,27 @@
 		    } else {
 			    $pageActuelle=1; // La page actuelle est la n°1 
 		    }
-		
+
 		    $format = "%07d";
-			
+
 		    if (!is_int($password)){
 			    // do the job
 			    include ('mantisbt/www/user/index.php');
 		    } else {
-			    echo "Un problème est survenu lors de la récupération des tickets";
+		 	    exit_error(_('Impossible de récupérer les identifiants de connexions depuis le LDAP'),'home');
 		    }
             break;
         case 'admin':
 		    $group = group_get_object($id);
 		    if ( !$group) {
-			    exit_error("Invalid Project", "Inexistent Project");
+				exit_no_group();
 		    }
 		    if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the MantisBT plugin active
-			    exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+			    exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home');
 		    }
 		    $userperm = $group->getPermission($user);//we'll check if the user belongs to the group
 		    if ( !$userperm->IsMember()) {
-			    exit_error("Access Denied", "You are not a member of this project");
+			    exit_permission_denied(_('You are not a member of this project'));
 		    }
 		    //only project admin can access here
 		    if ( $userperm->isAdmin() ) {
@@ -188,7 +183,7 @@
 			    mantisbt_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));	
 			    include ('mantisbt/www/admin/index.php');
 		    } else {
-			    exit_error("Access Denied", "You are not a project Admin");
+			    exit_permission_denied(_('You are not Admin of this project'),'home');
 		    }
             break;
 	}
@@ -201,5 +196,4 @@
 // c-file-style: "bsd"
 // End:
 
-
 ?>

Modified: trunk/src/plugins/quota_management/www/index.php
===================================================================
--- trunk/src/plugins/quota_management/www/index.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/quota_management/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,109 +1,124 @@
 <?php
 
 /*
- * quota_management plugin
+ * Copyright 2010, FusionForge Team
  *
- * Daniel Perez <danielperez.arg at gmail.com>
+ * This file is part of FusionForge.
  *
- * This is an example to watch things in action. You can obviously modify things and logic as you see fit
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
 require_once $gfcommon.'include/pre.php';
 require_once $gfconfig.'plugins/quota_management/config.php';
 
-// the header that displays for the user portion of the plugin
-function quota_management_Project_Header($params) {                                                                                                                                         
-	global $DOCUMENT_ROOT,$HTML,$id;                                                                            
-	$params['toptab']='quota_management'; 
+// the header that displays for the project portion of the plugin
+function quota_management_Project_Header($params) {
+	global $DOCUMENT_ROOT,$HTML,$id;
+	$params['toptab']='quota_management';
 	$params['group']=$id;
-	/*                                                                                                                                                              
-		Show horizontal links                                                                                                                                   
-	*/                                                                                                                                                              
-	site_project_header($params);														
+	/*
+	 Show horizontal links
+	 */
+	site_project_header($params);
 }
 
-// the header that displays for the project portion of the plugin
+// the header that displays for the user portion of the plugin
 function quota_management_User_Header($params) {
-	global $DOCUMENT_ROOT,$HTML,$user_id;                                                                            
+	global $DOCUMENT_ROOT,$HTML,$user_id;
 	$params['toptab']='quota_management'; 
 	$params['user']=$user_id;
-	/*                                                                                                                                                              
-	 Show horizontal links                                                                                                                                   
-	 */                                                                                                                                                              
-	site_user_header($params);    
+	/*
+	 Show horizontal links
+	 */
+	site_user_header($params);
 }
 
+$user = session_get_user(); // get the session user
 
-	$user = session_get_user(); // get the session user
+if (!$user || !is_object($user)) { || $user->isError() || !$user->isActive()) {
+	exit_error(_('Invalid User'),'home');
+} else if ( $user->isError() ) {
+	exit_error($user->getErrorMessage,'home');
+} else if ( !$user->isActive()) {
+	exit_error(_('User not active'),'home');
+}
 
-	if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
-		exit_error("Invalid User", "Cannot Process your request for this user.");
-	}
-
-	$type = getStringFromRequest('type');
-	$id = getStringFromRequest('id');
-	$pluginname = getStringFromRequest('pluginname');
+$type = getStringFromRequest('type');
+$id = getStringFromRequest('id');
+$pluginname = getStringFromRequest('pluginname');
 	
-	if (!$type) {
-		exit_error("Cannot Process your request","No TYPE specified"); // you can create items in Base.tab and customize this messages
-	} elseif (!$id) {
-		exit_error("Cannot Process your request","No ID specified");
-	} else {
-		if ($type == 'group') {
-			$group = group_get_object($id);
-			if ( !$group) {
-				exit_error("Invalid Project", "Inexistent Project");
-			}
-			if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the quota_management plugin active
-				exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
-			}
-			$userperm = $group->getPermission ();//we'll check if the user belongs to the group (optional)
-			if ( !$userperm->IsMember()) {
-				exit_error("Access Denied", "You are not a member of this project");
-			}
-			// other perms checks here...
+if (!$type) {
+	exit_missing_params($_SERVER['HTTP_REFERER'],array(_('No TYPE specified')),'home');
+} elseif (!$id) {
+	exit_missing_params($_SERVER['HTTP_REFERER'],array(_('No ID specified')),'home');
+} else {
+	if ($type == 'group') {
+		$group = group_get_object($id);
+		if ( !$group) {
+			exit_no_group();
+		}
+		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the quota_management plugin active
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginnname),'home');
+		}
+		$userperm = $group->getPermission ();//we'll check if the user belongs to the group (optional)
+		if ( !$userperm->IsMember()) {
+			exit_permission_denied(_('You are not a member of this project'),'home');
+		}
+		// other perms checks here...
+		quota_management_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
+		// DO THE STUFF FOR THE PROJECT PART HERE
+		echo "We are in the Project quota_management plugin <br>";
+		echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+	} elseif ($type == 'user') {
+		$realuser = user_get_object($id);// 
+		if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
+			exit_error(sprintf(_('First activate the User\'s %s plugin through Account Maintenance Page'),$pluginname),'my');
+		}
+		if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private quota_management part of this user
+			exit_permission_denied(sprintf(_('You cannot access other user\'s personal %s'),$pluginname),'my');
+		}
+		quota_management_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));    
+		// DO THE STUFF FOR THE USER PART HERE
+		echo "We are in the User quota_management plugin <br>";
+		echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+	} elseif ($type == 'admin') {
+		$group = group_get_object($id);
+		if ( !$group) {
+			exit_no_group();
+		}
+		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the quota_management plugin active
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginnname),'home');
+		}
+		$userperm = $group->getPermission ();//we'll check if the user belongs to the group
+		if ( !$userperm->IsMember()) {
+			exit_permission_denied(_('You are not a member of this project'),'home');
+		}
+		//only project admin can access here
+		if ( $userperm->isAdmin() ) {
 			quota_management_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
-			// DO THE STUFF FOR THE PROJECT PART HERE
-			echo "We are in the Project quota_management plugin <br>";
+			// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
+			echo "We are in the Project quota_management plugin <font color=\"#ff0000\">ADMINISTRATION</font> <br>";
 			echo "Greetings from planet " . $world; // $world comes from the config file in /etc
-		} elseif ($type == 'user') {
-			$realuser = user_get_object($id);// 
-			if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
-				exit_error("Error", "First activate the User's $pluginname plugin through Account Manteinance Page");
-			}
-			if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private quota_management part of this user
-				exit_error("Access Denied", "You cannot access other user's personal $pluginname");
-			}
-			quota_management_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));    
-			// DO THE STUFF FOR THE USER PART HERE
-			echo "We are in the User quota_management plugin <br>";
-			echo "Greetings from planet " . $world; // $world comes from the config file in /etc
-		} elseif ($type == 'admin') {
-			$group = group_get_object($id);
-			if ( !$group) {
-				exit_error("Invalid Project", "Inexistent Project");
-			}
-			if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the quota_management plugin active
-				exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
-			}
-			$userperm = $group->getPermission ();//we'll check if the user belongs to the group
-			if ( !$userperm->IsMember()) {
-				exit_error("Access Denied", "You are not a member of this project");
-			}
-			//only project admin can access here
-			if ( $userperm->isAdmin() ) {
-				quota_management_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
-				// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
-				echo "We are in the Project quota_management plugin <font color=\"#ff0000\">ADMINISTRATION</font> <br>";
-				echo "Greetings from planet " . $world; // $world comes from the config file in /etc
-			} else {
-				exit_error("Access Denied", "You are not a project Admin");
-			}
+		} else {
+			exit_permission_denied(_('You are not Admin of this project'),'home');
 		}
-	}	 
-	
-	site_project_footer(array());
+	}
+}	 
 
+site_project_footer(array());
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"

Modified: trunk/src/plugins/quota_management/www/quota_project.php
===================================================================
--- trunk/src/plugins/quota_management/www/quota_project.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/quota_management/www/quota_project.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -3,23 +3,24 @@
  * Project Admin page to manage quotas project
  *
  * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 2002-2004 (c) GForge Team
+ * Copyright 2010 (c) FusionForge Team 
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -28,7 +29,7 @@
 require_once $gfwww.'project/admin/project_admin_utils.php';
 
 if (!forge_get_config('use_project_vhost')) {
-	exit_disabled();
+	exit_disabled('home');
 }
 
 session_require_perm ('project_admin', $group_id) ;
@@ -36,9 +37,9 @@
 $group = &group_get_object($group_id);
 
 if (!$group || !is_object($group)) {
-        exit_error('Error','Error creating group object');
+        exit_no_group();
 } else if ($group->isError()) {
-        exit_error('ERROR',$group->getErrorMessage());
+        exit_error($group->getErrorMessage(),'home');
 }
 
 

Modified: trunk/src/plugins/scmcvs/www/acl.php
===================================================================
--- trunk/src/plugins/scmcvs/www/acl.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/scmcvs/www/acl.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,23 +1,24 @@
 <?php
 /**
- * Implement CVS ACLs based on GForge roles
+ * Implement CVS ACLs based on FusionForge roles
  *
  * Copyright 2004 GForge, LLC
+ * Copyright 2010, Franck Villaume
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
  */
 
@@ -26,7 +27,7 @@
 require_once $gfcommon.'include/pre.php';
 
 if (!forge_get_config('use_scm')) {
-	exit_disabled();
+	exit_disabled('home');
 }
 
 $env_group = getStringFromPost('group');
@@ -39,16 +40,16 @@
 preg_match("/[[:alnum:]_-]{3,15}/", $env_user, $matches2);
 
 if (count($matches) == 0) {
-	exit_error('','Invalid CVS repository : '.$env_group);
+	exit_error(_('Invalid CVS repository : ').$env_group,'home');
 } else {
 	if (count($matches2) == 0) {
-		exit_error('','Invalid username : '.$env_user);
+		exit_error(_('Invalid username : ').$env_user,'home');
 	}
 
 	$userName = $matches2[count($matches2)-1];
 	$User =& user_get_object_by_name($userName);
 	if (!$User || !is_object($User)) {
-		exit_error('','User "'.$userName.'"not found');
+		exit_error(sprintf(_('User not found %s'),$userName),'home');
 	}
 	session_set_new($User->getID());
 
@@ -59,7 +60,7 @@
 	}
 
 	if (! forge_check_perm_for_user ($User, 'scm', $Group->getID(), 'write')) {
-		exit_permission_denied();
+		exit_permission_denied('','home');
 	}
 }
 

Modified: trunk/src/plugins/wiki/www/g
===================================================================
--- trunk/src/plugins/wiki/www/g	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/wiki/www/g	2010-09-19 09:53:04 UTC (rev 10544)
@@ -52,9 +52,9 @@
 require_once $gfplugins.'wiki/common/wikiconfig.class.php';
 
 if (!$group_id || !$project) {
-     exit_no_group();
+    exit_no_group();
 } else if (!($project->usesPlugin("wiki"))) {
-    exit_error("Wiki plugin not activated in project", $project->getPublicName());
+    exit_disabled('home');
 } else {
 
     $group_name = $project->getUnixName();

Modified: trunk/src/plugins/wiki/www/wikiadmin.php
===================================================================
--- trunk/src/plugins/wiki/www/wikiadmin.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/plugins/wiki/www/wikiadmin.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -60,8 +60,12 @@
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
-    exit_error("Invalid User", "Cannot Process your request for this user.");
+if (!$user || !is_object($user)) { || $user->isError() || !$user->isActive()) {
+    exit_error(_('Invalid User'),'home');
+} else if ( $user->isError()) {
+	exit_error($user->getErrorMessage(),'home');
+} else if ( !$user->isActive()) {
+	exit_error(_('User not active'),'home');
 }
 
 $type = getStringFromRequest('type');
@@ -70,21 +74,21 @@
 $config = getArrayFromRequest('config');
 
 if (!$type) {
-    exit_error("Cannot Process your request","No TYPE specified");
+    exit_missing_params($_SERVER['HTTP_REFERER'],array(_'No TYPE specified'),'home');
 } elseif (!$id) {
-    exit_error("Cannot Process your request","No ID specified");
+    exit_missing_params($_SERVER['HTTP_REFERER'],array(_'No ID specified'),'home');
 } else {
     if ($type == 'admin_post') {
         $group = group_get_object($id);
         if ( !$group) {
-            exit_error(_('Invalid Project'), _('Inexistent Project'));
+			exit_no_group();
         }
         if (!($group->usesPlugin($pluginname))) { //check if the group has the wiki plugin active
-            exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home');
         }
         $userperm = $group->getPermission($user); //we'll check if the user belongs to the group
         if ( !$userperm->IsMember()) {
-            exit_error(_('Access Denied'), _('You are not a member of this project'));
+			exit_permission_denied(_('You are not a member of this project'),'home');
         }
         //only project admin can access here
         if ( $userperm->isAdmin() ) {
@@ -105,20 +109,20 @@
             $type = 'admin';
             $feedback = _('Configuration saved.');
         } else {
-            exit_error(_('Access Denied'), _('You are not a project Admin'));
+            exit_permission_denied(_('You are not a project Admin'),'home');
         }
     }
     if ($type == 'admin') {
         $group = group_get_object($id);
         if ( !$group) {
-            exit_error(_('Invalid Project'), _('Inexistent Project'));
+			exit_no_group();
         }
         if ( ! ($group->usesPlugin ($pluginname)) ) {//check if the group has the plugin active
-            exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+			exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home');
         }
         $userperm = $group->getPermission($user); //we'll check if the user belongs to the group
         if ( !$userperm->IsMember()) {
-            exit_error(_('Access Denied'), _('You are not a member of this project'));
+            exit_permission_denied(_('You are not a member of this project'),'home');
         }
         //only project admin can access here
         if ( $userperm->isAdmin() ) {
@@ -166,7 +170,7 @@
             print "</tr>\n";
             print "</table>\n";
         } else {
-            exit_error(_('Access Denied'), _('You are not a project Admin'));
+            exit_permission_denied(_('You are not a project Admin'),'home');
         }
     }
 }

Modified: trunk/src/www/docman/index.php
===================================================================
--- trunk/src/www/docman/index.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/www/docman/index.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -56,7 +56,7 @@
 	exit_disabled('home');
 
 if ($g->isError())
-	exit_error(_('Error'),$g->getErrorMessage(),'docman');
+	exit_error($g->getErrorMessage(),'docman');
 
 $dirid = getIntFromRequest('dirid');
 if (empty($dirid))
@@ -64,19 +64,19 @@
 
 $df = new DocumentFactory($g);
 if ($df->isError())
-	exit_error(_('Error'),$df->getErrorMessage(),'docman');
+	exit_error($df->getErrorMessage(),'docman');
 
 $dgf = new DocumentGroupFactory($g);
 if ($dgf->isError())
-	exit_error(_('Error'),$dgf->getErrorMessage(),'docman');
+	exit_error($dgf->getErrorMessage(),'docman');
 
 $nested_groups = $dgf->getNested();
 if ($dgf->isError())
-    exit_error(_('Error'),$dgf->getErrorMessage(),'docman');
+    exit_error($dgf->getErrorMessage(),'docman');
 
 $dgh = new DocumentGroupHTML($g);
 if ($dgh->isError())
-	exit_error(_('Error'),$dgh->getErrorMessage(),'docman');
+	exit_error($dgh->getErrorMessage(),'docman');
 
 $d_arr =& $df->getDocuments();
 if (!$d_arr || count($d_arr) <1)

Modified: trunk/src/www/docman/view.php
===================================================================
--- trunk/src/www/docman/view.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/www/docman/view.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -29,26 +29,27 @@
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'docman/Document.class.php';
 
+session_require_perm ('project_read', $group_id) ;
+
 $arr=explode('/',getStringFromServer('REQUEST_URI'));
 $group_id=$arr[3];
 $docid=$arr[4];
-$docname=urldecode($arr[5]);
 
 if ($docid) {
+	$docname=urldecode($arr[5]);
 
 	$g =& group_get_object($group_id);
 	if (!$g || !is_object($g)) {
 		exit_no_group();
 	} elseif ($g->isError()) {
-		exit_error('Error',$g->getErrorMessage());
+		exit_error($g->getErrorMessage(),'docman');
 	}
-	session_require_perm ('project_read', $group_id) ;
 
 	$d = new Document($g,$docid);
 	if (!$d || !is_object($d)) {
-		exit_error('Document unavailable','Document is not available.');
+		exit_error(_('Document is not available.'),'docman');
 	} elseif ($d->isError()) {
-		exit_error('Error',$d->getErrorMessage());
+		exit_error($d->getErrorMessage(),'docman');
 	}
 
 	/** 
@@ -61,8 +62,7 @@
 	 * name is correct.
 	 */
 	if ($d->getFileName() != $docname) {
-		exit_error(_('No document data'),
-			   _('No document to display - invalid or inactive document number'));
+		exit_error(_('No document to display - invalid or inactive document number'),'docman');
 	}
 
 	Header ('Content-disposition: filename="'.str_replace('"', '', $d->getFileName()).'"');
@@ -76,7 +76,7 @@
 	echo $d->getFileData();
 
 } else {
-	exit_error(_('No document data'),_('No document to display - invalid or inactive document number.'));
+	exit_error(_('No document to display - invalid or inactive document number.'),'docman');
 }
 
 // Local Variables:

Modified: trunk/src/www/frs/admin/editrelease.php
===================================================================
--- trunk/src/www/frs/admin/editrelease.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/www/frs/admin/editrelease.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -45,7 +45,7 @@
 if (!$group || !is_object($group)) {
     exit_no_group();
 } elseif ($group->isError()) {
-    exit_error(_('Error'), $group->getErrorMessage());
+    exit_error($group->getErrorMessage(),'frs');
 }
 session_require_perm ('frs', $group_id, 'write') ;
 
@@ -54,9 +54,9 @@
 //
 $frsp = new FRSPackage($group,$package_id);
 if (!$frsp || !is_object($frsp)) {
-	exit_error(_('Error'),_('Could Not Get FRSPackage'),'frs');
+	exit_error(_('Could Not Get FRSPackage'),'frs');
 } elseif ($frsp->isError()) {
-	exit_error(_('Error'),$frsp->getErrorMessage(),'frs');
+	exit_error($frsp->getErrorMessage(),'frs');
 }
 
 //
@@ -64,9 +64,9 @@
 //
 $frsr = new FRSRelease($frsp,$release_id);
 if (!$frsr || !is_object($frsr)) {
-	exit_error(_('Error'),_('Could Not Get FRSRelease'),'frs');
+	exit_error(_('Could Not Get FRSRelease'),'frs');
 } elseif ($frsr->isError()) {
-	exit_error('Error',$frsr->getErrorMessage(),'frs');
+	exit_error($frsr->getErrorMessage(),'frs');
 }
 
 $upload_dir = forge_get_config('ftp_upload_dir') . "/" . $group->getUnixName();
@@ -91,7 +91,7 @@
 	// Check for uploaded release notes
 	if ($uploaded_notes["tmp_name"]) {
 		if (!is_uploaded_file($uploaded_notes['tmp_name'])) {
-			exit_error(_('Error'),_('Attempted File Upload Attack'),'frs');
+			exit_error(_('Attempted File Upload Attack'),'frs');
 		}
 		if ($uploaded_notes['type'] !== 'text/plain') {
 			$error_msg .= _('Release Notes Are not in Text').'<br />';
@@ -110,7 +110,7 @@
 	// Check for uploaded change logs
 	if ($uploaded_changes['tmp_name']) {
 		if (!is_uploaded_file($uploaded_changes['tmp_name'])) {
-			exit_error(_('Error'),_('Attempted File Upload Attack'),'frs');
+			exit_error(_('Attempted File Upload Attack'),'frs');
 		}
 		if ($uploaded_changes['type'] !== 'text/plain') {
 			$error_msg .= _('Change Log Is not in Text').'<br />';
@@ -132,7 +132,7 @@
 		//$release_date = mktime($date_list[3],$date_list[4],0,$date_list[1],$date_list[2],$date_list[0]);
 		$release_date = strtotime($release_date);
 		if (!$frsr->update($status_id,$release_name,$notes,$changes,$preformatted,$release_date)) {
-			exit_error(_('Error'),$frsr->getErrorMessage(),'frs');
+			exit_error($frsr->getErrorMessage(),'frs');
 		} else {
 			$feedback .= _('Data Saved');
 		}
@@ -180,12 +180,12 @@
 		if ($im_sure) {
 			$frsf = new FRSFile($frsr,$file_id);
 			if (!$frsf || !is_object($frsf)) {
-				exit_error(_('Error'),_('Could Not Get FRSFile'),'frs');
+				exit_error(_('Could Not Get FRSFile'),'frs');
 			} elseif ($frsf->isError()) {
-				exit_error(_('Error'),$frsf->getErrorMessage(),'frs');
+				exit_error($frsf->getErrorMessage(),'frs');
 			} else {
 				if (!$frsf->delete()) {
-					exit_error(_('Error'),$frsf->getErrorMessage(),'frs');
+					exit_error($frsf->getErrorMessage(),'frs');
 				} else {
 					$feedback .= _('File Deleted');
 				}
@@ -197,15 +197,15 @@
 	} else {
 		$frsf = new FRSFile($frsr,$file_id);
 		if (!$frsf || !is_object($frsf)) {
-			exit_error(_('Error'),_('Could Not Get FRSFile'),'frs');
+			exit_error(_('Could Not Get FRSFile'),'frs');
 		} elseif ($frsf->isError()) {
-			exit_error(_('Error'),$frsf->getErrorMessage(),'frs');
+			exit_error($frsf->getErrorMessage(),'frs');
 		} else {
 			//$date_list = split('[- :]',$release_time,5);
 			//$release_time = mktime($date_list[3],$date_list[4],0,$date_list[1],$date_list[2],$date_list[0]);
 			$release_time = strtotime($release_time);
 			if (!$frsf->update($type_id,$processor_id,$release_time,$new_release_id)) {
-				exit_error(_('Error'),$frsf->getErrorMessage(),'frs');
+				exit_error($frsf->getErrorMessage(),'frs');
 			} else {
 				$feedback .= _('File Updated');
 			}
@@ -267,7 +267,7 @@
 	</td>
 </tr>
 <tr>
-	<td>
+	<td colspan="2">
 		<br />
 		<input type="checkbox" name="preformatted" value="1" <?php echo (($frsr->getPreformatted())?'checked="checked"':''); ?> /> <?php echo _('Preserve my pre-formatted text.') ?>
 		<p>
@@ -327,6 +327,7 @@
 </table>
 <p>
 <input type="submit" name="submit" value="<?php echo _('Add This File') ?>" /></p>
+</fieldset>
 </form>
 <hr />
 <h2><?php echo _('Step 3: Edit Files In This Release') ?></h2>

Deleted: trunk/src/www/include/exit.php
===================================================================
--- trunk/src/www/include/exit.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/www/include/exit.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,117 +0,0 @@
-<?php
-/**
- * FusionForge : Exit functions
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2010, Franck Villaume
- *
- * This file is part of FusionForge.
- *
- * FusionForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/**
- * exit_error() - Exit PHP with error
- *
- * @param		string	Error title
- * @param		string	Error text
- * @param       string  toptab for navigation bar
- */
-function exit_error($title,$text="", $toptab='') {
-	global $HTML,$group_id;
-	$HTML->header(array('title'=>_('Exiting with error'), 'group'=>$group_id, 'toptab'=>$toptab));
-	echo '<h1>' . _('Exiting with error') . '</h1>';
-	echo $HTML->error_msg($title.' : '.htmlspecialchars($text));
-	$HTML->footer(array());
-	exit;
-}
-
-/**
- * exit_permission_denied() - Exit with permission denied error
- *
- * @param	string	$reason_descr
- * @param   string  toptab needed for navigation
- */
-function exit_permission_denied($reason_descr='',$toptab='') {
-	if(!session_loggedin()) {
-		exit_not_logged_in();
-	} else {
-		if (!$reason_descr) {
-			$reason_descr=_('This project\'s administrator will have to grant you permission to view this page.');
-		}
-		exit_error(_('Permission denied.'),$reason_descr,$toptab);
-	}
-}
-
-/**
- * exit_not_logged_in() - Exit with not logged in error
- */
-function exit_not_logged_in() {
-	//instead of a simple error page, now take them to the login page
-	session_redirect ("/account/login.php?triggered=1&return_to=".urlencode(getStringFromServer('REQUEST_URI')));
-}
-
-/**
- * exit_no_group() - Exit with no group chosen error
- */
-function exit_no_group() {
-	exit_error(_('Error'), _('No project was chosen, project does not exist or you can\'t access it.'));
-}
-
-/**
- * exit_missing_param() - Exit with missing required parameters error
- * @param   string  URL : usually $_SERVER['HTTP_REFERER']
- * @param   array   array of missing parameters
- * @param   string  toptab needed for navigation
- */
-function exit_missing_param($url='',$missing_params=array(),$toptab='') {
-    if (!empty($url)) {
-        if (!empty($missing_params)) {
-            $error = _('Missing required parameters : ');
-            foreach ($missing_params as $missing_param) {
-                $error .= $missing_param.' ';
-            }
-        } else {
-            $error = sprintf(_('Missing required parameters.'));
-        }
-        header('Location: '.$url.'&error_msg='.urlencode($error));
-        exit;
-    } else {
-	    exit_error(_('Error'), _('Missing required parameters.'),$toptab);
-    }
-}
-
-/**
- * exit_disabled() - Exit with disabled feature error.
- * @param   string  toptab needed for navigation
- */
-function exit_disabled($toptab='') {
-	exit_error(_('Error'), _('The Site Administrator has turned off this feature.'),$toptab);
-}
-
-/**
- * exit_form_double_submit() - Exit with double submit error.
- * @param   string  toptab needed for navigation
- */
-function exit_form_double_submit($toptab='') {
-	exit_error(_('Error'),_('You Attempted To Double-submit this item. Please avoid double-clicking.'),$toptab);
-}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Modified: trunk/src/www/include/project_home.php
===================================================================
--- trunk/src/www/include/project_home.php	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/www/include/project_home.php	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,13 +1,28 @@
 <?php 
 
-/** 
-* project_home.php 
-* 
-* SourceForge: Breaking Down the Barriers to Open Source Development 
-* Copyright 1999-2001 (c) VA Linux Systems 
-* http://sourceforge.net 
-* 
-*/
+/**
+ * FusionForge Project Home
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems 
+ * Copyright 2010, FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 require_once $gfwww.'news/news_utils.php';
 require_once $gfwww.'include/trove.php';

Modified: trunk/src/www/projects
===================================================================
--- trunk/src/www/projects	2010-09-18 18:52:51 UTC (rev 10543)
+++ trunk/src/www/projects	2010-09-19 09:53:04 UTC (rev 10544)
@@ -1,25 +1,26 @@
 <?php
 /**
- * Projects Redirector
+ * FusionForge Projects Redirector
  *
  * Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 2002-2004 (c) GForge Team
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -37,20 +38,18 @@
 //	test to see if the logger was successful in setting up the objects
 //
 if (!$group_id || !$project) {
-	exit_error("Invalid Project","Invalid Project");
+	exit_no_group();
 } else {
 	$subpage = getStringFromRequest('subpage');
 
 	if ($subpage == "admin") {
 		session_redirect(util_make_url("/project/admin/?group_id=$group_id"));
-		exit();
 	} else if ($subpage == "files" || $subpage == "download" || $subpage == "dl") {
 		if (getStringFromRequest('subpage2') == "release") {
 			session_redirect(util_make_url("/frs/admin/qrs.php?group_id=$group_id"));
 		} else {
 			session_redirect(util_make_url("/frs/?group_id=$group_id"));
 		}
-		exit();
 	} else if ($subpage == "cvs") {
 		header("Location: ".account_group_cvsweb_url($project->getUnixName()));
 		exit();




More information about the Fusionforge-commits mailing list