[Fusionforge-commits] r10549 - in trunk/src/www: . activity include survey/admin

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Sun Sep 19 14:49:35 CEST 2010


Author: nerville
Date: 2010-09-19 14:49:35 +0200 (Sun, 19 Sep 2010)
New Revision: 10549

Modified:
   trunk/src/www/activity/index.php
   trunk/src/www/include/html.php
   trunk/src/www/include/trove.php
   trunk/src/www/sendmessage.php
   trunk/src/www/survey/admin/index.php
Log:
exit functions migration

Modified: trunk/src/www/activity/index.php
===================================================================
--- trunk/src/www/activity/index.php	2010-09-19 12:27:32 UTC (rev 10548)
+++ trunk/src/www/activity/index.php	2010-09-19 12:49:35 UTC (rev 10549)
@@ -2,19 +2,31 @@
 /**
  * Project Activity Page
  *
+ * Copyright 1999 dtype
  * Copyright 2006 (c) GForge, LLC
- * http://gforge.org
+ * 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');
 require_once $gfcommon.'include/pre.php';
 
-/*
- Project Summary Page
- Written by dtype Oct. 1999
- */
 $group_id = getIntFromRequest("group_id");
 $received_begin = getStringFromRequest("start_date");
 $received_end = getStringFromRequest("end_date");
@@ -66,7 +78,7 @@
 }
 $group=group_get_object($group_id);
 if (!$group || !is_object($group)) {
-	exit_permission_denied();
+	exit_permission_denied('home');
 }
 
 site_project_header(array('title'=>_('Activity'),'group'=>$group_id,'toptab'=>'activity'));
@@ -114,8 +126,11 @@
 			    $end,
 			    $group_id,
 			    db_string_array_to_any_clause ($section)));
-echo db_error();
 
+if (db_error()) {
+	exit_error(db_error(),'home');
+}
+
 $results = array();
 while ($arr = db_fetch_array($res)) {
 	$results[] = $arr;
@@ -136,7 +151,7 @@
 }
 foreach ($show as $showthis) {
 	if (array_search($showthis,$ids) === false) {
-		exit_error('Error','Invalid Data Passed to query');
+		exit_error(_('Invalid Data Passed to query'),'home');
 	}
 }
 $multiselect=html_build_multiple_select_box_from_arrays($ids,$texts,'show[]',$show,5,false);
@@ -189,7 +204,9 @@
 				    $end,
 				    $group_id,
 				    db_string_array_to_any_clause ($show)));
-	echo db_error();
+	if (db_error()) {
+		exit_error(db_error(),'home');
+	}
 
 	$rows=db_numrows($res);
 	if ($rows<1) {

Modified: trunk/src/www/include/html.php
===================================================================
--- trunk/src/www/include/html.php	2010-09-19 12:27:32 UTC (rev 10548)
+++ trunk/src/www/include/html.php	2010-09-19 12:49:35 UTC (rev 10549)
@@ -3,6 +3,7 @@
  * FusionForge Misc HTML functions
  *
  * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c) FusionForge Team
  *
  * This file is part of FusionForge.
  *
