ruckus vsz
This commit is contained in:
78
Ruckus/vsz/index.php
Normal file
78
Ruckus/vsz/index.php
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if (!isset($_POST['submit'])) {
|
||||||
|
$_SESSION['url'] = "http://" . $_GET['nbiIP'] . ":9080/portalintf";
|
||||||
|
$_SESSION['client_mac'] = $_GET['client_mac'];
|
||||||
|
$_SESSION['uip'] = $_GET['uip'];
|
||||||
|
} else {
|
||||||
|
$username = $_POST['username'];
|
||||||
|
$password = $_POST['password'];
|
||||||
|
|
||||||
|
$postData = [
|
||||||
|
"Vendor" => "ruckus",
|
||||||
|
"RequestUserName" => "admin",
|
||||||
|
"RequestPassword" => "Admin@123",
|
||||||
|
"APIVersion" => "1.0",
|
||||||
|
"RequestCategory" => "UserOnlineControl",
|
||||||
|
"RequestType" => "Login",
|
||||||
|
"UE-IP" => $_SESSION["uip"],
|
||||||
|
"UE-MAC" => $_SESSION["client_mac"],
|
||||||
|
"UE-Proxy" => "0",
|
||||||
|
"UE-Username" => $username,
|
||||||
|
"UE-Password" => $password
|
||||||
|
];
|
||||||
|
|
||||||
|
$curl = curl_init();
|
||||||
|
|
||||||
|
curl_setopt_array($curl, array(
|
||||||
|
CURLOPT_URL => $_SESSION['url'],
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_ENCODING => '',
|
||||||
|
CURLOPT_MAXREDIRS => 10,
|
||||||
|
CURLOPT_TIMEOUT => 0,
|
||||||
|
CURLOPT_SSL_VERIFYPEER => false,
|
||||||
|
CURLOPT_SSL_VERIFYHOST => false,
|
||||||
|
CURLOPT_FOLLOWLOCATION => true,
|
||||||
|
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||||
|
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||||
|
CURLOPT_POSTFIELDS => json_encode($postData),
|
||||||
|
CURLOPT_HTTPHEADER => array(
|
||||||
|
'Content-Type: application/json'
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
|
$response = curl_exec($curl);
|
||||||
|
|
||||||
|
curl_close($curl);
|
||||||
|
|
||||||
|
if ($response !== false) {
|
||||||
|
$json = json_decode($response, true);
|
||||||
|
echo "<pre>" . json_encode($json, JSON_PRETTY_PRINT) . "</pre>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
die("Error: check with your network administrator");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>WiFi Portal</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Welcome!<br>
|
||||||
|
Please login to our Wifi service</p>
|
||||||
|
|
||||||
|
<form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>>
|
||||||
|
<label>User Name: <input type="text" name="username"></label><br/>
|
||||||
|
<label>Password: <input type="text" name="password"></label><br/>
|
||||||
|
<input type="submit" name="submit" value="LOGIN" />
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user