Example #1
0
function usr_action_window()
{
    global $print, $txt, $x7c;
    // Include the user control library
    include_once "./lib/usercontrol.php";
    // Create a user info object for this user
    $user_info = new user_control($_GET['user']);
    if ($_GET['action'] == "ignore") {
        $user_info->ignore();
        $body = $txt[101];
    } elseif ($_GET['action'] == "unignore") {
        $user_info->unignore();
        $body = $txt[102];
    } elseif ($_GET['action'] == "gop" && $x7c->permissions['room_operator'] == 1) {
        $user_info->give_ops();
        $body = $txt[105];
    } elseif ($_GET['action'] == "dice" && $x7c->permissions['admin_panic'] == 1) {
        $form = $user_info->dice($user_info, $_GET['room']);
        $body = "Effettua un tiro per <b>[" . $user_info->user . "]</b>:" . $form;
    } elseif ($_GET['action'] == "top" && $x7c->permissions['room_operator'] == 1) {
        $user_info->take_ops();
        $body = $txt[106];
    } elseif ($_GET['action'] == "vip" && $x7c->permissions['room_operator'] == 1 && $x7c->permissions['viewip'] == 1) {
        $ip = $user_info->view_ip();
        $body = $txt[107] . $ip;
    } elseif ($_GET['action'] == "kick" && $x7c->permissions['room_operator'] == 1 && $x7c->permissions['kick'] == 1) {
        if (!isset($_POST['reason'])) {
            $body = $txt[108] . "\n\t\t\t\t<form action=\"index.php?act=usr_action&action=kick&user={$user_info->user}&room={$_GET['room']}\" method=\"post\">\n\t\t\t\t<input type=\"text\" size=\"25\" name=\"reason\" class=\"text_input\">\n\t\t\t\t<input type=\"submit\" value=\"{$txt['97']}\" class=\"button\">\n\t\t\t\t</form>";
        } else {
            $user_info->kick($_POST['reason']);
            $body = $txt[109];
        }
    } elseif ($_GET['action'] == "mute" && $x7c->permissions['room_operator'] == 1) {
        $user_info->mute();
        $body = $txt[111];
    } elseif ($_GET['action'] == "unmute" && $x7c->permissions['room_operator'] == 1) {
        $user_info->unmute();
        $body = $txt[112];
    } elseif ($_GET['action'] == "gv" && $x7c->permissions['room_operator'] == 1) {
        $user_info->voice();
        $body = $txt[113];
    } elseif ($_GET['action'] == "tv" && $x7c->permissions['room_operator'] == 1) {
        $user_info->unvoice();
        $body = $txt[114];
    } else {
        // They sent an incorrect page so we give them an error
        $body = $txt[104];
    }
    // This script will update the user action/profile tab so it is accurate
    $script = "\n\t\t<script language=\"javascript\" type=\"text/javascript\">\n\n\t\topener.window.clearTheWay();\n\t\topener.window.parent.frames['profile'].document.location='./index.php?act=frame&frame=profile&room={$_GET['room']}&user={$_GET['user']}&tto=1';\n\n\t\t</script>\n\n\t\t";
    // Output this to the print buffer
    $print->info_window($body . $script);
}
Example #2
0
File: del_ok.php Project: I0T/xss
<?php

/**
 * @author: xiaoma
 * @blog  : www.i0day.com
 * @date  : 2014.10.14 11:2
 */
session_start();
header("Content-type: text/html; charset=utf-8");
require_once '../config/mysql_conn.php';
//require_once '../config/session.php';
require_once '../config/user_control.php';
$pro_res = new user_control();
$del_res = $pro_res->project_del();
Example #3
0
<?php

/**
 * @author: xiaoma
 * @blog  : www.i0day.com
 * @date  : 2014.10.11 10:3
 */
header("Content-type: text/html; charset=utf-8");
require_once '../config/mysql_conn.php';
require_once '../config/session.php';
require_once '../config/user_control.php';
$xss_res = new user_control();
$ip = $_GET['ip'];
$domain = $_GET['domain'];
$cookie_res = $xss_res->xss_info($ip, $domain);
?>

<div class="pageContent">
	<div class="tabs" currentIndex="0" eventType="click">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
					
					<li><span>信息</span></li>
					<li><a href="other_tools_action.php?domain=<?php 
