Added incognito mode

This commit is contained in:
Pierre HUBERT 2019-01-11 12:03:59 +01:00
parent 4e0b5c5fc9
commit 2753569015
3 changed files with 19 additions and 2 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);
}