remove index.php
This commit is contained in:
parent
1903dc6b45
commit
32a64d944a
@ -5,4 +5,4 @@
|
||||
**/
|
||||
|
||||
|
||||
header('location: ../index.php?_route=admin/');
|
||||
header('location: ../?_route=admin/');
|
2
init.php
2
init.php
@ -87,7 +87,7 @@ if ($_app_stage != 'Live') {
|
||||
if ($isApi) {
|
||||
define('U', APP_URL . '/system/api.php?r=');
|
||||
} else {
|
||||
define('U', APP_URL . '/index.php?_route=');
|
||||
define('U', APP_URL . '/?_route=');
|
||||
}
|
||||
|
||||
// notification message
|
||||
|
@ -157,10 +157,15 @@ class User
|
||||
return [];
|
||||
}
|
||||
|
||||
public static function generateToken($uid)
|
||||
public static function generateToken($uid, $validDays = 30)
|
||||
{
|
||||
global $db_pass;
|
||||
if($validDays>=30){
|
||||
$time = time();
|
||||
}else{
|
||||
$time = strtotime("+ $validDays days");
|
||||
}
|
||||
|
||||
return [
|
||||
'time' => $time,
|
||||
'token' => $uid . '.' . $time . '.' . sha1($uid . '.' . $time . '.' . $db_pass)
|
||||
|
@ -80,6 +80,9 @@ if ($handler == '') {
|
||||
$handler = 'default';
|
||||
}
|
||||
try {
|
||||
if(!empty($_GET['uid'])){
|
||||
$_COOKIE['uid'] = $_GET['token'];
|
||||
}
|
||||
$admin = Admin::_info();
|
||||
$sys_render = $root_path . File::pathFixer('system/controllers/' . $handler . '.php');
|
||||
if (file_exists($sys_render)) {
|
||||
|
@ -507,7 +507,7 @@ switch ($action) {
|
||||
$welcomeMessage = str_replace('[[name]]', $d['fullname'], $welcomeMessage);
|
||||
$welcomeMessage = str_replace('[[username]]', $d['username'], $welcomeMessage);
|
||||
$welcomeMessage = str_replace('[[password]]', $d['password'], $welcomeMessage);
|
||||
$welcomeMessage = str_replace('[[url]]', APP_URL . '/index.php?_route=login', $welcomeMessage);
|
||||
$welcomeMessage = str_replace('[[url]]', APP_URL . '/?_route=login', $welcomeMessage);
|
||||
|
||||
$emailSubject = "Welcome to " . $config['CompanyName'];
|
||||
|
||||
|
@ -39,10 +39,17 @@ switch ($do) {
|
||||
}
|
||||
if (Password::_uverify($password, $d_pass) == true) {
|
||||
$_SESSION['uid'] = $d['id'];
|
||||
User::setCookie($d['id']);
|
||||
$token = User::setCookie($d['id']);
|
||||
$d->last_login = date('Y-m-d H:i:s');
|
||||
$d->save();
|
||||
_log($username . ' ' . Lang::T('Login Successful'), 'User', $d['id']);
|
||||
if ($isApi) {
|
||||
if ($token) {
|
||||
showResult(true, Lang::T('Login Successful'), ['token' => "u." . $token]);
|
||||
} else {
|
||||
showResult(false, Lang::T('Invalid Username or Password'));
|
||||
}
|
||||
}
|
||||
_alert(Lang::T('Login Successful'), 'success', "home");
|
||||
} else {
|
||||
_msglog('e', Lang::T('Invalid Username or Password'));
|
||||
|
@ -30,9 +30,9 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
ajax: {
|
||||
url: function(params) {
|
||||
if(params.term != undefined){
|
||||
return './index.php?_route=autoload/customer_select2&s='+params.term;
|
||||
return './?_route=autoload/customer_select2&s='+params.term;
|
||||
}else{
|
||||
return './index.php?_route=autoload/customer_select2';
|
||||
return './?_route=autoload/customer_select2';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
ajax: {
|
||||
url: function(params) {
|
||||
if(params.term != undefined){
|
||||
return './index.php?_route=autoload/customer_select2&s='+params.term;
|
||||
return './?_route=autoload/customer_select2&s='+params.term;
|
||||
}else{
|
||||
return './index.php?_route=autoload/customer_select2';
|
||||
return './?_route=autoload/customer_select2';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -843,5 +843,6 @@
|
||||
"Settings_For_Cron_Reminder": "Pengaturan Untuk Pengingat Cron",
|
||||
"Security": "Keamanan",
|
||||
"Enable_CSRF_Validation": "Aktifkan Validasi CSRF",
|
||||
"Cross_site_request_forgery": "Pemalsuan permintaan lintas situs"
|
||||
"Cross_site_request_forgery": "Pemalsuan permintaan lintas situs",
|
||||
"Forgot_Password": "Lupa Kata Sandi"
|
||||
}
|
@ -325,7 +325,7 @@
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
$.ajax({
|
||||
url: "index.php?_route=autoload_user/isLogin/{$_bill['id']}",
|
||||
url: "?_route=autoload_user/isLogin/{$_bill['id']}",
|
||||
cache: false,
|
||||
success: function(msg) {
|
||||
$("#login_status_{$_bill['id']}").html(msg);
|
||||
|
@ -183,7 +183,7 @@
|
||||
document.getElementById("routers").required = false;
|
||||
document.getElementById("routers").disabled = true;
|
||||
$.ajax({
|
||||
url: "index.php?_route=autoload/pool",
|
||||
url: "?_route=autoload/pool",
|
||||
data: "routers=radius",
|
||||
cache: false,
|
||||
success: function(msg) {
|
||||
|
@ -170,7 +170,7 @@
|
||||
document.getElementById("routers").required = false;
|
||||
document.getElementById("routers").disabled = true;
|
||||
$.ajax({
|
||||
url: "index.php?_route=autoload/pool",
|
||||
url: "?_route=autoload/pool",
|
||||
data: "routers=radius",
|
||||
cache: false,
|
||||
success: function(msg) {
|
||||
|
@ -281,7 +281,7 @@ function deleteFolder($path)
|
||||
PHPNuxBill has been updated to Version <b><?= $version ?></b>
|
||||
</div>
|
||||
</div>
|
||||
<meta http-equiv="refresh" content="5; ./index.php?_route=dashboard">
|
||||
<meta http-equiv="refresh" content="5; ./?_route=dashboard">
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user