getNickId($nick); if ($nick == "") { // error $cmdp = $p; $cmdp["param"] = _pfc("Missing parameter"); $cmdp["param"] .= " (".$this->usage.")"; $cmd =& pfcCommand::Factory("error"); $cmd->run($xml_reponse, $cmdp); return; } $updated = false; $msg = "
"._pfc("Nobody has been unbanished")."
"; // update the recipient banlist $banlist = $ct->getChanMeta($recipient, 'banlist_nickid'); if ($banlist == NULL) $banlist = array(); else $banlist = unserialize($banlist); $nb = count($banlist); if (in_array($nickid, $banlist)) { $banlist = array_diff($banlist, array($nickid)); $ct->setChanMeta($recipient, 'banlist_nickid', serialize($banlist)); $updated = true; $msg = ""._pfc("%s has been unbanished", $nick)."
"; } else if ($nick == "all") // @todo move the "/unban all" command in another command /unbanall { $banlist = array(); $ct->setChanMeta($recipient, 'banlist_nickid', serialize($banlist)); $updated = true; $msg = ""._pfc("%s users have been unbanished", $nb)."
"; } if ($updated) $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ok', '".$msg."');"); else $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ko', '".$msg."');"); } } ?>