mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-24 12:38:58 +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
|
||||
CS::get()->components->user->updateLastActivity(userID);
|
||||
update_last_user_activity_if_allowed();
|
||||
|
||||
//Return list
|
||||
return $api_list;
|
||||
|
@ -129,7 +129,7 @@ class userController
|
||||
user_login_required();
|
||||
|
||||
//Update last user activity
|
||||
CS::get()->components->user->updateLastActivity(userID);
|
||||
update_last_user_activity_if_allowed();
|
||||
|
||||
//Return userID
|
||||
return array("userID" => userID);
|
||||
|
@ -58,4 +58,21 @@ function check_post_password(int $userID, string $name) : bool {
|
||||
|
||||
//Else the password seems to be valid
|
||||
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