Cool Solution - Webcalendar
From Univention Wiki
Note: Cool Solutions are articles documenting additional functionality based on Univention products.
Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.
Contents
Introduction
This article describes a way to install Webcalendar in UCS and to integrate it in a UCS domain (LDAP directory) as a company's calendar.
Webcalendar is a Web application "that can be configured as a single-user calendar, a multi-user calendar for groups of users, or as an event calendar viewable by visitors" See link to Webcalendar.
How is a calendar useful?
A digital calendar is not simply to see the date, nowadays a calendar is mainly expected to provide a personal agenda, where you can manage your list of appointments (or an assistant for you). It can also be used as a time management tool, or in a collaborative environment, to see the events of your team (or simply their availability), your partners or even your customers. More generally, a Web calendar can also be used to share the public events of the company to anyone interested.
Integration
The following sections describe the packages needed, the basic settings to get the Web installation wizard and the modifications to integrate it in the LDAP directory.
The examples are based the following environment, you need to adapt this to your network. For simplicity, here we are going to install the service and the database on the UCS Master.
Setting | Example |
---|---|
IP Address UCS DC Master | 192.168.100.10 |
Hostname of UCS DC Master (ldap/master) | master.domain.com |
LDAP port (ldap/master/port) | 7389 |
Base DN (ldap/base) | dc=domain,dc=com |
LDAP DN of calendar users | cn=users,dc=domain,dc=com |
LDAP DN of calendar administrators | cn=Enterprise Admins,cn=groups,dc=domain,dc=com |
Webcalendar bind user | uid=webcalendar,cn=users,dc=domain,dc=com |
Database service | Postgresql |
Database name | webcalendar |
Database user | webcalendarusr |
Prerequisites
- Update UCS to the last errata.
root@master:# univention-upgrade --ignoressh --updateto=4.1-1 --noninteractive
- Here we are going to use Postgresql
On UCS calendar server install the service and the database driver for PHP
root@master:# univention-install postgresql php5-pgsql root@master:# su - postgres postgres@master:~$ createdb webcalendar postgres@master:~$ createuser --no-createdb --no-adduser -R -P webcalendarusr
You will be prompted for the password of the database user. Logout from postgres session afterwards.
- Create a LDAP user for binding the service to LDAP
WEBCALPW=$(makepasswd --chars 20) udm users/user create \ --position="cn=users,$(ucr get ldap/base)" \ --option posix --set lastname=Service --set username=webcalendar \ --set primaryGroup="cn=Domain Users,cn=groups,$(ucr get ldap/base)" \ --set shell=/usr/sbin/nologin --set unixhome=/dev/null --set password="${WEBCALPW}" --set overridePWLength=1 --set overridePWHistory=1
Make sure not to lose the $WEBCALPW password, it will be needed to set the bind in Webcalendar user-ldap.php configuration file.
Optionally, you can create a group for calendar users and calendar Administrators, in case you don't want to use the default UCS groups
Preparation
Download latest release
Download the latest release from sourceforge.
wget https://sourceforge.net/projects/webcalendar/files/webcalendar%201.2/1.2.7/WebCalendar-1.2.7.tar.gz/download -O webcalendar.tar.gz tar zxvf webcalendar.tar.gz -C /var/www/ mv /var/www/WebCalendar-1.2.7 /var/www/calendar chown -R www-data:www-data /var/www/calendar/includes
If your are not going to use LDAP, you can now open your Web browser to http://192.168.100.10/calendar. Otherwise see next section.
LDAP Integration
The Install wizard offers further documentation. For example see appendix E "How To Configure for LDAP" http://192.168.100.10/calendar/docs/WebCalendar-SysAdmin.html#appendixE
- Edit user-ldap.php file
vi /var/www/calendar/includes/user-ldap.php
------ LDAP General Server Settings ------ // // Name or address of the LDAP server For SSL/TLS use 'ldaps:localhost' $ldap_server = 'master.domain.com'; // Port LDAP listens on (default 389) $ldap_port = '7389'; //... // base DN to search for users $ldap_base_dn = 'cn=users,dc=domain,dc=com'; //... // Account used to bind to the server and search for information. // This user must have the correct rights to perform search. // If left empty the search will be made in anonymous. // // * We do NOT recommend storing the root LDAP account info here * $ldap_admin_dn = 'uid=webcalendar,cn=users,dc=domain,dc=com'; // user DN $ldap_admin_pwd = 'GJozreHG7KIbKfSQx0IC'; // user password ($WEBCALPW) ------ Admin Group Settings ------ // // A group name (complete DN) to find users with admin rights $ldap_admin_group_name = 'cn=Enterprise Admins,cn=groups,dc=domain,dc=com';
Web Installation
- You can now open your Web browser to http://192.168.100.10/calendar, create the settings file password and finish the set-up steps.
- Install the database (See database setup image)
- Save the settings and Launch the WebCalendar
- Login with any UCS Domain username
UMC integration
Set the following variables to have a link to the calendar in the Univention Management Console:
ucr set ucs/web/overview/entries/service/calendar/description/de="Zugriff auf den Kalender" \ ucs/web/overview/entries/service/calendar/description="Access to the calendar" \ ucs/web/overview/entries/service/calendar/icon="/calendar/icons/example.gif" \ ucs/web/overview/entries/service/calendar/label/de="Calendar" \ ucs/web/overview/entries/service/calendar/label="Calendar" \ ucs/web/overview/entries/service/calendar/link="/calendar/" \ ucs/web/overview/entries/service/calendar/priority="45"
Usage
Please visit the README.html page for further information about everyday usage of the tool, see link to readme. See also calendars or the user manual
Troubleshooting
First of all, make sure that all the settings in the settings table given in the beginning correspond with their respective entries in both settings.php and user-ldap.php configuration files.
- Test LDAP connection
ldapsearch -h $(ucr get ldap/master) \ -p $(ucr get ldap/master/port) \ -x -D "uid=webcalendar,cn=users,$(ucr get ldap/base)" -w "${WEBCALPW}" \ -b cn=users,$(ucr get ldap/base) \ -LLL "(&(objectClass=person)(uid=*))" uid
- To change application settings go to http://192.168.100.10/calendar/install/ For example, you could set "User Authentication" to None (Single-User) and tick "Create Default Admin Account" to discard problems in other authentication methods. Save the settings and Launch the WebCalendar login page. test user 'admin', password 'admin'
- It could be useful to have a look at the list of current bugs in Sourceforge.
- Upgrading usually involves adapting the installed service to the last changes in the database, see http://192.168.100.10/calendar/UPGRADING.html
References
- Online Calendars - http://www.k5n.us/article.php?id=0003#toc_7
- Webcalendar - http://www.k5n.us/webcalendar.php
- Webcalendar bugs - https://sourceforge.net/p/webcalendar/bugs/
- Webcalendar in Sourceforge - https://sourceforge.net/projects/webcalendar/files/
- Webcalendar README - http://webcalendar.cvs.sourceforge.net/viewvc/webcalendar/webcalendar/README.html
- Webcalendar User Manual - http://webcalendar.cvs.sourceforge.net/viewvc/webcalendar/webcalendar/docs/WebCalendar-UserManual.html