UniTime / unitime

Comprehensive University Timetabling System
http://www.unitime.org
Apache License 2.0
274 stars 162 forks source link

Problem! #116

Closed wldwa19 closed 2 years ago

wldwa19 commented 2 years ago

I have certainly did something wrong - maybe deleting the system administrator Abraham Root or trying to change language to french. Now, I can't access the timetable managers screen nor courses, students… administration menus. What can I do to correct this situation or go back to previous status, please?

Screen Shot 2022-07-28 at 5 42 06 PM
tomas-muller commented 2 years ago

Looks like you have deleted the record for the admin user (Abraham Root) in the Administration > Academic Sessions > Managers page. Also, by default, French localization is not included in the official build of UniTime, though big chunk of UniTime has been translated to French -- see https://help.unitime.org/localization for more details.

For the default admin/admin user to work, there needs to be:

1) a record in the users table (user name, hashed password using MD5 and external id) - typically to be defined Administration > Other > Users page

mysql> select * from users where external_uid='1';
+----------+--------------------------+--------------+
| username | password                 | external_uid |
+----------+--------------------------+--------------+
| admin    | ISMvKXpXpadDiUoOSoAfww== | 1            |
+----------+--------------------------+--------------+
1 row in set (0.00 sec)

(this authentication can be replaced by other means, e.g., using LDAP or CAS authentication)

2) a record in the timetable_manager table (Administration > Academic Session > Timetable Managers) with the matching external id

mysql> select * from timetable_manager where external_uid='1';
+----------+--------------+------------+-------------+-----------+------------------+--------------------+------------+
| uniqueid | external_uid | first_name | middle_name | last_name | email_address    | last_modified_time | acad_title |
+----------+--------------+------------+-------------+-----------+------------------+--------------------+------------+
|      470 | 1            | Abraham    | NULL        | Root      | [demo@unitime.org](mailto:demo@unitime.org) | NULL               | NULL       |
+----------+--------------+------------+-------------+-----------+------------------+--------------------+------------+
1 row in set (0.00 sec)

the timetable managers are associated with one or more roles (tmtbl_mgr_to_roles table) and they may be associated with one or more departments (dept_to_tt_mgr table, this is important for roles that are session or department dependent -- e.g., a timetable manager can only make changes to courses of his/her departments; a session admin can only make changes to academic sessions from which he/she has at least one department).

mysql> select * from tmtbl_mgr_to_roles where manager_id = 470;
+------------+----------+----------+------------+----------------+
| manager_id | role_id  | uniqueid | is_primary | receive_emails |
+------------+----------+----------+------------+----------------+
|        470 |        1 |      510 |          1 |              1 |
+------------+----------+----------+------------+----------------+
1 row in set (0.00 sec)

Roles are defined in the roles table with the permissions in rights table. If you need to reset the roles and their permissions back to their defaults, you can copy the content of these two tables from the blank-data.sql. We also have an XML file that can be used to export/import roles and their permissions (using Administration > Academic Sessions > Data Exchange page) -- this is useful for making a backup before making permission changes. The various XML formats are described at https://www.unitime.org/uct_interfaces.php.

Please notes that some roles are automatically associated based on having a record in some other table: there is the Student role if we have a student record, the Instructor role if there is an instructor record, the Advisor role if there is an instructor record, the No Role when the user is authenticated but no other role exists for the term, and the Anonymous for access that does not require authentication. If you want to disable some of these, the better approach is to mark the role as disabled (not enabled) on the Administration > Other > Roles page instead of deleting the role.

Please take a look at the administration manual (Help > Manuals > Administration) as it provides some useful information on how to set up UniTime.