Changeset 178 for minimanager/banned.php


Ignore:
Timestamp:
Dec 23, 2007, 2:55:36 PM (17 years ago)
Author:
george
Message:

Minimanager 0.1.6b

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/banned.php

    r142 r178  
    88 * License: GNU General Public License v2(GPL)
    99 */
    10  
     10
    1111require_once("header.php");
    1212valid_login(1);
     
    2929 $order_dir = ($dir) ? "ASC" : "DESC";
    3030 $dir = ($dir) ? 0 : 1;
    31        
     31
    3232 $query_1 = $sql->query("SELECT count(*) FROM $ban_type");
    3333 $all_record = $sql->result($query_1,0);
     
    5353 </script>
    5454 <table class=\"lined\">
    55    <tr> 
     55   <tr>
    5656        <th width=\"5%\">{$lang_global['delete_short']}</td>
    5757        <th width=\"19%\"><a href=\"banned.php?order_by=$key_field&amp;ban_type=$ban_type&amp;dir=$dir\"".($order_by==$key_field ? " class=\"$order_dir\"" : "").">{$lang_banned['ip_acc']}</a></th>
     
    7272                        $owner_acc_name = $ban[0];
    7373                }
    74  
     74
    7575  $output .= "<tr>
    7676                        <td><img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>$owner_acc_name</font><br />{$lang_global['are_you_sure']}', del_banned + '$ban[0]');\" style=\"cursor:pointer;\" /></td>
     
    9898 $sql = new SQL;
    9999 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    100  
     100
    101101 if(isset($_GET['ban_type'])) $ban_type = $sql->quote_smart($_GET['ban_type']);
    102102        else redirect("banned.php?error=1");
     
    166166//########################################################################################################################
    167167function do_add_entry() {
    168  global $lang_global, $realm_db, $user_name;
     168 global $lang_global, $realm_db, $user_name, $lang_banned, $output;
    169169
    170170 if((empty($_GET['ban_type']))||(empty($_GET['entry'])) ||(empty($_GET['bantime'])))
     
    173173 $sql = new SQL;
    174174 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    175  
     175
    176176 $ban_type = $sql->quote_smart($_GET['ban_type']);
    177177
     
    182182                else $entry = $sql->result($result1, 0, 'id');
    183183 }
    184  
     184
    185185 $bantime = time() + (3600 * $sql->quote_smart($_GET['bantime']));
    186  
    187  $banreason = (isset($_GET['banreason']) && ($_POST['banreason'] != '')) ? $sql->quote_smart($_GET['banreason']) : "none";
     186
     187 $banreason = (isset($_GET['banreason']) && ($_GET['banreason'] != '')) ? $sql->quote_smart($_GET['banreason']) : "none";
    188188
    189189 if ($ban_type === "account_banned"){
    190190        $result = $sql->query("SELECT count(*) FROM account_banned WHERE id = '$entry'");
    191191        if(!$sql->result($result, 0))
    192                 $sql->query("INSERT INTO account_banned (id, bandate, unbandate, bannedby, banreason, active) 
     192                $sql->query("INSERT INTO account_banned (id, bandate, unbandate, bannedby, banreason, active)
    193193                                           VALUES ('$entry',".time().",$bantime,'$user_name','$banreason', 1)");
    194194
     
    197197                                                VALUES ('$entry',".time().",$bantime,'$user_name','$banreason')");
    198198                }
    199                        
     199
    200200 if ($sql->affected_rows()) {
    201201        $sql->close();
     
    213213//########################################################################################################################
    214214$err = (isset($_GET['error'])) ? $_GET['error'] : NULL;
    215        
     215
    216216$output .= "<div class=\"top\">";
    217217switch ($err) {
Note: See TracChangeset for help on using the changeset viewer.