]>
Commit | Line | Data |
---|---|---|
b147e8c8 | 1 | --- eventum-1.6.1/misc/irc/bot.php.orig 2005-09-17 17:28:04.000000000 +0300 |
33a6b04f | 2 | +++ eventum-1.6.1/misc/irc/bot.php 2005-09-17 17:49:09.000000000 +0300 |
b147e8c8 ER |
3 | @@ -38,22 +39,19 @@ |
4 | ||
5 | ini_set("memory_limit", "256M"); | |
6 | ||
7 | +// compat with earlier releases where didn't have array -glen | |
8 | +if (empty($irc_channels)) { | |
9 | + $irc_channels = array(); | |
10 | + $irc_channels[$irc_default_project] = $irc_default_channel; | |
11 | +} | |
12 | + | |
1105b2cd ER |
13 | // the following is the list of IRC channels that the bot should connect to, |
14 | // and the associated project name | |
b147e8c8 | 15 | -$channels = array( |
622e4f4b | 16 | - Project::getID('Default Project') => array( |
1105b2cd | 17 | - '#issues', |
b147e8c8 ER |
18 | - ) |
19 | -); | |
20 | -$irc_server_hostname = 'localhost'; | |
21 | -$irc_server_port = 6667; | |
22 | -$nickname = 'EventumBOT'; | |
23 | -$realname = 'Eventum Issue Tracking System'; | |
24 | -// do you need a username/password to connect to this server? if | |
25 | -// so, fill in the next two variables | |
26 | -$username = ''; | |
27 | -$password = ''; | |
28 | - | |
29 | +$channels = array(); | |
30 | +foreach ($irc_channels as $proj => $chan) { | |
31 | + $proj_id = Project::getID($proj); | |
a9085278 | 32 | + $channels[$proj_id] = is_array($chan) ? $chan : array($chan); |
b147e8c8 | 33 | +} |
3955d156 | 34 | |
1105b2cd ER |
35 | // ============================================ |
36 | // ============================================ | |
b147e8c8 ER |
37 | @@ -269,7 +267,7 @@ |
38 | function _getChannels($prj_id) | |
39 | { | |
40 | global $channels; | |
41 | - return $channels[$prj_id]; | |
42 | + return @$channels[$prj_id]; | |
43 | } | |
44 | ||
45 | ||
33a6b04f ER |
46 | @@ -410,14 +408,16 @@ |
47 | $irc->registerActionhandler(SMARTIRC_TYPE_QUERY, '^!?list-quarantined', $bot, 'listQuarantinedIssues'); | |
48 | ||
49 | $irc->connect($irc_server_hostname, $irc_server_port); | |
50 | -if (!empty($username)) { | |
51 | - $irc->login($nickname, $realname, 0, $username, $password); | |
52 | -} else { | |
53 | +if (empty($username)) { | |
54 | $irc->login($nickname, $realname); | |
cf8be08a | 55 | +} elseif (empty($password)) { |
33a6b04f ER |
56 | + $irc->login($nickname, $realname, 0, $username); |
57 | +} else { | |
58 | + $irc->login($nickname, $realname, 0, $username, $password); | |
59 | } | |
60 | $irc->listen(); | |
61 | $irc->disconnect(); | |
62 | ||
63 | // release the lock | |
64 | Lock::release('irc_bot'); | |
65 | -?> | |
66 | \ No newline at end of file | |
67 | +?> | |
a9085278 ER |
68 | --- eventum-1.7.0/misc/irc/bot.php~ 2005-12-30 00:22:37.000000000 +0200 |
69 | +++ eventum-1.7.0/misc/irc/bot.php 2005-12-30 00:23:17.000000000 +0200 | |
70 | @@ -31,6 +31,7 @@ | |
71 | ini_set("memory_limit", "256M"); | |
72 | ||
5cc1b37a ER |
73 | require_once("../../config.inc.php"); |
74 | +require_once('/etc/eventum/irc.php'); | |
75 | require_once(APP_INC_PATH . "db_access.php"); | |
76 | require_once(APP_INC_PATH . "class.auth.php"); | |
77 | require_once(APP_INC_PATH . "class.lock.php"); |