@@ -662,27 +663,26 @@
 	} else if ($project->isError()) {
 		if ($project->isPermissionDeniedError()) {
 			if (!session_get_user()) {
- 			$next = '/account/login.php?feedback='.urlencode($project->getErrorMessage());
+ 			$next = '/account/login.php?error_msg='.urlencode($project->getErrorMessage());
  			if (getStringFromServer('REQUEST_METHOD') != 'POST') {
 				$next .= '&return_to='.urlencode(getStringFromServer('REQUEST_URI'));
  			}
- 			header("Location: $next");
- 			exit;
+			session_redirect($next);
 		}
 			else
-				exit_error("Project access problem: ",$project->getErrorMessage());
+				exit_error(sprintf(_('Project access problem: %s'),$project->getErrorMessage()),'home');
 		}
-		exit_error("Project Problem: ",$project->getErrorMessage());
+		exit_error(sprintf(_('Project Problem: %s'),$project->getErrorMessage()),'home');
 	}
 
 	//group is private
 	if (!$project->isPublic()) {
-		session_require_perm ('project_read', $group_id) ;
+		session_require_perm ('project_read', $group_id);
 	}
 
 	//for dead projects must be member of admin project
 	if (!$project->isActive()) {
-		session_require_global_perm ('forge_admin') ;
+		session_require_global_perm ('forge_admin');
 	}
 
 	if (isset($params['title'])){
@@ -722,7 +722,15 @@
 	*/
 	echo $HTML->header($params);
 	echo "<h1>" . _('My Personal Page') . "</h1>\n";
-	echo html_feedback_top((isset($GLOBALS['feedback']) ? $GLOBALS['feedback'] : ''));
+	if (isset($GLOBALS['error_msg'])) {
+		echo html_feedback_top($GLOBALS['error_msg']);
+	}
+	if (isset($GLOBALS['warning_msg'])) {
+		echo html_feedback_top($GLOBALS['warning_msg']);
+	}
+	if (isset($GLOBALS['feedback'])) {
+		echo html_feedback_top($GLOBALS['feedback']);
+	}
 	echo ($HTML->beginSubMenu());
 	if ($GLOBALS['sys_use_diary']) {
 		echo ($HTML->printSubMenu(

Modified: trunk/src/www/include/trove.php
===================================================================
--- trunk/src/www/include/trove.php	2010-09-19 12:27:32 UTC (rev 10548)
+++ trunk/src/www/include/trove.php	2010-09-19 12:49:35 UTC (rev 10549)
@@ -1,11 +1,26 @@
 <?php
 /**
- * trove.php
+ * Trove
  *
- * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
+ * 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
  */
 
 // ################################## Trove Globals
@@ -389,7 +404,7 @@
         $res=db_query_params ('SELECT * FROM trove_cat WHERE parent=$1',
 			array($node));
         if (!$res) {
-                exit_error( _('Error In Trove Operation'), db_error());
+                exit_error(sprintf(_('Error In Trove Operation : %s'),db_error()),'home');
         }
         if (db_numrows($res)>0) {
                 for ($i=0; $i<db_numrows($res); $i++) {
@@ -399,22 +414,22 @@
         $res=db_query_params ('DELETE FROM trove_treesums WHERE trove_cat_id=$1',
 			array($node));
         if (!$res) {
-                exit_error( _('Error In Trove Operation'), db_error());
+                exit_error(sprintf(_('Error In Trove Operation : %s'),db_error()),'home');
         }
         $res=db_query_params ('DELETE FROM trove_group_link WHERE trove_cat_id=$1',
 			array($node));
         if (!$res) {
-                exit_error( _('Error In Trove Operation'), db_error());
+                exit_error(sprintf(_('Error In Trove Operation : %s'),db_error()),'home');
         }
         $res=db_query_params ('DELETE FROM trove_agg WHERE trove_cat_id=$1',
 			array($node));
         if (!$res) {
-                exit_error( _('Error In Trove Operation'), db_error());
+                exit_error(sprintf(_('Error In Trove Operation : %s'),db_error()),'home');
         }
         $res=db_query_params ('DELETE FROM trove_cat WHERE trove_cat_id=$1',
 			array($node));
         if (!$res || db_affected_rows($res)<1) {
-                exit_error( _('Error In Trove Operation'), db_error());
+                exit_error(sprintf(_('Error In Trove Operation : %s'),db_error()),'home');
         }
 }
 

Modified: trunk/src/www/sendmessage.php
===================================================================
--- trunk/src/www/sendmessage.php	2010-09-19 12:27:32 UTC (rev 10548)
+++ trunk/src/www/sendmessage.php	2010-09-19 12:49:35 UTC (rev 10549)
@@ -48,7 +48,7 @@
 }
 
 if ($toaddress && !eregi(forge_get_config('web_host'),$toaddress)) {
-	exit_error(,sprintf(_('You can only send to addresses @<em>%1$s</em>.'),forge_get_config('web_host')),'home');
+	exit_error(sprintf(_('You can only send to addresses @<em>%1$s</em>.'),forge_get_config('web_host')),'home');
 }
 
 

Modified: trunk/src/www/survey/admin/index.php
===================================================================
--- trunk/src/www/survey/admin/index.php	2010-09-19 12:27:32 UTC (rev 10548)
+++ trunk/src/www/survey/admin/index.php	2010-09-19 12:49:35 UTC (rev 10549)
@@ -47,7 +47,7 @@
 echo '<h1>'._('Survey Administration').'</h1>';
 
 if (!session_loggedin()) {
-	exit_not_logged_in()
+	exit_not_logged_in();
 }
 
 if ( !user_ismember($group_id,'A')) {




More information about the Fusionforge-commits mailing list