Departmental Calendar

Objective: Laying down procedure of making the departmental calendar / scheduler for a big department which spread across a country. Download the source: I assume that you have SUSE 10.2 is already installed and Apache-Mysql-PHP are running in your server computer.

Calendar from calendarix is a great open source software for making departmental calendar to show various departmental events on web. Originally it was made and tested for windows platform but for a 24X7 environment I thought to try it on my SUSE 10.2 server. I find it works well on Linux. Download the zip file from http://www.calendarix.com . Extract all the files at the document root of the web server. (on Suse 10.2 this is normally /srv/www/htdocs/your-departmental-calendar/ )
Installation / Tweaking:

Create a database 'calendar' at mysql. For creating the necessary tables import the create_cal.sql file in the mysql prompt or run it from phpmyadmin's sql prompt.
(phpmyadmin is another great opensource GUI for administering mysql database, it's discussion is beyond the scope of this write up....)

Now open "cal_db.inc.php" in in your favorite text editor (mine is gedit) and check the database references. Check that the database name (calendar) , database login name, password and host are correct. Make the necessary changes and save the file as "cal_db.inc.php". (username=test or admin and password =testing or admin ) . The default.css (in /themes/directory) can be changed to suit the color and size of the fonts (which I have increased the font sizes for my department ). in the cal_config.inc.php // Make the following variable as 0. This will help everybody to see and add the events in the calendar without authentication. $userlogin = 0 ; $userview = 0 ; $publicview = 0 ; The existing authentication module is not very elegant for calendar. Specially for

admin it takes only admin as password. Changing the values does not work here. To solve the problem I have added an alternate authentication for my department. You can add any number of authentication here. dump the following code in an http_auth.php file <?php $valid_passwords = array ("bera" => "bera123","admin"=>"admin783167"); $valid_users = array_keys($valid_passwords); $user = $_SERVER['PHP_AUTH_USER']; $pass = $_SERVER['PHP_AUTH_PW']; $validated = (in_array($user, $valid_users)) && ($pass == $valid_passwords[$user]); if (!$validated) { header('WWW-Authenticate: Basic realm="My Calendar"'); header('HTTP/1.0 401 Unauthorized'); die ("Not authorized"); } ?> save the file as http_auth.php in the same calendar directory and then add the following line in index.php and calendar.php file include ('http_auth.php');
Testing:

Now every time you open the calendar or go to http://yourserver/yourdirectory/calendar/ location the browser will ask for authentication. (here the authentications are either bera & bera123 or admin & admin783167 ) You can add as many authentication as you like here in http_auth.php file. And when the authentication is through you can add , edit or delete the entries in the calendar module. It has plenty of choices for selection of languages (total 24 languages are selectable at cal_config.php file) .
Benefit: Once set properly this calendar program can be used very extensively all across the organization. SUSE 10.2 being the linux OS is extremely stable and The administration is also possible from remote.

Bye Bera