[Fusionforge-commits] r10548 - in trunk/src: common/include www www/scm www/scm/include www/scm/reporting www/stats www/survey

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


Author: nerville
Date: 2010-09-19 14:27:32 +0200 (Sun, 19 Sep 2010)
New Revision: 10548

Modified:
   trunk/src/common/include/exit.php
   trunk/src/www/404.php
   trunk/src/www/scm/include/scm_utils.php
   trunk/src/www/scm/reporting/commits_graph.php
   trunk/src/www/scm/viewvc.php
   trunk/src/www/sendmessage.php
   trunk/src/www/snapshots.php
   trunk/src/www/source.php
   trunk/src/www/stats/lastlogins.php
   trunk/src/www/survey/survey_utils.php
Log:
exit functions migration

Modified: trunk/src/common/include/exit.php
===================================================================
--- trunk/src/common/include/exit.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/common/include/exit.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -64,9 +64,10 @@
 
 /**
  * exit_no_group() - Exit with no group chosen error
+ * @param	string toptab
  */
 function exit_no_group() {
-	exit_error(_('No project was chosen, project does not exist or you can\'t access it.'));
+	exit_error(_('No project was chosen, project does not exist or you can\'t access it.'),$toptab='');
 }
 
 /**

Modified: trunk/src/www/404.php
===================================================================
--- trunk/src/www/404.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/404.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,23 +1,23 @@
 <?php
 /**
- * GForge HTTP 404 (Document Not Found) Page
+ * FusionForge HTTP 404 (Document Not Found) Page
  *
  * 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
  */
 

Modified: trunk/src/www/scm/include/scm_utils.php
===================================================================
--- trunk/src/www/scm/include/scm_utils.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/scm/include/scm_utils.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,44 +1,43 @@
 <?php
 /**
- * GForge SCM Library
+ * FusionForge SCM Library
  *
- * Copyright 2004 (c) GForge LLC
+ * Copyright 2004-2005 (c) GForge LLC, Tim Perdue
+ * Copyright 2010 (c), Franck Villaume
+ * http://fusionforge.org
  *
- * @author Tim Perdue tim at gforge.org
- * @date 2005-04-16
+ * 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
  */
 
 function scm_header($params) {
 	global $HTML;
 	if (!forge_get_config('use_scm')) {
-		exit_disabled();
+		exit_disabled('home');
 	}
 
 	$project =& group_get_object($params['group']);
 	if (!$project || !is_object($project)) {
-		exit_error('Error','Could Not Get Project');
+		exit_no_group();
 	} elseif ($project->isError()) {
-		exit_error('Error',$project->getErrorMessage());
+		exit_error($project->getErrorMessage(),'home');
 	}
 
 	if (!$project->usesSCM()) {
-		exit_error('Error',_('Error - This project has turned off SCM.'));
+		exit_disabled('home');
 	}
 	site_project_header(array('title'=>_('SCM Repository'),'group'=>$params['group'],'toptab'=>'scm',));
 	/*

Modified: trunk/src/www/scm/reporting/commits_graph.php
===================================================================
--- trunk/src/www/scm/reporting/commits_graph.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/scm/reporting/commits_graph.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,26 +1,24 @@
 <?php
 /**
- * Reporting System
+ * FusionForge Reporting System
  *
- * Copyright 2004 (c) GForge LLC
+ * Copyright 2003-2004 (c) GForge LLC, Tim Perdue
+ * Copyright 2010 (c) Franck Villaume
  *
- * @author Tim Perdue tim at gforge.org
- * @date 2003-03-16
+ * 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
  */
 
@@ -41,15 +39,13 @@
 //	Check for error, such as license key problem
 //
 if ($report->isError()) {
-	echo $report->getErrorMessage();
-	exit;
+	exit_error($report->getErrorMessage(),'home');
 }
 
 $group_id = getIntFromRequest('group_id');
 $g =& group_get_object($group_id);
 if (!$g || !is_object($g)) {
-	echo 'Permission Denied';
-	exit;
+	exit_no_group();
 }
 
 $days = getIntFromRequest('days');
@@ -80,7 +76,7 @@
 			       $group_id));
 
 if (db_error()) {
-	exit_error('Error',db_error());
+	exit_error(db_error(),'home');
 }
 
 // Create the graph. These two calls are always required

