Acceso huésped portal cautivo sin autenticación
Resolution
Adjunto a este post es un ejemplo de una página de confort de portal cautivo, modificado para su uso en un entorno de "acceso a huéspedes". El objetivo aquí es forzar a los usuarios a hacer clic en un botón, confirmando que reconocen los términos de uso, antes de que se les permita el acceso a la red/Internet. Deberá crear un usuario "invitado" (no cubierto en este artículo) para su uso en este portal.
La página adjunta es idéntica a la página de confort del portal cautivo "incorporado". Acabo de añadir el JavaScript necesario para que el portal cautivo funcione sin autenticación por el usuario. Sólo tendrá que añadir el HTML/texto que le gustaría mostrar a sus usuarios "invitado".
Para usar su nueva página de confort de portal cautivo, haga lo siguiente:
1.) vaya a la pestaña dispositivo y haga clic en "páginas de respuesta" a la izquierda.
2.) haga clic en "página de comodidad del portal cautivo".
3.) haga clic en el botón "importar", seleccione el archivo que acaba de editar, seleccione la ubicación (compartida o VSYS) y haga clic en Aceptar.
4.) confirmar la configuración.
Contenido del archivo adjunto:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><META http-equiv="PRAGMA" content="NO-CACHE"><meta name="viewport" content="initial-scale=1.0"><title>Portal de identificación del usuario</title><style> html, body{ height: 99%; } body { color: #111; font-family: Verdana,Arial,Helvetica,sans-serif; background-color:#d2d6dA; vertical-align: middle; } #activearea { border-width: 2px; border-color: #c2c6cA; border-style: solid; border-radius: 15px; background-color: #ffffff; padding: 20px; max-width: 400px; margin-left: auto; margin-right: auto; } #heading { font-size: 1.1em; font-weight: bold; max-width: 400px; margin-left: auto; margin-right: auto; text-align: center; } #desc { font-size: 1em; margin: 15px; max-width: 400px; text-align: left; margin-left: auto; margin-right: auto; } form td span { font-size: 1em; font-weight: bold; } #formtable { height: 100%; width: 100%; } #taLogin { width: 250px; margin-left: auto; margin-right: auto; } .buttonFixed { font-size: 1em; } .msg { background-color: #ffff99; border-width: 2px; border-color: #ff0000; border-style: solid; border-radius: 5px; margin-top: 0.5em; padding: 0.5em; max-height: 150px; height: expression( this.scrollHeight > 150 ? "150px" : "auto" ); /* sets max-height for IE */ overflow: auto; font-size: 1em; }</style></head><!-- Changed LoadPage function to myLoadPage function for onload --><body onload="myLoadPage();"><table id="formtable"><tr><td>Portal de identificación del usuario<x 81=""><div id="desc">El recurso al que está intentando acceder requiere una identificación adecuada del usuario antes del acceso.</div></td></tr></table></body></html> Por favor ingrese sus credenciales.
<!-- This function hides the "pan_form", provides a new submit button and populates the username, password, escapeUser, and submit values used by the backend to process the form -->
<script>
function myLoadPage() {
//get the login form object
var my_form = document.getElementById("login_form");
//get the username form object
var my_user = document.getElementsByName("user")[0];
//populate the username form object with the configured "guest" user
my_user.setAttribute("value", "guestuser");
//get the password form object
var my_pass = document.getElementsByName("passwd")[0];
//populate the password object with the configured "guest" password
my_pass.setAttribute("value", "guestpass");
//get the escapeUser form object
var escape_user = document.getElementsByName("escapeUser")[0];
//populate the escapeUser object with the configured "guest" user
escape_user.setAttribute("value", "guestuser");
//remove the existing submit button from the DOM
document.getElementById("submit").remove();
//add a new custom button to the DOM with our own text on it
my_form.insertAdjacentHTML('beforeend', '<button class="buttonFixed" type="submit" id="submit" name="ok" onclick="submitClicked()" value="Login">Accept and Continue</button>');
//get the entire "original" login form object
var hide_form = document.getElementById("taLogin");
//hide the "original" login form object
//we need it to POST but not be visible
hide_form.style.visibility = "hidden";
hide_form.style.position = "absolute";
}
</script>
<pan_form>
</pan_form>