Merge branch 'development' of djpbessems/lucidAuth into master

This commit is contained in:
Danny Bessems 2019-06-20 07:50:15 +00:00 committed by Gitea
commit 55413d20c5
3 changed files with 10 additions and 33 deletions

View File

@ -15,6 +15,8 @@ $pageLayout['full'] = <<<'FULL'
<link href="misc/style.button.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="misc/script.translation.js"></script>
<script src="https://unpkg.com/nprogress@0.2.0/nprogress.js"></script>
<link href="https://unpkg.com/nprogress@0.2.0/nprogress.css" rel="stylesheet" />
</head>
<body>
<div id="horizon">

View File

@ -1,27 +0,0 @@
<?php
// Basic example of PHP script to handle with jQuery-Tabledit plug-in.
// Note that is just an example. Should take precautions such as filtering the input data.
header('Content-Type: application/json');
$input = filter_input_array(INPUT_POST);
$mysqli = new mysqli('localhost', 'user', 'password', 'database');
if (mysqli_connect_errno()) {
echo json_encode(array('mysqli' => 'Failed to connect to MySQL: ' . mysqli_connect_error()));
exit;
}
if ($input['action'] === 'edit') {
$mysqli->query("UPDATE users SET username='" . $input['username'] . "', email='" . $input['email'] . "', avatar='" . $input['avatar'] . "' WHERE id='" . $input['id'] . "'");
} else if ($input['action'] === 'delete') {
$mysqli->query("UPDATE users SET deleted=1 WHERE id='" . $input['id'] . "'");
} else if ($input['action'] === 'restore') {
$mysqli->query("UPDATE users SET deleted=0 WHERE id='" . $input['id'] . "'");
}
mysqli_close($mysqli);
echo json_encode($input);

View File

@ -40,25 +40,27 @@ $(document).ready(function(){
xhrFields: {
withCredentials: true,
},
timeout: 750,
// origin domain should be exempted from timeout
// (because origin domain can/will be different from current domain --due to traefik design).
data: {
ref: btoa(JSON.stringify({
action: 'login',
token: data.SecureToken
}))
}
}).done(function() {
NProgress.inc(1 / XHR.length);
}));
});
$.when.apply($, XHR).then(function(){
$.each(arguments, function(_index, _arg) {
// Show progress somehow (maybe something like https://minicss.org/v2/progress)
// Finished cross-domain logins (either succesfully or through timeout)
NProgress.done();
window.location.replace(data.Location);
});
});
}
// Finished (either succesfully or through timeout) cross-domain logins
// redirect once all finished loading or timeout after $X ms
// origin domain should be exempted from timeout
// (because origin domain can/will be different from current domain --due to traefik design).
//window.location.replace(data.Location);
}, 2250);
} else {
$('#btnlogin').css({