Introduction
The Users module is a generic user management tool for the entire Administration system. Each user in the database is controlled by several user tables. Each user has a number of generic fields such as First name, user name, password etc, in the main users table. In addition, each user has 3 optional, additional types of information, forming a many to one scenario:
- Contact details (Phone, mobile and email etc)
- Multiple Addresses
- Options (These options will change certain elements within the code.)
Additional information is entered via selecting an option from the pull down menu under Details.
The options are slightly different. A few of them are needed for user permission management. The most important one is 'is_admin', which is given a value of 0 for non-admin users, or 1 for admin users. Admin users typically have access to the maximum range of privileges within the system. Some admin modules require additional levels of administration, and usually use a value of 2.
The second option that must be given to every user is 'menu'. This tells the Admin system which site navigation to display when the user logs on. Normally users will only have 1 menu given, but in some instances a user could have several options set as 'menu', giving him/her the choice of which 'site' to use within the system. If only one menu option is set, it must end with a pipe and a 1 (This means that this menu is the default menu (the one shown when the user first logs on), as shown in the following example (The format is Site Label|menu_filename|default)
Additional options are given to users, depending on the requirements of the system and its modules. Options that are not needed by any system are then simply informational, and will not affect the system in any way (for example, you may want to add a website URL to a user).
Automatic User Options
A configuration file, include/user_types.xml is used to assign different user_types to the Admin's sites. Each comes with a set of options and other dynamic actions that are triggered when creating a new user. Think of user types as short cuts, they automatically generate the right options and database entries (even in other, related tables) for the type of user you want to create.
Create User
To create a new user, navigate to the user User Administration (if access exists), click the 'Add' icon (the green icon with a plus sign). This brings up the entry form. If your site is set up to have user types, a drop-down menu with the user_type label will also appear. If you want to create a normal user, without any additional options, do not select a user type.
If you want to create a Student, for example, select student (or the appropriate user_type option), fill in the rest of the data in this form, and click submit. You should get confirmation on a successful addition, and see the new user in the list.
User Questions
- We have a server set up on a new installation
- The owners of this server will have full control over everything as they have access to the database.
- Only administrators can change other peoples options
- Only administrators can really see the user admin anyway
OR
- Our server with multi-user controls
- We want to offer PHPST to many people
- Each will be an administrator in there own right on there little space in the system
- We have user parent id to control what users belong to them this is recursive.
- So all users are tied to a parent - all parents are Admins in there own right they can admin only there elements
- HOWEVER we cant have admins who are not super admins - i.e. us - adding in new menu options and the like - if they do this then they can see other areas of the site
- So admin user C can see PHPST - he can add new users departments - options to these users - but cannot add new menu items and other things that effect the stability of the system.
More user stuff
The user management panel is now dynamic, depending on which "view_site" is currently toggled. If the site is "server_admin", all users are shown. For any other site, only users who have the corresponding "menu" entry in the users_options table are listed.
User creation is also dynamic. A new menu is given, depending on which site is selected: user type. This gives a list of "template" users. If one is selected, a number of additional Database entries will be performed, depending on the settings in the include/user_types.xml file. This can include any number of user_options as well as other entries in non-user tables. At the moment, all user types are displayed, no matter which site is selected, but the next stage of development will link the user type option with the selected site.
The user_type xml file
This file is rather self-explanatory, apart from a number of dynamic fields which are enclosed in {curly brackets}. These fields are essential for linking an entry in the users_options table with an entry in a non-user table.
For example:
- The user is inserted using the POST variables
- The global_coach user type includes an entry in the tickets_departments table. This must be done before the users_option 'department_id' is created, otherwise we do not know what the department_id will be.
- This department receives two variables, {username} and {notes} which are assigned respectively to its 'name' and 'description' fields (in Global Language, each user is assigned to only 1 department which bears his/her name).
- A users_options entry is added as described above
As a result of the above procedure (entirely automatic, based alone on the user_types.xml file), a new user is created with the following options:
- menu: Global Language|global|1
- is_admin: 2
- department_id: 34
- lang: en
And a new department with the user's username is created, department_id 34.
ToDo
- When selecting the Options pull down, firstly I have no indication of what user it is. Secondly I cannot then select to move onto other options through a pull down.
- White screen of death with no Errors on new installations - what are the issues with this, we need clearly defined errors and debugs reports.
- When superadmin creates a new admin, no options are saved
External Links
|
Modules
|