* Copyright 2002-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.
+ * 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 Licence, 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
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require dirname(__FILE__).'/../../www/env.inc.php';
require_once $gfcommon.'include/pre.php';
require $gfcommon.'include/cron_utils.php';
-define('FILE_EXTENSION','.new'); // use .new when testing
+//define('FILE_EXTENSION','.new'); // use .new when testing
+define('FILE_EXTENSION',''); // use .new when testing
/*
$path_to_cronjobs = dirname(dirname(__FILE__));
// You should also modify this to the correct PHP path and extra configuration (if needed)
-$php_command = "/usr/bin/php -d include_path=".ini_get("include_path");
+$php_command = '/usr/bin/php';
$aliases_orig = file("/etc/aliases");
$i++;
$line = trim($aliases_orig[$i]);
} while ($i < count($aliases_orig) && !preg_match("/^[[:blank:]]*#GFORGEEND/", $line));
-
+
// Got to end of file (shouldn't happen, means #GFORGEEND wasn't found on file
if ($i >= (count($aliases_orig)-1)) break;
-
+
// read next line
$i++;
$line = trim($aliases_orig[$i]);
}
-
+
// empty line or comment
if (empty($line) || preg_match('/^#/', $line)) continue;
-
+
list($alias_name, $alias) = explode(':', $line, 2);
$alias_name = trim($alias_name);
$alias = trim($alias);
array ('A'));
for ($forres=0; $forres<db_numrows($resforum); $forres++) {
$forname=strtolower(db_result($resforum,$forres,'unix_group_name').'-'.strtolower(db_result($resforum,$forres,'forum_name')));
-
+
if (array_key_exists($forname, $aliases)) {
// A GForge alias was found outside the markers
unset($aliases[$forname]);
}
-
+
$gforge_aliases[$forname] = '"|'.$php_command." ".$path_to_cronjobs."/forum_gateway.php ".db_result($resforum,$forres,'unix_group_name')." ".strtolower(db_result($resforum,$forres,'forum_name')).'"';
}
}
// first we remove non-alphanumeric characters (spaces and other stuff)
$formatted_tracker_name = preg_replace('/[^[:alnum:]]/','',db_result($restracker,$forres,'tracker_name'));
$formatted_tracker_name = strtolower($formatted_tracker_name);
-
+
$trackername=strtolower(db_result($restracker,$forres,'unix_group_name'))."-".$formatted_tracker_name;
// enclose tracker name with quotes if it has whitespaces
if (strpos($trackername, ' ') !== false) {
$trackername = '"'.$trackername.'"';
}
-
+
if (array_key_exists($trackername, $aliases)) {
// A GForge alias was found outside the markers
unset($aliases[$trackername]);
}
-
+
$gforge_aliases[$trackername] = '"|'.$php_command." ".$path_to_cronjobs."/tracker_gateway.php ".db_result($restracker,$forres,'unix_group_name')." ".strtolower(db_result($restracker,$forres,'group_artifact_id')).'"';
}
}
$mailmanlines = explode("\n",$mailmancontents);
for ($k = 0; $k < count($mailmanlines); $k++) {
$mailmanline = explode(":",$mailmanlines[$k], 2);
-
+
$alias = trim($mailmanline[0]);
if (empty($alias)) continue;
$command = trim($mailmanline[1]);
-
+
if (array_key_exists($alias, $aliases)) {
// A GForge alias was found outside the markers
unset($aliases[$alias]);
}
-
+
$gforge_aliases[$alias] = $command;
}
- $err .= "\n$k Mailman Lines";
+ $err .= "$k Mailman Lines\n";
fclose($h2);
}
// A GForge alias was found outside the markers
unset($aliases[$user]);
}
-
+
$gforge_aliases[$user] = $email;
}
$err .= $ok;
cron_entry(17,$err);
-
-?>