$prot = Common::substrUntil($host, '://'); $ssl = $prot === 'ircs' ? true : false; $host = Common::substrFrom($host, '://', $host); $server->saveVars(array('serv_host' => $host, 'serv_port' => $port)); $server->saveOption(Dog_Server::SSL, $ssl); } # Copy Nicknames + passwords from config global $LAMB_CFG; $nicks = GDO::table('Dog_Nick'); $nicks->createTable(true); GDO::table('Dog_Channel')->update('chan_options=0x02'); foreach ($LAMB_CFG['servers'] as $srv) { $nickname = $srv['nickname']; $nickname = Common::substrUntil($nickname, ',', $nickname); $password = $srv['password']; if (false === ($server = Dog_Server::getByTLD(Common::getDomain($srv['host'])))) { die('OUCH!'); } $nicks->insertAssoc(array('nick_sid' => $server->getID(), 'nick_name' => $nickname, 'nick_pass' => $password)); if (isset($srv['options'])) { $server->saveOption(Dog_Server::BNC); } $co = Dog_Channel::DEFAULT_OPTIONS; foreach (explode(',', $srv['channels']) as $chan_name) { GDO::table('Dog_Channel')->update("chan_options={$co}", "chan_sid={$server->getID()} AND chan_name='{$chan_name}'"); } } foreach ($servers->selectAll('*', '', '', NULL, -1, -1, GDO::ARRAY_O) as $server) { $server instanceof Dog_Server; if (false === $nicks->selectVar('1', 'nick_sid=' . $server->getID())) { $nicks->insertAssoc(array('nick_sid' => $server->getID(), 'nick_name' => 'Lamb3', 'nick_pass' => 'lamblamb'));
public static function initTimersDirServer($entry, $fullpath, $null = NULL) { if (false !== ($server = Dog_Server::getByTLD($entry))) { if (false !== ($server = Dog::getServerByID($server->getID()))) { GWF_File::filewalker($fullpath, true, array(__CLASS__, 'initTimersDir'), false, $server); } else { Dog_Log::debug(sprintf("Server %d-%s for Timer in path \"%s\" is not Online.", $serverid, $entry, $fullpath)); } } else { Dog_Log::debug(sprintf('Timer in path "%s" could not find it\'s server: %s.', $fullpath, $entry)); } }