2008-10-04 03:35:17 +04:00
|
|
|
<?php
|
|
|
|
/*
|
2013-03-07 01:22:53 +04:00
|
|
|
* Copyright 2005-2013 the original author or authors.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2008-10-04 03:35:17 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
require_once('../libs/common.php');
|
|
|
|
require_once('../libs/chat.php');
|
|
|
|
require_once('../libs/operator.php');
|
|
|
|
require_once('../libs/pagination.php');
|
|
|
|
|
|
|
|
$operator = check_login();
|
|
|
|
$page = array();
|
|
|
|
$errors = array();
|
|
|
|
|
2009-06-04 05:14:26 +04:00
|
|
|
setlocale(LC_TIME, getstring("time.locale"));
|
|
|
|
|
2008-10-04 03:35:17 +04:00
|
|
|
$link = connect();
|
|
|
|
|
2011-02-26 17:06:19 +03:00
|
|
|
if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
2008-10-04 03:35:17 +04:00
|
|
|
$banId = isset($_GET['id']) ? $_GET['id'] : "";
|
|
|
|
|
2011-02-26 17:06:19 +03:00
|
|
|
if (!preg_match("/^\d+$/", $banId)) {
|
2009-06-05 15:38:24 +04:00
|
|
|
$errors[] = "Cannot delete: wrong argument";
|
2008-10-04 03:35:17 +04:00
|
|
|
}
|
|
|
|
|
2011-02-26 17:06:19 +03:00
|
|
|
if (count($errors) == 0) {
|
|
|
|
perform_query("delete from ${mysqlprefix}chatban where banid = $banId", $link);
|
2008-10-04 03:35:17 +04:00
|
|
|
header("Location: $webimroot/operator/blocked.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-10 15:13:11 +04:00
|
|
|
$blockedList = select_multi_assoc("select banid,unix_timestamp(dtmtill) as till,address,comment from ${mysqlprefix}chatban", $link);
|
2008-10-04 03:35:17 +04:00
|
|
|
|
2011-11-09 18:16:37 +04:00
|
|
|
close_connection($link);
|
2008-10-04 03:35:17 +04:00
|
|
|
|
|
|
|
setup_pagination($blockedList);
|
|
|
|
|
2009-03-16 04:20:04 +03:00
|
|
|
prepare_menu($operator);
|
2008-10-04 03:35:17 +04:00
|
|
|
start_html_output();
|
2009-06-05 15:38:24 +04:00
|
|
|
|
2008-10-04 03:35:17 +04:00
|
|
|
require('../view/blocked_visitors.php');
|
|
|
|
exit;
|
2011-11-09 18:16:37 +04:00
|
|
|
?>
|