Adattamento form di login a AdmitLTE

This commit is contained in:
loviuz 2024-01-13 00:21:37 +01:00
parent c0b632b4e6
commit 2636a71ef7
3 changed files with 24 additions and 26 deletions

View File

@ -1259,4 +1259,8 @@ kbd{
position: absolute;
color: #ff8300;
z-index: 10;
}
}
.login-box .form-control-feedback{
pointer-events: all;
}

View File

@ -148,33 +148,31 @@ if (!empty(flash()->getMessage('error'))) {
}
echo '
<form action="?op=login" method="post" class="login-box box" autocomplete="off" >
<div class="box-header with-border text-center">
<img src="'.App::getPaths()['img'].'/logo_completo.png" class="img-responsive" alt="'.tr('OpenSTAManager, il software gestionale open source per assistenza tecnica e fatturazione elettronica').'">
</div>
<form action="?op=login" method="post" autocomplete="off">
<div class="login-box">
<div class="login-logo">
<img src="'.App::getPaths()['img'].'/logo_completo.png" class="img-responsive" alt="'.tr('OpenSTAManager, il software gestionale open source per assistenza tecnica e fatturazione elettronica').'">
</div>
<div class="login-box-body box-body">
<div class="form-group input-group">
<span class="input-group-addon before"><i class="fa fa-user"></i> </span>
<input type="text" name="username" autocomplete="username" class="form-control" placeholder="'.tr('Nome utente').'"';
<div class="login-box-body">
<p class="login-box-msg">'.tr('Accedi con le tue credenziali').'</p>
<div class="form-group has-feedback">
<input type="text" name="username" autocomplete="username" class="form-control" placeholder="'.tr('Nome utente').'"';
if (isset($username)) {
echo ' value="'.$username.'"';
}
echo ' required>
</div>
<span class="form-control-feedback"><i class="fa fa-user"></i> </span>
</div>
{[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": "'.tr('Password').'", "icon-before": "<i class=\"fa fa-lock\"></i>"]}
<div class="form-group has-feedback">
{[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": "'.tr('Password').'" ]}
</div>
<div class="text-right">
<small><a href="'.base_path().'/reset.php">'.tr('Password dimenticata?').'</a></small>
</div>
<button type="submit" class="btn btn-danger btn-block btn-flat">'.tr('Accedi').'</button>
<br>
<p><a href="'.base_path().'/reset.php">'.tr('Password dimenticata?').'</a></p>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" id="login" class="btn btn-danger btn-block">'.tr('Accedi').'</button>
</div>
<!-- box-footer -->
</form>
<!-- /.box -->

View File

@ -101,12 +101,8 @@ class DefaultHandler implements HandlerInterface
*/
protected function password(&$values, &$extras)
{
$values['icon-after'] = '<i onclick="togglePassword_'.$values['id'].'()" class="clickable fa" id="'.$values['id'].'_toggle"></i>';
$result = '
<script>
const characters ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!%-()*[]";
function generateString(length) {
@ -141,7 +137,7 @@ class DefaultHandler implements HandlerInterface
}
}
$(document).ready(function(){
$(document).ready(function(){
togglePassword_'.$values['id'].'();
});
</script>';
@ -201,7 +197,7 @@ class DefaultHandler implements HandlerInterface
}
// Delega al metodo "text", per la generazione del codice HTML
$result .= $this->text($values, $extras);
$result .= $this->text($values, $extras).'<span class="fa fa-eye-slash clickable form-control-feedback" id="'.$values['id'].'_toggle" onclick="togglePassword_'.$values['id'].'();"></span>';
return $result;
}