mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Can open user page from virtual directory name
This commit is contained in:
@ -201,6 +201,33 @@ ComunicWeb.user.userInfos = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the user ID specified by its folder name
|
||||
*
|
||||
* @param {String} path The path of the user
|
||||
* @param {Function} callback What to do once we got a response from the server
|
||||
*/
|
||||
getIDfromPath: function(path, callback){
|
||||
|
||||
//Prepare an API request
|
||||
var apiURI = "user/findbyfolder";
|
||||
var params = {
|
||||
subfolder: path
|
||||
};
|
||||
|
||||
//Define what to do next
|
||||
var next = function(response){
|
||||
if(response.userID){
|
||||
callback(response.userID*1);
|
||||
}
|
||||
else
|
||||
//An error occured
|
||||
callback(-1);
|
||||
}
|
||||
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, next);
|
||||
},
|
||||
|
||||
/**
|
||||
* Empty users cache
|
||||
*
|
||||
|
Reference in New Issue
Block a user