コード例 #1
0
function irc($command)
{
    global $XUSER, $SERVER, $ROOMS, $OPERATOR, $CS, $PERMISSIONS;
    // The following IRC commands are implemented
    // unban
    // devoice
    // join
    // mdeop
    // names
    // unignore
    // voice
    // kick
    // mkick
    // op
    // away
    // back
    // ignore
    // wallchop
    // ban
    // deop
    // invite
    // topic
    // wallchan
    // msg
    // admin
    // deadmin
    //       mode
    //  // +-s,+-p = Private, Public
    //  // +-m = moded
    //  // +-l <number> = user limit, number if +
    //  // +-b = ban
    //  // +-v = voice
    //  // +-o = op
    //  // +-i = ignore
    //  // +-a = Admin/noadmin
    $command = eregi_replace("/", "", $command);
    $commando = eregi_replace("/", "", $command);
    $i = 0;
    while ($token = strtok($command, " ")) {
        $command = @eregi_replace("{$token}", "", $command);
        $cmd[$i] = $token;
        $i++;
    }
    $command2 = "6439547" . $commando;
    $token = strtok($command2, " ");
    $command2 = @eregi_replace("{$token} ", "", $command2);
    if ($cmd[0] != "wallchop" && $cmd[0] != "topic" && $cmd[0] != "wallchan" && $cmd[0] != "mode" && $cmd[0] != "join" && $cmd[0] != "me") {
        $command2 = "6439547" . $command2;
        $token = strtok($command2, " ");
        $command2 = @eregi_replace("{$token}", "", $command2);
    }
    $cmd[3] = $command2;
    $cmd[1] = strip($cmd[1]);
    $qa = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
    $rowa = do_Fetch_row($qa);
    if ($rowa[4] == 4 || $rowa[4] == 5) {
        $wuza = 1;
    }
    $noauth = 0;
    if ($XUSER['LEVEL'] < 3) {
        $noauth = 1;
    }
    // Start looking for the command the user ran
    if ($cmd[0] == "unban" && $noauth != 1) {
        mnotice($cmd[1], 9);
        if (eregi(".*\\..*\\..*\\..*", $cmd[1])) {
            $isip = 1;
        }
        if (isset($isip)) {
            DoQuery("DELETE FROM {$SERVER['TBL_PREFIX']}bans WHERE room='{$ROOMS['IN_ROOM_NAME']}' && ip='{$cmd['1']}'");
        } else {
            DoQuery("DELETE FROM {$SERVER['TBL_PREFIX']}bans WHERE room='{$ROOMS['IN_ROOM_NAME']}' && name='{$cmd['1']}'");
        }
    } elseif ($cmd[0] == "devoice" && $noauth != 1 && !isset($wuza)) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE username='******'1']}'");
        $row = Do_Fetch_Row($q);
        if ($row[3] == $ROOMS['IN_ROOM_NAME']) {
            $q = DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET voice='' WHERE username='******'1']}'");
            mnotice($cmd[1], 6);
        }
    } elseif ($cmd[0] == "join") {
        sendsysmsgto("To join {$cmd['3']} <a href=\"../index.php?changeroom=set&room={$cmd['3']}\" target=\"_parent\">Click Here</a>.", "{$XUSER['NAME']}:PRIV");
    } elseif ($cmd[0] == "help") {
        function disp($mess_txt)
        {
            global $CS, $XUSER;
            $mess_txt = eregi_replace("\r\n", "", $mess_txt);
            $mess_txt = eregi_replace("\n", "", $mess_txt);
            sendsysmsgto("{$mess_txt}", "{$XUSER['NAME']}:PRIV");
        }
        if ($cmd[1] == "") {
            disp("This server accepts the following commands: ");
            disp("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td width=\"75\">unban</td>\n<td width=\"75\">devoice</td>\n<td width=\"75\">join</td>\n<td width=\"75\">mdeop</td>\n<td width=\"75\">names</td>\n<td width=\"75\">unignore</td>\n</tr>\n<tr>\n<td width=\"75\">voice</td>\n<td width=\"75\">kick</td>\n<td width=\"75\">mkick</td>\n<td width=\"75\">op</td>\n<td width=\"75\">away</td>\n<td width=\"75\">back</td>\n</tr>\n<tr>\n<td width=\"75\">ignore</td>\n<td width=\"75\">wallchop</td>\n<td width=\"75\">ban</td>\n<td width=\"75\">deop</td>\n<td width=\"75\">invite</td>\n<td width=\"75\">topic</td>\n</tr>\n<tr>\n<td width=\"75\">wallchan</td>\n<td width=\"75\">msg</td>\n<td width=\"75\">admin</td>\n<td width=\"75\">deadmin</td>\n<td width=\"75\">mode</td>\n<td width=\"75\">list</td>\n</tr>\n<tr>\n<td width=\"75\">me</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n</tr>\n</table>");
            disp("For more information type /help <i>command</i>");
            disp("Certain Commands may not be accepted if you do not have correct authorization.");
        } elseif ($cmd[1] == "unban") {
            disp("Command: unban<Br>\nSyntax: /unban <i>username</i><Br>\nAction: Unbans a username or IP address from the chat room.");
        } elseif ($cmd[1] == "devoice") {
            disp("Command: devoice<Br>\nSyntax: /devoice <i>username</i><Br>\nAction: Takes away a users voice so they can no longer send messages in a moderated chat room.");
        } elseif ($cmd[1] == "join") {
            disp("Command: join<Br>\nSyntax: /join <i>room name</i><Br>\nAction: Gives you a link to change to room <i>room name</i>.");
        } elseif ($cmd[1] == "mdeop") {
            disp("Command: mdeop<Br>\nSyntax: /mdeop<Br>\nAction: Mass De-Ops the entire room.  De-Ops all other ops but you.");
        } elseif ($cmd[1] == "names") {
            disp("Command: names<Br>\nSyntax: /names<Br>\nAction: Prints the usernames of people in chat with you.");
        } elseif ($cmd[1] == "unignore") {
            disp("Command: unignore<Br>\nSyntax: /unignore <i>username</i><Br>\nAction: Unignores the user with username <i>username</i>.");
        } elseif ($cmd[1] == "voice") {
            disp("Command: voice<Br>\nSyntax: /voice <i>username</i><Br>\nAction: Gives user <i>username</i> a voice.  This allows them to send messages to a moderated chat room");
        } elseif ($cmd[1] == "kick") {
            disp("Command: kick<Br>\nSyntax: /kick <i>username</i><Br>\nAction: This will kick (remove) a user from chat.");
        } elseif ($cmd[1] == "mkick") {
            disp("Command: mkick<Br>\nSyntax: /mkick<Br>\nAction: This kicks all users in the chat room out except for you.");
        } elseif ($cmd[1] == "op") {
            disp("Command: op<Br>\nSyntax: /op <i>username</i><Br>\nAction: Gives <i>username</i> operator status in the current chat room.");
        } elseif ($cmd[1] == "away") {
            disp("Command: away<Br>\nSyntax: /away<Br>\nAction: Sets your current status as away.");
        } elseif ($cmd[1] == "back") {
            disp("Command: back<Br>\nSyntax: /back<Br>\nAction: Sets your current stats as present.");
        } elseif ($cmd[1] == "ignore") {
            disp("Command: ignore<Br>\nSyntax: /ignore <i>username</i><Br>\nAction: Ignores <i>username</i>, you will no longer recieve messages from <i>username</i>");
        } elseif ($cmd[1] == "wallchop") {
            disp("Command: wallchop<Br>\nSyntax: /wallchop <i>message</i><Br>\nAction: Sends <i>message</i> to all the operators in the current chat room.");
        } elseif ($cmd[1] == "ban") {
            disp("Command: ban<Br>\nSyntax: /ban <i>username</i><Br>\nAction: Bans a username or IP address from the chat room.  The user will no longer be able to access this chat room.");
        } elseif ($cmd[1] == "deop") {
            disp("Command: deop<Br>\nSyntax: /deop <i>username</i><Br>\nAction: Takes operator status from a user.");
        } elseif ($cmd[1] == "invite") {
            disp("Command: invite<Br>\nSyntax: /invite <i>username</i><Br>\nAction: Invites a username to join the current chat room.");
        } elseif ($cmd[1] == "topic") {
            disp("Command: topic<Br>\nSyntax: /topic <i>topic</i><Br>\nAction: Sets the chat rooms topic to <i>topic</i>.");
        } elseif ($cmd[1] == "wallchan") {
            disp("Command: wallcan<Br>\nSyntax: /wallchan <i>message</i><Br>\nAction: Sends a message to all channels on current server.");
        } elseif ($cmd[1] == "msg") {
            disp("Command: msg<Br>\nSyntax: /msg <i>username</i> <i>message</i><Br>\nAction: Sends a private message, <i>message</i>, to <i>username</i>.");
        } elseif ($cmd[1] == "admin") {
            disp("Command: admin<Br>\nSyntax: /admin <i>username</i><Br>\nAction: Grants <i>username</i> administrator access.");
        } elseif ($cmd[1] == "deadmin") {
            disp("Command: deadmin<Br>\nSyntax: /deadmin <i>username</i><Br>\nAction: Takes <i>username</i>'s administrator access.");
        } elseif ($cmd[1] == "list") {
            disp("Command: list<Br>\nSyntax: /list<Br>\nAction: Displays list of rooms on the server.");
        } elseif ($cmd[1] == "me") {
            disp("Command: me<Br>\nSyntax: /me <i>action</i><Br>\nAction: Makes you do an action.");
        } elseif ($cmd[1] == "mode") {
            disp("Command: mode<Br>\nSyntax: /mode <i>mode</i> [<i>username</i>]<Br>\nAction: Preforms <i>mode</i> on <i>username</i>.  If <i>mode</i> is a channel\nmode then <i>username</i> may be ommited.  Placing a + in front of a mode applys it and placing\na - in from of a mode removes it.<Br><br>User Modes:<Br>\n[+|-]b: [Bans|Unbans] a user from the current chat room.<Br>\n[+|-]v: [Give Voice To|Take Voice From] a user in the current chat room.<Br>\n[+|-]o: [Ops|Deops] a user in the current chat room.<Br> \n[+|-]i: [Ignores|Unignores] a user.<Br>\n[+|-]a: [Admins|Deadmins] a user.<Br>\n<Br>Channel Modes<br>\n+p: Makes current chat room private.  Replace <i>username</i> with the password for the room.<br>\n-p: Makes a chat room public.  <i>username</i> may be ommited.<Br>\n+m: Makes a chat room moderated.  <i>username</i> may be ommited.<Br>\n-m: Makes a chat room unmoderated.  <i>username</i> may be ommited.<Br>\n+l: Sets the user limit for the current chat room.  Replace <i>username</i> with the maximum amount of users for the room.<br>\n-l: Removes the user limit from current chat room.  <i>username</i> may be ommited.<Br>\n\n");
        } else {
            disp("Sorry no help is available for that command.");
        }
    } elseif ($cmd[0] == "mdeop" && $noauth != 1) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = Do_Fetch_row($q)) {
            $q2 = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
            $row = Do_Fetch_row($q2);
            if ($row[4] == "3{$ROOMS['id']}" && $row[1] != $XUSER['NAME']) {
                irc("/deop {$row['1']}");
            }
        }
    } elseif ($cmd[0] == "names") {
        sendsysmsgto("Users in chat with you:", "{$XUSER['NAME']}:PRIV");
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = Do_Fetch_row($q)) {
            sendsysmsgto("{$row['1']}", "{$XUSER['NAME']}:PRIV");
        }
    } elseif ($cmd[0] == "unignore") {
        DoQuery("DELETE FROM {$SERVER['TBL_PREFIX']}ignore WHERE user='******'NAME']}' AND toignore='{$cmd['1']}'");
    } elseif ($cmd[0] == "voice" && $noauth != 1 && !isset($wuza)) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET voice='{$ROOMS['id']}' WHERE username='******'1']}'");
        mnotice($cmd[1], 5);
    } elseif ($cmd[0] == "kick" && $noauth != 1 && !isset($wuza) && $PERMISSIONS['Kick'] != 1) {
        mnotice($cmd[1], 7);
        $time = time();
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}bans VALUES('0','{$ROOMS['IN_ROOM_NAME']}','{$cmd['1']}','','{$time}','60')");
    } elseif ($cmd[0] == "mkick" && $noauth != 1) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = Do_Fetch_row($q)) {
            if ($row[1] != $XUSER['NAME']) {
                irc("/kick {$row['1']}");
            }
        }
    } elseif ($cmd[0] == "op" && $noauth != 1 && !isset($wuza)) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
        $row = Do_Fetch_Row($q);
        if (strlen($XUSER['LEVEL']) == 1) {
            $isop = 0;
        } elseif (strlen($row[4]) > 1) {
            $isop = 1;
        }
        if ($isop == 0) {
            $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE username='******'1']}'");
            $row = Do_Fetch_Row($q);
            if ($row[3] == $ROOMS['IN_ROOM_NAME']) {
                DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='3{$ROOMS['id']}' WHERE username='******'1']}'");
                mnotice($cmd[1], 3);
            }
        }
    } elseif ($cmd[0] == "away") {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET status=2 WHERE username='******'NAME']}'");
    } elseif ($cmd[0] == "back") {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET status='' WHERE username='******'NAME']}'");
    } elseif ($cmd[0] == "ignore") {
        $time = time();
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}ignore VALUES('0','{$XUSER['NAME']}','{$cmd['1']}','{$time}','')");
    } elseif ($cmd[0] == "msg") {
        $cmd[3] = strip($cmd[3]);
        sendprivatemsg($cmd[3], $cmd[1]);
    } elseif ($cmd[0] == "wallchop") {
        $cmd[3] = strip($cmd[3]);
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = do_fetch_row($q)) {
            $q2 = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
            $row2 = do_Fetch_row($q2);
            if ($row2[4] == "3{$ROOMS['id']}") {
                sendprivatemsg($cmd[3], $row[1]);
            }
        }
    } elseif ($cmd[0] == "ban" && $noauth != 1 && !isset($wuza) && $PERMISSIONS['Ban'] != 1) {
        $time = time();
        mnotice($cmd[1], 8);
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}bans VALUES('0','{$ROOMS['IN_ROOM_NAME']}','{$cmd['1']}','','{$time}','0')");
    } elseif ($cmd[0] == "deop" && $noauth != 1 && !isset($wuza)) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='1' WHERE username='******'1']}'");
        mnotice($cmd[1], 4);
    } elseif ($cmd[0] == "roll") {
        global $XUSER, $SERVER, $ROOMS;
        $SERVER['CURRENT_TIME'] = time();
        $ran1 = rand(1, 6);
        $ran2 = rand(1, 6);
        if (@$cmd[1] == 2) {
            $message = "{$XUSER['NAME']} rolls two dice and gets a {$ran1} and a {$ran2}";
        } else {
            $message = "{$XUSER['NAME']} rolls a dice and gets a {$ran1}";
        }
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}messages \nVALUES('0','{$ROOMS['IN_ROOM_NAME']}','System','{$SERVER['CURRENT_TIME']}','0','{$message}')");
    } elseif ($cmd[0] == "me") {
        global $XUSER, $SERVER, $ROOMS;
        $SERVER['CURRENT_TIME'] = time();
        if ($cmd[1] != "") {
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}messages \nVALUES('0','{$ROOMS['IN_ROOM_NAME']}','System','{$SERVER['CURRENT_TIME']}','0','{$XUSER['NAME']} {$cmd['3']}')");
        }
    } elseif ($cmd[0] == "invite") {
        $SERVER['CURRENT_TIME'] = time();
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}messages \nVALUES('0','{$cmd['1']}:PRIV','System','{$SERVER['CURRENT_TIME']}','0','{$XUSER['NAME']} has invited you to join the chatroom <a href=\"../index.php?changeroom=set&room={$ROOMS['IN_ROOM_NAME']}\" target=\"_parent\">{$ROOMS['IN_ROOM_NAME']}</a>')");
    } elseif ($cmd[0] == "topic" && $noauth != 1) {
        $cmd[3] = strip($cmd[3]);
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET topic='{$cmd['3']}' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
        mnotice($cmd[3], 12);
    } elseif ($cmd[0] == "wallchan" && $PERMISSIONS['Send_Sys_Message'] == 1) {
        sendsysmsg($cmd[3]);
    } elseif ($cmd[0] == "admin" && $PERMISSIONS['Make_Admins'] == 1) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='4',time='0' WHERE username='******'1']}'");
        mnotice($cmd[1], 1);
    } elseif ($cmd[0] == "deadmin" && $PERMISSIONS['Make_Admins'] == 1) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='1',time='0' WHERE username='******'1']}'");
        mnotice($cmd[1], 2);
    } elseif ($cmd[0] == "list") {
        $r = listrooms("dark");
        $r = eregi_replace("\r\n", "", $r);
        sendsysmsgto($r, "{$XUSER['NAME']}:PRIV");
    } elseif ($cmd[0] == "mode") {
        $error = 0;
        if (eregi("-", $cmd[1], $match)) {
            $type = "-";
        } else {
            $type = "+";
        }
        if ($cmd[3] == $cmd[1]) {
            $cmd[3] = "";
        }
        $temp = eregi_replace("\\+", "\\+", $cmd[1]);
        $temp = eregi_replace("\\-", "\\-", $temp);
        $cmd[3] = eregi_replace("{$temp}", "", $cmd[3]);
        $cmd[3] = eregi_replace("^ ", "", $cmd[3]);
        $cmd[3] = eregi_replace(" \$", "", $cmd[3]);
        if (eregi("p", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET type='1' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                    mnotice("", 11);
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +p <i>password</i>";
                    } else {
                        if ($PERMISSIONS['CR_Private'] == 1) {
                            $error = "The administrator of this server has disabled private rooms.";
                        } else {
                            DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET type='2',password='******'3']}' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                            mnotice("", 10);
                        }
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("m", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET moderated='0' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                    mnotice("", 15);
                } else {
                    if ($PERMISSIONS['CR_Moderated'] == 1) {
                        $error = "The administrator of this server has disabled the creation of moderated rooms.";
                    } else {
                        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET moderated='1' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                        mnotice("", 14);
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("l", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET maxusers='0' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                    mnotice("Unlimited", 13);
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +l <i>max users</i>";
                    } else {
                        if ($cmd[3] < 2) {
                            $cmd[3] = 2;
                        }
                        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET maxusers='{$cmd['3']}' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                        mnotice($cmd[3], 13);
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("b", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -b <i>username</i>";
                    } else {
                        irc("/unban {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +b <i>username</i>";
                    } else {
                        irc("/ban {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("v", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -v <i>username</i>";
                    } else {
                        irc("/devoice {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +v <i>username</i>";
                    } else {
                        irc("/voice {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("o", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -o <i>username</i>";
                    } else {
                        irc("/deop {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +o <i>username</i>";
                    } else {
                        irc("/op {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("i", $cmd[1], $match)) {
            if ($type == "-") {
                if ($cmd[3] == "") {
                    $error = "Usage: /mode -i <i>username</i>";
                } else {
                    irc("/unignore {$cmd['3']}");
                }
            } else {
                if ($cmd[3] == "") {
                    $error = "Usage: /mode +i <i>username</i>";
                } else {
                    irc("/ignore {$cmd['3']}");
                }
            }
        }
        if (eregi("a", $cmd[1], $match)) {
            if ($PERMISSIONS['Make_Admins'] == 1) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -a <i>username</i>";
                    } else {
                        irc("/deadmin {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +a <i>username</i>";
                    } else {
                        irc("/admin {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if ($error == 1) {
            sendsysmsgto("You do not have permission to use that command.", "{$XUSER['NAME']}:PRIV");
        } elseif ($error != "0") {
            sendsysmsgto($error, "{$XUSER['NAME']}:PRIV");
        }
    } else {
        $message = "Unknown Command {$cmd['0']}";
        if (isset($wuza)) {
            $message = "Sorry, You may not preform this action on this user.";
        }
        sendsysmsgto($message, "{$XUSER['NAME']}:PRIV");
    }
}
コード例 #2
0
    ?>
" alink="<?php 
    echo $CS['FONTLT'];
    ?>
">
<?php 
    if (isset($ban)) {
        $banned = "{$txt['22']}<Br><Br>";
        DoQuery("DELETE FROM {$SERVER['TBL_PREFIX']}online WHERE username='******'NAME']}' AND roomname='{$ROOMS['IN_ROOM_NAME']}' OR ip='{$XUSER['IP']}' AND roomname='{$ROOMS['IN_ROOM_NAME']}'");
    } else {
        $banned = "";
    }
    if (isset($pincorrect)) {
        $banned .= "{$txt['23']}<Br><Br>";
    }
    $body = listrooms();
    if ($PERMISSIONS['CreateRoom'] != 1) {
        $body .= "<Br><Br>\n<a href=\"index.php?croom1=yes\">{$txt['25']}</a>";
    }
    $temp = $PERMISSIONS['Edit_Settings'] + $PERMISSIONS['Edit_Styles'] + $PERMISSIONS['Edit_Permissions'] + $PERMISSIONS['Edit_Users'] + $PERMISSIONS['Edit_Room'] + $PERMISSIONS['Server_Ban'] + $PERMISSIONS['Edit_Filter'] + $PERMISSIONS['Edit_Smilies'] + $PERMISSIONS['Edit_Bandwidth'];
    if ($temp != 0) {
        $body .= "<Br><a href=\"admin.php\">[{$txt['386']}]</a>";
    }
    printct(700, 700, "<font size=\"6\"><div align=\"center\">{$txt['24']}</div>", "\n<div align=\"Center\">{$banned}{$body} \n<Br><Br></div>", "{$CS['1']}", $CS[2], "{$CS['3']}");
} elseif ($action == "createroom1") {
    ?>
<body bgcolor="<?php 
    echo $CS['WIN_BG1'];
    ?>
" text="<?php 
    echo $CS['FONTLT'];