Management of users and groups

From Armarius

Jump to: navigation, search

Return to development documentation [[1]]

[edit] Functionnalities

For the moment, there are these functionnalities :

  • Register : A person, who is on the main page can register if she wants (clicking on the link "Register ?" in the heading "Login"). In this case, a form is shown with obligatory fields to complete (login, password (in two fields to confirm it), name, email). There is also a security picture : the person has to write in a field the characters typed in the picture. If all the fields are correct (they're not empty and, the 2 passwords typed are the same, the name has not numbers in it, the login is not used by another user, the email is not bad and the characters typed are the same that in the security picture), the person is registered in the database and instead of the heading "Login" in the main page, she has only the message "You're connected as" with her login and she has access to the administration panel. She can also disconnect by clicking on the link "Disconnect". In this case, the main page becomes the same that before with the heading "Login".

For the moment, we haven't programmed yet the rights, so each user registered has access to the administration panel. If one field is not correct, an error message is showed on the form in order to the person can correct it. The registered person is a member of any group.

  • Connect : A person, who has already registered, can connect giving her login and password. If the login and the password are correct, she has access to the main page with the message "You're connected as" with her login, the link to the administration panel and the link "Disconnect".


Administration panel : (for the moment, all users registered have access ; after, it will be only for the system admin) With this, we can create users, manage users, create a group, manage groups, or return to the main page.

  • Create user

A new user can be created if the fields of a form (the same that in the registering form except the security picture) are all completed and correct (in the same way that in the registering form). If there is an error, a message is shown on the form. He is a member of any group.

  • Manage users

For each user, there is an array showing his login, email, date of last connexion, date of creation, his groups, and if he is activated. Besides, the list of users can be sorted by alphabetical order (default), or by last connexion, or by date of creation. The choice is made with a drop-down list. <br / Moreover, for each user, we can remove him and also suspend or activate him and edit his information (to see the details, look at after).

  • Edit users

In effetc, the login and the email of a user can be edited if the fields "name" and "mail" are completed and correct.
Else, an error message is shown.

  • Create group

A new group can be created giving its name. It can be chosen to add or not members (users registered) to the group. If the name of the group already exists or if the field "Name of the group" is not completed, an error message is shown.

  • Manage groups

In effect,the list of the existing groups can be shown. In this case, for each group, the list of the users who belong to it is also shown. Moreover, for each group, we can remove it or edit (modify the members of this group) it.

[edit] Details of programmation

  • We have done some modifications : now, all the tables of the database will begin with armarius_ instead of prefix_ .

A new table armarius_rights has been created such as : armarius_rights (rg_col_id, rg_group_id, rg_rights) . rg_rights is a binary word that encodes permissions like in Unix system. The table armarius_category has been removed. The tables armarius_groups with the fields group_id (ID of the group) and group_name (name of the group), and armarius_groups_content with the fields gc_group_id (ID of the group), gc_user_id (ID of the user) have also been created.

Here you can see the new structure of the database of Armarius [[2]]

  • Scripts used

They're all in app/admin.

  • admin_panel.php : Administration panel with menu (Users, Groups, Collections)
  • admin_inscription.php : Script used when a user wants to register
  • user_create.php : Script to create a new user, giving its name,email,password,login (only for the system admin)
  • user_edit.php : Script to edit the name and the email of a selected user (only for the system admin)
  • user_manage.php : Script (only for system admin) to see all the users registered and their information : login,email,date of last connexion,date of creation,groups in what he belongs,if he's activated ; the admin can do actions on it:activate/suspend,remove or edit. The list can be sorted by alphabetical orer, date of last connexion or by date of creation.
  • group_create.php : Script to create a new group, giving its name and if we want users to add to the group (only for system admin)
  • group_edit.php : Script to edit the members of a slected group (only for admin system)
  • group_manage.php : Script to see all the groups (sorted by alphabetical order) registered and for each group, its users (only for admin system)

This files are associated with template files because we've used Smarty.
Then, there are treatment scripts :

  • add.php : Script to update the session variable if we want or not add a user to a selected group
  • admin_deconnexion.php : When a user disconnects, his information is destroyed and there is a return to the main page
  • image.php : File to create the security image when a user wants to register
  • login.php : Tests if the login is correct. In this case, the message "You are connected as .." and the buttoDisconnect appears on the main page instead of the traditional "Login". If there is a problem, a message appears on the main page indicating the error to the user.The user can try to connect again. This file is also used for the administrator operations like manage users, groups or collections.
  • order.php : Script to update the session variable with the order selected to show the list of users
  • group_remove.php : Script to remove a group from the database
  • user_treatment.php : Script which tests if the login is correct. In this case, the message "You are connected as .." and the button Disconnect appear on the main page instead of the traditional "Login". If there is a problem, a message appears on the main page indicating the error to the user. The user can try to connect again.
  • users_group.php : Puts the id of the user added to the group into in a session variable and puts 0 to the session variable containing the id of the user we want to remove.


All the files are called with an URL such as : To call create_user.php, the URL is ?create:user.

Personal tools