Path Configuration

This commit is contained in:
Ibnu Maksum
2024-02-26 14:38:04 +07:00
parent 617e628b04
commit d2fa9be8d1
18 changed files with 270 additions and 242 deletions

View File

@ -10,13 +10,13 @@ class User
{
public static function getID(){
global $db_password;
if(isset($_SESSION['uid'])){
if(isset($_SESSION['uid']) && !empty($_SESSION['uid'])){
return $_SESSION['uid'];
}else if(isset($_COOKIE['uid'])){
// id.time.sha1
$tmp = explode('.',$_COOKIE['uid']);
if(sha1($tmp[0].$tmp[1].$db_password)==$tmp[2]){
if($tmp[1] < 86400*30){
if(sha1($tmp[0].'.'.$tmp[1].'.'.$db_password)==$tmp[2]){
if(time()-$tmp[1] < 86400*30){
$_SESSION['uid'] = $tmp[0];
return $tmp[0];
}