This commit is contained in:
2021-12-25 23:17:47 -03:00
parent 7e01974ec8
commit d7d671fb51
68 changed files with 2991 additions and 160 deletions

View File

@ -7,9 +7,9 @@
{{$titulo}} -
@endif
Incoviba S. A.</title>
<link rel="stylesheet" type="text/css" href="css/app.css" />
<link rel="icon" type="image/png" href="images/Isotipo 32.png" />
<script type="text/javascript" src="js/app.js"></script>
<link rel="stylesheet" type="text/css" href="{{$urls->styles}}/app.css" />
<link rel="icon" type="image/png" href="{{$urls->images}}/Isotipo 32.png" />
<script type="text/javascript" src="{{$urls->scripts}}/app.js"></script>
@stack('styles')
</head>
@ -19,7 +19,7 @@
<div class="row">
<div class="col-md-12">
<div class="logo_cabezal">
<a href="."><img src="images/logo_cabezal.png" /></a>
<a href="."><img src="{{$urls->images}}/logo_cabezal.png" /></a>
</div>
</div>
</div>
@ -28,15 +28,15 @@
<nav class="navbar navbar-default">
<ul class="nav navbar-nav">
<li><a href=".">Inicio</a></li>
@if (\App\Contract\Auth::isIn())
@if ($auth->isIn())
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
{{\App\Contract\Auth::User()->name}} <span class="caret"></span>
{{$auth->user()}} <span class="caret"></span>
</a>
@include('layout.menu.login')
</li>
@else
<li><a href="{{url('', ['p' => 'auth', 'a' => 'login'])}}">Ingresar</a></li>
<li><a href="{{$urls->base}}/auth/login">Ingresar</a></li>
@endif
</ul>
</nav>

View File

@ -5,7 +5,7 @@
<div class="col-md-12 h3">Cambio de Cl&aacute;ve</div>
</div>
<br />
<form class="form-horizontal" method="post" action="{{url('', ['p' => 'auth', 'a' => 'do_change_pass'])}}">
<form class="form-horizontal" method="post" action="{{$urls->base}}/auth/password/change">
<div class="form-group">
<div class="col-md-2">Cl&aacute;ve anterior</div>
<div class="col-md-3"><input type="password" name="old" class="form-control" /></div>
@ -32,7 +32,7 @@
$(document).ready(function() {
var status = [0, 0, 0, 0];
$("input[name='old']").blur(function(e) {
$.post('{!!nUrl('auth', 'check_pass', ['ajax' => 'true'])!!}', {"password": $(this).val()}, function(data) {
$.post('{!!$urls->base!!}}/auth/password/check', {"password": $(this).val()}, function(data) {
if (data == 'KO') {
$('#msg1').html('<span class="label label-danger"><span class="glyphicon glyphicon-warning-sign"></span> Cl&aacute;ve anterior inv&aacute;lida.</span>');
status[1] = 0;
@ -43,7 +43,7 @@ $(document).ready(function() {
});
})
$("input[name='new']").blur(function(e) {
var result = zxcvbn($(this).val(), user_inputs=[$("input[name='old']").val(), '{{\App\Contract\Auth::User()->name}}']);
var result = zxcvbn($(this).val(), user_inputs=[$("input[name='old']").val(), '{{$user->name}}']);
if (result.score < 3) {
$('#msg2').html('<span class="label label-danger"><span class="glyphicon glyphicon-warning-sign"></span> Nivel ' + result.score + '</span>');
status[2] = 0;

View File

@ -1,7 +1,7 @@
@extends('auth.base')
@section('content')
<form class="form-horizontal" action="{{url('', ['p' => 'auth', 'a' => 'do_login'])}}" method="post">
<form class="form-horizontal" id="login_form" method="post">
<div class="form-group">
<div class="col-md-2">Usuario</div>
<div class="col-md-3"><input type="text" name="name" class="form-control" /></div>
@ -15,3 +15,28 @@
</div>
</form>
@endsection
@push('scripts')
<script type="text/javascript">
function doLogin(e) {
e.preventDefault()
const form = $(e.currentTarget)
const url = '{{$urls->base}}/auth/login'
const data = {
name: form.find("[name='name']").val(),
password: form.find("[name='password']").val()
}
$.post(url, data).then((data) => {
if (data.login) {
window.location = '{{$route}}'
return
}
console.debug(data)
})
return false
}
$(document).ready(() => {
$('#login_form').submit(doLogin)
})
</script>
@endpush