Acceso Xestion.

This commit is contained in:
Laegnur 2022-10-23 22:35:04 +02:00
parent b6a37ca1fd
commit b2b8dcfb83
11 changed files with 334 additions and 174 deletions

View file

@ -2,7 +2,7 @@
* @FONTS
* =============================================================================
*
* fonts.css v0.1.12 | GNU GPL License |
* fonts.css v0.1.13 | GNU GPL License |
*
*/
@ -90,13 +90,13 @@
@font-face
{
font-family: 'icomoon';
src: url('../fonts/icomoon_Regular.eot?jfx2ev'); /* 1 */
src: url('../fonts/icomoon_Regular.eot?jfx2ev#iefix') format('embedded-opentype'), /* 2 */
url('../fonts/icomoon_Regular.woff2?jfx2ev') format('woff2'), /* 3 */
url('../fonts/icomoon_Regular.woff?jfx2ev') format('woff'), /* 4 */
url('../fonts/icomoon_Regular.otf?jfx2ev') format('opentype'), /* 5 */
url('../fonts/icomoon_Regular.ttf?jfx2ev') format('truetype'), /* 5 */
url('../fonts/icomoon_Regular.svg?jfx2ev#icomoon') format('svg'); /* 6 */
src: url('../fonts/icomoon_Regular.eot?srs48a'); /* 1 */
src: url('../fonts/icomoon_Regular.eot?srs48a#iefix') format('embedded-opentype'), /* 2 */
url('../fonts/icomoon_Regular.woff2?srs48a') format('woff2'), /* 3 */
url('../fonts/icomoon_Regular.woff?srs48a') format('woff'), /* 4 */
url('../fonts/icomoon_Regular.otf?srs48a') format('opentype'), /* 5 */
url('../fonts/icomoon_Regular.ttf?srs48a') format('truetype'), /* 5 */
url('../fonts/icomoon_Regular.svg?srs48a#icomoon') format('svg'); /* 6 */
font-display: block;
font-style: normal;
font-weight: normal;
@ -107,9 +107,9 @@
*
*/
[class^="icon-"],
[class*=" icon-"]
{
[class^="icon-"],
[class*=" icon-"]
{
font-family: 'icomoon' !important;
font-variant: normal;
font-style: normal;
@ -117,84 +117,99 @@
text-transform: none;
speak: never;
}
}
.icon-chevrons-right:before
{
.icon-chevrons-right:before
{
content: "\e900";
}
}
.icon-edit:before
{
.icon-edit:before
{
content: "\e901";
}
}
.icon-document-file-txt:before
{
.icon-document-file-txt:before
{
content: "\e902";
}
}
.icon-corner-right-down:before
{
.icon-corner-right-down:before
{
content: "\e903";
}
}
.icon-folder:before
{
.icon-folder:before
{
content: "\e904";
}
}
.icon-tag:before
{
.icon-tag:before
{
content: "\e905";
}
}
.icon-book-open:before
{
.icon-book-open:before
{
content: "\e906";
}
}
.icon-book:before
{
.icon-book:before
{
content: "\e907";
}
}
.icon-arrow-right:before
{
.icon-arrow-right:before
{
content: "\e908";
}
}
.icon-user:before
{
.icon-user:before
{
content: "\e909";
}
}
.icon-skip-back:before
{
.icon-skip-back:before
{
content: "\e90a";
}
}
.icon-skip-forward:before
{
.icon-skip-forward:before
{
content: "\e90b";
}
}
.icon-play:before
{
.icon-play:before
{
content: "\e90c";
}
}
.icon-search:before
{
.icon-search:before
{
content: "\e90d";
}
}
.icon-settings:before
{
.icon-settings:before
{
content: "\e90e";
}
}
.icon-home:before
{
.icon-home:before
{
content: "\e90f";
}
}
.icon-alert-circle:before
{
content: "\e910";
}
.icon-check-circle:before
{
content: "\e911";
}
.icon-x-circle:before
{
content: "\e912";
}

View file

@ -507,6 +507,81 @@ figure.enlace figcaption a
text-transform: uppercase;
}
form#inicio-sesion
{
display: flex;
flex-direction: column;
width: 80%;
margin: 0 auto;
padding: 10px;
border: 1px solid rgb(var(--cor_10));
border-radius: 0.625rem;
text-align: center;
}
form#inicio-sesion div#notificacions
{
margin-bottom: 10px;
border: 1px solid;
border-radius: 0.625rem;
}
form#inicio-sesion div#notificacions.erro
{
color: #D8000C;
background-color: #FFBABA;
}
form#inicio-sesion div#notificacions.alerta
{
color: #9f6000;
background-color: #feefb3;
}
form#inicio-sesion div#notificacions.exito
{
color: #4f8a10;
background-color: #dff2bf;
}
form#inicio-sesion div#notificacions.info
{
color: #00529b;
background-color: #bde5f8;
}
form#inicio-sesion div#notificacions h3
{
margin: 0;
padding: 10px;
color: inherit;
}
form#inicio-sesion div.elemento
{
display: flex;
flex-direction: row;
margin-bottom: 10px;
}
form#inicio-sesion div.elemento > *
{
width: 50%;
}
.contedor
{
width: 90%;
@ -657,6 +732,11 @@ figure.enlace figcaption a
height: 200px;
}
form#inicio-sesion
{
width: 50%;
}
div.celda.esquerda
{
flex-direction: row;

View file

@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<metadata>
Created by FontForge 20201107 at Sun Oct 23 17:16:18 2022
Created by FontForge 20201107 at Sun Oct 23 17:42:08 2022
By Unknown
</metadata>
<defs>
@ -94,5 +94,20 @@ q18 -8 37.5 -9t38.5 4q13 4 25.5 11t22.5 17l3 3q7 6 14.5 9t15.5 3q9 0 16.5 -3t14.
<glyph glyph-name="uniE90F" unicode="&#xe90f;"
d="M102 588q-8 -6 -12.5 -14.5t-4.5 -18.5v-470q0 -26 10 -49.5t28 -40.5q17 -17 40.5 -27.5t49.5 -10.5h598q26 0 49.5 10t40.5 28q17 17 27.5 40.5t10.5 49.5v470q0 9 -4.5 18t-12.5 15l-384 299q-11 9 -25.5 9t-26.5 -9zM683 43v384q0 17 -12.5 29.5t-30.5 12.5h-256
q-18 0 -30.5 -12.5t-12.5 -29.5v-384h-128q-8 0 -16 3t-14 9t-9 14t-3 16v449l341 265l341 -265v-449q0 -8 -3 -16t-9 -14t-14 -9t-16 -3h-128zM427 43v341h170v-341h-170z" />
<glyph glyph-name="uniE910" unicode="&#xe910;"
d="M981 427q0 48 -9 94q-10 46 -27.5 88t-43.5 80q-25 38 -57 70q-32 31 -70 57q-37 25 -79 43t-88 27q-46 10 -95 10t-95 -10q-46 -9 -88 -27t-79 -43q-38 -26 -70 -57q-32 -32 -57 -70q-26 -38 -43.5 -80t-27.5 -88q-9 -46 -9 -94q0 -49 9 -95q10 -46 27.5 -88t43.5 -80
q25 -37 57 -69t70 -57q37 -26 79 -44t88 -27q46 -10 95 -10t95 10q46 9 88 27t79 44q38 25 70 57t57 69q26 38 43.5 80t27.5 88q9 46 9 95zM896 427q0 -80 -30 -150t-82 -122q-53 -52 -122.5 -82t-149.5 -30t-149.5 30t-122.5 82q-52 52 -82 122t-30 150q0 79 30 149t82 122
q53 52 122.5 82.5t149.5 30.5t149.5 -30.5t122.5 -82.5q52 -52 82 -122t30 -149v0zM469 597v-170q0 -18 12.5 -30.5t30.5 -12.5t30.5 12.5t12.5 30.5v170q0 18 -12.5 30.5t-30.5 12.5t-30.5 -12.5t-12.5 -30.5v0zM512 213q18 0 30.5 12.5t12.5 30.5t-12.5 30.5t-30.5 12.5
t-30.5 -12.5t-12.5 -30.5t12.5 -30.5t30.5 -12.5z" />
<glyph glyph-name="uniE911" unicode="&#xe911;"
d="M896 466v-39q0 -80 -30 -150t-83 -122q-52 -52 -122 -82t-149 -30q-80 0 -150 30t-122 83q-52 52 -82 122t-30 149q0 80 30 149.5t83 122.5q52 52 122 82t149 30q43 0 82.5 -9t73.5 -24q16 -8 32.5 -1.5t23.5 22.5q8 16 1.5 32.5t-22.5 23.5q-42 20 -90.5 30.5
t-100.5 10.5q-48 0 -94 -9q-46 -10 -88.5 -27.5t-79.5 -43.5q-38 -25 -70 -57t-57 -69q-25 -38 -43 -80t-28 -88q-9 -46 -9 -95q0 -48 9 -94q10 -46 27.5 -88.5t43.5 -79.5q25 -38 57 -70t69 -57q38 -26 80 -43.5t88 -27.5q46 -9 95 -9q48 0 94 9q46 10 88.5 27.5t79.5 43.5
q38 25 70 57t57 69q25 38 43 80t28 88q9 46 9 95v39q0 18 -12.5 30.5t-29.5 12.5q-18 0 -30.5 -12.5t-12.5 -30.5v0zM909 798l-397 -397l-98 98q-12 13 -30 13t-30 -13q-13 -12 -13 -30t13 -30l128 -128q12 -13 30 -13t30 13l427 427q12 12 12 30t-12 30q-13 13 -30.5 13
t-29.5 -13v0z" />
<glyph glyph-name="uniE912" unicode="&#xe912;"
d="M981 427q0 48 -9 94q-10 46 -27.5 88t-43.5 80q-25 38 -57 70q-32 31 -70 57q-37 25 -79 43t-88 27q-46 10 -95 10t-95 -10q-46 -9 -88 -27t-79 -43q-38 -26 -70 -57q-32 -32 -57 -70q-26 -38 -43.5 -80t-27.5 -88q-9 -46 -9 -94q0 -49 9 -95q10 -46 27.5 -88t43.5 -80
q25 -37 57 -69t70 -57q37 -26 79 -44t88 -27q46 -10 95 -10t95 10q46 9 88 27t79 44q38 25 70 57t57 69q26 38 43.5 80t27.5 88q9 46 9 95zM896 427q0 -80 -30 -150t-82 -122q-53 -52 -122.5 -82t-149.5 -30t-149.5 30t-122.5 82q-52 52 -82 122t-30 150q0 79 30 149t82 122
q53 52 122.5 82.5t149.5 30.5t149.5 -30.5t122.5 -82.5q52 -52 82 -122t30 -149v0zM354 525l98 -98l-98 -98q-13 -13 -13 -30.5t13 -29.5q12 -13 30 -13t30 13l98 97l98 -97q12 -13 30 -13t30 13q13 12 13 29.5t-13 30.5l-98 98l98 98q13 12 13 29.5t-13 30.5q-12 12 -30 12
t-30 -12l-98 -98l-98 98q-12 12 -30 12t-30 -12q-13 -13 -13 -30.5t13 -29.5z" />
</font>
</defs></svg>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,30 @@
function getToken(event)
{
event.preventDefault();
grecaptcha.ready(function()
{
grecaptcha.execute('6LexXqYiAAAAACwDpMGIg1OMnAXVJU0VmbEMQUD8', { action: 'submit' }).then(function(token)
{
var form = document.getElementById("inicio-sesion");
var boton_token = document.createElement('input');
boton_token.type = 'hidden';
boton_token.name = 'token';
boton_token.id = 'token';
boton_token.value = token;
var boton_action = document.createElement('input');
boton_action.type = 'hidden';
boton_action.name = 'action';
boton_action.id = 'action';
boton_action.value = 'submit';
form.appendChild(boton_token);
form.appendChild(boton_action);
form.submit();
});;
});
}

View file

@ -1,93 +1,111 @@
<?php namespace ProcessWire;
if($input->post->user && $input->post->pass)
{
$user = $sanitizer->username($input->post->user);
$pass = $input->post->pass;
define("RECAPTCHA_V3_SECRET_KEY", '6LexXqYiAAAAAOoFqs4kfWd7zW6stVRK0aViyiQo');
if($input->post->usuario && $input->post->contrasinal)
{
$user = $sanitizer->username($input->post->usuario);
$pass = $input->post->contrasinal;
}
$token = $input->post->token;
$action = $input->post->action;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.google.com/recaptcha/api/siteverify");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('secret' => RECAPTCHA_V3_SECRET_KEY, 'response' => $token)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$arrResponse = json_decode($response, true);
if($arrResponse["success"] == '1' && $arrResponse["action"] == $action && $arrResponse["score"] >= 0.5)
{
if($session->login($user, $pass))
{
$session->redirect($page->parent->httpUrl);
}
}
$url1 = $sanitizer->name($input->urlSegment1);
$resEmpresa = null;
$q = "template=empresa, name={$url1}, limit=1";
if($url1)
{
if($pages->count($q))
{
$resEmpresa = $pages->find($q)->first();
setcookie("w_empresa", $resEmpresa->name , time()+4000000, "/gestion/");
}
else
{
$session->redirect($page->parent->httpUrl);
setcookie("w_empresa", "", time()-3600);
$mensaxe_tipo = "erro";
$mensaxe = _x('Wrong username or password', 'Wrong username or password');
}
}
else
{
setcookie("w_empresa", "", time()-3600);
unset($_COOKIE['w_empresa']);
$mensaxe_tipo = "alerta";
$mensaxe = _x('Wrong reCaptcha', 'Wrong reCaptcha');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
?><!DOCTYPE html>
<html lang="<?php echo _x('en', 'HTML language code'); ?>">
<head>
<title><?php echo $titulo; ?></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body class="login">
<div>
<a class="hiddenanchor" id="signup"></a>
<a class="hiddenanchor" id="signin"></a>
<link rel="icon" type="image/png" sizes="32x32" href="<?php echo $config->urls->templates; ?>images/favicon-32x32.png">
<link rel="shortcut icon" href="<?php echo $config->urls->templates; ?>images/favicon.ico">
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates; ?>css/reset.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates; ?>css/fonts.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates; ?>css/swiper.css" />
<link title="Praia de Seselle" rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>css/style.css" />
<style>
:root
{
font-size: 16px;
<div class="login_wrapper">
<div class="animate form login_form">
<section class="login_content">
<form action="/es/gestion/acceder/" method='post' >
<?php if ($url1 || $resEmpresa): ?>
<img src="<?php echo $resEmpresa->imagen->first()->url; ?>" class="img-responsive"><br>
<?php else: ?>
<h1>Disnav Gestión</h1>
<?php endif; ?>
<?php if($input->post->user) echo "<h2 class='error '>Usuario o contraseña incorrecta</h2>"; ?>
<div>
<input type="text" name="user" class="form-control" placeholder="Usuario">
</div>
<div>
<input type="password" name="pass" class="form-control login-password" placeholder="Contraseña">
</div>
<div>
<!-- <a class="btn btn-default submit" href="index.html">Entrar</a> -->
<input type='submit' name='submit' value='Entrar' class="btn btn-default btn-block btn-validation" />
</div>
<div class="clearfix"></div>
<div class="separator">
<div class="clearfix"></div>
<br />
<div>
<p>©2016 All Rights Reserved. Developed by <a href="http://www.procgal.es" target="_blank">Procgal</a></p>
--cor_60: <?php echo $configuracion['cor_fondo'] ?>;
--cor_30: <?php echo $configuracion['cor_principal'] ?>;
--cor_10: <?php echo $configuracion['cor_secundario'] ?>;
}
</style>
</head>
<body>
<a href="#contido" class="visually-hidden element-focusable bypass-to-main"><?php echo _x('Skip to content', 'bypass'); ?></a>
<header id="cabeceira">
<div class="contedor">
<div id="logo">
<picture>
<source srcset="<?php echo $config->urls->templates?>images/logo-praia-seselle-150x116.jpg" media="(max-width: 767px)">
<source srcset="<?php echo $config->urls->templates?>images/logo-praia-seselle-230x179.jpg" media="(min-width: 768px)">
<img src="<?php echo $config->urls->templates?>images/logo-praia-seselle.svg" alt="<?php echo _x('Logo of Praia de Seselle Tourist Apartments', 'Site logo'); ?>">
</picture>
<h1 class="visually-hidden"><?php echo $configuracion['sitio_nome']; ?> <?php echo $configuracion['sitio_descripcion']; ?></h1>
</div>
</div>
</header>
<main id="contido">
<div class="contedor">
<form id="inicio-sesion" onSubmit="getToken(event)" action="/es/gestion/acceder/" method='post'>
<h2><?php echo _x('Log in', 'Log in'); ?></h2>
<?php if($input->post->usuario): ?>
<div id="notificacions" class="<?php echo $mensaxe_tipo; ?>">
<h3><i class="icon-x-circle"></i> <?php echo $mensaxe ?></h2>
</div>
<?php endif; ?>
<div class="elemento">
<label for="usuario"><?php echo _x('Username', 'Username') ?>:</label>
<input type="text" id="usuario" name="usuario">
</div>
<div class="elemento">
<label for="contrasinal"><?php echo _x('Password', 'Password') ?>:</label>
<input type="password" id="contrasinal" name="contrasinal">
</div>
<input type="submit" id="enviar" name="enviar" value="<?php echo _x('Log in', 'Log in'); ?>">
</form>
</section>
</div>
</div>
</main>
<footer id="pe">
<h2 class="visually-hidden"><?php echo _x('Footer', 'Page footer');?></h2>
<div class="contedor">
<p>&copy;2022 <?php echo $configuracion['sitio_nome']
. ' ' . $configuracion['sitio_descripcion']; ?>.</p>
<p><?php echo _x('All rights reserved', 'copyright');?></p>
<p><?php echo _x('Designed and Developed by', 'developer');?> <a target="_blank" href="https://artabro.org">Codigo Artabro</a></p>
</div>
</footer>
<script src="https://www.google.com/recaptcha/api.js?render=6LexXqYiAAAAACwDpMGIg1OMnAXVJU0VmbEMQUD8"></script>
<script src="<?php echo $config->urls->templates?>js/main.js"></script>
</body>
</html>

View file

@ -3,10 +3,12 @@
$menu = '';
$contido = '';
$gestion = $pages->get('/gestion');
$menu = renderMenu($gestion->children, 0, 'paxinas');
$contido .= renderMigasPan($page) . "\n";
$contido .= '<article id="inicio">' . "\n";
$contido .= '<article id="gestion">' . "\n";
$contido .= '<div class="contedor">' . "\n";
$contido .= '<h2 class="visually-hidden">' . ucfirst($inicio->title) . '</h2>' . "\n";
$contido .= '<h3>' . $page->title . '</h3>' . "\n";
$contido .= '<h2>' . ucfirst($page->title) . '</h2>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</article>' . "\n";