Initial commit
[2ch-be.git] / zwitch / switch.php
blob869d344fc75851aabc2abc23b56a15ad795c1f57
1 <?php
2 $ind_path = "/home/auth/secure_html/control/indicator.txt";
3 $aa = "";
5 if(isset($_POST['switch'])) {
6 $mode = abs(file_get_contents($ind_path));
8 $bak_inbox = "/home/auth/secure_html/control/replacement/inbox.bak.php";
9 $bak_msg = "/home/auth/secure_html/control/replacement/message.bak.php";
10 $bak_mproc = "/home/auth/secure_html/control/replacement/message_proc.bak.php";
11 $bak_p = "/home/auth/secure_html/control/replacement/p.bak.php";
12 $bak_reply = "/home/auth/secure_html/control/replacement/reply.bak.php";
14 $orig_inbox = "/home/auth/public_html/inbox.php";
15 $orig_msg = "/home/auth/public_html/message.php";
16 $orig_mproc = "/home/auth/public_html/message_proc.php";
17 $orig_p = "/home/auth/public_html/test/p.php";
18 $orig_reply = "/home/auth/public_html/reply.php";
20 $b_orig_inbox = "/home/auth/secure_html/control/original/inbox.orig.php";
21 $b_orig_msg = "/home/auth/secure_html/control/original/message.orig.php";
22 $b_orig_mproc = "/home/auth/secure_html/control/original/message_proc.orig.php";
23 $b_orig_p = "/home/auth/secure_html/control/original/p.orig.php";
24 $b_orig_reply = "/home/auth/secure_html/control/original/reply.orig.php";
26 if($mode == "0") {
27 file_put_contents($orig_inbox,file_get_contents($bak_inbox));
28 file_put_contents($orig_msg,file_get_contents($bak_msg));
29 file_put_contents($orig_mproc,file_get_contents($bak_mproc));
30 file_put_contents($orig_p,file_get_contents($bak_p));
31 file_put_contents($orig_reply,file_get_contents($bak_reply));
32 file_put_contents($ind_path,"1");
33 $aa = "<h4>BE Messaging successfully turned <a style=\"color:red;\">OFF</a></h4>";
34 } elseif($mode == "1") {
35 file_put_contents($orig_inbox,file_get_contents($b_orig_inbox));
36 file_put_contents($orig_msg,file_get_contents($b_orig_msg));
37 file_put_contents($orig_mproc,file_get_contents($b_orig_mproc));
38 file_put_contents($orig_p,file_get_contents($b_orig_p));
39 file_put_contents($orig_reply,file_get_contents($b_orig_reply));
40 file_put_contents($ind_path,"0");
41 $aa = "<h4>BE Messaging successfully turned <a style=\"color:green;\">ON</a></h4>";
45 $mode = abs(file_get_contents($ind_path));
46 if($mode == "0")
47 $btn = "<input type=\"submit\" name=\"switch\" class=\"btn btn-default\" value=\"OFF\">";
48 elseif($mode == "1")
49 $btn = "<input type=\"submit\" name=\"switch\" class=\"btn btn-default\" value=\"ON\">";
51 include 'include/header.php';
53 <body><center>
55 <div class="container margintopandbottom">
56 <?php include 'menu.php'; ?>
57 <form method="post">
58 <div class="panel panel-default ban"><h2>BE Messaging Switch</h2><br><br>
59 Turn <?php echo $btn; ?> BE Messaging.
60 <br><br>
61 <?php echo $aa; ?>
62 </div>
63 </form>
64 </div>
65 </center>
66 </body>
67 </html>