Modified: trunk/src/www/scm/viewvc.php
===================================================================
--- trunk/src/www/scm/viewvc.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/scm/viewvc.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,13 +1,31 @@
 <?php
 
 /**
- * GForge ViewCVS PHP wrapper.
+ * FusionForge ViewCVS PHP wrapper.
  *
  * Portion of this file is inspired from the ViewCVS wrapper
  * contained in CodeX.
  * Copyright (c) Xerox Corporation, CodeX / CodeX Team, 2001,2002. All Rights Reserved.
  * http://codex.xerox.com
  *
+ * 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
  */
 
 // make sure we're not compressing output if we are making a tarball
@@ -21,7 +39,7 @@
 require_once $gfwww.'scm/include/viewvc_utils.php';
 
 if (!forge_get_config('use_scm')) {
-	exit_disabled();
+	exit_disabled('home');
 }
 
 // Get the project name from query
@@ -44,11 +62,13 @@
 
 // Check permissions
 $Group =& group_get_object_by_name($projectName);
-if (!$Group || !is_object($Group) || $Group->isError()) {
+if (!$Group || !is_object($Group)) {
 	exit_no_group();
+} else if ( $Group->isError()) {
+	exit_error($Group->getErrorMessage(),'home');
 }
 if (!$Group->usesSCM()) {
-	exit_error(_('Error'), _('Error - This project has turned off SCM.'));
+	exit_disabled('home');
 }
 
 // check if the scm_box is located in another server
@@ -57,7 +77,7 @@
 $external_scm = !$sys_scm_single_host;
 
 if (!forge_check_perm ('scm', $group->getID(), 'read')) {
-	exit_permission_denied();
+	exit_permission_denied('home');
 }
 
 if ($external_scm) {
@@ -70,7 +90,7 @@
 	$script_url = "http://".$scm_box."/".$server_script.$_SERVER["PATH_INFO"]."?".$_SERVER["QUERY_STRING"];
 	$fh = @fopen($script_url, "r");
 	if (!$fh) {
-		exit_error('Error', 'Could not open script <b>'.$script_url.'</b>.');
+		exit_error(sprintf(_('Could not open script %s.'),$script_url),'home');
 	}
 	
 	// start reading the output of the script (in 8k chunks)

Modified: trunk/src/www/sendmessage.php
===================================================================
--- trunk/src/www/sendmessage.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/sendmessage.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -3,23 +3,24 @@
  * Send an Email Message Page
  *
  * 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) Franck Villaume
+ * 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
  */
 
@@ -30,7 +31,7 @@
 $touser = getStringFromRequest('touser');
 
 if (!$toaddress && !$touser) {
-	exit_error(_('Error'),_('Error - some variables were not provided'));
+	exit_missing_param('',array(_('toaddress'),_('touser')),'home');
 }
 
 if ($touser) {
@@ -42,18 +43,18 @@
 			array($touser)) ;
 
 	if (!$result || db_numrows($result) < 1) {
-		exit_error(_('Error'),_('Error - That user does not exist'));
+		exit_error(_('That user does not exist'),'home');
 	}
 }
 
 if ($toaddress && !eregi(forge_get_config('web_host'),$toaddress)) {
-	exit_error(_('Error'),sprintf(_('You can only send to addresses @<em>%1$s</em>.'),forge_get_config('web_host')));
+	exit_error(,sprintf(_('You can only send to addresses @<em>%1$s</em>.'),forge_get_config('web_host')),'home');
 }
 
 
 if (getStringFromRequest('send_mail')) {
 	if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-		exit_form_double_submit();
+		exit_form_double_submit('home');
 	}
 
 	$subject = getStringFromRequest('subject');
@@ -66,7 +67,7 @@
 			force them to enter all vars
 		*/
 		form_release_key(getStringFromRequest('form_key'));
-		exit_missing_param();
+		exit_missing_param('',array(_('Subject'),_('Body'),_('Name'),_('Email'),'home');
 	}
 	
 	// we remove the CRLF in all thoses vars. This is to make sure that there will be no CRLF Injection	

Modified: trunk/src/www/snapshots.php
===================================================================
--- trunk/src/www/snapshots.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/snapshots.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,11 +1,28 @@
 <?php
 
 /**
- * GForge SCM Snapshots download page
+ * FusionForge SCM Snapshots download page
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2003-2004 (c) GForge
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2003-2004 (c) GForge
+ * 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
  */
 
 $no_gz_buffer=true;
