[Fusionforge-commits] r10552 - in trunk/src/www: mail/admin project/admin softwaremap

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


Author: nerville
Date: 2010-09-19 19:57:10 +0200 (Sun, 19 Sep 2010)
New Revision: 10552

Modified:
   trunk/src/www/mail/admin/deletelist.php
   trunk/src/www/project/admin/group_trove.php
   trunk/src/www/project/admin/index.php
   trunk/src/www/softwaremap/trove_list.php
Log:
exit functions migration

Modified: trunk/src/www/mail/admin/deletelist.php
===================================================================
--- trunk/src/www/mail/admin/deletelist.php	2010-09-19 16:28:29 UTC (rev 10551)
+++ trunk/src/www/mail/admin/deletelist.php	2010-09-19 17:57:10 UTC (rev 10552)
@@ -1,11 +1,27 @@
 <?php
-
 /**
- * GForge Mailing Lists Facility
+ * FusionForge Mailing Lists Facility
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2003-2004 (c) Guillaume Smet - Open Wide
+ * Copyright 1999-2001, VA Linux Systems, Inc.
+ * Copyright 2003-2004 (c) Guillaume Smet - Open Wide
+ * Copyright 2010 (c) 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
  */
 
 require_once('../../env.inc.php');
@@ -23,8 +39,10 @@
 }
 
 $group =& group_get_object($group_id);
-if (!$group || !is_object($group) || $group->isError()) {
+if (!$group || !is_object($group)) {
 	exit_no_group();
+} else if ($group->isError()) {
+	exit_error($group->getErrorMessage(),'home');
 }
 
 session_require_perm ('project_admin', $group->getID()) ;
@@ -35,9 +53,10 @@
 	$sure = getStringFromPost('sure');
 	$really_sure = getStringFromPost('really_sure');
 	if (!$ml->delete($sure,$really_sure)) {
-		exit_error('Error',$ml->getErrorMessage());
+		exit_error($ml->getErrorMessage(),'home');
 	} else {
-		header("Location: index.php?group_id=$group_id&feedback=Mailing+List+successfully+deleted");
+		$feedback= _('Mailing List Successfully deleted');
+		session_redirect('?group_id='.$group_id.'&feedback='.urlencode($feedback));
 	}
 }
 

Modified: trunk/src/www/project/admin/group_trove.php
===================================================================
--- trunk/src/www/project/admin/group_trove.php	2010-09-19 16:28:29 UTC (rev 10551)
+++ trunk/src/www/project/admin/group_trove.php	2010-09-19 17:57:10 UTC (rev 10552)
@@ -37,7 +37,7 @@
 
 if (getStringFromRequest('submit') && getStringFromRequest('root1')) {
 	 if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-		exit_form_double_submit();
+		exit_form_double_submit('home');
 	 }
 	group_add_history ('Changed Trove', '', $group_id);
 
@@ -66,7 +66,8 @@
 			}
 		}
 	}
-	session_redirect('/project/admin/?group_id='.$group_id);
+	$feedback = _('Trove Update Success');
+	session_redirect('/project/admin/?group_id='.$group_id.'&feedback='.urlencode($feedback));
 }
 
 project_admin_header(array('title'=>_('Edit Trove Categorization'),'group'=>$group_id));

Modified: trunk/src/www/project/admin/index.php
===================================================================
--- trunk/src/www/project/admin/index.php	2010-09-19 16:28:29 UTC (rev 10551)
+++ trunk/src/www/project/admin/index.php	2010-09-19 17:57:10 UTC (rev 10552)
@@ -6,24 +6,23 @@
  * as allows to manage it. This page should be accessible to all project
  * members, but only admins may perform most functions.
  *
- * Copyright 2004 GForge, LLC
+ * Copyright 2004 GForge, LLC - Tim Perdue
+ * Copyright 2010 (c), Franck Villaume
  *
- * @author Tim Perdue tim at gforge.org
+ * This file is part of FusionForge.
  *
- * This file is part of GForge.
- *
- * 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
  */
 
@@ -34,6 +33,8 @@
 require_once $gfcommon.'include/GroupJoinRequest.class.php';
 
 $group_id = getIntFromRequest('group_id');
