function assemble($params) { if (!is_array($params)) { return null; } ksort($params, SORT_STRING); $sign = ''; foreach ($params as $key => $val) { $sign .= $key . (is_array($val) ? assemble($val) : $val); } return $sign; }
* 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ if ($reg = $this->getChannelReg($chan_name)) { $this->removeChannelReg($reg); $reg->delete(); $reason = 'So long, and thanks for all the fish!'; if ($cmd_num_args > 1) { $reason = assemble($pargs, 2); } if (($chan = $this->getChannel($chan_name)) && $chan->isOn($bot->getNumeric())) { $bot->mode($chan->getName(), '-R'); $bot->part($chan->getName(), $reason); } }
/* * ircPlanet Services for ircu * Copyright (c) 2005 Brian Cline. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $quote_stuff = assemble($pargs, 1); $this->sendf($quote_stuff);
function getHostMask() { $mask = '*!*' . right($this->ident, IDENT_LEN) . '@'; $host = $this->host; if ($this->hasFakehost()) { $host = $this->fakehost; } elseif ($this->isHostHidden()) { $host = $this->getAccountName() . '.' . HIDDEN_HOST; } $levels = explode('.', $host); $num_levels = count($levels); if (isIp($host)) { $host = assemble($levels, 0, 3, '.'); $host .= '.*'; } elseif ($num_levels > 2) { for ($n = $num_levels - 1; $n > 0; $n--) { if (preg_match('/[0-9]/', $levels[$n])) { break; } } $host = '*.'; $host .= assemble($levels, $n + 1, -1, '.'); } $mask = fixHostMask($mask); return $mask . $host; }
* 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ if (!($chan = $this->getChannel($chan_name))) { $bot->noticef($user, "Nobody is on channel %s.", $chan_name); return false; } if (!$chan->isOn($bot->getNumeric())) { $bot->noticef($user, 'I am not on %s.', $chan->getName()); return false; } $text = assemble($pargs, 2); $bot->message($chan->getName(), $text);
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $chan_name = $pargs[1]; $owner_nick = $pargs[2]; $purpose = ''; if ($cmd_num_args > 2) { $purpose = assemble($pargs, 3); } if ($chan_name[0] != '#') { $bot->notice($user, 'Channel names must begin with the # character.'); return false; } if (!($owner = $this->getAccount($owner_nick))) { $bot->noticef($user, '%s is not a known account name!', $owner_nick); return false; } if (!($reg = $this->getChannelReg($chan_name))) { $reg = new DB_Channel($chan_name, $owner->getId()); $reg->setPurpose($purpose); $reg->save(); $reg = $this->addChannelReg($reg); $bot->join($chan_name);
* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $is_public = false; $is_private = false; $cmd_msg = assemble($args, 3); $cmd_target = $privmsg_target; $this->loadCommandInfo(); if (empty($chan_key) && array_key_exists($cmd_target, $this->users) && $this->users[$cmd_target]->isBot()) { $bot = $this->users[$cmd_target]; $is_private = true; } if (!empty($chan_key) && $cmd_msg[0] == '!') { $cmd_msg = substr($cmd_msg, 1); $bot = $this->default_bot; $is_public = true; } if ($is_public || $is_private) { $user_numeric = $args[0]; $user = $this->getUser($user_numeric); $pargs = lineGetArgs($cmd_msg, false);
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $option = strtoupper($pargs[2]); $value = ''; if ($cmd_num_args >= 3) { $value = assemble($pargs, 3); } if ($option == 'PURPOSE') { if (strlen($value) >= MAXLEN_CHAN_PURPOSE) { $bot->notice($user, 'The channel purpose you provided is too long. Please try something shorter.'); return false; } $chan_reg->setPurpose($value); $bot->notice($user, 'Updated channel purpose.'); } elseif ($option == 'URL') { if (strlen($value) >= MAXLEN_CHAN_URL) { $bot->notice($user, 'The channel URL you provided is too long. Please try something shorter.'); return false; } $chan_reg->setUrl($value); $bot->notice($user, 'Updated channel URL.');
* 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ if (!($chan = $this->getChannel($chan_name))) { $bot->noticef($user, "Nobody is on channel %s.", $chan_name); return false; } if (!$chan->isOn($bot->getNumeric())) { $bot->noticef($user, 'I am not on %s.', $chan->getName()); return false; } $text = "ACTION " . assemble($pargs, 2) . ""; $bot->message($chan->getName(), $text);
* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $topic_arg = 3; if (TOPIC_BURSTING) { $topic_arg = 5; } $topic = assemble($args, $topic_arg); if ($chan = $this->getChannel($chan_key)) { $chan->setTopic($topic); }
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $help_topic = 'help'; $help_level = 0; if ($cmd_num_args > 0) { $help_topic = assemble($pargs, 1); $help_topic_first = $pargs[1]; $help_level = $this->getCommandLevel($help_topic_first); } $res = db_query("select text from help where service = 'CS' and topic = '{$help_topic}' and minlevel <= {$user_level}"); if ($res && mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); $lines = explode("\n", $row['text']); $spacing = str_repeat(' ', 30 - strlen($help_topic)); $help_syntax = $this->getCommandSyntax($help_topic); $bot->noticef($user, "%sHELP on %s %s %10s%s", BOLD_START, $help_topic, $spacing, 'Level ' . $help_level, BOLD_END); $bot->noticef($user, ""); if (!preg_match('/syntax:/i', $row['text'])) { $bot->noticef($user, "%sSyntax:%s %s %s", BOLD_START, BOLD_END, $help_topic, $help_syntax); $bot->noticef($user, ""); }
* this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ if (!($chan = $this->getChannel($chan_name))) { $bot->noticef($user, "Nobody is on channel %s.", $chan_name); return false; } if ($cmd_num_args < 2) { $bot->noticef($user, 'Topic on %s%s%s is currently: %s', BOLD_START, $chan->getName(), BOLD_END, $chan->getTopic()); } else { $new_topic = assemble($pargs, 2); $bot->topic($chan->getName(), $new_topic, $chan->getTs()); $chan->topic = $new_topic; }
/* * ircPlanet Services for ircu * Copyright (c) 2005 Brian Cline. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $ping_text = assemble($pargs, 1); $bot->noticef($user->numeric, "%sPING %s", CTCP_START, $ping_text);
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ if (!($reg = $this->getChannelReg($chan_name))) { $bot->noticef($user, '%s is not registered!', $chan_name); return false; } $mod_uid = $pargs[2]; $option = strtoupper($pargs[3]); $value = ''; if ($cmd_num_args >= 4) { $value = assemble($pargs, 4); } if ($mod_user = $this->getAccount($mod_uid)) { if (!($access = $this->getChannelAccessAccount($chan_name, $mod_user))) { $bot->noticef($user, '%s is not in the %s access list.', $mod_user->getName(), $reg->getName()); return false; } if ($option == 'LEVEL') { $new_level = $value; if ($new_level < 1 || $new_level > 500) { $bot->notice($user, 'Access level must range from 1 to 500.'); return false; } $access->setLevel($new_level); $bot->noticef($user, '%s\'s level on %s has has been changed to %d.', $mod_user->getName(), $reg->getName(), $new_level); } elseif ($option == 'AUTOOP') {
$user_level = $this->getUserLevel($user); $cmd_level = $this->getCommandLevel($cmd_name); $cmd_req_args = $this->getCommandArgCount($cmd_name); $cmd_num_args = count($pargs) - 1; if ($user->isService() && $cmd_name == 'gline') { $user_level = $cmd_level; } if ($cmd_num_args > 0) { $chan_name = $pargs[1]; $chan_key = strtolower($chan_name); } if ($user_level >= $cmd_level) { if ($cmd_num_args >= $cmd_req_args) { $chan_name = $chan_key; $cmd_result = (include $cmd_handler_file); if ($cmd_result == false) { return false; } $report_cmd = str_replace("_", " ", $cmd_name); $report_cmd = strtoupper($report_cmd); $this->reportCommand($report_cmd, $user, assemble($pargs, 1)); } else { $bot->noticef($user, "%sSyntax:%s %s %s", BOLD_START, BOLD_END, $cmd_name, $this->getCommandSyntax($cmd_name)); } } else { $bot->noticef($user, "You do not have enough access to use that command!"); } } elseif (!$is_public) { $bot->noticef($user->numeric, "Invalid command! Use %sshowcommands%s to get a list of available commands.", BOLD_START, BOLD_END); } }
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $message = assemble($pargs, 1); foreach ($this->users as $tmp_numeric => $tmp_user) { if (!$tmp_user->isOper() || $tmp_user->isBot()) { continue; } $bot->noticef($tmp_user, '%s[Oper Msg]:%s %s', BOLD_START, BOLD_END, $message); }
* All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of ircPlanet nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ if ($cmd_num_args == 0) { $reason = 'So long, and thanks for all the fish!'; } else { $reason = assemble($pargs, 1); } $this->close($reason);
$duration = '60m'; // default duration $reason = ''; // default reason $level = $user_channel_level; if ($level == 0) { $level = 75; } if ($cmd_num_args >= 3) { $duration = $pargs[3]; } if ($cmd_num_args >= 4) { $level = $pargs[4]; } if ($cmd_num_args >= 5) { $reason = assemble($pargs, 5); } if ($level > $user_level) { $bot->noticef($user, 'The level you specified is too high and must be %s or lower.', $user_level); return false; } if (!($duration_secs = convertDuration($duration))) { $bot->notice($user, 'Invalid duration specified! See help for more details.'); return false; } if (!preg_match('/[!@\\.]/', $mask)) { if ($tmp_user = $this->getUserByNick($mask)) { $mask = $tmp_user->getHostMask(); } else { $mask = $mask . '!*@*'; }
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $option = strtoupper($pargs[1]); $value = ''; if ($cmd_num_args > 1) { $value = assemble($pargs, 2); } $account = $this->getAccount($user->getAccountName()); if ($option == 'EMAIL') { if (strlen($value) >= MAXLEN_USEREMAIL) { $bot->notice($user, 'Your email address is too long. Please try something shorter.'); return false; } $account->setEmail($value); $bot->notice($user, 'Your e-mail address has been updated.'); } elseif ($option == 'INFO') { if (strlen($value) >= MAXLEN_INFOLINE) { $bot->notice($user, 'Your infoline is too long. Please try something shorter.'); return false; } $account->setInfoLine($value);
* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $channel = $pargs[1]; $duration = $pargs[2]; $reason = assemble($pargs, 3); if (!preg_match('/^#/', $channel)) { $bot->noticef($user, '%s is not a valid channel name.', $channel); return false; } if (!($duration_secs = convertDuration($duration))) { $bot->notice($user, 'Invalid duration specified! See help for more details.'); return false; } $max_ts = 2147483647; $expire_ts = time() + $duration_secs; if ($expire_ts > $max_ts || $expire_ts < 0) { $bot->noticef($user, 'The duration you specified is too large. Please try something more sensible.'); return false; } $gline = $this->addGline($channel, $duration_secs, time(), $reason);
* specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ $chan_name = $pargs[1]; $purpose = assemble($pargs, 2); if (!$user->isLoggedIn()) { $bot->notice($user, 'You must register a user account before you can register a channel.'); return false; } if ($chan_name[0] != '#') { $bot->notice($user, 'Channel names must begin with the # character.'); return false; } if ($this->getChannelRegCount($user->getAccountId()) >= MAX_CHAN_REGS) { $bot->noticef($user, 'You cannot register more than %d channels.', MAX_CHAN_REGS); return false; } $reg = $this->getChannelReg($chan_name); $chan = $this->getChannel($chan_name); if ($reg) {