1 --- eventum-1.6.1/misc/irc/bot.php.orig 2005-09-17 17:28:04.000000000 +0300
2 +++ eventum-1.6.1/misc/irc/bot.php 2005-09-17 17:49:09.000000000 +0300
7 +require_once('/etc/webapps/eventum/core.php');
8 +include_once('/etc/webapps/eventum/irc.php');
10 -include_once("../../config.inc.php");
11 include_once(APP_INC_PATH . "db_access.php");
12 include_once(APP_INC_PATH . "class.auth.php");
13 include_once(APP_INC_PATH . "class.lock.php");
16 ini_set("memory_limit", "256M");
18 +// compat with earlier releases where didn't have array -glen
19 +if (empty($irc_channels)) {
20 + $irc_channels = array();
21 + $irc_channels[$irc_default_project] = $irc_default_channel;
24 // the following is the list of IRC channels that the bot should connect to,
25 // and the associated project name
27 - Project::getID('Default Project') => array(
31 -$irc_server_hostname = 'localhost';
32 -$irc_server_port = 6667;
33 -$nickname = 'EventumBOT';
34 -$realname = 'Eventum Issue Tracking System';
35 -// do you need a username/password to connect to this server? if
36 -// so, fill in the next two variables
41 +foreach ($irc_channels as $proj => $chan) {
42 + $proj_id = Project::getID($proj);
43 + $channels[$proj_id] = $chan;
46 // ============================================
47 // ============================================
49 function _getChannels($prj_id)
52 - return $channels[$prj_id];
53 + return @$channels[$prj_id];
58 $irc->registerActionhandler(SMARTIRC_TYPE_QUERY, '^!?list-quarantined', $bot, 'listQuarantinedIssues');
60 $irc->connect($irc_server_hostname, $irc_server_port);
61 -if (!empty($username)) {
62 - $irc->login($nickname, $realname, 0, $username, $password);
64 +if (empty($username)) {
65 $irc->login($nickname, $realname);
66 +} elseif (empty($password)) {
67 + $irc->login($nickname, $realname, 0, $username);
69 + $irc->login($nickname, $realname, 0, $username, $password);
75 Lock::release('irc_bot');
77 \ No newline at end of file