$argc = count($argv); if ($argc !== 1) { return $plugin->showHelp(); } $name = strtolower($argv[0]); # Block important core plugins from beeing disabled. if (in_array($name, $coreplugs, true)) { $plugin->rply('core_plugin', array($name)); } elseif ($chan === 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))) {