Support for "force remember cookie" and list fixes
This commit is contained in:
parent
40d028a92e
commit
bd2d9237dc
|
@ -475,6 +475,7 @@ INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_ti
|
|||
INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_time`, `last_edit`, `user_id`) VALUES (NULL, 'training_edit', 1, 1, current_timestamp(), current_timestamp(), '1');
|
||||
INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_time`, `last_edit`, `user_id`) VALUES (NULL, 'training_remove', 1, 1, current_timestamp(), current_timestamp(), '1');
|
||||
INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_time`, `last_edit`, `user_id`) VALUES (NULL, 'use_location_picker', 1, 1, current_timestamp(), current_timestamp(), '1');
|
||||
INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_time`, `last_edit`, `user_id`) VALUES (NULL, 'force_remember_cookie', 0, 1, current_timestamp(), current_timestamp(), '1');
|
||||
$option_check_cf_ip"
|
||||
);
|
||||
mt_srand(10);
|
||||
|
|
|
@ -37,7 +37,7 @@ foreach($risultato as $row){
|
|||
$functionName = $row["available"] ? "deactivate" : "activate";
|
||||
$helmet_colour = $row["chief"] ? "red" : "black";
|
||||
$firstCell = "<a id='username-{$row['id']}' style='text-align: left;' onclick='$functionName(".$row["id"].");'><img alt='{$helmet_colour} helmet' src='./resources/images/{$helmet_colour}_helmet.png' width='20px'>$name</a>";
|
||||
$secondCell = $row["available"] ? "<a onclick='$functionName(".$row["id"].");'><i class='fa fa-check' style='color:green'></i></a>" : "<a onclick='$functionName(".$row["id"].");'><i class='fa fa-times' style='color:red'></i></a>";
|
||||
$secondCell = $row["available"] ? "<a onclick='$functionName(".$row["id"].");'><i class='fa fa-check' style='color:green'></i></a>" : "<a onclick='$functionName(".$row["id"].");'><i class='fa fa-times' style='color:red'></i></a>";
|
||||
$response[] = [
|
||||
(time()-$row["online_time"])<=30 ? "<u>".$firstCell."</u>" : $firstCell,
|
||||
$secondCell,
|
||||
|
@ -49,10 +49,13 @@ foreach($risultato as $row){
|
|||
"<a href='user_details.php?user=".$row['id']."'><p>".t("Altri dettagli", false)."</p></a>"
|
||||
];
|
||||
} else {
|
||||
$name = $user->nameById($row["id"]);
|
||||
$helmet_colour = $row["chief"] ? "red" : "black";
|
||||
$firstCell = "<a id='username-{$row['id']}' style='text-align: left;'><img alt='{$helmet_colour} helmet' src='./resources/images/{$helmet_colour}_helmet.png' width='20px'>$name</a>";
|
||||
$secondCell = $row["available"] ? "<a><i class='fa fa-check' style='color:green'></i></a>" : "<a><i class='fa fa-times' style='color:red'></i></a>";
|
||||
$response[] = [
|
||||
"id" => $row["id"],
|
||||
"available" => $row["available"],
|
||||
"online" => (time()-$row["online_time"])<=30 ? 1 : 0
|
||||
(time()-$row["online_time"])<=30 ? "<u>".$firstCell."</u>" : $firstCell,
|
||||
$secondCell
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,12 +17,16 @@
|
|||
<input type="text" name="name" placeholder="{{ 'username'|t }}" required autocomplete="username" autofocus><br><br>
|
||||
<input type="password" name="password" placeholder="{{ 'password'|t }}" required
|
||||
autocomplete="current-password"><br><br>
|
||||
{% if option('force_remember_cookie') %}
|
||||
<input type="hidden" name="remember_me" value='1' id="remember_me checkbox1" type="checkbox">
|
||||
{% else %}
|
||||
<div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" name="remember_me" value='1' id="remember_me checkbox1" type="checkbox">
|
||||
<label for="checkbox1">{{ 'Stay connected'|t }}</label>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<input type="submit" name="login" class="btn btn-lg btn-success" value="{{ 'Login'|t }}">
|
||||
</form>
|
||||
{% if error %}
|
||||
|
|
Loading…
Reference in New Issue