[Fusionforge-commits] r10545 - in trunk/src: common/include plugins/blocks/www plugins/extratabs/www plugins/mantisbt/www plugins/quota_management/www plugins/wiki/www www/account www/project

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Sun Sep 19 12:18:52 CEST 2010


Author: nerville
Date: 2010-09-19 12:18:52 +0200 (Sun, 19 Sep 2010)
New Revision: 10545

Modified:
   trunk/src/common/include/squal_exit.php
   trunk/src/plugins/blocks/www/index.php
   trunk/src/plugins/extratabs/www/index.php
   trunk/src/plugins/mantisbt/www/index.php
   trunk/src/plugins/quota_management/www/index.php
   trunk/src/plugins/wiki/www/wikiadmin.php
   trunk/src/www/account/change_email-complete.php
   trunk/src/www/account/change_email.php
   trunk/src/www/account/lostlogin.php
   trunk/src/www/account/lostpw.php
   trunk/src/www/account/pending-resend.php
   trunk/src/www/account/verify.php
   trunk/src/www/project/index.php
Log:
exit function migration

Modified: trunk/src/common/include/squal_exit.php
===================================================================
--- trunk/src/common/include/squal_exit.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/common/include/squal_exit.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -63,7 +63,7 @@
  * @param   array   array of missing parameters
  * @param   string  toptab needed for navigation
  */
-function exit_missing_param(($url='',$missing_params=array(),$toptab='') {
+function exit_missing_param($url='',$missing_params=array(),$toptab='') {
 	exit_error('MISSING REQUIRED PARAMETERS');
 }
 

Modified: trunk/src/plugins/blocks/www/index.php
===================================================================
--- trunk/src/plugins/blocks/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/plugins/blocks/www/index.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -146,7 +146,7 @@
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user) ) {|| $user->isError() || !$user->isActive()) {
+if (!$user || !is_object($user) ) {
 	exit_error(_('Invalid User'),'home');
 } else if ( $user->isError() ) {
 	exit_error($user->getErrorMessage(),'home');

Modified: trunk/src/plugins/extratabs/www/index.php
===================================================================
--- trunk/src/plugins/extratabs/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/plugins/extratabs/www/index.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -42,7 +42,7 @@
 if (!$group || !is_object($group)) {
 	exit_no_group();
 } elseif ($group->isError()) {
-	exit_error($group->getErrorMessage(),'home')
+	exit_error($group->getErrorMessage(),'home');
 }
 
 db_begin();

Modified: trunk/src/plugins/mantisbt/www/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/plugins/mantisbt/www/index.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -56,7 +56,7 @@
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user)) { || $user->isError() || !$user->isActive()) {
+if (!$user || !is_object($user)) {
 	exit_error(_('Invalid User'),'home');
 } else if ( $user->isError()) {
 	exit_error($user->isError(),'home');

Modified: trunk/src/plugins/quota_management/www/index.php
===================================================================
--- trunk/src/plugins/quota_management/www/index.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/plugins/quota_management/www/index.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -47,7 +47,7 @@
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user)) { || $user->isError() || !$user->isActive()) {
+if (!$user || !is_object($user)) {
 	exit_error(_('Invalid User'),'home');
 } else if ( $user->isError() ) {
 	exit_error($user->getErrorMessage,'home');

Modified: trunk/src/plugins/wiki/www/wikiadmin.php
===================================================================
--- trunk/src/plugins/wiki/www/wikiadmin.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/plugins/wiki/www/wikiadmin.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -60,7 +60,7 @@
 
 $user = session_get_user(); // get the session user
 
-if (!$user || !is_object($user)) { || $user->isError() || !$user->isActive()) {
+if (!$user || !is_object($user)) {
     exit_error(_('Invalid User'),'home');
 } else if ( $user->isError()) {
 	exit_error($user->getErrorMessage(),'home');

Modified: trunk/src/www/account/change_email-complete.php
===================================================================
--- trunk/src/www/account/change_email-complete.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/www/account/change_email-complete.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -5,21 +5,22 @@
  * This page should be accessed with confirmation URL sent to user in email
  *
  * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c) 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  USA
  */
 
@@ -35,7 +36,7 @@
 	$confirm_hash = getStringFromRequest('ch');
 }
 if (!$confirm_hash) {
-	exit_missing_param();
+	exit_missing_param('',array(_('Confirm Hash')),'my');
 }
 $confirm_hash = html_clean_hash_string($confirm_hash);
 
@@ -43,23 +44,20 @@
 			array($confirm_hash)) ;
 
 if (db_numrows($res_user) > 1) {
-	exit_error("Error","This confirm hash exists more than once.");
+	exit_error(_('This confirm hash exists more than once.'),'my');
 }
 if (db_numrows($res_user) < 1) {
-	exit_error("Error","Invalid confirmation hash.");
+	exit_error(_('Invalid confirmation hash.'),'my');
 }
 $u =& user_get_object(db_result($res_user, 0, 'user_id'), $res_user);
 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(),'my');
 }
 
 if (!$u->setEmail($u->getNewEmail())) {
-	exit_error(
-		'Could Not Complete Operation',
-		$u->getErrorMessage()
-	);
+	exit_error($u->getErrorMessage(),'my');
 }
 //plugin webcal change user mail
 	else {

Modified: trunk/src/www/account/change_email.php
===================================================================
--- trunk/src/www/account/change_email.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/www/account/change_email.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -3,21 +3,22 @@
  * Change user's email page
  *
  * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c) 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  USA
  */
 
