[Fusionforge-commits] r10555 - trunk/src/www/admin

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Mon Sep 20 12:04:48 CEST 2010


Author: nerville
Date: 2010-09-20 12:04:48 +0200 (Mon, 20 Sep 2010)
New Revision: 10555

Modified:
   trunk/src/www/admin/admin_table.php
   trunk/src/www/admin/pluginman.php
   trunk/src/www/admin/search.php
   trunk/src/www/admin/unsubscribe.php
   trunk/src/www/admin/userlist.php
   trunk/src/www/admin/vhost.php
Log:
exit function migration

Modified: trunk/src/www/admin/admin_table.php
===================================================================
--- trunk/src/www/admin/admin_table.php	2010-09-20 09:37:16 UTC (rev 10554)
+++ trunk/src/www/admin/admin_table.php	2010-09-20 10:04:48 UTC (rev 10555)
@@ -89,7 +89,6 @@
 
 	$qpa = db_construct_qpa ($qpa, implode (',', $v).')', $values) ;
 
-    var_dump($qpa);
 	if (db_query_qpa($qpa)) {
         print('<div class="feedback">');
 		printf(_('%1$s successfully added.'), ucfirst(getUnitLabel($unit)));

Modified: trunk/src/www/admin/pluginman.php
===================================================================
--- trunk/src/www/admin/pluginman.php	2010-09-20 09:37:16 UTC (rev 10554)
+++ trunk/src/www/admin/pluginman.php	2010-09-20 10:04:48 UTC (rev 10555)
@@ -64,7 +64,7 @@
 			$res = db_query_params ('DELETE FROM user_plugin WHERE plugin_id = (SELECT plugin_id FROM plugins WHERE plugin_name = $1)',
 			array($pluginname));
 			if (!$res) {
-				exit_error("SQL ERROR",db_error());
+				exit_error(db_error(),'admin');
 			} else {
 				$feedback .= sprintf(ngettext('%d user detached from plugin.', '%d users detached from plugin.', db_affected_rows($res)), db_affected_rows($res));
 			}
@@ -74,14 +74,14 @@
 			$res = db_query_params ('DELETE FROM group_plugin WHERE plugin_id = (SELECT plugin_id FROM plugins WHERE plugin_name = $1)',
 			array($pluginname));
 			if (!$res) {
-				exit_error("SQL ERROR",db_error());
+				exit_error(db_error(),'admin');
 			} else {
 				$feedback .= sprintf(ngettext('%d project detached from plugin.', '%d projects detached from plugin.', db_affected_rows($res)), db_affected_rows($res));
 			}
 		}
 		$res = $pm->deactivate($pluginname);
 		if (!$res) {
-			exit_error("SQL ERROR",db_error());
+			exit_error(db_error(),'admin');
 		} else {
 			$feedback = sprintf(_('Plugin %1$s updated Successfully'), $pluginname);
 			
@@ -111,7 +111,7 @@
 
 		$res = $pm->activate($pluginname);
 		if (!$res) {
-			exit_error("SQL ERROR",db_error());
+			exit_error(db_error(),'admin');
 		} else {
 			$feedback = sprintf(_('Plugin %1$s updated Successfully'), $pluginname);
 

Modified: trunk/src/www/admin/search.php
===================================================================
--- trunk/src/www/admin/search.php	2010-09-20 09:37:16 UTC (rev 10554)
+++ trunk/src/www/admin/search.php	2010-09-20 10:04:48 UTC (rev 10555)
@@ -9,21 +9,22 @@
  * not any other (new) page.
  *
  * Copyright 1999-2001 (c) VA Linux Systems
+ * 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
  */
 
@@ -36,7 +37,7 @@
 $usersearch = getStringFromRequest('usersearch');
 
 if (!$search) {
-	exit_error(_('Error - Refusing to display whole DB. Please use a CLI query if you wish to do this.'));
+	exit_error(_('Refusing to display whole DB. Please use a CLI query if you wish to do this.'),'admin');
 }
 
 site_admin_header(array('title'=>_('Admin Search Results')));
@@ -82,7 +83,7 @@
 
 	if (db_numrows($result) < 1) {
 
-		echo db_error();
+		exit_error(db_error(),'admin');
 
 	} else {
 

Modified: trunk/src/www/admin/unsubscribe.php
===================================================================
--- trunk/src/www/admin/unsubscribe.php	2010-09-20 09:37:16 UTC (rev 10554)
+++ trunk/src/www/admin/unsubscribe.php	2010-09-20 10:04:48 UTC (rev 10555)
@@ -7,20 +7,20 @@
  *
  * Copyright 1999-2001 (c) VA Linux Systems
  *
- * 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
  */
 
@@ -71,18 +71,16 @@
 
 		$u =& user_get_object_by_name($user_name);
 		if (!$u || !is_object($u)) {
-			exit_error('Error','Could Not Get User');
+			exit_error(_('Could Not Get User'),'home');
 		} elseif ($u->isError()) {
-			exit_error('Error',$u->getErrorMessage());
+			exit_error($u->getErrorMessage(),'home');
 		}
 
 		if (!$u->unsubscribeFromMailings($type=='ALL' ? 1 : 0)) {
-			exit_error(
-				_('Error, Could not unsubscribe user:') .$u->getErrorMessage()
-			);
+			exit_error(_('Could not unsubscribe user: ').$u->getErrorMessage(),'home');
 		}
 
-		$feedback .= _('User unsubscribed').'<br />';
+		$feedback .= _('User unsubscribed');
 	}
 }
 

Modified: trunk/src/www/admin/userlist.php
===================================================================
--- trunk/src/www/admin/userlist.php	2010-09-20 09:37:16 UTC (rev 10554)
+++ trunk/src/www/admin/userlist.php	2010-09-20 10:04:48 UTC (rev 10555)
@@ -2,21 +2,23 @@
 /**
  *
  * Copyright 1999-2000 (c) The SourceForge Crew
+ * Copyright 2010 (c) Franck Villaume - Capgemini
+ * 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
  */
 
@@ -39,24 +41,24 @@
 function performAction($newStatus, $statusString, $user_id) {
 	$u =& user_get_object($user_id);
 	if (!$u || !is_object($u)) {
-		exit_error('Error','Could Not Get User');
+		exit_error(_('Could Not Get User'),'home');
 	} elseif ($u->isError()) {
-		exit_error('Error',$u->getErrorMessage());
+		exit_error($u->getErrorMessage(),'home');
 	}
 	if($newStatus=="D") {
 		if(!$u->delete(true)) {
-			exit_error('Error',$u->getErrorMessage());
+			exit_error($u->getErrorMessage(),'home');
 		}
 	} else {
 		if(!$u->setStatus($newStatus)) {
-			exit_error('Error',$u->getErrorMessage());
+			exit_error($u->getErrorMessage(),'home');
 		}
 		if(!$u->setUnixStatus($newStatus)) {
-			exit_error('Error',$u->getErrorMessage());
+			exit_error($u->getErrorMessage(),'home');
 		}
 
 	}
-	echo "<h2>" .sprintf(_('User updated to %1$s status'), $statusString)."</h2>";
+	echo "<div class='feedback'>" .sprintf(_('User updated to %1$s status'), $statusString)."</div>";
 }
 
 function show_users_list ($result) {

Modified: trunk/src/www/admin/vhost.php
===================================================================
--- trunk/src/www/admin/vhost.php	2010-09-20 09:37:16 UTC (rev 10554)
+++ trunk/src/www/admin/vhost.php	2010-09-20 10:04:48 UTC (rev 10555)
@@ -10,20 +10,20 @@
  *
  * Copyright 1999-2001 (c) VA Linux Systems
  *
- * 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
  */
 
@@ -33,7 +33,7 @@
 require_once $gfwww.'admin/admin_utils.php';
 
 if (!forge_get_config('use_project_vhost')) {
-	exit_disabled();
+	exit_disabled('home');
 }
 
 session_require_global_perm ('forge_admin');
@@ -49,7 +49,7 @@
 		if (!$group || !is_object($group)) {
             exit_no_group();
 		} elseif ($group->isError()) {
-			exit_error('Error',$group->getErrorMessage());
+			exit_error($group->getErrorMessage(),'home');
 		}
 		
 		$group_id = $group->getID();
@@ -72,17 +72,16 @@
 
 
 			if (!$res || db_affected_rows($res) < 1) {
-				$feedback .= _('Error adding VHOST:') .db_error();
+				$error_msg .= _('Error adding VHOST: ') .db_error();
 			} else {
-				$feedback .= _('Virtual Host:'). "<strong>".$vhost_name."</strong>" ._('scheduled for creation on group'). "<em>".$group->getUnixName()."</em>";
+				$feedback .= _('Virtual Host: ').$vhost_name._(' scheduled for creation on group ').$group->getUnixName();
 			}
 		} else {
-
-			$feedback .=	"<strong>" ._('The provided group name does not exist'). "</strong>";
-
+			$error_msg .= _('Vhost not valid');
 		}
-			
-	}			
+    } else {
+		$warning_msg .=	_('Missing group name');
+    }
 }
 
 if (getStringFromRequest('tweakcommit')) {
@@ -102,7 +101,7 @@
 
 
 	if (!$res || db_affected_rows($res) < 1) {
-		$feedback .= _('Error updating VHOST entry:') .db_error();
+		$error_msg .= _('Error updating VHOST entry: ') .db_error();
 	} else {
 		$feedback .= _('Virtual Host entry updated.');
 	}		
@@ -170,7 +169,7 @@
 
 		$row_vh = db_fetch_array($res_vh);
 	
-		print '<p><strong>'._('Update Record:').'</strong></p><hr />';
+		print '<div class="feedback">'._('Update Record:').'</div>';
 
 		$title=array();
 		$title[]=_('VHOST ID');
@@ -196,7 +195,7 @@
 			</form>
 		';
 	} else {
-		echo _('No such VHOST:') . $vhost_name;
+		echo '<div class="warning">'._('No such VHOST: ') . $vhost_name.'</div>';
 	}
 
 }




More information about the Fusionforge-commits mailing list