-// WebIRC passwords enabled for this server
-conf.webirc_pass = {
- //"irc.network.com": "configured_webirc_password",
- //"127.0.0.1": "foobar"
-};
+// WebIRC password enabled for this server
+//conf.webirc_pass = "foobar";
+
+// Multiple WebIRC passwords may be used for multiple servers
+//conf.webirc_pass = {
+// "irc.network.com": "configured_webirc_password",
+// "127.0.0.1": "foobar"
+//};
// Some IRCDs require the clients IP via the username/ident
conf.ip_as_username = [
function findWebIrc(connect_data) {
var webirc_pass = global.config.webirc_pass,
ip_as_username = global.config.ip_as_username,
- tmp;
+ found_webirc_pass, tmp;
- // Do we have a WEBIRC password for this?
- if (webirc_pass && webirc_pass[this.irc_host.hostname]) {
+ // Do we have a single WEBIRC password?
+ if (typeof webirc_pass === 'string') {
+ found_webirc_pass = webirc_pass;
+
+ // Do we have a WEBIRC password for this hostname?
+ } else if (typeof webirc_pass === 'object' && webirc_pass[this.irc_host.hostname]) {
+ found_webirc_pass = webirc_pass[this.irc_host.hostname];
+ }
+
+ if (found_webirc_pass) {
// Build the WEBIRC line to be sent before IRC registration
tmp = 'WEBIRC ' + webirc_pass[this.irc_host.hostname] + ' KiwiIRC ';
tmp += this.user.hostname + ' ' + this.user.address;
connect_data.prepend_data = [tmp];
}
-
// Check if we need to pass the users IP as its username/ident
if (ip_as_username && ip_as_username.indexOf(this.irc_host.hostname) > -1) {
// Get a hex value of the clients IP