Ejemplo n.º 1
0
function GetBanFromUID($uid)
{
    $res = DB::Execute("SELECT flags,reason,expiry,appeal FROM {P}Bans WHERE uid='{$uid}'");
    if ($res->RecordCount() == 0) {
        return array();
    }
    // NO BAN
    $row = $res->FetchRow();
    list($flags, $reason, $expiry, $appeal) = $row;
    $td = $expiry - $_SERVER['REQUEST_TIME'];
    //	echo "TD: $td";
    if ($td < 0) {
        remove_id_ban($uid);
        remove_ip_ban($ip);
        return array();
    }
    return $row;
}
Ejemplo n.º 2
0
     Output::$tpl->display('controlpanel/banform.end.php');
     include 'includes/footer.php';
     exit;
     break;
     break;
 case 'unban_uid':
     if (!$moderator && !$administrator) {
         add_error('You are not wise enough.', true);
     }
     if (!id_exists($_GET['id'])) {
         add_error('There is no such user.', true);
     }
     $id = $_GET['id'];
     $page_title = 'Unban poster ' . $id;
     if (isset($_POST['id'])) {
         remove_id_ban($id);
         redirect('User ID unbanned.');
     }
     break;
 case 'unban_ip':
     if (!$moderator && !$administrator) {
         add_error('You are not wise enough.', true);
     }
     if (!filter_var($_GET['id'], FILTER_VALIDATE_IP)) {
         add_error('That is not a valid IP address.', true);
     }
     $id = $_GET['id'];
     $page_title = 'Unban IP address ' . $id;
     if (isset($_POST['id'])) {
         remove_ip_ban($id);
         redirect('IP address unbanned.');