@@ -28,14 +29,14 @@
 
 if (getStringFromRequest('submit')) {
 	if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-		exit_form_double_submit();
+		exit_form_double_submit('my');
 	}
 
 	$newemail = getStringFromRequest('newemail');
 
 	if (!validate_email($newemail)) {
 		form_release_key(getStringFromRequest('form_key'));
-		exit_error(_('Error'),_('Invalid email address.'));
+		exit_error(_('Invalid email address.'),'my');
 	}
 
 	$confirm_hash = substr(md5($GLOBALS['session_ser'] . time()),0,16);
@@ -43,18 +44,15 @@
 	$u =& user_get_object(user_getid());
 	if (!$u || !is_object($u)) {
    		form_release_key(getStringFromRequest('form_key'));
-   		exit_error('Error','Could Not Get User');
+   		exit_error(_('Could Not Get User'),'my');
 	} elseif ($u->isError()) {
 		form_release_key(getStringFromRequest('form_key'));
-		exit_error('Error',$u->getErrorMessage());
+		exit_error($u->getErrorMessage(),'my');
 	}
 
 	if (!$u->setNewEmailAndHash($newemail, $confirm_hash)) {
 		form_release_key(getStringFromRequest('form_key'));
-		exit_error(
-			'Could Not Complete Operation',
-			$u->getErrorMessage()
-		);
+		exit_error($u->getErrorMessage(),'my');
 	}
 
 	$message = sprintf(_('You have requested a change of email address on %1$s.

Modified: trunk/src/www/account/lostlogin.php
===================================================================
--- trunk/src/www/account/lostlogin.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/www/account/lostlogin.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -5,21 +5,22 @@
  * This page is accessed via confirmation URL in email
  *
  * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c) 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  USA
  */
 
@@ -36,7 +37,7 @@
 	$confirm_hash = getStringFromRequest('ch');
 }
 if (!$confirm_hash) {
-	exit_missing_param();
+	exit_missing_param('',array(_('Confirm Has')),'my');
 }
 // Remove noise from hash produced by buggy mail clients
 $confirm_hash = html_clean_hash_string($confirm_hash);
@@ -45,38 +46,27 @@
 			array($confirm_hash)) ;
 
 if (db_numrows($res_user) > 1) {
-	exit_error(
-		_('ERROR'),
-		_('This confirm hash exists more than once.')
-	);
+	exit_error(_('This confirm hash exists more than once.'),'my');
 }
 if (db_numrows($res_user) < 1) {
-	exit_error(
-		_('ERROR'),
-		_('Invalid confirmation hash')
+	exit_error(_('Invalid confirmation hash'),'my');
 	);
 }
 $u =& user_get_object(db_result($res_user, 0, 'user_id'), $res_user);
 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(),'my');
 }
 
 if (getStringFromRequest("submit")) {
 
 	if (strlen($passwd)<6) {
-		exit_error(
-			_('ERROR'),
-			_('You must supply valid password (at least 6 chars).')
-		);
+		exit_error(_('You must supply valid password (at least 6 chars).'),'my');
 	}
 
 	if ($passwd != $passwd2) {
-		exit_error(
-			_('ERROR'),
-			_('New passwords do not match.')
-		);
+		exit_error(_('New passwords do not match.'),'my');
 	}
 
 	if ($u->setPasswd($passwd)) {
@@ -91,7 +81,7 @@
 		exit();
 	}
 
-	$feedback = _('ERROR').': '.$u->getErrorMessage();
+	$error_msg = _('ERROR').': '.$u->getErrorMessage();
 }
 
 $title = _("Lost Password Login") ;

