mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 13:59:29 +00:00
Added incognito mode
This commit is contained in:
parent
4e0b5c5fc9
commit
2753569015
@ -38,7 +38,7 @@ class friendsController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Update the last activity of the user
|
//Update the last activity of the user
|
||||||
CS::get()->components->user->updateLastActivity(userID);
|
update_last_user_activity_if_allowed();
|
||||||
|
|
||||||
//Return list
|
//Return list
|
||||||
return $api_list;
|
return $api_list;
|
||||||
|
@ -129,7 +129,7 @@ class userController
|
|||||||
user_login_required();
|
user_login_required();
|
||||||
|
|
||||||
//Update last user activity
|
//Update last user activity
|
||||||
CS::get()->components->user->updateLastActivity(userID);
|
update_last_user_activity_if_allowed();
|
||||||
|
|
||||||
//Return userID
|
//Return userID
|
||||||
return array("userID" => userID);
|
return array("userID" => userID);
|
||||||
|
@ -59,3 +59,20 @@ function check_post_password(int $userID, string $name) : bool {
|
|||||||
//Else the password seems to be valid
|
//Else the password seems to be valid
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update last user activity if the user allows it
|
||||||
|
*
|
||||||
|
* This function do not do anything if the incognito mode
|
||||||
|
* has been enabled by the user
|
||||||
|
*/
|
||||||
|
function update_last_user_activity_if_allowed() {
|
||||||
|
|
||||||
|
//Check if incognito mode is enabled
|
||||||
|
if(isset($_POST["incognito"]))
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Update last activity time of the user
|
||||||
|
CS::get()->components->user->updateLastActivity(userID);
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user