/usr/share/gforge/db/20040826_migrateforum.php is in gforge-db-postgresql 5.1.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | #! /usr/bin/php
<?php
/**
* GForge Forum Renamer - forum names are now unix-format for email gateway
*
* Copyright 2004 GForge, LLC
* 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 this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once dirname(__FILE__).'/../www/env.inc.php';
require_once $gfcommon.'include/pre.php';
//
// Convert forum names to new legal syntax
//
db_begin();
$res=db_query_params ('SELECT group_forum_id,forum_name FROM forum_group_list',
array()) ;
if (!$res) {
echo db_error();
db_rollback();
exit();
}
for ($i=0; $i<db_numrows($res); $i++) {
$res2 = db_query_params ('UPDATE forum_group_list SET forum_name=$1 WHERE group_forum_id=$2',
array (ereg_replace('[^_\.0-9a-z-]','-', strtolower(db_result($res,$i,'forum_name'))),
db_result($res,$i,'group_forum_id'))) ;
if (!$res2) {
echo db_error();
db_rollback();
exit();
}
}
//
// Long-standing oddity in GForge -
// forums were ZERO-pen Discussion, not Oh-pen Discussion
//
$res = db_query_params ('UPDATE forum_group_list SET forum_name=$1
WHERE forum_name=$2',
array('open-discussion',
'0pen-discussion')) ;
if (!$res) {
echo db_error();
db_rollback();
exit();
}
db_commit();
echo "SUCCESS\n";
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
?>
|