@@ -20,16 +37,14 @@
 }
 $group =& group_get_object($group_id);
 if (!$group || !is_object($group)) {
-	exit_error(_('Error'),
-		_('Error creating group'));
+	exit_error(_('Error creating group'),'home');
 } else if ($group->isError()) {
-	exit_error(_('Error'),
-		$group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'home');
 }
 
 // Snapshot downloads require the same permissions as SCM read access
 if (!forge_check_perm ('scm', $group->getID(), 'read')) {
- 	exit_permission_denied();
+ 	exit_permission_denied('home');
 }
 
 // Download file

Modified: trunk/src/www/source.php
===================================================================
--- trunk/src/www/source.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/source.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,12 +1,27 @@
 <?php
+
 /**
- *
  * Show source code of a given file.
  *
- * Given a file, show the source code for that file.
- *
  * Copyright 2002 (C) GForge Development Team
+ * 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');
@@ -14,17 +29,17 @@
 
 
 if (!forge_get_config('show_source')) {
-	exit_permission_denied();
+	exit_permission_denied('home');
 }
 
 $file = getStringFromRequest('file');
 
 if (!$file) {
-	exit_error(_('Missing File Argument'), _('A file must be specified for this page.'));
+	exit_missing_param('',array(_('A file must be specified for this page.')),'home');
 }
 
 if (strstr($file,'..')) {
-	exit_error(_('Invalid File Argument'), _('The file argument is invalid.'));
+	exit_error(_('The file argument is invalid.'),'home');
 }
 
 $dir = dirname($file);
@@ -37,7 +52,7 @@
 }
 
 if (!file_exists($fname) || @is_dir($fname)) {
-	exit_error(_('File Not Found'), _('Cannot find specified file to display.'));
+	exit_error(_('Cannot find specified file to display.'),'home');
 }
 
 $HTML->header(array('title'=>sprintf(_('Source of %1$s'), $file)));

Modified: trunk/src/www/stats/lastlogins.php
===================================================================
--- trunk/src/www/stats/lastlogins.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/stats/lastlogins.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,15 +1,27 @@
 <?php
 /**
-  *
-  * Page to view latest logins to the site
-  *
-  * WARNING: this should probably be moved to /stats/ for consistency
-  *
-  * SourceForge: Breaking Down the Barriers to Open Source Development
-  * Copyright 1999-2001 (c) VA Linux Systems
-  * http://sourceforge.net
-  *
-  */
+ * Page to view latest logins to the site
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * 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';
@@ -26,7 +38,7 @@
 			       50);
 
 if (!$res_logins || db_numrows($res_logins) < 1) {
-	exit_error('Error',_('No records found","Database error: "').db_error());
+	exit_error(_('No records found","Database error: "').db_error(),'home');
 }
 
 $HTML->header(array('title'=>_('Last Logins')));

Modified: trunk/src/www/survey/survey_utils.php
===================================================================
--- trunk/src/www/survey/survey_utils.php	2010-09-19 11:52:35 UTC (rev 10547)
+++ trunk/src/www/survey/survey_utils.php	2010-09-19 12:27:32 UTC (rev 10548)
@@ -1,39 +1,35 @@
 <?php
 /**
- * GForge Survey Facility
+ * FusionForge Survey Facility
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Portions Copyright 1999-2001 (c) VA Linux Systems, Tim Perdue
+ * Copyright 2002-2004 (c) GForge Team
+ * Copyright 2010 (c) Franck Villaume
+ * 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
  */
 
 
-/*
-	Survey System
-	By Tim Perdue, Sourceforge, 11/99
-*/
-
 function survey_header($params) {
 	global $group_id,$is_admin_page,$HTML;
 
 	if (!forge_get_config('use_survey')) {
-		exit_disabled();
+		exit_disabled('home');
 	}
 
 	$params['toptab']='surveys';
@@ -41,7 +37,7 @@
 
 	if ($project =& group_get_object($group_id)){
 		if (!$project->usesSurvey()) {
-			exit_error(_('Error'), _('This Project Has Turned Off Surveys.'));
+			exit_disabled('home');
 		}
 		
 		site_project_header($params);




More information about the Fusionforge-commits mailing list