forked from ferchang/reg8log
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_unban_user.php
More file actions
33 lines (20 loc) · 1.18 KB
/
Copy pathcode_unban_user.php
File metadata and controls
33 lines (20 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
if(ini_get('register_globals')) exit("<center><h3>Error: Turn that damned register globals off!</h3></center>");
if(!isset($parent_page)) exit("<center><h3>Error: Direct access denied!</h3></center>");
require_once $index_dir.'include/code/code_db_object.php';
require_once $index_dir.'include/code/code_fetch_site_vars.php';
$lock_name=$reg8log_db->quote_smart('reg8log--ban-'.strtolower($_POST['username'])."--$site_key");
$reg8log_db->query("select get_lock($lock_name, -1)");
$username=$reg8log_db->quote_smart($_POST['username']);
$query='update `accounts` set `banned`=0 where `username`='.$username.' limit 1';
$reg8log_db->query($query);
$query='delete from `ban_info` where `username`='.$username.' limit 1';
$reg8log_db->query($query);
$reg8log_db->query("select release_lock($lock_name)");
$success_msg='<h3>'.tr('User').' <span style="color: orange">'.htmlspecialchars($_POST['username'], ENT_QUOTES, 'UTF-8').'</span> '.tr('unbanned successfully.').'</h3>';
$no_specialchars=true;
$additional_link=array(tr('Admin operations'), 'index.php');
require $index_dir.'include/page/page_success.php';
require $index_dir.'include/code/code_set_submitted_forms_cookie.php';
exit;
?>