echo $domain;
?>
&ip=<?php 
echo $ip;
?>
" class="j-ajax"><span>控制台</span></a></li>
Example #4
0
<?php

include 'includes/header.html';
include 'modules/user_control.php';
if (!isset($_GET['uid'])) {
    if (!isset($_GET['page'])) {
        $page = 1;
    } else {
        $page = $_GET['page'];
    }
    $user_cont = new user_control();
    $user_cont->show_all($page);
} else {
    $uid = $_GET['uid'];
    $user_cont = new user_control();
    $user_cont->show_detail($uid);
}
include 'includes/footer.html';
Example #5
0
<?php 
/**
 * @author: xiaoma
 * @blog  : www.i0day.com
 * @date  : 2014.10.19 21:37
 */
header("Content-type: text/html; charset=utf-8");
require_once '../config/mysql_conn.php';
require_once '../config/session.php';
require_once '../config/user_control.php';
$pro_res = new user_control();
$pro_list = $pro_res->other_tools();
Example #6
0
function roomcp_master()
{
    global $x7p, $x7s, $print, $db, $txt, $x7c, $prefix;
    // Check permissions to make sure they have access to the Room Control Panel
    if ($x7c->permissions['room_operator'] == 0) {
        $print->normal_window($txt[215], "++" . $txt[216]);
        return "";
    }
    $head = $txt[41];
    $body = $txt[217];
    if (!isset($_GET['cp_page'])) {
        $_GET['cp_page'] = "main";
    }
    if ($_GET['cp_page'] == "main") {
        // The main CP -- hmm, duh
        // Nothing needs done here
        $body = "<a href=\"index.php?act=admincp\">Vai al pannello di amministrazione generale</a>";
    } elseif ($_GET['cp_page'] == "settings") {
        $head = $txt[218];
        if ($x7c->permissions['make_rooms'] == 0) {
            $body = "--" . $txt[216];
            return;
        }
        if (!isset($_POST['topic'])) {
            // Some quick defaults
            if ($x7c->room_data['moderated'] == 1) {
                $def['moderated'] = " CHECKED";
            } else {
                $def['moderated'] = "";
            }
            if ($x7c->room_data['time'] == 0) {
                $def['neverexpire'] = " CHECKED";
            } else {
                $def['neverexpire'] = "";
            }
            if ($x7c->room_data['panic_free'] == 1) {
                $def['panic_free'] = " CHECKED";
            } else {
                $def['panic_free'] = "";
            }
            if ($x7c->room_data['hunt'] == 1) {
                $def['hunt'] = " CHECKED";
            } else {
                $def['hunt'] = "";
            }
            $body = "<Br><Br><form action=\"index.php?act=roomcp&cp_page=settings&room={$_GET['room']}\" method=\"post\">\n\t\t\t\t<table width=\"100%\" align=\"center\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"33%\">Descrizione:</td>\n \t\t\t\t\t\t<td ><textarea class=\"text_input\" name=\"topic\" style=\"width: 100%; height: 200px\">{$x7c->room_data['topic']}</textarea></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<input type=\"hidden\" class=\"text_input\" style=\"width: 100%;\" name=\"greeting\" value=\"{$x7c->room_data['greeting_raw']}\" autocomplete=\"off\">\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>{$txt['3']}:</td>\n\t\t\t\t\t\t<td><input type=\"password\" class=\"text_input\" style=\"width: 100%;\"  name=\"password\" autocomplete=\"off\" value=\"{$x7c->room_data['password']}\"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>{$txt['67']}:</td>\n\t\t\t\t\t\t<td><input type=\"text\" class=\"text_input\" style=\"width: 100%;\" name=\"max_users\" value=\"{$x7c->room_data['maxusers']}\"></td>\n\t\t\t\t\t</tr>\n                                        <td>Nome lungo:</td>\n\t\t\t\t\t\t\t\t<td width=\"100\"><input type=\"text\" style=\"width: 100%;\" class=\"text_input\" name=\"long_name\" value=\"{$x7c->room_data['long_name']}\"></td>\n\t\t\t\t\t";
            if ($x7c->permissions['set_background'] == 1 && $x7c->settings['enable_roombgs'] == 1) {
                $body .= "<tr>\n\t\t\t\t\t\t\t\t<td>Immagine per la descrizione:</font></td>\n\t\t\t\t\t\t\t\t<td><input type=\"text\" class=\"text_input\" style=\"width: 100%;\"  name=\"rm_bg\" value=\"{$x7c->room_data['background']}\"></td>\n\t\t\t\t\t\t\t</tr>";
            }
            if ($x7c->permissions['set_logo'] == 1 && $x7c->settings['enable_roomlogo'] == 1) {
                $body .= "<tr>\n\t\t\t\t\t\t\t\t<td>Immagine polaroid:</td>\n\t\t\t\t\t\t\t\t<td><input type=\"text\" class=\"text_input\" style=\"width: 100%;\"  name=\"image_url\" value=\"{$x7c->room_data['logo']}\"></td>\n\t\t\t\t\t\t\t\t<tr><td>&nbsp;</td><td><a onClick=\"javascript: window.open('index.php?act=images&subdir=polaroid','Images','location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes,width={$x7c->settings['tweak_window_large_width']},height={$x7c->settings['tweak_window_large_height']}');\">[Carica immagine]</a></td></tr>\n\t\t\t\t\t\t\t</tr>";
            }
            if ($x7c->room_data['type'] == 1) {
                $def['public'] = " selected=true";
                $def['private'] = "";
            } else {
                $def['public'] = "";
                $def['private'] = " selected=true";
            }
            $type_options = "<option value=\"1\"{$def['public']}>{$txt['68']}</option>";
            if ($x7c->permissions['make_proom'] != 0) {
                $type_options .= "<option value=\"2\"{$def['private']}>{$txt['69']}</option>";
            }
            $body .= "<tr>\n\t\t\t\t\t\t\t<td>{$txt['64']}:</td>\n\t\t\t\t\t\t\t<td><select class=\"text_input\" style=\"width: 100px;\" name=\"room_type\">{$type_options}</select></td>\n\t\t\t\t\t\t</tr>";
            $body .= "<tr>\n\t\t\t\t\t\t\t\t<td>Non &egrave; affetta dal panico:</td>\n\t\t\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"panic_free\" value=\"1\"{$def['panic_free']}></td>\n\t\t\t\t\t\t</tr>";
            $body .= "<tr>\n\t\t\t\t\t\t\t\t<td>Stanza hunt (random avatar):</td>\n\t\t\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"hunt\" value=\"1\"{$def['hunt']}></td>\n\t\t\t\t\t\t</tr>";
            $body .= "<tr>\n\t\t\t\t\t\t\t<td colspan=\"2\"><Br><div align=\"center\"><input type=\"submit\" class=\"text_input\" value=\"{$txt['187']}\"></div></td>\n\t\t\t\t\t\t</tr></form></table>";
        } else {
            // Update actual settings, print ok message
            include_once "./lib/rooms.php";
            // Check some values
            if ($_POST['max_users'] == "" || $_POST['max_users'] < 3) {
                $_POST['max_users'] = "3";
            }
            if (@$_POST['moderated'] == "" || $x7c->permissions['make_mod'] == 0) {
                $_POST['moderated'] = 0;
            }
            if ($x7c->permissions['make_proom'] == 0 || $_POST['room_type'] != 1 && $_POST['room_type'] != 2) {
                $_POST['room_type'] = 1;
            }
            if ($x7c->permissions['set_background'] == 0 || $x7c->settings['enable_roombgs'] == 0 || !isset($_POST['rm_bg'])) {
                $_POST['rm_bg'] = $x7c->room_data['background'];
            }
            if ($x7c->permissions['set_logo'] == 0 || $x7c->settings['enable_roomlogo'] == 0 || !isset($_POST['image_url'])) {
                $_POST['image_url'] = $x7c->room_data['logo'];
            }
            if (!isset($_POST['panic_free'])) {
                $_POST['panic_free'] = 0;
            }
            if (!isset($_POST['hunt'])) {
                $_POST['hunt'] = 0;
            }
            //We enable html formatting for the topic field
            $_POST['topic'] = preg_replace("/&lt;/i", "<", $_POST['topic']);
            $_POST['topic'] = preg_replace("/&gt;/i", ">", $_POST['topic']);
            $_POST['topic'] = preg_replace("/&quot;/i", "\"", $_POST['topic']);
            // Order `em up
            $new_settings[] = $_POST['room_type'];
            $new_settings[] = $_POST['moderated'];
            $new_settings[] = $_POST['topic'];
            $new_settings[] = $_POST['greeting'];
            $new_settings[] = $_POST['password'];
            $new_settings[] = $_POST['max_users'];
            $new_settings[] = $_POST['rm_bg'];
            $new_settings[] = $_POST['image_url'];
            $new_settings[] = $_POST['panic_free'];
            $new_settings[] = $_POST['long_name'];
            $new_settings[] = $_POST['hunt'];
            mass_change_roomsettings($_GET['room'], $new_settings);
            $body = $txt[210];
        }
    } elseif ($_GET['cp_page'] == "blocklist") {
        $head = $txt[141];
        if (@$_GET['subact'] == "ban" && isset($_POST['toban'])) {
            if (@$_POST['len_unlimited'] == 1) {
                $length = 0;
            } else {
                $length = $_POST['len_limited'] * $_POST['len_period'];
            }
            new_ban($_POST['toban'], $length, $_POST['reason'], $x7c->room_data['id']);
            $body = "{$txt['234']}<br><Br>";
        } elseif (@$_GET['subact'] == "unban") {
            remove_ban($_GET['banid'], $x7c->room_data['id']);
            $body = "{$txt['235']}<Br><Br>";
        } else {
            $body = "";
        }
        $body .= "{$txt['233']}<Br><Br><table border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"2\" class=\"col_header\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=\"100\">{$txt['224']}</td>\n\t\t\t\t\t\t\t<td width=\"110\">{$txt['223']}</td>\n\t\t\t\t\t\t\t<td width=\"50\">{$txt['225']}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"2\" class=\"inside_table\">";
        // Get the ban records
        $query = $db->DoQuery("SELECT * FROM {$prefix}banned WHERE room='{$x7c->room_data['id']}'");
        while ($row = $db->Do_Fetch_Row($query)) {
            if ($row[4] == 0) {
                $length = $txt[226];
            } else {
                $length = date("{$x7c->settings['date_format_full']}", $row[3] + $row[4]);
            }
            $body .= "<tr>\n\t\t\t\t\t\t\t\t<td width=\"100\" class=\"dark_row\"><a href=\"index.php?act=roomcp&cp_page=blocklist&subact=unban&banid={$row['0']}&room={$_GET['room']}\">{$row['2']}</a></td>\n\t\t\t\t\t\t\t\t<td width=\"110\" class=\"dark_row\">{$row['5']}</td>\n\t\t\t\t\t\t\t\t<td width=\"50\" class=\"dark_row\" style=\"text-align: center\">{$length}</td>\n\t\t\t\t\t\t\t</tr>";
        }
        $body .= "</table><Br><br>\n\t\t\t\t\t<form action=\"index.php?act=roomcp&cp_page=blocklist&subact=ban&room={$_GET['room']}\" method=\"post\">\n\t\t\t\t\t\t<table align=\"center\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"200\" colspan=\"2\"><div align=\"center\"><b>{$txt['222']}</b></div></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"100\">{$txt['224']}: </td>\n\t\t\t\t\t\t\t\t<td width=\"100\"><input type=\"text\" name=\"toban\" class=\"text_input\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"100\">{$txt['223']}: </td>\n\t\t\t\t\t\t\t\t<td width=\"100\"><input type=\"text\" name=\"reason\" class=\"text_input\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td width=\"100\">{$txt['225']}: </td>\n\t\t\t\t\t\t\t\t<td width=\"100\" style=\"text-align: center\">{$txt['226']} <input type=\"checkbox\" value=\"1\" name=\"len_unlimited\" CHECKED>\n\t\t\t\t\t\t\t\t\t<Br>{$txt['227']}\n\t\t\t\t\t\t\t\t\t<Br>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"text_input\" style=\"width: 45px;text-align: center;\" name=\"len_limited\" value=\"0\">\n\t\t\t\t\t\t\t\t\t<select name=\"len_period\" class=\"text_input\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"60\">{$txt['228']}</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3600\">{$txt['229']}</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"86400\">{$txt['230']}</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"604800\">{$txt['231']}</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2419200\">{$txt['232']}</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"200\" colspan=\"2\"><div align=\"center\"><input type=\"submit\" value=\"{$txt['222']}\" class=\"button\"></div></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</form>";
    } elseif ($_GET['cp_page'] == "ops") {
        $head = $txt[219];
        // Include the necessary librarys for this
        include_once "./lib/usercontrol.php";
        if (isset($_POST['add'])) {
            // Give them operator status
            $body = $txt[105] . "<Br><Br>";
            $uco = new user_control($_POST['add']);
            if ($uco->user_info->profile['id'] != "") {
                $uco->give_ops();
                $x7c->room_data['ops'] .= ";" . $uco->user_info->profile['id'];
            } else {
                $body = $txt[239] . "<Br><Br>";
            }
        } elseif (isset($_GET['revoke'])) {
            // Take away their operator status
            $body = $txt[106] . "<br><br>";
            $uco = new user_control($_GET['revoke']);
            $uco->take_ops();
            // Clear it so it isn't displayed again
            $ops = explode(";", $x7c->room_data['ops']);
            $ops_id = array_search($uco->user_info->profile['id'], $ops);
            unset($ops[$ops_id]);
            $x7c->room_data['ops'] = implode(";", $ops);
        } else {
            $body = "";
        }
        // Make a listing of all operators in this room
        $body .= $txt[236] . "<Br>";
        $ops = explode(";", $x7c->room_data['ops']);
        foreach ($ops as $key => $val) {
            $username = get_user_by_id($val);
            $body .= "<Br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"index.php?act=roomcp&cp_page=ops&room={$_GET['room']}&revoke={$username}\">{$username}</a>";
        }
        $body .= "<Br><Br><form action=\"index.php?act=roomcp&cp_page=ops&room={$_GET['room']}\" method=\"post\">\n\t\t\t{$txt['94']}: <input type=\"text\" name=\"add\" class=\"text_input\"> <input type=\"submit\" class=\"button\" value=\"{$txt['94']}\">\n\t\t\t</form><Br><Br>";
    } elseif ($_GET['cp_page'] == "voices") {
        $head = $txt[220];
        // Include the necessary librarys for this
        include_once "./lib/usercontrol.php";
        if (isset($_POST['add'])) {
            // Give them a voice
            $body = $txt[113] . "<Br><Br>";
            $uco = new user_control($_POST['add']);
            if ($uco->user_info->profile['id'] != "") {
                $uco->voice();
                $x7c->room_data['voiced'] .= ";" . $uco->user_info->profile['id'];
            } else {
                $body = $txt[239] . "<Br><Br>";
            }
        } elseif (isset($_GET['revoke'])) {
            // Take their voice
            $body = $txt[114] . "<br><br>";
            $uco = new user_control($_GET['revoke']);
            $uco->unvoice();
            // Clear it so it isn't displayed again
            $voice = explode(";", $x7c->room_data['voiced']);
            $voice_id = array_search($uco->user_info->profile['id'], $voice);
            unset($voice[$voice_id]);
            $x7c->room_data['voiced'] = implode(";", $voice);
        } else {
            $body = "";
        }
        // Make a listing of all voiced users in this room
        $body .= $txt[237] . "<Br>";
        $voice = explode(";", $x7c->room_data['voiced']);
        foreach ($voice as $key => $val) {
            if ($val > 0) {
                $username = get_user_by_id($val);
                $body .= "<Br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"index.php?act=roomcp&cp_page=voices&room={$_GET['room']}&revoke={$username}\">{$username}</a>";
            }
        }
        $body .= "<Br><Br><form action=\"index.php?act=roomcp&cp_page=voices&room={$_GET['room']}\" method=\"post\">\n\t\t\t{$txt['99']}: <input type=\"text\" name=\"add\" class=\"text_input\"> <input type=\"submit\" class=\"button\" value=\"{$txt['99']}\">\n\t\t\t</form><Br><Br>";
    } elseif ($_GET['cp_page'] == "mutes") {
        $head = $txt[221];
        // Include the necessary librarys for this
        include_once "./lib/usercontrol.php";
        if (isset($_POST['add'])) {
            // Mute them
            $body = $txt[111] . "<Br><Br>";
            $uco = new user_control($_POST['add']);
            if ($uco->user_info->profile['id'] != "") {
                $uco->mute();
                $x7c->room_data['voiced'] .= ";-" . $uco->user_info->profile['id'];
            } else {
                $body = $txt[239] . "<Br><Br>";
            }
        } elseif (isset($_GET['revoke'])) {
            // Make them on longer muted
            $body = $txt[112] . "<br><br>";
            $uco = new user_control($_GET['revoke']);
            $uco->unmute();
            // Clear it so it isn't displayed again
            $mute = explode(";", $x7c->room_data['voiced']);
            $mute_id = array_search("-{$uco->user_info->profile['id']}", $mute);
            unset($mute[$mute_id]);
            $x7c->room_data['voiced'] = implode(";", $mute);
        } else {
            $body = "";
        }
        // Make a listing of all operators in this room
        $body .= $txt[238] . "<Br>";
        $mute = explode(";", $x7c->room_data['voiced']);
        foreach ($mute as $key => $val) {
            if ($val < 0) {
                $val = $val * -1;
                $username = get_user_by_id($val);
                $body .= "<Br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"index.php?act=roomcp&cp_page=mutes&room={$_GET['room']}&revoke={$username}\">{$username}</a>";
            }
        }
        $body .= "<Br><Br><form action=\"index.php?act=roomcp&cp_page=mutes&room={$_GET['room']}\" method=\"post\">\n\t\t\t{$txt['93']}: <input type=\"text\" name=\"add\" class=\"text_input\"> <input type=\"submit\" class=\"button\" value=\"{$txt['93']}\">\n\t\t\t</form><Br><Br>";
    } elseif ($_GET['cp_page'] == "logs") {
        $head = $txt[240];
        if ($x7c->permissions['access_room_logs'] == 0) {
            $body = "--" . $txt[216];
        } else {
            include_once "./lib/logs.php";
            $log = new logs(1, $_GET['room']);
            if (isset($_GET['subact'])) {
                if ($_GET['subact'] == 'enable') {
                    // Enable logging
                    include_once "./lib/rooms.php";
                    change_roomsetting($_GET['room'], "logged", 1);
                    $x7c->room_data['logged'] = 1;
                } elseif ($_GET['subact'] == 'disable') {
                    // Disable logging
                    include_once "./lib/rooms.php";
                    change_roomsetting($_GET['room'], "logged", 0);
                    $x7c->room_data['logged'] = 0;
                } elseif ($_GET['subact'] == 'clear') {
                    // Clear the log
                    $log->clear();
                    $log->log_size = 0;
                }
            }
            if ($x7c->room_data['logged'] == 1) {
                $body = "{$txt['242']}.  <a href=\"index.php?act=roomcp&cp_page=logs&subact=disable&room={$_GET['room']}\">[{$txt['245']}]</a><Br><Br>";
            } else {
                $body = "{$txt['243']}.  <a href=\"index.php?act=roomcp&cp_page=logs&subact=enable&room={$_GET['room']}\">[{$txt['244']}]</a><Br><Br>";
            }
            // Display file size information
            if ($x7c->settings['max_log_room'] != 0) {
                $percent1 = round($log->log_size / $x7c->settings['max_log_room'], 2) * 100;
                $percent1 .= "%";
                $percent2 = 100 - $percent1 . "%";
                $fs1 = round($log->log_size / 1024, 2);
                $fs2 = round(($x7c->settings['max_log_room'] - $log->log_size) / 1024, 2);
            } else {
                $percent1 = $txt[248];
                $percent2 = $txt[248];
                $fs1 = round($log->log_size / 1024, 2);
                $fs2 = "({$txt['248']})";
            }
            $txt[246] = eregi_replace("_p", "{$percent1}", $txt[246]);
            $txt[247] = eregi_replace("_p", "{$percent2}", $txt[247]);
            $txt[246] = eregi_replace("_s", "{$fs1}", $txt[246]);
            $txt[247] = eregi_replace("_s", "{$fs2}", $txt[247]);
            $body .= "{$txt['246']}<Br>{$txt['247']}<Br><Br>";
            // If logging is enabled then show the log
            if ($x7c->room_data['logged'] == 1) {
                // Get the log contents
                $contents = $log->get_log_contents_per_date();
                // Calculate the pages display
                $selected_date = "";
                if (isset($_POST['date'])) {
                    $selected_date = "value=\"{$_POST['date']}\"";
                }
                $pages = '<script language="javascript" type="text/javascript" src="lib/datetimepicker.js" ></script>
					<script language="javascript" type="text/javascript">
						function jump_to_date(date_str) {
							document.getElementById(\'demo1\').value = date_str;
							document.forms[0].submit();

						}
					</script>
					<form id="dateform" name="dateform1" action="index.php?act=roomcp&cp_page=logs&room=' . $_GET['room'] . '" method="post">
						<input type="Text" name="date" id="demo1" maxlength="15" size="15" ' . $selected_date . '><a href="javascript:NewCal(\'demo1\',\'ddmmyyyy\',false,24)"><img src="graphic/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
					</form>
					';
                $body .= "<Br>{$pages}<hr>";
                include_once "./lib/message.php";
                $body .= '<div style="background: black; color: white;">';
                $header = false;
                $count = 0;
                foreach ($contents as $linenum => $entry) {
                    // Get date and sender
                    $count++;
                    $message = "";
                    $match = "";
                    if (preg_match("/^(.+?);\\[(.+?)\\]/", $entry, $match)) {
                        $entry = preg_replace("/^(.+?);\\[(.+?)\\]/", "", $entry);
                        $date = date($x7c->settings['date_format_full'], $match[1]);
                        $sender = $match[2];
                        // Get message
                        $message = $entry;
                    } else {
                        $message = "<b>Warning: wrong log format </b>" . $entry;
                    }
                    if (!$header) {
                        if ($match) {
                            $date_short = date("j/n/Y", $match[1]);
                            $body .= "<a href=\"#\" onClick=\"javascript: jump_to_date('{$date_short}');\"> &lt;&lt;&lt; {$date_short}</a><br><br>";
                        }
                        $header = true;
                    } else {
                        if ($count == sizeof($contents)) {
                            if ($match) {
                                $date_short = date("j/n/Y", $match[1]);
                                $body .= "<a href=\"#\" onClick=\"javascript: jump_to_date('{$date_short}');\">{$date_short} &gt;&gt;&gt;</a><br><br>";
                            }
                        } else {
                            $body .= "<b>{$sender}</b>[{$date}]: {$message}<br><br>";
                        }
                    }
                }
                $body .= "</div><hr>{$pages}<Br><Br>";
            }
        }
    }
    // THis mini-function determines what the active section link is
    function whatsmyclass($id)
    {
        $x = $_GET['cp_page'];
        if ($x == $id) {
            return " class=\"ucp_sell\"";
        } else {
            return " class=\"ucp_cell\" onMouseOver=\"javascript: this.className='ucp_sell'\" onMouseOut=\"javascript: this.className='ucp_cell'\"  onClick=\"javascript: window.location='./index.php?act=roomcp&cp_page={$id}&room={$_GET['room']}'\"";
        }
    }
    // Add the menu to the body
    $cbody = "<div align=\"center\">\n\t\t\t<table border=\"0\" width=\"95%\" class=\"ucp_table\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<td width=\"20%\" height=\"100%\">\n\t\t\t\t\t\t<table class=\"ucp_table2\" height=\"100%\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"100%\"" . whatsmyclass("main") . ">{$txt['137']}</td>\n\t\t\t\t\t\t\t</tr>";
    if ($x7c->permissions['make_rooms'] == 1) {
        $cbody .= "\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"100%\"" . whatsmyclass("settings") . ">{$txt['218']}</td>\n\t\t\t\t\t\t\t</tr>";
    }
    if ($x7c->permissions['access_room_logs'] == 1) {
        $cbody .= "\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td width=\"100%\"" . whatsmyclass("logs") . ">{$txt['240']}</td>\n\t\t\t\t\t\t\t\t</tr>";
    }
    $cbody .= "<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td width=\"100%\" class=\"ucp_cell\" style=\"cursor: default;\" height=\"100%\"><Br>";
    //if($x7c->settings['single_room_mode'] == "")
    //	$cbody .= 					"<a href=\"./index.php\">[$txt[29]]</a><Br>";
    $cbody .= "<a href=\"#\" onClick=\"javascript: window.close();\">[{$txt['133']}]</a><Br><Br>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>";
    $cbody .= "</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t<Td width=\"5\" class=\"ucp_divider\">&nbsp;</td>\n\t\t\t\t\t<td class=\"ucp_bodycell\">{$body}</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</div>";
    $print->normal_window($head, $print->ss_ucp . $cbody);
}