MPIIComputationalEpigenetics / DeepBlue

DeepBlue Epigenomic Data Server
Other
2 stars 0 forks source link

User authentication / user administration command #25

Closed felipealbrecht closed 9 years ago

felipealbrecht commented 9 years ago

user_bind_password(user_email, password, user_key)

Where the user email is the password registered in deepblue. Password is the password User_key is the user key or the admin key

So, the user can change its own password or the admin can change for any user.

The returns are 'okay', user_id for success and 'error', invalid user/user_key for failure

For now, You can store the user password in the users collection.


user_auth(user_email, password)

Return ("okay", user_key) from the user_email, password combination Or error, 'invalid user name/password'

This command will be user by the login page, where the user will provide its email and password and the php code will get the user's user_key using this command. This user_key will be stored in the section, and used by all commands.

Lower case the email value for searching in the database.


The last command is the user_set_value (sorry by the bad name, I didn't sleep tonight)

This command receive three parameters:

user_set_value(user_id or email, key, value, user key)

user email or ID (I have implemented some functions for getting the ID from the project name 'automatically', check the command add_project_user for getting the id when the id or the name was provided. Just pay attention that where can be the email or ID (maybe you can allow email, name, and ID).

Key is the value key (for now, the email, name, password, and memory_limit)

Value is the... Value. For the Email, name, and password you can handle the value as string, the memory_limit must be a long long when read and stored into mongodb. So, you have to check if the key is one of these allowed keys. Convert to long long if it is memory_limit. Store/overwrite the old value. Pay Attention to stored the email in lower case.

The key can be from the user itself or the admin.

Please, keep in mind that new keys will be included in the future, like space quote, processing time, simultaneously processing, and so on.

So, thank you very much for doing it soon.