init: workspace opencode sync
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
$API->comm("/ip/hotspot/user/set", array(
|
||||
".id" => "$disablehotspotuser",
|
||||
"disabled" => "yes",
|
||||
));
|
||||
if ($_SESSION['ubp'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&profile=" . $_SESSION['ubp'] . "&session=" . $session . "'</script>";
|
||||
} elseif ($_SESSION['ubc'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&comment=" . $_SESSION['ubc'] . "&session=" . $session . "'</script>";
|
||||
} else {
|
||||
echo "<script>window.location='./?hotspot=users&profile=all&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
$API->comm("/ip/hotspot/user/set", array(
|
||||
".id" => "$enablehotspotuser",
|
||||
"disabled" => "no",
|
||||
));
|
||||
if ($_SESSION['ubp'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&profile=" . $_SESSION['ubp'] . "&session=" . $session . "'</script>";
|
||||
} elseif ($_SESSION['ubc'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&comment=" . $_SESSION['ubc'] . "&session=" . $session . "'</script>";
|
||||
} else {
|
||||
echo "<script>window.location='./?hotspot=users&profile=all&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2019 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
if (!isset($_SESSION["mikhmon"])) {
|
||||
header("Location:../admin.php?id=login");
|
||||
} else {
|
||||
// load session MikroTik
|
||||
$session = $_GET['session'];
|
||||
|
||||
// load config
|
||||
include('../include/config.php');
|
||||
$iphost = explode('!', $data[$session][1])[1];
|
||||
$userhost = explode('@|@', $data[$session][2])[1];
|
||||
$passwdhost = explode('#|#', $data[$session][3])[1];
|
||||
$curency = explode('&', $data[$session][6])[1];
|
||||
|
||||
// lang
|
||||
include('../include/lang.php');
|
||||
include('../lang/'.$langid.'.php');
|
||||
|
||||
include_once('../lib/routeros_api.class.php');
|
||||
|
||||
$API = new RouterosAPI();
|
||||
$API->debug = false;
|
||||
$API->connect($iphost, $userhost, decrypt($passwdhost));
|
||||
|
||||
$uprofname = $_GET['name'];
|
||||
if ($uprofname != "") {
|
||||
$getprofile = $API->comm("/ip/hotspot/user/profile/print", array("?name" => "$uprofname"));
|
||||
$ponlogin = $getprofile[0]['on-login'];
|
||||
$getvalid = $_validity. " : " . explode(",", $ponlogin)[3];
|
||||
$getprice = explode(",", $ponlogin)[2];
|
||||
$getsprice = explode(",", $ponlogin)[4];
|
||||
$getlock = "| ".$_lock_user." : " . explode(",", $ponlogin)[6];
|
||||
if ($getprice == 0) {
|
||||
} else {
|
||||
if ($curency == "Rp" || $curency == "rp" || $curency == "IDR" || $curency == "idr") {
|
||||
$price = "| ".$_price." : " . $curency . " " . number_format($getprice, 0, ",", ".");
|
||||
} else {
|
||||
$price = "| ".$_price." : " . $curency . " " . number_format($getprice);
|
||||
}
|
||||
}
|
||||
if ($getsprice == 0) {
|
||||
} else {
|
||||
if ($curency == "Rp" || $curency == "rp" || $curency == "IDR" || $curency == "idr") {
|
||||
$sprice = "| ".$_selling_price." : " . $curency . " " . number_format($getsprice, 0, ",", ".");
|
||||
} else {
|
||||
$sprice = "| ".$_selling_price." : " . $curency . " " . number_format($getsprice);
|
||||
}
|
||||
}
|
||||
echo '<b id="getdata">' . $getvalid . ' ' . $price . ' ' . $sprice . ' ' . $getlock . '</b>';
|
||||
echo '<span id="validity">' . explode(",", $ponlogin)[3] . '</span> ';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
echo "<meta http-equiv='refresh' content='0;url=../' />";
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
// remove ip binding
|
||||
if ($removeipbinding != "") {
|
||||
$API->comm("/ip/hotspot/ip-binding/remove", array(
|
||||
".id" => "$removeipbinding",
|
||||
));
|
||||
|
||||
$getqueue = $API->comm("/queue/simple/print", array(
|
||||
"?name" => "$macbinding",
|
||||
));
|
||||
|
||||
$squeue = $getqueue[0]['.id'];
|
||||
|
||||
$API->comm("/queue/simple/remove", array(
|
||||
".id" => "$squeue",
|
||||
));
|
||||
|
||||
$getvalid = $API->comm("/system/scheduler/print", array(
|
||||
"?name" => "$macbinding",
|
||||
));
|
||||
|
||||
$svalid = $getvalid[0]['.id'];
|
||||
|
||||
$API->comm("/system/scheduler/remove", array(
|
||||
".id" => "$svalid",
|
||||
));
|
||||
|
||||
$getarp = $API->comm("/ip/arp/print", array(
|
||||
"?address" => "$ipbinding",
|
||||
));
|
||||
$sarp = $getarp[0]['.id'];
|
||||
|
||||
$API->comm("/ip/arp/remove", array(
|
||||
".id" => "$sarp",
|
||||
));
|
||||
|
||||
$getlease = $API->comm("/ip/dhcp-server/lease/print", array(
|
||||
"?address" => "$ipbinding",
|
||||
));
|
||||
|
||||
$slease = $getlease[0]['.id'];
|
||||
|
||||
$API->comm("/ip/dhcp-server/lease/remove", array(
|
||||
".id" => "$slease",
|
||||
));
|
||||
|
||||
//redirect to ipbinding
|
||||
echo "<script>window.location='./?hotspot=ipbinding&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
// enable ip binging
|
||||
elseif ($enableipbinding != "") {
|
||||
$API->comm("/ip/hotspot/ip-binding/set", array(
|
||||
".id" => "$enableipbinding",
|
||||
"disabled" => "no",
|
||||
));
|
||||
|
||||
echo "<script>window.location='./?hotspot=ipbinding&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
// disable ip binging
|
||||
elseif ($disableipbinding != "") {
|
||||
$API->comm("/ip/hotspot/ip-binding/set", array(
|
||||
".id" => "$disableipbinding",
|
||||
"disabled" => "yes",
|
||||
));
|
||||
|
||||
echo "<script>window.location='./?hotspot=ipbinding&session=" . $session . "'</script>";
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
// remove scheduler
|
||||
if ($removesch != "") {
|
||||
$API->comm("/system/scheduler/remove", array(
|
||||
".id" => "$removesch",
|
||||
));
|
||||
|
||||
echo "<script>window.location='./?system=scheduler&session=" . $session . "'</script>";
|
||||
}
|
||||
// enable scheduler
|
||||
elseif ($enablesch != "") {
|
||||
$API->comm("/system/scheduler/set", array(
|
||||
".id" => "$enablesch",
|
||||
"disabled" => "no",
|
||||
));
|
||||
|
||||
echo "<script>window.location='./?system=scheduler&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
// disable scheduler
|
||||
elseif ($disablesch != "") {
|
||||
$API->comm("/system/scheduler/set", array(
|
||||
".id" => "$disablesch",
|
||||
"disabled" => "yes",
|
||||
));
|
||||
|
||||
echo "<script>window.location='./?system=scheduler&session=" . $session . "'</script>";
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
if (!isset($_SESSION["mikhmon"])) {
|
||||
header("Location:../admin.php?id=login");
|
||||
} else {
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
$API = new RouterosAPI();
|
||||
$API->debug = false;
|
||||
if ($API->connect($iphost, $userhost, decrypt($passwdhost))) {
|
||||
$API->write('/system/reboot');
|
||||
$API->read();
|
||||
}
|
||||
session_destroy();
|
||||
echo "<script>window.location='./admin.php?id=login'</script>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div style="padding-top:10%;" class="register-box">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-power-off"></i> Reboot MikroTik</h3>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
<div>
|
||||
<h3><?= $_reboot.' '. $session; ?>?</h3>
|
||||
</div>
|
||||
<button class="btn bg-warning" type="submit" title="Yes" name="submit"><?= $_yes ?></button>
|
||||
<a class="btn bg-primary" href="./?hotspot=dashboard&session=<?= $session; ?>" title="No"> <?= $_no ?> </a>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
// remove host
|
||||
$API->comm("/ip/hotspot/cookie/remove", array(
|
||||
".id" => "$removecookie",
|
||||
));
|
||||
// redirect to host
|
||||
echo "<script>window.location='./?hotspot=cookies&session=" . $session . "'</script>";
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
$getuser = $API->comm("/ip/hotspot/user/print", array(
|
||||
"?limit-uptime" => "1s",
|
||||
));
|
||||
$TotalReg = count($getuser);
|
||||
|
||||
$_SESSION['ubp'] = $getuser[0]['profile'];
|
||||
$_SESSION['ubc'] = "";
|
||||
|
||||
for ($i = 0; $i < $TotalReg; $i++) {
|
||||
$userdetails = $getuser[$i];
|
||||
$uid = $userdetails['.id'];
|
||||
|
||||
$API->comm("/ip/hotspot/user/remove", array(
|
||||
".id" => "$uid",
|
||||
));
|
||||
}
|
||||
if ($_SESSION['ubp'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&profile=" . $_SESSION['ubp'] . "&session=" . $session . "'</script>";
|
||||
} else {
|
||||
echo "<script>window.location='./?hotspot=users&profile=all&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
// remove host
|
||||
$API->comm("/ip/hotspot/host/remove", array(
|
||||
".id" => "$removehost",
|
||||
));
|
||||
// redirect to host
|
||||
echo "<script>window.location='./?hotspot=hosts&session=" . $session . "'</script>";
|
||||
?>
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
if ($removehotspotusers != "") {
|
||||
$uids = explode("~", $removehotspotusers);
|
||||
|
||||
$nuids = count($uids);
|
||||
|
||||
for ($i = 0; $i < $nuids; $i++) {
|
||||
|
||||
$getuname = $API->comm("/ip/hotspot/user/print", array(
|
||||
"?.id" => "$uids[$i]",
|
||||
));
|
||||
|
||||
$name = $getuname[0]['name'];
|
||||
|
||||
$getscr = $API->comm("/system/script/print", array(
|
||||
"?name" => "$name",
|
||||
));
|
||||
|
||||
$scr = $getscr[0]['.id'];
|
||||
|
||||
$getsch = $API->comm("/system/scheduler/print", array(
|
||||
"?name" => "$name",
|
||||
));
|
||||
|
||||
$sch = $getsch[0]['.id'];
|
||||
|
||||
$API->comm("/system/script/remove", array(
|
||||
".id" => "$scr",
|
||||
));
|
||||
|
||||
$API->comm("/system/scheduler/remove", array(
|
||||
".id" => "$sch",
|
||||
));
|
||||
|
||||
$API->comm("/ip/hotspot/user/remove", array(
|
||||
".id" => "$uids[$i]",
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
if ($_SESSION['ubp'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&profile=" . $_SESSION['ubp'] . "&session=" . $session . "'</script>";
|
||||
} elseif ($_SESSION['ubc'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&comment=" . $_SESSION['ubc'] . "&session=" . $session . "'</script>";
|
||||
} else {
|
||||
echo "<script>window.location='./?hotspot=users&profile=all&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$getuname = $API->comm("/ip/hotspot/user/print", array(
|
||||
"?.id" => "$removehotspotuser",
|
||||
));
|
||||
|
||||
$name = $getuname[0]['name'];
|
||||
|
||||
$getscr = $API->comm("/system/script/print", array(
|
||||
"?name" => "$name",
|
||||
));
|
||||
|
||||
$scr = $getscr[0]['.id'];
|
||||
|
||||
$getsch = $API->comm("/system/scheduler/print", array(
|
||||
"?name" => "$name",
|
||||
));
|
||||
|
||||
$sch = $getsch[0]['.id'];
|
||||
|
||||
$API->comm("/system/script/remove", array(
|
||||
".id" => "$scr",
|
||||
));
|
||||
|
||||
$API->comm("/system/scheduler/remove", array(
|
||||
".id" => "$sch",
|
||||
));
|
||||
|
||||
$API->comm("/ip/hotspot/user/remove", array(
|
||||
".id" => "$removehotspotuser",
|
||||
));
|
||||
|
||||
|
||||
if ($_SESSION['ubp'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&profile=" . $_SESSION['ubp'] . "&session=" . $session . "'</script>";
|
||||
} elseif ($_SESSION['ubc'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&comment=" . $_SESSION['ubc'] . "&session=" . $session . "'</script>";
|
||||
} else {
|
||||
echo "<script>window.location='./?hotspot=users&profile=all&session=" . $session . "'</script>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
$getuser = $API->comm("/ip/hotspot/user/print", array(
|
||||
"?comment" => "$removehotspotuserbycomment",
|
||||
"?uptime" => "00:00:00"
|
||||
));
|
||||
$TotalReg = count($getuser);
|
||||
|
||||
$_SESSION['ubp'] = $getuser[0]['profile'];
|
||||
$_SESSION['ubc'] = "";
|
||||
|
||||
for ($i = 0; $i < $TotalReg; $i++) {
|
||||
$userdetails = $getuser[$i];
|
||||
$uid = $userdetails['.id'];
|
||||
|
||||
$API->comm("/ip/hotspot/user/remove", array(
|
||||
".id" => "$uid",
|
||||
));
|
||||
}
|
||||
if ($_SESSION['ubp'] != "") {
|
||||
echo "<script>window.location='./?hotspot=users&profile=" . $_SESSION['ubp'] . "&session=" . $session . "'</script>";
|
||||
} else {
|
||||
echo "<script>window.location='./?hotspot=users&profile=all&session=" . $session . "'</script>";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
$API->comm("/ppp/active/remove", array(
|
||||
".id" => "$removepactive",
|
||||
));
|
||||
|
||||
echo "<script>window.location='./?ppp=active&session=" . $session . "'</script>";
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
if ($removereport != "") {
|
||||
$uids = explode("~", $removereport);
|
||||
|
||||
$nuids = count($uids);
|
||||
|
||||
for ($i = 0; $i < $nuids; $i++) {
|
||||
|
||||
$API->comm("/system/script/remove", array(
|
||||
".id" => "$uids[$i]",
|
||||
));
|
||||
|
||||
}
|
||||
$_SESSION[$session.'idhr'] = "";
|
||||
}
|
||||
echo "<script>window.location='./?report=selling".$_SESSION['report']."&session=" . $session . "'</script>";
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
// get user active
|
||||
$getuser = $API->comm("/ip/hotspot/active/print", array(
|
||||
"?.id" => "$removeuseractive",
|
||||
));
|
||||
$user = $getuser[0]['user'];
|
||||
// get cookie id
|
||||
$getcookie = $API->comm("/ip/hotspot/cookie/print", array(
|
||||
"?user" => "$user",
|
||||
));
|
||||
$ck = $getcookie[0]['.id'];
|
||||
// remove cookie
|
||||
$API->comm("/ip/hotspot/cookie/remove", array(
|
||||
".id" => "$ck",
|
||||
));
|
||||
// remove user active
|
||||
$API->comm("/ip/hotspot/active/remove", array(
|
||||
".id" => "$removeuseractive",
|
||||
));
|
||||
// redirect to user active
|
||||
echo "<script>window.location='./?hotspot=active&session=" . $session . "'</script>";
|
||||
?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
$pid = $removeuserprofile;
|
||||
$pname = $_GET['pname'];
|
||||
|
||||
$getmonid = $API->comm("/system/scheduler/print", array(
|
||||
"?name" => "$pname",
|
||||
));
|
||||
$monid = $getmonid[0]['.id'];
|
||||
|
||||
$API->comm("/ip/hotspot/user/profile/remove", array(
|
||||
".id" => "$pid",
|
||||
));
|
||||
$API->comm("/system/scheduler/remove", array(
|
||||
".id" => "$monid",
|
||||
));
|
||||
echo "<script>window.location='./?hotspot=user-profiles&session=" . $session . "'</script>";
|
||||
?>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
$API->comm("/ip/hotspot/user/set", array(
|
||||
".id" => "$resethotspotuser", "limit-uptime" => "0", "comment" => ""
|
||||
));
|
||||
$API->comm("/ip/hotspot/user/reset-counters", array(
|
||||
".id" => "$resethotspotuser",
|
||||
));
|
||||
|
||||
$getuname = $API->comm("/ip/hotspot/user/print", array(
|
||||
"?.id" => "$resethotspotuser",
|
||||
));
|
||||
$uname = $getuname[0]['name'];
|
||||
|
||||
$getsname = $API->comm("/system/scheduler/print", array(
|
||||
"?name" => "$uname",
|
||||
));
|
||||
$removesch = $getsname[0]['.id'];
|
||||
|
||||
$API->comm("/system/scheduler/remove", array(
|
||||
".id" => "$removesch",
|
||||
));
|
||||
|
||||
echo "<script>window.location='./?hotspot-user=" . $resethotspotuser . "&session=" . $session . "'</script>";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
if (!isset($_SESSION["mikhmon"])) {
|
||||
header("Location:../admin.php?id=login");
|
||||
} else {
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
$API = new RouterosAPI();
|
||||
$API->debug = false;
|
||||
if ($API->connect($iphost, $userhost, decrypt($passwdhost))) {
|
||||
$API->write('/system/shutdown');
|
||||
$API->read();
|
||||
}
|
||||
session_destroy();
|
||||
echo "<script>window.location='./admin.php?id=login'</script>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div style="padding-top:10%;" class="register-box">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-power-off"></i> Shutdown MikroTik</h3>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
<div>
|
||||
<h3><?= $_shutdown.' '. $session; ?>?</h3>
|
||||
</div>
|
||||
<button class="btn bg-warning" type="submit" title="Yes" name="submit"><?= $_yes ?></button>
|
||||
<a class="btn bg-primary" href="./?hotspot=dashboard&session=<?= $session; ?>" title="No"> <?= $_no ?> </a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user