mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-04 10:15:03 +02:00
remove index.php
This commit is contained in:
parent
1903dc6b45
commit
32a64d944a
13 changed files with 31 additions and 15 deletions
|
@ -157,10 +157,15 @@ class User
|
|||
return [];
|
||||
}
|
||||
|
||||
public static function generateToken($uid)
|
||||
public static function generateToken($uid, $validDays = 30)
|
||||
{
|
||||
global $db_pass;
|
||||
$time = time();
|
||||
if($validDays>=30){
|
||||
$time = time();
|
||||
}else{
|
||||
$time = strtotime("+ $validDays days");
|
||||
}
|
||||
|
||||
return [
|
||||
'time' => $time,
|
||||
'token' => $uid . '.' . $time . '.' . sha1($uid . '.' . $time . '.' . $db_pass)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue