From fbef90c4c6455f54ec482f44eae4e9ee8b1a3d07 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 22 Aug 2011 20:05:06 -0300 Subject: [PATCH] Added the ability to support Irc Bots that need to login into private IRC Servers. Requires the following to be added to the config.json file "user":"authenticationusername", "pass":"thisuserspassowrd", This will allow people with internal irc servers to use this if they control access from ldap for irc. --- src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php b/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php index fcd4a16900..e29d604b08 100644 --- a/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php +++ b/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php @@ -53,8 +53,9 @@ final class PhabricatorIRCBot extends PhabricatorDaemon { $port = idx($config, 'port', 6667); $join = idx($config, 'join', array()); $handlers = idx($config, 'handlers', array()); - + $pass = idx($config, 'pass'); $nick = idx($config, 'nick', 'phabot'); + $user = idx($config, 'user', $nick); if (!preg_match('/^[A-Za-z0-9_`[{}^|\]\\-]+$/', $nick)) { throw new Exception( @@ -101,8 +102,11 @@ final class PhabricatorIRCBot extends PhabricatorDaemon { } $this->socket = $socket; + $this->writeCommand('USER', "{$user} 0 * :{$user}"); + if ($pass) { + $this->writeCommand('PASS', "{$pass}"); + } - $this->writeCommand('USER', "{$nick} 0 * :{$nick}"); $this->writeCommand('NICK', "{$nick}"); foreach ($join as $channel) { $this->writeCommand('JOIN', "{$channel}");