+$feedback = htmlspecialchars(getStringFromRequest('feedback'));
+
 session_require_perm ('project_admin', $group_id) ;
 
 // get current information
@@ -41,34 +42,14 @@
 if (!$group || !is_object($group)) {
     exit_no_group();
 } elseif ($group->isError()) {
-	exit_error('Error',$group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'home');
 }
 
 $group->clearError();
 
 $adminheadertitle=sprintf(_('Project Admin: %1$s'), $group->getPublicName() );
 project_admin_header(array('title'=>$adminheadertitle, 'group'=>$group->getID()));
-?>
 
-<table class="my-layout-table">
-	<tr>
-		<td>
-
-<?php echo $HTML->boxTop(_('Misc. Project Information'));  ?>
-
-
-<?php
-
-	if (forge_get_config('use_shell')) {
-?> 
-<p><?php echo _('Group shell (SSH) server:&nbsp;') ?><strong><?php echo $group->getUnixName().'.'.forge_get_config('web_host'); ?></strong></p>
-<p><?php echo _('Group directory on shell server:&nbsp;') ?><br/><strong><?php echo account_group_homedir($group->getUnixName()); ?></strong></p>
-<p><?php echo _('Project WWW directory on shell server:&nbsp;') ?><br /><strong><?php echo account_group_homedir($group->getUnixName()).'/htdocs'; ?></strong></p>
-<?php
-	} //end of use_shell condition
-?> 
-
-<?php
 // If this was a submission, make updates
 if (getStringFromRequest('submit')) {
 	$form_group_name = getStringFromRequest('form_group_name');
@@ -118,14 +99,35 @@
 	//100 $logo_image_id
 
 	if (!$res) {
-		$feedback .= $group->getErrorMessage();
+		$submit_error = $group->getErrorMessage();
 	} else {
-		$feedback .= _('Project information updated');
+		$submit_feedback = _('Project information updated');
 	}
 }
 
+if (isset($submit_error)) {
+	echo '<div class="error">'.$submit_error.'</div>';
+}
+if (isset($submit_feedback)) {
+	echo '<div class="feedback">'.$submit_feedback.'</div>';
+}
 ?>
 
+<table class="my-layout-table">
+	<tr>
+		<td>
+
+<?php echo $HTML->boxTop(_('Misc. Project Information'));
+
+if (forge_get_config('use_shell')) {
+?> 
+<p><?php echo _('Group shell (SSH) server:&nbsp;') ?><strong><?php echo $group->getUnixName().'.'.forge_get_config('web_host'); ?></strong></p>
+<p><?php echo _('Group directory on shell server:&nbsp;') ?><br/><strong><?php echo account_group_homedir($group->getUnixName()); ?></strong></p>
+<p><?php echo _('Project WWW directory on shell server:&nbsp;') ?><br /><strong><?php echo account_group_homedir($group->getUnixName()).'/htdocs'; ?></strong></p>
+<?php
+	} //end of use_shell condition
+?> 
+
 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
 
 <input type="hidden" name="group_id" value="<?php echo $group->getID(); ?>" />

Modified: trunk/src/www/softwaremap/trove_list.php
===================================================================
--- trunk/src/www/softwaremap/trove_list.php	2010-09-19 16:28:29 UTC (rev 10551)
+++ trunk/src/www/softwaremap/trove_list.php	2010-09-19 17:57:10 UTC (rev 10552)
@@ -33,7 +33,7 @@
 require_once $gfwww.'include/trove.php';
 
 if (!forge_get_config('use_trove')) {
-	exit_disabled();
+	exit_disabled('home');
 }
 
 $form_cat = getIntFromRequest('form_cat');
@@ -53,10 +53,7 @@
 			array($form_cat));
 
 if (db_numrows($res_trove_cat) < 1) {
-	exit_error(
-		_('Invalid Trove Category'),
-		_('That Trove category does not exist').': '.db_error()
-	);
+	exit_error(_('That Trove category does not exist').': '.db_error(),'trove');
 }
 
 $HTML->header(array('title'=>_('Software Map')));




More information about the Fusionforge-commits mailing list