All pastes #343239 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-02-06 22:06 UTC
rendered paste body
case 'del':
					$target = firstword($pars);
					if ($ns->valid_nick($target)) {
						if (!ake(strtolower($target),$ng)) {
							$hs->helpnotice($u,$this->source,"NICK_X_NOT_REGISTERED",'s',$target);
							return;
						}
						$mask = '';
						//$target = $ng[strtolower($target)]->ngi->mainnick->nick."!*@*";
						$ngi = $ng[strtolower($target)]->ngi->ngi;
					} elseif ($target and ereg('![^@]+@',$target)) {
						$mask = $target;
						$ngi = 'NULL';
					} else {
						$hs->helpnotice($u,$this->source,"BAD_SYNTAX",'c','AKICK');
						$hs->helpnotice($u,$this->source,"CHAN_AKICK_SYNTAX");
						return;
					}
					$r = q("DELETE FROM `cs_akick` WHERE `cid`={$c->ci->cid} AND `ngi`=$ngi AND `mask`='$mask' LIMIT 1",true); 
					if (mysql_affected_rows()) {
						$hs->helpnotice($u,$this->source,"CHAN_AKICK_DELETED",'n',
							($ngi ? $target : $mask),'c',$c->name);
						if ((int) $ngi and ake($ngi,$c->ci->akick_by_ngi)) {
							unset($c->ci->akick_by_ngi[$ngi]);
						}
						foreach ($c->ci->akick as $key => &$ak) {
							if ($ak->id !== $ngi and $ak->wildcard != $mask) continue;
							unset($c->ci->akick[$key]);
							break;
						}
					}
					else
						$hs->helpnotice($u,$this->source,"CHAN_AKICK_NO_MATCH",'s',$c->name);
					break;