[evolvis-commits] r15804: exit function migration

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Mar 1 00:30:46 CET 2011


Author: mirabilos
Date: 2011-03-01 00:30:46 +0100 (Tue, 01 Mar 2011)
New Revision: 15804

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/www/wikiadmin.php
   trunk/gforge_base/evolvisforge-5.1/src/www/account/editsshkeys.php
   trunk/gforge_base/evolvisforge-5.1/src/www/account/index.php
   trunk/gforge_base/evolvisforge-5.1/src/www/account/lostlogin.php
   trunk/gforge_base/evolvisforge-5.1/src/www/account/unsubscribe.php
Log:
exit function migration

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/www/wikiadmin.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/www/wikiadmin.php	2011-02-28 23:30:43 UTC (rev 15803)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/www/wikiadmin.php	2011-02-28 23:30:46 UTC (rev 15804)
@@ -74,9 +74,9 @@
 $config = getArrayFromRequest('config');
 
 if (!$type) {
-    exit_missing_params($_SERVER['HTTP_REFERER'],array(_'No TYPE specified'),'home');
+    exit_missing_params($_SERVER['HTTP_REFERER'],array(_('No TYPE specified')),'home');
 } elseif (!$id) {
-    exit_missing_params($_SERVER['HTTP_REFERER'],array(_'No ID specified'),'home');
+    exit_missing_params($_SERVER['HTTP_REFERER'],array(_('No ID specified')),'home');
 } else {
     if ($type == 'admin_post') {
         $group = group_get_object($id);

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/account/editsshkeys.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/account/editsshkeys.php	2011-02-28 23:30:43 UTC (rev 15803)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/account/editsshkeys.php	2011-02-28 23:30:46 UTC (rev 15804)
@@ -3,21 +3,22 @@
  * Change user's SSH authorized keys
  *
  * 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
  */
 
@@ -29,7 +30,7 @@
  * Simple function that tries to check the validity of public ssh keys with a regexp.
  * Exits with an error message if an invalid key is found.
  *
- * \param keys A string with a set of keys to check. Each key is delimited by a carriage return.
+ * @param keys A string with a set of keys to check. Each key is delimited by a carriage return.
  */
 function checkKeys($keys) {
 	$key = strtok($keys,"\n");
@@ -43,7 +44,7 @@
 			if ( preg_match("@^ssh-(rsa|dss)\s+[A-Za-z0-9+/]{157,}={0,2}(\s+.*)?$@", $key) === 0 ) { // Warning: we must use === for the test
 				$msg = sprintf (_('The following key has a wrong format: |%s|.  Please, correct it by going back to the previous page.'),
 						htmlspecialchars($key));
-				exit_error('Error',  $msg);
+				exit_error($msg,'my');
 			}
 		}
 		$key = strtok("\n");
@@ -54,9 +55,9 @@
 
 $u =& user_get_object(user_getid());
 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')) {
@@ -64,10 +65,7 @@
 	checkKeys ($authorized_keys);
 
 	if (!$u->setAuthorizedKeys($authorized_keys)) {
-		exit_error(
-			'Error',
-			'Could not update SSH authorized keys: '.db_error()
-		);
+		exit_error(sprintf(_('Could not update SSH authorized keys: %s'),db_error()),'my');
 	}
 	session_redirect("/account/");
 

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/account/index.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/account/index.php	2011-02-28 23:30:43 UTC (rev 15803)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/account/index.php	2011-02-28 23:30:46 UTC (rev 15804)
@@ -3,21 +3,22 @@
  * User account main page - show settings with means to change them
  *
  * 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
  */
 
@@ -26,6 +27,7 @@
 require_once $gfcommon.'include/timezones.php';
 
 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
+$error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
 
 session_require_login () ;
 
@@ -77,15 +79,16 @@
 	if (!$u->update($firstname, $lastname, $language, $timezone, $mail_site, $mail_va, $use_ratings,
 		$jabber_address,$jabber_only,$theme_id,$address,$address2,$phone,$fax,$title,$ccode)) {
 		form_release_key(getStringFromRequest('form_key'));
-		$feedback = $u->getErrorMessage();
+		$error_msg = $u->getErrorMessage();
+		$refresh_url = '/account/?error_msg='.urlencode($error_msg)
 	} else {
 		$feedback = _('Updated');
+		$refresh_url = '/account/?feedback='.urlencode($feedback);
 	}
 
 	if ($refresh) {
-		session_redirect("/account/?feedback=".urlencode($feedback));
+		session_redirect($refresh_url);
 	}
-
 }
 
 site_user_header(array('title'=>_('Account Maintenance')));

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/account/lostlogin.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/account/lostlogin.php	2011-02-28 23:30:43 UTC (rev 15803)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/account/lostlogin.php	2011-02-28 23:30:46 UTC (rev 15804)
@@ -50,7 +50,6 @@
 }
 if (db_numrows($res_user) < 1) {
 	exit_error(_('Invalid confirmation hash'),'my');
-	);
 }
 $u =& user_get_object(db_result($res_user, 0, 'user_id'), $res_user);
 if (!$u || !is_object($u)) {

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/account/unsubscribe.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/account/unsubscribe.php	2011-02-28 23:30:43 UTC (rev 15803)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/account/unsubscribe.php	2011-02-28 23:30:46 UTC (rev 15804)
@@ -5,21 +5,22 @@
  * This page is accessed via URL present in site mailings
  *
  * 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,7 +35,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,18 +44,18 @@
 			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');
 }
 
 $row_user = db_fetch_array($res_user);
 $user =& user_get_object($row_user['user_id'], $res_user);
 if (!$user || !is_object($user)) {
-    exit_error('Error','Could Not Get User');
+    exit_error(_('Could Not Get User'),'home');
 } elseif ($user->isError()) {
-    exit_error('Error',$user->getErrorMessage());
+    exit_error($user->getErrorMessage(),'my');
 }
 
 $all=getStringFromRequest('all');



More information about the evolvis-commits mailing list