public static function sendServerMessage(Dog_Server $server, $message) { foreach ($server->getChannels() as $chan) { $chan instanceof Dog_Channel; if (!Dog_Conf_Mod_Chan::isModuleDisabled('Shadowlamb', $chan->getID())) { $chan->sendPRIVMSG($message); } } }
public static function onQuit(DOGMOD_QuitJoin $QUITJOIN, Dog_Server $server, Dog_User $user) { $noteworthy = $QUITJOIN->getConfig('noteworthy', 's'); foreach ($server->getChannels() as $channel) { $channel instanceof Dog_Channel; if ($channel->getUserByID($user->getID()) !== false) { if (!Dog_Conf_Mod_Chan::isModuleDisabled('QuitJoin', $channel->getID())) { self::onQuitChannel($QUITJOIN, $server, $channel, $user, $noteworthy); } } } }
public function isTriggerEnabled(Dog_Server $server, $channel, $trigger) { $mod = $this->getName(); $sid = $server->getID(); if (!$this->isEnabled($server, $channel) || Dog_Conf_Mod_Serv::isTriggerDisabled($mod, $sid, $trigger, '0') || $channel !== false && Dog_Conf_Mod_Chan::isTriggerDisabled($mod, $channel->getID(), $trigger, $this->getDefDis($trigger))) { return false; } return true; }
public function setValue($value) { $key = $this->name; $sid = Dog::getServer()->getID(); $uid = Dog::getUser()->getID(); $c = Dog::getChannel(); if ($this->module !== NULL) { $mod = $this->module; switch ($this->scope) { case 'g': return Dog_Conf_Mod::setConf($mod, $key, $value); case 's': return Dog_Conf_Mod_Serv::setConf($mod, $sid, $key, $value); case 'c': if ($c !== false) { return Dog_Conf_Mod_Chan::setConf($mod, $c->getID(), $key, $value); } return false; case 'u': return Dog_Conf_Mod_User::setConf($mod, $uid, $key, $value); } } elseif ($this->plugin !== NULL) { $plg = $this->plugin; switch ($this->scope) { case 'g': return Dog_Conf_Plug::setConf($plg, $key, $value); case 's': return Dog_Conf_Plug_Serv::setConf($plg, $sid, $key, $value); case 'c': if ($c !== false) { Dog_Conf_Plug_Chan::setConf($plg, $c->getID(), $key, $value); } return false; case 'u': return Dog_Conf_Plug_User::setConf($plg, $uid, $key, $value); } } return false; }
if (!Dog::hasPermission($serv, false, $user, 'a')) { Dog::noPermission('a'); } elseif (false !== ($plug = Dog_Plugin::getPlug($name))) { Dog_Conf_Plug_Serv::setDisabled($plug->getName(), $sid, '1'); $plugin->rply('plg_on_serv', array($name, $serv->displayName())); } elseif (false !== ($mod = Dog_Module::getByName($name))) { Dog_Conf_Mod_Serv::setModuleDisabled($mod->getName(), $sid, '1'); $plugin->rply('mod_on_serv', array($mod->displayName(), $serv->displayName())); } elseif (false !== ($mod = Dog_Module::getByTrigger($name))) { Dog_Conf_Mod_Serv::setTriggerDisabled($mod->getName(), $sid, $name, '1'); $plugin->rply('trg_on_serv', array($name, $mod->displayName(), $serv->displayName())); } else { Dog::rply('err_command'); } } else { $cid = $chan->getID(); if (!Dog::hasPermission($serv, $chan, $user, 's')) { return Dog::noPermission('s'); } elseif (false !== ($plug = Dog_Plugin::getPlug($name))) { Dog_Conf_Plug_Chan::setDisabled($plug->getName(), $cid, '1'); $plugin->rply('plg_on_chan', array($name, $chan->displayLongName())); } elseif (false !== ($mod = Dog_Module::getByName($name))) { Dog_Conf_Mod_Chan::setModuleDisabled($mod->getName(), $cid, '1'); $plugin->rply('mod_on_chan', array($mod->displayName(), $chan->displayLongName())); } elseif (false !== ($mod = Dog_Module::getByTrigger($name))) { Dog_Conf_Mod_Chan::setTriggerDisabled($mod->getName(), $cid, $name, '1'); $plugin->rply('trg_on_chan', array($name, $mod->displayName(), $chan->displayLongName())); } else { Dog::rply('err_command'); } }
private function onBoardServerChannelTimer(array $entries, Dog_Forum $board, Dog_Server $server, Dog_Channel $channel) { if ('' === ($boardstring = Dog_Conf_Mod_Chan::getConf($this->getName(), $channel->getID(), 'boards', ''))) { return; } $boardstr = explode(';', $boardstring); foreach ($boardstr as $boardst) { $abbo = new Dog_ForumAbbo($boardst); foreach ($entries as $entry) { $entry instanceof Dog_ForumEntry; if ($abbo->matches($board, $entry)) { $this->sendAbbo($board, $channel, $entry); } } } }
} if (false !== ($mod = Dog_Module::getByName($name))) { Dog_Conf_Mod_Serv::setModuleDisabled($mod->getName(), $sid, '0'); $plugin->rply('mod_on_serv', array($mod->displayName(), $serv->displayName())); } // else // { // Dog::rply('err_command'); // } } else { $cid = $chan->getID(); if (!Dog::hasPermission($serv, $chan, $user, 's')) { return Dog::noPermission('s'); } if (false !== ($plug = Dog_Plugin::getPlug($name))) { Dog_Conf_Plug_Chan::setDisabled($plug->getName(), $cid, '0'); $plugin->rply('plg_on_chan', array($name, $chan->displayLongName())); } if (false !== ($mod = Dog_Module::getByTrigger($name))) { Dog_Conf_Mod_Chan::setTriggerDisabled($mod->getName(), $cid, $name, '0'); $plugin->rply('trg_on_chan', array($name, $mod->displayName(), $chan->displayLongName())); } if (false !== ($mod = Dog_Module::getByName($name))) { Dog_Conf_Mod_Chan::setModuleDisabled($mod->getName(), $cid, '0'); $plugin->rply('mod_on_chan', array($mod->displayName(), $chan->displayLongName())); } // else // { // Dog::rply('err_command'); // } }