[Fusionforge-commits] r10618 - in trunk: src/common/include src/www/admin src/www/new src/www/news src/www/news/admin tests/code/deprecations
Franck VILLAUME
nerville at libremir.placard.fr.eu.org
Wed Sep 22 10:52:36 CEST 2010
Author: nerville
Date: 2010-09-22 10:52:35 +0200 (Wed, 22 Sep 2010)
New Revision: 10618
Modified:
trunk/src/common/include/RoleObserver.class.php
trunk/src/www/admin/globalroleedit.php
trunk/src/www/admin/useredit.php
trunk/src/www/new/index.php
trunk/src/www/news/admin/index.php
trunk/src/www/news/admin/news_admin_utils.php
trunk/src/www/news/index.php
trunk/src/www/news/news_utils.php
trunk/src/www/news/submit.php
trunk/tests/code/deprecations/DeprecationsTest.php
Log:
exit functions migration
Modified: trunk/src/common/include/RoleObserver.class.php
===================================================================
--- trunk/src/common/include/RoleObserver.class.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/common/include/RoleObserver.class.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -89,7 +89,7 @@
//
$res = db_query_params ('SELECT group_forum_id,is_public,allow_anonymous FROM forum_group_list WHERE group_id=$1',
array ($this->Group->getID())) ;
- while ($arr =& db_fetch_array($res)) {
+ while ($arr = db_fetch_array($res)) {
$this->setting_array['forumpublic'][$arr['group_forum_id']] = $arr['is_public'];
$this->setting_array['forumanon'][$arr['group_forum_id']] = $arr['allow_anonymous'];
}
@@ -99,7 +99,7 @@
//
$res = db_query_params ('SELECT group_project_id,is_public FROM project_group_list WHERE group_id=$1',
array ($this->Group->getID())) ;
- while ($arr =& db_fetch_array($res)) {
+ while ($arr = db_fetch_array($res)) {
$this->setting_array['pmpublic'][$arr['group_project_id']] = $arr['is_public'];
}
@@ -108,7 +108,7 @@
//
$res = db_query_params ('SELECT group_artifact_id,is_public,allow_anon FROM artifact_group_list WHERE group_id=$1',
array ($this->Group->getID())) ;
- while ($arr =& db_fetch_array($res)) {
+ while ($arr = db_fetch_array($res)) {
$this->setting_array['trackerpublic'][$arr['group_artifact_id']] = $arr['is_public'];
$this->setting_array['trackeranon'][$arr['group_artifact_id']] = $arr['allow_anon'];
}
@@ -118,7 +118,7 @@
//
$res = db_query_params ('SELECT package_id,is_public FROM frs_package WHERE group_id=$1',
array ($this->Group->getID())) ;
- while ($arr =& db_fetch_array($res)) {
+ while ($arr = db_fetch_array($res)) {
$this->setting_array['frspackage'][$arr['package_id']] = $arr['is_public'];
}
Modified: trunk/src/www/admin/globalroleedit.php
===================================================================
--- trunk/src/www/admin/globalroleedit.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/admin/globalroleedit.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -41,9 +41,9 @@
}
if (!$role || !is_object($role)) {
- exit_error('Error',_('Could Not Get Role'));
+ exit_error(_('Could Not Get Role'),'admin');
} elseif ($role->isError()) {
- exit_error('Error',$role->getErrorMessage());
+ exit_error($role->getErrorMessage(),'admin');
}
$old_data = $role->getGlobalSettings () ;
@@ -72,18 +72,18 @@
$role_name = $role->getName() ;
}
if (!$role_name) {
- $feedback .= ' Missing Role Name ';
+ $warning_msg .= ' Missing Role Name ';
} else {
if (!$role_id) {
$role_id=$role->create($role_name,$data);
if (!$role_id) {
- $feedback .= $role->getErrorMessage();
+ $error_msg .= $role->getErrorMessage();
} else {
$feedback = _('Successfully Created New Role');
}
} else {
if (!$role->update($role_name,$data)) {
- $feedback .= $role->getErrorMessage();
+ $error_msg .= $role->getErrorMessage();
} else {
$feedback = _('Successfully Updated Role');
}
Modified: trunk/src/www/admin/useredit.php
===================================================================
--- trunk/src/www/admin/useredit.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/admin/useredit.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -4,20 +4,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
*/
@@ -38,18 +38,15 @@
$user_id = getIntFromRequest('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'),'admin');
} elseif ($u->isError()) {
- exit_error('Error',$u->getErrorMessage());
+ exit_error($u->getErrorMessage(),'admin');
}
if (getStringFromRequest('delete_user') != '' && getStringFromRequest('confirm_delete') == '1') {
// delete user
if (!$u->delete(true)) {
- exit_error(
- _('Could Not Complete Operation'),
- $u->getErrorMessage()
- );
+ exit_error( _('Could Not Complete Operation: ').$u->getErrorMessage(),'admin');
} else {
$feedback = _('Deleted (D)').'<br />';
}
@@ -63,10 +60,7 @@
if (!$u->setEmail($email)
|| (forge_get_config('use_shell') && !$u->setShell($shell))
|| !$u->setStatus($status)) {
- exit_error(
- _('Could Not Complete Operation'),
- $u->getErrorMessage()
- );
+ exit_error( _('Could Not Complete Operation: ').$u->getErrorMessage(),'admin');
}
if ($u->getUnixStatus() != 'N') {
@@ -81,9 +75,9 @@
}
if ($u->isError()) {
- $feedback = $u->getErrorMessage();
+ $error_msg = $u->getErrorMessage();
} else {
- $feedback = _('Updated').'<br />';
+ $feedback = _('Updated');
}
}
Modified: trunk/src/www/new/index.php
===================================================================
--- trunk/src/www/new/index.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/new/index.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -1,13 +1,26 @@
<?php
/**
- *
- * SourceForge New Releases Page
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
+ * New Releases Page
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * 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';
Modified: trunk/src/www/news/admin/index.php
===================================================================
--- trunk/src/www/news/admin/index.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/news/admin/index.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -1,25 +1,25 @@
<?php
/**
- * GForge News Facility
+ * News Facility
*
* Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 2002-2004 (c) GForge Team
+ * 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
*/
@@ -40,7 +40,7 @@
$details = getStringFromRequest('details');
$id = getIntFromRequest('id');
-$feedback = '';
+$feedback = getStringFromRequest('feedback');
if ($group_id && $group_id != forge_get_config('news_group') && user_ismember($group_id,'A')) {
$status = getIntFromRequest('status');
@@ -84,7 +84,8 @@
details=$3 WHERE id=$4 AND group_id=$5", array($status, htmlspecialchars($summary), $details, $id, $group_id));
if (!$result || db_affected_rows($result) < 1) {
- $feedback .= _('Error On Update:');
+ $error_msg .= _('Error On Update:');
+ $error_msg .= db_error();
} else {
$feedback .= _('NewsByte Updated.');
// No notification if news is deleted.
@@ -108,7 +109,7 @@
$result=db_query_params("SELECT * FROM news_bytes WHERE id=$1 AND group_id=$2", array($id, $group_id));
if (db_numrows($result) < 1) {
- exit_error(_('Error'), _('NewsByte not found'));
+ exit_error(_('NewsByte not found'),'news');
}
$group =& group_get_object($group_id);
@@ -202,7 +203,7 @@
$result=db_query_params("UPDATE news_bytes SET is_approved='1', post_date=$1,
summary=$2, details=$3 WHERE id=$4", array(time(), htmlspecialchars($summary), $details, $id));
if (!$result || db_affected_rows($result) < 1) {
- $feedback .= _('Error On Update:');
+ $error_msg .= _('Error On Update:');
} else {
$feedback .= _('NewsByte Updated.');
}
@@ -212,8 +213,8 @@
*/
$result=db_query_params("UPDATE news_bytes SET is_approved='2' WHERE id=$1", array($id));
if (!$result || db_affected_rows($result) < 1) {
- $feedback .= _('Error On Update:');
- $feedback .= db_error();
+ $error_msg .= _('Error On Update:');
+ $error_msg .= db_error();
} else {
$feedback .= _('NewsByte Deleted.');
}
@@ -233,8 +234,8 @@
SET is_approved='2'
WHERE id = ANY($1)",array(db_int_array_to_any_clause($news_id)));
if (!$result || db_affected_rows($result) < 1) {
- $feedback .= _('Error On Update:');
- $feedback .= db_error();
+ $error_msg .= _('Error On Update:');
+ $error_msg .= db_error();
} else {
$feedback .= _('NewsBytes Rejected.');
}
@@ -252,10 +253,10 @@
FROM news_bytes,groups WHERE id=$1
AND news_bytes.group_id=groups.group_id ", array($id));
if (db_numrows($result) < 1) {
- exit_error(_('Error'), _('NewsByte not found'));
+ exit_error(_('NewsByte not found'),'news');
}
if (db_result($result,0,'is_approved') == 4) {
- exit_error(_('Error'), _('NewsByte deleted'));
+ exit_error(_('NewsByte deleted'),'news');
}
$group =& group_get_object(db_result($result,0,'group_id'));
@@ -342,7 +343,7 @@
} else {
- exit_error(_('Permission denied.'),sprintf(_('You have to be an admin on the project you are editing or a member of the %s News team.'), forge_get_config ('forge_name')));
+ exit_error(sprintf(_('You have to be an admin on the project you are editing or a member of the %s News team.'), forge_get_config ('forge_name')),'news');
}
Modified: trunk/src/www/news/admin/news_admin_utils.php
===================================================================
--- trunk/src/www/news/admin/news_admin_utils.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/news/admin/news_admin_utils.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -1,25 +1,25 @@
<?php
/**
- * GForge News Facility
+ * News Facility
*
* Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 2002-2004 (c) GForge Team
+ * 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
*/
Modified: trunk/src/www/news/index.php
===================================================================
--- trunk/src/www/news/index.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/news/index.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -1,25 +1,25 @@
<?php
/**
- * GForge News Facility
+ * News Facility
*
* Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 2002-2004 (c) GForge Team
+ * 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
*/
Modified: trunk/src/www/news/news_utils.php
===================================================================
--- trunk/src/www/news/news_utils.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/news/news_utils.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -1,38 +1,33 @@
<?php
/**
- * GForge News Facility
+ * News Facility
*
* Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 2002-2004 (c) GForge Team
+ * 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
*/
-/*
- News System
- By Tim Perdue, Sourceforge, 12/99
-*/
-
function news_header($params) {
global $HTML,$group_id,$news_name,$news_id;
if (!forge_get_config('use_news')) {
- exit_disabled();
+ exit_disabled('home');
}
$params['toptab']='news';
Modified: trunk/src/www/news/submit.php
===================================================================
--- trunk/src/www/news/submit.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/src/www/news/submit.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -8,20 +8,20 @@
*
* 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
*/
@@ -59,18 +59,18 @@
if (session_loggedin()) {
if (!user_ismember($group_id,'A')) {
- exit_permission_denied(_('You cannot submit news for a project unless you are an admin on that project'));
+ exit_permission_denied(_('You cannot submit news for a project unless you are an admin on that project'),'home');
}
$group_id = getIntFromRequest('group_id');
if ($group_id == forge_get_config('news_group')) {
- exit_permission_denied(_('Submitting news from the news group is not allowed.'));
+ exit_permission_denied(_('Submitting news from the news group is not allowed.'),'home');
}
if (getStringFromRequest('post_changes')) {
if (!form_key_is_valid(getStringFromRequest('form_key'))) {
- exit_form_double_submit();
+ exit_form_double_submit('news');
}
$summary = getStringFromRequest('summary');
$details = getStringFromRequest('details');
@@ -94,7 +94,7 @@
$f=new Forum(group_get_object(forge_get_config('news_group')));
if (!$f->create(ereg_replace('[^_\.0-9a-z-]','-', strtolower($summary)),$details,1,'',0,0)) {
db_rollback();
- exit_error('Error',$f->getErrorMessage());
+ exit_error($f->getErrorMessage(),'news');
}
$new_id=$f->getID();
$sql='INSERT INTO news_bytes (group_id,submitted_by,is_approved,post_date,forum_id,summary,details)
@@ -104,14 +104,14 @@
if (!$result) {
db_rollback();
form_release_key(getStringFromRequest('form_key'));
- $error_msg = ' '._('ERROR doing insert').' ';
+ $error_msg = _('ERROR doing insert');
} else {
db_commit();
- $feedback = ' '._('News Added.').' ';
+ $feedback = _('News Added.');
}
} else {
form_release_key(getStringFromRequest('form_key'));
- $error_msg = ' '._('ERROR - both subject and body are required').' ';
+ $error_msg = _('ERROR - both subject and body are required');
}
}
@@ -156,8 +156,8 @@
echo '<textarea name="details" rows="5" cols="50"></textarea><br />';
}
unset($GLOBALS['editor_was_set_up']);
- echo '<input type="submit" name="submit" value="'._('Submit').'" />
- </p></form>';
+ echo '<div><input type="submit" name="submit" value="'._('Submit').'" />
+ </div></form>';
news_footer(array());
Modified: trunk/tests/code/deprecations/DeprecationsTest.php
===================================================================
--- trunk/tests/code/deprecations/DeprecationsTest.php 2010-09-22 08:52:27 UTC (rev 10617)
+++ trunk/tests/code/deprecations/DeprecationsTest.php 2010-09-22 08:52:35 UTC (rev 10618)
@@ -121,6 +121,8 @@
'sys_share_path',
'sys_var_path',
'sys_etc_path',
+ 'GForge',
+ 'gforge.org',
) ;
$pattern = implode ('|', $vars) ;
More information about the Fusionforge-commits
mailing list