Initial commit
[2ch-be.git] / dev-test / old_dev / zwitch / ban.php
blobbc1d7719adef609416577f60f63e2c70fa5d25c8
1 <?php
2 error_reporting(E_ALL); ini_set("display_errors", 1);
3 include('config.php');
4 $n="";
5 if(isset($_POST['sban'])) {
6 $id = trim($_POST['ban']);
7 $ban = new Message;
8 $user = trim($ban->FindUser($id, $id_mail_path));
9 $fdir = substr($user, 0, 1);
10 $sdir = substr($user, 1, 1);
11 $path = DB_PATH.$fdir."/".$sdir."/".$user;
12 $info = file($path);
13 $info['3'] = "500\n";
14 $data = implode($info);
15 if(file_put_contents($path, $data))
16 $n = "User ".$id." has been blocked";
18 include 'include/header.php';
21 <body><center>
22 <div class="container margintopandbottom">
23 <?php include 'menu.php';?>
24 <div class="panel panel-default ban">
25 <h2>Ban user from BE Messaging</h2><br><br>
26 <form method="post">
27 <input type="text" name="ban" placeholder="User ID"><br><br>
28 <input type="submit" name="sban" class="btn btn-default" value="Submit">
29 <br><br>
30 <?php echo $n; ?>
31 </form>
32 </div>
33 </div>
34 </center>
35 </body>
36 </html>