1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

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.
This commit is contained in:
Richard 2011-08-22 20:05:06 -03:00 committed by epriestley
parent 8690c66191
commit fbef90c4c6

View file

@ -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}");