Created userIDorPath(infos) function

This commit is contained in:
Pierre
2018-01-02 18:58:40 +01:00
parent dced14cf52
commit 3c803a16c0
3 changed files with 35 additions and 0 deletions

View File

@ -247,6 +247,25 @@ ComunicWeb.user.userInfos = {
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, next);
},
/**
* Get the ID or the path of a user, depending of what is available
*
* @param {Object} userInfos Informations about the user
* @return {String} The ID of the user or its path, if he has one
*/
getIDorPath: function(userInfos){
//Check if a virtual directory is available
if(userInfos.virtualDirectory != null){
return userInfos.virtualDirectory;
}
//Else return user ID
else {
return userInfos.userID;
}
},
/**
* Empty users cache
*