Difference between revisions of "WebCalendar"
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This is a lose collection of information regarding the web calendar. Currently we use [https://github.com/craigk5n/webcalendar?tab=readme-ov-file k5n's php implementation] with some custom changes (which might be possible to do in a better way, but I have no clue so far). | This is a lose collection of information regarding the web calendar. Currently we use [https://github.com/craigk5n/webcalendar?tab=readme-ov-file k5n's php implementation] with some custom changes (which might be possible to do in a better way, but I have no clue so far). | ||
− | == Backing up database | + | == Backing up database == |
The calendar user has no rights so you need to know the db admin login. Then you can do | The calendar user has no rights so you need to know the db admin login. Then you can do | ||
Line 18: | Line 18: | ||
For PHP v7.4 only WebCalendar v1.9.8 seems to work. They are in the process of updating to PHP v8! | For PHP v7.4 only WebCalendar v1.9.8 seems to work. They are in the process of updating to PHP v8! | ||
− | == | + | == LDAP settings == |
+ | |||
+ | After doing the initialization or updating of the database we need to connect to ldap. If you did not select LDAP autehtication during setup you can change that in 'includes/settings.php'. Adjust the settings in 'includes/auth-settings.php' such that: | ||
+ | |||
+ | <pre> | ||
+ | $user_can_update_password = false; | ||
+ | $admin_can_add_user = false; | ||
+ | $admin_can_delete_user = false; | ||
+ | ... | ||
+ | $ldap_server = '<server address>'; | ||
+ | ... | ||
+ | $set_lda-_version = true; | ||
+ | ... | ||
+ | $ldap_base_dn = 'ou=People,dc=sternwarte,dc=uni-erlangen,dc=de'; | ||
+ | ... | ||
+ | $ldap_admin_group_name = 'cn=leitung,ou=local,ou=Group,dc=sternwarte,dc=uni-erlangen,dc=de'; | ||
+ | ... | ||
+ | $ldap_user_filter = '(|(objectclass=remeisperson)(uid=webmaster))'; // only allow real people, but also webmaster | ||
+ | </pre> | ||
+ | |||
+ | == Customization == | ||
+ | |||
+ | We do small changes to guide the users: | ||
+ | |||
+ | 'includes/menu.php' change | ||
+ | <pre> | ||
+ | <a class="nav-link" href="<?php echo $logout_url; ?>">Logout</a> | ||
+ | </pre> | ||
+ | to | ||
+ | <pre> | ||
+ | <a class="nav-link" href="<?php echo $logout_url; ?>"><?php if ($login == '__public__') echo \ | ||
+ | 'Login'; else echo 'Logout';?></a> | ||
+ | </pre> | ||
+ | |||
+ | There are changes in 'includes/functions.php' regarding the __internal__ fake user. Check older WebCalendar files what was done. Same goes for 'includes/classes/WebCalendar.php', includes/translate.php', 'includes/user-ldap.php', 'edit_entry.php' and 'admin.php'. | ||
+ | |||
+ | Lastly, it seems that the entry edit queries only can handle 1 selected category (or none) but the page allows to select multiple. To change, edit 'edit_entry.php' (search for "Edit Categories") and change all buttons from "checkbox" to "radio" and remove the category id in the name for the radio buttons to communicate. | ||
[[Category:Web Admin]] | [[Category:Web Admin]] |
Latest revision as of 11:13, 6 September 2024
This is a lose collection of information regarding the web calendar. Currently we use k5n's php implementation with some custom changes (which might be possible to do in a better way, but I have no clue so far).
Backing up database
The calendar user has no rights so you need to know the db admin login. Then you can do ``` mysqldump -uroot -p Calendar_I > Calendar_I.sql ```
Calendar_I is what was as of this writing. Check include/settings.php in the WebCalendar folder to see what is actually used right now.
Update script
After backing the data base unpack the new version into a new folder, set the apache address (remember it is in puppet), and go through the install script. Make sure that 'includes/' is read/writeable by www-data! (and also the parent folder).
PHP version
For PHP v7.4 only WebCalendar v1.9.8 seems to work. They are in the process of updating to PHP v8!
LDAP settings
After doing the initialization or updating of the database we need to connect to ldap. If you did not select LDAP autehtication during setup you can change that in 'includes/settings.php'. Adjust the settings in 'includes/auth-settings.php' such that:
$user_can_update_password = false; $admin_can_add_user = false; $admin_can_delete_user = false; ... $ldap_server = '<server address>'; ... $set_lda-_version = true; ... $ldap_base_dn = 'ou=People,dc=sternwarte,dc=uni-erlangen,dc=de'; ... $ldap_admin_group_name = 'cn=leitung,ou=local,ou=Group,dc=sternwarte,dc=uni-erlangen,dc=de'; ... $ldap_user_filter = '(|(objectclass=remeisperson)(uid=webmaster))'; // only allow real people, but also webmaster
Customization
We do small changes to guide the users:
'includes/menu.php' change
<a class="nav-link" href="<?php echo $logout_url; ?>">Logout</a>
to
<a class="nav-link" href="<?php echo $logout_url; ?>"><?php if ($login == '__public__') echo \ 'Login'; else echo 'Logout';?></a>
There are changes in 'includes/functions.php' regarding the __internal__ fake user. Check older WebCalendar files what was done. Same goes for 'includes/classes/WebCalendar.php', includes/translate.php', 'includes/user-ldap.php', 'edit_entry.php' and 'admin.php'.
Lastly, it seems that the entry edit queries only can handle 1 selected category (or none) but the page allows to select multiple. To change, edit 'edit_entry.php' (search for "Edit Categories") and change all buttons from "checkbox" to "radio" and remove the category id in the name for the radio buttons to communicate.