--- ERROR --- If a command does not succeed or if an error has occurred during its execution, the response will be at least: { error: { mMessage: String } } --- COMMANDS --- * activate Activates a user account. Parameters => userId: String Response => { returnedValue: "ok" } * login Logs in the specified user with the given password. Parameters => username: String, password: String, permanentConnection: "true"/true/"false"/false Response => { returnedValue: } * logout Logs out the current user. Parameters => none Response => { returnedValue: "true"/true } * sessionId Gets the current session ID. Note: The session may be created. Parameters => none Response => { returnedValue: } * getSessionInfo Gets all information about the current session (sessionId, isAnonymousSession, user). Note: the session may be created. Parameters => none Response => { sessionId: String, anonymous: "true"/true/"false"/false, user: { data: { username: String, email: String, role: "admin"/"user"/String } } } * userId Gets the CDSLogin ID of the current user (which may be anonymous). Parameters => none Response => { returnedValue: } Response(anonymous or unknown user) => { returnedValue: null } Response(no session) => { } * anonymousUserId Gets the CDSLogin ID of the anonymous user associated with the current session. Note: DOES NOT WORK if a user is currently logged. Parameters => none Response => { anonymous: "true"/true, returnedValue: } Response(not anonymous user or no session) => { anonymous: "false"/false } * permanentConnection Tells whether the connection of the current user is permanent or not. Parameters => none Response => { returnedValue: "true"/true/"false"/false } * isSessionAnonyme Tells whether a user is connected to the CDS login or not. Parameters => none Response => { returnedValue: "true"/true/"false"/false } * username Gets the name of the current user (may be "anonymous"). Parameters => none Response => { returnedValue: username, password, email, firstName, lastName, affiliation, researchDomain, isDataPublic: "yes"/"no" Response => { returnedValue: "ok" } * data [ONLY FOR THE CURRENT USER OR AN ADMIN] Gets all information about the specified user. The data of the current user are returned if no user is specified. Parameters[ALL OPTIONAL] => username, userId Response => { user: {data: { username: String, email: String, role: "admin"/"user"/String } } } * askForNewPassword Sends a mail to the specified user so that he can reset its password. Parameters => username Response => { returnedValue: "ok" } * preferences [ONLY FOR THE CURRENT USER OR AN ADMIN] Gets all preferences about the specified user. The preferences of the current user are returned if no user is specified. Parameters[ALL OPTIONAL] => username, userId Response => { user: { preferences: { ... } } } * prettyNames Gets the prettyNames of the specified user(s???). Parameters => username(s???) Response => { prettyNames: { : , ... } } * updatePreferences [ONLY FOR THE CURRENT USER OR AN ADMIN] Updates a part or all the preferences of the specified user. The given preferences of the current user are updated if no use is specified. Parameters => username[OPTIONAL], userId[OPTIONAL], preferences Response => { returnedValue: "ok" } * changePassword [ONLY FOR THE CURRENT USER OR AN ADMIN] Changes the password of the specified user. The password of the current user is changed if no user is specified. Parameters => username[OPTIONAL], oldPassword, newPassword Response => { returnedValue: "ok" } * updateRole [ONLY FOR AN ADMIN] Updates the role of the specified user. The role of the current user (MUST BE AN ADMIN) is updated if no user is specified. Parameters => username[OPTIONAL], role Response => { returnedValue: "ok" } * updateStatus [ONLY FOR AN ADMIN] Updates the status of the specified user. The status of the current user (MUST BE AN ADMIN) is updated if no user is specified. Parameters => username[OPTIONAL], status Response => { returnedValue: "ok" } * updateEmail [ONLY FOR AN ADMIN] Updates the email of the specified user. The email of the current user (MUST BE AN ADMIN) is updated if no user is specified. Parameters => username, email Response => { returnedValue: "ok" } * getUser [/!\ ACCESSIBLE BY EVERYBODY /!\] Gets all information about the specified user. Parameters => username Response => { user: { data: { username: "...", role: "...", email: "..." }, preferences: { ... } } } * usersAsItems [/!\ ACCESSIBLE BY EVERYBODY /!\] Gets ALL information about ALL CDS users. Parameters => none Response => { items: [ { mId: "...", mLastLoginAsLong: , mCreationDateAsLong: , mAnonyme: true/false, mUsername: "...", mPassword: "...", mEmail: "...", mRole: "...", mPreferences: { ... }, mAdminInfo:{...}, mIsDeleteAllowed: true/false, mCreationDate: "...", mStatus: }, ... ] }