Modified: trunk/src/www/account/lostpw.php
===================================================================
--- trunk/src/www/account/lostpw.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/www/account/lostpw.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -6,23 +6,24 @@
  * for account.
  *
  * 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) 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
  */
 
@@ -32,7 +33,7 @@
 
 if (getStringFromRequest('submit')) {
 	if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-		exit_form_double_submit();
+		exit_form_double_submit('my');
 	}
 
 	$loginname = getStringFromRequest('loginname');
@@ -41,7 +42,7 @@
 
 	if (!$u || !is_object($u)){
 		form_release_key(getStringFromRequest('form_key'));
-		exit_error(_('Invalid user'),_('That user does not exist.'));
+		exit_error(_('That user does not exist.'),'my');
 	}
 
 	// First, we need to create new confirm hash
@@ -51,7 +52,7 @@
 	$u->setNewEmailAndHash($u->getEmail(), $confirm_hash);
 	if ($u->isError()) {
 		form_release_key(getStringFromRequest('form_key'));
-		exit_error('Error',$u->getErrorMessage());
+		exit_error($u->getErrorMessage(),'my');
 	} else {
 
 		$message = sprintf(_('Someone (presumably you) on the %1$s site requested a

Modified: trunk/src/www/account/pending-resend.php
===================================================================
--- trunk/src/www/account/pending-resend.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/www/account/pending-resend.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -3,21 +3,22 @@
  * Resend account activation email with confirmation URL
  *
  * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c), 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  USA
  */
 
@@ -32,16 +33,13 @@
 		$u = user_get_object_by_email ($loginname);
 	}
 	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->getStatus() != 'P') {
-		exit_error(
-			'Invalid action',
-			'Your account is already active.'
-		);
+		exit_error(_('Your account is already active.'),'my');
 	}
 	$u->sendRegistrationEmail();
 	$HTML->header(array('title'=>"Account Pending Verification"));

Modified: trunk/src/www/account/verify.php
===================================================================
--- trunk/src/www/account/verify.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/www/account/verify.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -6,21 +6,22 @@
  * email.
  *
  * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c) 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  USA
  */
 
@@ -34,10 +35,7 @@
 	$passwd = getStringFromRequest('passwd');
 
 	if (!$loginname) {
-		exit_error(
-			_('Missing paramater'),
-			_('You must enter a user name.')
-		);
+		exit_missing_param('',array(_('UserName')),'my');
 	}
 
 	$u = user_get_object_by_name($loginname);
@@ -45,39 +43,27 @@
 		$u = user_get_object_by_email ($loginname);
 	}
 	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(),'my');
 	}
 
 	if ($u->getStatus()=='A'){
-		exit_error(
-			_('Invalid operation'),
-			_('Account already active.')
-		);
+		exit_error(_('Account already active.'),'my');
 	}
 
 	$confirm_hash = html_clean_hash_string($confirm_hash);
 
 	if ($confirm_hash != $u->getConfirmHash()) {
-		exit_error(
-			_('Invalid parameter'),
-			_('Cannot confirm account identity - invalid confirmation hash (or login name)')
-		);
+		exit_error(_('Cannot confirm account identity - invalid confirmation hash (or login name)'),'my');
 	}
 
 	if (!session_login_valid($loginname, $passwd, 1)) {
-		exit_error(
-			_('Access denied'),
-			_('Credentials you entered do not correspond to valid account.')
-		);
+		exit_permission_denied(_('Credentials you entered do not correspond to valid account.'),'my');
 	}
 
 	if (!$u->setStatus('A')) {
-		exit_error(
-			_('Could not activate account'),
-			_('Error while activiting account').': '.$u->getErrorMessage()
-		);
+		exit_error( _('Error while activiting account').': '.$u->getErrorMessage(),'my');
 	}
 
 	session_redirect("/account/first.php");

Modified: trunk/src/www/project/index.php
===================================================================
--- trunk/src/www/project/index.php	2010-09-19 09:53:04 UTC (rev 10544)
+++ trunk/src/www/project/index.php	2010-09-19 10:18:52 UTC (rev 10545)
@@ -33,7 +33,7 @@
 }
 
 if (!$group_id) {
-	exit_error(_('Error'),_('Missing Project Argument : A project must be specified for this page.'));
+	exit_missing_param('',array(_('A project must be specified for this page.')),'');
 }
 
 if (isset ($sys_noforcetype) && $sys_noforcetype) {




More information about the Fusionforge-commits mailing list