NuestraRED.org/portalcautivo2/index.html

239 lines
10 KiB
HTML
Raw Permalink Normal View History

2019-04-05 04:47:54 +00:00
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="noindex, nofollow, noodp, noydir" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="copyright" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
2019-04-05 05:17:18 +00:00
<title>Acceso a la red comunitaria NuestraRed.org</title>
2019-04-05 04:47:54 +00:00
<!-- Bootstrap -->
2019-04-05 13:01:46 +00:00
<link rel="stylesheet" href="css/captiveportal-bootstrap.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="css/captiveportal-all.css" crossorigin="anonymous">
2019-04-05 04:47:54 +00:00
<link href="css/signin.css" rel="stylesheet">
<!-- static zone info -->
<script src="js/zone.js"></script>
<script src="js/jquery-1.11.2.min.js"></script>
<!-- <script src="js/captiveportal-jquery.min.js"></script> -->
2019-04-05 13:01:46 +00:00
2019-04-05 04:47:54 +00:00
<script>
function getURLparams()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
$( document ).ready(function() {
/**
* logon action
*/
$("#signin").click(function (event) {
event.preventDefault();
// hide alerts
$("#alertMSG").addClass("hidden");
// try to login
$.ajax({
type: "POST",
url: "/api/captiveportal/access/logon/" + zoneid + "/",
dataType:"json",
data:{ user: $("#inputUsername").val(), password: $("#inputPassword").val() }
}).done(function(data) {
// redirect on successful login
if (data['clientState'] == 'AUTHORIZED') {
if (getURLparams()['redirurl'] != undefined) {
window.location = 'http://'+getURLparams()['redirurl']+'?refresh';
} else {
// no target, reload page
window.location.reload();
}
} else {
$("#inputUsername").val("");
$("#inputPassword").val("");
$("#errorMSGtext").html("authentication failed");
$("#alertMSG").removeClass("hidden");
}
}).fail(function(){
$("#errorMSGtext").html("unable to connect to authentication server");
$("#alertMSG").removeClass("hidden");
});
});
/**
* login anonymous, only applicable when server is configured without authentication
*/
$("#signin_anon").click(function (event) {
event.preventDefault();
// hide alerts
$("#alertMSG").addClass("hidden");
// try to login
$.ajax({
type: "POST",
url: "/api/captiveportal/access/logon/" + zoneid + "/",
dataType:"json",
data:{ user: '', password: '' }
}).done(function(data) {
// redirect on successful login
if (data['clientState'] == 'AUTHORIZED') {
if (getURLparams()['redirurl'] != undefined) {
window.location = 'http://'+getURLparams()['redirurl']+'?refresh';
} else {
window.location.reload();
}
} else {
$("#inputUsername").val("");
$("#inputPassword").val("");
$("#errorMSGtext").html("login failed");
$("#alertMSG").removeClass("hidden");
}
}).fail(function(){
$("#errorMSGtext").html("unable to connect to authentication server");
$("#alertMSG").removeClass("hidden");
});
});
/**
* logoff action
*/
$("#logoff").click(function (event) {
event.preventDefault();
// hide alerts
$("#alertMSG").addClass("hidden");
// try to login
$.ajax({
type: "POST",
url: "/api/captiveportal/access/logoff/" + zoneid + "/",
dataType:"json",
data:{ user: '', password: '' }
}).done(function(data) {
// refresh page
window.location.reload();
}).fail(function(){
$("#errorMSGtext").html("unable to connect to authentication server");
$("#alertMSG").removeClass("hidden");
});
});
/**
* close / hide error message
*/
$("#btnCloseError").click(function(){
$("#alertMSG").addClass("hidden");
});
/**
* execute after pageload
*/
$.ajax({
type: "POST",
url: "/api/captiveportal/access/status/" + zoneid + "/",
dataType:"json",
data:{ user: $("#inputUsername").val(), password: $("#inputPassword").val() }
}).done(function(data) {
if (data['clientState'] == 'AUTHORIZED') {
$("#logout_frm").removeClass('hidden');
} else if (data['authType'] == 'none') {
$("#login_none").removeClass('hidden');
} else {
$("#login_password").removeClass('hidden');
}
}).fail(function(){
$("#errorMSGtext").html("unable to connect to authentication server");
$("#alertMSG").removeClass("hidden");
});
});
</script>
</head>
<body>
2019-04-05 13:01:46 +00:00
<div class="container register">
<div class="row">
<div class="col-md-3 register-left">
<img src="images/captiveportal-logoNRwhite.png" alt="" />
<h3>¡Bienvenid@!</h3>
<p>¡Estás muy cerca de entrar al mundo Web!</p>
</div>
<div class="col-md-9 register-right">
<ul class="nav nav-tabs nav-justified" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="true">Sin Internet</a>
</li>
<li class="nav-item">
<a class="nav-link " id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="false">Con Internet</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show" id="home" role="tabpanel" aria-labelledby="home-tab">
<h3 class="register-heading">Entrar con Internet</h3>
<div class="row register-form">
<div class="col-md-12">
<div id="login_password" class="hidden">
2019-04-05 13:01:46 +00:00
<form class="form-signin">
<!-- <h2 class="form-signin-heading">Please sign in</h2> -->
2019-04-05 13:01:46 +00:00
<label for="inputUsername" class="sr-only">Usuario</label>
<input type="text" id="inputUsername" class="form-control" placeholder="Usuario" required autofocus autocomplete="none" autocapitalize="none" autocorrect="off">
2019-04-05 13:01:46 +00:00
<label for="inputPassword" class="sr-only">Contraseña</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Contraseña" required>
2019-04-05 13:01:46 +00:00
<button class="btn btn-primary btn-block" id="signin" type="button">Ingresar</button>
</form>
</div>
<!-- User option 3: Already logged in, show logout button -->
<div id="logout_frm" class="hidden">
<form class="form-signin">
<button class="btn btn-primary btn-block" id="logoff" type="button">Salir</button>
</form>
</div>
2019-04-05 13:01:46 +00:00
</div>
</div>
</div>
<div class="tab-pane fade show active" id="profile" role="tabpanel" aria-labelledby="profile-tab">
<h3 class="register-heading">Ver contenidos sin Internet</h3>
<div class="row register-form">
<div class="boton_entrar">
<div class="container boton_entrar">
<div class="col-md-12 ">
<a href="https://nuestrared.org">
<button class="btn btn-default circle_button" > <strong style="font-size: 25px">Entrar</strong> <span class="circle-greater-than"></span></button>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
2019-04-05 04:47:54 +00:00
</div>
2019-04-05 13:01:46 +00:00
</div>
2019-04-05 04:47:54 +00:00
2019-04-05 13:01:46 +00:00
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
2019-04-05 13:01:46 +00:00
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/captiveportal-bootstrap.min.js"></script>
2019-04-05 04:47:54 +00:00
</body>
</html>