Improve mobile integration, add autocorrect etc. flags to login fields
This commit is contained in:
parent
4462925c50
commit
1fb4afc6aa
2
api.php
2
api.php
@ -14,7 +14,7 @@ header("Content-Type: application/json");
|
|||||||
|
|
||||||
$username = $VARS['username'];
|
$username = $VARS['username'];
|
||||||
$password = $VARS['password'];
|
$password = $VARS['password'];
|
||||||
if (user_exists($username) !== true || authenticate_user($username, $password, $errmsg) !== true) {
|
if (user_exists($username) !== true || authenticate_user($username, $password, $errmsg) !== true || account_has_permission($username, "QWIKCLOCK") !== true) {
|
||||||
header("HTTP/1.1 403 Unauthorized");
|
header("HTTP/1.1 403 Unauthorized");
|
||||||
die("\"403 Unauthorized\"");
|
die("\"403 Unauthorized\"");
|
||||||
}
|
}
|
||||||
|
2
app.php
2
app.php
@ -53,7 +53,7 @@ if (!is_empty($_GET['page'])) {
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<nav class="navbar navbar-inverse navbar-<?php echo MENU_BAR_STYLE; ?>-top">
|
<nav class="navbar navbar-inverse navbar-blue navbar-<?php echo MENU_BAR_STYLE; ?>-top">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
|
||||||
|
@ -122,8 +122,8 @@ if (checkLoginServer()) {
|
|||||||
|
|
||||||
if ($multiauth != true) {
|
if ($multiauth != true) {
|
||||||
?>
|
?>
|
||||||
<input type="text" class="form-control" name="username" placeholder="<?php lang("username"); ?>" required="required" autofocus /><br />
|
<input type="text" class="form-control" name="username" placeholder="<?php lang("username"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus /><br />
|
||||||
<input type="password" class="form-control" name="password" placeholder="<?php lang("password"); ?>" required="required" /><br />
|
<input type="password" class="form-control" name="password" placeholder="<?php lang("password"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><br />
|
||||||
<?php if (RECAPTCHA_ENABLED) { ?>
|
<?php if (RECAPTCHA_ENABLED) { ?>
|
||||||
<div class="g-recaptcha" data-sitekey="<?php echo RECAPTCHA_SITE_KEY; ?>"></div>
|
<div class="g-recaptcha" data-sitekey="<?php echo RECAPTCHA_SITE_KEY; ?>"></div>
|
||||||
<br />
|
<br />
|
||||||
@ -135,7 +135,7 @@ if (checkLoginServer()) {
|
|||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
<?php lang("2fa prompt"); ?>
|
<?php lang("2fa prompt"); ?>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="authcode" placeholder="<?php lang("authcode"); ?>" required="required" autocomplete="off" autofocus /><br />
|
<input type="text" class="form-control" name="authcode" placeholder="<?php lang("authcode"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus /><br />
|
||||||
<input type="hidden" name="progress" value="2" />
|
<input type="hidden" name="progress" value="2" />
|
||||||
<input type="hidden" name="username" value="<?php echo $VARS['username']; ?>" />
|
<input type="hidden" name="username" value="<?php echo $VARS['username']; ?>" />
|
||||||
<?php
|
<?php
|
||||||
|
@ -9,6 +9,7 @@ require __DIR__ . "/../required.php";
|
|||||||
require __DIR__ . "/../lib/login.php";
|
require __DIR__ . "/../lib/login.php";
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
header('Access-Control-Allow-Origin: *');
|
||||||
|
|
||||||
// Allow ping check without authentication
|
// Allow ping check without authentication
|
||||||
if ($VARS['action'] == "ping") {
|
if ($VARS['action'] == "ping") {
|
||||||
|
13
pages.php
13
pages.php
@ -26,4 +26,17 @@ define("PAGES", [
|
|||||||
"static/js/punches.js"
|
"static/js/punches.js"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"shifts" => [
|
||||||
|
"title" => "shifts",
|
||||||
|
"navbar" => true,
|
||||||
|
"icon" => "calendar",
|
||||||
|
"styles" => [
|
||||||
|
"static/css/datatables.min.css",
|
||||||
|
"static/css/tables.css"
|
||||||
|
],
|
||||||
|
"scripts" => [
|
||||||
|
"static/js/datatables.min.js",
|
||||||
|
"static/js/shifts.js"
|
||||||
|
]
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
|
67
pages/shifts.php
Normal file
67
pages/shifts.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/../required.php';
|
||||||
|
|
||||||
|
redirectifnotloggedin();
|
||||||
|
|
||||||
|
|
||||||
|
require_once __DIR__ . "/../lib/dates.php";
|
||||||
|
$weekstart = sqldatetime(getstartofweek(WEEK_START));
|
||||||
|
$punches = $database->select('punches', ['in', 'out'], ['AND' => ['uid' => $_SESSION['uid'], 'in[>]' => $weekstart]]);
|
||||||
|
$punchtimes = [];
|
||||||
|
foreach ($punches as $p) {
|
||||||
|
$punchtimes[] = [$p['in'], $p['out']];
|
||||||
|
}
|
||||||
|
$totalseconds = sumelapsedtimearray($punchtimes);
|
||||||
|
$totalpunches = count($punches);
|
||||||
|
?>
|
||||||
|
<p class="page-header h5"><i class="fa fa-calendar fa-fw"></i> <?php lang("this week") ?></p>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-xs-12 col-sm-6 col-md-4 col-md-offset-2">
|
||||||
|
<div class="panel panel-blue">
|
||||||
|
<div class="panel-body">
|
||||||
|
<h4>
|
||||||
|
<?php
|
||||||
|
lang2("x on the clock", ["time" => seconds2string($totalseconds, false)]);
|
||||||
|
?>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-12 col-sm-6 col-md-4">
|
||||||
|
<div class="panel panel-blue">
|
||||||
|
<div class="panel-body">
|
||||||
|
<h4>
|
||||||
|
<?php
|
||||||
|
lang2("x punches", ["count" => $totalpunches]);
|
||||||
|
?>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="punches" style="height: 0px; width: 0px;"> </a>
|
||||||
|
|
||||||
|
<p class="page-header h5"><i class="fa fa-clock-o fa-fw"></i> <?php lang("punch card") ?></p>
|
||||||
|
<table id="punchtable" class="table table-bordered table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th data-priority="0"></th>
|
||||||
|
<th data-priority="1"><i class="fa fa-fw fa-play"></i> <?php lang('in'); ?></th>
|
||||||
|
<th data-priority="1"><i class="fa fa-fw fa-stop"></i> <?php lang('out'); ?></th>
|
||||||
|
<th data-priority="2"><i class="fa fa-fw fa-sticky-note-o"></i> <?php lang('notes'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th data-priority="0"></th>
|
||||||
|
<th data-priority="1"><i class="fa fa-fw fa-play"></i> <?php lang('in'); ?></th>
|
||||||
|
<th data-priority="1"><i class="fa fa-fw fa-stop"></i> <?php lang('out'); ?></th>
|
||||||
|
<th data-priority="2"><i class="fa fa-fw fa-sticky-note-o"></i> <?php lang('notes'); ?></th>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
@ -56,3 +56,19 @@ file and add a .navbar-[color] class to the navbar in app.php.
|
|||||||
.navbar-inverse .navbar-link {
|
.navbar-inverse .navbar-link {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (max-width: 767px) {
|
||||||
|
button.navbar-toggle[data-toggle="collapse"] {
|
||||||
|
float: left;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-header .navbar-brand {
|
||||||
|
margin-left: -20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-header .navbar-brand img {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
@ -7,12 +7,12 @@ function setClock() {
|
|||||||
$('#server_date').text(resp.date);
|
$('#server_date').text(resp.date);
|
||||||
var seconds = resp.seconds * 1;
|
var seconds = resp.seconds * 1;
|
||||||
var interval = 60 - seconds;
|
var interval = 60 - seconds;
|
||||||
console.log(interval);
|
//console.log(interval);
|
||||||
if (interval > 5) {
|
if (interval > 5) {
|
||||||
interval = 5;
|
interval = 5;
|
||||||
}
|
}
|
||||||
console.log(interval);
|
//console.log(interval);
|
||||||
console.log((((seconds + interval) / 60) * 100));
|
//console.log((((seconds + interval) / 60) * 100));
|
||||||
|
|
||||||
$('#seconds_bar div').animate({
|
$('#seconds_bar div').animate({
|
||||||
width: (((seconds + interval) / 60) * 100) + "%"
|
width: (((seconds + interval) / 60) * 100) + "%"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user