### Eclipse Workspace Patch 1.0
#P mrbs
Index: web/view_entry.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/view_entry.php,v
retrieving revision 1.16
diff -u -r1.16 view_entry.php
--- web/view_entry.php	23 Jun 2004 21:06:52 -0000	1.16
+++ web/view_entry.php	2 Aug 2008 04:39:20 -0000
@@ -1,24 +1,33 @@
 <?php
-# $Id: view_entry.php,v 1.16 2004/06/23 21:06:52 gwalker Exp $
-
+# $Id: view_entry.php,v 1.6 2008/08/01 04:02:10 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
+
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
+include "functions.php";
+include "$dbsys.php";
+$id = required_param('id', PARAM_INT);
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$area = optional_param('area', 0, PARAM_INT);
+$room = optional_param('room', 0, PARAM_INT);
+$series = optional_param('series', 0, PARAM_INT);
+$pview = optional_param('pview', 0, PARAM_INT);
 
 #If we dont know the right date then make it up
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
 	$year  = date("Y");
 }
-if(empty($area))
+if($area==0)
 	$area = get_default_area();
 
-print_header($day, $month, $year, $area);
+print_header_mrbs($day, $month, $year, $area);
 
-if( empty($series) ) {
+if($series==0 ) { //this should be cleaned up - ab.
 	$series = 0;
 }
 else {
@@ -34,7 +43,7 @@
 	       $tbl_area.area_name,
 	       $tbl_repeat.type,
 	       $tbl_repeat.room_id,
-	       " . sql_syntax_timestamp_to_unix("$tbl_repeat.timestamp") . ",
+	       $tbl_repeat.timestamp,
 	       ($tbl_repeat.end_time - $tbl_repeat.start_time),
 	       $tbl_repeat.start_time,
 	       $tbl_repeat.end_time,
@@ -58,7 +67,7 @@
 	       $tbl_area.area_name,
 	       $tbl_entry.type,
 	       $tbl_entry.room_id,
-	       " . sql_syntax_timestamp_to_unix("$tbl_entry.timestamp") . ",
+	       $tbl_entry.timestamp,
 	       ($tbl_entry.end_time - $tbl_entry.start_time),
 	       $tbl_entry.start_time,
 	       $tbl_entry.end_time,
@@ -77,7 +86,7 @@
 if(sql_count($res) < 1) {
 	fatal_error(
 		0,
-		($series ? get_vocab("invalid_series_id") : get_vocab("invalid_entry_id"))
+		($series ? get_string('invalid_series_id','block_mrbs') : get_string('invalid_entry_id','block_mrbs'))
 	);
 }
 
@@ -186,40 +195,40 @@
 <H3><?php echo $name ?></H3>
  <table border=0>
    <tr>
-    <td><b><?php echo get_vocab("description") ?></b></td>
+    <td><b><?php echo get_string('description') ?></b></td>
     <td><?php    echo nl2br($description) ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("room").":" ?></b></td>
+    <td><b><?php echo get_string('room','block_mrbs').":" ?></b></td>
     <td><?php    echo  nl2br($area_name . " - " . $room_name) ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("start_date") ?></b></td>
+    <td><b><?php echo get_string('start_date','block_mrbs') ?></b></td>
     <td><?php    echo $start_date ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("duration") ?></b></td>
+    <td><b><?php echo get_string('duration','block_mrbs') ?></b></td>
     <td><?php    echo $duration . " " . $dur_units ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("end_date") ?></b></td>
+    <td><b><?php echo get_string('end_date','block_mrbs') ?></b></td>
     <td><?php    echo $end_date ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("type") ?></b></td>
+    <td><b><?php echo get_string('type','block_mrbs') ?></b></td>
     <td><?php    echo empty($typel[$type]) ? "?$type?" : $typel[$type] ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("createdby") ?></b></td>
+    <td><b><?php echo get_string('createdby','block_mrbs') ?></b></td>
     <td><?php    echo $create_by ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("lastupdate") ?></b></td>
+    <td><b><?php echo get_string('lastmodified') ?></b></td>
     <td><?php    echo $updated ?></td>
    </tr>
    <tr>
-    <td><b><?php echo get_vocab("rep_type") ?></b></td>
-    <td><?php    echo get_vocab($repeat_key) ?></td>
+    <td><b><?php echo get_string('rep_type','block_mrbs') ?></b></td>
+    <td><?php    echo get_string($repeat_key,'block_mrbs') ?></td>
    </tr>
 <?php
 
@@ -237,13 +246,13 @@
 	}
 	if ($rep_type == 6)
 	{
-		echo "<tr><td><b>".get_vocab("rep_num_weeks").get_vocab("rep_for_nweekly")."</b></td><td>$rep_num_weeks</td></tr>\n";
+		echo "<tr><td><b>".get_string('rep_num_weeks','block_mrbs').get_string('rep_for_nweekly','block_mrbs')."</b></td><td>$rep_num_weeks</td></tr>\n";
 	}
 	
 	if($opt)
-		echo "<tr><td><b>".get_vocab("rep_rep_day")."</b></td><td>$opt</td></tr>\n";
+		echo "<tr><td><b>".get_string('rep_rep_day','block_mrbs')."</b></td><td>$opt</td></tr>\n";
 	
-	echo "<tr><td><b>".get_vocab("rep_end_date")."</b></td><td>$rep_end_date</td></tr>\n";
+	echo "<tr><td><b>".get_string('rep_end_date','block_mrbs')."</b></td><td>$rep_end_date</td></tr>\n";
 }
 
 ?>
@@ -252,31 +261,31 @@
 <p>
 <?php
 if( ! $series )
-	echo "<a href=\"edit_entry.php?id=$id\">". get_vocab("editentry") ."</a>";
+	echo "<a href=\"edit_entry.php?id=$id\">". get_string('editentry','block_mrbs') ."</a>";
 
 if($repeat_id)
 	echo " - ";
 
 if($repeat_id || $series )
-	echo "<a href=\"edit_entry.php?id=$id&edit_type=series&day=$day&month=$month&year=$year\">".get_vocab("editseries")."</a>";
+	echo "<a href=\"edit_entry.php?id=$id&edit_type=series&day=$day&month=$month&year=$year\">".get_string('editseries','block_mrbs')."</a>";
 
 ?>
 <BR>
 <?php
 if( ! $series )
-	echo "<A HREF=\"del_entry.php?id=$id&series=0\" onClick=\"return confirm('".get_vocab("confirmdel")."');\">".get_vocab("deleteentry")."</A>";
+	echo "<A HREF=\"del_entry.php?id=$id&series=0\" onClick=\"return confirm('".get_string('confirmdel','block_mrbs')."');\">".get_string('deleteentry','block_mrbs')."</A>";
 
 if($repeat_id)
 	echo " - ";
 
 if($repeat_id || $series )
-	echo "<A HREF=\"del_entry.php?id=$id&series=1&day=$day&month=$month&year=$year\" onClick=\"return confirm('".get_vocab("confirmdel")."');\">".get_vocab("deleteseries")."</A>";
+    echo "<A HREF=\"del_entry.php?id=$id&series=1&day=$day&month=$month&year=$year\" onClick=\"return confirm('".get_string('confirmdel','block_mrbs')."');\">".get_string('deleteseries','block_mrbs')."</A>";
 
 ?>
 <BR>
 <?php if (isset($HTTP_REFERER)) //remove the link if displayed from an email
 { ?>
-<a href="<?php echo $HTTP_REFERER ?>"><?php echo get_vocab("returnprev") ?></a>
+<a href="<?php echo $HTTP_REFERER ?>"><?php echo get_string('returnprev','block_mrbs') ?></a>
 <?php
 }
-include "trailer.inc"; ?>
+include "trailer.php"; ?>
\ No newline at end of file
Index: web/auth_ldap.inc
===================================================================
RCS file: web/auth_ldap.inc
diff -N web/auth_ldap.inc
--- web/auth_ldap.inc	13 Feb 2007 12:53:23 -0000	1.7.2.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,165 +0,0 @@
-<?php
-
-// $Id: auth_ldap.inc,v 1.7.2.4 2007/02/13 12:53:23 jberanek Exp $
-
-/* ~~JFL 2003/11/12 By default, use the http session mechanism */
-if (!isset($auth['session'])) $auth['session']='http';
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-function authValidateUser($user, $pass)
-{
-	global $auth;
-	global $ldap_host;
-	global $ldap_port;
-	global $ldap_v3;
-	global $ldap_tls;
-	global $ldap_base_dn;
-	global $ldap_user_attrib;
-	global $ldap_filter;
-
-	$all_ldap_base_dn     = array();
-	$all_ldap_user_attrib = array();
-
-	// Check if we do not have a username/password
-	// User can always bind to LDAP anonymously with empty password,
-	// therefore we need to block empty password here...
-	if(!isset($user) || !isset($pass) || strlen($pass)==0)
-	{
-		return 0;
-	}
-
-	# Check that if there is an array of hosts and an array of ports
-	# then the number of each must be the same or the authenication
-	# is forced to fail.
-	if(is_array( $ldap_base_dn ) && is_array( $ldap_user_attrib ) && count($ldap_user_attrib) != count($ldap_base_dn) )
-	{
-		return 0;
-	}
-
-	# Transfer the based dn(s) to an new value to ensure that
-	# an array is always used.
-	# If a single value is passed then turn it into an array
-	if(is_array( $ldap_base_dn ) )
-	{
-		$all_ldap_base_dn = $ldap_base_dn;
-	}
-	else
-	{
-		$all_ldap_base_dn = array($ldap_base_dn);
-	}
-
-	# Transfer the array of user attributes to a new value.
-	# Create an array of the user attributes to match the number of
-	# base dn's if a single user attribute has been passed.
-	if(is_array( $ldap_user_attrib ) )
-	{
-		$all_ldap_user_attrib = $ldap_user_attrib;
-	}
-	else
-	{
-		while( each($all_ldap_base_dn ) )
-		{
-			$all_ldap_user_attrib[] = $ldap_user_attrib;
-		}
-	}
-
-	// establish ldap connection
-	// the '@' suppresses errors
-	if (isset($ldap_port))
-	{
-		$ldap = @ldap_connect($ldap_host, $ldap_port);
-	}
-	else
-	{
-		$ldap = @ldap_connect($ldap_host);
-	}
-
-	// Check that connection was established
-	if($ldap)
-	{
-		if ($ldap_v3)
-		{
-			ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
-		}
-		if ($ldap_tls)
-		{
-			ldap_start_tls($ldap);
-		}
-
-		// now process all base dn's until authentication is achieved
-		// or fail
-		foreach( $all_ldap_base_dn as $idx => $base_dn)
-		{
-			// construct dn for user
-			$dn = $all_ldap_user_attrib[$idx] . "=" . $user . "," . $base_dn;
-
-			// try an authenticated bind
-			// use this to confirm that the user/password pair
-			if(@ldap_bind($ldap, $dn, $pass))
-			{
-				// however if there is a filter check that the
-				// user is part of the group defined by the filter
-				if (! $ldap_filter)
-				{
-					@ldap_unbind($ldap);
-					return 1;
-				}
-				else
-				{
-					$res = @ldap_search(
-						$ldap,
-						$base_dn,
-						"(&(". $all_ldap_user_attrib[$idx] ."=$user)($ldap_filter))",
-						array()
-						);
-					if (@ldap_count_entries($ldap, $res) > 0)
-					{
-						@ldap_unbind($ldap);
-						return 1;
-					}
-				}
-			}
-		}
-		@ldap_unbind($ldap);
-	}
-	// return failure if no connection is established
-	return 0;
-}
-
-/* authGetUserLevel($user)
- *
- * Determines the users access level
- *
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-    // User not logged in, user level '0'
-    if(!isset($user))
-        return 0;
-    
-    // Check if the user is can modify
-    for($i = 0; $lev1_admin[$i]; $i++)
-    {
-        if(strcasecmp($user, $lev1_admin[$i]) == 0)
-            return 2;
-    }
-    
-    // Everybody else is access level '1'
-    return 1;
-}
-
-?>
Index: web/session_host.inc
===================================================================
RCS file: web/session_host.inc
diff -N web/session_host.inc
--- web/session_host.inc	29 Mar 2005 13:26:27 -0000	1.1.4.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-<?php
-
-/* $Id: session_host.inc,v 1.1.4.1 2005/03/29 13:26:27 jberanek Exp $
- *
- * This is a slight variant of session_ip. 
- * Session management scheme that uses the DNS name of the computer
- * to identify users and administrators.
- * Anyone who can access the server can make bookings etc.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- * $auth["type"]    = "none";
- * $auth["session"] = "host";
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "DNSname1";
- * $auth["admin"][] = "DNSname2";
- */
-
-# No need to prompt for a name - if no DNSname is returned, ip address
-# is used
-function authGet() { }
-
-function getUserName()
-{
-	global $REMOTE_ADDR;
-	$remotehostname = gethostbyaddr($REMOTE_ADDR);
-        return $remotehostname;
-}
-
-?>
Index: web/session_nt.inc
===================================================================
RCS file: web/session_nt.inc
diff -N web/session_nt.inc
--- web/session_nt.inc	29 Mar 2005 13:26:27 -0000	1.1.4.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,37 +0,0 @@
-<?php
-
-/* $Id: session_nt.inc,v 1.1.4.1 2005/03/29 13:26:27 jberanek Exp $
- *
- * Session management scheme that uses Windows NT domain users and Internet 
- * Information Server as the source for user authentication.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- *      $auth["type"]    = "none";
- *      $auth["session"] = "nt";
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "nt_username1";
- * $auth["admin"][] = "nt_username2";
- *
- * See AUTHENTICATION  for more informations.
- */
-
-/** 
- * Request that the username/password be given.
- *
- * For this scheme no need to prompt for a name - NT User always there.
- */
-function authGet() { }
-
-function getUserName()
-{
-	global $AUTH_USER;
-	$AUTH_USER = get_current_user();  
-	return $AUTH_USER;
-
-}
-
-?>
\ No newline at end of file
Index: web/lang.el
===================================================================
RCS file: web/lang.el
diff -N web/lang.el
--- web/lang.el	28 Jul 2004 10:01:12 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.el,v 1.4 2004/07/28 10:01:12 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Greek file.
-#
-#
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-7";
-
-# Used in style.inc
-$vocab["mrbs"]               = "������� ��������� �������� (MRBS)";
-
-# Used in functions.inc
-$vocab["report"]             = "�������";
-$vocab["admin"]              = "����������";
-$vocab["help"]               = "�������";
-$vocab["search"]             = "���������:";
-$vocab["not_php3"]           = "<H1>�������: ���� � ������ ��� �������� �� PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "��������� ���";
-$vocab["bookingsforpost"]    = ""; # Goes after the date
-$vocab["areas"]              = "��������:";
-$vocab["daybefore"]          = "�������� ���� ����������� ����";
-$vocab["dayafter"]           = "�������� ���� ������� ����";
-$vocab["gototoday"]          = "�������� ��� �������� ����";
-$vocab["goto"]               = "��������";
-$vocab["highlight_line"]     = "Highlight this line";
-$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "������� ��� �����";
-$vocab["viewweek"]           = "������� ��� ��������";
-$vocab["viewmonth"]          = "������� ��� ����";
-$vocab["ppreview"]           = "������������� ���������
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "�������� ��������
-$vocab["editentry"]          = "����������� ��������
-$vocab["editseries"]         = "����������� ������
-$vocab["namebooker"]         = "������� ���������:";
-$vocab["fulldescription"]    = "������ ���������:<br>&nbsp;&nbsp;(������� ������,<br>&nbsp;&nbsp;���������/��������� ���.)";
-$vocab["date"]               = "����������:";
-$vocab["start_date"]         = "��� �������:";
-$vocab["end_date"]           = "��� �����:";
-$vocab["time"]               = "���:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "��������:";
-$vocab["seconds"]            = "������������";
-$vocab["minutes"]            = "�����";
-$vocab["hours"]              = "����
-$vocab["days"]               = "������
-$vocab["weeks"]              = "���������
-$vocab["years"]              = "������";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "�������� ����";
-$vocab["type"]               = "�����:";
-$vocab["internal"]           = "���������";
-$vocab["external"]           = "���������";
-$vocab["save"]               = "����������";
-$vocab["rep_type"]           = "����� ����������:";
-$vocab["rep_type_0"]         = "������";
-$vocab["rep_type_1"]         = "��������";
-$vocab["rep_type_2"]         = "�����������";
-$vocab["rep_type_3"]         = "�������";
-$vocab["rep_type_4"]         = "������";
-$vocab["rep_type_5"]         = "�������, ���������� �����";
-$vocab["rep_type_6"]         = "n-�����������";
-$vocab["rep_end_date"]       = "���������� ����������� ����������:";
-$vocab["rep_rep_day"]        = "����� ����������:";
-$vocab["rep_for_weekly"]     = "(��� (n-)�����������)";
-$vocab["rep_freq"]           = "���������:";
-$vocab["rep_num_weeks"]      = "������� ��������
-$vocab["rep_for_nweekly"]    = "(��� n-�����������)";
-$vocab["ctrl_click"]         = "�������������� Control-Click ��� �� ��������� ������������ ��� ��� ��������
-$vocab["entryid"]            = "�������������� ������� �������� ";
-$vocab["repeat_id"]          = "�������������� ������� ���������� "; 
-$vocab["you_have_not_entered"] = "��� �������� �� (��)";
-$vocab["you_have_not_selected"] = "You have not selected a";
-$vocab["valid_room"]         = "room.";
-$vocab["valid_time_of_day"]  = "������ ���.";
-$vocab["brief_description"]  = "������� ���������.";
-$vocab["useful_n-weekly_value"] = "������� n-����������� ����.";
-
-# Used in view_entry.php
-$vocab["description"]        = "���������:";
-$vocab["room"]               = "�������";
-$vocab["createdby"]          = "������������� ���
-$vocab["lastupdate"]         = "��������� ���������:";
-$vocab["deleteentry"]        = "�������� ��������
-$vocab["deleteseries"]       = "�������� ������ ����������
-$vocab["confirmdel"]         = "����� �������\\n��� ������ ��\\n���������� ���� ��� �������;\\n\\n";
-$vocab["returnprev"]         = "��������� ���� ����������� ������";
-$vocab["invalid_entry_id"]   = "����� �������������� ������� �������.";
-$vocab["invalid_series_id"]  = "Invalid series id.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "������";
-$vocab["sched_conflict"]     = "�������������� ��������������
-$vocab["conflict"]           = "� ��� ������� ���������� �� ��� ��������� ��������:";
-$vocab["too_may_entrys"]     = "�� �������� �� ������������� ���������� ������ ��������.<BR>�������� ��������������� ������������ ��������!";
-$vocab["returncal"]          = "��������� �� ������� �����������
-$vocab["failed_to_acquire"]  = "�������� ����������� ������������� ��������� ���� ���� ���������"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "������������ � ��������";
-$vocab["norights"]           = "��� ����� ���������� ��������� ��� �� ������������� ���� �� �����������.";
-$vocab["please_login"]       = "�������� ������ �������� (log in)";
-$vocab["user_name"]          = "����� ������";
-$vocab["user_password"]      = "������� ���������
-$vocab["unknown_user"]       = "�������� �������
-$vocab["you_are"]            = "�����";
-$vocab["login"]              = "�������� (Log in)";
-$vocab["logoff"]             = "������ (Log Off)";
-
-# Authentication database
-$vocab["user_list"]          = "User list";
-$vocab["edit_user"]          = "Edit user";
-$vocab["delete_user"]        = "Delete this user";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email address";
-$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
-$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
-$vocab["add_new_user"]       = "Add a new user";
-$vocab["rights"]             = "Rights";
-$vocab["action"]             = "Action";
-$vocab["user"]               = "User";
-$vocab["administrator"]      = "Administrator";
-$vocab["unknown"]            = "Unknown";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-
-# Used in search.php
-$vocab["invalid_search"]     = "���� � ���������� ������� ����������.";
-$vocab["search_results"]     = "������������ ���������� ���:";
-$vocab["nothing_found"]      = "��� �������� �������� ��� �� ����������.";
-$vocab["records"]            = "���������� ";
-$vocab["through"]            = " ��� ";
-$vocab["of"]                 = " ���
-$vocab["previous"]           = "�����������";
-$vocab["next"]               = "�������";
-$vocab["entry"]              = "������";
-$vocab["view"]               = "�������";
-$vocab["advanced_search"]    = "��������� ���������";
-$vocab["search_button"]      = "���������";
-$vocab["search_for"]         = "��������� ���";
-$vocab["from"]               = "���
-
-# Used in report.php
-$vocab["report_on"]          = "������� ��� �����������:";
-$vocab["report_start"]       = "���������� ������� ��������:";
-$vocab["report_end"]         = "���������� ����� ��������:";
-$vocab["match_area"]         = "��������� ��������:";
-$vocab["match_room"]         = "��������� ��������:";
-$vocab["match_type"]         = "Match type:";
-$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
-$vocab["match_entry"]        = "��������� �������� ����������:";
-$vocab["match_descr"]        = "��������� ���������� ����������:";
-$vocab["include"]            = "�� �������������
-$vocab["report_only"]        = "������� ��
-$vocab["summary_only"]       = "�������� ��
-$vocab["report_and_summary"] = "������� ��� �������
-$vocab["summarize_by"]       = "������ ����:";
-$vocab["sum_by_descrip"]     = "������� ���������";
-$vocab["sum_by_creator"]     = "���������
-$vocab["entry_found"]        = "���������� �������";
-$vocab["entries_found"]      = "������������ ��������";
-$vocab["summary_header"]     = "�������� ���� ��������";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "������";
-$vocab["submitquery"]        = "�������� ��������
-$vocab["sort_rep"]           = "Sort Report by:";
-$vocab["sort_rep_time"]      = "Start Date/Time";
-$vocab["rep_dsp"]            = "Display in report:";
-$vocab["rep_dsp_dur"]        = "Duration";
-$vocab["rep_dsp_end"]        = "End Time";
-
-# Used in week.php
-$vocab["weekbefore"]         = "�������� ���� ����������� ��������";
-$vocab["weekafter"]          = "�������� ���� ������� ��������";
-$vocab["gotothisweek"]       = "�������� ���� �������� ��������";
-
-# Used in month.php
-$vocab["monthbefore"]        = "�������� ���� ����������� ����";
-$vocab["monthafter"]         = "�������� ���� ������� ����";
-$vocab["gotothismonth"]      = "�������� ���� �������� ����";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "��� ����� ������� �������� ��� ���� ��� �������";
-
-# Used in admin.php
-$vocab["edit"]               = "�����������";
-$vocab["delete"]             = "��������";
-$vocab["rooms"]              = "��������
-$vocab["in"]                 = "���";
-$vocab["noareas"]            = "����� �������";
-$vocab["addarea"]            = "�������� ��������
-$vocab["name"]               = "�����";
-$vocab["noarea"]             = "��� ���� ��������� �������";
-$vocab["browserlang"]        = "� ������������� ��� ������������";
-$vocab["postbrowserlang"]    = "������.";
-$vocab["addroom"]            = "�������� ��������
-$vocab["capacity"]           = "������������";
-$vocab["norooms"]            = "����� �������.";
-$vocab["administration"]     = "����������";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "����������� ��������
-$vocab["change"]             = "������";
-$vocab["backadmin"]          = "��������� ���� ����������";
-$vocab["editroomarea"]       = "����������� ���������� �������� � ��������
-$vocab["editroom"]           = "����������� ��������
-$vocab["update_room_failed"] = "� ��������� ��� �������� �������: ";
-$vocab["error_room"]         = "������: � ������� ";
-$vocab["not_found"]          = " ��� �������";
-$vocab["update_area_failed"] = "� ��������� ��� ������� �������: ";
-$vocab["error_area"]         = "������: � ������� ";
-$vocab["room_admin_email"]   = "Room admin email:";
-$vocab["area_admin_email"]   = "Area admin email:";
-$vocab["invalid_email"]      = "Invalid email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "� �������� ���� �� ��������� ��� ��������� ���������
-$vocab["sure"]               = "����� ��������;";
-$vocab["YES"]                = "���";
-$vocab["NO"]                 = "���";
-$vocab["delarea"]            = "������ �� ���������� ���� ��� �������� �� ���� �� ������� ��� �� ��������� �� ��� ����������<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "������� �� �� MRBS";
-$vocab["database"]           = "���� ���������: ";
-$vocab["system"]             = "�������: ";
-$vocab["please_contact"]     = "�������� ������������� �� ";
-$vocab["for_any_questions"]  = "��� ���� ��������� ��� ���������� ���.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "������� ������: �������� �������� ��� ���� ��������
-
-?>
Index: web/lang.it
===================================================================
RCS file: web/lang.it
diff -N web/lang.it
--- web/lang.it	28 Jul 2004 10:01:13 -0000	1.11
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.it,v 1.11 2004/07/28 10:01:13 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is an Italian file.
-#
-# Translations provided by: Gianni
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Sistema di Prenotazione Sale";
-
-# Used in functions.inc
-$vocab["report"]             = "Report";
-$vocab["admin"]              = "Admin";
-$vocab["help"]               = "Aiuto";
-$vocab["search"]             = "Ricerca:";
-$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Prenotazioni per";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Aree";
-$vocab["daybefore"]          = "Vai al Giorno Prima";
-$vocab["dayafter"]           = "Vai al Giorno Dopo";
-$vocab["gototoday"]          = "Vai a oggi";
-$vocab["goto"]               = "Vai a";
-$vocab["highlight_line"]     = "Highlight this line";
-$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Vedi Giorno";
-$vocab["viewweek"]           = "Vedi Settimana";
-$vocab["viewmonth"]          = "Vedi Mese";
-$vocab["ppreview"]           = "Anteprima Stampa";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Aggiungi";
-$vocab["editentry"]          = "Modifica";
-$vocab["editseries"]         = "Modifica Serie";
-$vocab["namebooker"]         = "Breve Descrizione:";
-$vocab["fulldescription"]    = "Descrizione Completa:<br>&nbsp;&nbsp;(Numero di persone,<br>&nbsp;&nbsp;Interno/Esterno ecc..)";
-$vocab["date"]               = "Data:";
-$vocab["start_date"]         = "Ora Inizio:";
-$vocab["end_date"]           = "Ora Fine:";
-$vocab["time"]               = "Ora:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "Durata:";
-$vocab["seconds"]            = "secondi";
-$vocab["minutes"]            = "minuti";
-$vocab["hours"]              = "ora";
-$vocab["days"]               = "giorni";
-$vocab["weeks"]              = "settimane";
-$vocab["years"]              = "anni";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "Tutto il giorno";
-$vocab["type"]               = "Tipo:";
-$vocab["internal"]           = "Interno";
-$vocab["external"]           = "Esterno";
-$vocab["save"]               = "Salva";
-$vocab["rep_type"]           = "Ripeti Tipo:";
-$vocab["rep_type_0"]         = "Nessuno";
-$vocab["rep_type_1"]         = "Giornaliero";
-$vocab["rep_type_2"]         = "Settimanale";
-$vocab["rep_type_3"]         = "Mensile";
-$vocab["rep_type_4"]         = "Annuale";
-$vocab["rep_type_5"]         = "Mensile, giorno corrispondente";
-$vocab["rep_type_6"]         = "nSettimanale";
-$vocab["rep_end_date"]       = "Ripeti data di Fine:";
-$vocab["rep_rep_day"]        = "Ripeti Girno:";
-$vocab["rep_for_weekly"]     = "(per (n-)settimanale)";
-$vocab["rep_freq"]           = "Frequenza:";
-$vocab["rep_num_weeks"]      = "Numero di settimane";
-$vocab["rep_for_nweekly"]    = "(per n-settimanale)";
-$vocab["ctrl_click"]         = "Use Control-Click to select more than one room";
-$vocab["entryid"]            = "Entry ID ";
-$vocab["repeat_id"]          = "Repeat ID "; 
-$vocab["you_have_not_entered"] = "You have not entered a";
-$vocab["you_have_not_selected"] = "You have not selected a";
-$vocab["valid_room"]         = "room.";
-$vocab["valid_time_of_day"]  = "valid time of day.";
-$vocab["brief_description"]  = "Brief Description.";
-$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Descrizione:";
-$vocab["room"]               = "Sala";
-$vocab["createdby"]          = "Creato da:";
-$vocab["lastupdate"]         = "Ultima Modifica:";
-$vocab["deleteentry"]        = "Cancella";
-$vocab["deleteseries"]       = "Cancella Series";
-$vocab["confirmdel"]         = "Sei sicuro\\nche vuoi\\ncancellare l\'elemento?\\n\\n";
-$vocab["returnprev"]         = "Ritorna alla Pagina Precedente";
-$vocab["invalid_entry_id"]   = "Invalid entry id.";
-$vocab["invalid_series_id"]  = "Invalid series id.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Errore";
-$vocab["sched_conflict"]     = "Conflitto di Prenotazione";
-$vocab["conflict"]           = "La nuova prenotazione sar� in conflitto con questa(e):";
-$vocab["too_may_entrys"]     = "L'opzione selezionata crea troppe entit�.<BR>Per favore usa una opzione differente!";
-$vocab["returncal"]          = "Ritorna al calendario";
-$vocab["failed_to_acquire"]  = "Failed to acquire exclusive database access"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Accesso Negato";
-$vocab["norights"]           = "Non hai i diritti per modificare questo oggetto.";
-$vocab["please_login"]       = "Please log in";
-$vocab["user_name"]          = "Name";
-$vocab["user_password"]      = "Password";
-$vocab["unknown_user"]       = "Unknown user";
-$vocab["you_are"]            = "You are";
-$vocab["login"]              = "Log in";
-$vocab["logoff"]             = "Log Off";
-
-# Authentication database
-$vocab["user_list"]          = "User list";
-$vocab["edit_user"]          = "Edit user";
-$vocab["delete_user"]        = "Delete this user";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email address";
-$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
-$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
-$vocab["add_new_user"]       = "Add a new user";
-$vocab["rights"]             = "Rights";
-$vocab["action"]             = "Action";
-$vocab["user"]               = "User";
-$vocab["administrator"]      = "Administrator";
-$vocab["unknown"]            = "Unknown";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Valore di Ricerca vuoto o sbagliato.";
-$vocab["search_results"]     = "Risultati ricerca per:";
-$vocab["nothing_found"]      = "Nessun risultato trovato.";
-$vocab["records"]            = "Trovati ";
-$vocab["through"]            = " attraverso ";
-$vocab["of"]                 = " di ";
-$vocab["previous"]           = "Precedente";
-$vocab["next"]               = "Successivo";
-$vocab["entry"]              = "Valore";
-$vocab["view"]               = "Vista";
-$vocab["advanced_search"]    = "Advanced search";
-$vocab["search_button"]      = "Ricerca";
-$vocab["search_for"]         = "Search For";
-$vocab["from"]               = "From";
-
-# Used in report.php
-$vocab["report_on"]          = "Report su Meetings:";
-$vocab["report_start"]       = "Report su data inizio:";
-$vocab["report_end"]         = "Report su data fine:";
-$vocab["match_area"]         = "Trovata area:";
-$vocab["match_room"]         = "Trovata stanza:";
-$vocab["match_type"]         = "Match type:";
-$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
-$vocab["match_entry"]        = "Trovata descrizione breve:";
-$vocab["match_descr"]        = "Trovata descrizione completa:";
-$vocab["include"]            = "Includi:";
-$vocab["report_only"]        = "Solo Report";
-$vocab["summary_only"]       = "Solo Raggruppamento";
-$vocab["report_and_summary"] = "Report e Raggruppamento";
-$vocab["summarize_by"]       = "Raggruppa per:";
-$vocab["sum_by_descrip"]     = "Breve descrizione";
-$vocab["sum_by_creator"]     = "Creatore";
-$vocab["entry_found"]        = "trovato valore";
-$vocab["entries_found"]      = "trovati valori";
-$vocab["summary_header"]     = "Gruppo di (Valori) Ore";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Totale";
-$vocab["submitquery"]        = "Run Report";
-$vocab["sort_rep"]           = "Sort Report by:";
-$vocab["sort_rep_time"]      = "Start Date/Time";
-$vocab["rep_dsp"]            = "Display in report:";
-$vocab["rep_dsp_dur"]        = "Duration";
-$vocab["rep_dsp_end"]        = "End Time";
-
-# Used in week.php
-$vocab["weekbefore"]         = "Vai alla Settimana Precedente";
-$vocab["weekafter"]          = "Vai alla Settimana Successiva";
-$vocab["gotothisweek"]       = "Vai alla Settimana Corrente";
-
-# Used in month.php
-$vocab["monthbefore"]        = "Vai al Mese Precedente";
-$vocab["monthafter"]         = "Vai al Mese Successivo";
-$vocab["gotothismonth"]      = "Vai al Mese Corrente";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Non ci sono sale per questa Area";
-
-# Used in admin.php
-$vocab["edit"]               = "Edit";
-$vocab["delete"]             = "Delete";
-$vocab["rooms"]              = "Rooms";
-$vocab["in"]                 = "in";
-$vocab["noareas"]            = "No Areas";
-$vocab["addarea"]            = "Add Area";
-$vocab["name"]               = "Name";
-$vocab["noarea"]             = "No area selected";
-$vocab["browserlang"]        = "Your browser is set to use";
-$vocab["postbrowserlang"]    = "language.";
-$vocab["addroom"]            = "Add Room";
-$vocab["capacity"]           = "Capacity";
-$vocab["norooms"]            = "No rooms.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Edit Area";
-$vocab["change"]             = "Change";
-$vocab["backadmin"]          = "Back to Admin";
-$vocab["editroomarea"]       = "Edit Area or Room Description";
-$vocab["editroom"]           = "Edit Room";
-$vocab["update_room_failed"] = "Update room failed: ";
-$vocab["error_room"]         = "Error: room ";
-$vocab["not_found"]          = " not found";
-$vocab["update_area_failed"] = "Update area failed: ";
-$vocab["error_area"]         = "Error: area ";
-$vocab["room_admin_email"]   = "Room admin email:";
-$vocab["area_admin_email"]   = "Area admin email:";
-$vocab["invalid_email"]      = "Invalid email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "This will delete the following bookings";
-$vocab["sure"]               = "Are you sure?";
-$vocab["YES"]                = "YES";
-$vocab["NO"]                 = "NO";
-$vocab["delarea"]            = "You must delete all rooms in this area before you can delete it<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "About MRBS";
-$vocab["database"]           = "Database: ";
-$vocab["system"]             = "System: ";
-$vocab["please_contact"]     = "Please contact ";
-$vocab["for_any_questions"]  = "for any questions that aren't answered here.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fatal Error: Failed to connect to database";
-
-?>
Index: web/xbLib.js
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/xbLib.js,v
retrieving revision 1.4
diff -u -r1.4 xbLib.js
--- web/xbLib.js	24 Aug 2004 16:58:55 -0000	1.4
+++ web/xbLib.js	2 Aug 2008 04:39:20 -0000
@@ -3,7 +3,7 @@
  *
  * Inspired by the excellent xbDOM.js (and using it for debugging)
  *
- * $Id: xbLib.js,v 1.4 2004/08/24 16:58:55 jflarvoire Exp $
+ * $Id: xbLib.js,v 1.1 2007/04/05 22:25:35 arborrow Exp $
  */
 
 var doAlert = false;
Index: web/mrbs_auth.inc
===================================================================
RCS file: web/mrbs_auth.inc
diff -N web/mrbs_auth.inc
--- web/mrbs_auth.inc	29 Mar 2005 13:26:27 -0000	1.8.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,82 +0,0 @@
-<?php
-// $Id: mrbs_auth.inc,v 1.8.2.1 2005/03/29 13:26:27 jberanek Exp $
-
-// include the authentification wrappers
-include "auth_$auth[type].inc";
-if (isset($auth['session'])) include "session_$auth[session].inc";
-
-/* getAuthorised($user, $pass, $level)
- * 
- * Check to see if the user name/password is valid
- * 
- * $user  - The user name
- * $pass  - The users password
- * $level - The access level required
- * 
- * Returns:
- *   0        - The user does not have the required access
- *   non-zero - The user has the required access
- */
-function getAuthorised($level)
-{
-    global $auth;
-
-    $user = getUserName();
-    if(isset($user) == FALSE) {
-        authGet();
-        return 0;
-    }
-
-    return authGetUserLevel($user, $auth["admin"]) >= $level;
-}
-
-/* getWritable($creator, $user)
- * 
- * Determines if a user is able to modify an entry
- *
- * $creator - The creator of the entry
- * $user    - Who wants to modify it
- *
- * Returns:
- *   0        - The user does not have the required access
- *   non-zero - The user has the required access
- */
-function getWritable($creator, $user)
-{
-    global $auth;
-
-    // Always allowed to modify your own stuff
-    if(strcasecmp($creator, $user) == 0)
-        return 1;
-
-    if(authGetUserLevel($user, $auth["admin"]) >= 2)
-        return 1;
-
-    // Unathorised access
-    return 0;
-}
-
-/* showAccessDenied()
- * 
- * Displays an appropate message when access has been denied
- * 
- * Retusns: Nothing
- */
-function showAccessDenied($day, $month, $year, $area)
-{
-    global $HTTP_REFERER;
-
-    print_header($day, $month, $year, $area);
-?>
-  <H1><?php echo get_vocab("accessdenied")?></H1>
-  <P>
-   <?php echo get_vocab("norights")?>
-  </P>
-  <P>
-   <A HREF="<?php echo $HTTP_REFERER; ?>"><?php echo get_vocab("returnprev"); ?></A>
-  </P>
- </BODY>
-</HTML>
-<?php
-}
-?>
Index: web/week.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/week.php,v
retrieving revision 1.37.2.2
diff -u -r1.37.2.2 week.php
--- web/week.php	13 Feb 2007 12:53:36 -0000	1.37.2.2
+++ web/week.php	2 Aug 2008 04:39:20 -0000
@@ -2,20 +2,30 @@
 # $Id: week.php,v 1.37.2.2 2007/02/13 12:53:36 jberanek Exp $
 
 # mrbs/week.php - Week-at-a-time view
-
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
-include "mincals.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+include "mincals.php";
+
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month',0,  PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$id = optional_param('id', 0, PARAM_INT);
+$area = optional_param('area', 0, PARAM_INT);
+$room = optional_param('room', 0, PARAM_INT);
+$debug_flag = optional_param('debug_flag', 0, PARAM_INT);
+$morningstarts_minutes = optional_param('morningstarts_minutes', 0, PARAM_INT);
+$pview = optional_param('pview', 0, PARAM_INT);
 
 if (empty($debug_flag)) $debug_flag = 0;
 
-$num_of_days=7; #could also pass this in as a parameter or whatever
+$num_of_days=7; #could also pass this in as a parameter or whatever // let's not -ab.
 
 # If we don't know the right date then use today:
-if (!isset($day) or !isset($month) or !isset($year))
+if (($day==0) or ($month==0) or ($year==0)) //I think we should separate these out and handle each variable independently -ab
 {
 	$day   = date("d");
 	$month = date("m");
@@ -36,14 +46,14 @@
 	$year  = date("Y", $time);
 }
 
-if (empty($area))
+if ($area==0)
 	$area = get_default_area();
-if (empty($room))
+if ($room==0)
 	$room = get_default_room($area);
 # Note $room will be 0 if there are no rooms; this is checked for below.
 
 # print the page header
-print_header($day, $month, $year, $area);
+print_header_mrbs($day, $month, $year, $area);
 
 $format = "Gi";
 if( $enable_periods ) {
@@ -57,8 +67,8 @@
 }
 
 # ensure that $morningstarts_minutes defaults to zero if not set
-if( empty( $morningstarts_minutes ) )
-	$morningstarts_minutes=0;
+// if( empty( $morningstarts_minutes ) ) //not needed with optional_param
+//	$morningstarts_minutes=0;
 
 # Define the start and end of each day of the week in a way which is not
 # affected by daylight saving...
@@ -80,12 +90,12 @@
 	$this_room_name = "";
 
 	# Show all areas
-	echo "<td width=\"30%\"><u>".get_vocab("areas")."</u><br>";
+	echo "<td width=\"30%\"><u>".get_string('areas','block_mrbs')."</u><br>";
 }
 
   # show either a select box or the normal html list
   if ($area_list_format == "select") {
-	echo make_area_select_html('week.php', $area, $year, $month, $day); # from functions.inc
+	echo make_area_select_html('week.php', $area, $year, $month, $day); # from functions.php
 	$this_area_name = sql_query1("select area_name from $tbl_area where id=$area");
 	$this_room_name = sql_query1("select room_name from $tbl_room where id=$room");
   } else {
@@ -108,12 +118,12 @@
 	echo "</td>\n";
 
 	# Show all rooms in the current area
-echo "<td width=\"30%\"><u>".get_vocab("rooms")."</u><br>";
+echo "<td width=\"30%\"><u>".get_string('rooms','block_mrbs')."</u><br>";
 }
 
   # should we show a drop-down for the room list, or not?
   if ($area_list_format == "select") {
-	echo make_room_select_html('week.php', $area, $room, $year, $month, $day); # from functions.inc
+	echo make_room_select_html('week.php', $area, $room, $year, $month, $day); # from functions.php
   } else {
 	$sql = "select id, room_name, description from $tbl_room where area_id=$area order by room_name";
 	$res = sql_query($sql);
@@ -142,8 +152,8 @@
 # Don't continue if this area has no rooms:
 if ($room <= 0)
 {
-	echo "<h1>".get_vocab("no_rooms_for_area")."</h1>";
-	include "trailer.inc";
+	echo "<h1>".get_string('no_rooms_for_area','block_mrbs')."</h1>";
+	include "trailer.php";
 	exit;
 }
 
@@ -167,10 +177,10 @@
 	#Show Go to week before and after links
 	echo "<table width=\"100%\"><tr><td>
 	  <a href=\"week.php?year=$yy&month=$ym&day=$yd&area=$area&room=$room\">
-	  &lt;&lt; ".get_vocab("weekbefore")."</a></td>
-	  <td align=center><a href=\"week.php?area=$area&room=$room\">".get_vocab("gotothisweek")."</a></td>
+	  &lt;&lt; ".get_string('weekbefore','block_mrbs')."</a></td>
+	  <td align=center><a href=\"week.php?area=$area&room=$room\">".get_string('gotothisweek','block_mrbs')."</a></td>
 	  <td align=right><a href=\"week.php?year=$ty&month=$tm&day=$td&area=$area&room=$room\">
-	  ".get_vocab("weekafter")."&gt;&gt;</a></td></tr></table>";
+	  ".get_string('weekafter','block_mrbs')."&gt;&gt;</a></td></tr></table>";
 }
 
 #Get all appointments for this week in the room that we care about
@@ -279,7 +289,7 @@
                . "true, "
                . ((FALSE != $times_right_side) ? "true" : "false") . ", "
                . "\"$highlight_method\", "
-               . "\"" . get_vocab("click_to_reserve") . "\""
+               . "\"" . get_string('click_to_reserve','block_mrbs') . "\""
                . ");</SCRIPT>\n";
             }
 
@@ -287,7 +297,7 @@
 echo "<table cellspacing=0 border=1 width=\"100%\">";
 
 # The header row contains the weekday names and short dates.
-echo "<tr><th width=\"1%\"><br>".($enable_periods ? get_vocab("period") : get_vocab("time"))."</th>";
+echo "<tr><th width=\"1%\"><br>".($enable_periods ? get_string('period','block_mrbs') : get_string('time'))."</th>";
 if (empty($dateformat))
 	$dformat = "%a<br>%b %d";
 else
@@ -297,14 +307,14 @@
 	$t = mktime( 12, 0, 0, $month, $day+$j, $year); 
 	echo "<th width=\"14%\"><a href=\"day.php?year=" . strftime("%Y", $t) . 
 	"&month=" . strftime("%m", $t) . "&day=" . strftime("%d", $t) . 
-	"&area=$area\" title=\"" . get_vocab("viewday") . "\">"
+	"&area=$area\" title=\"" . get_string('viewday','block_mrbs') . "\">"
     . utf8_strftime($dformat, $t) . "</a></th>\n";
 }
 # next line to display times on right side
 if ( FALSE != $times_right_side )
 {
     echo "<th width=\"1%\"><br>"
-    . ( $enable_periods  ? get_vocab("period") : get_vocab("time") )
+    . ( $enable_periods  ? get_string('period','block_mrbs') : get_string('time') )
     . "</th>";
 }
 
@@ -337,11 +347,11 @@
 	if( $enable_periods ){
 		$time_t_stripped = preg_replace( "/^0/", "", $time_t );
 		echo "<a href=\"$hilite_url=$time_t\"  title=\""
-        . get_vocab("highlight_line") . "\">"
+        . get_string('highlight_line','block_mrbs') . "\">"
         . $periods[$time_t_stripped] . "</a></td>";
 	} else {
 		echo "<a href=\"$hilite_url=$time_t\" title=\""
-        . get_vocab("highlight_line") . "\">"
+        . get_string('highlight_line','block_mrbs') . "\">"
         . utf8_strftime(hour_min_format(),$t) . "</a></td>";
 	}
 
@@ -442,14 +452,14 @@
             tdcell("red");
             $time_t_stripped = preg_replace( "/^0/", "", $time_t );
             echo "<a href=\"$hilite_url=$time_t\"  title=\""
-            . get_vocab("highlight_line") . "\">"
+            . get_string('highlight_line','block_mrbs') . "\">"
             . $periods[$time_t_stripped] . "</a></td>";
         }
         else
         {
             tdcell("red");
             echo "<a href=\"$hilite_url=$time_t\" title=\""
-            . get_vocab("highlight_line") . "\">"
+            . get_string('highlight_line','block_mrbs') . "\">"
             . utf8_strftime(hour_min_format(),$t) . "</a></td>";
         }
     }
@@ -460,5 +470,5 @@
 
 show_colour_key();
 
-include "trailer.inc"; 
+include "trailer.php"; 
 ?>
Index: web/help.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/help.php,v
retrieving revision 1.12.2.1
diff -u -r1.12.2.1 help.php
--- web/help.php	24 Jan 2007 10:40:16 -0000	1.12.2.1
+++ web/help.php	2 Aug 2008 04:39:19 -0000
@@ -1,37 +1,42 @@
 <?php
 
 # $Id: help.php,v 1.12.2.1 2007/01/24 10:40:16 jberanek Exp $
-
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "$dbsys.inc";
-include "functions.inc";
-include "version.inc";
+include "$dbsys.php";
+include "functions.php";
+include "version.php";
+
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$area = optional_param('area', get_default_area(),  PARAM_INT);
 
 #If we dont know the right date then make it up
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
 	$year  = date("Y");
 }
-if(empty($area))
-	$area = get_default_area();
+//if(empty($area)) - using optional_param -ab
+//	$area = get_default_area();
 
-print_header($day, $month, $year, $area);
+print_header_mrbs($day, $month, $year, $area);
 
-echo "<H3>" . get_vocab("about_mrbs") . "</H3>\n";
-echo "<P><a href=\"http://mrbs.sourceforge.net\">".get_vocab("mrbs")."</a> - ".get_mrbs_version()."\n";
-echo "<BR>" . get_vocab("database") . sql_version() . "\n";
-echo "<BR>" . get_vocab("system") . php_uname() . "\n";
+echo "<H3>" . get_string('about_mrbs','block_mrbs') . "</H3>\n";
+echo "<P><a href=\"http://mrbs.sourceforge.net\">".get_string('mrbs','block_mrbs')."</a> - ".get_mrbs_version()."\n";
+echo "<BR>" . get_string('database','block_mrbs') . sql_version() . "\n";
+echo "<BR>" . get_string('system','block_mrbs') . php_uname() . "\n";
 echo "<BR>PHP: " . phpversion() . "\n";
 
-echo "<H3>" . get_vocab("help") . "</H3>\n";
-echo get_vocab("please_contact") . '<a href="mailto:' . $mrbs_admin_email
+echo "<H3>" . get_string('help') . "</H3>\n";
+echo get_string('please_contact','block_mrbs') . '<a href="mailto:' . $mrbs_admin_email
 	. '">' . $mrbs_admin
-	. "</a> " . get_vocab("for_any_questions") . "\n";
+	. "</a> " . get_string('for_any_questions','block_mrbs') . "\n";
  
 include "site_faq" . $faqfilelang . ".html";
 
-include "trailer.inc";
+include "trailer.php";
 ?>
Index: web/auth_pop3.inc
===================================================================
RCS file: web/auth_pop3.inc
diff -N web/auth_pop3.inc
--- web/auth_pop3.inc	29 Mar 2005 13:26:15 -0000	1.6.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,170 +0,0 @@
-<?php
-
-/* $Id: auth_pop3.inc,v 1.6.2.2 2005/03/29 13:26:15 jberanek Exp $
- *
- * Authentication scheme that uses POP3 as the source for user
- * authentication.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- * $auth["realm"] = "MRBS";    # Or any other string
- * $auth["type"]  = "pop3";
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "pop3user1";
- * $auth["admin"][] = "pop3user2";
- */
-
-/* ~~JFL 2003/11/12 By default, use the http session mechanism */
-if (!isset($auth['session'])) $auth['session']='http';
-
-/* authValidateUser($user, $pass)
- *
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-function authValidateUser($user, $pass)
-{
-   global $auth;
-   global $pop3_host;
-   global $pop3_port;
-   $match= array();
-   $shared_secret = "";
-   $all_pop3_hosts = array();
-   $all_pop3_ports = array();
-
-   // Check if we do not have a username/password
-   if(!isset($user) || !isset($pass) || strlen($pass)==0)
-   {
-      return 0;
-   }
-
-   # Check that if there is an array of hosts and an array of ports
-   # then the number of each is the same
-   if(is_array( $pop3_host ) && is_array( $pop3_port ) && count($pop3_port) != count($pop3_host) )
-   {
-      return 0;
-   }
-
-   # Transfer the list of pop3 hosts to an new value to ensure that
-   # an array is always used.
-   # If a single value is passed then turn it into an array
-   if(is_array( $pop3_host ) )
-   {
-      $all_pop3_hosts = $pop3_host;
-   }
-   else
-   {
-      $all_pop3_hosts = array($pop3_host);
-   }
-
-   # create an array of the port numbers to match the number of
-   # hosts if a single port number has been passed.
-   if(is_array( $pop3_port ) )
-   {
-      $all_pop3_ports = $pop3_port;
-   }
-   else
-   {
-       while( each($all_pop3_hosts ) )
-       {
-          $all_pop3_ports[] = $pop3_port;
-       }
-   }
-
-   # iterate over all hosts and return if you get a successful login
-   foreach( $all_pop3_hosts as $idx => $host)
-   {
-      $error_number = "";
-      $error_string = "";
-
-      // Connect to POP3 server
-      $stream = fsockopen( $host, $all_pop3_ports[$idx], $error_number, $error_string, 15 );
-      $response = fgets( $stream, 1024 );
-
-      // first we try to use APOP, and then if that fails we fall back to traditional stuff
-
-      // get the shared secret ( something on the greeting line that looks like <XXXX> )
-      if ( preg_match( '/(<[^>]*>)/', $response, $match ) )
-      {
-	  $shared_secret = $match[0];
-      }
-
-      // if we have a shared secret then try APOP
-      if ($shared_secret) {
-	 $md5_token = md5("$shared_secret$pass");
-
-	 if ($stream) {
-	    $auth_string = "APOP $user $md5_token\r\n";
-	    fputs( $stream, $auth_string );
-
-	    // read the response. if it's an OK then we're authenticated
-	    $response = fgets( $stream, 1024 );
-	    if( substr( $response, 0, 3 ) == '+OK' ) {
-	       fputs( $stream, "QUIT\r\n" );
-	       return 1;
-	    }
-	 }
-      } // end shared secret if
-
-      // if we've still not authenticated then try using traditional methods
-      // need to reconnect if we tried APOP
-      if ($shared_secret) {
-	 $stream = fsockopen( $host, $all_pop3_ports[$idx], $error_number, $error_string, 15 );
-	 $response = fgets( $stream, 1024 );
-      }
-
-      // send standard POP3 USER and PASS commands
-      if( $stream ) {
-	 fputs( $stream, "USER $user\r\n" );
-	 $response = fgets( $stream, 1024 );
-	 if( substr( $response, 0, 3 ) == '+OK' ) {
-	    fputs( $stream, "PASS $pass\r\n" );
-	    $response = fgets( $stream, 1024 );
-	    if( substr( $response, 0, 3 ) == '+OK' ) {
-	       return 1;
-	    }
-	 }
-	 fputs( $stream, "QUIT\r\n" );
-      }
-   }
-
-   // return failure
-   return 0;
-}
-
-/* authGetUserLevel($user)
- * 
- * Determines the users access level
- * 
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-   // User not logged in, user level '0'
-   if(!isset($user))
-      return 0;
-
-   // Check if the user is can modify
-   for($i = 0; $lev1_admin[$i]; $i++)
-   {
-      if(strcasecmp($user, $lev1_admin[$i]) == 0)
-	 return 2;
-   }
-
-   // Everybody else is access level '1'
-   return 1;
-}
-
-?>
Index: web/language.inc
===================================================================
RCS file: web/language.inc
diff -N web/language.inc
--- web/language.inc	13 Feb 2007 12:53:32 -0000	1.13.2.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,676 +0,0 @@
-<?php
-
-# $Id: language.inc,v 1.13.2.4 2007/02/13 12:53:32 jberanek Exp $
-
-# A map is needed to convert from the HTTP language specifier to a
-# locale specifier for Windows
-$lang_map_windows = array
-(
-  'cs' => 'csy',
-  'cs-cs' => 'csy',
-  'cs-cz' => 'csy',
-  'cz' => 'csy',
-  'cz-cz' => 'csy',
-  'da' => 'dan',
-  'da-da' => 'dan',
-  'de' => 'deu',
-  'de-at' => 'dea',
-  'de-ch' => 'des',
-  'de-de' => 'deu',
-  'el' => 'ell',
-  'el-el' => 'ell',
-  'el-gr' => 'ell',
-  'en' => 'eng',
-  'en-au' => 'ena',
-  'en-ca' => 'enc',
-  'en-en' => 'eng',
-  'en-ie' => 'eng',
-  'en-nz' => 'enz',
-  'en-gb' => 'eng',
-  'en-us' => 'usa',
-  'es' => 'esp',
-  'es-es' => 'esp',
-  'es-mx' => 'esm',
-  'fi' => 'fin',
-  'fi-fi' => 'fin',
-  'fr' => 'fra',
-  'fr-be' => 'frb',
-  'fr-ca' => 'frc',
-  'fr-ch' => 'frs',
-  'fr-fr' => 'fra',
-  'it' => 'ita',
-  'it-ch' => 'its',
-  'it-it' => 'its',
-  'ja' => 'jpn',
-  'ja-ja' => 'jpn',
-  'ja-jp' => 'jpn',
-  'ko' => 'kor',
-  'ko-ko' => 'kor',
-  'ko-kr' => 'kor',
-  'nl' => 'nld',
-  'nl-be' => 'nlb',
-  'nl-nl' => 'nld',
-  'no' => 'norwegian',
-  'no-no' => 'norwegian',
-  'nb' => 'nor',
-  'nb-nb' => 'nor',
-  'nn' => 'non',
-  'nn-nn' => 'non',
-  'pl' => 'plk',
-  'pl-pl' => 'plk',
-  'pt' => 'ptg',
-  'pt-br' => 'ptb',
-  'pt-pt' => 'ptg',
-  'sv' => 'sve',
-  'sv-se' => 'sve',
-  'sv-sv' => 'sve',
-  'zh' => 'chinese',
-  'zh-tw' => 'cht',
-  'zh-cn' => 'chs',
-  'zh-hk' => 'cht',
-  'zh-sg' => 'cht',
-  'zh-zh' => 'chinese',
-);
-
-# This maps a Windows locale to the charset it uses, which are
-# all Windows code pages
-$winlocale_codepage_map = array
-(
-  'chs' => 'CP936',
-  'cht' => 'CP950',
-  'csy' => 'CP1250',
-  'dan' => 'CP1252',
-  'dea' => 'CP1252',
-  'des' => 'CP1252',
-  'deu' => 'CP1252',
-  'ell' => 'CP1253',
-  'ena' => 'CP1252',
-  'enc' => 'CP1252',
-  'eng' => 'CP1252',
-  'enz' => 'CP1252',
-  'esm' => 'CP1252',
-  'esp' => 'CP1252',
-  'fin' => 'CP1252',
-  'fra' => 'CP1252',
-  'frb' => 'CP1252',
-  'frc' => 'CP1252',
-  'frs' => 'CP1252',
-  'ita' => 'CP1252',
-  'its' => 'CP1252',
-  'jpn' => 'CP932',
-  'kor' => 'CP949',
-  'nlb' => 'CP1252',
-  'nld' => 'CP1252',
-  'norwegian' => 'CP1252',
-  'ptb' => 'CP1252',
-  'ptg' => 'CP1252',
-  'plk' => 'CP1250',
-  'sve' => 'CP1252',
-  'usa' => 'CP1252'
-);
-
-# These are special cases, generally we can convert from the HTTP
-# language specifier to a locale specifier without a map
-$lang_map_unix = array
-(
-  'cs_CS' => 'cs_CZ',
-  'da_DA' => 'da_DK',
-  'el_EL' => 'el_GR',
-  'en_EN' => 'en_GB',
-  'ja_JA' => 'ja_JP',
-  'ko_KO' => 'ko_KR',
-  'sv_SV' => 'sv_SE',
-  'zh_ZH' => 'zh_CN',
-);
-
-# IBM AIX locale to code set table
-# See http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf2/setlocale.htm
-$aixlocale_codepage_map = array
-(
-  'Ar_AA' => 'IBM-1046',
-  'ar_AA' => 'ISO8859-6',
-  'bg_BG' => 'ISO8856-5',
-  'cs_CZ' => 'ISO8859-2',
-  'Da_DK' => 'IBM-850',
-  'da_DK' => 'ISO8859-1',
-  'De_CH' => 'IBM-850',
-  'de_CH' => 'ISO8859-1',
-  'De_DE' => 'IBM-850',
-  'de_DE' => 'ISO8859-1',
-  'el_GR' => 'ISO8859-7',
-  'En_GB' => 'IBM-850',
-  'en_GB' => 'ISO8859-1',
-  'En_US' => 'IBM-850',
-  'en_US' => 'ISO8859-1',
-  'Es_ES' => 'IBM-850',
-  'es_ES' => 'ISO8859-1',
-  'Fi_FI' => 'IBM-850',
-  'fi_FI' => 'ISO8859-1',
-  'Fr_BE' => 'IBM-850',
-  'fr_BE' => 'ISO8859-1',
-  'Fr_CA' => 'IBM-850',
-  'fr_CA' => 'ISO8859-1',
-  'Fr_FR' => 'IBM-850',
-  'fr_FR' => 'ISO8859-1 ',
-  'Fr_CH' => 'IBM-850',
-  'fr_CH' => 'ISO8859-1',
-  'hr_HR' => 'ISO8859-2',
-  'hu_HU' => 'ISO8859-2',
-  'Is_IS' => 'IBM-850',
-  'is_IS' => 'ISO8859-1',
-  'It_IT' => 'IBM-850',
-  'it_IT' => 'ISO8859-1',
-  'Iw_IL' => 'IBM-856',
-  'iw_IL' => 'ISO8859-8',
-  'Ja_JP' => 'IBM-943',
-  'ko_KR' => 'IBM-eucKR',
-  'mk_MK' => 'ISO8859-5',
-  'Nl_BE' => 'IBM-850',
-  'nl_BE' => 'ISO8859-1',
-  'Nl_NL' => 'IBM-850',
-  'nl_NL' => 'ISO8859-1',
-  'No_NO' => 'IBM-850',
-  'no_NO' => 'ISO8859-1',
-  'pl_PL' => 'ISO8859-2',
-  'Pt_PT' => 'IBM-850',
-  'pt_PT' => 'ISO8859-1',
-  'ro_RO' => 'ISO8859-2',
-  'ru_RU' => 'ISO8859-5',
-  'sh_SP' => 'ISO8859-2',
-  'sl_SI' => 'ISO8859-2',
-  'sk_SK' => 'ISO8859-2',
-  'sr_SP' => 'ISO8859-5',
-  'Zh_CN' => 'GBK',
-  'Sv_SE' => 'IBM-850',
-  'sv_SE' => 'ISO8859-1',
-  'tr_TR' => 'ISO8859-9',
-  'zh_TW' => 'IBM-eucTW'
-);
-
-# GNU iconv code set to IBM AIX libiconv code set table
-# Keys of this table should be in lowercase, and searches should be performed using lowercase!
-$gnu_iconv_to_aix_iconv_codepage_map = array
-(
-  // "iso-8859-[1-9]" --> "ISO8859-[1-9]" according to http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf2/setlocale.htm
-  'iso-8859-1' => 'ISO8859-1',
-  'iso-8859-2' => 'ISO8859-2',
-  'iso-8859-3' => 'ISO8859-3',
-  'iso-8859-4' => 'ISO8859-4',
-  'iso-8859-5' => 'ISO8859-5',
-  'iso-8859-6' => 'ISO8859-6',
-  'iso-8859-7' => 'ISO8859-7',
-  'iso-8859-8' => 'ISO8859-8',
-  'iso-8859-9' => 'ISO8859-9',
-
-  // "big5" --> "IBM-eucTW" according to http://kadesh.cepba.upc.es/mancpp/classref/ref/ITranscoder_DSC.htm
-  'big5' => 'IBM-eucTW',
-
-  // "big-5" --> "IBM-eucTW" (see above)
-  'big-5' => 'IBM-eucTW'
-);
-
-# IBM AIX libiconv UTF-8 converters
-# See http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/convert_prg.htm#HDRDNNRI49HOWA
-$aix_utf8_converters = array
-(
-  'ISO8859-1',
-  'ISO8859-2',
-  'ISO8859-3',
-  'ISO8859-4',
-  'ISO8859-5',
-  'ISO8859-6',
-  'ISO8859-7',
-  'ISO8859-8',
-  'ISO8859-9',
-  'JISX0201.1976-0',
-  'JISX0208.1983-0',
-  'CNS11643.1986-1',
-  'CNS11643.1986-2',
-  'KSC5601.1987-0',
-  'IBM-eucCN',
-  'IBM-eucJP',
-  'IBM-eucKR',
-  'IBM-eucTW',
-  'IBM-udcJP',
-  'IBM-udcTW',
-  'IBM-sbdTW',
-  'UCS-2',
-  'IBM-437',
-  'IBM-850',
-  'IBM-852',
-  'IBM-857',
-  'IBM-860',
-  'IBM-861',
-  'IBM-863',
-  'IBM-865',
-  'IBM-869',
-  'IBM-921',
-  'IBM-922',
-  'IBM-932',
-  'IBM-943',
-  'IBM-934',
-  'IBM-935',
-  'IBM-936',
-  'IBM-938',
-  'IBM-942',
-  'IBM-944',
-  'IBM-946',
-  'IBM-948',
-  'IBM-1124',
-  'IBM-1129',
-  'TIS-620',
-  'IBM-037',
-  'IBM-273',
-  'IBM-277',
-  'IBM-278',
-  'IBM-280',
-  'IBM-284',
-  'IBM-285',
-  'IBM-297',
-  'IBM-500',
-  'IBM-875',
-  'IBM-930',
-  'IBM-933',
-  'IBM-937',
-  'IBM-939',
-  'IBM-1026',
-  'IBM-1112',
-  'IBM-1122',
-  'IBM-1124',
-  'IBM-1129',
-  'IBM-1381',
-  'GBK',
-  'TIS-620'
-);
-
-
-##############################################################################
-# Language token handling
-
-// Get first default set of language tokens for emails.
-if (MAIL_ADMIN_ON_BOOKINGS or MAIL_AREA_ADMIN_ON_BOOKINGS or
-    MAIL_ROOM_ADMIN_ON_BOOKINGS or MAIL_BOOKER)
-{
-    include "lang." . $default_language_tokens;
-    include "lang." . MAIL_ADMIN_LANG;
-    $mail_vocab = $vocab;
-    unset ($vocab);
-}
-
-# Get a default set of language tokens, you can change this if you like
-include "lang." . $default_language_tokens;
-
-# Define the default locale here. For a list of supported
-# locales on your system do "locale -a"
-setlocale(LC_ALL,'C');
-
-# We attempt to make up a sensible locale from the HTTP_ACCEPT_LANGUAGE
-# environment variable.
-
-# First we enumerate the user's language preferences...
-if (isset($HTTP_ACCEPT_LANGUAGE)) // Attempt to use $HTTP_ACCEPT_LANGUAGE only when defined.
-{
-  $lang_specifiers = explode(',',$HTTP_ACCEPT_LANGUAGE);
-  foreach ($lang_specifiers as $specifier)
-  {
-    if (preg_match('/([a-zA-Z\-]+);q=([0-9\.]+)/', $specifier, $matches))
-    {
-      $langs[$matches[1]] = $matches[2];
-    }
-    else if (preg_match("/([a-zA-Z\-]+)/", $specifier, $matches))
-    {
-      $langs[$matches[1]] = 1.0;
-    }
-  }
-  arsort($langs,SORT_NUMERIC);
-}
-else // Else use the value from config.inc.php.
-{
-  $langs[$default_language_tokens] = 1.0;
-}
-
-# The following attempts to import a language based on what the client
-# is using.
-
-if (!$disable_automatic_language_changing)
-{
-  $doneit = 0;
-
-  # First try for an exact match, so if the user specified en-gb, look
-  # for lang.en-gb
-
-  foreach ($langs as $lang => $qual)
-  {
-    $lang_file = "lang." . strtolower($lang);
-
-    if (file_exists($lang_file))
-    {
-      include $lang_file;
-      $doneit = 1;
-      $locale = $lang;
-      break;
-    }
-  }
-  if ($doneit == 0)
-  {
-    # None of the user's preferred languages was available, so try to
-    # find a lang file for one of the base languages, e.g. look for
-    # lang.en if "en-ca" was specified.
-
-    foreach ($langs as $lang)
-    {
-      $lang_file = "lang." . strtolower(substr($lang,0,2));
-
-      if (file_exists($lang_file))
-      {
-        include $lang_file;
-        $locale = $lang;
-        break;
-      }
-    }
-  }
-}
-
-##############################################################################
-# Locale handling
-
-$windows_locale = "eng";
-
-# 2003/11/09 JF Larvoire: Help new admins understand what to do in case the iconv error occurs...
-if (($unicode_encoding) && (!function_exists('iconv')))
-{
-  exit('
-<P>
-  <B>Error:</B> The iconv module, which provides PHP support for Unicode, is not
-installed on your system.</P>
-<P>Unicode gives MRBS the ability to easily support languages other than
-English. Without Unicode, support for non-English-speaking users will be crippled.</P>
-<P>To fix this error, do one of the following:</P>
-<UL>
-<LI><P>Install and enable the iconv module.<BR>
-On a Windows server, enable php_iconv.dll in %windir%\php.ini, and make sure both
-%phpdir%\dlls\iconv.dll and %phpdir%\extensions\php_iconv.dll are in the
-path. One way to do this is to copy these two files to %windir%.<BR>
-On a Unix server, recompile your PHP module with the appropriate
-option for enabling the iconv extension. Consult your PHP server
-documentation for more information about enabling iconv support.</P></LI>
-<LI><P>Disable Unicode support by modifying config.inc.php and setting the
-variable $unicode_encoding to 0. If your MRBS installation is on a shared
-host, then this may be your only option.</P></LI>
-</UL>
-');
-}
-
-if ($override_locale != "")
-{
-  if (setlocale(LC_ALL,$override_locale) == FALSE)
-  {
-    $locale_warning = "Server failed to set locale to
- \"".$override_locale."\" (Override locale)";
-  }
-  $windows_locale = $override_locale;
-}
-else
-{
-  $server_os = get_server_os();
-
-  if ($server_os == "windows")
-  {
-    if ($lang_map_windows[strtolower($locale)])
-    {
-      if (setlocale(LC_ALL, $lang_map_windows[strtolower($locale)]) == FALSE)
-      {
-        $locale_warning = "Server failed to set locale to
- \"".$lang_map_windows[strtolower($locale)]."\" (Windows)";
-      }
-      $windows_locale = $lang_map_windows[strtolower($locale)];
-    }
-    else
-    {
-      $locale_warning = "Server failed to map browser language
- \"".$locale."\" to a Windows locale specifier";
-    }
-  }
-  /* All of these Unix OSes work in mostly the same way... */
-  else if (($server_os == "linux") ||
-           ($server_os == "sunos") ||
-           ($server_os == "bsd") ||
-           ($server_os == "aix") ||
-           ($server_os == "macosx"))
-  {
-    if (strlen($locale) == 2)
-    {
-      # Convert locale=xx to xx_XX; this is not correct for some locales???
-      $locale = strtolower($locale)."_".strtoupper($locale);
-    }
-    else
-    {
-      # Convert locale=xx-xX or xx_Xx or xx_XxXx (etc.) to xx_XX[XX]; this is highly
-      # dependent on the machine's installed locales
-      $locale = strtolower(substr($locale,0,2))."_".strtoupper(substr($locale,3));
-    }
-    if (isset($lang_map_unix[$locale]) && ($lang_map_unix[$locale]))
-    {
-      $locale = $lang_map_unix[$locale];
-    }
-    if ($unicode_encoding)
-    {
-      if ($server_os == "sunos")
-      {
-        $locale .= ".UTF-8";
-      }
-      else
-      {
-        // On IBM AIX, do not add ".utf-8" as this yields an invalid
-        // locale name
-        if ($server_os != "aix")
-        {
-          $locale .= ".utf-8";
-        }
-      }
-    }
-    if (setlocale(LC_ALL, $locale) == FALSE)
-    {
-      $locale_warning = "Server failed to set locale to \"".$locale."\"
-(Unix)";
-    }
-  }
-}
-
-function get_server_os()
-{
-  if (stristr(PHP_OS,"Darwin"))
-  {
-    return "macosx";
-  }
-  else if (stristr(PHP_OS, "WIN"))
-  {
-    return "windows";
-  }
-  else if (stristr(PHP_OS, "Linux"))
-  {
-    return "linux";
-  }
-  else if (stristr(PHP_OS, "BSD"))
-  {
-    return "bsd";
-  }
-  else if (stristr(PHP_OS, "SunOS"))
-  {
-    return "sunos";
-  }
-  else if (stristr(PHP_OS, "AIX"))
-  {
-    return "aix";
-  }
-  else
-  {
-    return "unsupported";
-  }
-}
-
-// Translates a GNU libiconv character encoding name to its corresponding IBM AIX libiconv character
-// encoding name. Returns FALSE if character encoding name is unknown.
-function get_aix_character_encoding($character_encoding)
-{
-  global $gnu_iconv_to_aix_iconv_codepage_map;
-
-  // Check arguments
-  if ($character_encoding == NULL ||
-      !is_string($character_encoding) ||
-      empty($character_encoding))
-  {
-    return FALSE;
-  }
-
-  // Convert character encoding name to lowercase
-  $character_encoding = strtolower($character_encoding);
-
-  // Check that we know of an IBM AIX libiconv character encoding name equivalent for this character encoding name
-  if (!array_key_exists($character_encoding, $gnu_iconv_to_aix_iconv_codepage_map))
-  {
-    return FALSE;
-  }
-
-  return $gnu_iconv_to_aix_iconv_codepage_map[$character_encoding];
-}
-
-function get_vocab_utf8_aix($tag)
-{
-  global $aix_utf8_converters, $vocab;
-
-  // Attempt to translate character encoding name
-  $aix_character_set = get_aix_character_encoding($vocab['charset']);
-
-  // Check if character encoding name translation was successful
-  if ($aix_character_set === FALSE)
-  {
-    // Unsuccessful; just use the original character encoding name
-    $aix_character_set = $vocab['charset'];
-
-  }
-  else
-  {
-    // Successful; check that a corresponding UTF-8 converter exists
-    if (!in_array($aix_character_set, $aix_utf8_converters, TRUE))
-    {
-      // Corresponding UTF-8 converter does not exist; just use the original character encoding name
-      $aix_character_set = $vocab['charset'];
-
-    }
-    else
-    {
-      // Success; the translated character encoding name is ready to use
-    }
-  }
-
-  return iconv($aix_character_set, 'UTF-8', $vocab[$tag]);
-}
-
-
-# Get a vocab item, in UTF-8 or a local encoding, depending on
-# the setting of $unicode_encoding
-function get_vocab($tag)
-{
-  global $vocab, $unicode_encoding;
-
-  if ($unicode_encoding && (strcasecmp($vocab["charset"], "utf-8") != 0))
-  {
-    if ((get_server_os() == 'aix') &&
-        (strcasecmp(ICONV_IMPL, 'unknown') == 0) &&
-        (strcasecmp(ICONV_VERSION, 'unknown') == 0))
-    {
-      $translated = get_vocab_utf8_aix($tag);
-    }
-    else
-    {
-      $translated = iconv($vocab["charset"],"utf-8",$vocab[$tag]);
-    }
-  }
-  else
-  {
-    $translated = $vocab[$tag];
-  }
-  return $translated;
-}
-
-// AIX version of utf8_convert(); needed as locales won't give us UTF-8
-// NOTE: Should ONLY be called with input encoded in the default code set of the current locale!
-// NOTE: Uses the LC_TIME category for determining the current locale setting, so should preferrably be used on date/time input only!
-function utf8_convert_aix($string)
-{
-  global $aixlocale_codepage_map, $aix_utf8_converters, $unicode_encoding;
-
-  // Retrieve current locale setting
-  $aix_locale = setlocale(LC_TIME, '0');
-
-  if ($aix_locale === FALSE)
-  {
-    // Locale setting could not be retrieved; return string unchanged
-    return $string;
-  }
-
-  if (!array_key_exists($aix_locale, $aixlocale_codepage_map))
-  {
-    // Default code page of locale could not be found; return string unchanged
-    return $string;
-  }
-
-  $aix_codepage = $aixlocale_codepage_map[$aix_locale];
-
-  if (!in_array($aix_codepage, $aix_utf8_converters, TRUE))
-  {
-    // No suitable UTF-8 converter was found for this code page; return string unchanged
-    return $string;
-  }
-
-  // Convert string to UTF-8
-  $aix_string = iconv($aix_codepage, 'UTF-8', $string);
-
-  // Default to original string if conversion failed
-  $string = ($aix_string === FALSE) ? $string : $aix_string;
-
-  return $string;
-}
-
-function utf8_convert_from_locale($string)
-{
-  global $windows_locale, $unicode_encoding, $winlocale_codepage_map;
-
-  if ($unicode_encoding)
-  {
-    if (get_server_os() == "windows")
-    {
-      if ($winlocale_codepage_map[$windows_locale])
-      {
-        $string = iconv($winlocale_codepage_map[$windows_locale],"utf-8",
-                        $string);
-      }
-    }
-    else if (get_server_os() == "aix")
-    {
-      $string = utf8_convert_aix($string);
-    }
-  }
-  return $string;
-}
-  
-function utf8_strftime($format, $time)
-{
-  # %p doesn't actually work in some locales, we have to patch it up ourselves
-  if (preg_match('/%p/', $format))
-  {
-    $ampm = strftime('%p', $time);
-    if ($ampm == '')
-    {
-      $ampm = date('a',$time);
-    }
-
-    $format = preg_replace('/%p/', $ampm, $format);
-  }
-
-  $result = strftime($format,$time);
-  return utf8_convert_from_locale($result);
-}
-
-?>
Index: web/PEAR.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/PEAR.php,v
retrieving revision 1.2
diff -u -r1.2 PEAR.php
--- web/PEAR.php	16 Apr 2004 17:23:30 -0000	1.2
+++ web/PEAR.php	2 Aug 2008 04:39:18 -0000
@@ -18,9 +18,9 @@
 // |          Tomas V.V.Cox <cox@idecnet.com>                           |
 // +--------------------------------------------------------------------+
 //
-// $Id: PEAR.php,v 1.2 2004/04/16 17:23:30 thierry_bo Exp $
+// $Id: PEAR.php,v 1.1 2007/04/05 22:25:23 arborrow Exp $
 //
-
+require_once("../../../config.php"); //for Moodle integration
 define('PEAR_ERROR_RETURN',     1);
 define('PEAR_ERROR_PRINT',      2);
 define('PEAR_ERROR_TRIGGER',    4);
Index: web/lang.cz
===================================================================
RCS file: web/lang.cz
diff -N web/lang.cz
--- web/lang.cz	28 Jul 2004 15:52:59 -0000	1.10
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.cz,v 1.10 2004/07/28 15:52:59 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Czech file.
-#
-# Translations provided by: "SmEjDiL" <malyl@col.cz>, 
-#   "David Krotil" <David.Krotil@mu-sokolov.cz>
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-2";
-
-# Used in style.inc
-$vocab["mrbs"]               = "MRBS - Rezerva�n� syst�m";
-
-# Used in functions.inc
-$vocab["report"]             = "V�pis";
-$vocab["admin"]              = "Administr�tor";
-$vocab["help"]               = "Pomoc";
-$vocab["search"]             = "Hledat:";
-$vocab["not_php3"]             = "<H1>UPOZORN�N�: Toto z�ejm� nen� funk�n� s PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Objedn�no pro";
-$vocab["bookingsforpost"]    = ""; # Goes after the date
-$vocab["areas"]              = "Oblasti";
-$vocab["daybefore"]          = "Den vzad";
-$vocab["dayafter"]           = "Den vp�ed";
-$vocab["gototoday"]          = "Dnes";
-$vocab["goto"]               = "P�ej�t na";
-$vocab["highlight_line"]     = "Ozna�te tuto ��dku";
-$vocab["click_to_reserve"]   = "Klepn�te na bu�ku, aby jste provedli rezervaci.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Dny";
-$vocab["viewweek"]           = "T�dny";
-$vocab["viewmonth"]          = "M�s�ce ";
-$vocab["ppreview"]           = "Pro tisk";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "P�idat z�znam";
-$vocab["editentry"]          = "Editovat z�znam";
-$vocab["editseries"]         = "Editovat s�rii";
-$vocab["namebooker"]         = "Popis instrukce:";
-$vocab["fulldescription"]    = "Celkov� popis:<br>&nbsp;&nbsp;(Po�et cestuj�c�ch,<br>&nbsp;&nbsp;Obsazeno/Voln� m�sta atd)";
-$vocab["date"]               = "Datum:";
-$vocab["start_date"]         = "Za��tek:";
-$vocab["end_date"]           = "Konec:";
-$vocab["time"]               = "�as:";
-$vocab["period"]             = "Perioda:";
-$vocab["duration"]           = "Doba trv�n�:";
-$vocab["seconds"]            = "sekundy";
-$vocab["minutes"]            = "minuty";
-$vocab["hours"]              = "hodiny";
-$vocab["days"]               = "dny";
-$vocab["weeks"]              = "v�kendy";
-$vocab["years"]              = "roky";
-$vocab["periods"]            = "period";
-$vocab["all_day"]            = "V�echny dny";
-$vocab["type"]               = "Typ:";
-$vocab["internal"]           = "Voln� m�sta";
-$vocab["external"]           = "Obsazeno";
-$vocab["save"]               = "Ulo�it";
-$vocab["rep_type"]           = "Typ opakov�n�:";
-$vocab["rep_type_0"]         = "Nikdy";
-$vocab["rep_type_1"]         = "Denn�";
-$vocab["rep_type_2"]         = "T�dn�";
-$vocab["rep_type_3"]         = "M�s��n�";
-$vocab["rep_type_4"]         = "Ro�n�";
-$vocab["rep_type_5"]         = "M�s��n�, jednou za m�s�c";
-$vocab["rep_type_6"]         = "n-t�dn�
-$vocab["rep_end_date"]       = "Konec opakov�n�:";
-$vocab["rep_rep_day"]        = "Opakovat v den:";
-$vocab["rep_for_weekly"]     = "(pro (n-)t�dn�
-$vocab["rep_freq"]           = "Frekvence:";
-$vocab["rep_num_weeks"]      = "�islo t�dne";
-$vocab["rep_for_nweekly"]    = "(pro n-t�dn�
-$vocab["ctrl_click"]         = "U��t CTRL pro v�b�r v�ce m�stnost�";
-$vocab["entryid"]            = "Vstupn� ID ";
-$vocab["repeat_id"]          = "ID pro opakov�n�"; 
-$vocab["you_have_not_entered"] = "Nevlo�il jste";
-$vocab["you_have_not_selected"] = "Nevybral jste";
-$vocab["valid_room"]         = "prost�edek.";
-$vocab["valid_time_of_day"]  = "platn� �asov� �sek dne.";
-$vocab["brief_description"]  = "Kr�tk� popis.";
-$vocab["useful_n-weekly_value"] = "pou�iteln� x-t�denn� hodnota.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Popis:";
-$vocab["room"]               = "M�stnost:";
-$vocab["createdby"]          = "Vytvo�il u�ivatel:";
-$vocab["lastupdate"]         = "Posledn� zm�na:";
-$vocab["deleteentry"]        = "Smazat z�znam";
-$vocab["deleteseries"]       = "Smazat s�rii";
-$vocab["confirmdel"]         = "Jste si jist�\\nsmaz�n�m tohoto z�znamu?\\n\\n";
-$vocab["returnprev"]         = "N�vrat na p�edchoz� str�nku";
-$vocab["invalid_entry_id"]   = "�patn� ID z�znamu.";
-$vocab["invalid_series_id"]  = "�patn� ID skupiny.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Chyba";
-$vocab["sched_conflict"]     = "Konflikt p�i pl�nov�n�";
-$vocab["conflict"]           = "Nov� rezervace je v konfliktu s jin�m z�znamem:";
-$vocab["too_may_entrys"]     = "Vybran� volba byla vytvo�ena pro jin� z�znamy.<BR>Pros�m vyberte jinou volbu!";
-$vocab["returncal"]          = "N�vrat do kalend��
-$vocab["failed_to_acquire"]  = "Chyba v�hradn�ho p��stupu do datab�ze"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "P��stup zam�tnut";
-$vocab["norights"]           = "Nem�te p��stupov� pr�vo pro zm�nu t�to polo�ky.";
-$vocab["please_login"]       = "Pros�m, p�ihla�te se";
-$vocab["user_name"]          = "Jm�no";
-$vocab["user_password"]      = "Heslo";
-$vocab["unknown_user"]       = "Nezn�m� u�ivatel";
-$vocab["you_are"]            = "Jste";
-$vocab["login"]              = "P�ihl�sit se";
-$vocab["logoff"]             = "Odhl�sit se";
-
-# Authentication database
-$vocab["user_list"]          = "Seznam u�ivatel�
-$vocab["edit_user"]          = "Editovat u�ivatele";
-$vocab["delete_user"]        = "Smazat tohoto u�ivatele";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Emailov� adresa";
-$vocab["password_twice"]     = "Pokud chcete zm�nit heslo, pros�m napi�te ho dvakr�t";
-$vocab["passwords_not_eq"]   = "Chyba: Vlo�en� hesla se neshoduj�.";
-$vocab["add_new_user"]       = "P�idat nov�ho u�ivatele";
-$vocab["rights"]             = "Pr�va";
-$vocab["action"]             = "Akce";
-$vocab["user"]               = "U�ivatel";
-$vocab["administrator"]      = "Administr�tor";
-$vocab["unknown"]            = "Nezn�m�
-$vocab["ok"]                 = "Ano";
-$vocab["show_my_entries"]    = "Klepnout pro zobraz�n� v�ech nadch�zej�c�ch z�znam�
-
-# Used in search.php
-$vocab["invalid_search"]     = "Pr�zdn� nebo neplatn� hledan� �et�zec.";
-$vocab["search_results"]     = "V�sledek hled�n� pro:";
-$vocab["nothing_found"]      = "Nic nenalezeno";
-$vocab["records"]            = "Z�znam";
-$vocab["through"]            = " skrze ";
-$vocab["of"]                 = " o ";
-$vocab["previous"]           = "P�edchozi";
-$vocab["next"]               = "Dal��";
-$vocab["entry"]              = "Z�znam";
-$vocab["view"]               = "N�hled";
-$vocab["advanced_search"]    = "Roz���en� hled�n�";
-$vocab["search_button"]      = "Hledat";
-$vocab["search_for"]         = "Hledat co";
-$vocab["from"]               = "Od";
-
-# Used in report.php
-$vocab["report_on"]          = "V�pis setk�n�:";
-$vocab["report_start"]       = "V�pis za��tk�
-$vocab["report_end"]         = "V�pis konc�
-$vocab["match_area"]         = "Hledan� oblast:";
-$vocab["match_room"]         = "Hledan� m�stnost:";
-$vocab["match_type"]         = "Hledan� typ:";
-$vocab["ctrl_click_type"]    = "U��t CTRL pro v�b�r v�ce typ�
-$vocab["match_entry"]        = "Hledat v popisu:";
-$vocab["match_descr"]        = "Hledat v cel�m popisu:";
-$vocab["include"]            = "Zahrnovat:";
-$vocab["report_only"]        = "Jen v�pis";
-$vocab["summary_only"]       = "Jen p�ehled";
-$vocab["report_and_summary"] = "V�pis a p�ehled";
-$vocab["summarize_by"]       = "P�ehled od:";
-$vocab["sum_by_descrip"]     = "Popis instrukce";
-$vocab["sum_by_creator"]     = "Tv�rce";
-$vocab["entry_found"]        = "nalezeno";
-$vocab["entries_found"]      = "nalezeno";
-$vocab["summary_header"]     = "P�ehled  (z�znamu) hodiny";
-$vocab["summary_header_per"] = "P�ehled  (z�znamu) periody";
-$vocab["total"]              = "Celkem";
-$vocab["submitquery"]        = "Vytvo�it sestavu";
-$vocab["sort_rep"]           = "Se�adit v�pis podle:";
-$vocab["sort_rep_time"]      = "V�choz� den/�as";
-$vocab["rep_dsp"]            = "Zobrazit ve v�pisu:";
-$vocab["rep_dsp_dur"]        = "Trv�n�";
-$vocab["rep_dsp_end"]        = "�as ukon�en�";
-
-# Used in week.php
-$vocab["weekbefore"]         = "T�den dozadu";
-$vocab["weekafter"]          = "T�den dop�edu";
-$vocab["gotothisweek"]       = "Tento t�den";
-
-# Used in month.php
-$vocab["monthbefore"]        = "M�s�c dozadu";
-$vocab["monthafter"]         = "M�sic dop�edu";
-$vocab["gotothismonth"]      = "Tento m�s�c";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Pro tuto m�stnost nen� definov�na �adn� oblast!";
-
-# Used in admin.php
-$vocab["edit"]               = "Editovat";
-$vocab["delete"]             = "Smazat";
-$vocab["rooms"]              = "M�stnosti";
-$vocab["in"]                 = "v";
-$vocab["noareas"]            = "��dn� oblasti";
-$vocab["addarea"]            = "P�idat oblast";
-$vocab["name"]               = "Jm�no";
-$vocab["noarea"]             = "Nen� vybr�na ��dn� oblast";
-$vocab["browserlang"]        = "Prohl�ec je nastaven k pou�it�";
-$vocab["postbrowserlang"]    = "jazyku.";
-$vocab["addroom"]            = "P�idat m�stnost";
-$vocab["capacity"]           = "Kapacita";
-$vocab["norooms"]            = "��dn� m�stnost.";
-$vocab["administration"]     = "Administrace";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Editovat oblast";
-$vocab["change"]             = "Zm�na";
-$vocab["backadmin"]          = "N�vrat do administrace";
-$vocab["editroomarea"]       = "Editovat popis oblasti nebo m�stnosti";
-$vocab["editroom"]           = "Editovat m�stnosti";
-$vocab["update_room_failed"] = "Chyba editace m�stnosti: ";
-$vocab["error_room"]         = "Chyba: m�stnost ";
-$vocab["not_found"]          = " nenalezen";
-$vocab["update_area_failed"] = "Chyba editace oblasti: ";
-$vocab["error_area"]         = "Chyba: oblast ";
-$vocab["room_admin_email"]   = "Email administr�tora m�stnosti:";
-$vocab["area_admin_email"]   = "Email administr�tora oblasti";
-$vocab["invalid_email"]      = "�patn� email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Bylo smaz�no rezervov�n�";
-$vocab["sure"]               = "Jste si jist�
-$vocab["YES"]                = "ANO";
-$vocab["NO"]                 = "NE";
-$vocab["delarea"]            = "Mus�te smazat v�echny m�stnosti v t�to oblasti p�edt�m ne� ji m�ete smazat<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "O MRBS";
-$vocab["database"]           = "Datab�ze: ";
-$vocab["system"]             = "Syst�m: ";
-$vocab["please_contact"]     = "Pros�m kontaktujte ";
-$vocab["for_any_questions"]  = "pokud m�te n�jak� dal�� ot�zky.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fataln� chyba: Nepoda�ilo se p�ipojit do datab�ze";
-
-?>
Index: web/lang.fi
===================================================================
RCS file: web/lang.fi
diff -N web/lang.fi
--- web/lang.fi	9 Oct 2006 15:53:59 -0000	1.9.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id : lang.fi,v 1.1 Thu Jan 30 2003 thierry_bo Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is the Finnish version.
-#
-# Translation by Vesa Palmu ( vesa.palmu@no... ),
-# 2005 Tom Ingberg (tom.ingberg@iki.fi.invalid)
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "utf-8";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Huonetilojen varausjärjestelmä";
-
-# Used in functions.inc
-$vocab["report"]             = "Raportit";
-$vocab["admin"]              = "Ylläpito";
-$vocab["help"]               = "Ohjeet";
-$vocab["search"]             = "Etsi:";
-$vocab["not_php3"]             = "Varoitus: Järjestelmä ei välttämättä toimi PHP3:lla.</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Varaukset";
-$vocab["bookingsforpost"]    = ""; # Goes after the date
-$vocab["areas"]              = "Tilat";
-$vocab["daybefore"]          = "Edelliseen päivään";
-$vocab["dayafter"]           = "Seuraavaan päivään";
-$vocab["gototoday"]          = "Tähän päivään";
-$vocab["goto"]               = "mene";
-$vocab["highlight_line"]     = "Korosta tämä rivi";
-$vocab["click_to_reserve"]   = "Napsauta solua tehdäksesi varauksen.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Näytä päivä";
-$vocab["viewweek"]           = "Näytä viikko";
-$vocab["viewmonth"]          = "Näytä kuukausi";
-$vocab["ppreview"]           = "Tulostuksen esikatselu";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Lisää varaus";
-$vocab["editentry"]          = "Muokkaa varausta";
-$vocab["editseries"]         = "Muokkaa varaussarjaa";
-$vocab["namebooker"]         = "Lyhyt kuvaus:";
-$vocab["fulldescription"]    = "Täydellinen kuvaus:<br>&nbsp;&nbsp;(Montako ihmistä,<br>&nbsp;&nbsp;sisäinen/ulkoinen jne)";
-$vocab["date"]               = "Päivämäärä:";
-$vocab["start_date"]         = "Aloitusaika:";
-$vocab["end_date"]           = "Lopetusaika:";
-$vocab["time"]               = "Aika:";
-$vocab["period"]             = "Jakso:";
-$vocab["duration"]           = "Kesto:";
-$vocab["seconds"]            = "sekuntia";
-$vocab["minutes"]            = "minuuttia";
-$vocab["hours"]              = "tuntia";
-$vocab["days"]               = "päivää";
-$vocab["weeks"]              = "viikkoa";
-$vocab["years"]              = "vuotta";
-$vocab["periods"]            = "jaksoa";
-$vocab["all_day"]            = "Koko päivän";
-$vocab["type"]               = "Tyyppi:";
-$vocab["internal"]           = "Sisäinen";
-$vocab["external"]           = "Ulkoinen";
-$vocab["save"]               = "Tallenna";
-$vocab["rep_type"]           = "Toiston tyyppi:";
-$vocab["rep_type_0"]         = "Ei toistoa";
-$vocab["rep_type_1"]         = "Päivittäin";
-$vocab["rep_type_2"]         = "Viikoittain";
-$vocab["rep_type_3"]         = "Kuukausittain";
-$vocab["rep_type_4"]         = "Vuosittain";
-$vocab["rep_type_5"]         = "Kuukausittain samana viikonpäivänä";
-$vocab["rep_type_6"]         = "Määräaikainen viikoittainen";
-$vocab["rep_end_date"]       = "Toiston loppupäivämäärä:";
-$vocab["rep_rep_day"]        = "Toiston viikonpäivä:";
-$vocab["rep_for_weekly"]     = "(viikottaiselle toistolle)";
-$vocab["rep_freq"]           = "Tiheys:";
-$vocab["rep_num_weeks"]      = "Montako viikkoa";
-$vocab["rep_for_nweekly"]    = "(määräaikaiselle viikottaiselle)";
-$vocab["ctrl_click"]         = "Pidä CTRL-nappi pohjassa valitaksesi useita huoneita.";
-$vocab["entryid"]            = "Varauksen ID ";
-$vocab["repeat_id"]          = "Toiston ID "; 
-$vocab["you_have_not_entered"] = "Et ole antanut seuraavaa pakollista tietoa:";
-$vocab["you_have_not_selected"] = "Et ole valinnut";
-$vocab["valid_room"]         = "huonetta.";
-$vocab["valid_time_of_day"]  = "Ajankohta ei ole kelpaa.";
-$vocab["brief_description"]  = "Lyhyt kuvaus";
-$vocab["useful_n-weekly_value"] = "Määräaikaisen viikottaisen varauksen viikkomäärä.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Kuvaus:";
-$vocab["room"]               = "Huone:";
-$vocab["createdby"]          = "Varauksen tekijä:";
-$vocab["lastupdate"]         = "Päivitetty:";
-$vocab["deleteentry"]        = "Poista varaus";
-$vocab["deleteseries"]       = "Poista varaussarja";
-$vocab["confirmdel"]         = "Oletko varma että haluat poistaa\\ntämän varauksen?\\n\\n";
-$vocab["returnprev"]         = "Takaisin edelliselle sivulle";
-$vocab["invalid_entry_id"]   = "Virheellinen varauksen ID.";
-$vocab["invalid_series_id"]  = "Virheellinen sarjan ID.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Virhe";
-$vocab["sched_conflict"]     = "Päällekkäinen varaus";
-$vocab["conflict"]           = "Uusi varaus menee päällekkäin seuraavien varausten kanssa:";
-$vocab["too_may_entrys"]     = "Valituilla ehdoilla tulisi liian monta varausta.<br>Valittuja ehtoja on muutettava.";
-$vocab["returncal"]          = "Paluu kalenterinäkymään";
-$vocab["failed_to_acquire"]  = "Tietokantaan ei saatu (varauksetonta) yhteyttä."; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Pääsy kielletty";
-$vocab["norights"]           = "Sinulla ei ole riittävästi oikeuksia yrittämäsi toiminnon suorittamiseen.";
-$vocab["please_login"]       = "Ole hyvä ja kirjaudu sisään";
-$vocab["user_name"]          = "Käyttäjätunnus";
-$vocab["user_password"]      = "Salasana";
-$vocab["unknown_user"]       = "Tuntematon käyttäjä";
-$vocab["you_are"]            = "Olet";
-$vocab["login"]              = "Kirjaudu sisään";
-$vocab["logoff"]             = "Kirjaudu ulos";
-
-# Authentication database
-$vocab["user_list"]          = "Käyttäjälista";
-$vocab["edit_user"]          = "Muokkaa käyttäjää";
-$vocab["delete_user"]        = "Poista tämä käyttäjä";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Sähköpostiosoite";
-$vocab["password_twice"]     = "Jos haluat vaihtaa salasanan, ole hyvä ja anna uusi salasana kahdesti";
-$vocab["passwords_not_eq"]   = "Virhe: Salasanat eivät täsmää.";
-$vocab["add_new_user"]       = "Lisää uusi käyttäjä";
-$vocab["rights"]             = "Oikeudet";
-$vocab["action"]             = "Toiminto";
-$vocab["user"]               = "Käyttäjä";
-$vocab["administrator"]      = "Ylläpitäjä";
-$vocab["unknown"]            = "Tuntematon";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Tyhjä tai kelpaamaton haku.";
-$vocab["search_results"]     = "Hakutulokset:";
-$vocab["nothing_found"]      = "Yhtään varausta ei löytynyt antamillasi ehdoilla. ";
-$vocab["records"]            = "Tulokset ";
-$vocab["through"]            = " - ";
-$vocab["of"]                 = " tuloksia yhteensä: ";
-$vocab["previous"]           = "Edellinen";
-$vocab["next"]               = "Seuraava";
-$vocab["entry"]              = "Varaus";
-$vocab["view"]               = "Katsele";
-$vocab["advanced_search"]    = "Tarkennettu haku";
-$vocab["search_button"]      = "Hae";
-$vocab["search_for"]         = "Etsi:";
-$vocab["from"]               = "Alkaen";
-
-# Used in report.php
-$vocab["report_on"]          = "Raportti varauksista:";
-$vocab["report_start"]       = "Raportin alkupäivämäärä:";
-$vocab["report_end"]         = "Raportin loppupäivämäärä:";
-$vocab["match_area"]         = "Alue:";
-$vocab["match_room"]         = "Huone:";
-$vocab["match_type"]         = "Tyyppi:";
-$vocab["ctrl_click_type"]    = "Pidä Ctrl-näppäin alaspainettuna valitaksesi useamman tyypin.";
-$vocab["match_entry"]        = "Lyhyt kuvaus:";
-$vocab["match_descr"]        = "Täydellinen kuvaus:";
-$vocab["include"]            = "Sisältäen:";
-$vocab["report_only"]        = "Ainoastaan raportti";
-$vocab["summary_only"]       = "Ainoastaan yhteenveto";
-$vocab["report_and_summary"] = "Molemmat";
-$vocab["summarize_by"]       = "Yhteenvedon peruste:";
-$vocab["sum_by_descrip"]     = "Lyhyt kuvaus";
-$vocab["sum_by_creator"]     = "Varaaja";
-$vocab["entry_found"]        = "varaus löytyi";
-$vocab["entries_found"]      = "varausta löytyi";
-$vocab["summary_header"]     = "Varausten tunnit yhteensä";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Kaikkiaan";
-$vocab["submitquery"]        = "Tee raportti";
-$vocab["sort_rep"]           = "Raporttien lajittelun peruste:";
-$vocab["sort_rep_time"]      = "Aloitusaika";
-$vocab["rep_dsp"]            = "Näytä raportissa:";
-$vocab["rep_dsp_dur"]        = "Kesto";
-$vocab["rep_dsp_end"]        = "Loppumisaika";
- 
-# Used in week.php
-$vocab["weekbefore"]         = "Edelliseen viikkoon";
-$vocab["weekafter"]          = "Seuraavaan viikkoon";
-$vocab["gotothisweek"]       = "Tähän viikkoon";
-
-# Used in month.php
-$vocab["monthbefore"]        = "Edelliseen kuukauteen";
-$vocab["monthafter"]         = "Seuraavaan kuukauteen";
-$vocab["gotothismonth"]      = "Tähän kuukauteen";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Tällä alueella ei ole yhtään huonetta.";
-
-# Used in admin.php
-$vocab["edit"]               = "Muokkaa";
-$vocab["delete"]             = "Poista";
-$vocab["rooms"]              = "Huoneet";
-$vocab["in"]                 = "alueella";
-$vocab["noareas"]            = "Ei alueita";
-$vocab["addarea"]            = "Lisää alue";
-$vocab["name"]               = "Nimi";
-$vocab["noarea"]             = "Ei valittua aluetta";
-$vocab["browserlang"]        = "Selaimesi kieliasetus on";
-$vocab["postbrowserlang"]    = ".";
-$vocab["addroom"]            = "Lisää huone";
-$vocab["capacity"]           = "Maksimi henkilömäärä";
-$vocab["norooms"]            = "Ei huoneita.";
-$vocab["administration"]     = "Ylläpito";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Muokkaa alueen tietoja";
-$vocab["change"]             = "Tallenna";
-$vocab["backadmin"]          = "Takaisin ylläpitoon";
-$vocab["editroomarea"]       = "Muokkaa alueen tai huoneen kuvausta";
-$vocab["editroom"]           = "Muokkaa huoneen tietoja";
-$vocab["update_room_failed"] = "Huoneen tietojen päivitys epäonnistui: ";
-$vocab["error_room"]         = "Virhe: huonetta ";
-$vocab["not_found"]          = " ei löytynyt";
-$vocab["update_area_failed"] = "Alueen tietojen päivitys epäonnistui: ";
-$vocab["error_area"]         = "Virhe: aluetta ";
-$vocab["room_admin_email"]   = "Huonevastaavan sähköposti:";
-$vocab["area_admin_email"]   = "Aluevastaavan sähköposti:";
-$vocab["invalid_email"]      = "Virheellinen sähköpostiosoite!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Seuraavat varaukset poistetaan";
-$vocab["sure"]               = "Oletko varma?";
-$vocab["YES"]                = "KYLLÄ";
-$vocab["NO"]                 = "EN";
-$vocab["delarea"]            = "Sinun täytyy poistaa kaikki alueen huoneet ennnen kuin voit poistaa alueen.<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "Tietoja varausjärjestelmästä";
-$vocab["database"]           = "Tietokanta: ";
-$vocab["system"]             = "Käyttöjärjestelmä: ";
-$vocab["please_contact"]     = "Järjestelmän yhteyshenkilö ";
-$vocab["for_any_questions"]  = "antaa lisätietoja mikäli et löydä vastausta kysymykseesi näistä ohjeista.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Järjestelmävirhe: Tietokantayhteyden avaaminen ei onnistu.";
-
-?>
Index: web/lang.no
===================================================================
RCS file: web/lang.no
diff -N web/lang.no
--- web/lang.no	10 Jun 2005 08:50:28 -0000	1.13.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,252 +0,0 @@
-<?php
-# $Id: lang.no,v 1.13.2.1 2005/06/10 08:50:28 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is the Norwegian file.
-#
-# Translations provided by: Rune Johansen (rune.johansen@finedamer.com)
-# Further translated by: Emil St�a (emil@consider.no)
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "M�teromsbooking";
-
-# Used in functions.inc
-$vocab["report"]             = "Rapport";
-$vocab["admin"]              = "Admin";
-$vocab["help"]               = "Hjelp";
-$vocab["search"]             = "S�k:";
-$vocab["not_php3"]           = "<H1>NB: Dette virker sannsynligvis ikke med PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Booking for";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Omr�de";
-$vocab["daybefore"]          = "G� til forrige dag";
-$vocab["dayafter"]           = "G� til neste dag";
-$vocab["gototoday"]          = "G� til idag";
-$vocab["goto"]               = "g� til";
-$vocab["highlight_line"]     = "Merk denne linjen";
-$vocab["click_to_reserve"]   = "Trykk i cellen for � reservere.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Vis dag";
-$vocab["viewweek"]           = "Vis Uke";
-$vocab["viewmonth"]          = "Vis M�ned";
-$vocab["ppreview"]           = "Forh�ndsvisning";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Booking";
-$vocab["editentry"]          = "Endre booking";
-$vocab["editseries"]         = "Endre serie";
-$vocab["namebooker"]         = "Kort beskrivelse:";
-$vocab["fulldescription"]    = "Lang beskrivelse:<br>&nbsp;&nbsp;(Antall personer,<br>&nbsp;&nbsp;Internt/Eksternt osv)";
-$vocab["date"]               = "Dato:";
-$vocab["start_date"]         = "Starttid:";
-$vocab["end_date"]           = "Sluttid:";
-$vocab["time"]               = "Tid:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "Lengde:";
-$vocab["seconds"]            = "sekunder";
-$vocab["minutes"]            = "minutter";
-$vocab["hours"]              = "timer";
-$vocab["days"]               = "dager";
-$vocab["weeks"]              = "uker";
-$vocab["years"]              = "�r";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "hele dagen";
-$vocab["type"]               = "Type:";
-$vocab["internal"]           = "Internt";
-$vocab["external"]           = "Eksternt";
-$vocab["save"]               = "Lagre";
-$vocab["rep_type"]           = "Repetisjonstype:";
-$vocab["rep_type_0"]         = "ingen";
-$vocab["rep_type_1"]         = "daglig";
-$vocab["rep_type_2"]         = "ukentlig";
-$vocab["rep_type_3"]         = "m�nedlig";
-$vocab["rep_type_4"]         = "�rlig";
-$vocab["rep_type_5"]         = "M�nedlig, samme dag";
-$vocab["rep_type_6"]         = "n-ukentlig";
-$vocab["rep_end_date"]       = "Repetisjon sluttdato:";
-$vocab["rep_rep_day"]        = "Repetisjonsdag:";
-$vocab["rep_for_weekly"]     = "(ved hver uke)";
-$vocab["rep_freq"]           = "Frekvens:";
-$vocab["rep_num_weeks"]      = "Antall uker";
-$vocab["rep_for_nweekly"]    = "(for n-uker)";
-$vocab["ctrl_click"]         = "Hold inne kontrolltasten for � velge mer enn ett rom";
-$vocab["entryid"]            = "Booking ID ";
-$vocab["repeat_id"]          = "Repetisjons ID "; 
-$vocab["you_have_not_entered"] = "Du har ikke angitt";
-$vocab["you_have_not_selected"] = "Du har ikke valgt ";
-$vocab["valid_room"]         = "ett rom.";
-$vocab["valid_time_of_day"]  = "ett gyldig tidspunkt.";
-$vocab["brief_description"]  = "en kort beskrivelse.";
-$vocab["useful_n-weekly_value"] = "en gyldig verdi for antall uker.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Beskrivelse:";
-$vocab["room"]               = "Rom";
-$vocab["createdby"]          = "Laget av:";
-$vocab["lastupdate"]         = "Senest oppdatert:";
-$vocab["deleteentry"]        = "Slett booking";
-$vocab["deleteseries"]       = "Slett serie";
-$vocab["confirmdel"]         = "Er du sikker p� at\\ndu vil slette bookingen?\\n\\n";
-$vocab["returnprev"]         = "Tilbake til forrige side";
-$vocab["invalid_entry_id"]   = "Ugyldig booking-ID.";
-$vocab["invalid_series_id"]  = "Ugyldig serie-ID.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Feil";
-$vocab["sched_conflict"]     = "Bookingkonflikt";
-$vocab["conflict"]           = "Bookingen er i konflikt med f�lgende booking(er):";
-$vocab["too_may_entrys"]     = "De valgte instillinger skaper for mange bookinger.<BR>Vennligst bruk andre instillinger!";
-$vocab["returncal"]          = "Tilbake til kalender";
-$vocab["failed_to_acquire"]  = "Kunne ikke oppn� eksklusiv databasetilgang"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Ingen adgang";
-$vocab["norights"]           = "Du har ingen rettigheter til � endre bookingen.";
-$vocab["please_login"]       = "Vennligst logg inn";
-$vocab["user_name"]          = "Navn";
-$vocab["user_password"]      = "Passord";
-$vocab["unknown_user"]       = "Ukjent bruker";
-$vocab["you_are"]            = "Bruker: ";
-$vocab["login"]              = "Logg inn";
-$vocab["logoff"]             = "Logg ut";
-
-# Authentication database
-$vocab["user_list"]          = "Brukerliste";
-$vocab["edit_user"]          = "Rediger bruker";
-$vocab["delete_user"]        = "Slett denne brukeren";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Epost-addresse";
-$vocab["password_twice"]     = "Hvis du vil endre passordet, skriv det nye passordet to ganger";
-$vocab["passwords_not_eq"]   = "Feil: Passordene er ikke like.";
-$vocab["add_new_user"]       = "Legg til ny bruker";
-$vocab["rights"]             = "Rettigheter";
-$vocab["action"]             = "Valg";
-$vocab["user"]               = "Bruker";
-$vocab["administrator"]      = "Administrator";
-$vocab["unknown"]            = "Ukjent";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Trykk for � vise kommende innlegg";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Tom eller ugyldig s�kestreng.";
-$vocab["search_results"]     = "S�keresultat for:";
-$vocab["nothing_found"]      = "Ingen poster ble funnet.";
-$vocab["records"]            = "Booking ";
-$vocab["through"]            = " til ";
-$vocab["of"]                 = " av ";
-$vocab["previous"]           = "Forrige";
-$vocab["next"]               = "Neste";
-$vocab["entry"]              = "Post";
-$vocab["view"]               = "Vis";
-$vocab["advanced_search"]    = "Avansert s�
-$vocab["search_button"]      = "S�
-$vocab["search_for"]         = "S�k etter";
-$vocab["from"]               = "Fra";
-
-# Used in report.php
-$vocab["report_on"]          = "Rapport:";
-$vocab["report_start"]       = "Start dato:";
-$vocab["report_end"]         = "Slutt dato:";
-$vocab["match_area"]         = "Omr�de:";
-$vocab["match_room"]         = "Rom:";
-$vocab["match_type"]         = "Velg type:";
-$vocab["ctrl_click_type"]    = "Bruk CTRL-tasten for � velge fler enn en type";
-$vocab["match_entry"]        = "Kort beskrivelse:";
-$vocab["match_descr"]        = "Lang beskrivelse:";
-$vocab["include"]            = "Skal inneholde:";
-$vocab["report_only"]        = "Bare rapport";
-$vocab["summary_only"]       = "Summering";
-$vocab["report_and_summary"] = "Rapport og Summering";
-$vocab["summarize_by"]       = "Summering etter:";
-$vocab["sum_by_descrip"]     = "Kort beskrivelse";
-$vocab["sum_by_creator"]     = "Hvem som booket";
-$vocab["entry_found"]        = "post funnet";
-$vocab["entries_found"]      = "poster funnet";
-$vocab["summary_header"]     = "Sum timer";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Totalt";
-$vocab["submitquery"]        = "Kj�r rapport";
-$vocab["sort_rep"]           = "Sorter rapport etter:";
-$vocab["sort_rep_time"]      = "Dato/Tid";
-$vocab["rep_dsp"]            = "Vis i rapport:";
-$vocab["rep_dsp_dur"]        = "Varighet";
-$vocab["rep_dsp_end"]        = "Slutt-tid";
-
-# Used in week.php
-$vocab["weekbefore"]         = "G� til uken f�
-$vocab["weekafter"]          = "G� til uken etter";
-$vocab["gotothisweek"]       = "G� til denne uken";
-
-# Used in month.php
-$vocab["monthbefore"]        = "G� til forrige m�ned";
-$vocab["monthafter"]         = "G� til neste m�ned";
-$vocab["gotothismonth"]      = "G� til denne m�neden";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Ingen rom definert for dette omr�det";
-
-# Used in admin.php
-$vocab["edit"]               = "Endre";
-$vocab["delete"]             = "Slett";
-$vocab["rooms"]              = "Rom";
-$vocab["in"]                 = "i";
-$vocab["noareas"]            = "Ingen omr�der";
-$vocab["addarea"]            = "Legg til omr�de";
-$vocab["name"]               = "Navn";
-$vocab["noarea"]             = "Omr�de ikke valgt";
-$vocab["browserlang"]        = "Din nettleser er satt opp til � bruke f�lgende spr�k:";
-$vocab["postbrowserlang"]    = "";
-$vocab["addroom"]            = "Legg til rom";
-$vocab["capacity"]           = "Kapasitet";
-$vocab["norooms"]            = "Ingen rom.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Endre omr�de";
-$vocab["change"]             = "Endre";
-$vocab["backadmin"]          = "Tilbake til admin";
-$vocab["editroomarea"]       = "Endre omr�de- eller rombeskrivelse";
-$vocab["editroom"]           = "Endre rom";
-$vocab["update_room_failed"] = "Oppdatering av rom feilet: ";
-$vocab["error_room"]         = "Feil: rom ";
-$vocab["not_found"]          = " ble ikke funnet";
-$vocab["update_area_failed"] = "Oppdatering av omr�de feilet: ";
-$vocab["error_area"]         = "Feil: omr�de ";
-$vocab["room_admin_email"]   = "Rom-administrators E-post:";
-$vocab["area_admin_email"]   = "Omr�de-administrators E-post:";
-$vocab["invalid_email"]      = "Ugyldig E-post!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Dette vil slette f�lgende bookinger";
-$vocab["sure"]               = "Er du sikker?";
-$vocab["YES"]                = "JA";
-$vocab["NO"]                 = "NEI";
-$vocab["delarea"]            = "Du m� slette alle rommene i dette omr�det f�r du kan slette det<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "Om MRBS";
-$vocab["database"]           = "Database: ";
-$vocab["system"]             = "System: ";
-$vocab["please_contact"]     = "Vennligst ta kontakt med ";
-$vocab["for_any_questions"]  = "for sp�rsm�l som ikke er besvart her.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Alvorlig feil: Kunne ikke koble til database";
-
-?>
Index: web/grab_globals.inc.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/grab_globals.inc.php,v
retrieving revision 1.2
diff -u -r1.2 grab_globals.inc.php
--- web/grab_globals.inc.php	14 Nov 2003 21:47:20 -0000	1.2
+++ web/grab_globals.inc.php	2 Aug 2008 04:39:19 -0000
@@ -18,8 +18,8 @@
 // | @version   $Revision: 1.2 $.
 // +---------------------------------------------------------------------------+
 //
-// $Id: grab_globals.inc.php,v 1.2 2003/11/14 21:47:20 jflarvoire Exp $
-
+// $Id: grab_globals.inc.php,v 1.2 2007/12/28 05:53:05 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
 // -- GET --
 if (!empty($_GET))
 {
@@ -133,6 +133,12 @@
 // +---------------------------------------------------------------------------+
 /* Changes to this file :
  * $Log: grab_globals.inc.php,v $
+ * Revision 1.2  2007/12/28 05:53:05  arborrow
+ * CONTRIB-237 - continued param checks and removing blank lines at end of files
+ *
+ * Revision 1.1  2007/04/05 22:25:30  arborrow
+ * adding mrbs block to Moodle \contrib\plugins\blocks
+ *
  * Revision 1.2  2003/11/14 21:47:20  jflarvoire
  * Added the setting of $HTTP_HOST.
  *
@@ -140,4 +146,4 @@
  * + Make MRBS compliant to the 'register_globals = off' directive
  *
  */
-?>
+?>
\ No newline at end of file
Index: web/auth_none.inc
===================================================================
RCS file: web/auth_none.inc
diff -N web/auth_none.inc
--- web/auth_none.inc	29 Mar 2005 13:26:15 -0000	1.1.4.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,64 +0,0 @@
-<?php
-
-/* $Id: auth_none.inc,v 1.1.4.2 2005/03/29 13:26:15 jberanek Exp $
- *
- * Dummy authentication scheme, that accepts any user.
- * Useful for using mrbs without authentication,
- * or in combination with a session scheme that already enforces
- * its own authentication. For example that in IIS.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- *      $auth["type"]    = "none";
- *      $auth["session"] = your choice
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "nt_username1";
- * $auth["admin"][] = "nt_username2";
- *
- * See AUTHENTICATION  for more informations.
- */
-
-/** 
- * Checks if the specified username/password pair are valid.
- *
- * For this authentication scheme always validates.
- * 
- * @param   string  $user   The user name
- * @param   string  $pass   The password
- * @return  int             non-zero - Always valid
- */
-function authValidateUser($user, $pass)
-{
-    return 1;
-}
-
-/* authGetUserLevel($user)
- * 
- * Determines the users access level
- * 
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-    // User not logged in, user level '0'
-    if(!isset($user))
-	return 0;
-	
-    // Check if the user is can modify
-    for($i = 0; isset($lev1_admin[$i]); $i++)
-    {
-	if(strcasecmp($user, $lev1_admin[$i]) == 0)
-	    return 2;
-    }
-	
-    // Everybody else is access level '1'
-    return 1;
-}
-
-?>
Index: web/functions.inc
===================================================================
RCS file: web/functions.inc
diff -N web/functions.inc
--- web/functions.inc	13 Feb 2007 12:53:28 -0000	1.34.2.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,608 +0,0 @@
-<?php
-
-# $Id: functions.inc,v 1.34.2.5 2007/02/13 12:53:28 jberanek Exp $
-
-# probably a bad place to put this, but for error reporting purposes
-# $pview must be defined. if it's not then there's errors generated all
-# over the place. so we test to see if it is set, and if not then set
-# it.
-if (!isset($pview)) {
-	$pview = 0;
-}
-
-function print_header($day, $month, $year, $area)
-{
-	global $mrbs_company, $search_str, $locale_warning;
-
-	# If we dont know the right date then make it up 
-	if(!$day)
-		$day   = date("d");
-	if(!$month)
-		$month = date("m");
-	if(!$year)
-		$year  = date("Y");
-	if (empty($search_str))
-		$search_str = "";
-
-	if ($unicode_encoding)
-	{
-		header("Content-Type: text/html; charset=utf-8");
-	}
-	else
-	{
-		# We use $vocab directly instead of get_vocab() because we have
-		# no requirement to convert the vocab text, we just output
-		# the charset
-		header("Content-Type: text/html; charset=".$vocab["charset"]);
-	}
-
-	header("Pragma: no-cache");                          // HTTP 1.0
-	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-                      "http://www.w3.org/TR/html4/loose.dtd">
-<HTML>
-  <HEAD>
-<?php
-   include "style.inc";
-?>
-    <TITLE><?php echo get_vocab("mrbs") ?></TITLE>
-    <SCRIPT LANGUAGE="JavaScript">
-
-<!-- Begin
-
-/*   Script inspired by "True Date Selector"
-     Created by: Lee Hinder, lee.hinder@ntlworld.com 
-     
-     Tested with Windows IE 6.0
-     Tested with Linux Opera 7.21, Mozilla 1.3, Konqueror 3.1.0
-     
-*/
-
-function daysInFebruary (year){
-  // February has 28 days unless the year is divisible by four,
-  // and if it is the turn of the century then the century year
-  // must also be divisible by 400 when it has 29 days
-  return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
-}
-
-//function for returning how many days there are in a month including leap years
-function DaysInMonth(WhichMonth, WhichYear)
-{
-  var DaysInMonth = 31;
-  if (WhichMonth == "4" || WhichMonth == "6" || WhichMonth == "9" || WhichMonth == "11")
-    DaysInMonth = 30;
-  if (WhichMonth == "2")
-    DaysInMonth = daysInFebruary( WhichYear );
-  return DaysInMonth;
-}
-
-//function to change the available days in a months
-function ChangeOptionDays(formObj, prefix)
-{
-  var DaysObject = eval("formObj." + prefix + "day");
-  var MonthObject = eval("formObj." + prefix + "month");
-  var YearObject = eval("formObj." + prefix + "year");
-
-  if (DaysObject.selectedIndex && DaysObject.options)
-    { // The DOM2 standard way
-    // alert("The DOM2 standard way");
-    var DaySelIdx = DaysObject.selectedIndex;
-    var Month = parseInt(MonthObject.options[MonthObject.selectedIndex].value);
-    var Year = parseInt(YearObject.options[YearObject.selectedIndex].value);
-    }
-  else if (DaysObject.selectedIndex && DaysObject[DaysObject.selectedIndex])
-    { // The legacy MRBS way
-    // alert("The legacy MRBS way");
-    var DaySelIdx = DaysObject.selectedIndex;
-    var Month = parseInt(MonthObject[MonthObject.selectedIndex].value);
-    var Year = parseInt(YearObject[YearObject.selectedIndex].value);
-    }
-  else if (DaysObject.value)
-    { // Opera 6 stores the selectedIndex in property 'value'.
-    // alert("The Opera 6 way");
-    var DaySelIdx = parseInt(DaysObject.value);
-    var Month = parseInt(MonthObject.options[MonthObject.value].value);
-    var Year = parseInt(YearObject.options[YearObject.value].value);
-    }
-
-  // alert("Day="+(DaySelIdx+1)+" Month="+Month+" Year="+Year);
-
-  var DaysForThisSelection = DaysInMonth(Month, Year);
-  var CurrentDaysInSelection = DaysObject.length;
-  if (CurrentDaysInSelection > DaysForThisSelection)
-  {
-    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
-    {
-      DaysObject.options[DaysObject.options.length - 1] = null
-    }
-  }
-  if (DaysForThisSelection > CurrentDaysInSelection)
-  {
-    for (i=0; i<DaysForThisSelection; i++)
-    {
-      DaysObject.options[i] = new Option(eval(i + 1));
-    }
-  }
-  if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex = 0;
-  if (DaySelIdx >= DaysForThisSelection)
-    DaysObject.selectedIndex = DaysForThisSelection-1;
-  else
-    DaysObject.selectedIndex = DaySelIdx;
-}
-
-  //  End -->
-    </SCRIPT>
-  </HEAD>
-  <BODY BGCOLOR="#ffffed" TEXT=black LINK="#5B69A6" VLINK="#5B69A6" ALINK=red>
-	   <?php if ( $GLOBALS["pview"] != 1 ) { ?>
-
-   <?php # show a warning if this is using a low version of php
-       if (substr(phpversion(), 0, 1) == 3)
-	       echo get_vocab("not_php3");
-       if (!empty($locale_warning))
-               echo "[Warning: ".$locale_warning."]";
-   ?>
-
-    <TABLE WIDTH="100%">
-      <TR>
-        <TD BGCOLOR="#5B69A6">
-          <TABLE WIDTH="100%" BORDER=0>
-            <TR>
-              <TD CLASS="banner" BGCOLOR="#C0E0FF">
-                <FONT SIZE=4>
-                  <B><?php echo $mrbs_company ?></B><BR>
-                  <A HREF="index.php"><?php echo get_vocab("mrbs") ?></A>
-                </FONT>
-              </TD>
-              <TD CLASS="banner" BGCOLOR="#C0E0FF">
-                <FORM ACTION="day.php" METHOD=GET name="Form1">
-                  <FONT SIZE=2>
-<?php
-   genDateSelector("", $day, $month, $year); // Note: The 1st arg must match the last arg in the call to ChangeOptionDays below.
-   if (!empty($area))
-        echo "
-                    <INPUT TYPE=HIDDEN NAME=area VALUE=$area>\n"
- 
-?>
-	            <SCRIPT LANGUAGE="JavaScript">
-                    <!--
-                    // fix number of days for the $month/$year that you start with
-                    ChangeOptionDays(document.Form1, ''); // Note: The 2nd arg must match the first in the call to genDateSelector above.
-                    // -->
-                    </SCRIPT>
-                    <INPUT TYPE=SUBMIT VALUE="<?php echo get_vocab("goto") ?>">
-                  </FONT>
-                </FORM>
-              </TD>
-              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-                <A HREF="help.php?day=<?php echo $day ?>&month=<?php echo $month ?>&year=<?php echo $year ?>"><?php echo get_vocab("help") ?></A>
-              </TD>
-              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-                <A HREF="admin.php?day=<?php echo $day ?>&month=<?php echo $month ?>&year=<?php echo $year ?>"><?php echo get_vocab("admin") ?></A>
-              </TD>
-              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-                <A HREF="report.php"><?php echo get_vocab("report") ?></A>
-              </TD>
-              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-                <FORM METHOD=GET ACTION="search.php">
-                  <FONT SIZE=2>
-                    <A HREF="search.php?advanced=1"><?php echo get_vocab("search") ?></A>
-                  </FONT>
-                  <INPUT TYPE=TEXT   NAME="search_str" VALUE="<?php echo $search_str ?>" SIZE=10>
-                  <INPUT TYPE=HIDDEN NAME=day        VALUE="<?php echo $day        ?>"        >
-                  <INPUT TYPE=HIDDEN NAME=month      VALUE="<?php echo $month      ?>"        >
-                  <INPUT TYPE=HIDDEN NAME=year       VALUE="<?php echo $year       ?>"        >
-<?php
-   if (!empty($area))
-        echo "
-                  <INPUT TYPE=HIDDEN NAME=area VALUE=$area>\n"
-?>
-                </FORM>
-              </TD>
-<?php
-    # For session protocols that define their own logon box...
-    if (function_exists('PrintLogonBox'))
-   	{
-   	PrintLogonBox();
-   	}
-?>
-            </TR>
-          </TABLE>
-        </TD>
-      </TR>
-    </TABLE>
-<?php } ?>
-<?php
-}
-
-function toTimeString(&$dur, &$units)
-{
-	if($dur >= 60)
-	{
-		$dur /= 60;
-
-		if($dur >= 60)
-		{
-			$dur /= 60;
-
-			if(($dur >= 24) && ($dur % 24 == 0))
-			{
-				$dur /= 24;
-
-				if(($dur >= 7) && ($dur % 7 == 0))
-				{
-					$dur /= 7;
-
-					if(($dur >= 52) && ($dur % 52 == 0))
-					{
-						$dur  /= 52;
-						$units = get_vocab("years");
-					}
-					else
-						$units = get_vocab("weeks");
-				}
-				else
-					$units = get_vocab("days");
-			}
-			else
-				$units = get_vocab("hours");
-		}
-		else
-			$units = get_vocab("minutes");
-	}
-	else
-		$units = get_vocab("seconds");
-}
-
-
-function toPeriodString($start_period, &$dur, &$units)
-{
-	global $enable_periods;
-        global $periods;
-
-        $max_periods = count($periods);
-
-	$dur /= 60;
-
-        if( $dur >= $max_periods || $start_period == 0 )
-        {
-                if( $start_period == 0 && $dur == $max_periods )
-                {
-                        $units = get_vocab("days");
-                        $dur = 1;
-                        return;
-                }
-
-                $dur /= 60;
-                if(($dur >= 24) && is_int($dur))
-                {
-                	$dur /= 24;
-			$units = get_vocab("days");
-                        return;
-                }
-                else
-                {
-			$dur *= 60;
-                        $dur = ($dur % $max_periods) + floor( $dur/(24*60) ) * $max_periods;
-                        $units = get_vocab("periods");
-                        return;
-		}
-        }
-        else
-		$units = get_vocab("periods");
-}
-
-
-
-function genDateSelector($prefix, $day, $month, $year)
-{
-	if($day   == 0) $day = date("d");
-	if($month == 0) $month = date("m");
-	if($year  == 0) $year = date("Y");
-	
-	echo "
-                  <SELECT NAME=\"${prefix}day\">";
-	
-	for($i = 1; $i <= 31; $i++)
-		echo "
-                    <OPTION" . ($i == $day ? " SELECTED" : "") . ">$i";
-
-	echo "
-                  </SELECT>
-
-                  <SELECT NAME=\"${prefix}month\" onchange=\"ChangeOptionDays(this.form,'$prefix')\">";
-
-	for($i = 1; $i <= 12; $i++)
-	{
-		$m = utf8_strftime("%b", mktime(0, 0, 0, $i, 1, $year));
-		
-		print "
-                    <OPTION VALUE=\"$i\"" . ($i == $month ? " SELECTED" : "") . ">$m";
-	}
-
-	echo "
-                  </SELECT>
-	          <SELECT NAME=\"${prefix}year\" onchange=\"ChangeOptionDays(this.form,'$prefix')\">";
-
-	$min = min($year, date("Y")) - 5;
-	$max = max($year, date("Y")) + 5;
-
-	for($i = $min; $i <= $max; $i++)
-		print "
-                    <OPTION VALUE=\"$i\"" . ($i == $year ? " SELECTED" : "") . ">$i";
-
-	echo "
-                  </SELECT>";
-}
-
-# Error handler - this is used to display serious errors such as database
-# errors without sending incomplete HTML pages. This is only used for
-# errors which "should never happen", not those caused by bad inputs.
-# If $need_header!=0 output the top of the page too, else assume the
-# caller did that. Alway outputs the bottom of the page and exits.
-function fatal_error($need_header, $message)
-{
-	if ($need_header) print_header(0, 0, 0, 0);
-	echo $message;
-	include "trailer.inc";
-	exit;
-}
-
-# Apply backslash-escape quoting unless PHP is configured to do it
-# automatically. Use this for GET/POST form parameters, since we
-# cannot predict if the PHP configuration file has magic_quotes_gpc on.
-function slashes($s)
-{
-	if (get_magic_quotes_gpc()) return $s;
-	else return addslashes($s);
-}
-
-# Remove backslash-escape quoting if PHP is configured to do it with
-# magic_quotes_gpc. Use this whenever you need the actual value of a GET/POST
-# form parameter (which might have special characters) regardless of PHP's
-# magic_quotes_gpc setting.
-function unslashes($s)
-{
-	if (get_magic_quotes_gpc()) return stripslashes($s);
-	else return $s;
-}
-
-# Return a default area; used if no area is already known. This returns the
-# lowest area ID in the database (no guaranty there is an area 1).
-# This could be changed to implement something like per-user defaults.
-function get_default_area()
-{
-	global $tbl_area;
-	$area = sql_query1("SELECT id FROM $tbl_area ORDER BY area_name LIMIT 1");
-	return ($area < 0 ? 0 : $area);
-}
-
-# Return a default room given a valid area; used if no room is already known.
-# This returns the first room in alphbetic order in the database.
-# This could be changed to implement something like per-user defaults.
-function get_default_room($area)
-{
-	global $tbl_room;
-	$room = sql_query1("SELECT id FROM $tbl_room WHERE area_id=$area ORDER BY room_name LIMIT 1");
-	return ($room < 0 ? 0 : $room);
-}
-
-# Get the local day name based on language. Note 2000-01-02 is a Sunday.
-function day_name($daynumber)
-{
-	return utf8_strftime("%A", mktime(0,0,0,1,2+$daynumber,2000));
-}
-
-function hour_min_format()
-{
-        global $twentyfourhour_format;
-        if ($twentyfourhour_format)
-	{
-  	        return "%H:%M";
-	}
-	else
-	{
-		return "%I:%M%p";
-	}
-}
-
-function period_date_string($t, $mod_time=0)
-{
-        global $periods;
-
-	$time = getdate($t);
-        $p_num = $time["minutes"] + $mod_time;
-        if( $p_num < 0 ) $p_num = 0;
-        if( $p_num >= count($periods) - 1 ) $p_num = count($periods ) - 1;
-	# I have made the separater a ',' as a '-' leads to an ambiguious
-	# display in report.php when showing end times.
-        return array($p_num, $periods[$p_num] . utf8_strftime(", %A %d %B %Y",$t));
-}
-
-function period_time_string($t, $mod_time=0)
-{
-        global $periods;
-
-	$time = getdate($t);
-        $p_num = $time["minutes"] + $mod_time;
-        if( $p_num < 0 ) $p_num = 0;
-        if( $p_num >= count($periods) - 1 ) $p_num = count($periods ) - 1;
-        return $periods[$p_num];
-}
-
-function time_date_string($t)
-{
-        global $twentyfourhour_format;
-
-        if ($twentyfourhour_format)
-	{
-  	        return utf8_strftime("%H:%M:%S - %A %d %B %Y",$t);
-	}
-	else
-	{
-	        return utf8_strftime("%I:%M:%S%p - %A %d %B %Y",$t);
-	}
-}
-
-# Output a start table cell tag <td> with color class and fallback color.
-# $colclass is an entry type (A-J), "white" for empty, or "red" for highlighted.
-# The colors for CSS browsers can be found in the style sheet. The colors
-# in the array below are fallback for non-CSS browsers only.
-function tdcell($colclass)
-{
-	# This should be 'static $ecolors = array(...)' but that crashes PHP3.0.12!
-	static $ecolors;
-	if (!isset($ecolors)) $ecolors = array("A"=>"#FFCCFF", "B"=>"#99CCCC",
-		"C"=>"#FF9999", "D"=>"#FFFF99", "E"=>"#C0E0FF", "F"=>"#FFCC99",
-		"G"=>"#FF6666", "H"=>"#66FFFF", "I"=>"#DDFFDD", "J"=>"#CCCCCC",
-		"red"=>"#FFF0F0", "white"=>"#FFFFFF");
-	if (isset($ecolors[$colclass]))
-		echo "<td class=\"$colclass\" bgcolor=\"$ecolors[$colclass]\">";
-	else
-		echo "<td class=\"$colclass\">";
-}
-
-# Display the entry-type color key. This has up to 2 rows, up to 5 columns.
-function show_colour_key()
-{
-	global $typel;
-	echo "<table border=0><tr>\n";
-	$nct = 0;
-	for ($ct = "A"; $ct <= "Z"; $ct++)
-	{
-		if (!empty($typel[$ct]))
-		{
-			if (++$nct > 5)
-			{
-				$nct = 0;
-				echo "</tr><tr>";
-			}
-			tdcell($ct);
-			echo "$typel[$ct]</td>\n";
-		}
-	}
-	echo "</tr></table>\n";
-}
-
-# Round time down to the nearest resolution
-function round_t_down($t, $resolution, $am7)
-{
-        return (int)$t - (int)abs(((int)$t-(int)$am7)
-				  % $resolution);
-}
-
-# Round time up to the nearest resolution
-function round_t_up($t, $resolution, $am7)
-{
-	if (($t-$am7) % $resolution != 0)
-	{
-		return $t + $resolution - abs(((int)$t-(int)
-					       $am7) % $resolution);
-	}
-	else
-	{
-		return $t;
-	}
-}
-
-# generates some html that can be used to select which area should be
-# displayed.
-function make_area_select_html( $link, $current, $year, $month, $day )
-{
-	global $tbl_area;
-	$out_html = "
-<form name=\"areaChangeForm\" method=get action=\"$link\">
-  <select name=\"area\" onChange=\"document.areaChangeForm.submit()\">";
-
-	$sql = "select id, area_name from $tbl_area order by area_name";
-   	$res = sql_query($sql);
-   	if ($res) for ($i = 0; ($row = sql_row($res, $i)); $i++)
-   	{
-		$selected = ($row[0] == $current) ? "selected" : "";
-		$out_html .= "
-    <option $selected value=\"".$row[0]."\">" . htmlspecialchars($row[1]);
-   	}
-	$out_html .= "
-  </select>
-
-  <INPUT TYPE=HIDDEN NAME=day        VALUE=\"$day\">
-  <INPUT TYPE=HIDDEN NAME=month      VALUE=\"$month\">
-  <INPUT TYPE=HIDDEN NAME=year       VALUE=\"$year\">
-  <input type=submit value=\"".get_vocab("change")."\">
-</form>\n";
-
-	return $out_html;
-} # end make_area_select_html
-
-function make_room_select_html( $link, $area, $current, $year, $month, $day )
-{
-	global $tbl_room;
-	$out_html = "
-<form name=\"roomChangeForm\" method=get action=\"$link\">
-  <select name=\"room\" onChange=\"document.roomChangeForm.submit()\">";
-
-	$sql = "select id, room_name from $tbl_room where area_id=$area order by room_name";
-   	$res = sql_query($sql);
-   	if ($res) for ($i = 0; ($row = sql_row($res, $i)); $i++)
-   	{
-		$selected = ($row[0] == $current) ? "selected" : "";
-		$out_html .= "
-    <option $selected value=\"".$row[0]."\">" . htmlspecialchars($row[1]);
-   	}
-	$out_html .= "
-  </select>
-  <INPUT TYPE=HIDDEN NAME=day        VALUE=\"$day\"        >
-  <INPUT TYPE=HIDDEN NAME=month      VALUE=\"$month\"        >
-  <INPUT TYPE=HIDDEN NAME=year       VALUE=\"$year\"      >
-  <INPUT TYPE=HIDDEN NAME=area       VALUE=\"$area\"         >
-  <input type=submit value=\"".get_vocab("change")."\">
-</form>\n";
-
-	return $out_html;
-} # end make_area_select_html
-
-
-# This will return the appropriate value for isdst for mktime().
-# The order of the arguments was chosen to match those of mktime.
-# hour is added so that this function can when necessary only be
-# run if the time is between midnight and 3am (all DST changes
-# occur in this period.
-function is_dst ( $month, $day, $year, $hour="-1" )
-{
-
-	if( $hour != -1  && $hour > 3)
-		return( -1 );
-	
-	# entering DST
-	if( !date( "I", mktime(12, 0, 0, $month, $day-1, $year)) && 
-	    date( "I", mktime(12, 0, 0, $month, $day, $year)))
-		return( 0 ); 
-
-	# leaving DST
-	elseif( date( "I", mktime(12, 0, 0, $month, $day-1, $year)) && 
-	    !date( "I", mktime(12, 0, 0, $month, $day, $year)))
-		return( 1 );
-	else
-		return( -1 );
-}
-
-# if crossing dst determine if you need to make a modification
-# of 3600 seconds (1 hour) in either direction
-function cross_dst ( $start, $end )
-{
-	
-	# entering DST
-	if( !date( "I", $start) &&  date( "I", $end))
-		$modification = -3600;
-
-	# leaving DST
-	elseif(  date( "I", $start) && !date( "I", $end))
-		$modification = 3600;
-	else
-		$modification = 0;
-
-	return $modification;
-}
-?>
Index: web/auth_imap.inc
===================================================================
RCS file: web/auth_imap.inc
diff -N web/auth_imap.inc
--- web/auth_imap.inc	9 Oct 2006 15:53:59 -0000	1.6.2.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,149 +0,0 @@
-<?php
-
-/* $Id: auth_imap.inc,v 1.6.2.3 2006/10/09 15:53:59 jberanek Exp $
- *
- * Authentication scheme that uses IMAP as the source for user
- * authentication.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- * $auth["realm"] = "MRBS";    # Or any other string
- * $auth["type"]  = "imap";
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "imapuser1";
- * $auth["admin"][] = "imapuser2";
- */
-
-/* ~~JFL 2003/11/12 By default, use the http session mechanism */
-if (!isset($auth['session'])) $auth['session']='http';
-
-/* quoteIMAP($str)
- *
- * quote char's into valid IMAP string
- *
- * $str - String to be quoted
- *
- * Returns:
- *   quoted string
- */
-function quoteIMAP($str)
-{
-    return ereg_replace('(["\\])', '\\\\1', $str);
-}
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-function authValidateUser($user, $pass)
-{
-	global $auth;
-	global $imap_host;
-	global $imap_port;
-	$all_imap_hosts = array();
-	$all_imap_ports = array();
-
-	// Check if we do not have a username/password
-	if(!isset($user) || !isset($pass) || strlen($pass)==0)
-	{
-		return 0;
-	}
-
-	# Check that if there is an array of hosts and an array of ports
-	# then the number of each is the same
-	if(is_array( $imap_host ) && is_array( $imap_port ) && count($imap_port) != count($imap_host) )
-	{
-		return 0;
-	}
-
-	# Transfer the list of imap hosts to an new value to ensure that
-	# an array is always used.
-	# If a single value is passed then turn it into an array
-	if(is_array( $imap_host ) )
-	{
-		$all_imap_hosts = $imap_host;
-	}
-	else
-	{
-		$all_imap_hosts = array($imap_host);
-	}
-
-	# create an array of the port numbers to match the number of
-	# hosts if a single port number has been passed.
-	if(is_array( $imap_port ) )
-	{
-		$all_imap_ports = $imap_port;
-	}
-	else
-	{
-		while( each($all_imap_hosts ) )
-		{
-			$all_imap_ports[] = $imap_port;
-		}
-	}
-
-	# iterate over all hosts and return if you get a successful login
-	foreach( $all_imap_hosts as $idx => $host)
-	{
-		$error_number = "";
-		$error_string = "";
-
-		// Connect to IMAP-server
-		$stream = fsockopen( $host, $all_imap_ports[$idx], $error_number, $error_string, 15 );
-		if( $stream ) {
-			$response = fgets( $stream, 1024 );
-			$logon_str = "a001 LOGIN \"" . quoteIMAP( $user ) . "\" \"" . quoteIMAP( $pass ) . "\"\r\n";
-			fputs( $stream, $logon_str );
-			$response = fgets( $stream, 1024 );
-			if( substr( $response, 5, 2 ) == 'OK' ) {
-				fputs( $stream, "a002 LOGOUT\r\n" );
-				$response = fgets( $stream, 1024 );
-				fclose( $stream );
-				return 1;
-			}
-			fputs( $stream, "a002 LOGOUT\r\n" );
-			fclose( $stream );
-		}
-	}
-
-	// return failure
-	return 0;
-}
-
-/* authGetUserLevel($user)
- *
- * Determines the users access level
- *
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-	// User not logged in, user level '0'
-	if(!isset($user))
-		return 0;
-
-	// Check if the user is can modify
-	for($i = 0; $lev1_admin[$i]; $i++)
-	{
-		if(strcasecmp($user, $lev1_admin[$i]) == 0)
-			return 2;
-	}
-
-	// Everybody else is access level '1'
-	return 1;
-}
-
-?>
Index: web/admin.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/admin.php,v
retrieving revision 1.16.2.1
diff -u -r1.16.2.1 admin.php
--- web/admin.php	29 Mar 2005 13:26:15 -0000	1.16.2.1
+++ web/admin.php	2 Aug 2008 04:39:18 -0000
@@ -1,25 +1,31 @@
 <?php
 
-# $Id: admin.php,v 1.16.2.1 2005/03/29 13:26:15 jberanek Exp $
-
+# $Id: admin.php,v 1.4 2008/08/01 04:02:11 arborrow Exp $
+require_once("../../../config.php");
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+
+$day=optional_param('day',0 ,PARAM_INT);
+$month=optional_param('month', 0 ,PARAM_INT);
+$year=optional_param('year', 0, PARAM_INT);
+$area = optional_param('area', get_default_area(), PARAM_INT);
+$area_name = optional_param('area_name', '', PARAM_TEXT);
 
 #If we dont know the right date then make it up 
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
 	$year  = date("Y");
 }
 
-if (empty($area))
-{
-    $area = get_default_area();
-}
+//if (empty($area)) // going to handle with optional_param -ab.
+//{
+//    $area = get_default_area();
+//}
 
 if(!getAuthorised(2))
 {
@@ -27,7 +33,7 @@
 	exit();
 }
 
-print_header($day, $month, $year, isset($area) ? $area : "");
+print_header_mrbs($day, $month, $year, isset($area) ? $area : "");
 
 // If area is set but area name is not known, get the name.
 if (isset($area))
@@ -48,12 +54,12 @@
 }
 ?>
 
-<h2><?php echo get_vocab("administration") ?></h2>
+<h2><?php echo get_string('administration') ?></h2>
 
 <table border=1>
 <tr>
-<th><center><b><?php echo get_vocab("areas") ?></b></center></th>
-<th><center><b><?php echo get_vocab("rooms") ?> <?php if(isset($area_name)) { echo get_vocab("in") . " " .
+<th><center><b><?php echo get_string('areas','block_mrbs') ?></b></center></th>
+<th><center><b><?php echo get_string('rooms','block_mrbs') ?> <?php if(isset($area_name)) { echo get_string('in','block_mrbs') . " " .
   htmlspecialchars($area_name); }?></b></center></th>
 </tr>
 
@@ -65,13 +71,13 @@
 if (! $res) fatal_error(0, sql_error());
 
 if (sql_count($res) == 0) {
-	echo get_vocab("noareas");
+	echo get_string('noareas','block_mrbs');
 } else {
 	echo "<ul>";
 	for ($i = 0; ($row = sql_row($res, $i)); $i++) {
 		$area_name_q = urlencode($row[1]);
 		echo "<li><a href=\"admin.php?area=$row[0]&area_name=$area_name_q\">"
-			. htmlspecialchars($row[1]) . "</a> (<a href=\"edit_area_room.php?area=$row[0]\">" . get_vocab("edit") . "</a>) (<a href=\"del.php?type=area&area=$row[0]\">" .  get_vocab("delete") . "</a>)\n";
+			. htmlspecialchars($row[1]) . "</a> (<a href=\"edit_area_room.php?area=$row[0]\">" . get_string('edit') . "</a>) (<a href=\"del.php?type=area&area=$row[0]\">" .  get_string('delete') . "</a>)\n";
 	}
 	echo "</ul>";
 }
@@ -84,17 +90,17 @@
 	$res = sql_query("select id, room_name, description, capacity from $tbl_room where area_id=$area order by room_name");
 	if (! $res) fatal_error(0, sql_error());
 	if (sql_count($res) == 0) {
-		echo get_vocab("norooms");
+		echo get_string('norooms','block_mrbs');
 	} else {
 		echo "<ul>";
 		for ($i = 0; ($row = sql_row($res, $i)); $i++) {
 			echo "<li>" . htmlspecialchars($row[1]) . "(" . htmlspecialchars($row[2])
-			. ", $row[3]) (<a href=\"edit_area_room.php?room=$row[0]\">" . get_vocab("edit") . "</a>) (<a href=\"del.php?type=room&room=$row[0]\">" . get_vocab("delete") . "</a>)\n";
+			. ", $row[3]) (<a href=\"edit_area_room.php?room=$row[0]\">" . get_string('edit') . "</a>) (<a href=\"del.php?type=room&room=$row[0]\">" . get_string('delete') . "</a>)\n";
 		}
 		echo "</ul>";
 	}
 } else {
-	echo get_vocab("noarea");
+	echo get_string('noarea','block_mrbs');
 }
 
 ?>
@@ -102,30 +108,30 @@
 </tr>
 <tr>
 <td>
-<h3 ALIGN=CENTER><?php echo get_vocab("addarea") ?></h3>
+<h3 ALIGN=CENTER><?php echo get_string('addarea','block_mrbs') ?></h3>
 <form action=add.php method=post>
 <input type=hidden name=type value=area>
 
 <TABLE>
-<TR><TD><?php echo get_vocab("name") ?>:       </TD><TD><input type=text name=name></TD></TR>
+<TR><TD><?php echo get_string('name') ?>:       </TD><TD><input type=text name=name></TD></TR>
 </TABLE>
-<input type=submit value="<?php echo get_vocab("addarea") ?>">
+<input type=submit value="<?php echo get_string('addarea','block_mrbs') ?>">
 </form>
 </td>
 
 <td>
 <?php if (0 != $area) { ?>
-<h3 ALIGN=CENTER><?php echo get_vocab("addroom") ?></h3>
+<h3 ALIGN=CENTER><?php echo get_string('addroom','block_mrbs') ?></h3>
 <form action=add.php method=post>
 <input type=hidden name=type value=room>
 <input type=hidden name=area value=<?php echo $area; ?>>
 
 <TABLE>
-<TR><TD><?php echo get_vocab("name") ?>:       </TD><TD><input type=text name=name></TD></TR>
-<TR><TD><?php echo get_vocab("description") ?></TD><TD><input type=text name=description></TD></TR>
-<TR><TD><?php echo get_vocab("capacity") ?>:   </TD><TD><input type=text name=capacity></TD></TR>
+<TR><TD><?php echo get_string('name') ?>:       </TD><TD><input type=text name=name></TD></TR>
+<TR><TD><?php echo get_string('description') ?></TD><TD><input type=text name=description></TD></TR>
+<TR><TD><?php echo get_string('capacity','block_mrbs') ?>:   </TD><TD><input type=text name=capacity></TD></TR>
 </TABLE>
-<input type=submit value="<?php echo get_vocab("addroom") ?>">
+<input type=submit value="<?php echo get_string('addroom','block_mrbs') ?>">
 </form>
 <?php } else { echo "&nbsp;"; }?>
 </td>
@@ -133,6 +139,6 @@
 </table>
 
 <br>
-<?php echo get_vocab("browserlang") . " " . $HTTP_ACCEPT_LANGUAGE . " " . get_vocab("postbrowserlang") ; ?>
+<?php echo get_string('browserlang','block_mrbs') . " " . $HTTP_ACCEPT_LANGUAGE . " " . get_string('postbrowserlang','block_mrbs') ; ?>
 
-<?php include "trailer.inc" ?>
+<?php include "trailer.php" ?>
\ No newline at end of file
Index: web/mincals.inc
===================================================================
RCS file: web/mincals.inc
diff -N web/mincals.inc
--- web/mincals.inc	12 Apr 2004 21:22:05 -0000	1.11
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,228 +0,0 @@
-<?php
-// $Id: mincals.inc,v 1.11 2004/04/12 21:22:05 gwalker Exp $
-
-function minicals($year, $month, $day, $area, $room, $dmy) {
-
-// PHP Calendar Class
-//  
-// Copyright David Wilkinson 2000. All Rights reserved.
-// 
-// This software may be used, modified and distributed freely
-// providing this copyright notice remains intact at the head 
-// of the file.
-//
-// This software is freeware. The author accepts no liability for
-// any loss or damages whatsoever incurred directly or indirectly 
-// from the use of this script.
-//
-// URL:   http://www.cascade.org.uk/software/php/calendar/
-// Email: davidw@cascade.org.uk
-
-class Calendar
-{
-    var $month;
-    var $year;
-    var $day;
-    var $h;
-    var $area;
-    var $room;
-    var $dmy;
-    
-    function Calendar($day, $month, $year, $h, $area, $room, $dmy)
-    {
-        $this->day   = $day;
-        $this->month = $month;
-        $this->year  = $year;
-        $this->h     = $h;
-        $this->area  = $area;
-        $this->room  = $room;
-        $this->dmy   = $dmy;
-    }
-   
-    
-    function getCalendarLink($month, $year)
-    {
-        return "";
-    }
-    
-   function getDateLink($day, $month, $year)
-   {
-      if( empty($this->room) )
-         return $this->dmy.".php?year=$year&month=$month&day=$day&area=".$this->area;
-      else
-         return $this->dmy.".php?year=$year&month=$month&day=$day&area=".$this->area."&room=".$this->room;
-   }
-    
-
-    function getDaysInMonth($month, $year)
-    {
-        if ($month < 1 || $month > 12)
-        {
-            return 0;
-        }
-    
-        $days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
-   
-        $d = $days[$month - 1];
-   
-        if ($month == 2)
-        {
-            // Check for leap year
-            // Forget the 4000 rule, I doubt I'll be around then...
-        
-            if ($year%4 == 0)
-            {
-                if ($year%100 == 0)
-                {
-                    if ($year%400 == 0)
-                    {
-                        $d = 29;
-                    }
-                }
-                else
-                {
-                    $d = 29;
-                }
-            }
-        }
-    
-        return $d;
-    }
-
-    function getFirstDays()
-    {
-      global $weekstarts;
-
-      $basetime = mktime(12,0,0,6,11+$weekstarts,2000);
-      for ($i = 0, $s = ""; $i < 7; $i++)
-      {
-         $show = $basetime + ($i * 24 * 60 * 60);
-         $fl = utf8_strftime('%a',$show);
-         $s .= "<td align=center valign=top class=\"calendarHeader\">$fl</td>\n";
-      }
-      return $s;
-    }
-
-    function getHTML()
-    {
-        global $weekstarts;
-        global $PHP_SELF;
-        global $day;
-        global $month;
-
-        if (!isset($weekstarts)) $weekstarts = 0;
-        $s = "";
-        
-        $daysInMonth = $this->getDaysInMonth($this->month, $this->year);
-	// $prevYear is the current year unless the previous month is
-	// December then you need to decrement the year
-	if( $this->month - 1 > 0 )
-	{
-		$prevMonth = $this->month - 1;
-		$prevYear = $this->year;
-	}
-	else
-	{
-		$prevMonth = 12;
-		$prevYear = $this->year -1;
-	}
-        $daysInPrevMonth = $this->getDaysInMonth($prevMonth, $prevYear);
-        $date = mktime(12, 0, 0, $this->month, 1, $this->year);
-        
-        $first = (strftime("%w",$date) + 7 - $weekstarts) % 7;
-        $monthName = utf8_strftime("%B",$date);
-        
-        //$prevMonth = $this->getCalendarLink($this->month - 1 >   0 ? $this->month - 1 : 12, $this->month - 1 >   0 ? $this->year : $this->year - 1);
-        //$nextMonth = $this->getCalendarLink($this->month + 1 <= 12 ? $this->month + 1 :  1, $this->month + 1 <= 12 ? $this->year : $this->year + 1);
-        
-        $s .= "<table class=\"calendar\">\n";
-        // prints month name and year
-        $s .= "<tr>\n";
-        //$s .= "<td align=center valign=top>" . (($prevMonth == "") ? "&nbsp;" : "<a href=\"$prevMonth\">&lt;&lt;</a>")  . "</td>\n";
-        $s .= "<td align=center valign=top class=\"calendarHeader\" colspan=7>$monthName&nbsp;$this->year</td>\n"; 
-        //$s .= "<td align=center valign=top>" . (($nextMonth == "") ? "&nbsp;" : "<a href=\"$nextMonth\">&gt;&gt;</a>")  . "</td>\n";
-        $s .= "</tr>\n";
-        
-        $s .= "<tr>\n";
-        // gets days of week
-        $s .= $this->getFirstDays();
-        $s .= "</tr>\n";
-
-        $d = 1 - $first;
-            
-        # this is used to highlight days in upcoming month
-        $days_to_highlight = ($d + 7);
-
-        while ($d <= $daysInMonth)
-        {
-            $s .= "<tr>\n";
-
-            for ($i = 0; $i < 7; $i++)
-            {
-                $s .= "<td class=\"calendar\" align=\"center\" valign=\"top\">";
-                if ($d > 0 && $d <= $daysInMonth)
-                {
-                    $link = $this->getDateLink($d, $this->month, $this->year);
-                    $d_week = ($d - 7);
-
-                    if ($link == "")
-                        $s .= $d;
-                    elseif (preg_match("/day/i", basename($PHP_SELF)))
-                    {
-                        if (($d == $this->day) and ($this->h))
-                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
-                        else
-                            $s .= "<a href=\"$link\">$d</a>";
-                    }
-                    elseif (preg_match("/week/i", basename($PHP_SELF)))
-                    {
-		    #echo "((".$this->day." < $days_to_highlight) && ($d < $days_to_highlight) && (($day - $daysInMonth) > (-6)) && (".$this->month." == ($month + 1)) && ($first != 0))<br>";
-                        if (($this->day <= $d) && ($this->day > $d_week) && ($this->h))
-                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
-                        elseif (($this->day < $days_to_highlight) && ($d < $days_to_highlight) && (($day - $daysInPrevMonth) > (-6)) && ($this->month == (($month + 1)%12)) && ($first != 0))
-                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
-                        else
-                            $s .= "<a href=\"$link\">$d</a>";
-                    }
-                    elseif (preg_match("/month/i", basename($PHP_SELF)))
-                        if ( $this->h )
-                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
-                        else
-                            $s .= "<a href=\"$link\">$d</a>";
-                }
-                else
-                {
-                    $s .= "&nbsp;";
-                }
-                $s .= "</td>\n";
-                $d++;
-            }
-            $s .= "</tr>\n";
-        }
-        
-        $s .= "</table>\n";
-        
-        return $s;
-    }
-}
-
-$lastmonth = mktime(12, 0, 0, $month-1, 1, $year);
-$thismonth = mktime(12, 0, 0, $month,   $day, $year);
-$nextmonth = mktime(12, 0, 0, $month+1, 1, $year);
-
-echo "<td>";
-$cal = new Calendar(date("d",$lastmonth), date("m",$lastmonth), date("Y",$lastmonth), 0, $area, $room, $dmy);
-echo $cal->getHTML();
-echo "</td>";
-
-echo "<td>";
-$cal = new Calendar(date("d",$thismonth), date("m",$thismonth), date("Y",$thismonth), 1, $area, $room, $dmy);
-echo $cal->getHTML();
-echo "</td>";
-
-echo "<td>";
-$cal = new Calendar(date("d",$nextmonth), date("m",$nextmonth), date("Y",$nextmonth), 0, $area, $room, $dmy);
-echo $cal->getHTML();
-echo "</td>";
-}
-?>
Index: web/lang.de
===================================================================
RCS file: web/lang.de
diff -N web/lang.de
--- web/lang.de	28 Jul 2004 10:01:12 -0000	1.18
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.de,v 1.18 2004/07/28 10:01:12 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a German file.
-#
-# Translations provided by: Michael Redinger
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Raumbuchungssystem MRBS";
-
-# Used in functions.inc
-$vocab["report"]             = "Bericht";
-$vocab["admin"]              = "Admin";
-$vocab["help"]               = "Hilfe";
-$vocab["search"]             = "Suche:";
-$vocab["not_php3"]             = "<H1>WARNUNG: Funktioniert warscheinlich nicht mit PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Eintr�ge f�
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Bereiche";
-$vocab["daybefore"]          = "gehe zum vorherigen Tag";
-$vocab["dayafter"]           = "gehe zum n�chsten Tag";
-$vocab["gototoday"]          = "gehe zum heutigen Tag";
-$vocab["goto"]               = "Start";
-$vocab["highlight_line"]     = "Markieren Sie diese Zeile";
-$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Zeige Tag";
-$vocab["viewweek"]           = "Zeige Woche";
-$vocab["viewmonth"]          = "Zeige Monat";
-$vocab["ppreview"]           = "Druckansicht";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Eintrag hinzuf�gen";
-$vocab["editentry"]          = "Eintrag �ndern";
-$vocab["editseries"]         = "Alle Eintr�ge �ndern";
-$vocab["namebooker"]         = "Kurzbeschreibung ";
-$vocab["fulldescription"]    = "Vollst�ndige Beschreibung:<br>&nbsp;&nbsp;(Anzahl der Teilnehmer etc;)";
-$vocab["date"]               = "Tag:";
-$vocab["start_date"]         = "Anfangsdatum:";
-$vocab["end_date"]           = "Enddatum:";
-$vocab["time"]               = "Zeit:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "Dauer:";
-$vocab["seconds"]            = "Sekunden";
-$vocab["minutes"]            = "Minuten";
-$vocab["hours"]              = "Stunden";
-$vocab["days"]               = "Tage";
-$vocab["weeks"]              = "Wochen";
-$vocab["years"]              = "Jahre";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "Ganzt�gig";
-$vocab["type"]               = "Art:";
-$vocab["internal"]           = "Intern";
-$vocab["external"]           = "Extern";
-$vocab["save"]               = "Speichern";
-$vocab["rep_type"]           = "Art der Wiederholung:";
-$vocab["rep_type_0"]         = "Keine";
-$vocab["rep_type_1"]         = "t�glich";
-$vocab["rep_type_2"]         = "w�chentlich";
-$vocab["rep_type_3"]         = "monatlich";
-$vocab["rep_type_4"]         = "j�hrlich";
-$vocab["rep_type_5"]         = "monatlich, entsprechender Tag";
-$vocab["rep_type_6"]         = "jede n-te Woche";
-$vocab["rep_end_date"]       = "Ende der Wiederholung:";
-$vocab["rep_rep_day"]        = "Tag der Wiederholung:";
-$vocab["rep_for_weekly"]     = "(f�r w�chentlich)";
-$vocab["rep_freq"]           = "H�ufigkeit:";
-$vocab["rep_num_weeks"]      = "Anzahl Wochen";
-$vocab["rep_for_nweekly"]    = "(f�r n-te Woche)";
-$vocab["ctrl_click"]         = "Strg-Click um mehr als einen Raum auszuw�hlen";
-$vocab["entryid"]            = "Entry ID ";
-$vocab["repeat_id"]          = "Repeat ID "; 
-$vocab["you_have_not_entered"] = "Sie haben folgendes Feld nicht ausgef�llt :";
-$vocab["you_have_not_selected"] = "You have not selected a";
-$vocab["valid_room"]         = "room.";
-$vocab["valid_time_of_day"]  = "G�ltige Uhrzeit.";
-$vocab["brief_description"]  = "Kurzbeschreibung.";
-$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Beschreibung:";
-$vocab["room"]               = "Raum";
-$vocab["createdby"]          = "Erstellt von:";
-$vocab["lastupdate"]         = "Letzte �nderung:";
-$vocab["deleteentry"]        = "Eintrag l�schen";
-$vocab["deleteseries"]       = "Alle Eintr�ge l�schen";
-$vocab["confirmdel"]         = "Sind Sie sicher,\\ndass Sie diesen Eintrag\\nl�schen wollen?\\n\\n";
-$vocab["returnprev"]         = "Zur�ck zur vorigen Seite";
-$vocab["invalid_entry_id"]   = "Invalid entry id.";
-$vocab["invalid_series_id"]  = "Invalid series id.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Fehler";
-$vocab["sched_conflict"]     = "Konflikt in der Planung";
-$vocab["conflict"]           = "Der neue Eintrag hat einen Konflikt mit folgenden Eintr�gen:";
-$vocab["too_may_entrys"]     = "Die gew�hlten Optionen w�rden zu viele Eintr�ge erzeugen.<BR>�ndern Sie bitte die Optionen!";
-$vocab["returncal"]          = "Zur�ck zur Kalenderansicht";
-$vocab["failed_to_acquire"]  = "Konnte nicht exclusiv auf die Datenbank zugreifen"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Zugang verweigert";
-$vocab["norights"]           = "Sie haben keine Berechtigung, diesen Eintrag zu �ndern";
-$vocab["please_login"]       = "Bitte einloggen";
-$vocab["user_name"]          = "Benutzername";
-$vocab["user_password"]      = "Passwort";
-$vocab["unknown_user"]       = "Unbekannter Benutzer";
-$vocab["you_are"]            = "Sie sind";
-$vocab["login"]              = "Einloggen";
-$vocab["logoff"]             = "Ausloggen";
-
-# Authentication database
-$vocab["user_list"]          = "Benutzerliste";
-$vocab["edit_user"]          = "Bearbeite Benutzer";
-$vocab["delete_user"]        = "L�sche diesen Benutzer";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email Addresse";
-$vocab["password_twice"]     = "Falls Sie Ihr Passwort �ndern wollen, geben Sie das neue Passwort zwei mal ein.";
-$vocab["passwords_not_eq"]   = "Fehler: Die Passw�rter stimmen nicht �berein.";
-$vocab["add_new_user"]       = "Benutzer hinzuf�gen";
-$vocab["rights"]             = "Rechte";
-$vocab["action"]             = "Action";
-$vocab["user"]               = "Benutzer";
-$vocab["administrator"]      = "Administrator";
-$vocab["unknown"]            = "Unbekannt";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Leerer oder ung�ltiger Suchbegriff.";
-$vocab["search_results"]     = "Suchergebnis f�
-$vocab["nothing_found"]      = "Keine passenden Suchergebnisse gefunden.";
-$vocab["records"]            = "Ergebnisse ";
-$vocab["through"]            = " bis ";
-$vocab["of"]                 = " von ";
-$vocab["previous"]           = "Vorige";
-$vocab["next"]               = "N�chste";
-$vocab["entry"]              = "Eintrag";
-$vocab["view"]               = "�ffnen";
-$vocab["advanced_search"]    = "Erweiterte Suche";
-$vocab["search_button"]      = "Suche";
-$vocab["search_for"]         = "Suche nach";
-$vocab["from"]               = "Von";
-
-# Used in report.php
-$vocab["report_on"]          = "Bericht �ber Termine:";
-$vocab["report_start"]       = "Bericht Beginn:";
-$vocab["report_end"]         = "Bericht Ende:";
-$vocab["match_area"]         = "Suche Bereich:";
-$vocab["match_room"]         = "Suche Raum:";
-$vocab["match_type"]         = "Nach typ:";
-$vocab["ctrl_click_type"]    = "Strg-Click um mehr als einen Typus auszuw�hlen";
-$vocab["match_entry"]        = "Suche Kurzbeschreibung:";
-$vocab["match_descr"]        = "Suche Beschreibung:";
-$vocab["include"]            = "Generiere:";
-$vocab["report_only"]        = "nur Bericht";
-$vocab["summary_only"]       = "nur Zusammenfassung";
-$vocab["report_and_summary"] = "Bericht und Zusammenfassung";
-$vocab["summarize_by"]       = "Zusammenfassung nach:";
-$vocab["sum_by_descrip"]     = "Kurzbeschreibung";
-$vocab["sum_by_creator"]     = "Ersteller";
-$vocab["entry_found"]        = "Eintrag gefunden";
-$vocab["entries_found"]      = "Eintr�ge gefunden";
-$vocab["summary_header"]     = "Stundenzusammenfassung der Eintr�ge";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Gesamt";
-$vocab["submitquery"]        = "Bericht erstellen";
-$vocab["sort_rep"]           = "Sortiere Report nach:";
-$vocab["sort_rep_time"]      = "Startzeit/Datum ";
-$vocab["rep_dsp"]            = "zeige im Report:";
-$vocab["rep_dsp_dur"]        = "Dauer";
-$vocab["rep_dsp_end"]        = "Endzeit";
-
-# Used in week.php
-$vocab["weekbefore"]         = "gehe zur vorigen Woche";
-$vocab["weekafter"]          = "gehe zur n�chsten Woche";
-$vocab["gotothisweek"]       = "gehe zu dieser Woche";
-
-# Used in month.php
-$vocab["monthbefore"]        = "gehe zum vorigen Monat";
-$vocab["monthafter"]         = "gehe zum n�chsten Monat";
-$vocab["gotothismonth"]      = "gehe zu diesen Monat";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Der Bereich enth�lt keinen Raum";
-
-# Used in admin.php
-$vocab["edit"]               = "Bearbeiten";
-$vocab["delete"]             = "L�schen";
-$vocab["rooms"]              = "R�ume";
-$vocab["in"]                 = "in";
-$vocab["noareas"]            = "Keine Bereiche";
-$vocab["addarea"]            = "Bereich hinzuf�gen";
-$vocab["name"]               = "Name";
-$vocab["noarea"]             = "Kein Bereich ausgew�hlt";
-$vocab["browserlang"]        = "Die Spracheinstellung Ihres Browsers ist";
-$vocab["postbrowserlang"]    = ".";
-$vocab["addroom"]            = "Raum hinzuf�gen";
-$vocab["capacity"]           = "Kapazit�t";
-$vocab["norooms"]            = "Keine R�ume vorhanden.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Bereich bearbeiten";
-$vocab["change"]             = "�ndern";
-$vocab["backadmin"]          = "Zur�ck zu Admin";
-$vocab["editroomarea"]       = "Raum- oder Bereichsbeschreibung bearbeiten";
-$vocab["editroom"]           = "Raum bearbeiten";
-$vocab["update_room_failed"] = "Raum aktualisieren gescheitert: ";
-$vocab["error_room"]         = "Error: Raum ";
-$vocab["not_found"]          = " nicht gefunden";
-$vocab["update_area_failed"] = "Update area failed: ";
-$vocab["error_area"]         = "Fehler: Bereich ";
-$vocab["room_admin_email"]   = "E-mail des Raumadministrators";
-$vocab["area_admin_email"]   = "E-mail des Bereichsadministrators";
-$vocab["invalid_email"]      = "Ung�ltige e-mail Adresse !";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Dadurch werden die folgenden Eintr�ge gel�scht";
-$vocab["sure"]               = "Sind Sie sicher?";
-$vocab["YES"]                = "JA";
-$vocab["NO"]                 = "NEIN";
-$vocab["delarea"]            = "Sie m�ssen alle R�ume dieses Bereiches l�schen, damit Sie den Bereich l�schen k�nnen<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "�ber MRBS";
-$vocab["database"]           = "Datenbank: ";
-$vocab["system"]             = "System: ";
-$vocab["please_contact"]     = "Bitte kontaktieren Sie ";
-$vocab["for_any_questions"]  = "f�r Fragen die hier nicht beantwortet sind.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fataler Fehler: Kann nicht an Datenbank anbinden";
-
-?>
Index: web/auth_db.inc
===================================================================
RCS file: web/auth_db.inc
diff -N web/auth_db.inc
--- web/auth_db.inc	20 Aug 2005 09:46:44 -0000	1.6.2.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,70 +0,0 @@
-<?php
-/*****************************************************************************\
-*									      *
-*   File name       auth_db.inc						      *
-*									      *
-*   Description	    Authenticate users from a table in the MRBS database.     *
-*									      *
-*   Notes	    To use this authentication scheme, set in config.inc.php: *
-*			$auth["type"]  = "db";				      *
-*									      *
-*   History								      *
-*    2004/01/11 JFL Created this file					      *
-*									      *
-\*****************************************************************************/
-
-// $Id: auth_db.inc,v 1.6.2.3 2005/08/20 09:46:44 jberanek Exp $
-
-/* session_php.inc and session_cookie.inc will add a link to the user list
-    in the logon box, if the value $user_list_link is set. */
-$user_list_link = "edit_users.php";
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-
-function authValidateUser($user, $pass)
-{
-   global $tbl_users;
-
-   $user=slashes($user);
-   $user=strtolower($user);
-   $pass = md5($pass);
-   return sql_query1("select count(*) from $tbl_users where name='$user' and password='$pass';");
-}
-
-/* authGetUserLevel($user)
- * 
- * Determines the users access level
- * 
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-   // User not logged in, user level '0'
-   if(!isset($user))
-      return 0;
-
-   // Check if the user is can modify
-   for($i = 0; isset($lev1_admin[$i]); $i++)
-   {
-      if(strcasecmp($user, $lev1_admin[$i]) == 0)
-	 return 2;
-   }
-
-   // Everybody else is access level '1'
-   return 1;
-}
-
-?>
\ No newline at end of file
Index: web/trailer.inc
===================================================================
RCS file: web/trailer.inc
diff -N web/trailer.inc
--- web/trailer.inc	9 Oct 2006 15:54:00 -0000	1.10.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,90 +0,0 @@
-<?php
-# $Id: trailer.inc,v 1.10.2.1 2006/10/09 15:54:00 jberanek Exp $
-
-if ( $pview != 1 ) {
-
-echo "<P><HR><B>".get_vocab("viewday").":</B>\n";
-
-if(!isset($year))
-	$year = strftime("%Y");
-
-if(!isset($month))
-	$month = strftime("%m");
-
-if(!isset($day))
-	$day = strftime("%d");
-
-if (empty($area))
-	$params = "";
-else
-	$params = "&area=$area";
-
-for($i = -6; $i <= 7; $i++)
-{
-	$ctime = mktime(0, 0, 0, $month, $day + $i, $year);
-
-	$str = utf8_strftime(empty($dateformat)? "%b %d" : "%d %b", $ctime);
-
-	$cyear  = date("Y", $ctime);
-	$cmonth = date("m", $ctime);
-	$cday   = date("d", $ctime);
-	if ($i != -6) echo " | ";
-	if ($i == 0) echo '<b>[ ';
-	echo "<a href=\"day.php?year=$cyear&month=$cmonth&day=$cday$params\">$str</a>\n";
-	if ($i == 0) echo ']</b> ';
-}
-
-echo "<BR><B>".get_vocab("viewweek").":</B>\n";
-
-if (!empty($room)) $params .= "&room=$room";
-
-$ctime = mktime(0, 0, 0, $month, $day, $year);
-# How many days to skip back to first day of week:
-$skipback = (date("w", $ctime) - $weekstarts + 7) % 7;
-	
-for ($i = -4; $i <= 4; $i++)
-{
-	$ctime = mktime(0, 0, 0, $month, $day + 7 * $i - $skipback, $year);
-
-	$cweek  = date("W", $ctime);
-	$cday   = date("d", $ctime);
-	$cmonth = date("m", $ctime);
-	$cyear  = date("Y", $ctime);
-	if ($i != -4) echo " | ";
-
-	if ($view_week_number)
-	{
-		$str = $cweek;
-	}
-	else
-	{
-		$str = utf8_strftime(empty($dateformat)? "%b %d" : "%d %b", $ctime);
-	}
-	if ($i == 0) echo '<b>[ ';
-	echo "<a href=\"week.php?year=$cyear&month=$cmonth&day=$cday$params\">$str</a>\n";
-	if ($i == 0) echo ']</b> ';
-}
-
-echo "<BR><B>".get_vocab("viewmonth").":</B>\n";
-for ($i = -2; $i <= 6; $i++)
-{
-	$ctime = mktime(0, 0, 0, $month + $i, 1, $year);
-	$str = utf8_strftime("%b %Y", $ctime);
-	
-	$cmonth = date("m", $ctime);
-	$cyear  = date("Y", $ctime);
-	if ($i != -2) echo " | ";
-	if ($i == 0) echo '<b>[ ';
-	echo "<a href=\"month.php?year=$cyear&month=$cmonth$params\">$str</a>\n";
-	if ($i == 0) echo ']</b> ';
-}
-
-echo "<HR>";
-echo '<p><center><a href="' . basename($PHP_SELF) . '?' . $QUERY_STRING . '&pview=1">' . get_vocab("ppreview") . '</a></center><p>';
-
-}
-?>
-
-<HR>
-</BODY>
-</HTML>
\ No newline at end of file
Index: web/session_ip.inc
===================================================================
RCS file: web/session_ip.inc
diff -N web/session_ip.inc
--- web/session_ip.inc	29 Mar 2005 13:26:27 -0000	1.1.4.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-<?php
-
-/* $Id: session_ip.inc,v 1.1.4.1 2005/03/29 13:26:27 jberanek Exp $
- *
- * Session management scheme that uses IP addresses to identify users.
- * Anyone who can access the server can make bookings.
- * Administrators are also identified by their IP address.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- * $auth["type"]    = "none";
- * $auth["session"] = "ip";
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "127.0.0.1"; // Local host = the server you're running on
- * $auth["admin"][] = "192.168.0.1";
- */
-
-# No need to prompt for a name - ip address always there
-function authGet() { }
-
-function getUserName()
-{
-	global $REMOTE_ADDR;
-	return $REMOTE_ADDR;
-}
-
-?>
\ No newline at end of file
Index: web/month.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/month.php,v
retrieving revision 1.31.2.4
diff -u -r1.31.2.4 month.php
--- web/month.php	23 Feb 2007 22:06:45 -0000	1.31.2.4
+++ web/month.php	2 Aug 2008 04:39:19 -0000
@@ -2,13 +2,22 @@
 # $Id: month.php,v 1.31.2.4 2007/02/23 22:06:45 jberanek Exp $
 
 # mrbs/month.php - Month-at-a-time view
-
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
-include "mincals.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+include "mincals.php";
+
+$day = optional_param('day', 1, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$id = optional_param('id', 0, PARAM_INT);
+$area = optional_param('area', 0,  PARAM_INT);
+$room = optional_param('room', 0, PARAM_INT);
+$debug_flag = optional_param('debug_flag', 0, PARAM_INT);
+$pview = optional_param('pview', 0, PARAM_INT);
 
 # 3-value compare: Returns result of compare as "< " "= " or "> ".
 function cmp3($a, $b)
@@ -19,22 +28,23 @@
 }
 
 # Default parameters:
-if (empty($debug_flag)) $debug_flag = 0;
-if (empty($month) || empty($year) || !checkdate(intval($month), 1, intval($year)))
+# if (empty($debug_flag)) $debug_flag = 0; //not needed with optional_param initialization
+if (($month==0) || ($year==0) || !checkdate(intval($month), 1, intval($year)))
 {
     $month = date("m");
     $year  = date("Y");
 }
 $day = 1;
-# print the page header
-print_header($day, $month, $year, $area);
 
-if (empty($area))
+if ($area==0)
     $area = get_default_area();
-if (empty($room))
+if ($room==0)
     $room = get_default_room($area);
 # Note $room will be 0 if there are no rooms; this is checked for below.
 
+# print the page header
+print_header_mrbs($day, $month, $year, $area); //I think this was misplaced -ab.
+
 # Month view start time. This ignores morningstarts/eveningends because it
 # doesn't make sense to not show all entries for the day, and it messes
 # things up when entries cross midnight.
@@ -81,12 +91,12 @@
     $this_room_name = "";
 
     # Show all areas
-    echo "<td width=\"30%\"><u>".get_vocab("areas")."</u><br>";
+    echo "<td width=\"30%\"><u>".get_string('areas','block_mrbs')."</u><br>";
 }
 
   # show either a select box or the normal html list
   if ($area_list_format == "select") {
-    echo make_area_select_html('month.php', $area, $year, $month, $day); # from functions.inc
+    echo make_area_select_html('month.php', $area, $year, $month, $day); # from functions.php
     $this_area_name = sql_query1("select area_name from $tbl_area where id=$area");
     $this_room_name = sql_query1("select room_name from $tbl_room where id=$room");
   } else {
@@ -110,13 +120,13 @@
     echo "</td>\n";
     
     # Show all rooms in the current area:
-    echo "<td width=\"30%\"><u>".get_vocab("rooms")."</u><br>";
+    echo "<td width=\"30%\"><u>".get_string('rooms','block_mrbs')."</u><br>";
 }
 
 
   # should we show a drop-down for the room list, or not?
   if ($area_list_format == "select") {
-    echo make_room_select_html('month.php', $area, $room, $year, $month, $day); # from functions.inc
+    echo make_room_select_html('month.php', $area, $room, $year, $month, $day); # from functions.php
   } else {
     $sql = "select id, room_name from $tbl_room where area_id=$area order by room_name";
     $res = sql_query($sql);
@@ -144,8 +154,8 @@
 # Don't continue if this area has no rooms:
 if ($room <= 0)
 {
-    echo "<h1>".get_vocab("no_rooms_for_area")."</h1>";
-    include "trailer.inc";
+    echo "<h1>".get_string('no_rooms_for_area','block_mrbs')."</h1>";
+    include "trailer.php";
     exit;
 }
 
@@ -167,17 +177,17 @@
 if ( $pview != 1 ) {
     echo "<table width=\"100%\"><tr><td>
       <a href=\"month.php?year=$yy&month=$ym&area=$area&room=$room\">
-      &lt;&lt; ".get_vocab("monthbefore")."</a></td>
-      <td align=center><a href=\"month.php?area=$area&room=$room\">".get_vocab("gotothismonth")."</a></td>
+      &lt;&lt; ".get_string('monthbefore','block_mrbs')."</a></td>
+      <td align=center><a href=\"month.php?area=$area&room=$room\">".get_string('gotothismonth','block_mrbs')."</a></td>
       <td align=right><a href=\"month.php?year=$ty&month=$tm&area=$area&room=$room\">
-      ".get_vocab("monthafter")."&gt;&gt;</a></td></tr></table>";
+      ".get_string('monthafter','block_mrbs')."&gt;&gt;</a></td></tr></table>";
 }
 
 if ($debug_flag)
     echo "<p>DEBUG: month=$month year=$year start=$weekday_start range=$month_start:$month_end\n";
 
 # Used below: localized "all day" text but with non-breaking spaces:
-$all_day = ereg_replace(" ", "&nbsp;", get_vocab("all_day"));
+$all_day = ereg_replace(" ", "&nbsp;", get_string('all_day','block_mrbs'));
 
 #Get all meetings for this month in the room that we care about
 # row[0] = Start time
@@ -307,7 +317,7 @@
        . "false, "
        . "false, "
        . "\"$highlight_method\", "
-       . "\"" . get_vocab("click_to_reserve") . "\""
+       . "\"" . get_string('click_to_reserve','block_mrbs') . "\""
        . ");</SCRIPT>\n";
     }
 
@@ -429,5 +439,5 @@
 }
 echo "</tr></table>\n";
 
-include "trailer.inc";
+include "trailer.php";
 ?>
Index: web/session_cookie.inc
===================================================================
RCS file: web/session_cookie.inc
diff -N web/session_cookie.inc
--- web/session_cookie.inc	13 Feb 2007 12:53:34 -0000	1.9.2.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,212 +0,0 @@
-<?php
-/*****************************************************************************\
-*									      *
-*   File name       session_cookie.inc					      *
-*									      *
-*   Description	    Manage sessions via cookies stored in the client browser. *
-*									      *
-*   URL arguments   UserName		The user name			      *
-*		    UserPassword	His password			      *
-*		    TargetURL		Where we were going before login.     *
-*									      *
-*   Notes	    To use this session mechanism, set in config.inc.php:     *
-*			$auth["session"]  = "cookie";			      *
-*									      *
-*   History								      *
-*    2003/11/09 JFL Created this file					      *
-*    Remaining history in ChangeLog and CVS logs                              *
-*									      *
-\*****************************************************************************/
-
-// $Id: session_cookie.inc,v 1.9.2.4 2007/02/13 12:53:34 jberanek Exp $
-
-if (isset($cookie_path_override))
-{
-  $cookie_path = $cookie_path_override;
-}
-else
-{
-  $cookie_path = $PHP_SELF;
-  $cookie_path = ereg_replace('[^/]*$', '', $cookie_path);
-}
-
-/*
-  Target of the form with sets the URL argument "Action=SetName".
-  Will eventually return to URL argument "TargetURL=whatever".
-*/
-if (isset($Action) && ($Action == "SetName"))
-{
-    // Avoid errors with error level ALL
-    if ( !isset( $NewUserName ) )
-    {
-    	$NewUserName = "";
-    }
-    /* First make sure the password is valid */
-    if ($NewUserName == "") {
-        // Delete cookie
-
-        setcookie("UserName", '', time()-42000, $cookie_path);
-    } else {
-        $NewUserName = unslashes($NewUserName);
-        $NewPassword = unslashes($NewPassword);
-
-        if (!authValidateUser($NewUserName, $NewUserPassword))
-        {
-            print_header(0, 0, 0, 0);
-            echo "<P>".get_vocab('unknown_user')."</P>\n";
-            printLoginForm($TargetURL);
-            exit();
-        }
-        else
-        {
-            $UserName     = $NewUserName;
-            $UserPassword = $NewUserPassword;
-        }
-
-        setcookie("UserName", $UserName, time()+(60*60*24*30), $cookie_path);
-    }
-    header ("Location: $TargetURL"); /* Redirect browser to initial page */
-    /* Note HTTP 1.1 mandates an absolute URL. Most modern browsers support relative URLs,
-        which allows to work around problems with DNS inconsistencies in the server name.
-        Anyway, if the browser cannot redirect automatically, the manual link below will work. */
-    print_header(0, 0, 0, 0);
-    echo "<br />\n";
-    echo "<p>Please click <a href=\"$TargetURL\">here</a> if you're not redirected automatically to the page you requested.</p>\n";
-    echo "</body>\n";
-    echo "</html>\n";
-    exit();
-}
-
-/*
-  Display the login form. Used by two routines below.
-  Will eventually return to $TargetURL.
-*/
-function printLoginForm($TargetURL)
-{
-    global $PHP_SELF;
-?>
-<p>
-  <?php echo get_vocab("please_login") ?>
-</p>
-<form method="post" action="<?php echo basename($PHP_SELF) ?>">
-  <table>
-    <tr>
-      <td align="right"><?php echo get_vocab("user_name") ?></td>
-      <td><input type="text" name="NewUserName" /></td>
-    </tr>
-    <tr>
-      <td align="right"><?php echo get_vocab("user_password") ?></td>
-      <td><input type="password" name="NewUserPassword" /></td>
-    </tr>
-  </table>
-  <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" /> <br />
-  <input type="hidden" name="Action" value="SetName" /> <br />
-  <input type="submit" value="<?php echo get_vocab('login') ?> " /> <br />
-</form>
-</body>
-</html>
-<?php
-}
-
-/*
-  Target of the form with sets the URL argument "Action=QueryName".
-  Will eventually return to URL argument "TargetURL=whatever".
-*/
-if (isset($Action) && ($Action == "QueryName"))
-{
-    print_header(0, 0, 0, 0);
-    printLoginForm($TargetURL);
-    exit();
-}
-
-/* authGet()
- * 
- * Request the user name/password
- * 
- * Returns: Nothing
- */
-function authGet()
-{
-    global $PHP_SELF, $QUERY_STRING;
-
-    print_header(0, 0, 0, 0);
-
-    echo "<p>".get_vocab("norights")."</p>\n";
-
-    $TargetURL = basename($PHP_SELF);
-    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
-    printLoginForm($TargetURL);
-
-    exit();
-}
-
-function getUserName()
-{
-    if (!empty($_COOKIE) && isset($_COOKIE["UserName"]))
-    {
-	return $_COOKIE["UserName"];
-    }
-    else
-    {
-        global $HTTP_COOKIE_VARS;
-	if (!empty($HTTP_COOKIE_VARS) && isset($HTTP_COOKIE_VARS["UserName"]))
-	    return $HTTP_COOKIE_VARS["UserName"];
-    }
-}
-
-// Print the logon entry on the top banner.
-function PrintLogonBox()
-{
-    global $PHP_SELF, $QUERY_STRING, $user_list_link, $user_link, $day, $month;
-    global $year, $auth;
-
-    $TargetURL = basename($PHP_SELF);
-    if (isset($url_base) && ($url_base != "")) $TargetURL = $url_base . '/' . $TargetURL;
-    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
-    $user=getUserName();
-    if (isset($user))
-    {
-        // words 'you are xxxx' becomes a link to the
-        // report page with only entries created by xxx. Past entries are not
-        // displayed but this can be changed
-           $search_string = "report.php?From_day=$day&From_month=$month&".
-             "From_year=$year&To_day=1&To_month=12&To_year=2030&".
-             "areamatch=&roommatch=&namematch=&descrmatch=&summarize=1&".
-             "sortby=r&display=d&sumby=d&creatormatch=$user"; ?>
-
-    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-      <A name="logonBox" href="<?php echo "$search_string\" title=\""
-         . get_vocab('show_my_entries') . "\">" . get_vocab('you_are')." "
-         .$user ?></A><br>
-          <FORM METHOD=POST ACTION="admin.php">
-	    <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
-	    <input type="hidden" name="Action" value="SetName" />
-	    <input type="hidden" name="UserName" value="" />
-	    <input type="hidden" name="UserPassword" value="" />
-	    <input type="submit" value=" <?php echo get_vocab('logoff') ?> " />
-	  </FORM>
-<?php if (isset($user_list_link)) print "	  <br>\n	  " .
-	    "<A href=\"$user_list_link\">" . get_vocab('user_list') . "</A><br>\n" ;
-?>
-	</TD>
-<?php
-    }
-else
-    {
-?>
-	<TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-	  <A name="logonBox" href=""><?php echo get_vocab('unknown_user'); ?></A><br>
-          <FORM METHOD=POST ACTION="admin.php">
-	    <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
-	    <input type="hidden" name="Action" value="QueryName" />
-	    <input type="submit" value=" <?php echo get_vocab('login') ?> " />
-	  </FORM>
-<?php if (isset($user_list_link)) print "	  <br>\n	  " .
-	    "<A href=\"$user_list_link\">" . get_vocab('user_list') . "</A><br>\n" ;
-?>
-	</TD>
-<?php
-    }
-}
-
-?>
Index: web/mysqli.inc
===================================================================
RCS file: web/mysqli.inc
diff -N web/mysqli.inc
--- web/mysqli.inc	9 Oct 2006 15:53:59 -0000	1.1.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,248 +0,0 @@
-<?php
-// $Id: mysqli.inc,v 1.1.2.2 2006/10/09 15:53:59 jberanek Exp $
-
-// mysqli.inc - Simple PHP database support for MySQL, using mysqli extension.
-// Include this file after defining the following variables:
-//   $db_host = The hostname of the database server
-//   $db_login = The username to use when connecting to the database
-//   $db_password = The database account password
-//   $db_database = The database name.
-// Including this file connects you to the database, or exits on error.
-
-
-// Free a results handle. You need not call this if you call sql_row or
-// sql_row_keyed until the row returns 0, since sql_row frees the results
-// handle when you finish reading the rows.
-function sql_free ($r)
-{
-  $r->close();
-}
-
-// Execute a non-SELECT SQL command (insert/update/delete).
-// Returns the number of tuples affected if OK (a number >= 0).
-// Returns -1 on error; use sql_error to get the error message.
-function sql_command ($sql)
-{
-  global $mysqli;
-  
-  $ret = -1;
-
-  if ($mysqli->query($sql)) {
-    $ret = $mysqli->affected_rows;
-  }
-  return $ret;
-}
-
-// Execute an SQL query which should return a single non-negative number value.
-// This is a lightweight alternative to sql_query, good for use with count(*)
-// and similar queries. It returns -1 on error or if the query did not return
-// exactly one value, so error checking is somewhat limited.
-// It also returns -1 if the query returns a single NULL value, such as from
-// a MIN or MAX aggregate function applied over no rows.
-function sql_query1 ($sql)
-{
-    global $mysqli;
-    
-    $r = $mysqli->query($sql);
-    if (! $r) return -1;
-    if (($r->num_rows != 1) || ($r->field_count != 1) ||
-        (($row = $r->fetch_row()) == NULL)) {
-        $result = -1;
-    }
-    $r->close();
-    return $row[0];
-}
-
-// Execute an SQL query. Returns a database-dependent result handle,
-// which should be passed back to sql_row or sql_row_keyed to get the results.
-// Returns 0 on error; use sql_error to get the error message.
-function sql_query ($sql)
-{
-    global $mysqli;
-
-    $r = $mysqli->query($sql);
-    return $r;
-}
-
-// Return a row from a result. The first row is 0.
-// The row is returned as an array with index 0=first column, etc.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-// Typical usage: $i = 0; while ((a = sql_row($r, $i++))) { ... }
-function sql_row ($r, $i)
-{
-    if ($i >= $r->num_rows) {
-      $r->close();
-      return 0;
-    }
-    $r->data_seek($i);
-    return $r->fetch_row();
-}
-
-// Return a row from a result as an associative array keyed by field name.
-// The first row is 0.
-// This is actually upward compatible with sql_row since the underlying
-// routing also stores the data under number indexes.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-function sql_row_keyed ($r, $i)
-{
-    if ($i >= $r->num_rows) {
-        $r->close();
-        return 0;
-    }
-    $r->data_seek($i);
-    return $r->fetch_array();
-}
-
-// Return the number of rows returned by a result handle from sql_query.
-function sql_count ($r)
-{
-    return $r->num_rows;
-}
-
-// Return the value of an autoincrement field from the last insert.
-// Must be called right after an insert on that table!
-function sql_insert_id($table, $field)
-{
-    global $mysqli;
-
-    return $mysqli->insert_id;
-}
-
-// Return the text of the last error message.
-function sql_error()
-{
-    global $mysqli;
-
-    return $mysqli->error;
-}
-
-// Begin a transaction, if the database supports it. This is used to
-// improve PostgreSQL performance for multiple insert/delete/updates.
-// There is no rollback support, since MySQL doesn't support it.
-function sql_begin()
-{
-}
-
-// Commit (end) a transaction. See sql_begin().
-function sql_commit()
-{
-}
-
-// Acquire a mutual-exclusion lock on the named table. For portability:
-// This will not lock out SELECTs.
-// It may lock out DELETE/UPDATE/INSERT or not, depending on the implementation.
-// It will lock out other callers of this routine with the same name argument.
-// It may timeout in 20 seconds and return 0, or may wait forever.
-// It returns 1 when the lock has been acquired.
-// Caller must release the lock with sql_mutex_unlock().
-// Caller must not have more than one mutex at any time.
-// Do not mix this with sql_begin()/sql_end() calls.
-//
-// In MySQL, we avoid table locks, and use low-level locks instead.
-function sql_mutex_lock($name)
-{
-    global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
-    if (!sql_query1("SELECT GET_LOCK('$name', 20)")) {
-        return 0;
-    }
-    $sql_mutex_unlock_name = $name;
-    if (empty($sql_mutex_shutdown_registered)) {
-        register_shutdown_function("sql_mutex_cleanup");
-        $sql_mutex_shutdown_registered = 1;
-    }
-    return 1;
-}
-
-// Release a mutual-exclusion lock on the named table. See sql_mutex_unlock.
-function sql_mutex_unlock($name)
-{
-    global $sql_mutex_unlock_name;
-    sql_query1("SELECT RELEASE_LOCK('$name')");
-    $sql_mutex_unlock_name = "";
-}
-
-// Shutdown function to clean up a forgotten lock. For internal use only.
-function sql_mutex_cleanup()
-{
-    global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
-    if (!empty($sql_mutex_unlock_name)) {
-        sql_mutex_unlock($sql_mutex_unlock_name);
-        $sql_mutex_unlock_name = "";
-    }
-}
-
-
-// Return a string identifying the database version:
-function sql_version()
-{
-    $r = sql_query("select version()");
-    $v = sql_row($r, 0);
-    sql_free($r);
-    return "MySQL $v[0]";
-}
-
-
-// Generate non-standard SQL for LIMIT clauses:
-function sql_syntax_limit($count, $offset)
-{
-    return " LIMIT $offset,$count ";
-}
-
-// Generate non-standard SQL to output a TIMESTAMP as a Unix-time:
-function sql_syntax_timestamp_to_unix($fieldname)
-{
-    return " UNIX_TIMESTAMP($fieldname) ";
-}
-
-// Generate non-standard SQL to match a string anywhere in a field's value
-// in a case insensitive manner. $s is the un-escaped/un-slashed string.
-// In MySQL, REGEXP seems to be case sensitive, so use LIKE instead. But this
-// requires quoting of % and _ in addition to the usual.
-function sql_syntax_caseless_contains($fieldname, $s)
-{
-    $s = str_replace("\\", "\\\\", $s);
-    $s = str_replace("%", "\\%", $s);
-    $s = str_replace("_", "\\_", $s);
-    $s = str_replace("'", "''", $s);
-    return " $fieldname LIKE '%$s%' ";
-}
-
-// Returns the name of a field.
-function sql_field_name($result, $index)
-{
-    $finfo = $result->fetch_field_direct($index);
-    return $finfo->name;
-}
-
-// Returns the type of a field. (one of "int", "real", "string", "blob", etc...)
-function sql_field_type($result, $index)
-{
-    $finfo = $result->fetch_field_direct($index);
-    return $finfo->type;
-}
-
-// Returns the number of fields in a result.
-function sql_num_fields($result)
-{
-    return $result->field_count;
-}
-
-
-
-// Establish a database connection.
-// On connection error, the message will be output without a proper HTML
-// header. There is no way I can see around this; if track_errors isn't on
-// there seems to be no way to supress the automatic error message output and
-// still be able to access the error text.
-
-$mysqli = new mysqli($db_host, $db_login, $db_password, $db_database);
-
-/* check connection */
-if (mysqli_connect_errno()) {
-    echo "\n<p>\n" . get_vocab("failed_connect_db") . " : " . mysqli_connect_error();
-    exit;
-}
-
-?>
Index: web/edit_entry.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/edit_entry.php,v
retrieving revision 1.30.2.4
diff -u -r1.30.2.4 edit_entry.php
--- web/edit_entry.php	13 Feb 2007 12:53:24 -0000	1.30.2.4
+++ web/edit_entry.php	2 Aug 2008 04:39:19 -0000
@@ -1,25 +1,39 @@
 <?php
 # $Id: edit_entry.php,v 1.30.2.4 2007/02/13 12:53:24 jberanek Exp $
-
+require_once("../../../config.php"); //for Moodle integration
 require_once('grab_globals.inc.php');
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
 
 global $twentyfourhour_format;
 
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$area = optional_param('area', get_default_area(),  PARAM_INT);
+$edit_type = optional_param('edit_type', '', PARAM_ALPHA);
+$id = optional_param('id', 0, PARAM_INT);
+$room_id = optional_param('room_id', 0, PARAM_INT);
+$start_hour = optional_param('start_hour', 0, PARAM_INT);
+// $morningstarts = optional_param('morningstarts', 0, PARAM_INT); //I believe this is coming from somewhere else - not URL - ab.
+// $rep_type could use a closer look but I believe this is not passed via URL -ab.
+$start_min = optional_param('start_min', 0, PARAM_INT);
+$rep_num_weeks = optional_param('rep_num_weeks', 0, PARAM_INT); 
+
 #If we dont know the right date then make it up
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
 	$year  = date("Y");
 }
-if(empty($area))
-	$area = get_default_area();
-if(!isset($edit_type))
-	$edit_type = "";
+// if(empty($area)) //handled by optional_param -ab
+//	$area = get_default_area();
+
+// if(!isset($edit_type)) //handled by optional_param -ab
+// 	$edit_type = "";
 
 if(!getAuthorised(1))
 {
@@ -40,14 +54,14 @@
 # Firstly we need to know if this is a new booking or modifying an old one
 # and if it's a modification we need to get all the old data from the db.
 # If we had $id passed in then it's a modification.
-if (isset($id))
+if ($id>0)
 {
 	$sql = "select name, create_by, description, start_time, end_time,
-	        type, room_id, entry_type, repeat_id from $tbl_entry where id=$id";
+	        type, room_id, entry_type, repeat_id, timestamp from $tbl_entry where id=$id";
 	
 	$res = sql_query($sql);
 	if (! $res) fatal_error(1, sql_error());
-	if (sql_count($res) != 1) fatal_error(1, get_vocab("entryid") . $id . get_vocab("not_found"));
+	if (sql_count($res) != 1) fatal_error(1, get_string('entryid','block_mrbs') . $id . get_string('not_found','block_mrbs'));
 	
 	$row = sql_row($res, 0);
 	sql_free($res);
@@ -71,12 +85,12 @@
 	
 	if($entry_type >= 1)
 	{
-		$sql = "SELECT rep_type, start_time, end_date, rep_opt, rep_num_weeks
+		$sql = "SELECT rep_type, start_time, end_date, rep_opt, rep_num_weeks, timestamp
 		        FROM $tbl_repeat WHERE id=$rep_id";
 		
 		$res = sql_query($sql);
 		if (! $res) fatal_error(1, sql_error());
-		if (sql_count($res) != 1) fatal_error(1, get_vocab("repeat_id") . $rep_id . get_vocab("not_found"));
+		if (sql_count($res) != 1) fatal_error(1, get_string('repeat_id','block_mrbs') . $rep_id . get_string('not_found','block_mrbs'));
 		
 		$row = sql_row($res, 0);
 		sql_free($res);
@@ -128,9 +142,9 @@
 {
 	# It is a new booking. The data comes from whichever button the user clicked
 	$edit_type   = "series";
-	$name        = "";
+	$name        = getUserName();
 	$create_by   = getUserName();
-	$description = "";
+	$description = "Class";
 	$start_day   = $day;
 	$start_month = $month;
 	$start_year  = $year;
@@ -154,7 +168,7 @@
 # this page has been accessed directly and no arguments have
 # been passed to it.
 # If we have not been provided with a room_id
-if( empty( $room_id ) )
+if ($room_id==0  )
 {
 	$sql = "select id from $tbl_room limit 1";
 	$res = sql_query($sql);
@@ -174,7 +188,7 @@
 	$start_min = "00";
 
 // Remove "Undefined variable" notice
-if (!isset($rep_num_weeks))
+if (empty($rep_num_weeks))
 {
     $rep_num_weeks = "";
 }
@@ -189,7 +203,7 @@
 	exit;
 }
 
-print_header($day, $month, $year, $area);
+print_header_mrbs($day, $month, $year, $area);
 
 ?>
 
@@ -200,7 +214,7 @@
   // null strings and spaces only strings not allowed
   if(/(^$)|(^\s+$)/.test(document.forms["main"].name.value))
   {
-    alert ( "<?php echo get_vocab("you_have_not_entered") . '\n' . get_vocab("brief_description") ?>");
+    alert ( "<?php echo get_string('you_have_not_entered','block_mrbs') . '\n' . get_string('description') ?>");
     return false;
   }
   <?php if( ! $enable_periods ) { ?>
@@ -210,7 +224,7 @@
 
   if(h > 23 || m > 59)
   {
-    alert ("<?php echo get_vocab("you_have_not_entered") . '\n' . get_vocab("valid_time_of_day") ?>");
+    alert ("<?php echo get_string('you_have_not_entered','block_mrbs') . '\n' . get_string('valid_time_of_day','block_mrbs') ?>");
     return false;
   }
   <?php } ?>
@@ -228,7 +242,7 @@
   }
   if ((!i1 || (i1 && i2)) && document.forms["main"].rep_type && document.forms["main"].rep_type[6].checked && (!n || n < 2))
   {
-    alert("<?php echo get_vocab("you_have_not_entered") . '\n' . get_vocab("useful_n-weekly_value") ?>");
+    alert("<?php echo get_string('you_have_not_entered','block_mrbs') . '\n' . get_string('useful_n-weekly_value','block_mrbs') ?>");
     return false;
   }
 
@@ -237,7 +251,7 @@
   // has been chosen
   if( document.forms["main"].elements['rooms[]'].selectedIndex == -1 )
   {
-    alert("<?php echo get_vocab("you_have_not_selected") . '\n' . get_vocab("valid_room") ?>");
+    alert("<?php echo get_string('you_have_not_selected','block_mrbs') . '\n' . get_string('valid_room','block_mrbs') ?>");
     return false;
   }
 
@@ -270,27 +284,27 @@
 }
 </SCRIPT>
 
-<h2><?php echo isset($id) ? ($edit_type == "series" ? get_vocab("editseries") : get_vocab("editentry")) : get_vocab("addentry"); ?></H2>
+<h2><?php echo isset($id) ? ($edit_type == "series" ? get_string('editseries','block_mrbs') : get_string('editentry','block_mrbs')) : get_string('addentry','block_mrbs'); ?></H2>
 
 <FORM NAME="main" ACTION="edit_entry_handler.php" METHOD="GET">
 
 <TABLE BORDER=0>
 
-<TR><TD CLASS=CR><B><?php echo get_vocab("namebooker")?></B></TD>
+<TR><TD CLASS=CR><B><?php echo get_string('namebooker','block_mrbs')?></B></TD>
   <TD CLASS=CL><INPUT NAME="name" SIZE=40 VALUE="<?php echo htmlspecialchars($name,ENT_NOQUOTES) ?>"></TD></TR>
 
-<TR><TD CLASS=TR><B><?php echo get_vocab("fulldescription")?></B></TD>
+<TR><TD CLASS=TR><B><?php echo get_string('fulldescription','block_mrbs')?></B></TD>
   <TD CLASS=TL><TEXTAREA NAME="description" ROWS=8 COLS=40 WRAP="virtual"><?php echo
 htmlspecialchars ( $description ); ?></TEXTAREA></TD></TR>
 
-<TR><TD CLASS=CR><B><?php echo get_vocab("date")?></B></TD>
+<TR><TD CLASS=CR><B><?php echo get_string('date')?></B></TD>
  <TD CLASS=CL>
   <?php genDateSelector("", $start_day, $start_month, $start_year) ?>
  </TD>
 </TR>
 
 <?php if(! $enable_periods ) { ?>
-<TR><TD CLASS=CR><B><?php echo get_vocab("time")?></B></TD>
+<TR><TD CLASS=CR><B><?php echo get_string('time')?></B></TD>
   <TD CLASS=CL><INPUT NAME="hour" SIZE=2 VALUE="<?php if (!$twentyfourhour_format && ($start_hour > 12)){ echo ($start_hour - 12);} else { echo $start_hour;} ?>" MAXLENGTH=2>:<INPUT NAME="minute" SIZE=2 VALUE="<?php echo $start_min;?>" MAXLENGTH=2>
 <?php
 if (!$twentyfourhour_format)
@@ -303,7 +317,7 @@
 ?>
 </TD></TR>
 <?php } else { ?>
-<TR><TD CLASS=CR><B><?php echo get_vocab("period")?></B></TD>
+<TR><TD CLASS=CR><B><?php echo get_string('period','block_mrbs')?></B></TD>
   <TD CLASS=CL>
     <SELECT NAME="period">
 <?php
@@ -320,7 +334,7 @@
 </TD></TR>
 
 <?php } ?>
-<TR><TD CLASS=CR><B><?php echo get_vocab("duration");?></B></TD>
+<TR><TD CLASS=CR><B><?php echo get_string('duration','block_mrbs');?></B></TD>
   <TD CLASS=CL><INPUT NAME="duration" SIZE=7 VALUE="<?php echo $duration;?>">
     <SELECT NAME="dur_units">
 <?php
@@ -332,12 +346,12 @@
 while (list(,$unit) = each($units))
 {
 	echo "<OPTION VALUE=$unit";
-	if ($dur_units == get_vocab($unit)) echo " SELECTED";
-	echo ">".get_vocab($unit);
+	if ($dur_units == get_string($unit,'block_mrbs')) echo " SELECTED";
+	echo ">".get_string($unit,'block_mrbs');
 }
 ?>
     </SELECT>
-    <INPUT NAME="all_day" TYPE="checkbox" VALUE="yes" onClick="OnAllDayClick(this)"> <?php echo get_vocab("all_day"); ?>
+    <INPUT NAME="all_day" TYPE="checkbox" VALUE="yes" onClick="OnAllDayClick(this)"> <?php echo get_string('all_day','block_mrbs'); ?>
 </TD></TR>
 
 
@@ -398,7 +412,7 @@
 
 // create area selector if javascript is enabled as this is required
 // if the room selector is to be updated.
-this.document.writeln("<tr><td class=CR><b><?php echo get_vocab("areas") ?>:</b></td><td class=CL valign=top>");
+this.document.writeln("<tr><td class=CR><b><?php echo get_string('areas','block_mrbs') ?>:</b></td><td class=CL valign=top>");
 this.document.writeln("          <select name=\"areas\" onChange=\"changeRooms(this.form)\">");
 <?php
 # get list of areas
@@ -420,7 +434,7 @@
 <?php
 } # if $num_areas
 ?>
-<tr><td class=CR><b><?php echo get_vocab("rooms") ?>:</b></td>
+<tr><td class=CR><b><?php echo get_string('rooms','block_mrbs') ?>:</b></td>
   <td class=CL valign=top><table><tr><td><select name="rooms[]" multiple="yes">
   <?php
         # select the rooms in the area determined above
@@ -439,10 +453,10 @@
         $room_names[$i] = $row[1];
    	}
   ?>
-  </select></td><td><?php echo get_vocab("ctrl_click") ?></td></tr></table>
+  </select></td><td><?php echo get_string('ctrl_click','block_mrbs') ?></td></tr></table>
     </td></tr>
 
-<TR><TD CLASS=CR><B><?php echo get_vocab("type")?></B></TD>
+<TR><TD CLASS=CR><B><?php echo get_string('type','block_mrbs')?></B></TD>
   <TD CLASS=CL><SELECT NAME="type">
 <?php
 for ($c = "A"; $c <= "Z"; $c++)
@@ -455,18 +469,19 @@
 <?php if($edit_type == "series") { ?>
 
 <TR>
- <TD CLASS=CR><B><?php echo get_vocab("rep_type")?></B></TD>
+ <TD CLASS=CR><B><?php echo get_string('rep_type','block_mrbs')?></B></TD>
  <TD CLASS=CL>
 <?php
 
-for($i = 0; isset($vocab["rep_type_$i"]); $i++)
+
+for($i = 0; $i<7; $i++) //manually setting this to 7 since that is how many repetition types there are -arb quick and dirty hack 
 {
 	echo "<INPUT NAME=\"rep_type\" TYPE=\"RADIO\" VALUE=\"" . $i . "\"";
 
 	if($i == $rep_type)
 		echo " CHECKED";
 
-	echo ">" . get_vocab("rep_type_$i") . "\n";
+	echo ">" . get_string('rep_type_'.$i,'block_mrbs') . "\n";
 }
 
 ?>
@@ -474,12 +489,12 @@
 </TR>
 
 <TR>
- <TD CLASS=CR><B><?php echo get_vocab("rep_end_date")?></B></TD>
+ <TD CLASS=CR><B><?php echo get_string('rep_end_date','block_mrbs')?></B></TD>
  <TD CLASS=CL><?php genDateSelector("rep_end_", $rep_end_day, $rep_end_month, $rep_end_year) ?></TD>
 </TR>
 
 <TR>
- <TD CLASS=CR><B><?php echo get_vocab("rep_rep_day")?></B> <?php echo get_vocab("rep_for_weekly")?></TD>
+ <TD CLASS=CR><B><?php echo get_string('rep_rep_day','block_mrbs')?></B> <?php echo get_string('rep_for_weekly','block_mrbs')?></TD>
  <TD CLASS=CL>
 <?php
 # Display day name checkboxes according to language and preferred weekday start.
@@ -500,7 +515,7 @@
 {
 	$key = "rep_type_" . (isset($rep_type) ? $rep_type : "0");
 
-	echo "<tr><td class=\"CR\"><b>".get_vocab("rep_type")."</b></td><td class=\"CL\">".get_vocab($key)."</td></tr>\n";
+	echo "<tr><td class=\"CR\"><b>".get_string('rep_type','block_mrbs')."</b></td><td class=\"CL\">".get_string($key,'block_mrbs')."</td></tr>\n";
 
 	if(isset($rep_type) && ($rep_type != 0))
 	{
@@ -515,9 +530,9 @@
 			}
 		}
 		if($opt)
-			echo "<tr><td class=\"CR\"><b>".get_vocab("rep_rep_day")."</b></td><td class=\"CL\">$opt</td></tr>\n";
+			echo "<tr><td class=\"CR\"><b>".get_string('rep_rep_day','block_mrbs')."</b></td><td class=\"CL\">$opt</td></tr>\n";
 
-		echo "<tr><td class=\"CR\"><b>".get_vocab("rep_end_date")."</b></td><td class=\"CL\">$rep_end_date</td></tr>\n";
+		echo "<tr><td class=\"CR\"><b>".get_string('rep_end_date','block_mrbs')."</b></td><td class=\"CL\">$rep_end_date</td></tr>\n";
 	}
 }
 /* We display the rep_num_weeks box only if:
@@ -526,12 +541,12 @@
    - we are editing an existing repeating entry ($rep_type is set and
      $rep_type != 0 and $edit_type == "series" )
 */
-if ( ( !isset( $id ) ) Xor ( isset( $rep_type ) && ( $rep_type != 0 ) && ( "series" == $edit_type ) ) )
+if ( ( ( $id==0 ) ) Xor ( isset( $rep_type ) && ( $rep_type != 0 ) && ( "series" == $edit_type ) ) )
 {
 ?>
 
 <TR>
- <TD CLASS=CR><B><?php echo get_vocab("rep_num_weeks")?></B> <?php echo get_vocab("rep_for_nweekly")?></TD>
+ <TD CLASS=CR><B><?php echo get_string('rep_num_weeks','block_mrbs')?></B> <?php echo get_string('rep_for_nweekly','block_mrbs')?></TD>
  <TD CLASS=CL><INPUT TYPE=TEXT NAME="rep_num_weeks" VALUE="<?php echo $rep_num_weeks?>">
 </TR>
 <?php } ?>
@@ -539,10 +554,10 @@
 <TR>
  <TD colspan=2 align=center>
   <SCRIPT LANGUAGE="JavaScript">
-   document.writeln ( '<INPUT TYPE="button" NAME="save_button" VALUE="<?php echo get_vocab("save")?>" ONCLICK="validate_and_submit()">' );
+   document.writeln ( '<INPUT TYPE="button" NAME="save_button" VALUE="<?php echo get_string('savechanges')?>" ONCLICK="validate_and_submit()">' );
   </SCRIPT>
   <NOSCRIPT>
-   <INPUT TYPE="submit" VALUE="<?php echo get_vocab("save")?>">
+   <INPUT TYPE="submit" VALUE="<?php echo get_string('savechanges')?>">
   </NOSCRIPT>
  </TD></TR>
 </TABLE>
@@ -557,4 +572,4 @@
 
 </FORM>
 
-<?php include "trailer.inc" ?>
\ No newline at end of file
+<?php include "trailer.php" ?>
Index: web/auth_ext.inc
===================================================================
RCS file: web/auth_ext.inc
diff -N web/auth_ext.inc
--- web/auth_ext.inc	29 Mar 2005 13:26:15 -0000	1.6.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,112 +0,0 @@
-<?php
-
-/* $Id: auth_ext.inc,v 1.6.2.2 2005/03/29 13:26:15 jberanek Exp $
- *
- * Authentication scheme that uses an external script as the source
- * for user authentication.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- * $auth["realm"]  = "MRBS";    # Or any other string
- * $auth["type"]   = "ext";
- * $auth["prog"]   = "authenticationprogram";  # The full path to the external
- *                                             # script
- * $auth["params"] = "#USERNAME# #PASSWORD# other-params" # Parameters to pass to
- *                                                        # the script, #USERNAME#
- *                                                        # and #PASSWORD#
- *                                                        # will be expanded to
- *                                                        # the values typed by
- *                                                        # the user.
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "username1";
- * $auth["admin"][] = "username2";
- *
- */
-
-/* ~~JFL 2003/11/12 By default, use the http session mechanism */
-if (!isset($auth['session'])) $auth['session']='http';
-
-function version_check($vercheck)
-{
-  $minver = str_replace(".","", $vercheck);
-  $curver = str_replace(".","", phpversion());
-
-  if($curver >= $minver)
-  {
-    return true;
-  }
-  return false;
-}
-
-if (version_check("4.0.3") == false)
-{
-    include "escapeshellarg.inc";
-}
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-function authValidateUser($user, $pass)
-{
-        global $auth;
-	
-	// Check if we do not have a username/password
-	if(!isset($user) || !isset($pass))
-	{
-		return 0;
-	}
-	
-	// Generate the command line
-	$cmd = $auth["prog"] . ' ' . $auth["params"];
-	$cmd = preg_replace('/#USERNAME#/',escapeshellarg($user),$cmd);
-	$cmd = preg_replace('/#PASSWORD#/',escapeshellarg($pass),$cmd);
-	
-	// Run the program
-	exec($cmd, $output, $ret);
-	
-	// If it succeeded, return success
-	if($ret == 0)
-		return 1;
-	
-	// return failure
-	return 0;
-}
-
-/* authGetUserLevel($user)
- * 
- * Determines the users access level
- * 
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-	// User not logged in, user level '0'
-	if(!isset($user))
-		return 0;
-	
-	// Check if the user is can modify
-	for($i = 0; $lev1_admin[$i]; $i++)
-	{
-		if(strcasecmp($user, $lev1_admin[$i]) == 0)
-			return 2;
-	}
-	
-	// Everybody else is access level '1'
-	return 1;
-}
-
-?>
\ No newline at end of file
Index: web/day.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/day.php,v
retrieving revision 1.38.2.3
diff -u -r1.38.2.3 day.php
--- web/day.php	13 Feb 2007 12:53:24 -0000	1.38.2.3
+++ web/day.php	2 Aug 2008 04:39:18 -0000
@@ -1,17 +1,38 @@
 <?php
 # $Id: day.php,v 1.38.2.3 2007/02/13 12:53:24 jberanek Exp $
-
+require_once("../../../config.php");
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
-include "mincals.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+include "mincals.php";
+
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$id = optional_param('id', 0, PARAM_INT);
+$area = optional_param('area', get_default_area(),  PARAM_INT);
+$room = optional_param('room', 0, PARAM_INT);
+$morningstarts_minutes = optional_param('morningstarts_minutes', 0, PARAM_INT);
+$pview = optional_param('pview', 0, PARAM_INT);
+$debug_flag = optional_param('debug_flag', 0, PARAM_INT);
+$timetohighlight = optional_param('$timetohighlight', 0, PARAM_INT);
+
+/*
+$id = required_param('id', PARAM_INT);   // course
+if (! $course = get_record("course", "id", $id)) {
+    error("Course ID is incorrect");
+    }
+require_course_login($course);
+add_to_log($course->id, "mrbs", "view all", "day.php?id=$course->id", "");
+*/
 
+global $user;
 if (empty($debug_flag)) $debug_flag = 0;
 
 #If we dont know the right date then make it up 
-if (!isset($day) or !isset($month) or !isset($year))
+if (($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
@@ -21,11 +42,11 @@
 	while (!checkdate(intval($month), intval($day), intval($year)))
 		$day--;
 }
-if (empty($area))
-	$area = get_default_area();
+// if (($area>0))
+//	$area = get_default_area();
 
 # print the page header
-print_header($day, $month, $year, $area);
+print_header_mrbs($day, $month, $year, $area);
 
 $format = "Gi";
 if( $enable_periods ) {
@@ -39,8 +60,7 @@
 }
 
 # ensure that $morningstarts_minutes defaults to zero if not set
-if( empty( $morningstarts_minutes ) )
-	$morningstarts_minutes=0;
+# not needed if initialized with optoinal_param - ab.
 
 # Define the start and end of each day in a way which is not affected by
 # daylight saving...
@@ -56,12 +76,12 @@
    echo "<table width=\"100%\"><tr><td width=\"60%\">";
 
    #Show all avaliable areas
-   echo "<u>".get_vocab("areas")."</u><br>";
+   echo "<u>".get_string('areas','block_mrbs')."</u><br>";
 
    # need to show either a select box or a normal html list,
    # depending on the settings in config.inc.php
    if ($area_list_format == "select") {
-	echo make_area_select_html('day.php', $area, $year, $month, $day); # from functions.inc
+	echo make_area_select_html('day.php', $area, $year, $month, $day); # from functions.php
    } else {
 	# show the standard html list
 	$sql = "select id, area_name from $tbl_area order by area_name";
@@ -189,7 +209,7 @@
 if (! $res) fatal_error(0, sql_error());
 if (sql_count($res) == 0)
 {
-	echo "<h1>".get_vocab("no_rooms_for_area")."</h1>";
+	echo "<h1>".get_string('no_rooms_for_area','block_mrbs')."</h1>";
 	sql_free($res);
 }
 else
@@ -199,9 +219,9 @@
 
 	if ( $pview != 1 ) {
 		#Show Go to day before and after links
-        $output = "<table width=\"100%\"><tr><td><a href=\"day.php?year=$yy&month=$ym&day=$yd&area=$area\">&lt;&lt;".get_vocab("daybefore")."</a></td>
-        <td align=center><a href=\"day.php?area=$area\">".get_vocab("gototoday")."</a></td>
-        <td align=right><a href=\"day.php?year=$ty&month=$tm&day=$td&area=$area\">".get_vocab("dayafter")."&gt;&gt;</a></td></tr></table>\n";
+        $output = "<table width=\"100%\"><tr><td><a href=\"day.php?year=$yy&month=$ym&day=$yd&area=$area\">&lt;&lt;".get_string('daybefore','block_mrbs')."</a></td>
+        <td align=center><a href=\"day.php?area=$area\">".get_string('gototoday','block_mrbs')."</a></td>
+        <td align=right><a href=\"day.php?year=$ty&month=$tm&day=$td&area=$area\">".get_string('dayafter','block_mrbs')."&gt;&gt;</a></td></tr></table>\n";
         print $output;
 	}
 
@@ -215,20 +235,20 @@
                . "true, "
                . ((FALSE != $times_right_side) ? "true" : "false") . ", "
                . "\"$highlight_method\", "
-               . "\"" . get_vocab("click_to_reserve") . "\""
+               . "\"" . get_string('click_to_reserve','block_mrbs') . "\""
                . ");</SCRIPT>\n";
             }
 
 	#This is where we start displaying stuff
 	echo "<table cellspacing=0 border=1 width=\"100%\">";
-	echo "<tr><th width=\"1%\">".($enable_periods ? get_vocab("period") : get_vocab("time"))."</th>";
+	echo "<tr><th width=\"1%\">".($enable_periods ? get_string('period','block_mrbs') : get_string('time'))."</th>";
 
 	$room_column_width = (int)(95 / sql_count($res));
 	for ($i = 0; ($row = sql_row($res, $i)); $i++)
 	{
         echo "<th width=\"$room_column_width%\">
             <a href=\"week.php?year=$year&month=$month&day=$day&area=$area&room=$row[2]\"
-            title=\"" . get_vocab("viewweek") . " &#10;&#10;$row[3]\">"
+            title=\"" . get_string('viewweek','block_mrbs') . " &#10;&#10;$row[3]\">"
             . htmlspecialchars($row[0]) . ($row[1] > 0 ? "($row[1])" : "") . "</a></th>";
 		$rooms[] = $row[2];
 	}
@@ -236,7 +256,7 @@
     # next line to display times on right side
     if ( FALSE != $times_right_side )
     {
-        echo "<th width=\"1%\">". ( $enable_periods  ? get_vocab("period") : get_vocab("time") )
+        echo "<th width=\"1%\">". ( $enable_periods  ? get_string('period','block_mrbs') : get_string('time') )
         ."</th>";
     }
     echo "</tr>\n";
@@ -269,11 +289,11 @@
 		if( $enable_periods ){
 			$time_t_stripped = preg_replace( "/^0/", "", $time_t );
 			echo "<a href=\"$hilite_url=$time_t\"  title=\""
-            . get_vocab("highlight_line") . "\">"
+            . get_string('highlight_line','block_mrbs') . "\">"
             . $periods[$time_t_stripped] . "</a></td>\n";
 		} else {
 			echo "<a href=\"$hilite_url=$time_t\" title=\""
-            . get_vocab("highlight_line") . "\">"
+            . get_string('highlight_line','block_mrbs') . "\">"
             . utf8_strftime(hour_min_format(),$t) . "</a></td>\n";
 		}
 
@@ -295,7 +315,7 @@
 			# We tell if its booked by $id having something in it
 			if (isset($id))
 				$c = $color;
-			elseif (isset($timetohighlight) && ($time_t == $timetohighlight))
+			elseif (($timetohighlight>0) && ($time_t == $timetohighlight))
 				$c = "red";
 			else
 				$c = $row_class; # Use the default color class for the row.
@@ -348,14 +368,14 @@
                 tdcell("red");
                 $time_t_stripped = preg_replace( "/^0/", "", $time_t );
                 echo "<a href=\"$hilite_url=$time_t\"  title=\""
-                . get_vocab("highlight_line") . "\">"
+                . get_string('highlight_line','block_mrbs') . "\">"
                 . $periods[$time_t_stripped] . "</a></td>\n";
             }
             else
             {
                 tdcell("red");
 		        echo "<a href=\"$hilite_url=$time_t\" title=\""
-                . get_vocab("highlight_line") . "\">"
+                . get_string('highlight_line','block_mrbs') . "\">"
                 . utf8_strftime(hour_min_format(),$t) . "</a></td>\n";
             }
         }
@@ -367,6 +387,5 @@
     (isset($output)) ? print $output : '';
 	show_colour_key();
 }
-
-include "trailer.inc";
+include "trailer.php";
 ?>
Index: web/auth_config.inc
===================================================================
RCS file: web/auth_config.inc
diff -N web/auth_config.inc
--- web/auth_config.inc	29 Mar 2005 13:26:15 -0000	1.2.4.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,82 +0,0 @@
-<?php 
-/*****************************************************************************\
-*									      *
-*   File name       auth_config.inc					      *
-*									      *
-*   Description	    Authenticate users from a list in config.inc.php.         *
-*									      *
-*   Notes	    To use this authentication scheme, set in config.inc.php: *
-*			$auth["type"]  = "config";			      *
-*									      *
-*		    Then for each user, add an entry formatted as:	      *
-*			$auth["user"]["username"] == "userpassword";          *
-*									      *
-*   History								      *
-*    2003/11/09 JFL Created this file					      *
-*									      *
-\*****************************************************************************/
-
-// $Id: auth_config.inc,v 1.2.4.2 2005/03/29 13:26:15 jberanek Exp $
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-
-function authValidateUser($user, $pass)
-{
-   global $auth;
-
-   // Check if we do not have a username/password
-   if(!isset($user) || !isset($pass) || strlen($pass)==0)
-   {
-      return 0;
-   }
-
-   if ((isset($auth["user"][$user])
-        && ($auth["user"][$user] == $pass)
-       ) ||
-       (isset($auth["user"][strtolower($user)])
-        && ($auth["user"][strtolower($user)] == $pass)
-       ))
-   {
-      return 1; // User validated
-   }
-
-   return 0;		// User unknown or password invalid
-}
-
-/* authGetUserLevel($user)
- * 
- * Determines the users access level
- * 
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-   // User not logged in, user level '0'
-   if(!isset($user))
-      return 0;
-
-   // Check if the user is can modify
-   for($i = 0; isset($lev1_admin[$i]); $i++)
-   {
-      if(strcasecmp($user, $lev1_admin[$i]) == 0)
-	 return 2;
-   }
-
-   // Everybody else is access level '1'
-   return 1;
-}
-
-?>
Index: web/lang.en
===================================================================
RCS file: web/lang.en
diff -N web/lang.en
--- web/lang.en	9 Oct 2006 15:53:59 -0000	1.26.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,255 +0,0 @@
-<?php
-# $Id: lang.en,v 1.26.2.2 2006/10/09 15:53:59 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a US/UK English file.
-#
-#
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Meeting Room Booking System";
-
-# Used in functions.inc
-$vocab["report"]             = "Report";
-$vocab["admin"]              = "Admin";
-$vocab["help"]               = "Help";
-$vocab["search"]             = "Search:";
-$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Bookings for";
-$vocab["bookingsforpost"]    = ""; # Goes after the date
-$vocab["areas"]              = "Areas";
-$vocab["daybefore"]          = "Go To Day Before";
-$vocab["dayafter"]           = "Go To Day After";
-$vocab["gototoday"]          = "Go To Today";
-$vocab["goto"]               = "goto";
-$vocab["highlight_line"]     = "Highlight this line";
-$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "View Day";
-$vocab["viewweek"]           = "View Week";
-$vocab["viewmonth"]          = "View Month";
-$vocab["ppreview"]           = "Print Preview";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Add Entry";
-$vocab["editentry"]          = "Edit Entry";
-$vocab["editseries"]         = "Edit Series";
-$vocab["namebooker"]         = "Brief Description:";
-$vocab["fulldescription"]    = "Full Description:<br>&nbsp;&nbsp;(Number of people,<br>&nbsp;&nbsp;Internal/External etc)";
-$vocab["date"]               = "Date:";
-$vocab["start_date"]         = "Start Time:";
-$vocab["end_date"]           = "End Time:";
-$vocab["time"]               = "Time:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "Duration:";
-$vocab["seconds"]            = "seconds";
-$vocab["minutes"]            = "minutes";
-$vocab["hours"]              = "hours";
-$vocab["days"]               = "days";
-$vocab["weeks"]              = "weeks";
-$vocab["years"]              = "years";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "All day";
-$vocab["type"]               = "Type:";
-$vocab["internal"]           = "Internal";
-$vocab["external"]           = "External";
-$vocab["save"]               = "Save";
-$vocab["rep_type"]           = "Repeat Type:";
-$vocab["rep_type_0"]         = "None";
-$vocab["rep_type_1"]         = "Daily";
-$vocab["rep_type_2"]         = "Weekly";
-$vocab["rep_type_3"]         = "Monthly";
-$vocab["rep_type_4"]         = "Yearly";
-$vocab["rep_type_5"]         = "Monthly, corresponding day";
-$vocab["rep_type_6"]         = "n-Weekly";
-$vocab["rep_end_date"]       = "Repeat End Date:";
-$vocab["rep_rep_day"]        = "Repeat Day:";
-$vocab["rep_for_weekly"]     = "(for (n-)weekly)";
-$vocab["rep_freq"]           = "Frequency:";
-$vocab["rep_num_weeks"]      = "Number of weeks";
-$vocab["rep_for_nweekly"]    = "(for n-weekly)";
-$vocab["ctrl_click"]         = "Use Control-Click to select more than one room";
-$vocab["entryid"]            = "Entry ID ";
-$vocab["repeat_id"]          = "Repeat ID "; 
-$vocab["you_have_not_entered"] = "You have not entered a";
-$vocab["you_have_not_selected"] = "You have not selected a";
-$vocab["valid_room"]         = "room.";
-$vocab["valid_time_of_day"]  = "valid time of day.";
-$vocab["brief_description"]  = "Brief Description.";
-$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Description:";
-$vocab["room"]               = "Room";
-$vocab["createdby"]          = "Created By:";
-$vocab["lastupdate"]         = "Last Updated:";
-$vocab["deleteentry"]        = "Delete Entry";
-$vocab["deleteseries"]       = "Delete Series";
-$vocab["confirmdel"]         = "Are you sure\\nyou want to\\ndelete this entry?\\n\\n";
-$vocab["returnprev"]         = "Return to previous page";
-$vocab["invalid_entry_id"]   = "Invalid entry id.";
-$vocab["invalid_series_id"]  = "Invalid series id.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Error";
-$vocab["sched_conflict"]     = "Scheduling Conflict";
-$vocab["conflict"]           = "The new booking will conflict with the following entry(s):";
-$vocab["too_may_entrys"]     = "The selected options will create too many entries.<BR>Please use different options!";
-$vocab["returncal"]          = "Return to calendar view";
-$vocab["failed_to_acquire"]  = "Failed to acquire exclusive database access";
-$vocab["invalid_booking"]    = "Invalid booking";
-$vocab["must_set_description"] = "You must set a brief description for the booking. Please go back and enter one.";
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Access Denied";
-$vocab["norights"]           = "You do not have access rights to modify this item.";
-$vocab["please_login"]       = "Please log in";
-$vocab["user_name"]          = "Name";
-$vocab["user_password"]      = "Password";
-$vocab["unknown_user"]       = "Unknown user";
-$vocab["you_are"]            = "You are";
-$vocab["login"]              = "Log in";
-$vocab["logoff"]             = "Log Off";
-
-# Authentication database
-$vocab["user_list"]          = "User list";
-$vocab["edit_user"]          = "Edit user";
-$vocab["delete_user"]        = "Delete this user";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email address";
-$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
-$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
-$vocab["add_new_user"]       = "Add a new user";
-$vocab["rights"]             = "Rights";
-$vocab["action"]             = "Action";
-$vocab["user"]               = "User";
-$vocab["administrator"]      = "Administrator";
-$vocab["unknown"]            = "Unknown";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-$vocab["no_users_initial"]   = "No users in database, allowing initial user creation";
-$vocab["no_users_create_first_admin"] = "Create a user configured as administrator and then you can log in and create more users.";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Empty or invalid search string.";
-$vocab["search_results"]     = "Search Results for:";
-$vocab["nothing_found"]      = "No matching entries found.";
-$vocab["records"]            = "Records ";
-$vocab["through"]            = " through ";
-$vocab["of"]                 = " of ";
-$vocab["previous"]           = "Previous";
-$vocab["next"]               = "Next";
-$vocab["entry"]              = "Entry";
-$vocab["view"]               = "View";
-$vocab["advanced_search"]    = "Advanced search";
-$vocab["search_button"]      = "Search";
-$vocab["search_for"]         = "Search For";
-$vocab["from"]               = "From";
-
-# Used in report.php
-$vocab["report_on"]          = "Report on Meetings:";
-$vocab["report_start"]       = "Report start date:";
-$vocab["report_end"]         = "Report end date:";
-$vocab["match_area"]         = "Match area:";
-$vocab["match_room"]         = "Match room:";
-$vocab["match_type"]         = "Match type:";
-$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
-$vocab["match_entry"]        = "Match brief description:";
-$vocab["match_descr"]        = "Match full description:";
-$vocab["include"]            = "Include:";
-$vocab["report_only"]        = "Report only";
-$vocab["summary_only"]       = "Summary only";
-$vocab["report_and_summary"] = "Report and Summary";
-$vocab["summarize_by"]       = "Summarize by:";
-$vocab["sum_by_descrip"]     = "Brief description";
-$vocab["sum_by_creator"]     = "Creator";
-$vocab["entry_found"]        = "entry found";
-$vocab["entries_found"]      = "entries found";
-$vocab["summary_header"]     = "Summary of (Entries) Hours";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Total";
-$vocab["submitquery"]        = "Run Report";
-$vocab["sort_rep"]           = "Sort Report by:";
-$vocab["sort_rep_time"]      = "Start Date/Time";
-$vocab["rep_dsp"]            = "Display in report:";
-$vocab["rep_dsp_dur"]        = "Duration";
-$vocab["rep_dsp_end"]        = "End Time";
-
-# Used in week.php
-$vocab["weekbefore"]         = "Go To Week Before";
-$vocab["weekafter"]          = "Go To Week After";
-$vocab["gotothisweek"]       = "Go To This Week";
-
-# Used in month.php
-$vocab["monthbefore"]        = "Go To Month Before";
-$vocab["monthafter"]         = "Go To Month After";
-$vocab["gotothismonth"]      = "Go To This Month";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "No rooms defined for this area";
-
-# Used in admin.php
-$vocab["edit"]               = "Edit";
-$vocab["delete"]             = "Delete";
-$vocab["rooms"]              = "Rooms";
-$vocab["in"]                 = "in";
-$vocab["noareas"]            = "No Areas";
-$vocab["addarea"]            = "Add Area";
-$vocab["name"]               = "Name";
-$vocab["noarea"]             = "No area selected";
-$vocab["browserlang"]        = "Your browser is set to use";
-$vocab["postbrowserlang"]    = "language.";
-$vocab["addroom"]            = "Add Room";
-$vocab["capacity"]           = "Capacity";
-$vocab["norooms"]            = "No rooms.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Edit Area";
-$vocab["change"]             = "Change";
-$vocab["backadmin"]          = "Back to Admin";
-$vocab["editroomarea"]       = "Edit Area or Room Description";
-$vocab["editroom"]           = "Edit Room";
-$vocab["update_room_failed"] = "Update room failed: ";
-$vocab["error_room"]         = "Error: room ";
-$vocab["not_found"]          = " not found";
-$vocab["update_area_failed"] = "Update area failed: ";
-$vocab["error_area"]         = "Error: area ";
-$vocab["room_admin_email"]   = "Room admin email:";
-$vocab["area_admin_email"]   = "Area admin email:";
-$vocab["invalid_email"]      = "Invalid email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "This will delete the following bookings";
-$vocab["sure"]               = "Are you sure?";
-$vocab["YES"]                = "YES";
-$vocab["NO"]                 = "NO";
-$vocab["delarea"]            = "You must delete all rooms in this area before you can delete it<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "About MRBS";
-$vocab["database"]           = "Database: ";
-$vocab["system"]             = "System: ";
-$vocab["please_contact"]     = "Please contact ";
-$vocab["for_any_questions"]  = "for any questions that aren't answered here.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fatal Error: Failed to connect to database";
-
-?>
Index: web/auth_nis.inc
===================================================================
RCS file: web/auth_nis.inc
diff -N web/auth_nis.inc
--- web/auth_nis.inc	29 Mar 2005 13:26:15 -0000	1.5.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,89 +0,0 @@
-<?php
-
-/* $Id: auth_nis.inc,v 1.5.2.2 2005/03/29 13:26:15 jberanek Exp $
- *
- * Authentication scheme that uses NIS as the source for user
- * authentication.
- *
- * To use this authentication scheme set the following
- * things in config.inc.php:
- *
- * $auth["realm"] = "MRBS";    # Or any other string
- * $auth["type"]  = "nis";
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "nisuser1";
- * $auth["admin"][] = "nisuser2";
- *
- */
-
-/* ~~JFL 2003/11/12 By default, use the http session mechanism */
-if (!isset($auth['session'])) $auth['session']='http';
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-function authValidateUser($user, $pass)
-{
-        global $auth;
-
-	// Check if we do not have a username/password
-	if(!isset($user) || !isset($pass))
-	{
-		return 0;
-	}
-
-        // untaint $user
-        //preg_match("/(^\w+).*/",$user,$regs);
-        //$user = $regs[1];
-
-        $rs = yp_match (yp_get_default_domain(), "passwd.byname", $user);
-	if ( ! empty ( $rs ) ) {
-          $rs = explode ( ":", $rs );
-	  if ( $rs[1] == crypt ( $pass, substr ( $rs[1], 0, 2 ) ) ) { 
-            return 1;
-          } else {
-            return 0;
-          }
-        }
-
-	// return failure
-	return 0;
-}
-
-/* authGetUserLevel($user)
- *
- * Determines the users access level
- *
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-	// User not logged in, user level '0'
-	if(!isset($user))
-		return 0;
-
-	// Check if the user is can modify
-	for($i = 0; $lev1_admin[$i]; $i++)
-	{
-		if(strcasecmp($user, $lev1_admin[$i]) == 0)
-			return 2;
-	}
-	
-	// Everybody else is access level '1'
-	return 1;
-}
-
-?>
\ No newline at end of file
Index: web/add.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/add.php,v
retrieving revision 1.5.2.1
diff -u -r1.5.2.1 add.php
--- web/add.php	29 Mar 2005 13:26:15 -0000	1.5.2.1
+++ web/add.php	2 Aug 2008 04:39:18 -0000
@@ -1,12 +1,12 @@
 <?php
 
-# $Id: add.php,v 1.5.2.1 2005/03/29 13:26:15 jberanek Exp $
-
+# $Id: add.php,v 1.2 2007/12/28 05:53:05 arborrow Exp $
+require_once("../../../config.php");
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
 
 if(!getAuthorised(2))
 {
@@ -14,6 +14,12 @@
 	exit();
 }
 
+$type = required_param('type', PARAM_ALPHA);
+$name = required_param('name', PARAM_TEXT);
+$description = optional_param('description', '', PARAM_TEXT);
+$capacity = optional_param('capacity', 0, PARAM_INT);
+$area = optional_param('area', 0, PARAM_INT);
+
 # This file is for adding new areas/rooms
 
 # we need to do different things depending on if its a room
Index: web/index.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/index.php,v
retrieving revision 1.8
diff -u -r1.8 index.php
--- web/index.php	14 Apr 2004 22:00:03 -0000	1.8
+++ web/index.php	2 Aug 2008 04:39:19 -0000
@@ -1,15 +1,16 @@
 <?php
 
-# $Id: index.php,v 1.8 2004/04/14 22:00:03 gwalker Exp $
+# $Id: index.php,v 1.2 2007/12/28 05:53:06 arborrow Exp $
 
 # Index is just a stub to redirect to the appropriate view
 # as defined in config.inc.php using the variable $default_view
 # If $default_room is defined in config.inc.php then this will
 # be used to redirect to a particular room.
-
+require_once("../../../config.php");; //for Moodle integration
 require_once "grab_globals.inc.php";
 include("config.inc.php");
-include("$dbsys.inc");
+include("$dbsys.php");
+
 
 $day   = date("d");
 $month = date("m");
@@ -46,4 +47,4 @@
 
 header("Location: $redirect_str");
 
-?>
+?>
\ No newline at end of file
Index: web/site_faq_fr.html
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/site_faq_fr.html,v
retrieving revision 1.2
diff -u -r1.2 site_faq_fr.html
--- web/site_faq_fr.html	12 Jan 2003 20:34:09 -0000	1.2
+++ web/site_faq_fr.html	2 Aug 2008 04:39:20 -0000
@@ -1,4 +1,4 @@
-<!-- $Id: site_faq_fr.html,v 1.2 2003/01/12 20:34:09 thierry_bo Exp $ -->
+<!-- $Id: site_faq_fr.html,v 1.1 2007/04/05 22:25:33 arborrow Exp $ -->
 <p>
 
 <b><a name=top>Authentification</a></b>
Index: web/lang.da
===================================================================
RCS file: web/lang.da
diff -N web/lang.da
--- web/lang.da	28 Jul 2004 10:01:12 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.da,v 1.5 2004/07/28 10:01:12 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is the Danish file.
-#
-# Translations provided by: Claes Bolvig Pedersen (cp@dhi.dk)
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Bookning af m�derum, MRBS";
-
-# Used in functions.inc
-$vocab["report"]             = "Rapport";
-$vocab["admin"]              = "Admin";
-$vocab["help"]               = "Hj�lp";
-$vocab["search"]             = "S�g:";
-$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Booking for";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Omr�de";
-$vocab["daybefore"]          = "G� til forrige dag";
-$vocab["dayafter"]           = "G� til n�ste dag";
-$vocab["gototoday"]          = "G� til idag";
-$vocab["goto"]               = "g� til";
-$vocab["highlight_line"]     = "Highlight this line";
-$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Vis dag";
-$vocab["viewweek"]           = "Vis Uge";
-$vocab["viewmonth"]          = "Vis M�ned";
-$vocab["ppreview"]           = "Forh�ndsvisning";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Booking";
-$vocab["editentry"]          = "�ndre booking";
-$vocab["editseries"]         = "�ndre serie";
-$vocab["namebooker"]         = "Kort beskrivelse:";
-$vocab["fulldescription"]    = "Lang beskrivelse:<br>&nbsp;&nbsp;(Antal personer,<br>&nbsp;&nbsp;Internt/Eksternt osv)";
-$vocab["date"]               = "Dato:";
-$vocab["start_date"]         = "Starttid:";
-$vocab["end_date"]           = "Sluttid:";
-$vocab["time"]               = "Tid:";
-$vocab["duration"]           = "L�ngde:";
-$vocab["period"]             = "Period:";
-$vocab["seconds"]            = "sekunder";
-$vocab["minutes"]            = "minutter";
-$vocab["hours"]              = "timer";
-$vocab["days"]               = "dage";
-$vocab["weeks"]              = "uger";
-$vocab["years"]              = "�r";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "hele dagen";
-$vocab["type"]               = "Type:";
-$vocab["internal"]           = "Internt";
-$vocab["external"]           = "Eksternt";
-$vocab["save"]               = "Gem";
-$vocab["rep_type"]           = "Repetitionstype:";
-$vocab["rep_type_0"]         = "ingen";
-$vocab["rep_type_1"]         = "daglig";
-$vocab["rep_type_2"]         = "ugentlig";
-$vocab["rep_type_3"]         = "m�nedlig";
-$vocab["rep_type_4"]         = "�rlig";
-$vocab["rep_type_5"]         = "M�nedlig, samme dag";
-$vocab["rep_type_6"]         = "n-ugentlig";
-$vocab["rep_end_date"]       = "Repetitionsslutdato:";
-$vocab["rep_rep_day"]        = "Repetitionsdag:";
-$vocab["rep_for_weekly"]     = "(ved hver uge)";
-$vocab["rep_freq"]           = "Frekvens:";
-$vocab["rep_num_weeks"]      = "Antal uger";
-$vocab["rep_for_nweekly"]    = "(for n-uger)";
-$vocab["ctrl_click"]         = "Hold kontroltasten nede for at v�lge mere end et rum";
-$vocab["entryid"]            = "Entry ID ";
-$vocab["repeat_id"]          = "Repeat ID "; 
-$vocab["you_have_not_entered"] = "Du har ikke indtastet et";
-$vocab["you_have_not_selected"] = "You have not selected a";
-$vocab["valid_room"]         = "room.";
-$vocab["valid_time_of_day"]  = "validt tidspunkt.";
-$vocab["brief_description"]  = "Kort beskrivelse.";
-$vocab["useful_n-weekly_value"] = "nyttig n-ugentlig v�rdi.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Beskrivelse:";
-$vocab["room"]               = "Rum";
-$vocab["createdby"]          = "Gemt af:";
-$vocab["lastupdate"]         = "Senest opdateret:";
-$vocab["deleteentry"]        = "Slet bookning";
-$vocab["deleteseries"]       = "Slet serie";
-$vocab["confirmdel"]         = "Er du sikker p� at\\ndu vil slette bookningen?\\n\\n";
-$vocab["returnprev"]         = "Tilbage til forrige side";
-$vocab["invalid_entry_id"]   = "Invalid entry id.";
-$vocab["invalid_series_id"]  = "Invalid series id.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Fejl";
-$vocab["sched_conflict"]     = "Bookningskonflikt";
-$vocab["conflict"]           = "Bookningen er i konflikt med f�lgende bookning(er):";
-$vocab["too_may_entrys"]     = "De valgte instillinger skaber for mange bookninger.<BR>Brug venligst andre indstillinger!";
-$vocab["returncal"]          = "Tilbage til kalender";
-$vocab["failed_to_acquire"]  = "Failed to acquire exclusive database access"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Ingen adgang";
-$vocab["norights"]           = "Du har ingen rettighed til at �ndre bookningen.";
-$vocab["please_login"]       = "Please log in";
-$vocab["user_name"]          = "Name";
-$vocab["user_password"]      = "Password";
-$vocab["unknown_user"]       = "Unknown user";
-$vocab["you_are"]            = "You are";
-$vocab["login"]              = "Log in";
-$vocab["logoff"]             = "Log Off";
-
-# Authentication database
-$vocab["user_list"]          = "User list";
-$vocab["edit_user"]          = "Edit user";
-$vocab["delete_user"]        = "Delete this user";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email address";
-$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
-$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
-$vocab["add_new_user"]       = "Add a new user";
-$vocab["rights"]             = "Rights";
-$vocab["action"]             = "Action";
-$vocab["user"]               = "User";
-$vocab["administrator"]      = "Administrator";
-$vocab["unknown"]            = "Unknown";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Tom eller ugyldig s�gestreng.";
-$vocab["search_results"]     = "S�geresultat for:";
-$vocab["nothing_found"]      = "Ingen poster blev fundet.";
-$vocab["records"]            = "Bookning ";
-$vocab["through"]            = " til ";
-$vocab["of"]                 = " af ";
-$vocab["previous"]           = "Forrige";
-$vocab["next"]               = "N�ste";
-$vocab["entry"]              = "Post";
-$vocab["view"]               = "Vis";
-$vocab["advanced_search"]    = "Avanceret s�gning";
-$vocab["search_button"]      = "S�
-$vocab["search_for"]         = "S�g efter";
-$vocab["from"]               = "Fra";
-
-# Used in report.php
-$vocab["report_on"]          = "Rapport:";
-$vocab["report_start"]       = "Start dato:";
-$vocab["report_end"]         = "Slut dato:";
-$vocab["match_area"]         = "Omr�de:";
-$vocab["match_room"]         = "Rum:";
-$vocab["match_type"]         = "Match type:";
-$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
-$vocab["match_entry"]        = "Kort beskrivelse:";
-$vocab["match_descr"]        = "Lang beskrivelse:";
-$vocab["include"]            = "Skal indeholde:";
-$vocab["report_only"]        = "Kun rapport";
-$vocab["summary_only"]       = "Opsummering";
-$vocab["report_and_summary"] = "Rapport og opsummering";
-$vocab["summarize_by"]       = "Opsummering efter:";
-$vocab["sum_by_descrip"]     = "Kort beskrivelse";
-$vocab["sum_by_creator"]     = "Hvem der har booket";
-$vocab["entry_found"]        = "post fundet";
-$vocab["entries_found"]      = "poster fundet";
-$vocab["summary_header"]     = "Sum timer";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Total";
-$vocab["submitquery"]        = "K�r rapport";
-$vocab["sort_rep"]           = "Sort Report by:";
-$vocab["sort_rep_time"]      = "Start Date/Time";
-$vocab["rep_dsp"]            = "Display in report:";
-$vocab["rep_dsp_dur"]        = "Duration";
-$vocab["rep_dsp_end"]        = "End Time";
-
-# Used in week.php
-$vocab["weekbefore"]         = "G� til ugen f�
-$vocab["weekafter"]          = "G� til ugen efter";
-$vocab["gotothisweek"]       = "G� til denne uge";
-
-# Used in month.php
-$vocab["monthbefore"]        = "G� til forrige m�ned";
-$vocab["monthafter"]         = "G� til n�ste m�ned";
-$vocab["gotothismonth"]      = "G� til denne m�ned";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Ingen rum er defineret for dette omr�de";
-
-# Used in admin.php
-$vocab["edit"]               = "�ndre";
-$vocab["delete"]             = "Slet";
-$vocab["rooms"]              = "Rum";
-$vocab["in"]                 = "i";
-$vocab["noareas"]            = "Ingen omr�der";
-$vocab["addarea"]            = "Tilf�j omr�de";
-$vocab["name"]               = "Navn";
-$vocab["noarea"]             = "Omr�de ikke valgt";
-$vocab["browserlang"]        = "Din browser er indstillet til at bruge f�lgende sprog:";
-$vocab["postbrowserlang"]    = "";
-$vocab["addroom"]            = "Tilf�j rom";
-$vocab["capacity"]           = "Kapacitet";
-$vocab["norooms"]            = "Ingen rum.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "�ndre omr�de";
-$vocab["change"]             = "�ndre";
-$vocab["backadmin"]          = "Tilbage til admin";
-$vocab["editroomarea"]       = "�ndre omr�de- eller rumbeskrivelse";
-$vocab["editroom"]           = "�ndre rom";
-$vocab["update_room_failed"] = "Updater rum fejlet: ";
-$vocab["error_room"]         = "Fejl: rum ";
-$vocab["not_found"]          = " ikke fundet";
-$vocab["update_area_failed"] = "Opdater omr�de fejlet: ";
-$vocab["error_area"]         = "Fejl: omr�de ";
-$vocab["room_admin_email"]   = "Room admin email:";
-$vocab["area_admin_email"]   = "Area admin email:";
-$vocab["invalid_email"]      = "Invalid email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Dette vil slette f�lgende bookninger";
-$vocab["sure"]               = "Er du sikker?";
-$vocab["YES"]                = "JA";
-$vocab["NO"]                 = "NEJ";
-$vocab["delarea"]            = "Du skal fjerne alle rum i dette omr�de f�r du kan slette det<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "Om MRBS";
-$vocab["database"]           = "Database: ";
-$vocab["system"]             = "System: ";
-$vocab["please_contact"]     = "Kontakt ";
-$vocab["for_any_questions"]  = "for sp�rgsm�l der ikke er besvaret her.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fatal Error: Failed to connect to database";
-
-?>
Index: web/config.inc.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/config.inc.php,v
retrieving revision 1.39.2.12
diff -u -r1.39.2.12 config.inc.php
--- web/config.inc.php	13 Feb 2007 12:53:23 -0000	1.39.2.12
+++ web/config.inc.php	2 Aug 2008 04:39:18 -0000
@@ -8,38 +8,41 @@
 #   You shouldn't have to modify anything outside this file.
 ###########################################################################
 
+//For integration with Moodle
+require_once("../../../config.php");
+$cfg_mrbs = get_config('block/mrbs');
 ###################
 # Database settings
 ###################
-# Which database system: "pgsql"=PostgreSQL, "mysql"=MySQL,
-# "mysqli"=MySQL via the mysqli PHP extension
-$dbsys = "mysql";
+# Which database system: "pgsql"=PostgreSQL, "mysql"=MySQL, "mysqli"=MySQL via the mysqli PHP extension
+$dbsys = $CFG->dbtype; //"mysql"
 # Hostname of database server. For pgsql, can use "" instead of localhost
 # to use Unix Domain Sockets instead of TCP/IP.
-$db_host = "localhost";
+$db_host = $CFG->dbhost; //"localhost";
 # Database name:
-$db_database = "mrbs";
+$db_database = $CFG->dbname; //"mrbs";
 # Database login user name:
-$db_login = "mrbs";
+$db_login = $CFG->dbuser; // "mrbs";
 # Database login password:
-$db_password = 'mrbs-password';
+$db_password = $CFG->dbpass; //'mrbs-password';
 # Prefix for table names.  This will allow multiple installations where only
 # one database is available
-$db_tbl_prefix = "mrbs_";
+$db_tbl_prefix = $CFG->prefix.'mrbs_';
 # Uncomment this to NOT use PHP persistent (pooled) database connections:
 # $db_nopersist = 1;
 
 ################################
 # Site identification information
 #################################
-$mrbs_admin = "Your Administrator";
-$mrbs_admin_email = "admin_email@your.org";
+$mrbs_admin = $cfg_mrbs->block_mrbs_admin;  //moodle username of the mrbs administrator
+$mrbs_admin_email = $cfg_mrbs->block_mrbs_admin_email; // "admin@MyMoodleSite.com";
 
 # This is the text displayed in the upper left corner of every page. Either
 # type the name of your organization, or you can put your logo like this :
 # $mrbs_company = "<a href=http://www.your_organisation.com/>
 # <img src=your_logo.gif border=0></a>";
-$mrbs_company = "Your Company";
+$mrbs_company = $SITE->fullname;
+$mrbs_company_url = $CFG->wwwroot;
 
 # This is to fix URL problems when using a proxy in the environment.
 # If links inside MRBS appear broken, then specify here the URL of
@@ -48,7 +51,7 @@
 # It is also recommended that you set this if you intend to use email
 # notifications, to ensure that the correct URL is displayed in the
 # notification.
-$url_base = "";
+$url_base = $cfg_mrbs->block_mrbs_serverpath;
 
 
 ###################
@@ -61,16 +64,17 @@
 # the default) or user defined periods (TRUE).  If user-defined periods
 # are used then $resolution, $morningstarts, $eveningends,
 # $eveningends_minutes and $twentyfourhour_format are ignored.
-$enable_periods = FALSE;
+$enable_periods = $cfg_mrbs->block_mrbs_enable_periods;
 
+if ($enable_periods == 0) { //if we are not using periods then set the following values, prevents error of unset variables
 # Resolution - what blocks can be booked, in seconds.
 # Default is half an hour: 1800 seconds.
-$resolution = 1800;
+    $resolution = $cfg_mrbs->block_mrbs_resolution;
 
 # Start and end of day, NOTE: These are integer hours only, 0-23, and
 # morningstarts must be < eveningends. See also eveningends_minutes.
-$morningstarts = 7;
-$eveningends   = 19;
+    $morningstarts = $cfg_mrbs->block_mrbs_morningstarts;
+    $eveningends   =$cfg_mrbs->block_mrbs_eveningends;
 
 # Minutes to add to $morningstarts to get to the real start of the day.
 # Be sure to consider the value of $eveningends_minutes if you change
@@ -79,14 +83,15 @@
 # morningstarts = 8 and morningstarts_minutes = 30 then for the last
 # period to start at say 4:30pm you would need to set eveningends = 16
 # and eveningends_minutes = 30
-$morningstarts_minutes = 0;
+    $morningstarts_minutes = $cfg_mrbs->block_mrbs_morningstarts_min;
 
 # Minutes to add to $eveningends hours to get the real end of the day.
 # Examples: To get the last slot on the calendar to be 16:30-17:00, set
 # eveningends=16 and eveningends_minutes=30. To get a full 24 hour display
 # with 15-minute steps, set morningstarts=0; eveningends=23;
 # eveningends_minutes=45; and resolution=900.
-$eveningends_minutes = 0;
+    $eveningends_minutes = $cfg_mrbs->block_mrbs_eveningends_min;
+}
 
 # Define the name or description for your periods in chronological order
 # For example:
@@ -101,18 +106,39 @@
 # when the browser determines the column widths to use in day and week
 # views
 
+// Moodle HACK
+
+if(!isset($cfg_mrbs->block_mrbs_periods) or empty($cfg_mrbs->block_mrbs_periods)) {
 $periods[] = "Period&nbsp;1";
 $periods[] = "Period&nbsp;2";
+    $periods[] = "Period&nbsp;3";
+    $periods[] = "Period&nbsp;4";
+    $periods[] = "Period&nbsp;5";
+    $periods[] = "Period&nbsp;6";
+    $periods[] = "Period&nbsp;7";
+    $periods[] = "Period&nbsp;8";
+    $periods[] = "Period&nbsp;9";
+    $periods[] = "Period&nbsp;10";
+    $periods[] = "Period&nbsp;11";
+    $periods[] = "Period&nbsp;12";
+}
+else {
+    $pds = explode("\n", $cfg_mrbs->block_mrbs_periods);
+    foreach ($pds as $pd) {
+        $pd = trim($pd);
+        $periods[] = $pd;
+    }
+}
 
 # Start of week: 0 for Sunday, 1 for Monday, etc.
-$weekstarts = 0;
+$weekstarts = $cfg_mrbs->block_mrbs_weekstarts;
 
 # Trailer date format: 0 to show dates as "Jul 10", 1 for "10 Jul"
-$dateformat = 0;
+$dateformat = $cfg_mrbs->block_mrbs_dateformat;
 
 # Time format in pages. 0 to show dates in 12 hour format, 1 to show them
 # in 24 hour format
-$twentyfourhour_format = 1;
+$twentyfourhour_format = $cfg_mrbs->block_mrbs_timeformat;
 
 ########################
 # Miscellaneous settings
@@ -140,7 +166,7 @@
 # of 12.
 $monthly_view_entries_details = "both";
 
-# To view weeks in the bottom (trailer.inc) as week numbers (42) instead of
+# To view weeks in the bottom (trailer.php) as week numbers (42) instead of
 # 'first day of the week' (13 Oct), set this to TRUE
 $view_week_number = FALSE;
 
@@ -168,9 +194,10 @@
 # Authentication settings - read AUTHENTICATION
 ###############################################
 $auth["session"] = "php"; # How to get and keep the user ID. One of
-			  # "http" "php" "cookie" "ip" "host" "nt" "omni"
+			  # "http" "php" "cookie" "ip" "host" "nt" "omni".
 			  # "remote_user"
-$auth["type"] = "config"; # How to validate the user/password. One of "none"
+$auth["type"] = "moodle";
+#$auth["type"] = "db_ext"; # How to validate the user/password. One of "none"
                           # "config" "db" "db_ext" "pop3" "imap" "ldap" "nis"
                           # "nw" "ext".
 
@@ -180,8 +207,8 @@
 $cookie_path_override = '';
 
 # The list of administrators (can modify other peoples settings)
-$auth["admin"][] = "127.0.0.1";	# localhost IP address. Useful with IP sessions.
-$auth["admin"][] = "administrator";	# A user name from the user list. Useful 
+#$auth["admin"][] = "127.0.0.1";	# localhost IP address. Useful with IP sessions.
+#$auth["admin"][] = "aborrow";	# A user name from the user list. Useful
                                     #with most other session schemes.
 #$auth["admin"][] = "10.0.0.1";
 #$auth["admin"][] = "10.0.0.2";
@@ -189,9 +216,9 @@
 
 # 'auth_config' user database
 # Format: $auth["user"]["name"] = "password";
-$auth["user"]["administrator"] = "secret";
-$auth["user"]["alice"] = "a";
-$auth["user"]["bob"] = "b";
+#$auth["user"]["administrator"] = "secret";
+#$auth["user"]["alice"] = "a";
+#$auth["user"]["bob"] = "b";
 
 # 'session_http' configuration settings
 $auth["realm"]  = "mrbs";
@@ -205,11 +232,11 @@
 
 # 'auth_db_ext' configuration settings
 $auth['db_ext']['db_host'] = 'localhost';
-$auth['db_ext']['db_username'] = 'authuser';
-$auth['db_ext']['db_password'] = 'authpass';
-$auth['db_ext']['db_name'] = 'authdb';
-$auth['db_ext']['db_table'] = 'users';
-$auth['db_ext']['column_name_username'] = 'name';
+$auth['db_ext']['db_username'] = ''; // 'authuser';
+$auth['db_ext']['db_password'] = ''; //'authpass';
+$auth['db_ext']['db_name'] = ''; //'authdb';
+$auth['db_ext']['db_table'] = $CFG->prefix.'user'; // 'users';
+$auth['db_ext']['column_name_username'] = 'username'; //'name';
 $auth['db_ext']['column_name_password'] = 'password';
 # Either 'md5', 'sha1', 'crypt' or 'plaintext'
 $auth['db_ext']['password_format'] = 'md5';
@@ -376,19 +403,20 @@
 # Set this to 1 to use UTF-8 in all pages and in the database, otherwise
 # text gets entered in the database in different encodings, dependent
 # on the users' language
-$unicode_encoding = 1;
+$unicode_encoding = 1; //this should not be an option in Moodle
 
 # Set this to a different language specifier to default to different
 # language tokens. This must equate to a lang.* file in MRBS.
 # e.g. use "fr" to use the translations in "lang.fr" as the default
 # translations
-$default_language_tokens = "en";
+$default_language_tokens = substr($USER->lang,0,2); //this could be either set to use the user default (or the site default)
+// echo $default_language_tokens;
 
 # Set this to 1 to disable the automatic language changing MRBS performs
 # based on the user's browser language settings. It will ensure that
 # the language displayed is always the value of $default_language_tokens,
 # as specified above
-$disable_automatic_language_changing = 0;
+$disable_automatic_language_changing = 1;
 
 # Set this to a valid locale (for the OS you run the MRBS server on)
 # if you want to override the automatic locale determination MRBS
@@ -403,7 +431,7 @@
 
 # This next require must be done after the definitions above, as the definitions
 # are used in the included file
-require_once "language.inc";
+require_once "language.php";
 
 #############
 # Entry Types
@@ -423,11 +451,11 @@
 # $typel["B"] = "B";
 # $typel["C"] = "C";
 # $typel["D"] = "D";
-$typel["E"] = get_vocab("external");
+$typel["E"] = get_string('external','block_mrbs');
 # $typel["F"] = "F";
 # $typel["G"] = "G";
 # $typel["H"] = "H";
-$typel["I"] = get_vocab("internal");
+$typel["I"] = get_string('internal','block_mrbs');
 # $typel["J"] = "J";
 
 ##########################################
Index: web/lang.fr
===================================================================
RCS file: web/lang.fr
diff -N web/lang.fr
--- web/lang.fr	28 Jul 2004 10:01:13 -0000	1.23
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.fr,v 1.23 2004/07/28 10:01:13 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a French file.
-#
-# Translations provided by: Thierry Wehr, thierry_bo
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Syst�me de R�servation de Ressources";
-
-# Used in functions.inc
-$vocab["report"]             = "Rapport";
-$vocab["admin"]              = "Gestion";
-$vocab["help"]               = "Aide";
-$vocab["search"]             = "Recherche:";
-$vocab["not_php3"]             = "<H1>ATTENTION: Cette application peut ne pas fonctionner correctement avec PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "R�servation pour<br>";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Lieux";
-$vocab["daybefore"]          = "Aller au jour pr�c�dent";
-$vocab["dayafter"]           = "Aller au jour suivant";
-$vocab["gototoday"]          = "Aujourd'hui";
-$vocab["goto"]               = " Afficher";
-$vocab["highlight_line"]     = "Surligner cette ligne";
-$vocab["click_to_reserve"]   = "Cliquer sur la case pour r�server.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Voir la journ�e";
-$vocab["viewweek"]           = "Voir la semaine";
-$vocab["viewmonth"]          = "Voir le mois";
-$vocab["ppreview"]           = "Format imprimable";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Ajouter une r�servation";
-$vocab["editentry"]          = "Editer une r�servation";
-$vocab["editseries"]         = "Editer une p�riodicit�";
-$vocab["namebooker"]         = "Br�ve description :";
-$vocab["fulldescription"]    = "Description compl�te:<br>&nbsp;&nbsp;(Nombre de personnes,<br>&nbsp;&nbsp;Interne/Externe etc)";
-$vocab["date"]               = "Date :";
-$vocab["start_date"]         = "Date de d�but :";
-$vocab["end_date"]           = "Date de fin :";
-$vocab["time"]               = "Heure :";
-$vocab["period"]             = "P�riode:";
-$vocab["duration"]           = "Dur�e :";
-$vocab["seconds"]            = "secondes";
-$vocab["minutes"]            = "minutes";
-$vocab["hours"]              = "heures";
-$vocab["days"]               = "jours";
-$vocab["weeks"]              = "semaines";
-$vocab["years"]              = "ann�es";
-$vocab["periods"]            = "periodes";
-$vocab["all_day"]            = "Journ�e enti�re";
-$vocab["type"]               = "Type :";
-$vocab["internal"]           = "Interne";
-$vocab["external"]           = "Externe";
-$vocab["save"]               = "Enregistrer";
-$vocab["rep_type"]           = "Type de p�riodicit� :";
-$vocab["rep_type_0"]         = "Aucune";
-$vocab["rep_type_1"]         = "Jour";
-$vocab["rep_type_2"]         = "Semaine";
-$vocab["rep_type_3"]         = "Mois";
-$vocab["rep_type_4"]         = "Ann�e";
-$vocab["rep_type_5"]         = "Mois, m�me jour semaine";
-$vocab["rep_type_6"]         = "tous les n semaines";
-$vocab["rep_end_date"]       = "Date de fin de p�riodicit� :";
-$vocab["rep_rep_day"]        = "Jour :";
-$vocab["rep_for_weekly"]     = "(pour n-semaines)";
-$vocab["rep_freq"]           = "Fr�quence :";
-$vocab["rep_num_weeks"]      = "Intervalle de semaines";
-$vocab["rep_for_nweekly"]    = "(pour n-semaines)";
-$vocab["ctrl_click"]         = "CTRL + clic souris pour s�lectionner plusieurs salles";
-$vocab["entryid"]            = "R�servation N� ";
-$vocab["repeat_id"]          = "p�riodicit� N� ";
-$vocab["you_have_not_entered"] = "Vous n'avez pas saisi";
-$vocab["you_have_not_selected"] = "Vous n'avez pas s�lectionn�";
-$vocab["valid_room"]         = "salle.";
-$vocab["valid_time_of_day"]  = "une heure valide.";
-$vocab["brief_description"]  = "la description br�ve.";
-$vocab["useful_n-weekly_value"] = "un intervalle de semaines valide.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Description :";
-$vocab["room"]               = "Salle ";
-$vocab["createdby"]          = "Cr��e par :";
-$vocab["lastupdate"]         = "Derni�re mise � jour :";
-$vocab["deleteentry"]        = "Effacer une r�servation";
-$vocab["deleteseries"]       = "Effacer une p�riodicit�";
-$vocab["confirmdel"]         = "Etes-vous s�r\\nde vouloir effacer\\ncette r�servation ?\\n\\n";
-$vocab["returnprev"]         = "Retour � la page pr�c�dente";
-$vocab["invalid_entry_id"]   = "N� de r�servation non valide";
-$vocab["invalid_series_id"]  = "Invalid series id.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Erreur";
-$vocab["sched_conflict"]     = "Conflit entre r�servations ";
-$vocab["conflict"]           = "La nouvelle r�servation entre en conflit avec la(les) r�servation(s) suivante(s) :";
-$vocab["too_may_entrys"]     = "Les options choisies cr�erons trop de r�servations.<BR>Choisissez des options diff�rentes !";
-$vocab["returncal"]          = "Retour au calendrier";
-$vocab["failed_to_acquire"]  = "Erreur, impossible d'obtenir l'acc�s exclusif � la base de donn�es"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Acc�s refus�";
-$vocab["norights"]           = "Vous n'avez pas les droits suffisants pour faire une modification.";
-$vocab["please_login"]       = "Veuillez vous identifier";
-$vocab["user_name"]          = "Nom";
-$vocab["user_password"]      = "Mot de passe";
-$vocab["unknown_user"]       = "Utilisateur non identifi�";
-$vocab["you_are"]            = "Vous �tes";
-$vocab["login"]              = "S'identifier";
-$vocab["logoff"]             = "Se d�connecter";
-
-# Authentication database
-$vocab["user_list"]          = "Liste des utilisateurs";
-$vocab["edit_user"]          = "Modification de l'utilisateur";
-$vocab["delete_user"]        = "Supprimer cet utilisateur";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Adresse m�l";
-$vocab["password_twice"]     = "Pour changer le mot de passe, tapez le nouveau mot de passe ici deux fois";
-$vocab["passwords_not_eq"]   = "Erreur: Les mots de passe ne sont pas identiques.";
-$vocab["add_new_user"]       = "Ajouter un nouvel utilisateur";
-$vocab["rights"]             = "Droits";
-$vocab["action"]             = "Action";
-$vocab["user"]               = "Utilisateur";
-$vocab["administrator"]      = "Administrateur";
-$vocab["unknown"]            = "Inconnu";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Afficher mes r�servations � venir";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Recherche non valide.";
-$vocab["search_results"]     = "R�sultats de la recherche pour :";
-$vocab["nothing_found"]      = "Aucune r�servation n'a �t� trouv�e.";
-$vocab["records"]            = "Enregistrements ";
-$vocab["through"]            = " � ";
-$vocab["of"]                 = " sur ";
-$vocab["previous"]           = "Pr�c�dent";
-$vocab["next"]               = "Suivant";
-$vocab["entry"]              = "R�servation";
-$vocab["view"]               = "Voir";
-$vocab["advanced_search"]    = "Recherche avanc�e"; 
-$vocab["search_button"]      = "Recherche"; 
-$vocab["search_for"]         = "Rechercher"; 
-$vocab["from"]               = "A partir de"; 
-
-# Used in report.php
-$vocab["report_on"]          = "Rapport des r�servations :";
-$vocab["report_start"]       = "Date de d�but du rapport :";
-$vocab["report_end"]         = "Date de fin du rapport :";
-$vocab["match_area"]         = "Lieu :";
-$vocab["match_room"]         = "Salle :";
-$vocab["match_type"]         = "Type :";
-$vocab["ctrl_click_type"]    = "CTRL + clic souris pour s�lectionner plusieurs types";
-$vocab["match_entry"]        = "Br�ve description :";
-$vocab["match_descr"]        = "Description compl�te :";
-$vocab["include"]            = "Inclure :";
-$vocab["report_only"]        = "le rappport seulement";
-$vocab["summary_only"]       = "le r�sum� seulement";
-$vocab["report_and_summary"] = "le rapport et le r�sum�";
-$vocab["summarize_by"]       = "R�sum� par :";
-$vocab["sum_by_descrip"]     = "Br�ve description";
-$vocab["sum_by_creator"]     = "Cr�ateur";
-$vocab["entry_found"]        = "r�servation trouv�e";
-$vocab["entries_found"]      = "r�servations trouv�es";
-$vocab["summary_header"]     = "D�compte des Heures R�serv�es";
-$vocab["summary_header_per"] = "D�compte des P�riodes R�serv�es";
-$vocab["total"]              = "Total";
-$vocab["submitquery"]        = "Afficher le rapport";
-$vocab["sort_rep"]           = "Trier par :";
-$vocab["sort_rep_time"]      = "Date/Heure";
-$vocab["rep_dsp"]            = "Afficher :";
-$vocab["rep_dsp_dur"]        = "la dur�e";
-$vocab["rep_dsp_end"]        = "l'heure de fin";
-
-# Used in week.php
-$vocab["weekbefore"]         = "Voir la semaine pr�c�dente";
-$vocab["weekafter"]          = "Voir la semaine suivante";
-$vocab["gotothisweek"]       = "Voir cette semaine-ci";
-
-# Used in month.php
-$vocab["monthbefore"]        = "Voir le mois pr�c�dent";
-$vocab["monthafter"]         = "Voir le mois suivant";
-$vocab["gotothismonth"]      = "Voir ce mois-ci";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Aucune salle n'est d�finie pour ce lieu";
-
-# Used in admin.php
-$vocab["edit"]               = "Modifier";
-$vocab["delete"]             = "Supprimer";
-$vocab["rooms"]              = "Salles";
-$vocab["in"]                 = "de :";
-$vocab["noareas"]            = "Pas de lieux";
-$vocab["addarea"]            = "Ajouter un lieu";
-$vocab["name"]               = "Nom";
-$vocab["noarea"]             = "S�lectionnez d'abord un lieu";
-$vocab["browserlang"]        = "Votre navigateur est configur� pour utiliser la langue";
-$vocab["postbrowserlang"]    = ".";
-$vocab["addroom"]            = "Ajouter une salle";
-$vocab["capacity"]           = "Maximum de personnes";
-$vocab["norooms"]            = "Aucune salle n'est cr��e pour ce lieu.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Modifier le lieu";
-$vocab["change"]             = "Changer";
-$vocab["backadmin"]          = "Revenir � l'�cran de gestion";
-$vocab["editroomarea"]       = "Modifiez la description d'un lieu ou d'une salle";
-$vocab["editroom"]           = "Modifier la salle";
-$vocab["update_room_failed"] = "La mise � jour de la salle a �chou�: ";
-$vocab["error_room"]         = "Erreur: salle ";
-$vocab["not_found"]          = " non trouv�e";
-$vocab["update_area_failed"] = "La mise � jour du lieu a �chou�: ";
-$vocab["error_area"]         = "Erreur: lieu ";
-$vocab["room_admin_email"]   = "Emails des responsables:";
-$vocab["area_admin_email"]   = "Emails des responsables:";
-$vocab["invalid_email"]      = "Adresse email non valide !";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Vous allez supprimer les r�servations suivantes";
-$vocab["sure"]               = "Etes-vous certains ?";
-$vocab["YES"]                = "OUI";
-$vocab["NO"]                 = "NON";
-$vocab["delarea"]            = "Vous devez supprimer toutes les salles de ce lieu avant de pouvoir le supprimer<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "A propos de MRBS (Meeting Room Booking System)";
-$vocab["database"]           = "Base de donn�e: ";
-$vocab["system"]             = "Syst�me d'exploitation: ";
-$vocab["please_contact"]     = "Contactez ";
-$vocab["for_any_questions"]  = "si vous avez une question qui n'est pas trait�e ici.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Erreur grave: Echec de la connexion � la base de donn�es";
-
-?>
Index: web/session_http.inc
===================================================================
RCS file: web/session_http.inc
diff -N web/session_http.inc
--- web/session_http.inc	20 Aug 2005 18:49:50 -0000	1.1.4.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,122 +0,0 @@
-<?php 
-/*****************************************************************************\
-*                                                                             *
-*   File name       auth_http.inc                                             *
-*                                                                             *
-*   Description     Get user identity using the HTTP basic authentication.    *
-*                                                                             *
-*   Notes           To use this session scheme, set in config.inc.php:        *
-*                       $auth["session"]  = "http";                           *
-*                                                                             *
-*   History                                                                   *
-*    2003/11/12 JFL Created this file                                         *
-*    Remaining history in ChangeLog and CVS logs                              *
-*                                                                             *
-\*****************************************************************************/
-
-// $Id: session_http.inc,v 1.1.4.2 2005/08/20 18:49:50 jberanek Exp $
-
-/* authGet()
- * 
- * Request the user name/password
- * 
- * Returns: Nothing
- */
-function authGet()
-{
-    global $auth;
-    header("WWW-Authenticate: Basic realm=\"$auth[realm]\"");
-    Header("HTTP/1.0 401 Unauthorized");
-}
-
-function getAuthPassword()
-{
-    global $PHP_AUTH_PW;
-
-    if (isset($PHP_AUTH_PW))
-    {
-        $pw = $PHP_AUTH_PW;
-        if (get_magic_quotes_gpc())
-        {
-            $pw = stripslashes($pw);
-        }
-        return $pw;
-    }
-    else
-    {
-        return null;
-    }
-}
-
-function getUserName()
-{
-    global $PHP_AUTH_USER;
-    if (isset($PHP_AUTH_USER))
-    {
-        $user = $PHP_AUTH_USER;
-        if (get_magic_quotes_gpc())
-        {
-            $user = stripslashes($user);
-        }
-
-        if (authValidateUser($user,getAuthPassword()))
-        {
-            return $user;
-        }
-        else
-        {
-            return null;
-        }
-    }
-    else
-    {
-        return null;
-    }
-}
-
-// Print the logon entry on the top banner.
-function PrintLogonBox()
-{
-	global $user_list_link;
-  
-	$user = getUserName();
-
-	if (isset($user))
-	{
-		// words 'you are xxxx' becomes a link to the
-        // report page with only entries created by xxx. Past entries are not
-        // displayed but this can be changed
-       	$search_string = "report.php?From_day=$day&From_month=$month&".
-          "From_year=$year&To_day=1&To_month=12&To_year=2030&areamatch=&".
-          "roommatch=&namematch=&descrmatch=&summarize=1&sortby=r&display=d&".
-          "sumby=d&creatormatch=$user"; ?>
-
-    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-      <A name="logonBox" href="<?php echo "$search_string\" title=\""
-         . get_vocab('show_my_entries') . "\">" . get_vocab('you_are')." "
-         .$user ?></A><br>
-<?php if (isset($user_list_link)) print "	  <br>\n	  " .
-	    "<A href='$user_list_link'>" . get_vocab('user_list') . "</A><br>\n" ;
-?>
-    </TD>
-<?php
-    }
-    else
-    {
-?>
-    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-       <A name="logonBox" href=""><?php echo get_vocab('unknown_user'); ?></A><br>
-          <FORM METHOD=POST ACTION="admin.php">
-	    <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
-	    <input type="hidden" name="Action" value="QueryName" />
-	    <input type="submit" value=" <?php echo get_vocab('login') ?> " />
-	  </FORM>
-<?php if (isset($user_list_link)) print "	  <br>\n	  " .
-	    "<A href=\"$user_list_link\">" . get_vocab('user_list') . "</A><br>\n" ;
-?>
-	</TD>
-<?php
-    }
-}
-
-?>
Index: web/edit_entry_handler.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/edit_entry_handler.php,v
retrieving revision 1.22.2.5
diff -u -r1.22.2.5 edit_entry_handler.php
--- web/edit_entry_handler.php	13 Feb 2007 12:53:27 -0000	1.22.2.5
+++ web/edit_entry_handler.php	2 Aug 2008 04:39:19 -0000
@@ -1,23 +1,34 @@
 <?php
 // $Id: edit_entry_handler.php,v 1.22.2.5 2007/02/13 12:53:27 jberanek Exp $
-
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
-include "mrbs_sql.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+include "mrbs_sql.php";
+
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$area = optional_param('area', get_default_area(),  PARAM_INT);
+$create_by = optional_param('create_by', '', PARAM_TEXT);
+$id = optional_param('id', 0, PARAM_INT);
+
+
+// $rooms - followup and see how this is passed -ab.
+// $edit_type  - followup and see how this is passed -ab.
 
 #If we dont know the right date then make it up 
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
     $day   = date("d");
     $month = date("m");
     $year  = date("Y");
 }
 
-if(empty($area))
-    $area = get_default_area();
+// if(empty($area)) // handled with optional_param above -ab.
+//     $area = get_default_area();
 
 if(!getAuthorised(1))
 {
@@ -33,10 +44,10 @@
 
 if ($name == '')
 {
-     print_header($day, $month, $year, $area);
+     print_header_mrbs($day, $month, $year, $area);
      ?>
-       <H1><?php echo get_vocab('invalid_booking'); ?></H1>
-       <?php echo get_vocab('must_set_description'); ?>
+       <H1><?php echo get_string('invalid_booking','block_mrbs'); ?></H1>
+       <?php echo get_string('must_set_description','block_mrbs'); ?>
    </BODY>
 </HTML>
 <?php
@@ -150,7 +161,7 @@
 
 # When checking for overlaps, for Edit (not New), ignore this entry and series:
 $repeat_id = 0;
-if (isset($id))
+if ($id>0)
 {
     $ignore_id = $id;
     $repeat_id = sql_query1("SELECT repeat_id FROM $tbl_entry WHERE id=$id");
@@ -162,7 +173,7 @@
 
 # Acquire mutex to lock out others trying to book the same slot(s).
 if (!sql_mutex_lock("$tbl_entry"))
-    fatal_error(1, get_vocab("failed_to_acquire"));
+    fatal_error(1, get_string('failed_to_acquire','block_mrbs'));
     
 # Check for any schedule conflicts in each room we're going to try and
 # book in
@@ -188,7 +199,7 @@
     }
     else
     {
-        $err        .= get_vocab("too_may_entrys") . "<P>";
+        $err        .= get_string('too_may_entrys','block_mrbs') . "<P>";
         $hide_title  = 1;
     }
   }
@@ -209,11 +220,11 @@
             if (MAIL_ADMIN_ON_BOOKINGS or MAIL_AREA_ADMIN_ON_BOOKINGS or
                 MAIL_ROOM_ADMIN_ON_BOOKINGS or MAIL_BOOKER)
             {
-                include_once "functions_mail.inc";
+                include_once "functions_mail.php";
                 // Send a mail only if this a new entry, or if this is an
                 // edited entry but we have to send mail on every change,
                 // and if mrbsCreateRepeatingEntrys is successful
-                if ( ( (isset($id) && MAIL_ADMIN_ALL) or !isset($id) ) && (0 != $new_id) )
+                if ( ( (($id>0) && MAIL_ADMIN_ALL) or ($id==0) ) && (0 != $new_id) )
                 {
                     // Get room name and area name. Would be better to avoid
                     // a database access just for that. Ran only if we need
@@ -230,11 +241,11 @@
                     }
                     // If this is a modified entry then call
                     // getPreviousEntryData to prepare entry comparison.
-                    if ( isset($id) )
+                    if ( $id>0 )
                     {
                         $mail_previous = getPreviousEntryData($id, 1);
                     }
-                    $result = notifyAdminOnBooking(!isset($id), $new_id);
+                    $result = notifyAdminOnBooking(($id==0), $new_id);
                 }
             }
         }
@@ -253,11 +264,11 @@
             if (MAIL_ADMIN_ON_BOOKINGS or MAIL_AREA_ADMIN_ON_BOOKINGS or
                 MAIL_ROOM_ADMIN_ON_BOOKINGS or MAIL_BOOKER)
             {
-                include_once "functions_mail.inc";
+                include_once "functions_mail.php";
                 // Send a mail only if this a new entry, or if this is an
                 // edited entry but we have to send mail on every change,
                 // and if mrbsCreateRepeatingEntrys is successful
-                if ( ( (isset($id) && MAIL_ADMIN_ALL) or !isset($id) ) && (0 != $new_id) )
+                if ( ( (($id>0) && MAIL_ADMIN_ALL) or ($id==0) ) && (0 != $new_id) )
                 {
                     // Get room name and are name. Would be better to avoid
                     // a database access just for that. Ran only if we need
@@ -274,18 +285,18 @@
                     }
                     // If this is a modified entry then call
                     // getPreviousEntryData to prepare entry comparison.
-                   if ( isset($id) )
+                   if ( $id>0 )
                     {
                         $mail_previous = getPreviousEntryData($id, 0);
                     }
-                    $result = notifyAdminOnBooking(!isset($id), $new_id);
+                    $result = notifyAdminOnBooking(($id==0), $new_id);
                 }
             }
         }
     } # end foreach $rooms
 
     # Delete the original entry
-    if(isset($id))
+    if($id>0)
         mrbsDelEntry(getUserName(), $id, ($edit_type == "series"), 1);
 
     sql_mutex_unlock("$tbl_entry");
@@ -302,12 +313,12 @@
 
 if(strlen($err))
 {
-    print_header($day, $month, $year, $area);
+    print_header_mrbs($day, $month, $year, $area);
     
-    echo "<H2>" . get_vocab("sched_conflict") . "</H2>";
+    echo "<H2>" . get_string('sched_conflict','block_mrbs') . "</H2>";
     if(!isset($hide_title))
     {
-        echo get_vocab("conflict");
+        echo get_string('conflict','block_mrbs');
         echo "<UL>";
     }
     
@@ -317,6 +328,7 @@
         echo "</UL>";
 }
 
-echo "<a href=\"$returl\">".get_vocab("returncal")."</a><p>";
+echo "<a href=\"$returl\">".get_string('returncal','block_mrbs')."</a><p>";
 
-include "trailer.inc"; ?>
\ No newline at end of file
+include "trailer.php"; 
+?>
\ No newline at end of file
Index: web/edit_users.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/edit_users.php,v
retrieving revision 1.9.2.3
diff -u -r1.9.2.3 edit_users.php
--- web/edit_users.php	2 Sep 2005 10:42:34 -0000	1.9.2.3
+++ web/edit_users.php	2 Aug 2008 04:39:19 -0000
@@ -21,12 +21,17 @@
 \*****************************************************************************/
 
 // $Id: edit_users.php,v 1.9.2.3 2005/09/02 10:42:34 jberanek Exp $
-
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+
+$Action = optional_param ('Action', '', PARAM_ALPHA);
+$Id = optional_param ('Id', 0, PARAM_INT);
+$password0 = optional_param('password0', '', PARAM_TEXT);
+$password1 = optional_param('password1', '', PARAM_TEXT);
 
 /*---------------------------------------------------------------------------*\
 |                     Create the users database if needed                     |
@@ -83,7 +88,7 @@
 
     $name = $field_name[$i];  // $name = "name", "password", ...
     // Search for indexes "user_name", "user_password", etc, in the localization array.
-    if (isset($vocab["user_".$name])) return get_vocab("user_".$name);
+    if (isset($vocab["user_".$name])) return get_string('user_'.$name,'block_mrbs');
     // If there is no entry (likely if user-defined fields have been added), return itself.
     return $name;
     }
@@ -136,15 +141,15 @@
         exit();
         }
 
-    print_header(0, 0, 0, 0);
+    print_header_mrbs(0, 0, 0, 0);
 
     if ($Action == "Edit")
     {
-        print "<h2>" . get_vocab("edit_user") . "</h2>\n";
+        print "<h2>" . get_string('edit_user','block_mrbs') . "</h2>\n";
     }
     else
     {
-        print "<h2>" . get_vocab("add_new_user") . "</h2>\n";
+        print "<h2>" . get_string('addnewuser') . "</h2>\n";
     }
 
     if (($Id >= 0) && ($level == 2)) /* Administrators get the right to delete users */
@@ -152,7 +157,7 @@
         print "<p><form method=post action=\"" . basename($PHP_SELF) . "\">\n";
         print "\t<input type=hidden name=Action value=Delete />\n";
         print "\t<input type=hidden name=Id value=$Id />\n";
-        print "\t<input style=\"margin:0\" type=submit value=\"" . get_vocab("delete_user") . "\" />\n";
+        print "\t<input style=\"margin:0\" type=submit value=\"" . get_string('delete_user','block_mrbs') . "\" />\n";
         print "</form></p>\n";
         }
 
@@ -181,25 +186,25 @@
         (!isset($invalid_email)) ? $invalid_email = '' : '' ;
         if ( ($field_name[$i] == "email") && (1 == $invalid_email) )
         {
-            print ("<td><STRONG>" . get_vocab('invalid_email') . "<STRONG></td>\n");
+            print ("<td><STRONG>" . get_string('emailmustbereal') . "<STRONG></td>\n");
         }
         print "    </tr>\n";
         }
     print "  </table>\n";
 
-    print " <br>" . get_vocab("password_twice") . "...<br><br>\n";
+    print " <br>" . get_string('password_twice','block_mrbs') . "...<br><br>\n";
     print "  <table>\n";
     for ($i=0; $i<2; $i++)
         {
         print "    <tr>\n";
-        print "      <td align=right valign=center>" . get_vocab("user_password") . "</td>\n";
+        print "      <td align=right valign=center>" . get_string('password') . "</td>\n";
         print "      <td><input type=password name=password$i value=\"\" /></td>\n";
         print "    </tr>\n";
         }
     print "  </table>\n";
 /*    print "  <input type=hidden name=Id value=\"$this_id\" /> <br />\n"; */
     print "  <input type=hidden name=Action value=Update /> <br />\n";
-    print "  <input type=submit value=\" " . get_vocab("ok") . " \" /> <br />\n";
+    print "  <input type=submit value=\" " . get_string('ok') . " \" /> <br />\n";
     print "</form>\n</body>\n</html>\n";
 
     exit();
@@ -214,12 +219,12 @@
     /* To do: Add JavaScript to verify passwords _before_ sending the form here */
     if ($password0 != $password1)
         {
-	print_header(0, 0, 0, "");
+	print_header_mrbs(0, 0, 0, "");
 
-        print get_vocab("passwords_not_eq") . "<br>\n";
+        print get_string('passwordsdiffer') . "<br>\n";
 
         print "<form method=post action=\"" . basename($PHP_SELF) . "\">\n";
-        print "  <input type=submit value=\" " . get_vocab("ok") . " \" /> <br />\n";
+        print "  <input type=submit value=\" " . get_string('ok') . " \" /> <br />\n";
         print "</form>\n</body>\n</html>\n";
 
         exit();
@@ -272,14 +277,14 @@
     $r = sql_command($operation);
     if ($r == -1)
     {
-	print_header(0, 0, 0, "");
+	print_header_mrbs(0, 0, 0, "");
 
 	// This is unlikely to happen in normal  operation. Do not translate.
         print "Error updating the $tbl_users table.<br>\n";
         print sql_error() . "<br>\n";
         
         print "<form method=post action=\"" . basename($PHP_SELF) . "\">\n";
-        print "  <input type=submit value=\" " . get_vocab("ok") . " \" /> <br />\n";
+        print "  <input type=submit value=\" " . get_string('ok') . " \" /> <br />\n";
         print "</form>\n</body>\n</html>\n";
 
         exit();
@@ -304,14 +309,14 @@
     $r = sql_command("delete from $tbl_users where id=$Id;");
     if ($r == -1)
         {
-	print_header(0, 0, 0, "");
+	print_header_mrbs(0, 0, 0, "");
 
 	// This is unlikely to happen in normal  operation. Do not translate.
         print "Error deleting entry $Id from the $tbl_users table.<br>\n";
         print sql_error() . "<br>\n";
         
         print "<form method=post action=\"" . basename($PHP_SELF) . "\">\n";
-        print "  <input type=submit value=\" " . get_vocab("ok") . " \" /> <br />\n";
+        print "  <input type=submit value=\" " . get_string('ok') . " \" /> <br />\n";
         print "</form>\n</body>\n</html>\n";
 
         exit();
@@ -326,14 +331,14 @@
 
 /* Print the standard MRBS header */
 
-print_header(0, 0, 0, "");
+print_header_mrbs(0, 0, 0, "");
 
-print "<h2>" . get_vocab("user_list") . "</h2>\n";
+print "<h2>" . get_string('userlist') . "</h2>\n";
 
 if ($initial_user_creation == 1)
 {
-    print "<h3>" . get_vocab("no_users_initial") . "</h3>\n";
-    print "<p>" . get_vocab("no_users_create_first_admin") . "</p>\n";
+    print "<h3>" . get_string('no_users_initial','block_mrbs') . "</h3>\n";
+    print "<p>" . get_string('no_users_create_first_admin','block_mrbs') . "</p>\n";
 }
 
 if ($level == 2) /* Administrators get the right to add new users */
@@ -341,7 +346,7 @@
     print "<p><form method=post action=\"" . basename($PHP_SELF) . "\">\n";
     print "\t<input type=hidden name=Action value=Add />\n";
     print "\t<input type=hidden name=Id value=\"-1\" />\n";
-    print "\t<input style=\"margin:0\" type=submit value=\"" . get_vocab("add_new_user") . "\" />\n";
+    print "\t<input style=\"margin:0\" type=submit value=\"" . get_string('addnewuser') . "\" />\n";
     print "</form></p>\n";
     }
 
@@ -349,10 +354,10 @@
 print "<table border=1>\n";
 print "<tr>";
 // The first 2 columns are the user rights and uaser name.
-print "<th>" . get_vocab("rights") . "</th><th>" . get_vocab("user_name") . "</th>";
+print "<th>" . get_string('rights','block_mrbs') . "</th><th>" . get_string('username') . "</th>";
 // The remaining columns are all the columns from the database, past the initial 3 (id, name, password).
 for ($i=3; $i<$nfields; $i++) print "<th>" . get_loc_field_name($i) . "</th>";
-print "<th>" . get_vocab("action") . "</th>";
+print "<th>" . get_string('action') . "</th>";
 print "</tr>\n";
 $i = 0; 
 while ($line = sql_row($list, $i++))
@@ -373,10 +378,10 @@
             $name = $col_value;
             switch (authGetUserLevel($name, $auth["admin"]))
                 {
-                case 1: $right = get_vocab("user"); break;
-                case 2: $right = get_vocab("administrator"); break; // MRBS admin
-                case 3: $right = get_vocab("administrator"); break; // Reserved for future user admin.
-                default: $right = get_vocab("unknown"); break;
+                case 1: $right = get_string('user'); break;
+                case 2: $right = get_string('administrator'); break; // MRBS admin
+                case 3: $right = get_string('administrator'); break; // Reserved for future user admin.
+                default: $right = get_string('unknown','block_mrbs'); break;
                 }
             print "\t\t<td>$right</td>\n";
             /* Fall through to display the name */
@@ -395,7 +400,7 @@
         print "\t\t    <form method=post action=\"" . basename($PHP_SELF) . "\">\n";
         print "\t\t\t<input type=hidden name=Action value=Edit />\n";
         print "\t\t\t<input type=hidden name=Id value=\"$this_id\" />\n";
-        print "\t\t\t<input style=\"margin:0\" type=submit value=\"" . get_vocab("edit") . "\" />\n";
+        print "\t\t\t<input style=\"margin:0\" type=submit value=\"" . get_string('savechanges') . "\" />\n";
         print "\t\t    </form>\n";
         }
     else
@@ -407,5 +412,5 @@
     }
 print "</table>\n";
 
-include "trailer.inc";
+include "trailer.php";
 ?>
\ No newline at end of file
Index: web/functions_mail.inc
===================================================================
RCS file: web/functions_mail.inc
diff -N web/functions_mail.inc
--- web/functions_mail.inc	26 Apr 2006 10:01:42 -0000	1.14.2.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,892 +0,0 @@
-<?php
-// +---------------------------------------------------------------------------+
-// | Meeting Room Booking System.                                              |
-// +---------------------------------------------------------------------------+
-// | Functions dedicated to emails handling.                                   |
-// |---------------------------------------------------------------------------+
-// | I keeped these functions in a separated file to avoid burden the main     |
-// | function.inc files if emails are not used.                                |
-// |                                                                           |
-// | USE : This file should be included in all files where emails functions    |
-// |        are likely to be used.                                             |
-// +---------------------------------------------------------------------------+
-// | @author    thierry_bo.                                                    |
-// | @version   $Revision: 1.14.2.6 $.                                              |
-// +---------------------------------------------------------------------------+
-//
-// $Id: functions_mail.inc,v 1.14.2.6 2006/04/26 10:01:42 jberanek Exp $
-
-// {{{ removeMailUnicode()
-
-/**
- * Convert already utf-8 encoded strings to charset defined for mails in
- * c.i.php.
- *
- * @param string    $string   string to convert
- * @return string   $string   string converted to $mail_vocab["charset"]
- */
-function removeMailUnicode($string)
-{
-    global $unicode_encoding, $mail_vocab;
-    //
-    if ($unicode_encoding)
-    {
-        return iconv("utf-8", $mail_vocab["charset"], $string);
-    }
-    else
-    {
-        return $string;
-    }
-}
-
-// }}}
-// {{{ getMailPeriodDateString()
-
-/**
- * Format a timestamp in non-unicode output (for emails).
- *
- * @param   timestamp   $t
- * @param   int         $mod_time
- * @return  array
- */
-function getMailPeriodDateString($t, $mod_time=0)
-{
-    global $periods;
-    //
-    $time = getdate($t);
-    $p_num = $time['minutes'] + $mod_time;
-    ( $p_num < 0 ) ? $p_num = 0 : '';
-    ( $p_num >= count($periods) - 1 ) ? $p_num = count($periods ) - 1 : '';
-    // I have made the separater a ',' as a '-' leads to an ambiguious
-    // display in report.php when showing end times.
-    return array($p_num, $periods[$p_num] . strftime(", %A %d %B %Y",$t));
-}
-
-// }}}
-// {{{ getMailTimeDateString()
-
-/**
- * Format a timestamp in non-unicode output (for emails).
- *
- * @param   timestamp   $t         timestamp to format
- * @param   boolean     $inc_time  include time in return string
- * @return  string                 formated string
- */
-function getMailTimeDateString($t, $inc_time=TRUE)
-{
-    global $twentyfourhour_format;
-    // This bit's necessary, because it seems %p in strftime format
-    // strings doesn't work
-    $ampm = date("a",$t);
-    if ($inc_time)
-    {
-        if ($twentyfourhour_format)
-        {
-            return strftime("%H:%M:%S - %A %d %B %Y",$t);
-        }
-        else
-        {
-            return strftime("%I:%M:%S$ampm - %A %d %B %Y",$t);
-        }
-    }
-    else
-    {
-        return strftime("%A %d %B %Y",$t);
-    }
-}
-
-// }}}
-// {{{ notifyAdminOnBooking()
-
-/**
- * Send email to administrator to notify a new/changed entry.
- *
- * @param bool    $new_entry    to know if this is a new entry or not
- * @param int     $new_id       used for create a link to the new entry
- * @return bool                 TRUE or PEAR error object if fails
- */
-function notifyAdminOnBooking($new_entry , $new_id)
-{
-    global $url_base, $returl, $mail_vocab, $name, $description, $area_name;
-    global $room_name, $starttime, $duration, $dur_units, $end_date, $endtime;
-    global $rep_enddate, $typel, $type, $create_by, $rep_type, $enable_periods;
-    global $rep_opt, $rep_num_weeks;
-    global $tbl_room, $tbl_area, $tbl_entry, $tbl_users, $tbl_repeat;
-    global $mail_previous, $auth;
-    
-    //
-    $recipients = '';
-    $id_table = ($rep_type > 0) ? "rep" : "e";
-    (MAIL_ADMIN_ON_BOOKINGS) ? $recipients = MAIL_RECIPIENTS : '';
-    if (MAIL_AREA_ADMIN_ON_BOOKINGS)
-    {
-        // Look for list of area admins emails addresses
-        if ($new_entry)
-        {
-            $sql = "SELECT a.area_admin_email ";
-            $sql .= "FROM $tbl_room r, $tbl_area a, $tbl_entry e ";
-            // If this is a repeating entry...
-            if ($id_table == 'rep')
-            {
-                // ...use the repeat table
-                $sql .= ", $tbl_repeat rep ";
-            }
-            $sql .= "WHERE ${id_table}.id=$new_id AND r.id=${id_table}.room_id AND a.id=r.area_id";
-            $res = sql_query($sql);
-            (! $res) ? fatal_error(0, sql_error()) : '';
-            $row = sql_row($res, 0);
-            if ( !empty($recipients) && (NULL != $row[0]) )
-            {
-                $recipients .= ',';
-            }
-            if (NULL != $row[0])
-            {
-                $recipients .= $row[0];
-            }
-        }
-        else
-        // if this is an edited entry, we already have area_admin_email,
-        // avoiding a database hit.
-        {
-           if ( !empty($recipients) && ('' != $mail_previous['area_admin_email']) )
-           {
-               $recipients .= ',';
-           }
-           if ('' != $mail_previous['area_admin_email'])
-           {
-               $recipients .= $mail_previous['area_admin_email'];
-           }
-        }
-    }
-    if (MAIL_ROOM_ADMIN_ON_BOOKINGS)
-    {
-        // Look for list of room admins emails addresses
-        if ($new_entry)
-        {
-            $sql = "SELECT r.room_admin_email ";
-            $sql .= "FROM $tbl_room r, $tbl_entry e ";
-            // If this is a repeating entry...
-            if ($id_table == 'rep')
-            {
-                // ...use the repeat table
-                $sql .= ", $tbl_repeat rep ";
-            }
-            $sql .= "WHERE ${id_table}.id=$new_id AND r.id=${id_table}.room_id";
-            $res = sql_query($sql);
-            (! $res) ? fatal_error(0, sql_error()) : '';
-            $row = sql_row($res, 0);
-            if ( !empty($recipients) && (NULL != $row[0]) )
-            {
-                $recipients .= ',';
-            }
-            if (NULL != $row[0])
-            {
-                $recipients .= $row[0];
-            }
-        }
-        else
-        // if this is an edited entry, we already have room_admin_email,
-        // avoiding a database hit.
-        {
-           if ( !empty($recipients) && ('' != $mail_previous['room_admin_email']) )
-           {
-               $recipients .= ',';
-           }
-           if ('' != $mail_previous['room_admin_email'])
-           {
-               $recipients .= $mail_previous['room_admin_email'];
-           }
-        }
-    }
-    if (MAIL_BOOKER)
-    {
-        if ('db' == $auth['type'])
-        {
-            /* It would be possible to move this query within the query in
-               getPreviousEntryData to have all in one central place and to
-               reduce database hits by one. However this is a bad idea. If a
-               user is deleted from your user database, this will prevent all
-               mails to admins when this user previously booked entries will
-               be changed, as no user name will match the booker name */
-            $sql = "SELECT email FROM $tbl_users WHERE name='";
-            $sql .= ($new_entry) ? $create_by : $mail_previous['createdby'];
-            $sql .= "'";
-            $res = sql_query($sql);
-            (! $res) ? fatal_error(0, sql_error()) : '';
-            $row = sql_row($res, 0);
-            if ( !empty($recipients) && (NULL != $row[0]) )
-            {
-                $recipients .= ',';
-            }
-            if (NULL != $row[0])
-            {
-                $recipients .= $row[0];
-            }
-        }
-        else
-        {
-            if ($new_entry)
-            {
-                if ( !empty($recipients) && ('' != $create_by) )
-                {
-                    $recipients .= ',';
-                }
-                if ('' != $create_by)
-                {
-                    $recipients .= str_replace(MAIL_USERNAME_SUFFIX, '',
-                        $create_by) . MAIL_DOMAIN;
-                }
-            }
-            else
-            {
-                if ( !empty($recipients) && ('' != $mail_previous['createdby']) )
-                {
-                    $recipients .= ',';
-                }
-                if ('' != $mail_previous['createdby'])
-                {
-                    $recipients .= str_replace(MAIL_USERNAME_SUFFIX, '',
-                        $mail_previous['createdby']) . MAIL_DOMAIN;
-                }
-            }
-        }
-    }
-    // In case $recipients is empty, no need to go further
-    if ('' == $recipients)
-    {
-        return FALSE;
-    }
-    //
-    $subject = $mail_vocab["mail_subject_entry"];
-    if ($new_entry)
-    {
-        $body = $mail_vocab["mail_body_new_entry"] . "\n\n";
-    }
-    else
-    {
-        $body = $mail_vocab["mail_body_changed_entry"] . "\n\n";
-    }
-    // Set the link to view entry page
-    if (isset($url_base) && ($url_base != ""))
-    {
-        $body .= "$url_base/view_entry.php?id=$new_id";
-    }
-    else
-    {
-        ('' != $returl) ? $url = explode(basename($returl), $returl) : '';
-        $body .= $url[0] . "view_entry.php?id=$new_id";
-    }
-    if ($rep_type > 0)
-    {
-        $body .= "&series=1";
-    }
-    $body .= "\n";
-    // Displays/don't displays entry details
-    if (MAIL_DETAILS)
-    {
-        $body .= "\n" . $mail_vocab["namebooker"] . " ";
-        $body .= compareEntries(removeMailUnicode($name),
-            removeMailUnicode($mail_previous['namebooker']), $new_entry)  . "\n";
-        
-        // Description:
-        $body .= $mail_vocab["description"] . " ";
-        $body .= compareEntries(removeMailUnicode($description),
-            removeMailUnicode($mail_previous['description']), $new_entry) . "\n";
-        
-        // Room:
-        $body .= $mail_vocab["room"] . ": " .
-            compareEntries(removeMailUnicode($area_name),
-            removeMailUnicode($mail_previous['area_name']), $new_entry);
-        $body .= " - " . compareEntries(removeMailUnicode($room_name),
-            removeMailUnicode($mail_previous['room_name']), $new_entry) . "\n";
-        
-        // Start time
-        if ( $enable_periods )
-        {
-            list( $start_period, $start_date) =
-                getMailPeriodDateString($starttime);
-            $body .= $mail_vocab["start_date"] . " ";
-            $body .= compareEntries(unHtmlEntities($start_date),
-                unHtmlEntities($mail_previous['start_date']), $new_entry) . "\n";
-        }
-        else
-        {
-            $start_date = getMailTimeDateString($starttime);
-            $body .= $mail_vocab["start_date"] . " " .
-                compareEntries($start_date, $mail_previous['start_date'], $new_entry) . "\n";
-        }
-        
-        // Duration
-        $body .= $mail_vocab["duration"] . " " .
-            compareEntries($duration, $mail_previous['duration'], $new_entry);
-        $body .= " " . compareEntries($mail_vocab["$dur_units"],
-            $mail_previous['dur_units'], $new_entry) . "\n";
-        
-        // End time
-        if ( $enable_periods )
-        {
-            $myendtime = $endtime;
-            $mod_time = -1;
-            list($end_period, $end_date) =  getMailPeriodDateString($myendtime, $mod_time);
-            $body .= $mail_vocab["end_date"] . " ";
-            $body .= compareEntries(unHtmlEntities($end_date),
-                unHtmlEntities($mail_previous['end_date']), $new_entry) ."\n";
-        }
-        else
-        {
-            $myendtime = $endtime;
-            $end_date = getMailTimeDateString($myendtime);
-            $body .= $mail_vocab["end_date"] . " " .
-                compareEntries($end_date, $mail_previous['end_date'], $new_entry) . "\n";
-        }
-        
-        // Type of booking
-        $body .= $mail_vocab["type"] . " ";
-        if ($new_entry)
-        {
-            $body .= $typel[$type];
-        }
-        else
-        {
-            $temp = $mail_previous['type'];
-            $body .= compareEntries($typel[$type], $typel[$temp], $new_entry);
-        }
-        
-        // Created by
-        $body .= "\n" . $mail_vocab["createdby"] . " " .
-            compareEntries($create_by, $mail_previous['createdby'], $new_entry) . "\n";
-        
-        // Last updated
-        $body .= $mail_vocab["lastupdate"] . " " .
-            compareEntries(getMailTimeDateString(time()), $mail_previous['updated'], $new_entry);
-        
-        // Repeat Type
-        $body .= "\n" . $mail_vocab["rep_type"];
-        if ($new_entry)
-        {
-            $body .= " " . $mail_vocab["rep_type_$rep_type"];
-        }
-        else
-        {
-            $temp = $mail_previous['rep_type'];
-            $body .=  " " . compareEntries($mail_vocab["rep_type_$rep_type"],
-                $mail_vocab["rep_type_$temp"], $new_entry);
-        }
-        
-        // Details if a series
-        if ($rep_type > 0)
-        {
-	    $opt = "";
-	    if (($rep_type == 2) || ($rep_type == 6))
-	    {
-		# Display day names according to language and preferred weekday start.
-		for ($i = 0; $i < 7; $i++)
-		{
-			$daynum = ($i + $weekstarts) % 7;
-			if ($rep_opt[$daynum]) $opt .= day_name($daynum) . " ";
-		}
-	    }
-	    if ($rep_type == 6)
-	    {
-		$body .= "\n" . $mail_vocab["rep_num_weeks"];
-		$body .=  ": " . compareEntries($rep_num_weeks, $mail_previous["rep_num_weeks"], $new_entry);
-	    }
-	
-	    if($opt || $mail_previous["rep_opt"])
-	    {
-		$body .= "\n" . $mail_vocab["rep_rep_day"];
-		$body .=  " " . compareEntries($opt, $mail_previous["rep_opt"], $new_entry);
-	    }
-
-            $body .= "\n" . $mail_vocab["rep_end_date"];
-            if ($new_entry)
-            {
-                $body .= " " . utf8_strftime('%A %d %B %Y',$rep_enddate);
-            }
-            else
-            {
-                $temp = utf8_strftime('%A %d %B %Y',$rep_enddate);
-                $body .=  " " . 
-                    compareEntries($temp, $mail_previous['rep_end_date'], $new_entry) . "\n";
-            }
-        }
-	$body .= "\n";
-    }
-    $result = sendMail($recipients, $subject, $body, $mail_vocab['charset'] ,MAIL_CC);
-    return $result;
-}
-
-// }}}
-// {{{ notifyAdminOnDelete()
-
-/**
- * Send email to administrator to notify a new/changed entry.
- *
- * @param   array   $mail_previous  contains deleted entry data forr email body
- * @return  bool    TRUE or PEAR error object if fails
- */
-function notifyAdminOnDelete($mail_previous)
-{
-    global $mail_vocab, $typel, $enable_periods, $auth, $tbl_users;
-    //
-    $recipients = '';
-    (MAIL_ADMIN_ON_BOOKINGS) ? $recipients = MAIL_RECIPIENTS : '';
-    if (MAIL_AREA_ADMIN_ON_BOOKINGS)
-    {
-        if ( !empty($recipients) && ('' != $mail_previous['area_admin_email']) )
-        {
-            $recipients .= ',';
-        }
-        if ('' != $mail_previous['area_admin_email'])
-        {
-            $recipients .= $mail_previous['area_admin_email'];
-        }
-    }
-    if (MAIL_ROOM_ADMIN_ON_BOOKINGS)
-    {
-        if ( !empty($recipients) && ('' != $mail_previous['room_admin_email']) )
-        {
-            $recipients .= ',';
-        }
-        if ('' != $mail_previous['room_admin_email'])
-        {
-            $recipients .= $mail_previous['room_admin_email'];
-        }
-    }
-    if (MAIL_BOOKER)
-    {
-        if ('db' == $auth['type'])
-        {
-            /* It would be possible to move this query within the query in
-               getPreviousEntryData to have all in one central place and to
-               reduce database hits by one. However this is a bad idea. If a
-               user is deleted from your user database, this will prevent all
-               mails to admins when this user previously booked entries will
-               be changed, as no user name will match the booker name */
-            $sql = "SELECT email
-                    FROM $tbl_users
-                    WHERE name='" . $mail_previous['createdby'] . "'";
-            $res = sql_query($sql);
-            (! $res) ? fatal_error(0, sql_error()) : '';
-            $row = sql_row($res, 0);
-            if ( !empty($recipients) && (NULL != $row[0]) )
-            {
-                $recipients .= ',';
-            }
-            if (NULL != $row[0])
-            {
-                $recipients .= $row[0];
-            }
-        }
-        else
-        {
-            if ( !empty($recipients) && ('' != $mail_previous['createdby']) )
-            {
-                $recipients .= ',';
-            }
-            if ('' != $mail_previous['createdby'])
-            {
-                $recipients .= str_replace(MAIL_USERNAME_SUFFIX, '',
-                    $mail_previous['createdby']) . MAIL_DOMAIN;
-            }
-        }
-    }
-    // In case mail is allowed but someone forgot to supply email addresses...
-    if ('' == $recipients)
-    {
-        return FALSE;
-    }
-    //
-    $subject = $mail_vocab["mail_subject_delete"];
-    $body = $mail_vocab["mail_body_del_entry"] . "\n\n";
-    // Displays deleted entry details
-    $body .= "\n" . $mail_vocab["namebooker"] . ' ';
-    $body .= removeMailUnicode($mail_previous['namebooker']) . "\n";
-    $body .= $mail_vocab["description"] . " ";
-    $body .= removeMailUnicode($mail_previous['description']) . "\n";
-    $body .= $mail_vocab["room"] . ": ";
-    $body .= removeMailUnicode($mail_previous['area_name']);
-    $body .= " - " . removeMailUnicode($mail_previous['room_name']) . "\n";
-    $body .= $mail_vocab["start_date"] . ' ';
-    if ( $enable_periods )
-    {
-        $body .= unHtmlEntities($mail_previous['start_date']) . "\n";
-    }
-    else
-    {
-        $body .= $mail_previous['start_date'] . "\n";
-    }
-    $body .= $mail_vocab["duration"] . ' ' . $mail_previous['duration'] . ' ';
-    $body .= $mail_previous['dur_units'] . "\n";
-    if ( $enable_periods )
-    {
-        $body .= $mail_vocab["end_date"] . " ";
-        $body .= unHtmlEntities($mail_previous['end_date']) ."\n";
-    }
-    else
-    {
-        $body .= $mail_vocab["end_date"] . " " . $mail_previous['end_date'];
-        $body .= "\n";
-    }
-    $body .= $mail_vocab["type"] . " ";
-    $body .=  (empty($typel[$mail_previous['type']])) ? "?" .
-        $mail_previous['type'] . "?" : $typel[$mail_previous['type']];
-    $body .= "\n" . $mail_vocab["createdby"] . " ";
-    $body .= $mail_previous['createdby'] . "\n";
-    $body .= $mail_vocab["lastupdate"] . " " . $mail_previous['updated'];
-    $body .= "\n" . $mail_vocab["rep_type"];
-    $temp = $mail_previous['rep_type'];
-    $body .=  " " . $mail_vocab["rep_type_$temp"];
-    if ($mail_previous['rep_type'] > 0)
-    {
-        if ($mail_previous['rep_type'] == 6)
-        {
-           $body .= "\n" . $mail_vocab["rep_num_weeks"];
-           $body .=  ": " . $mail_previous["rep_num_weeks"];
-        }
-   
-        if($mail_previous["rep_opt"])
-        {
-           $body .= "\n" . $mail_vocab["rep_rep_day"];
-           $body .=  " " . $mail_previous["rep_opt"];
-        }
-
-        $body .= "\n" . $mail_vocab["rep_end_date"];
-        $body .=  " " . $mail_previous['rep_end_date'] . "\n";
-    }
-    $body .= "\n";
-    // End of mail details
-    $result = sendMail($recipients, $subject, $body, $mail_vocab['charset'], MAIL_CC);
-    return $result;
-}
-
-// }}}
-// {{{ getPreviousEntryData()
-
-/**
- * Gather all fields values for an entry. Used for emails to get previous
- * entry state.
- *
- * @param int     $id       entry id to get data
- * @param int     $series   1 if this is a serie or 0
- * @return bool             TRUE or PEAR error object if fails
- */
-function getPreviousEntryData($id, $series)
-{
-    global $tbl_area, $tbl_entry, $tbl_repeat, $tbl_room, $enable_periods;
-    //
-    $sql = "
-    SELECT  e.name,
-            e.description,
-            e.create_by,
-            r.room_name,
-            a.area_name,
-            e.type,
-            e.room_id,
-            e.repeat_id, " .
-            sql_syntax_timestamp_to_unix("e.timestamp") . ",
-            (e.end_time - e.start_time) AS tbl_e_duration,
-            e.start_time AS tbl_e_start_time,
-            e.end_time AS tbl_e_end_time,
-            a.area_admin_email,
-            r.room_admin_email";
-    // Here we could just use $tbl_repeat.start_time, and not use alias,
-    // as the last column will take precedence using mysql_fetch_array,
-    // but for portability purpose I will not use it.
-    if (1 == $series)
-    {
-        $sql .= ", re.rep_type, re.rep_opt, re.rep_num_weeks,
-            (re.end_time - re.start_time) AS tbl_r_duration,
-            re.start_time AS tbl_r_start_time,
-            re.end_time AS tbl_r_end_time,
-            re.end_date AS tbl_r_end_date";
-    }
-    $sql .= "
-    FROM $tbl_entry e, $tbl_room r, $tbl_area a ";
-    (1 == $series) ? $sql .= ', ' . $tbl_repeat . ' re ' : '';
-    $sql .= "
-    WHERE e.room_id = r.id
-    AND r.area_id = a.id
-    AND e.id=$id";
-    (1 == $series) ? $sql .= " AND e.repeat_id = re.id" : '';
-    //
-    $res = sql_query($sql);
-    (! $res) ? fatal_error(0, sql_error()) : '';
-    (sql_count($res) < 1) ? fatal_error(0, get_vocab("invalid_entry_id")) : '';
-    $row = sql_row_keyed($res, 0);
-    sql_free($res);
-    // Store all needed values in $mail_previous array to pass to
-    // notifyAdminOnDelete function (shorter than individual variables -:) )
-    $mail_previous['namebooker']    = $row['name'];
-    $mail_previous['description']   = $row['description'];
-    $mail_previous['createdby']     = $row['create_by'];
-    $mail_previous['room_name']     = $row['room_name'];
-    $mail_previous['area_name']     = $row['area_name'];
-    $mail_previous['type']          = $row['type'];
-    $mail_previous['room_id']       = $row['room_id'];
-    $mail_previous['repeat_id']     = $row['repeat_id'];
-    $mail_previous['updated']       = getMailTimeDateString($row[8]);
-    $mail_previous['area_admin_email'] = $row['area_admin_email'];
-    $mail_previous['room_admin_email'] = $row['room_admin_email'];
-    // If we use periods
-    if ( $enable_periods )
-    {
-        // If we delete a serie, start_time and end_time must
-        // come from $tbl_repeat, not $tbl_entry.
-        //
-        // This is not a serie
-        if (1 != $series)
-        {
-            list( $mail_previous['start_period'], $mail_previous['start_date'])
-                =  getMailPeriodDateString($row['tbl_e_start_time']);
-            list( $mail_previous['end_period'] , $mail_previous['end_date']) =
-                getMailPeriodDateString($row['tbl_e_end_time'], -1);
-            // need to make DST correct in opposite direction to entry creation
-            // so that user see what he expects to see
-            $mail_previous['duration'] = $row['tbl_e_duration'] -
-                cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
-        }
-        // This is a serie
-        else
-        {
-            list( $mail_previous['start_period'], $mail_previous['start_date'])
-                =  getMailPeriodDateString($row['tbl_r_start_time']);
-            list( $mail_previous['end_period'] , $mail_previous['end_date']) =
-                getMailPeriodDateString($row['tbl_r_end_time'], 0);
-            // use getMailTimeDateString as all I want is the date
-	    $mail_previous['rep_end_date'] =
-                getMailTimeDateString($row['tbl_r_end_date'], FALSE);
-            // need to make DST correct in opposite direction to entry creation
-            // so that user see what he expects to see
-            $mail_previous['duration'] = $row['tbl_r_duration'] -
-                cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
-	    
-	    $mail_previous['rep_opt'] = "";
-	    switch($row['rep_type'])
-	    {
-		case 2:
-		case 6:
-			$rep_day[0] = $row['rep_opt'][0] != "0";
-			$rep_day[1] = $row['rep_opt'][1] != "0";
-			$rep_day[2] = $row['rep_opt'][2] != "0";
-			$rep_day[3] = $row['rep_opt'][3] != "0";
-			$rep_day[4] = $row['rep_opt'][4] != "0";
-			$rep_day[5] = $row['rep_opt'][5] != "0";
-			$rep_day[6] = $row['rep_opt'][6] != "0";
-
-			if ($row['rep_type'] == 6)
-			{
-				$mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
-			}
-			else
-			{
-				$mail_previous['rep_num_weeks'] = "";
-			}
-			
-			break;
-		
-		default:
-			$rep_day = array(0, 0, 0, 0, 0, 0, 0);
-	    }
-	    for ($i = 0; $i < 7; $i++)
-	    {
-		$wday = ($i + $weekstarts) % 7;
-		if ($rep_day[$wday])
-		    $mail_previous['rep_opt'] .= day_name($wday) . " ";
-	    }
-	    
-	    $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
-        }
-        toPeriodString($mail_previous['start_period'],
-            $mail_previous['duration'], $mail_previous['dur_units']);
-    }
-    // If we don't use periods
-    else
-    {
-        // This is not a serie
-        if (1 != $series)
-        {
-            $mail_previous['start_date'] =
-                getMailTimeDateString($row['tbl_e_start_time']);
-            $mail_previous['end_date'] =
-                getMailTimeDateString($row['tbl_e_end_time']);
-            // need to make DST correct in opposite direction to entry creation
-            // so that user see what he expects to see
-            $mail_previous['duration'] = $row['tbl_e_duration'] -
-                cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
-        }
-        // This is a serie
-        else
-        {
-            $mail_previous['start_date'] =
-                getMailTimeDateString($row['tbl_r_start_time']);
-            $mail_previous['end_date'] =
-                getMailTimeDateString($row['tbl_r_end_time']);
-            // use getMailTimeDateString as all I want is the date
-	    $mail_previous['rep_end_date'] =
-                getMailTimeDateString($row['tbl_r_end_date'], FALSE);
-            // need to make DST correct in opposite direction to entry creation
-            // so that user see what he expects to see
-            $mail_previous['duration'] = $row['tbl_r_duration'] -
-                cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
-            
-	    $mail_previous['rep_opt'] = "";
-	    switch($row['rep_type'])
-	    {
-		case 2:
-		case 6:
-			$rep_day[0] = $row['rep_opt'][0] != "0";
-			$rep_day[1] = $row['rep_opt'][1] != "0";
-			$rep_day[2] = $row['rep_opt'][2] != "0";
-			$rep_day[3] = $row['rep_opt'][3] != "0";
-			$rep_day[4] = $row['rep_opt'][4] != "0";
-			$rep_day[5] = $row['rep_opt'][5] != "0";
-			$rep_day[6] = $row['rep_opt'][6] != "0";
-
-			if ($row['rep_type'] == 6)
-			{
-				$mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
-			}
-			else
-			{
-				$mail_previous['rep_num_weeks'] = "";
-			}
-			
-			break;
-		
-		default:
-			$rep_day = array(0, 0, 0, 0, 0, 0, 0);
-	    }
-	    for ($i = 0; $i < 7; $i++)
-	    {
-		$wday = ($i + $weekstarts) % 7;
-		if ($rep_day[$wday])
-		    $mail_previous['rep_opt'] .= day_name($wday) . " ";
-	    }
-	    
-	    $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
-        }
-        toTimeString($mail_previous['duration'], $mail_previous['dur_units']);
-    }
-    (1 == $series) ? $mail_previous['rep_type'] = $row['rep_type']
-        : $mail_previous['rep_type'] = 0;
-    // return entry previous data as an array
-    return $mail_previous;
-}
-
-// }}}
-// {{{ compareEntries()
-
-/**
- * Compare entries fields to show in emails.
- *
- * @param string  $new_value       new field value
- * @param string  $previous_value  previous field value
- * @return string                  new value if no difference, new value and
- *                                 previous value in brackets otherwise
- */
-function compareEntries($new_value, $previous_value, $new_entry)
-{
-    $suffix = "";
-    if ($new_entry)
-    {
-        return $new_value;
-    }
-    if ($new_value != $previous_value)
-    {
-        $suffix = " ($previous_value)";
-    }
-    return($new_value . $suffix);
-}
-
-// }}}
-// {{{ sendMail()
-
-/**
- * Send emails using PEAR::Mail class.
- * How to use this class -> http://www.pear.php.net/package/Mail then link
- * "View documentation".
- * Currently implemented version: Mail 1.1.3 and its dependancies
- * Net_SMTP 1.2.6 and Net_Socket 1.0.2
- *
- * @param string  $recipients       comma separated list of recipients or array
- * @param string  $subject          email subject
- * @param string  $body             text message
- * @param string  $charset          character set used in body
- * @param string  $cc               Carbon Copy
- * @param string  $bcc              Blind Carbon Copy
- * @param string  $from             from field
- * @param string  $backend          'mail', 'smtp' or 'sendmail'
- * @param string  $sendmail_path    ie. "/usr/bin/sendmail"
- * @param string  $sendmail_args    ie. "-t -i"
- * @param string  $host             smtp server hostname
- * @param string  $port             smtp server port
- * @param string  $auth             smtp server authentication, TRUE/FALSE
- * @param string  $username         smtp server username
- * @param string  $password         smtp server password
- * @return bool                     TRUE or PEAR error object if fails
- */
-function sendMail($recipients, $subject, $body, $charset = 'us-ascii',
-    $cc = NULL, $bcc = NULL, $from = MAIL_FROM, $backend = MAIL_ADMIN_BACKEND,
-    $sendmail_path = SENDMAIL_PATH, $sendmail_args = SENDMAIL_ARGS,
-    $host = SMTP_HOST, $port = SMTP_PORT, $auth = SMTP_AUTH,
-    $username = SMTP_USERNAME, $password = SMTP_PASSWORD)
-{
-    require_once "Mail.php";
-
-    // Headers part
-    $headers['From']         = $from;
-    if( $backend != 'mail' ) {
-        $headers['To']           = $recipients;
-    }
-    (NULL != $cc) ? $headers['Cc'] = $cc : '';
-    (NULL != $bcc) ? $headers['Bcc'] = $bcc : '';
-    $headers['Subject']      = $subject;
-    $headers['MIME-Version'] = '1.0';
-    $headers['Content-Type'] = 'text/plain; charset=' . $charset;
-
-    // Parameters part
-    if( $backend == 'sendmail' ) {
-        $params['sendmail_path'] = $sendmail_path;
-        $params['sendmail_args'] = $sendmail_args;
-    }
-    if( $backend == "smtp" ) {
-        $params['host']          = $host;
-        $params['port']          = $port;
-        $params['auth']          = $auth;
-        $params['username']      = $username;
-        $params['password']      = $password;
-    }
-
-    // Call to the PEAR::Mail class
-    $mail_object =& Mail::factory($backend, $params);
-    $result = $mail_object->send($recipients, $headers, $body);
-
-    if (is_object($result))
-    {
-      error_log("Error sending email: ".$result->getMessage());
-    }
-    return $result;
-}
-
-// }}}
-// {{{ unHtmlEntities()
-
-/**
- * Convert all HTML entities to their applicable characters.
- * Added to remove HTML entities that are not suitable for plain text emails.
- * May be replaced by PHP function 'html_entity_decode()' but this function
- * only exist since PHP 4.3.0 and is buggy before PHP5.
- *
- * @param  string   $string     string to decode
- * @return string               decoded string
- */
-function unHtmlEntities($string)
-{
-    $trans_tbl = get_html_translation_table(HTML_ENTITIES);
-    $trans_tbl = array_flip($trans_tbl);
-    return strtr($string, $trans_tbl);
-}
-
-// }}}
-?>
Index: web/auth_nw.inc
===================================================================
RCS file: web/auth_nw.inc
diff -N web/auth_nw.inc
--- web/auth_nw.inc	29 Mar 2005 13:26:15 -0000	1.4.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,70 +0,0 @@
-<?php
-
-// $Id: auth_nw.inc,v 1.4.2.2 2005/03/29 13:26:15 jberanek Exp $
-
-/* ~~JFL 2003/11/12 By default, use the http session mechanism */
-if (!isset($auth['session'])) $auth['session']='http';
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-function authValidateUser($user, $pass)
-{
-        global $auth;
-    
-    // Check if we do not have a username/password
-    if(empty($user) || empty($pass))
-    {
-        return 0;
-    }
-    
-    // Generate the command line
-    $cmd = $auth["prog"] . " -S " . $auth["params"] . " -U '$user'";
-    
-    // Run the program, sending the password to stdin.
-    $p = popen($cmd, "w");
-    if (!$p)
-        return 0;
-    fputs($p, $pass);
-    if (pclose($p) == 0)
-        return 1;
-    
-    // return failure
-    return 0;
-}
-
-/* authGetUserLevel($user)
- * 
- * Determines the users access level
- * 
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-    // User not logged in, user level '0'
-    if(!isset($user))
-        return 0;
-    
-    // Check if the user is can modify
-    for($i = 0; $lev1_admin[$i]; $i++)
-    {
-        if(strcasecmp($user, $lev1_admin[$i]) == 0)
-            return 2;
-    }
-    
-    // Everybody else is access level '1'
-    return 1;
-}
-
-?>
Index: web/site_faq.html
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/site_faq.html,v
retrieving revision 1.2
diff -u -r1.2 site_faq.html
--- web/site_faq.html	25 Feb 2001 01:34:20 -0000	1.2
+++ web/site_faq.html	2 Aug 2008 04:39:20 -0000
@@ -1,4 +1,4 @@
-<!-- $Id: site_faq.html,v 1.2 2001/02/25 01:34:20 lbayuk Exp $ -->
+<!-- $Id: site_faq.html,v 1.1 2007/04/05 22:25:33 arborrow Exp $ -->
 <p>
 
 <b><a name=top>Authentication</a></b>
Index: web/session_php.inc
===================================================================
RCS file: web/session_php.inc
diff -N web/session_php.inc
--- web/session_php.inc	13 Feb 2007 12:53:35 -0000	1.8.2.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,214 +0,0 @@
-<?php
-/*****************************************************************************\
-*                                                                             *
-*   File name       session_php.inc                                           *
-*                                                                             *
-*   Description     Use PHP built-in sessions handling                        *
-*                                                                             *
-*   Notes           To use this authentication scheme, set in                 *
-*                   config.inc.php:                                           *
-*                       $auth["session"]  = "php";                            *
-*                                                                             *
-*                                                                             *
-*   History                                                                   *
-*    2003/11/09 JFL Created this file                                         *
-*    Remaining history in ChangeLog and CVS logs                              *
-*                                                                             *
-\*****************************************************************************/
-
-// $Id: session_php.inc,v 1.8.2.5 2007/02/13 12:53:35 jberanek Exp $
-
-global $PHP_SELF;
-
-if (isset($cookie_path_override))
-{
-    $cookie_path = $cookie_path_override;
-}
-else
-{
-    $cookie_path = $PHP_SELF;
-    $cookie_path = ereg_replace('[^/]*$', '', $cookie_path);
-}
-session_set_cookie_params(0, $cookie_path);
-session_start();
-
-/*
-  Target of the form with sets the URL argument "Action=SetName".
-  Will eventually return to URL argument "TargetURL=whatever".
-*/
-if (isset($Action) && ($Action == "SetName"))
-{
-    /* First make sure the password is valid */
-    if ($NewUserName == "") {
-
-        // Unset the session variables
-        if (isset($_SESSION)) {
-            $_SESSION = array();
-        } else {
-            global $HTTP_SESSION_VARS;
-            $HTTP_SESSION_VARS = array();
-        }
-    } else {
-        $NewUserName = unslashes($NewUserName);
-        $NewUserPassword = unslashes($NewUserPassword);
-        if (!authValidateUser($NewUserName, $NewUserPassword)) {
-            print_header(0, 0, 0, 0);
-            echo "<P>".get_vocab('unknown_user')."</P>\n";
-            printLoginForm($TargetURL);
-            exit();
-        }
-
-        if (isset($_SESSION)) {
-            $_SESSION["UserName"] = $NewUserName;
-        } else {
-            global $HTTP_SESSION_VARS;
-            $HTTP_SESSION_VARS["UserName"] = $NewUserName;
-        }
-    }
-
-    header ("Location: $TargetURL"); /* Redirect browser to initial page */
-    /* Note HTTP 1.1 mandates an absolute URL. Most modern browsers support relative URLs,
-        which allows to work around problems with DNS inconsistencies in the server name.
-        Anyway, if the browser cannot redirect automatically, the manual link below will work. */
-    print_header(0, 0, 0, 0);
-    echo "<br />\n";
-    echo "<p>Please click <a href=\"$TargetURL\">here</a> if you're not redirected automatically to the page you requested.</p>\n";
-    echo "</body>\n";
-    echo "</html>\n";
-    exit();
-}
-
-/*
-  Display the login form. Used by two routines below.
-  Will eventually return to $TargetURL.
-*/
-function printLoginForm($TargetURL)
-{
-    global $PHP_SELF;
-?>
-<p>
-  <?php echo get_vocab("please_login") ?>
-</p>
-<form method="post" action="<?php echo basename($PHP_SELF) ?>">
-  <table>
-    <tr>
-      <td align="right"><?php echo get_vocab("user_name") ?></td>
-      <td><input type="text" name="NewUserName" /></td>
-    </tr>
-    <tr>
-      <td align="right"><?php echo get_vocab("user_password") ?></td>
-      <td><input type="password" name="NewUserPassword" /></td>
-    </tr>
-  </table>
-  <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" /> <br />
-  <input type="hidden" name="Action" value="SetName" /> <br />
-  <input type="submit" value=" <?php echo get_vocab('login') ?> " /> <br />
-</form>
-</body>
-</html>
-<?php
-}
-
-/*
-  Target of the form with sets the URL argument "Action=QueryName".
-  Will eventually return to URL argument "TargetURL=whatever".
-*/
-if (isset($Action) && ($Action == "QueryName"))
-{
-    print_header(0, 0, 0, 0);
-    printLoginForm($TargetURL);
-    exit();
-}
-
-/* authGet()
- * 
- * Request the user name/password
- * 
- * Returns: Nothing
- */
-function authGet()
-{
-    global $PHP_SELF, $QUERY_STRING;
-
-    print_header(0, 0, 0, 0);
-
-    echo "<p>".get_vocab("norights")."</p>\n";
-
-    $TargetURL = basename($PHP_SELF);
-    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
-    printLoginForm($TargetURL);
-
-    exit();
-}
-
-function getUserName()
-{
-    if (isset($_SESSION) && isset($_SESSION["UserName"]) && ($_SESSION["UserName"] != ""))
-    {
-        return $_SESSION["UserName"];
-    }
-    else
-    {
-        global $HTTP_SESSION_VARS;
-        if (isset($HTTP_SESSION_VARS["UserName"]) && ($HTTP_SESSION_VARS["UserName"] != ""))
-            return $HTTP_SESSION_VARS["UserName"];
-    }
-}
-
-// Print the logon entry on the top banner.
-function PrintLogonBox()
-{
-    global $PHP_SELF, $QUERY_STRING, $user_list_link, $user_link, $day, $month;
-    global $year, $auth;
-
-    $TargetURL = basename($PHP_SELF);
-    if (isset($url_base) && ($url_base != "")) $TargetURL = $url_base . '/' . $TargetURL;
-    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
-    $user=getUserName();
-    if (isset($user))
-    {
-        // words 'you are xxxx' becomes a link to the
-        // report page with only entries created by xxx. Past entries are not
-        // displayed but this can be changed
-       	$search_string = "report.php?From_day=$day&From_month=$month&".
-          "From_year=$year&To_day=1&To_month=12&To_year=2030&areamatch=&".
-          "roommatch=&namematch=&descrmatch=&summarize=1&sortby=r&display=d&".
-          "sumby=d&creatormatch=$user"; ?>
-
-              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-                <A name="logonBox" href="<?php echo "$search_string\" title=\""
-         . get_vocab('show_my_entries') . "\">" . get_vocab('you_are')." "
-         .$user ?></A><br>
-                <FORM METHOD=POST ACTION="admin.php">
-	          <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
-	          <input type="hidden" name="Action" value="SetName" />
-	          <input type="hidden" name="NewUserName" value="" />
-	          <input type="hidden" name="NewUserPassword" value="" />
-	          <input type="submit" value=" <?php echo get_vocab('logoff') ?> " />
-                </FORM>
-<?php if (isset($user_list_link)) print "
-                <br>
-                <A href=\"$user_list_link\">" . get_vocab('user_list') . "</A><br>\n";
-?>
-              </TD>
-<?php
-    }
-else
-    {
-?>
-              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-                <A name="logonBox" href=""><?php echo get_vocab('unknown_user'); ?></A><br>
-                <FORM METHOD=POST ACTION="admin.php">
-                  <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
-                  <input type="hidden" name="Action" value="QueryName" />
-                  <input type="submit" value=" <?php echo get_vocab('login') ?> " />
-                </FORM>
-<?php if (isset($user_list_link)) print "
-	        <br>
-                <A href=\"$user_list_link\">" . get_vocab('user_list') . "</A><br>\n";
-?>
-              </TD>
-<?php
-    }
-}
-?>
Index: web/lang.ko
===================================================================
RCS file: web/lang.ko
diff -N web/lang.ko
--- web/lang.ko	13 Jul 2005 10:29:18 -0000	1.1.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.ko,v 1.1.2.1 2005/07/13 10:29:18 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Korean file.
-#
-#
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "utf-8";
-
-# Used in style.inc
-$vocab["mrbs"]               = "회의실 예약 시스템";
-
-# Used in functions.inc
-$vocab["report"]             = "보고서";
-$vocab["admin"]              = "관리자";
-$vocab["help"]               = "도움말";
-$vocab["search"]             = "검색:";
-$vocab["not_php3"]             = "<H1>주의: PHP3에서는 동작하지 않습니다.</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Bookings for";
-$vocab["bookingsforpost"]    = "의 예약입니다.";
-$vocab["areas"]              = "지역";
-$vocab["daybefore"]          = "이전으로";
-$vocab["dayafter"]           = "다음으로";
-$vocab["gototoday"]          = "오늘의 예약";
-$vocab["goto"]               = "바로가기";
-$vocab["highlight_line"]     = "Highlight this line";
-$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "일 단위";
-$vocab["viewweek"]           = "주 단위";
-$vocab["viewmonth"]          = "월 단위";
-$vocab["ppreview"]           = "인쇄용 미리보기";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "예약 등록";
-$vocab["editentry"]          = "예약 수정";
-$vocab["editseries"]         = "예약(Series) 수정";
-$vocab["namebooker"]         = "예약자명:";
-$vocab["fulldescription"]    = "상세정보(인원,내부/외부회의 등):";
-$vocab["date"]               = "날짜:";
-$vocab["start_date"]         = "시작일:";
-$vocab["end_date"]           = "종료일:";
-$vocab["time"]               = "시간:";
-$vocab["period"]             = "기간:";
-$vocab["duration"]           = "회의 시간:";
-$vocab["seconds"]            = "초";
-$vocab["minutes"]            = "분";
-$vocab["hours"]              = "시간";
-$vocab["days"]               = "일";
-$vocab["weeks"]              = "주";
-$vocab["years"]              = "년";
-$vocab["periods"]            = "기간";
-$vocab["all_day"]            = "하루종일";
-$vocab["type"]               = "회의 종류:";
-$vocab["internal"]           = "내부회의";
-$vocab["external"]           = "외부회의";
-$vocab["save"]               = "보존";
-$vocab["rep_type"]           = "반복 타입:";
-$vocab["rep_type_0"]         = "없음";
-$vocab["rep_type_1"]         = "일간";
-$vocab["rep_type_2"]         = "주간";
-$vocab["rep_type_3"]         = "월간";
-$vocab["rep_type_4"]         = "연간";
-$vocab["rep_type_5"]         = "월간, 해당일";
-$vocab["rep_type_6"]         = "몇주간";
-$vocab["rep_end_date"]       = "반복 종료일:";
-$vocab["rep_rep_day"]        = "반복일:";
-$vocab["rep_for_weekly"]     = "(몇 주간용)";
-$vocab["rep_freq"]           = "빈도:";
-$vocab["rep_num_weeks"]      = "몇 주";
-$vocab["rep_for_nweekly"]    = "(몇 주간용)";
-$vocab["ctrl_click"]         = "2개 이상을 선택하기 위해서는 Control-Click을 사용하세요";
-$vocab["entryid"]            = "엔트리 ID ";
-$vocab["repeat_id"]          = "반복 ID "; 
-$vocab["you_have_not_entered"] = "You have not entered a";
-$vocab["you_have_not_selected"] = "You have not selected a";
-$vocab["valid_room"]         = "room.";
-$vocab["valid_time_of_day"]  = "valid time of day.";
-$vocab["brief_description"]  = "간략 설명";
-$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
-
-# Used in view_entry.php
-$vocab["description"]        = "설명:";
-$vocab["room"]               = "회의실명";
-$vocab["createdby"]          = "예약자:";
-$vocab["lastupdate"]         = "최종 갱신일:";
-$vocab["deleteentry"]        = "예약 취소";
-$vocab["deleteseries"]       = "예약(Series) 취소";
-$vocab["confirmdel"]         = "예약을 취소하시겠습니까?";
-$vocab["returnprev"]         = "이전 페이지로";
-$vocab["invalid_entry_id"]   = "무효한 엔트리 ID.";
-$vocab["invalid_series_id"]  = "무효한 Serires ID.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "에러";
-$vocab["sched_conflict"]     = "스케쥴 중복";
-$vocab["conflict"]           = "이미 다른 예약이 되어있습니다.";
-$vocab["too_may_entrys"]     = "선택한 옵션은 너무 많은 엔트리를 작성하게 됩니다.<BR>다른 옵션을 선택해 주세요.";
-$vocab["returncal"]          = "달력 화면으로 돌아감";
-$vocab["failed_to_acquire"]  = "데이타베이스 접근에 실패하였습니다."; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "접근이 거부됨";
-$vocab["norights"]           = "수정할 수 있는 권한이 없습니다.";
-$vocab["please_login"]       = "로그인 하여 주십시오";
-$vocab["user_name"]          = "아이디";
-$vocab["user_password"]      = "비밀번호";
-$vocab["unknown_user"]       = "권한없는 사용자";
-$vocab["you_are"]            = "아이디: ";
-$vocab["login"]              = "로그인";
-$vocab["logoff"]             = "로그아웃";
-
-# Authentication database
-$vocab["user_list"]          = "사용자 리스트";
-$vocab["edit_user"]          = "사용자 수정";
-$vocab["delete_user"]        = "사용자 삭제";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "메일 주소";
-$vocab["password_twice"]     = "비밀번호를 변경하시려면, 새로운 비밀번호를 2회 입력하세요.";
-$vocab["passwords_not_eq"]   = "에러: 비밀번호가 바르지 않습니다.";
-$vocab["add_new_user"]       = "사용자 추가";
-$vocab["rights"]             = "권한";
-$vocab["action"]             = "동작";
-$vocab["user"]               = "사용자";
-$vocab["administrator"]      = "관리자";
-$vocab["unknown"]            = "Unknown";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-
-# Used in search.php
-$vocab["invalid_search"]     = "잘못된 검색어를 입력했음.";
-$vocab["search_results"]     = "검색 결과:";
-$vocab["nothing_found"]      = "검색 결과가 없습니다.";
-$vocab["records"]            = "Records ";
-$vocab["through"]            = " through ";
-$vocab["of"]                 = " of ";
-$vocab["previous"]           = "이전";
-$vocab["next"]               = "이후";
-$vocab["entry"]              = "Entry";
-$vocab["view"]               = "View";
-$vocab["advanced_search"]    = "상세 검색";
-$vocab["search_button"]      = "검색";
-$vocab["search_for"]         = "Search For";
-$vocab["from"]               = "From";
-
-# Used in report.php
-$vocab["report_on"]          = "회의에 관한 보고서 작성:";
-$vocab["report_start"]       = "시작일:";
-$vocab["report_end"]         = "종료일:";
-$vocab["match_area"]         = "검색할 지역:";
-$vocab["match_room"]         = "검색할 회의실:";
-$vocab["match_type"]         = "회의 타입:";
-$vocab["ctrl_click_type"]    = "2개 이상을 선택할 경우는 Control-Click을 사용하세요.";
-$vocab["match_entry"]        = "검색할 설명:";
-$vocab["match_descr"]        = "검색할 상세 정보:";
-$vocab["include"]            = "포함:";
-$vocab["report_only"]        = "보고서만";
-$vocab["summary_only"]       = "요약정보만";
-$vocab["report_and_summary"] = "보고서 및 요약정보";
-$vocab["summarize_by"]       = "다음에 의해 요약됨:";
-$vocab["sum_by_descrip"]     = "간략 설명";
-$vocab["sum_by_creator"]     = "작성자";
-$vocab["entry_found"]        = "entry found";
-$vocab["entries_found"]      = "entries found";
-$vocab["summary_header"]     = "Summary of (Entries) Hours";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "전체";
-$vocab["submitquery"]        = "보고서 실행";
-$vocab["sort_rep"]           = "정렬 순서:";
-$vocab["sort_rep_time"]      = "시작 일/시간";
-$vocab["rep_dsp"]            = "Display in report:";
-$vocab["rep_dsp_dur"]        = "기간";
-$vocab["rep_dsp_end"]        = "종료 시간";
-
-# Used in week.php
-$vocab["weekbefore"]         = "저번 주로";
-$vocab["weekafter"]          = "다음 주로";
-$vocab["gotothisweek"]       = "이번 주로";
-
-# Used in month.php
-$vocab["monthbefore"]        = "저번 달로";
-$vocab["monthafter"]         = "다음 달로";
-$vocab["gotothismonth"]      = "이번 달로";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "등록된 회의실이 없습니다.";
-
-# Used in admin.php
-$vocab["edit"]               = "수정";
-$vocab["delete"]             = "삭제";
-$vocab["rooms"]              = "회의실";
-$vocab["in"]                 = "in";
-$vocab["noareas"]            = "등록된 지역가 없음";
-$vocab["addarea"]            = "지역 추가";
-$vocab["name"]               = "이름";
-$vocab["noarea"]             = "지역이 선택되지 않았음";
-$vocab["browserlang"]        = "당신의 브라우저는 다음 언어를 사용하도록 설정되어 있음: ";
-$vocab["postbrowserlang"]    = "";
-$vocab["addroom"]            = "회의실 추가";
-$vocab["capacity"]           = "수용가능 인원";
-$vocab["norooms"]            = "등록된 회의실이 없음";
-$vocab["administration"]     = "지역 및 회의실 관리";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "지역 수정";
-$vocab["change"]             = "수정";
-$vocab["backadmin"]          = "돌아가기";
-$vocab["editroomarea"]       = "지역 또는 회의실 수정";
-$vocab["editroom"]           = "회의실 수정";
-$vocab["update_room_failed"] = "회의실 수정 실패: ";
-$vocab["error_room"]         = "에러: 회의실  ";
-$vocab["not_found"]          = "이(가) 발견되지 않음";
-$vocab["update_area_failed"] = "지역 수정 실패: ";
-$vocab["error_area"]         = "에러: 지역  ";
-$vocab["room_admin_email"]   = "회의실 관리자 메일주소:";
-$vocab["area_admin_email"]   = "지역 관리자 메일주소";
-$vocab["invalid_email"]      = "잘못된 메일주소입니다!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "다음의 예약들이 삭제됩니다.";
-$vocab["sure"]               = "삭제하시겠습니까?";
-$vocab["YES"]                = "예";
-$vocab["NO"]                 = "아니오";
-$vocab["delarea"]            = "지우기 전에 이 지역안에 있는 모든 회의실을 지워야 합니다.<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "About MRBS";
-$vocab["database"]           = "Database: ";
-$vocab["system"]             = "System: ";
-$vocab["please_contact"]     = "자세한 사항은 다음 관리자에게 연락주십시오: ";
-$vocab["for_any_questions"]  = " ";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "심각한 에러: 데이터베이스에 접속할 수 없습니다.";
-
-?>
Index: web/lang.cs
===================================================================
RCS file: web/lang.cs
diff -N web/lang.cs
--- web/lang.cs	21 Sep 2004 13:11:13 -0000	1.1.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.cs,v 1.1.2.1 2004/09/21 13:11:13 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Czech file.
-#
-# Translations provided by: "SmEjDiL" <malyl@col.cz>, 
-#   "David Krotil" <David.Krotil@mu-sokolov.cz>
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-2";
-
-# Used in style.inc
-$vocab["mrbs"]               = "MRBS - Rezerva�n� syst�m";
-
-# Used in functions.inc
-$vocab["report"]             = "V�pis";
-$vocab["admin"]              = "Administr�tor";
-$vocab["help"]               = "Pomoc";
-$vocab["search"]             = "Hledat:";
-$vocab["not_php3"]             = "<H1>UPOZORN�N�: Toto z�ejm� nen� funk�n� s PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Objedn�no pro";
-$vocab["bookingsforpost"]    = ""; # Goes after the date
-$vocab["areas"]              = "Oblasti";
-$vocab["daybefore"]          = "Den vzad";
-$vocab["dayafter"]           = "Den vp�ed";
-$vocab["gototoday"]          = "Dnes";
-$vocab["goto"]               = "P�ej�t na";
-$vocab["highlight_line"]     = "Ozna�te tuto ��dku";
-$vocab["click_to_reserve"]   = "Klepn�te na bu�ku, aby jste provedli rezervaci.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Dny";
-$vocab["viewweek"]           = "T�dny";
-$vocab["viewmonth"]          = "M�s�ce ";
-$vocab["ppreview"]           = "Pro tisk";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "P�idat z�znam";
-$vocab["editentry"]          = "Editovat z�znam";
-$vocab["editseries"]         = "Editovat s�rii";
-$vocab["namebooker"]         = "Popis instrukce:";
-$vocab["fulldescription"]    = "Celkov� popis:<br>&nbsp;&nbsp;(Po�et cestuj�c�ch,<br>&nbsp;&nbsp;Obsazeno/Voln� m�sta atd)";
-$vocab["date"]               = "Datum:";
-$vocab["start_date"]         = "Za��tek:";
-$vocab["end_date"]           = "Konec:";
-$vocab["time"]               = "�as:";
-$vocab["period"]             = "Perioda:";
-$vocab["duration"]           = "Doba trv�n�:";
-$vocab["seconds"]            = "sekundy";
-$vocab["minutes"]            = "minuty";
-$vocab["hours"]              = "hodiny";
-$vocab["days"]               = "dny";
-$vocab["weeks"]              = "v�kendy";
-$vocab["years"]              = "roky";
-$vocab["periods"]            = "period";
-$vocab["all_day"]            = "V�echny dny";
-$vocab["type"]               = "Typ:";
-$vocab["internal"]           = "Voln� m�sta";
-$vocab["external"]           = "Obsazeno";
-$vocab["save"]               = "Ulo�it";
-$vocab["rep_type"]           = "Typ opakov�n�:";
-$vocab["rep_type_0"]         = "Nikdy";
-$vocab["rep_type_1"]         = "Denn�";
-$vocab["rep_type_2"]         = "T�dn�";
-$vocab["rep_type_3"]         = "M�s��n�";
-$vocab["rep_type_4"]         = "Ro�n�";
-$vocab["rep_type_5"]         = "M�s��n�, jednou za m�s�c";
-$vocab["rep_type_6"]         = "n-t�dn�
-$vocab["rep_end_date"]       = "Konec opakov�n�:";
-$vocab["rep_rep_day"]        = "Opakovat v den:";
-$vocab["rep_for_weekly"]     = "(pro (n-)t�dn�
-$vocab["rep_freq"]           = "Frekvence:";
-$vocab["rep_num_weeks"]      = "�islo t�dne";
-$vocab["rep_for_nweekly"]    = "(pro n-t�dn�
-$vocab["ctrl_click"]         = "U��t CTRL pro v�b�r v�ce m�stnost�";
-$vocab["entryid"]            = "Vstupn� ID ";
-$vocab["repeat_id"]          = "ID pro opakov�n�"; 
-$vocab["you_have_not_entered"] = "Nevlo�il jste";
-$vocab["you_have_not_selected"] = "Nevybral jste";
-$vocab["valid_room"]         = "prost�edek.";
-$vocab["valid_time_of_day"]  = "platn� �asov� �sek dne.";
-$vocab["brief_description"]  = "Kr�tk� popis.";
-$vocab["useful_n-weekly_value"] = "pou�iteln� x-t�denn� hodnota.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Popis:";
-$vocab["room"]               = "M�stnost:";
-$vocab["createdby"]          = "Vytvo�il u�ivatel:";
-$vocab["lastupdate"]         = "Posledn� zm�na:";
-$vocab["deleteentry"]        = "Smazat z�znam";
-$vocab["deleteseries"]       = "Smazat s�rii";
-$vocab["confirmdel"]         = "Jste si jist�\\nsmaz�n�m tohoto z�znamu?\\n\\n";
-$vocab["returnprev"]         = "N�vrat na p�edchoz� str�nku";
-$vocab["invalid_entry_id"]   = "�patn� ID z�znamu.";
-$vocab["invalid_series_id"]  = "�patn� ID skupiny.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Chyba";
-$vocab["sched_conflict"]     = "Konflikt p�i pl�nov�n�";
-$vocab["conflict"]           = "Nov� rezervace je v konfliktu s jin�m z�znamem:";
-$vocab["too_may_entrys"]     = "Vybran� volba byla vytvo�ena pro jin� z�znamy.<BR>Pros�m vyberte jinou volbu!";
-$vocab["returncal"]          = "N�vrat do kalend��
-$vocab["failed_to_acquire"]  = "Chyba v�hradn�ho p��stupu do datab�ze"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "P��stup zam�tnut";
-$vocab["norights"]           = "Nem�te p��stupov� pr�vo pro zm�nu t�to polo�ky.";
-$vocab["please_login"]       = "Pros�m, p�ihla�te se";
-$vocab["user_name"]          = "Jm�no";
-$vocab["user_password"]      = "Heslo";
-$vocab["unknown_user"]       = "Nezn�m� u�ivatel";
-$vocab["you_are"]            = "Jste";
-$vocab["login"]              = "P�ihl�sit se";
-$vocab["logoff"]             = "Odhl�sit se";
-
-# Authentication database
-$vocab["user_list"]          = "Seznam u�ivatel�
-$vocab["edit_user"]          = "Editovat u�ivatele";
-$vocab["delete_user"]        = "Smazat tohoto u�ivatele";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Emailov� adresa";
-$vocab["password_twice"]     = "Pokud chcete zm�nit heslo, pros�m napi�te ho dvakr�t";
-$vocab["passwords_not_eq"]   = "Chyba: Vlo�en� hesla se neshoduj�.";
-$vocab["add_new_user"]       = "P�idat nov�ho u�ivatele";
-$vocab["rights"]             = "Pr�va";
-$vocab["action"]             = "Akce";
-$vocab["user"]               = "U�ivatel";
-$vocab["administrator"]      = "Administr�tor";
-$vocab["unknown"]            = "Nezn�m�
-$vocab["ok"]                 = "Ano";
-$vocab["show_my_entries"]    = "Klepnout pro zobraz�n� v�ech nadch�zej�c�ch z�znam�
-
-# Used in search.php
-$vocab["invalid_search"]     = "Pr�zdn� nebo neplatn� hledan� �et�zec.";
-$vocab["search_results"]     = "V�sledek hled�n� pro:";
-$vocab["nothing_found"]      = "Nic nenalezeno";
-$vocab["records"]            = "Z�znam";
-$vocab["through"]            = " skrze ";
-$vocab["of"]                 = " o ";
-$vocab["previous"]           = "P�edchozi";
-$vocab["next"]               = "Dal��";
-$vocab["entry"]              = "Z�znam";
-$vocab["view"]               = "N�hled";
-$vocab["advanced_search"]    = "Roz���en� hled�n�";
-$vocab["search_button"]      = "Hledat";
-$vocab["search_for"]         = "Hledat co";
-$vocab["from"]               = "Od";
-
-# Used in report.php
-$vocab["report_on"]          = "V�pis setk�n�:";
-$vocab["report_start"]       = "V�pis za��tk�
-$vocab["report_end"]         = "V�pis konc�
-$vocab["match_area"]         = "Hledan� oblast:";
-$vocab["match_room"]         = "Hledan� m�stnost:";
-$vocab["match_type"]         = "Hledan� typ:";
-$vocab["ctrl_click_type"]    = "U��t CTRL pro v�b�r v�ce typ�
-$vocab["match_entry"]        = "Hledat v popisu:";
-$vocab["match_descr"]        = "Hledat v cel�m popisu:";
-$vocab["include"]            = "Zahrnovat:";
-$vocab["report_only"]        = "Jen v�pis";
-$vocab["summary_only"]       = "Jen p�ehled";
-$vocab["report_and_summary"] = "V�pis a p�ehled";
-$vocab["summarize_by"]       = "P�ehled od:";
-$vocab["sum_by_descrip"]     = "Popis instrukce";
-$vocab["sum_by_creator"]     = "Tv�rce";
-$vocab["entry_found"]        = "nalezeno";
-$vocab["entries_found"]      = "nalezeno";
-$vocab["summary_header"]     = "P�ehled  (z�znamu) hodiny";
-$vocab["summary_header_per"] = "P�ehled  (z�znamu) periody";
-$vocab["total"]              = "Celkem";
-$vocab["submitquery"]        = "Vytvo�it sestavu";
-$vocab["sort_rep"]           = "Se�adit v�pis podle:";
-$vocab["sort_rep_time"]      = "V�choz� den/�as";
-$vocab["rep_dsp"]            = "Zobrazit ve v�pisu:";
-$vocab["rep_dsp_dur"]        = "Trv�n�";
-$vocab["rep_dsp_end"]        = "�as ukon�en�";
-
-# Used in week.php
-$vocab["weekbefore"]         = "T�den dozadu";
-$vocab["weekafter"]          = "T�den dop�edu";
-$vocab["gotothisweek"]       = "Tento t�den";
-
-# Used in month.php
-$vocab["monthbefore"]        = "M�s�c dozadu";
-$vocab["monthafter"]         = "M�sic dop�edu";
-$vocab["gotothismonth"]      = "Tento m�s�c";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Pro tuto m�stnost nen� definov�na �adn� oblast!";
-
-# Used in admin.php
-$vocab["edit"]               = "Editovat";
-$vocab["delete"]             = "Smazat";
-$vocab["rooms"]              = "M�stnosti";
-$vocab["in"]                 = "v";
-$vocab["noareas"]            = "��dn� oblasti";
-$vocab["addarea"]            = "P�idat oblast";
-$vocab["name"]               = "Jm�no";
-$vocab["noarea"]             = "Nen� vybr�na ��dn� oblast";
-$vocab["browserlang"]        = "Prohl�ec je nastaven k pou�it�";
-$vocab["postbrowserlang"]    = "jazyku.";
-$vocab["addroom"]            = "P�idat m�stnost";
-$vocab["capacity"]           = "Kapacita";
-$vocab["norooms"]            = "��dn� m�stnost.";
-$vocab["administration"]     = "Administrace";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Editovat oblast";
-$vocab["change"]             = "Zm�na";
-$vocab["backadmin"]          = "N�vrat do administrace";
-$vocab["editroomarea"]       = "Editovat popis oblasti nebo m�stnosti";
-$vocab["editroom"]           = "Editovat m�stnosti";
-$vocab["update_room_failed"] = "Chyba editace m�stnosti: ";
-$vocab["error_room"]         = "Chyba: m�stnost ";
-$vocab["not_found"]          = " nenalezen";
-$vocab["update_area_failed"] = "Chyba editace oblasti: ";
-$vocab["error_area"]         = "Chyba: oblast ";
-$vocab["room_admin_email"]   = "Email administr�tora m�stnosti:";
-$vocab["area_admin_email"]   = "Email administr�tora oblasti";
-$vocab["invalid_email"]      = "�patn� email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Bylo smaz�no rezervov�n�";
-$vocab["sure"]               = "Jste si jist�
-$vocab["YES"]                = "ANO";
-$vocab["NO"]                 = "NE";
-$vocab["delarea"]            = "Mus�te smazat v�echny m�stnosti v t�to oblasti p�edt�m ne� ji m�ete smazat<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "O MRBS";
-$vocab["database"]           = "Datab�ze: ";
-$vocab["system"]             = "Syst�m: ";
-$vocab["please_contact"]     = "Pros�m kontaktujte ";
-$vocab["for_any_questions"]  = "pokud m�te n�jak� dal�� ot�zky.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fataln� chyba: Nepoda�ilo se p�ipojit do datab�ze";
-
-?>
Index: web/report.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/report.php,v
retrieving revision 1.22.2.3
diff -u -r1.22.2.3 report.php
--- web/report.php	13 Feb 2007 12:53:33 -0000	1.22.2.3
+++ web/report.php	2 Aug 2008 04:39:20 -0000
@@ -1,11 +1,38 @@
 <?php
 # $Id: report.php,v 1.22.2.3 2007/02/13 12:53:33 jberanek Exp $
-
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
+include "functions.php";
+include "$dbsys.php";
+
 
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month',  0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$id = optional_param('id', 0, PARAM_INT);
+$area = optional_param('area', 0, PARAM_INT);
+$room = optional_param('room', 0, PARAM_INT);
+$pview = optional_param('pview', 0, PARAM_INT);
+
+$From_day= optional_param('From_day',  0, PARAM_INT);
+$From_month= optional_param('From_month', 0, PARAM_INT);
+$From_year= optional_param('From_year', 0, PARAM_INT);
+$To_day= optional_param('To_day', 0, PARAM_INT);
+$To_month= optional_param('To_month', 0, PARAM_INT);
+$To_year= optional_param('To_year', 0, PARAM_INT);
+
+// followup what the most appropriate default values should be - ab
+// $areamatch= optional_param('areamatch', PARAM_ALPHA);
+// $roommatch= optional_param('roommatch', PARAM_ALPHA);
+// $namematch= optional_param('namematch', PARAM_ALPHA);
+// $descrmatch= optional_param('descrmatch', PARAM_ALPHA);
+// $creatormatch= optional_param('creatormatch', PARAM_ALPHA);
+
+$summarize=optional_param('summarize', 1, PARAM_INT);
+$sortby= optional_param('sortby', 'r',  PARAM_ALPHA);
+$display= optional_param('display', 'd', PARAM_ALPHA);
+$sumby= optional_param('sumby', 'd', PARAM_ALPHA);
 
 function date_time_string($t)
 {
@@ -45,7 +72,7 @@
 	$start_time = utf8_strftime(hours_minutes_seconds_format(), $starts);
 	$duration = $ends - $starts;
 	if ($start_time == "00:00:00" && $duration == 60*60*24)
-		return $start_date . " - " . get_vocab("all_day");
+		return $start_date . " - " . get_string('all_day','block_mrbs');
 	toTimeString($duration, $dur_units);
 	return $start_date . " " . $start_time . " - " . $duration . " " . $dur_units;
 }
@@ -98,10 +125,10 @@
 	if( $sortby == "r" )
 	{
 		if ($area_room != $last_area_room)
-			echo "<hr><h2>". get_vocab("room") . ": " . $area_room . "</h2>\n";
+			echo "<hr><h2>". get_string('room','block_mrbs') . ": " . $area_room . "</h2>\n";
 		if ($date != $last_date || $area_room != $last_area_room)
 		{
-			echo "<hr noshade=\"true\"><h3>". get_vocab("date") . " " . $date . "</h3>\n";
+			echo "<hr noshade=\"true\"><h3>". get_string('date') . " " . $date . "</h3>\n";
 			$last_date = $date;
 		}
 		# remember current area/room that is being processed.
@@ -114,10 +141,10 @@
 	# entries to be sorted on start date
 	{
 		if ($date != $last_date)
-			echo "<hr><h2>". get_vocab("date") . " " . $date . "</h2>\n";
+			echo "<hr><h2>". get_string('date') . " " . $date . "</h2>\n";
 		if ($area_room != $last_area_room  || $date != $last_date)
 		{
-			echo "<hr noshade=\"true\"><h3>". get_vocab("room") . ": " . $area_room . "</h3>\n";
+			echo "<hr noshade=\"true\"><h3>". get_string('room','block_mrbs') . ": " . $area_room . "</h3>\n";
 			$last_area_room = $area_room;
 		}
 		# remember current date that is being processed.
@@ -150,16 +177,16 @@
 			"</td></tr>\n";
 
 	# Description:
-	echo "<tr><td class=\"BL\" colspan=2><b>".get_vocab("description")."</b> " .
+	echo "<tr><td class=\"BL\" colspan=2><b>".get_string('description')."</b> " .
 		nl2br(htmlspecialchars($row[4])) . "</td></tr>\n";
 
 	# Entry Type:
 	$et = empty($typel[$row[5]]) ? "?$row[5]?" : $typel[$row[5]];
-	echo "<tr><td class=\"BL\" colspan=2><b>".get_vocab("type")."</b> $et</td></tr>\n";
+	echo "<tr><td class=\"BL\" colspan=2><b>".get_string('type','block_mrbs')."</b> $et</td></tr>\n";
 	# Created by and last update timestamp:
-	echo "<tr><td class=\"BL\" colspan=2><small><b>".get_vocab("createdby")."</b> " .
-		htmlspecialchars($row[6]) . ", <b>".get_vocab("lastupdate")."</b> " .
-		date_time_string($row[7]) . "</small></td></tr>\n";
+	echo "<tr><td class=\"BL\" colspan=2><small><b>".get_string('createdby','block_mrbs')."</b> " .
+		htmlspecialchars($row[6]) . ", <b>".get_string('lastmodified')."</b> " .
+		time_date_string($row[7]) . "</small></td></tr>\n";
 
 	echo "</table>\n";
 }
@@ -232,7 +259,7 @@
 	$n_names = sizeof($names);
 
 	echo "<hr><h1>".
-             (empty($enable_periods) ? get_vocab("summary_header") : get_vocab("summary_header_per")).
+             (empty($enable_periods) ? get_string('summary_header','block_mrbs') : get_string('summary_header_per','block_mrbs')).
              "</h1><table border=2 cellspacing=4>\n";
 	echo "<tr><td>&nbsp;</td>\n";
 	for ($c = 0; $c < $n_rooms; $c++)
@@ -241,7 +268,7 @@
 		$col_count_total[$c] = 0;
 		$col_hours_total[$c] = 0.0;
 	}
-	echo "<td class=\"BR\" align=right><br><b>".get_vocab("total")."</b></td></tr>\n";
+	echo "<td class=\"BR\" align=right><br><b>".get_string('total')."</b></td></tr>\n";
 	$grand_count_total = 0;
 	$grand_hours_total = 0;
 
@@ -272,7 +299,7 @@
 		$grand_count_total += $row_count_total;
 		$grand_hours_total += $row_hours_total;
 	}
-	echo "<tr><td class=\"BR\" align=right><b>".get_vocab("total")."</b></td>\n";
+	echo "<tr><td class=\"BR\" align=right><b>".get_string('total')."</b></td>\n";
 	for ($c = 0; $c < $n_rooms; $c++)
 		cell($col_count_total[$c], $col_hours_total[$c]);
 	cell($grand_count_total, $grand_hours_total);
@@ -280,19 +307,19 @@
 }
 
 #If we dont know the right date then make it up
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
 	$year  = date("Y");
 }
-if(empty($area))
-	$area = get_default_area();
+if($area==0)
+	$area = get_default_area(); //cleanup - ab
 
 # print the page header
-print_header($day, $month, $year, $area);
+print_header_mrbs($day, $month, $year, $area);
 
-if (isset($areamatch))
+if (isset($areamatch)) //I need to look into -ab
 {
 	# Resubmit - reapply parameters as defaults.
 	# Make sure these are not escape-quoted:
@@ -329,37 +356,37 @@
 	$To_year  = date("Y", $To_time);
 }
 # $summarize: 1=report only, 2=summary only, 3=both.
-if (empty($summarize)) $summarize = 1;
+// if (empty($summarize)) $summarize = 1; //commented out - handled by optional_param -ab
 # $sumby: d=by brief description, c=by creator.
-if (empty($sumby)) $sumby = "d";
+// if (empty($sumby)) $sumby = "d"; //commented out - handled by optional_param -ab
 # $sortby: r=room, s=start date/time.
-if (empty($sortby)) $sortby = "r";
+// if (empty($sortby)) $sortby = "r"; //commented out - handled by optional_param -ab
 # $display: d=duration, e=start date/time and end date/time.
-if (empty($display)) $display = "d";
+// if (empty($display)) $display = "d"; //commented out - handled by optional_param -ab
 
 # Upper part: The form.
 if ( $pview != 1 ) {
 ?>
-<h1><?php echo get_vocab("report_on");?></h1>
+<h1><?php echo get_string('report_on','block_mrbs');?></h1>
 <form method=get action=report.php>
 <table>
-<tr><td class="CR"><?php echo get_vocab("report_start");?></td>
+<tr><td class="CR"><?php echo get_string('report_start','block_mrbs');?></td>
     <td class="CL"> <font size="-1">
     <?php genDateSelector("From_", $From_day, $From_month, $From_year); ?>
     </font></td></tr>
-<tr><td class="CR"><?php echo get_vocab("report_end");?></td>
+<tr><td class="CR"><?php echo get_string('report_end','block_mrbs');?></td>
     <td class="CL"> <font size="-1">
     <?php genDateSelector("To_", $To_day, $To_month, $To_year); ?>
     </font></td></tr>
-<tr><td class="CR"><?php echo get_vocab("match_area");?></td>
+<tr><td class="CR"><?php echo get_string('match_area','block_mrbs');?></td>
     <td class="CL"><input type=text name=areamatch size=18
     value="<?php echo $areamatch_default; ?>">
     </td></tr>
-<tr><td class="CR"><?php echo get_vocab("match_room");?></td>
+<tr><td class="CR"><?php echo get_string('match_room','block_mrbs');?></td>
     <td class="CL"><input type=text name=roommatch size=18
     value="<?php echo $roommatch_default; ?>">
     </td></tr>
-<tr><td CLASS=CR><?php echo get_vocab("match_type")?></td>
+<tr><td CLASS=CR><?php echo get_string('match_type','block_mrbs')?></td>
     <td CLASS=CL valign=top><table><tr><td>
         <select name="typematch[]" multiple="yes">
 <?php
@@ -370,51 +397,51 @@
 		     (is_array($typematch_default) && in_array ( $key, $typematch_default ) ? " selected" : "") .
 		     ">$val\n";
 }
-?></select></td><td><?php echo get_vocab("ctrl_click_type") ?></td></tr></table>
+?></select></td><td><?php echo get_string('ctrl_click_type','block_mrbs') ?></td></tr></table>
 </td></tr>
-<tr><td class="CR"><?php echo get_vocab("match_entry");?></td>
+<tr><td class="CR"><?php echo get_string('match_entry','block_mrbs');?></td>
     <td class="CL"><input type=text name=namematch size=18
     value="<?php echo $namematch_default; ?>">
     </td></tr>
-<tr><td class="CR"><?php echo get_vocab("match_descr");?></td>
+<tr><td class="CR"><?php echo get_string('match_descr','block_mrbs');?></td>
     <td class="CL"><input type=text name=descrmatch size=18
     value="<?php echo $descrmatch_default; ?>">
     </td></tr>
-<tr><td class="CR"><?php echo get_vocab("createdby");?></td>
+<tr><td class="CR"><?php echo get_string('createdby','block_mrbs');?></td>
     <td class="CL"><input type=text name=creatormatch size=18
     value="<?php echo $creatormatch_default; ?>">
     </td></tr>
-<tr><td class="CR"><?php echo get_vocab("include");?></td>
+<tr><td class="CR"><?php echo get_string('include','block_mrbs');?></td>
     <td class="CL">
       <input type=radio name=summarize value=1<?php if ($summarize==1) echo " checked";
-        echo ">" . get_vocab("report_only");?>
+        echo ">" . get_string('report_only','block_mrbs');?>
       <input type=radio name=summarize value=2<?php if ($summarize==2) echo " checked";
-        echo ">" . get_vocab("summary_only");?>
+        echo ">" . get_string('summary_only','block_mrbs');?>
       <input type=radio name=summarize value=3<?php if ($summarize==3) echo " checked";
-        echo ">" . get_vocab("report_and_summary");?>
+        echo ">" . get_string('report_and_summary','block_mrbs');?>
     </td></tr>
-<tr><td class="CR"><?php echo get_vocab("sort_rep");?></td>
+<tr><td class="CR"><?php echo get_string('sort_rep','block_mrbs');?></td>
     <td class="CL">
       <input type=radio name=sortby value=r<?php if ($sortby=="r") echo " checked";
-        echo ">". get_vocab("room");?>
+        echo ">". get_string('room','block_mrbs');?>
       <input type=radio name=sortby value=s<?php if ($sortby=="s") echo " checked";
-        echo ">". get_vocab("sort_rep_time");?>
+        echo ">". get_string('sort_rep_time','block_mrbs');?>
     </td></tr>
-<tr><td class="CR"><?php echo get_vocab("rep_dsp");?></td>
+<tr><td class="CR"><?php echo get_string('rep_dsp','block_mrbs');?></td>
     <td class="CL">
       <input type=radio name=display value=d<?php if ($display=="d") echo " checked";
-        echo ">". get_vocab("rep_dsp_dur");?>
+        echo ">". get_string('rep_dsp_dur','block_mrbs');?>
       <input type=radio name=display value=e<?php if ($display=="e") echo " checked";
-        echo ">". get_vocab("rep_dsp_end");?>
+        echo ">". get_string('rep_dsp_end','block_mrbs');?>
     </td></tr>
-<tr><td class="CR"><?php echo get_vocab("summarize_by");?></td>
+<tr><td class="CR"><?php echo get_string('summarize_by','block_mrbs');?></td>
     <td class="CL">
       <input type=radio name=sumby value=d<?php if ($sumby=="d") echo " checked";
-        echo ">" . get_vocab("sum_by_descrip");?>
+        echo ">" . get_string('sum_by_descrip','block_mrbs');?>
       <input type=radio name=sumby value=c<?php if ($sumby=="c") echo " checked";
-        echo ">" . get_vocab("sum_by_creator");?>
+        echo ">" . get_string('sum_by_creator','block_mrbs');?>
     </td></tr>
-<tr><td colspan=2 align=center><input type=submit value="<?php echo get_vocab("submitquery") ?>">
+<tr><td colspan=2 align=center><input type=submit value="<?php echo get_string('submitquery','block_mrbs') ?>">
 </td></tr>
 </table>
 </form>
@@ -422,7 +449,7 @@
 <?php
 }
 # Lower part: Results, if called with parameters:
-if (isset($areamatch))
+if (isset($areamatch)) //need to cleanup -ab
 {
 	# Make sure these are not escape-quoted:
 	$areamatch = unslashes($areamatch);
@@ -448,9 +475,7 @@
 #  10  [9]   Room name, must be HTML escaped
 
 	$sql = "SELECT e.id, e.start_time, e.end_time, e.name, e.description, "
-		. "e.type, e.create_by, "
-		.  sql_syntax_timestamp_to_unix("e.timestamp")
-		. ", a.area_name, r.room_name"
+		. "e.type, e.create_by, e.timestamp, a.area_name, r.room_name"
 		. " FROM $tbl_entry e, $tbl_area a, $tbl_room r"
 		. " WHERE e.room_id = r.id AND r.area_id = a.id"
 		. " AND e.start_time < $report_end AND e.end_time > $report_start";
@@ -496,7 +521,7 @@
 	$nmatch = sql_count($res);
 	if ($nmatch == 0)
 	{
-		echo "<P><B>" . get_vocab("nothing_found") . "</B>\n";
+		echo "<P><B>" . get_string('nothingtodisplay') . "</B>\n";
 		sql_free($res);
 	}
 	else
@@ -504,7 +529,7 @@
 		$last_area_room = "";
 		$last_date = "";
 		echo "<P><B>" . $nmatch . " "
-		. ($nmatch == 1 ? get_vocab("entry_found") : get_vocab("entries_found"))
+		. ($nmatch == 1 ? get_string('entry_found','block_mrbs') : get_string('entries_found','block_mrbs'))
 		.  "</B>\n";
 
 		for ($i = 0; ($row = sql_row($res, $i)); $i++)
@@ -525,4 +550,5 @@
 	}
 }
 
-include "trailer.inc";
\ No newline at end of file
+include "trailer.php";
+?>
\ No newline at end of file
Index: web/edit_area_room.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/edit_area_room.php,v
retrieving revision 1.14.2.1
diff -u -r1.14.2.1 edit_area_room.php
--- web/edit_area_room.php	29 Mar 2005 13:26:22 -0000	1.14.2.1
+++ web/edit_area_room.php	2 Aug 2008 04:39:18 -0000
@@ -1,14 +1,24 @@
 <?php
-// $Id: edit_area_room.php,v 1.14.2.1 2005/03/29 13:26:22 jberanek Exp $
-
+// $Id: edit_area_room.php,v 1.4 2008/08/01 04:02:10 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT);
+$change_done = optional_param('change_done', 0, PARAM_BOOL);
+$room = optional_param('room', 0, PARAM_INT); 
+$area_name = optional_param('area_name', '', PARAM_TEXT);
+
+// $room_admin_email = optional_param('room_admin_email', 0, PARAM_BOOL); //not sure if this is from config or passed from URL -ab. 
+// $area = optional_param('area', 0, PARAM_INT); this may be passed from URL and should probably be checked; however, I need to review the logic in other places first -ab.
 
 #If we dont know the right date then make it up
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
@@ -22,7 +32,7 @@
 }
 
 // Done changing area or room information?
-if (isset($change_done))
+if (($change_done))
 {
 	if (!empty($room)) // Get the area the room is in
 	{
@@ -32,16 +42,16 @@
 	exit();
 }
 
-print_header($day, $month, $year, isset($area) ? $area : "");
+print_header_mrbs($day, $month, $year, isset($area) ? $area : "");
 
 ?>
 
-<h2><?php echo get_vocab("editroomarea") ?></h2>
+<h2><?php echo get_string('editroomarea','block_mrbs') ?></h2>
 
 <table border=1>
 
 <?php
-if(!empty($room)) {
+if($room>0) {
     include_once 'Mail/RFC822.php';
     (!isset($room_admin_email)) ? $room_admin_email = '': '';
     $emails = explode(',', $room_admin_email);
@@ -66,34 +76,34 @@
 			. "', capacity=$capacity, room_admin_email='"
             . slashes($room_admin_email) . "' WHERE id=$room";
 		if (sql_command($sql) < 0)
-			fatal_error(0, get_vocab("update_room_failed") . sql_error());
+			fatal_error(0, get_string('update_room_failed','block_mrbs') . sql_error());
 	}
 
 	$res = sql_query("SELECT * FROM $tbl_room WHERE id=$room");
-	if (! $res) fatal_error(0, get_vocab("error_room") . $room . get_vocab("not_found"));
+	if (! $res) fatal_error(0, get_string('error_room','block_mrbs') . $room . get_string('not_found','block_mrbs'));
 	$row = sql_row_keyed($res, 0);
 	sql_free($res);
 ?>
-<h3 ALIGN=CENTER><?php echo get_vocab("editroom") ?></h3>
+<h3 ALIGN=CENTER><?php echo get_string('editroom','block_mrbs') ?></h3>
 <form action="edit_area_room.php" method="post">
 <input type=hidden name="room" value="<?php echo $row["id"]?>">
 <CENTER>
 <TABLE>
-<TR><TD><?php echo get_vocab("name") ?>:       </TD><TD><input type=text name="room_name" value="<?php
+<TR><TD><?php echo get_string('name') ?>:       </TD><TD><input type=text name="room_name" value="<?php
 echo htmlspecialchars($row["room_name"]); ?>"></TD></TR>
-<TR><TD><?php echo get_vocab("description") ?></TD><TD><input type=text name=description value="<?php
+<TR><TD><?php echo get_string('description') ?></TD><TD><input type=text name=description value="<?php
 echo htmlspecialchars($row["description"]); ?>"></TD></TR>
-<TR><TD><?php echo get_vocab("capacity") ?>:   </TD><TD><input type=text name=capacity value="<?php
+<TR><TD><?php echo get_string('capacity','block_mrbs') ?>:   </TD><TD><input type=text name=capacity value="<?php
 echo $row["capacity"]; ?>"></TD></TR>
-<TR><TD><?php echo get_vocab("room_admin_email") ?></TD><TD><input type=text name=room_admin_email MAXLENGTH=75 value="<?php
+<TR><TD><?php echo get_string('room_admin_email','block_mrbs') ?></TD><TD><input type=text name=room_admin_email MAXLENGTH=75 value="<?php
 echo htmlspecialchars($row["room_admin_email"]); ?>"></TD>
 <?php if (FALSE == $valid_email) {
-    echo ("<TD>&nbsp;</TD><TD><STRONG>" . get_vocab('invalid_email') . "<STRONG></TD>");
+    echo ("<TD>&nbsp;</TD><TD><STRONG>" . get_string('emailmustbereal') . "<STRONG></TD>");
 } ?></TR>
 </TABLE>
 <input type=submit name="change_room"
-value="<?php echo get_vocab("change") ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-<input type=submit name="change_done" value="<?php echo get_vocab("backadmin") ?>">
+value="<?php echo get_string('savechanges') ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<input type=submit name="change_done" value="<?php echo get_string('backadmin','block_mrbs') ?>">
 </CENTER>
 </form>
 <?php } ?>
@@ -123,32 +133,32 @@
 			. "', area_admin_email='" . slashes($area_admin_email)
             . "' WHERE id=$area";
 		if (sql_command($sql) < 0)
-			fatal_error(0, get_vocab("update_area_failed") . sql_error());
+			fatal_error(0, get_string('update_area_failed','block_mrbs') . sql_error());
 	}
 
 	$res = sql_query("SELECT * FROM $tbl_area WHERE id=$area");
-	if (! $res) fatal_error(0, get_vocab("error_area") . $area . get_vocab("not_found"));
+	if (! $res) fatal_error(0, get_string('error_area','block_mrbs') . $area . get_string('not_found','block_mrbs'));
 	$row = sql_row_keyed($res, 0);
 	sql_free($res);
 ?>
-<h3 ALIGN=CENTER><?php echo get_vocab("editarea") ?></h3>
+<h3 ALIGN=CENTER><?php echo get_string('editarea','block_mrbs') ?></h3>
 <form action="edit_area_room.php" method="post">
 <input type=hidden name="area" value="<?php echo $row["id"]?>">
 <CENTER>
 <TABLE>
-<TR><TD><?php echo get_vocab("name") ?>:       </TD><TD><input type=text name="area_name" value="<?php
+<TR><TD><?php echo get_string('name') ?>:       </TD><TD><input type=text name="area_name" value="<?php
 echo htmlspecialchars($row["area_name"]); ?>"></TD></TR>
-<TR><TD><?php echo get_vocab("area_admin_email") ?>:       </TD><TD><input type=text name="area_admin_email" MAXLENGTH=75 value="<?php
+<TR><TD><?php echo get_string('area_admin_email','block_mrbs') ?>:       </TD><TD><input type=text name="area_admin_email" MAXLENGTH=75 value="<?php
 echo htmlspecialchars($row["area_admin_email"]); ?>"></TD>
 <?php if (FALSE == $valid_email) {
-    echo ("<TD>&nbsp;</TD><TD><STRONG>" . get_vocab('invalid_email') . "</STRONG></TD>");
+    echo ("<TD>&nbsp;</TD><TD><STRONG>" . get_string('emailmustbereal') . "</STRONG></TD>");
 } ?></TR>
 </TABLE>
 <input type=submit name="change_area"
-value="<?php echo get_vocab("change") ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-<input type=submit name="change_done" value="<?php echo get_vocab("backadmin") ?>">
+value="<?php echo get_string('savechanges') ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<input type=submit name="change_done" value="<?php echo get_string('backadmin','block_mrbs') ?>">
 </CENTER>
 </form>
 <?php } ?>
 </TABLE>
-<?php include "trailer.inc" ?>
\ No newline at end of file
+<?php include "trailer.php" ?>
\ No newline at end of file
Index: web/lang.pt
===================================================================
RCS file: web/lang.pt
diff -N web/lang.pt
--- web/lang.pt	28 Jul 2004 10:01:13 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.pt,v 1.5 2004/07/28 10:01:13 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Portuguese file.
-#
-# Translated by: Lopo Pizarro
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Hor�rios de salas";
-
-# Used in functions.inc
-$vocab["report"]             = "Relat�rio";
-$vocab["admin"]              = "Administra��o";
-$vocab["help"]               = "Ajuda";
-$vocab["search"]             = "Pesquisa:";
-$vocab["not_php3"]             = "<H1>AVISO: Isto provavelmente n�o funciona com php3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Marca��es para";
-$vocab["bookingsforpost"]    = ""; # Goes after the date
-$vocab["areas"]              = "�reas";
-$vocab["daybefore"]          = "Ir para Dia Anterior";
-$vocab["dayafter"]           = "Ir para Dia Seguinte";
-$vocab["gototoday"]          = "Ir para hoje";
-$vocab["goto"]               = "ir para";
-$vocab["highlight_line"]     = "Highlight this line";
-$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Ver Dia";
-$vocab["viewweek"]           = "Ver Semana";
-$vocab["viewmonth"]          = "Ver M�s";
-$vocab["ppreview"]           = "Pr�-visualizar Inpress�o";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Nova entrada";
-$vocab["editentry"]          = "Editar entrada";
-$vocab["editseries"]         = "Editar Serie";
-$vocab["namebooker"]         = "Desci��o breve:";
-$vocab["fulldescription"]    = "Descri��o completa:<br>&nbsp;&nbsp;(Numero de Pessoas,<br>&nbsp;&nbsp;Internas/Externas etc)";
-$vocab["date"]               = "Data:";
-$vocab["start_date"]         = "Hora In�cio:";
-$vocab["end_date"]           = "Hora Fim:";
-$vocab["time"]               = "Hora:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "Dura��o:";
-$vocab["seconds"]            = "segundos";
-$vocab["minutes"]            = "minutos";
-$vocab["hours"]              = "horas";
-$vocab["days"]               = "dias";
-$vocab["weeks"]              = "semanas";
-$vocab["years"]              = "anos";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "Todos os dias";
-$vocab["type"]               = "Tipo:";
-$vocab["internal"]           = "Interno";
-$vocab["external"]           = "Externo";
-$vocab["save"]               = "Gravar";
-$vocab["rep_type"]           = "Repetir Tipo:";
-$vocab["rep_type_0"]         = "Nenhum";
-$vocab["rep_type_1"]         = "Diariamente";
-$vocab["rep_type_2"]         = "Semanalmente";
-$vocab["rep_type_3"]         = "Mensalmente";
-$vocab["rep_type_4"]         = "Anualmente";
-$vocab["rep_type_5"]         = "Mensalmente, no dia correspoondente";
-$vocab["rep_type_6"]         = "n-semanalmente";
-$vocab["rep_end_date"]       = "Repetir final de data:";
-$vocab["rep_rep_day"]        = "Repetir Dia:";
-$vocab["rep_for_weekly"]     = "(durante (n-)semanalmente)";
-$vocab["rep_freq"]           = "Frequ�ncia:";
-$vocab["rep_num_weeks"]      = "Numero de semanas";
-$vocab["rep_for_nweekly"]    = "(durante n-semanalmente)";
-$vocab["ctrl_click"]         = "Carregue Control-Click para seleccionar mais de uma sala";
-$vocab["entryid"]            = "ID de entrada";
-$vocab["repeat_id"]          = "Repetir ID "; 
-$vocab["you_have_not_entered"] = "N�o introduziu uma";
-$vocab["you_have_not_selected"] = "You have not selected a";
-$vocab["valid_room"]         = "room.";
-$vocab["valid_time_of_day"]  = "hora do dia v�lida.";
-$vocab["brief_description"]  = "Desci��o breve.";
-$vocab["useful_n-weekly_value"] = "valor n-semanal vi�vel.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Descri��o:";
-$vocab["room"]               = "Sala";
-$vocab["createdby"]          = "Marcado por:";
-$vocab["lastupdate"]         = "�ltima Actualiza��o:";
-$vocab["deleteentry"]        = "Apagar entrada";
-$vocab["deleteseries"]       = "Apagar Series";
-$vocab["confirmdel"]         = "Tem a certeza\\nque quer\\napagar esta entrada?\\n\\n";
-$vocab["returnprev"]         = "Voltar � P�gina anterior";
-$vocab["invalid_entry_id"]   = "Id inv�lido.";
-$vocab["invalid_series_id"]  = "Invalid series id.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Erro";
-$vocab["sched_conflict"]     = "Conflito de marca��es";
-$vocab["conflict"]           = "A nova marca��o entra em confito com as seguintes entrada(s):";
-$vocab["too_may_entrys"]     = "A op��o selecionada criar� demasiadas entradas.<BR>Use outras op��es por favor!";
-$vocab["returncal"]          = "Voltar � vista de Calend�rio";
-$vocab["failed_to_acquire"]  = "A tentativa de adquirir acesso exclusivo � base de dados falhou!"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Acesso Negado";
-$vocab["norights"]           = "N�o tem permiss�es para alterar este item.";
-$vocab["please_login"]       = "Please log in";
-$vocab["user_name"]          = "Name";
-$vocab["user_password"]      = "Password";
-$vocab["unknown_user"]       = "Unknown user";
-$vocab["you_are"]            = "You are";
-$vocab["login"]              = "Log in";
-$vocab["logoff"]             = "Log Off";
-
-# Authentication database
-$vocab["user_list"]          = "User list";
-$vocab["edit_user"]          = "Edit user";
-$vocab["delete_user"]        = "Delete this user";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email address";
-$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
-$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
-$vocab["add_new_user"]       = "Add a new user";
-$vocab["rights"]             = "Rights";
-$vocab["action"]             = "Action";
-$vocab["user"]               = "User";
-$vocab["administrator"]      = "Administrator";
-$vocab["unknown"]            = "Unknown";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Dados para pesquisa vazios ou inv�lidos.";
-$vocab["search_results"]     = "Resultados da pesquisa para:";
-$vocab["nothing_found"]      = "N�o foram encontrados registos.";
-$vocab["records"]            = "Registos ";
-$vocab["through"]            = " at� ";
-$vocab["of"]                 = " de ";
-$vocab["previous"]           = "Anterior";
-$vocab["next"]               = "Pr�ximo";
-$vocab["entry"]              = "Entrada";
-$vocab["view"]               = "Ver";
-$vocab["advanced_search"]    = "Pesquyisa Avan�ada";
-$vocab["search_button"]      = "Perquisar";
-$vocab["search_for"]         = "Pesquisar por";
-$vocab["from"]               = "De";
-
-# Used in report.php
-$vocab["report_on"]          = "Relat�rio de Disciplinas:";
-$vocab["report_start"]       = "Relat�rio de data inicial:";
-$vocab["report_end"]         = "Relat�rio de data final:";
-$vocab["match_area"]         = "Area correspondente:";
-$vocab["match_room"]         = "Sala correspondente:";
-$vocab["match_type"]         = "Match type:";
-$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
-$vocab["match_entry"]        = "Breve Descri��o correspondente:";
-$vocab["match_descr"]        = "Descri��o completa correspondente:";
-$vocab["include"]            = "Incluir:";
-$vocab["report_only"]        = "Apenas relat�rio";
-$vocab["summary_only"]       = "Apenas sum�rio";
-$vocab["report_and_summary"] = "Relat�rio e sum�rio";
-$vocab["summarize_by"]       = "Sum�rio por:";
-$vocab["sum_by_descrip"]     = "Descri��o por";
-$vocab["sum_by_creator"]     = "Criador";
-$vocab["entry_found"]        = "entrada encontrada";
-$vocab["entries_found"]      = "entradas encontradas";
-$vocab["summary_header"]     = "Sum�rio de (entradas) Horas";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Total";
-$vocab["submitquery"]        = "Correr relat�rio";
-$vocab["sort_rep"]           = "Sort Report by:";
-$vocab["sort_rep_time"]      = "Start Date/Time";
-$vocab["rep_dsp"]            = "Display in report:";
-$vocab["rep_dsp_dur"]        = "Duration";
-$vocab["rep_dsp_end"]        = "End Time";
-
-# Used in week.php
-$vocab["weekbefore"]         = "Ir para a semana Anterior";
-$vocab["weekafter"]          = "Ir para a semana seguinte";
-$vocab["gotothisweek"]       = "Ir para esta semana";
-
-# Used in month.php
-$vocab["monthbefore"]        = "Ir para o m�s Anterior";
-$vocab["monthafter"]         = "Ir para o m�s seguinte";
-$vocab["gotothismonth"]      = "Ir para este m�s";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "N�o h� salas definidas para esta �rea";
-
-# Used in admin.php
-$vocab["edit"]               = "Editar";
-$vocab["delete"]             = "Apagar";
-$vocab["rooms"]              = "Salas";
-$vocab["in"]                 = "em";
-$vocab["noareas"]            = "N�o h� �reas";
-$vocab["addarea"]            = "Acrescentar �rea";
-$vocab["name"]               = "Nome";
-$vocab["noarea"]             = "�rea n�o selecionada";
-$vocab["browserlang"]        = "O seu browser est� preparado para use";
-$vocab["postbrowserlang"]    = "Idioma.";
-$vocab["addroom"]            = "Acrescentar Sala";
-$vocab["capacity"]           = "Capacidade";
-$vocab["norooms"]            = "N�o h� salas.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Editar �rea";
-$vocab["change"]             = "Mudar";
-$vocab["backadmin"]          = "Voltar � administra��o";
-$vocab["editroomarea"]       = "Editar a descri��o de �rea ou Sala";
-$vocab["editroom"]           = "Editar Sala";
-$vocab["update_room_failed"] = "Actualizar a sala falhou: ";
-$vocab["error_room"]         = "Erro: sala ";
-$vocab["not_found"]          = " n�o encontrado";
-$vocab["update_area_failed"] = "Actualiza��o de �rea falhou: ";
-$vocab["error_area"]         = "Erro: �rea ";
-$vocab["room_admin_email"]   = "Room admin email:";
-$vocab["area_admin_email"]   = "Area admin email:";
-$vocab["invalid_email"]      = "Invalid email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Esta ac��o apagar� as seguintes Marca��es";
-$vocab["sure"]               = "Tem a certeza?";
-$vocab["YES"]                = "Sim";
-$vocab["NO"]                 = "N�o";
-$vocab["delarea"]            = "Tem que apagar todas as salas nesta �rea antes de a poder apagar<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "Sobre o MRBS";
-$vocab["database"]           = "Base de Dados: ";
-$vocab["system"]             = "Sistema: ";
-$vocab["please_contact"]     = "Contacte por favor ";
-$vocab["for_any_questions"]  = "for any questions that aren't answered here.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Erro: Failha ao ligar � base de dados";
-
-?>
Index: web/ChangeLog
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/Attic/ChangeLog,v
retrieving revision 1.34.2.5
diff -u -r1.34.2.5 ChangeLog
--- web/ChangeLog	23 Feb 2007 22:12:48 -0000	1.34.2.5
+++ web/ChangeLog	2 Aug 2008 04:39:18 -0000
@@ -1,3 +1,7 @@
+2008-01-01 Anthony Borrow <arborrow@jesuits.net>
+ * added optional_param and required_param checks to incoming variable in response to 
+ SQL injection attack vulnerability. More information available in CONTRIB-237.
+
 2007-02-23  John Beranek <jberanek@users.sourceforge.net>
 
 	* month.php, version.inc (mrbs-1_2-branch.[4,2]) (utags:
@@ -657,7 +661,7 @@
 	* day.php (1.38, mrbs-1_2_3, mrbs-1_2_2, mrbs-1_2-branch_lastmerge,
 	  mrbs-1_2_1, mrbs-1_2, mrbs-1_2-branch_bp): Changing ordering of
 	  rooms in day view back to "by room name" as "by capacity" was
-	  specific to Jean-Fran�ois' implementation.
+	  specific to Jean-Fran�ois' implementation.
 
 2004-06-12  Gavin Walker <gwalker@users.sourceforge.net>
 
@@ -1800,7 +1804,7 @@
 
 	* config.inc.php (1.3), trailer.inc (1.8): + Allow to view weeks in
 	  the bottom (trailer.inc) as week numbers (ie. 42) instead of
-	  'first day of the week' (13 Oct) (Per Wermelin - SKIOLD S�by A/S"
+	  'first day of the week' (13 Oct) (Per Wermelin - SKIOLD S�by A/S"
 	  <ela@skiold.dk>).
 
 2003-09-25  John Beranek <jberanek@users.sourceforge.net>
@@ -2159,7 +2163,7 @@
 	* admin.php (1.7), del.php (1.5), edit_area_room.php (1.6),
 	  index.php (1.4, mrbs-1-2-pre2, mrbs-1-2-pre1, Root-of-mrbs_MDB,
 	  mrbs-1-1), style.inc (1.7, mrbs-1-2-pre1, Root-of-mrbs_MDB,
-	  mrbs-1-1):	Fixes submitted/suggested by Jean-Fran�ois
+	  mrbs-1-1):	Fixes submitted/suggested by Jean-Fran�ois
 	  Larvoire:
 
 	     - Added closing ?> to index.php
Index: web/version.inc
===================================================================
RCS file: web/version.inc
diff -N web/version.inc
--- web/version.inc	23 Feb 2007 22:06:45 -0000	1.1.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-<?php
-
-# This should probably be a class, but you can only have protected
-# class members in PHP 5, so we won't bother
-
-function get_mrbs_version()
-{
-  # MRBS developers, make sure to update this string before each release
-  $mrbs_version = "MRBS 1.2.5";
-
-  return $mrbs_version;
-}
-
-?>
Index: web/style.inc
===================================================================
RCS file: web/style.inc
diff -N web/style.inc
--- web/style.inc	9 Oct 2006 15:54:00 -0000	1.10.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-<?php
-
-# $Id: style.inc,v 1.10.2.2 2006/10/09 15:54:00 jberanek Exp $
-
-global $unicode_encoding;
-global $vocab; # outside of scope; needs to be denote as global
-
-?>
-    <LINK REL="stylesheet" href="mrbs.css" type="text/css">
-    <META HTTP-EQUIV="Content-Type" content="text/html; charset=<?php
-   if ($unicode_encoding)
-   {
-     echo "utf-8";
-   }
-   else
-   {
-     # We use $vocab directly instead of get_vocab() because we have
-     # no requirement to convert the vocab text, we just output
-     # the charset
-     echo $vocab["charset"];
-   }
-?>">
-    <META NAME="Robots" content="noindex">
-<?php
-
-global $refresh_rate;
-global $PHP_SELF;
-
-if (($refresh_rate != 0) &&
-    preg_match("/(day|week|month)\.php/",$PHP_SELF))
-{
-  echo "    <META HTTP-EQUIV=\"Refresh\" CONTENT=\"$refresh_rate\">\n";
-}
-?>
Index: web/lang.sv
===================================================================
RCS file: web/lang.sv
diff -N web/lang.sv
--- web/lang.sv	13 Feb 2007 13:05:53 -0000	1.17.2.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,257 +0,0 @@
-<?php
-# $Id: lang.sv,v 1.17.2.3 2007/02/13 13:05:53 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is the Swedish file.
-#
-# Translated provede by: Bo Kleve (bok@unit.liu.se), MissterX
-# Modified on 2006-01-04 by: Bj�rn Wiberg <Bjorn.Wiberg@its.uu.se>
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "MRBS - M�tesRumsBokningsSystem";
-
-# Used in functions.inc
-$vocab["report"]             = "Rapport";
-$vocab["admin"]              = "Admin";
-$vocab["help"]               = "Hj�lp";
-$vocab["search"]             = "S�k:";
-$vocab["not_php3"]           = "<H1>VARNING: Detta fungerar f�rmodligen inte med PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Bokningar f�r";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Omr�den";
-$vocab["daybefore"]          = "G� till f�reg�ende dag";
-$vocab["dayafter"]           = "G� till n�sta dag";
-$vocab["gototoday"]          = "G� till idag";
-$vocab["goto"]               = "G� till";
-$vocab["highlight_line"]     = "Markera denna rad";
-$vocab["click_to_reserve"]   = "Klicka p� cellen f�r att g�ra en bokning.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Visa dag";
-$vocab["viewweek"]           = "Visa vecka";
-$vocab["viewmonth"]          = "Visa m�nad";
-$vocab["ppreview"]           = "F�rhandsgranska";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Ny bokning";
-$vocab["editentry"]          = "�ndra bokningen";
-$vocab["editseries"]         = "�ndra serie";
-$vocab["namebooker"]         = "Kort beskrivning:";
-$vocab["fulldescription"]    = "Fullst�ndig beskrivning:";
-$vocab["date"]               = "Datum:";
-$vocab["start_date"]         = "Starttid:";
-$vocab["end_date"]           = "Sluttid:";
-$vocab["time"]               = "Tid:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "L�ngd:";
-$vocab["seconds"]            = "sekunder";
-$vocab["minutes"]            = "minuter";
-$vocab["hours"]              = "timmar";
-$vocab["days"]               = "dagar";
-$vocab["weeks"]              = "veckor";
-$vocab["years"]              = "�r";
-$vocab["periods"]            = "perioder";
-$vocab["all_day"]            = "hela dagen";
-$vocab["type"]               = "Typ:";
-$vocab["internal"]           = "Internt";
-$vocab["external"]           = "Externt";
-$vocab["save"]               = "Spara";
-$vocab["rep_type"]           = "Repetitionstyp:";
-$vocab["rep_type_0"]         = "ingen";
-$vocab["rep_type_1"]         = "dagligen";
-$vocab["rep_type_2"]         = "varje vecka";
-$vocab["rep_type_3"]         = "m�natligen";
-$vocab["rep_type_4"]         = "�rligen";
-$vocab["rep_type_5"]         = "M�nadsvis, samma dag";
-$vocab["rep_type_6"]         = "Veckovis";
-$vocab["rep_end_date"]       = "Repetition slutdatum:";
-$vocab["rep_rep_day"]        = "Repetitionsdag:";
-$vocab["rep_for_weekly"]     = "(vid varje vecka)";
-$vocab["rep_freq"]           = "Intervall:";
-$vocab["rep_num_weeks"]      = "Antal veckor";
-$vocab["rep_for_nweekly"]    = "(F�r x-veckor)";
-$vocab["ctrl_click"]         = "H�ll ner tangenten <I>Ctrl</I> och klicka f�r att v�lja mer �n ett rum";
-$vocab["entryid"]            = "Boknings-ID ";
-$vocab["repeat_id"]          = "Repetions-ID "; 
-$vocab["you_have_not_entered"] = "Du har inte angivit";
-$vocab["you_have_not_selected"] = "Du har inte valt";
-$vocab["valid_room"]         = "ett giltigt rum.";
-$vocab["valid_time_of_day"]  = "en giltig tidpunkt p� dagen.";
-$vocab["brief_description"]  = "en kort beskrivning.";
-$vocab["useful_n-weekly_value"] = "ett anv�ndbart n-veckovist v�rde.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Beskrivning:";
-$vocab["room"]               = "Rum";
-$vocab["createdby"]          = "Skapad av:";
-$vocab["lastupdate"]         = "Senast uppdaterad:";
-$vocab["deleteentry"]        = "Radera bokningen";
-$vocab["deleteseries"]       = "Radera serie";
-$vocab["confirmdel"]         = "�r du s�ker att\\ndu vill radera\\nden h�r bokningen?\\n\\n";
-$vocab["returnprev"]         = "�ter till f�reg�ende sida";
-$vocab["invalid_entry_id"]   = "Ogiltigt boknings-ID!";
-$vocab["invalid_series_id"]  = "Ogiltigt serie-ID!";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Fel";
-$vocab["sched_conflict"]     = "Bokningskonflikt";
-$vocab["conflict"]           = "Den nya bokningen krockar med f�ljande bokning(ar):";
-$vocab["too_may_entrys"]     = "De valda inst�llningarna skapar f�r m�nga bokningar.<BR>V.g. anv�nd andra inst�llningar!";
-$vocab["returncal"]          = "�terg� till kalendervy";
-$vocab["failed_to_acquire"]  = "Kunde ej f� exklusiv databas�tkomst"; 
-$vocab["invalid_booking"]    = "Ogiltig bokning";
-$vocab["must_set_description"] = "Du m�ste ange en kort beskrivning f�r bokningen. V�nligen g� tillbaka och korrigera detta.";
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "�tkomst nekad";
-$vocab["norights"]           = "Du har inte r�ttighet att �ndra bokningen.";
-$vocab["please_login"]       = "V�nligen logga in";
-$vocab["user_name"]          = "Anv�ndarnamn";
-$vocab["user_password"]      = "L�senord";
-$vocab["unknown_user"]       = "Ok�nd anv�ndare";
-$vocab["you_are"]            = "Du �r";
-$vocab["login"]              = "Logga in";
-$vocab["logoff"]             = "Logga ut";
-
-# Authentication database
-$vocab["user_list"]          = "Anv�ndarlista";
-$vocab["edit_user"]          = "Editera anv�ndare";
-$vocab["delete_user"]        = "Radera denna anv�ndare";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "E-postadress";
-$vocab["password_twice"]     = "Om du vill �ndra ditt l�senord, v�nligen mata in detta tv� g�nger";
-$vocab["passwords_not_eq"]   = "Fel: L�senorden st�mmer inte �verens.";
-$vocab["add_new_user"]       = "L�gg till anv�ndare";
-$vocab["rights"]             = "R�ttigheter";
-$vocab["action"]             = "Aktion";
-$vocab["user"]               = "Anv�ndare";
-$vocab["administrator"]      = "Administrat�r";
-$vocab["unknown"]            = "Ok�nd";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Klicka f�r att visa alla dina aktuella bokningar";
-$vocab["no_users_initial"]   = "Inga anv�ndare finns i databasen. Till�ter initialt skapande av anv�ndare.";
-$vocab["no_users_create_first_admin"] = "Skapa en administrativ anv�ndare f�rst. D�refter kan du logga in och skapa fler anv�ndare.";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Tom eller ogiltig s�kstr�ng.";
-$vocab["search_results"]     = "S�kresultat f�r:";
-$vocab["nothing_found"]      = "Inga s�ktr�ffar hittades.";
-$vocab["records"]            = "Bokning ";
-$vocab["through"]            = " t.o.m. ";
-$vocab["of"]                 = " av ";
-$vocab["previous"]           = "F�reg�ende";
-$vocab["next"]               = "N�sta";
-$vocab["entry"]              = "Bokning";
-$vocab["view"]               = "Visa";
-$vocab["advanced_search"]    = "Avancerad s�kning";
-$vocab["search_button"]      = "S�k";
-$vocab["search_for"]         = "S�k f�r";
-$vocab["from"]               = "Fr�n";
-
-# Used in report.php
-$vocab["report_on"]          = "Rapport �ver m�ten:";
-$vocab["report_start"]       = "Startdatum f�r rapport:";
-$vocab["report_end"]         = "Slutdatum f�r rapport:";
-$vocab["match_area"]         = "S�k p� plats:";
-$vocab["match_room"]         = "S�k p� rum:";
-$vocab["match_type"]         = "S�k p� bokningstyp:";
-$vocab["ctrl_click_type"]    = "H�ll ner tangenten <I>Ctrl</I> och klicka f�r att v�lja fler �n en typ";
-$vocab["match_entry"]        = "S�k p� kort beskrivning:";
-$vocab["match_descr"]        = "S�k p� fullst�ndig beskrivning:";
-$vocab["include"]            = "Inkludera:";
-$vocab["report_only"]        = "Endast rapport";
-$vocab["summary_only"]       = "Endast sammanst�llning";
-$vocab["report_and_summary"] = "Rapport och sammanst�llning";
-$vocab["summarize_by"]       = "Sammanst�ll p�:";
-$vocab["sum_by_descrip"]     = "Kort beskrivning";
-$vocab["sum_by_creator"]     = "Skapare";
-$vocab["entry_found"]        = "bokning hittad";
-$vocab["entries_found"]      = "bokningar hittade";
-$vocab["summary_header"]     = "Sammanst�llning �ver (bokningar) timmar";
-$vocab["summary_header_per"] = "Sammanst�llning �ver (bokningar) perioder";
-$vocab["total"]              = "Totalt";
-$vocab["submitquery"]        = "Skapa rapport";
-$vocab["sort_rep"]           = "Sortera rapport efter:";
-$vocab["sort_rep_time"]      = "Startdatum/starttid";
-$vocab["rep_dsp"]            = "Visa i rapport:";
-$vocab["rep_dsp_dur"]        = "L�ngd";
-$vocab["rep_dsp_end"]        = "Sluttid";
-
-# Used in week.php
-$vocab["weekbefore"]         = "F�reg�ende vecka";
-$vocab["weekafter"]          = "N�sta vecka";
-$vocab["gotothisweek"]       = "Denna vecka";
-
-# Used in month.php
-$vocab["monthbefore"]        = "F�reg�ende m�nad";
-$vocab["monthafter"]         = "N�sta m�nad";
-$vocab["gotothismonth"]      = "Denna m�nad";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Rum saknas f�r denna plats";
-
-# Used in admin.php
-$vocab["edit"]               = "�ndra";
-$vocab["delete"]             = "Radera";
-$vocab["rooms"]              = "Rum";
-$vocab["in"]                 = "i";
-$vocab["noareas"]            = "Inget omr�de";
-$vocab["addarea"]            = "L�gg till omr�de";
-$vocab["name"]               = "Namn";
-$vocab["noarea"]             = "Inget omr�de valt";
-$vocab["browserlang"]        = "Din webbl�sare �r inst�lld att anv�nda spr�k(en)";
-$vocab["postbrowserlang"]    = "";
-$vocab["addroom"]            = "L�gg till rum";
-$vocab["capacity"]           = "Kapacitet";
-$vocab["norooms"]            = "Inga rum.";
-$vocab["administration"]     = "Administration";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "�ndra omr�de";
-$vocab["change"]             = "�ndra";
-$vocab["backadmin"]          = "Tillbaka till Administration";
-$vocab["editroomarea"]       = "�ndra omr�de eller rum";
-$vocab["editroom"]           = "�ndra rum";
-$vocab["update_room_failed"] = "Uppdatering av rum misslyckades: ";
-$vocab["error_room"]         = "Fel: rum ";
-$vocab["not_found"]          = " hittades ej";
-$vocab["update_area_failed"] = "Uppdatering av omr�de misslyckades: ";
-$vocab["error_area"]         = "Fel: omr�de";
-$vocab["room_admin_email"]   = "E-postadress till rumsansvarig:";
-$vocab["area_admin_email"]   = "E-postadress till omr�desansvarig";
-$vocab["invalid_email"]      = "Ogiltig e-postadress!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Detta raderar f�ljande bokningar";
-$vocab["sure"]               = "�r du s�ker?";
-$vocab["YES"]                = "JA";
-$vocab["NO"]                 = "NEJ";
-$vocab["delarea"]            = "Du m�ste ta bort alla rum i detta omr�de innan du kan ta bort omr�det!<p>";
-$vocab["backadmin"]          = "Tillbaka till Administration";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "Om MRBS";
-$vocab["database"]           = "Databas: ";
-$vocab["system"]             = "System: ";
-$vocab["please_contact"]     = "Var v�nlig kontakta ";
-$vocab["for_any_questions"]  = "f�r eventuella fr�gor som ej besvaras h�r.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fatalt fel: Kunde ej ansluta till databasen!";
-
-?>
Index: web/search.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/search.php,v
retrieving revision 1.12
diff -u -r1.12 search.php
--- web/search.php	14 Apr 2004 22:00:03 -0000	1.12
+++ web/search.php	2 Aug 2008 04:39:20 -0000
@@ -1,21 +1,28 @@
 <?php
-# $Id: search.php,v 1.12 2004/04/14 22:00:03 gwalker Exp $
-
+# $Id: search.php,v 1.4 2008/08/01 04:02:11 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
+include "functions.php";
+include "$dbsys.php";
+
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$area = optional_param('area', get_default_area(),  PARAM_INT);
+$advanced = optional_param('advanced', 0, PARAM_BOOL);
+$search_str = optional_param('search_str', 0, PARAM_TEXT); //may break some searches due to over-checking -ab.
 
 #If we dont know the right date then make it up 
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
 	$year  = date("Y");
 }
 
-if(empty($area))
-	$area = get_default_area();
+// if(empty($area)) //handled by optional_param above -ab.
+// 	$area = get_default_area();
 
 # Need all these different versions with different escaping.
 # search_str must be left as the html-escaped version because this is
@@ -27,17 +34,17 @@
 	$search_str = htmlspecialchars($search_text);
 }
 
-print_header($day, $month, $year, $area);
+print_header_mrbs($day, $month, $year, $area);
 
-if (!empty($advanced))
+if ($advanced)
 {
-	echo "<H3>" . get_vocab("advanced_search") . "</H3>";
+	echo "<H3>" . get_string('advanced_search','block_mrbs') . "</H3>";
 	echo "<FORM METHOD=GET ACTION=\"search.php\">";
-	echo get_vocab("search_for") . " <INPUT TYPE=TEXT SIZE=25 NAME=\"search_str\"><br>";
-	echo get_vocab("from"). " ";
+	echo get_string('search_for','block_mrbs') . " <INPUT TYPE=TEXT SIZE=25 NAME=\"search_str\"><br>";
+	echo get_string('from'). " ";
 	genDateSelector ("", $day, $month, $year);
-	echo "<br><INPUT TYPE=SUBMIT VALUE=\"" . get_vocab("search_button") ."\">";
-	include "trailer.inc";
+	echo "<br><INPUT TYPE=SUBMIT VALUE=\"" . get_string('search') ."\">";
+	include "trailer.php";
 	echo "</BODY>";
 	echo "</HTML>";
 	exit;
@@ -45,13 +52,13 @@
 
 if (!$search_str)
 {
-	echo "<H3>" . get_vocab("invalid_search") . "</H3>";
-	include "trailer.inc";
+	echo "<H3>" . get_string('invalid_search','block_mrbs') . "</H3>";
+	include "trailer.php";
 	exit;
 }
 
 # now is used so that we only display entries newer than the current time
-echo "<H3>" . get_vocab("search_results") . " \"<font color=\"blue\">$search_str</font>\"</H3>\n";
+echo "<H3>" . get_string('search_results','block_mrbs') . " \"<font color=\"blue\">$search_str</font>\"</H3>\n";
 
 $now = mktime(0, 0, 0, $month, $day, $year);
 
@@ -69,8 +76,8 @@
 
 if($total <= 0)
 {
-	echo "<B>" . get_vocab("nothing_found") . "</B>\n";
-	include "trailer.inc";
+	echo "<B>" . get_string('nothingtodisplay') . "</B>\n";
+	include "trailer.php";
 	exit;
 }
 
@@ -97,7 +104,7 @@
 
 if($has_prev || $has_next)
 {
-	echo "<B>" . get_vocab("records") . ($search_pos+1) . get_vocab("through") . ($search_pos+$num_records) . get_vocab("of") . $total . "</B><BR>";
+	echo "<B>" . get_string('records','block_mrbs') . ($search_pos+1) . get_string('through','block_mrbs') . ($search_pos+$num_records) . get_string('of','block_mrbs') . $total . "</B><BR>";
 
 	# display a "Previous" button if necessary
 	if($has_prev)
@@ -107,7 +114,7 @@
 		echo "&total=$total&year=$year&month=$month&day=$day\">";
 	}
 
-	echo "<B>" . get_vocab("previous") . "</B>";
+	echo "<B>" . get_string('previous') . "</B>";
 
 	if($has_prev)
 		echo "</A>";
@@ -123,7 +130,7 @@
 		echo "&total=$total&year=$year&month=$month&day=$day\">";
 	}
 
-	echo "<B>". get_vocab("next") ."</B>";
+	echo "<B>". get_string('next') ."</B>";
 
 	if($has_next)
 		echo "</A>";
@@ -132,17 +139,17 @@
   <P>
   <TABLE BORDER=2 CELLSPACING=0 CELLPADDING=3>
    <TR>
-    <TH><?php echo get_vocab("entry") ?></TH>
-    <TH><?php echo get_vocab("createdby") ?></TH>
-    <TH><?php echo get_vocab("namebooker") ?></TH>
-    <TH><?php echo get_vocab("description") ?></TH>
-    <TH><?php echo get_vocab("start_date") ?></TH>
+    <TH><?php echo get_string('entry','block_mrbs') ?></TH>
+    <TH><?php echo get_string('createdby','block_mrbs') ?></TH>
+    <TH><?php echo get_string('namebooker','block_mrbs') ?></TH>
+    <TH><?php echo get_string('description') ?></TH>
+    <TH><?php echo get_string('start_date','block_mrbs') ?></TH>
    </TR>
 <?php
 for ($i = 0; ($row = sql_row($result, $i)); $i++)
 {
 	echo "<TR>";
-	echo "<TD><A HREF=\"view_entry.php?id=$row[0]\">".get_vocab("view")."</A></TD>\n";
+	echo "<TD><A HREF=\"view_entry.php?id=$row[0]\">".get_string('view')."</A></TD>\n";
 	echo "<TD>" . htmlspecialchars($row[1]) . "</TD>\n";
 	echo "<TD>" . htmlspecialchars($row[2]) . "</TD>\n";
 	echo "<TD>" . htmlspecialchars($row[3]) . "</TD>\n";
@@ -160,5 +167,5 @@
 }
 
 echo "</TABLE>\n";
-include "trailer.inc";
-?>
+include "trailer.php";
+?>
\ No newline at end of file
Index: web/del.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/del.php,v
retrieving revision 1.11.2.1
diff -u -r1.11.2.1 del.php
--- web/del.php	29 Mar 2005 13:26:15 -0000	1.11.2.1
+++ web/del.php	2 Aug 2008 04:39:18 -0000
@@ -1,21 +1,29 @@
 <?php
-# $Id: del.php,v 1.11.2.1 2005/03/29 13:26:15 jberanek Exp $
-
+# $Id: del.php,v 1.4 2008/08/01 04:02:10 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+
+$day = optional_param('day', 0, PARAM_INT);
+$month = optional_param('month', 0, PARAM_INT);
+$year = optional_param('year', 0, PARAM_INT); 
+$area = optional_param('area', get_default_area(),  PARAM_INT);
+$type = optional_param('type', '', PARAM_ALPHA);
+$confirm = optional_param('confirm', 0, PARAM_BOOL);
 
 #If we dont know the right date then make it up
-if(!isset($day) or !isset($month) or !isset($year))
+if(($day==0) or ($month==0) or ($year==0))
 {
 	$day   = date("d");
 	$month = date("m");
 	$year  = date("Y");
 }
-if (empty($area))
-	$area = get_default_area();
+
+// if (empty($area)) // - handling with optional_param -ab.
+//	$area = get_default_area();
 
 if(!getAuthorised(2))
 {
@@ -45,7 +53,7 @@
 	}
 	else
 	{
-		print_header($day, $month, $year, $area);
+		print_header_mrbs($day, $month, $year, $area);
 		
 		# We tell them how bad what theyre about to do is
 		# Find out how many appointments would be deleted
@@ -55,7 +63,7 @@
 		if (! $res) echo sql_error();
 		elseif (sql_count($res) > 0)
 		{
-			echo get_vocab("deletefollowing") . ":<ul>";
+			echo get_string('deletefollowing','block_mrbs') . ":<ul>";
 			
 			for ($i = 0; ($row = sql_row($res, $i)); $i++)
 			{
@@ -68,10 +76,10 @@
 		}
 		
 		echo "<center>";
-		echo "<H1>" .  get_vocab("sure") . "</h1>";
-		echo "<H1><a href=\"del.php?type=room&room=$room&confirm=Y\">" . get_vocab("YES") . "!</a> &nbsp;&nbsp;&nbsp; <a href=admin.php>" . get_vocab("NO") . "!</a></h1>";
+		echo "<H1>" .  get_string('sure','block_mrbs') . "</h1>";
+		echo "<H1><a href=\"del.php?type=room&room=$room&confirm=Y\">" . get_string('yes') . "!</a> &nbsp;&nbsp;&nbsp; <a href=admin.php>" . get_string('no') . "!</a></h1>";
 		echo "</center>";
-		include "trailer.inc";
+		include "trailer.php";
 	}
 }
 
@@ -91,10 +99,11 @@
 	else
 	{
 		# There are rooms left in the area
-		print_header($day, $month, $year, $area);
+		print_header_mrbs($day, $month, $year, $area);
 		
-		echo get_vocab("delarea");
-		echo "<a href=admin.php>" . get_vocab("backadmin") . "</a>";
-		include "trailer.inc";
+		echo get_string('delarea','block_mrbs');
+		echo "<a href=admin.php>" . get_string('backadmin','block_mrbs') . "</a>";
+		include "trailer.php";
 	}
 }
+?>
\ No newline at end of file
Index: web/mysql.inc
===================================================================
RCS file: web/mysql.inc
diff -N web/mysql.inc
--- web/mysql.inc	25 Apr 2004 18:10:57 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,234 +0,0 @@
-<?php
-// $Id: mysql.inc,v 1.5 2004/04/25 18:10:57 jflarvoire Exp $
-
-// mysql.inc - Simple PHP database support for MySQL.
-// Include this file after defining the following variables:
-//   $db_host = The hostname of the database server
-//   $db_login = The username to use when connecting to the database
-//   $db_password = The database account password
-//   $db_database = The database name.
-// Including this file connects you to the database, or exits on error.
-
-
-// Free a results handle. You need not call this if you call sql_row or
-// sql_row_keyed until the row returns 0, since sql_row frees the results
-// handle when you finish reading the rows.
-function sql_free ($r)
-{
-	mysql_free_result($r);
-}
-
-// Execute a non-SELECT SQL command (insert/update/delete).
-// Returns the number of tuples affected if OK (a number >= 0).
-// Returns -1 on error; use sql_error to get the error message.
-function sql_command ($sql)
-{
-	if (mysql_query($sql)) return mysql_affected_rows();
-	return -1;
-}
-
-// Execute an SQL query which should return a single non-negative number value.
-// This is a lightweight alternative to sql_query, good for use with count(*)
-// and similar queries. It returns -1 on error or if the query did not return
-// exactly one value, so error checking is somewhat limited.
-// It also returns -1 if the query returns a single NULL value, such as from
-// a MIN or MAX aggregate function applied over no rows.
-function sql_query1 ($sql)
-{
-	$r = mysql_query($sql);
-	if (! $r) return -1;
-	if (mysql_num_rows($r) != 1 || mysql_num_fields($r) != 1
-		|| ($result = mysql_result($r, 0, 0)) == "") $result = -1;
-	mysql_free_result($r);
-	return $result;
-}
-
-// Execute an SQL query. Returns a database-dependent result handle,
-// which should be passed back to sql_row or sql_row_keyed to get the results.
-// Returns 0 on error; use sql_error to get the error message.
-function sql_query ($sql)
-{
-	$r = mysql_query($sql);
-	return $r;
-}
-
-// Return a row from a result. The first row is 0.
-// The row is returned as an array with index 0=first column, etc.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-// Typical usage: $i = 0; while ((a = sql_row($r, $i++))) { ... }
-function sql_row ($r, $i)
-{
-	if ($i >= mysql_num_rows($r))
-	{
-		mysql_free_result($r);
-		return 0;
-	}
-	mysql_data_seek($r, $i);
-	return mysql_fetch_row($r);
-}
-
-// Return a row from a result as an associative array keyed by field name.
-// The first row is 0.
-// This is actually upward compatible with sql_row since the underlying
-// routing also stores the data under number indexes.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-function sql_row_keyed ($r, $i)
-{
-	if ($i >= mysql_num_rows($r))
-	{
-		mysql_free_result($r);
-		return 0;
-	}
-	mysql_data_seek($r, $i);
-	return mysql_fetch_array($r);
-}
-
-// Return the number of rows returned by a result handle from sql_query.
-function sql_count ($r)
-{
-	return mysql_num_rows($r);
-}
-
-// Return the value of an autoincrement field from the last insert.
-// Must be called right after an insert on that table!
-function sql_insert_id($table, $field)
-{
-	return mysql_insert_id();
-}
-
-// Return the text of the last error message.
-function sql_error()
-{
-	return mysql_error();
-}
-
-// Begin a transaction, if the database supports it. This is used to
-// improve PostgreSQL performance for multiple insert/delete/updates.
-// There is no rollback support, since MySQL doesn't support it.
-function sql_begin()
-{
-}
-
-// Commit (end) a transaction. See sql_begin().
-function sql_commit()
-{
-}
-
-// Acquire a mutual-exclusion lock on the named table. For portability:
-// This will not lock out SELECTs.
-// It may lock out DELETE/UPDATE/INSERT or not, depending on the implementation.
-// It will lock out other callers of this routine with the same name argument.
-// It may timeout in 20 seconds and return 0, or may wait forever.
-// It returns 1 when the lock has been acquired.
-// Caller must release the lock with sql_mutex_unlock().
-// Caller must not have more than one mutex at any time.
-// Do not mix this with sql_begin()/sql_end() calls.
-//
-// In MySQL, we avoid table locks, and use low-level locks instead.
-function sql_mutex_lock($name)
-{
-	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
-	if (!sql_query1("SELECT GET_LOCK('$name', 20)")) return 0;
-	$sql_mutex_unlock_name = $name;
-	if (empty($sql_mutex_shutdown_registered))
-	{
-		register_shutdown_function("sql_mutex_cleanup");
-		$sql_mutex_shutdown_registered = 1;
-	}
-	return 1;
-}
-
-// Release a mutual-exclusion lock on the named table. See sql_mutex_unlock.
-function sql_mutex_unlock($name)
-{
-	global $sql_mutex_unlock_name;
-	sql_query1("SELECT RELEASE_LOCK('$name')");
-	$sql_mutex_unlock_name = "";
-}
-
-// Shutdown function to clean up a forgotten lock. For internal use only.
-function sql_mutex_cleanup()
-{
-	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
-	if (!empty($sql_mutex_unlock_name))
-	{
-		sql_mutex_unlock($sql_mutex_unlock_name);
-		$sql_mutex_unlock_name = "";
-	}
-}
-
-
-// Return a string identifying the database version:
-function sql_version()
-{
-	$r = sql_query("select version()");
-	$v = sql_row($r, 0);
-	sql_free($r);
-	return "MySQL $v[0]";
-}
-
-
-// Generate non-standard SQL for LIMIT clauses:
-function sql_syntax_limit($count, $offset)
-{
-	return " LIMIT $offset,$count ";
-}
-
-// Generate non-standard SQL to output a TIMESTAMP as a Unix-time:
-function sql_syntax_timestamp_to_unix($fieldname)
-{
-	return " UNIX_TIMESTAMP($fieldname) ";
-}
-
-// Generate non-standard SQL to match a string anywhere in a field's value
-// in a case insensitive manner. $s is the un-escaped/un-slashed string.
-// In MySQL, REGEXP seems to be case sensitive, so use LIKE instead. But this
-// requires quoting of % and _ in addition to the usual.
-function sql_syntax_caseless_contains($fieldname, $s)
-{
-	$s = str_replace("\\", "\\\\", $s);
-	$s = str_replace("%", "\\%", $s);
-	$s = str_replace("_", "\\_", $s);
-	$s = str_replace("'", "''", $s);
-	return " $fieldname LIKE '%$s%' ";
-}
-
-// Returns the name of a field.
-function sql_field_name($result, $index)
-{
-	return mysql_field_name($result, $index);
-}
-
-// Returns the type of a field. (one of "int", "real", "string", "blob", etc...)
-function sql_field_type($result, $index)
-{
-	return mysql_field_type($result, $index);
-}
-
-// Returns the number of fields in a result.
-function sql_num_fields($result)
-{
-	return mysql_num_fields($result);
-}
-
-
-
-// Establish a database connection.
-// On connection error, the message will be output without a proper HTML
-// header. There is no way I can see around this; if track_errors isn't on
-// there seems to be no way to supress the automatic error message output and
-// still be able to access the error text.
-if (empty($db_nopersist))
-	$db_c = mysql_pconnect($db_host, $db_login, $db_password);
-else
-	$db_c = mysql_connect($db_host, $db_login, $db_password);
-
-if (!$db_c || !mysql_select_db ($db_database))
-{
-	echo "\n<p>\n" . get_vocab("failed_connect_db") . "\n";
-	exit;
-}
-
-?>
Index: web/Mail.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/Mail.php,v
retrieving revision 1.1
diff -u -r1.1 Mail.php
--- web/Mail.php	16 Apr 2004 17:23:30 -0000	1.1
+++ web/Mail.php	2 Aug 2008 04:39:18 -0000
@@ -16,8 +16,8 @@
 // | Author: Chuck Hagenbuch <chuck@horde.org>                            |
 // +----------------------------------------------------------------------+
 //
-// $Id: Mail.php,v 1.1 2004/04/16 17:23:30 thierry_bo Exp $
-
+// $Id: Mail.php,v 1.2 2007/12/28 05:53:06 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
 require_once 'PEAR.php';
 
 /**
@@ -26,7 +26,7 @@
  * useful in multiple mailer backends.
  *
  * @access public
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
  * @package Mail
  */
 class Mail
@@ -191,4 +191,4 @@
     }
 
 }
-?>
+?>
\ No newline at end of file
Index: web/lang.ja
===================================================================
RCS file: web/lang.ja
diff -N web/lang.ja
--- web/lang.ja	11 Apr 2005 13:40:40 -0000	1.15.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.ja,v 1.15.2.1 2005/04/11 13:40:40 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Japanese file.
-#
-#
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "UTF-8";
-
-# Used in style.inc
-$vocab["mrbs"]               = "X線発生装置予約システム";
-
-# Used in functions.inc
-$vocab["report"]             = "報告";
-$vocab["admin"]              = "管理";
-$vocab["help"]               = "手引き";
-$vocab["search"]             = "検索:";
-$vocab["not_php3"]             = "<h1>警告: このスクリプトは、PHP3ではおそらく動作しません。</h1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "";
-$vocab["bookingsforpost"]    = "の予約です";
-$vocab["areas"]              = "X線発生装置";
-$vocab["daybefore"]          = "前の日に移動";
-$vocab["dayafter"]           = "次の日移動";
-$vocab["gototoday"]          = "本日に移動";
-$vocab["goto"]               = "移動";
-$vocab["highlight_line"]     = "この行を強調";
-$vocab["click_to_reserve"]   = "予約を入れたいセルをクリックしてください。";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "この日の予約状況";
-$vocab["viewweek"]           = "週間予約状況";
-$vocab["viewmonth"]          = "月間予約状況";
-$vocab["ppreview"]           = "印刷向けページ";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "予約登録";
-$vocab["editentry"]          = "予約の編集";
-$vocab["editseries"]         = "定例の編集";
-$vocab["namebooker"]         = "使用者:";
-$vocab["fulldescription"]    = "詳細な説明<br />(人数, 内部会議/外部会議 等):";
-$vocab["date"]               = "日付:";
-$vocab["start_date"]         = "開始時刻:";
-$vocab["end_date"]           = "終了時刻:";
-$vocab["time"]               = "時間:";
-$vocab["period"]             = "期間:";
-$vocab["duration"]           = "必要な時間:";
-$vocab["seconds"]            = "秒";
-$vocab["minutes"]            = "分";
-$vocab["hours"]              = "時間";
-$vocab["days"]               = "日";
-$vocab["weeks"]              = "週";
-$vocab["years"]              = "年";
-$vocab["periods"]            = "期間";
-$vocab["all_day"]            = "全日";
-$vocab["type"]               = "会議の種類:";
-$vocab["internal"]           = "内部会議";
-$vocab["external"]           = "外部会議";
-$vocab["save"]               = "保存";
-$vocab["rep_type"]           = "繰り返しの様式:";
-$vocab["rep_type_0"]         = "なし";
-$vocab["rep_type_1"]         = "毎日";
-$vocab["rep_type_2"]         = "毎週";
-$vocab["rep_type_3"]         = "毎月";
-$vocab["rep_type_4"]         = "毎年";
-$vocab["rep_type_5"]         = "毎月同じ日";
-$vocab["rep_type_6"]         = "n週毎";
-$vocab["rep_end_date"]       = "繰り返しの終了日:";
-$vocab["rep_rep_day"]        = "繰り返しの曜日:";
-$vocab["rep_for_weekly"]     = "(毎週, n週毎 選択時)";
-$vocab["rep_freq"]           = "頻度:";
-$vocab["rep_num_weeks"]      = "週の繰り返し数";
-$vocab["rep_for_nweekly"]    = "(n週毎 選択時)";
-$vocab["ctrl_click"]         = "複数のディテクターを選択するときは、<br />Controlキーを押しながらクリックしてください。";
-$vocab["entryid"]            = "予約ID ";
-$vocab["repeat_id"]          = "定例ID "; 
-$vocab["you_have_not_entered"] = "以下の項目が入力されていません:";
-$vocab["you_have_not_selected"] = "以下の項目が選択されていません:";
-$vocab["valid_room"]         = "X線発生装置";
-$vocab["valid_time_of_day"]  = "valid time of day.";
-$vocab["brief_description"]  = "簡単な説明";
-$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
-
-# Used in view_entry.php
-$vocab["description"]        = "説明:";
-$vocab["room"]               = "ディテクター:";
-$vocab["createdby"]          = "予約者:";
-$vocab["lastupdate"]         = "最後に更新した日:";
-$vocab["deleteentry"]        = "予約の削除";
-$vocab["deleteseries"]       = "定例の削除";
-$vocab["confirmdel"]         = "本当にこの予約を取り消してもよろしいですか?";
-$vocab["returnprev"]         = "前のページに戻る";
-$vocab["invalid_entry_id"]   = "不正な予約IDです。";
-$vocab["invalid_series_id"]  = "不正な定例IDです。";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "エラー";
-$vocab["sched_conflict"]     = "予定の重複";
-$vocab["conflict"]           = "新しい予約は、以下の登録と重複しています:";
-$vocab["too_may_entrys"]     = "選択されたオプションは大量のエントリーを作成します。<br />別のオプションを使用して下さい!";
-$vocab["returncal"]          = "カレンダー表示画面に戻る";
-$vocab["failed_to_acquire"]  = "排他的なデータベースアクセスの確保に失敗しました"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["新規登録"];
-$vocab["mail_body_del_entry"] = $mail["登録削除"];
-$vocab["mail_body_changed_entry"] = $mail["登録変更"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "アクセスが拒否されました";
-$vocab["norights"]           = "この項目を変更する権利がありません。";
-$vocab["please_login"]       = "ログインしてください";
-$vocab["user_name"]          = "名前";
-$vocab["user_password"]      = "パスワード";
-$vocab["unknown_user"]       = "不明なユーザ";
-$vocab["you_are"]            = "あなたは";
-$vocab["login"]              = "ログイン";
-$vocab["logoff"]             = "ロクオフ";
-
-# Authentication database
-$vocab["user_list"]          = "ユーザリスト";
-$vocab["edit_user"]          = "ユーザ編集";
-$vocab["delete_user"]        = "このユーザを削除";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Eメールアドレス";
-$vocab["password_twice"]     = "パスワードを変更したい場合は、新しいパスワードを2回入力してください";
-$vocab["passwords_not_eq"]   = "エラー: パスワードが一致しません。";
-$vocab["add_new_user"]       = "新しいユーザを追加";
-$vocab["rights"]             = "権限";
-$vocab["action"]             = "処置";
-$vocab["user"]               = "ユーザ";
-$vocab["administrator"]      = "管理者";
-$vocab["unknown"]            = "不明";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "クリックすると、これからの予定が表示されます。";
-
-# Used in search.php
-$vocab["invalid_search"]     = "検索語が空あるいは不適切です。";
-$vocab["search_results"]     = "検索結果:";
-$vocab["nothing_found"]      = "一致する項目は見つかりませんでした。";
-$vocab["records"]            = "履歴";
-$vocab["through"]            = "から";
-$vocab["of"]                 = ", 該当件数";
-$vocab["previous"]           = "前";
-$vocab["next"]               = "次";
-$vocab["entry"]              = "エントリー";
-$vocab["view"]               = "閲覧";
-$vocab["advanced_search"]    = "高度な検索";
-$vocab["search_button"]      = "検索";
-$vocab["search_for"]         = "検索語";
-$vocab["from"]               = "始点";
-
-# Used in report.php
-$vocab["report_on"]          = "会合の報告:";
-$vocab["report_start"]       = "報告開始日:";
-$vocab["report_end"]         = "報告終了日:";
-$vocab["match_area"]         = "X線発生装置の一致:";
-$vocab["match_room"]         = "ディテクターの一致:";
-$vocab["match_type"]         = "形態の一致:";
-$vocab["ctrl_click_type"]    = "複数の形態を選択するときは、<br />Controlキーを押しながらクリックしてください。";
-$vocab["match_entry"]        = "簡単な説明との一致:";
-$vocab["match_descr"]        = "詳細な説明との一致:";
-$vocab["include"]            = "内容:";
-$vocab["report_only"]        = "報告のみ";
-$vocab["summary_only"]       = "要約のみ";
-$vocab["report_and_summary"] = "報告と要約";
-$vocab["summarize_by"]       = "要約のまとめ方:";
-$vocab["sum_by_descrip"]     = "簡単な説明";
-$vocab["sum_by_creator"]     = "予約者";
-$vocab["entry_found"]        = "個のエントリーが見つかりました";
-$vocab["entries_found"]      = "個のエントリーが見つかりました";
-$vocab["summary_header"]     = "予約時間数の要約 (括弧内はエントリー数)";
-$vocab["summary_header_per"] = "予約時間帯数の要約 (括弧内はエントリー数)";
-$vocab["total"]              = "計";
-$vocab["submitquery"]        = "報告の作成";
-$vocab["sort_rep"]           = "報告の並べ方:";
-$vocab["sort_rep_time"]      = "開始日時";
-$vocab["rep_dsp"]            = "報告の表示:";
-$vocab["rep_dsp_dur"]        = "使用期間";
-$vocab["rep_dsp_end"]        = "終了時刻";
-
-# Used in week.php
-$vocab["weekbefore"]         = "前の週に移動";
-$vocab["weekafter"]          = "次の週に移動";
-$vocab["gotothisweek"]       = "今週に移動";
-
-# Used in month.php
-$vocab["monthbefore"]        = "前の月に移動";
-$vocab["monthafter"]         = "次の月に移動";
-$vocab["gotothismonth"]      = "今月に移動";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "このX線発生装置にはディテクターが設定されていません";
-
-# Used in admin.php
-$vocab["edit"]               = "編集";
-$vocab["delete"]             = "削除";
-$vocab["rooms"]              = "ディテクター";
-$vocab["in"]                 = "-";
-$vocab["noareas"]            = "X線発生装置がありません。";
-$vocab["addarea"]            = "X線発生装置を追加";
-$vocab["name"]               = "名称";
-$vocab["noarea"]             = "X線発生装置が選択されていません";
-$vocab["browserlang"]        = "あなたのブラウザの言語設定は";
-$vocab["postbrowserlang"]    = "です。";
-$vocab["addroom"]            = "ディテクターを追加";
-$vocab["capacity"]           = "収容人数";
-$vocab["norooms"]            = "ディテクターがありません。";
-$vocab["administration"]     = "管理";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "X線発生装置の編集";
-$vocab["change"]             = "変更";
-$vocab["backadmin"]          = "管理画面に戻る";
-$vocab["editroomarea"]       = "X線発生装置やディテクターの説明";
-$vocab["editroom"]           = "ディテクターの編集";
-$vocab["update_room_failed"] = "ディテクターの更新に失敗しました: ";
-$vocab["error_room"]         = "エラー: ディテクター ";
-$vocab["not_found"]          = "は見つかりませんでした";
-$vocab["update_area_failed"] = "X線発生装置の更新に失敗しました: ";
-$vocab["error_area"]         = "エラー: X線発生装置 ";
-$vocab["room_admin_email"]   = "ディテクターの管理者のEメール:";
-$vocab["area_admin_email"]   = "X線発生装置の管理者のEメール:";
-$vocab["invalid_email"]      = "不適切なEメールです!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "以下の予約を削除します";
-$vocab["sure"]               = "よろしいですか?";
-$vocab["YES"]                = "はい";
-$vocab["NO"]                 = "いいえ";
-$vocab["delarea"]            = "削除する前に、このX線発生装置に属するディテクターを全て削除してください。<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "MRBSについて";
-$vocab["database"]           = "データベース: ";
-$vocab["system"]             = "システム: ";
-$vocab["please_contact"]     = "ここに答えがない質問は、";
-$vocab["for_any_questions"]  = "にお尋ねください。";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "致命的なエラー: データベースに接続できませんでした。";
-
-?>
Index: web/del_entry.php
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/del_entry.php,v
retrieving revision 1.5.2.1
diff -u -r1.5.2.1 del_entry.php
--- web/del_entry.php	29 Mar 2005 13:26:16 -0000	1.5.2.1
+++ web/del_entry.php	2 Aug 2008 04:39:18 -0000
@@ -1,12 +1,14 @@
 <?php
-# $Id: del_entry.php,v 1.5.2.1 2005/03/29 13:26:16 jberanek Exp $
-
+# $Id: del_entry.php,v 1.2 2007/12/28 05:53:06 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
 require_once "grab_globals.inc.php";
 include "config.inc.php";
-include "functions.inc";
-include "$dbsys.inc";
-include "mrbs_auth.inc";
-include "mrbs_sql.inc";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+include "mrbs_sql.php";
+
+$id = required_param('id', PARAM_INT);
 
 if(getAuthorised(1) && ($info = mrbsGetEntryInfo($id)))
 {
@@ -17,7 +19,7 @@
 
     if (MAIL_ADMIN_ON_DELETE)
     {
-        include_once "functions_mail.inc";
+        include_once "functions_mail.php";
         // Gather all fields values for use in emails.
         $mail_previous = getPreviousEntryData($id, $series);
     }
Index: web/lang.es
===================================================================
RCS file: web/lang.es
diff -N web/lang.es
--- web/lang.es	13 Feb 2007 12:53:29 -0000	1.18.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.es,v 1.18.2.2 2007/02/13 12:53:29 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Spanish file.
-#
-#
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Sistema de Reservas de Salas de Reuni&oacute;n";
-
-# Used in functions.inc
-$vocab["report"]             = "Informes";
-$vocab["admin"]              = "Administraci&oacute;n";
-$vocab["help"]               = "Ayuda";
-$vocab["search"]             = "B&uacute;squeda:";
-$vocab["not_php3"]           = "<H1>ATENCI&Oacute;N: Puede que esto no funcione con PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Reservas para el";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Edificios";
-$vocab["daybefore"]          = "D&iacute;a Anterior";
-$vocab["dayafter"]           = "D&iacute;a Siguiente";
-$vocab["gototoday"]          = "D&iacute;a Actual";
-$vocab["goto"]               = "Ir a";
-$vocab["highlight_line"]     = "Remarcar esta L&iacute;nea";
-$vocab["click_to_reserve"]   = "Selecciona una Casilla para hacer una Reserva.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Ver D&iacute;a";
-$vocab["viewweek"]           = "Ver Semana";
-$vocab["viewmonth"]          = "Ver Mes";
-$vocab["ppreview"]           = "Vista Previa";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Nueva Reserva";
-$vocab["editentry"]          = "Editar Reserva";
-$vocab["editseries"]         = "Editar Serie";
-$vocab["namebooker"]         = "Nombre:";
-$vocab["fulldescription"]    = "Descripci&oacute;n Completa:";
-$vocab["date"]               = "Fecha:";
-$vocab["start_date"]         = "Fecha Inicio:";
-$vocab["end_date"]           = "Fecha Fin:";
-$vocab["time"]               = "Hora:";
-$vocab["period"]             = "Periodo:";
-$vocab["duration"]           = "Duraci&oacute;n:";
-$vocab["seconds"]            = "Segundos";
-$vocab["minutes"]            = "Minutos";
-$vocab["hours"]              = "Horas";
-$vocab["days"]               = "D&iacute;as";
-$vocab["weeks"]              = "Semanas";
-$vocab["years"]              = "Aa&ntilde;os";
-$vocab["periods"]            = "Periodos";
-$vocab["all_day"]            = "D&iacute;a Completo";
-$vocab["type"]               = "Tipo:";
-$vocab["internal"]           = "Interna";
-$vocab["external"]           = "Externa";
-$vocab["save"]               = "Salvar";
-$vocab["rep_type"]           = "Tipo Repetici&oacute;n:";
-$vocab["rep_type_0"]         = "Ninguna";
-$vocab["rep_type_1"]         = "Diaria";
-$vocab["rep_type_2"]         = "Semanal";
-$vocab["rep_type_3"]         = "Mensual";
-$vocab["rep_type_4"]         = "Anual";
-$vocab["rep_type_5"]         = "D&iacute;a correspondiente del Mes";
-$vocab["rep_type_6"]         = "n-Semanal";
-$vocab["rep_end_date"]       = "Fecha Tope Repetici&oacute;n:";
-$vocab["rep_rep_day"]        = "D&iacute;a Repetici&oacute;n:";
-$vocab["rep_for_weekly"]     = "(Semanal)";
-$vocab["rep_freq"]           = "Frecuencia:";
-$vocab["rep_num_weeks"]      = "N&uacute;mero de Semanas";
-$vocab["rep_for_nweekly"]    = "(n-Semanas)";
-$vocab["ctrl_click"]         = "Usar Control-Click para seleccionar m&aacute;s de una Sala";
-$vocab["entryid"]            = "ID de Entrada ";
-$vocab["repeat_id"]          = "ID de Repetici&oacute;n "; 
-$vocab["you_have_not_entered"] = "No ha introducido ning&uacute;n";
-$vocab["you_have_not_selected"] = "No ha seleccionado ning&uacute;n";
-$vocab["valid_room"]         = "Sala.";$vocab["valid_time_of_day"]  = "Hora V&aacute;lida del D&iacute;a.";
-$vocab["valid_time_of_day"]  = "Hora V&aacute;lida del D&iacute;a.";
-$vocab["brief_description"]  = "Breve Descripci&oacute;n.";
-$vocab["useful_n-weekly_value"] = "valor &uacute;til de n-Semanalmente.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Descripci&oacute;n:";
-$vocab["room"]               = "Sala";
-$vocab["createdby"]          = "Creada por:";
-$vocab["lastupdate"]         = "Ultima Actualizaci&oacute;n:";
-$vocab["deleteentry"]        = "Borrar Reserva";
-$vocab["deleteseries"]       = "Borrar Serie";
-$vocab["confirmdel"]         = "Seguro que desea borrar esta reserva?";
-$vocab["returnprev"]         = "Volver a P&aacute;gina Anterior";
-$vocab["invalid_entry_id"]   = "ID de Entrada Incorrecto.";
-$vocab["invalid_series_id"]  = "ID de Serie Incorrecto.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Error";
-$vocab["sched_conflict"]     = "Conflicto de Planificaci&oacute;n";
-$vocab["conflict"]           = "La nueva reserva entra en conflicto con la(s) siguiente(s) entrada(s):";
-$vocab["too_may_entrys"]     = "Las opciones seleccionadas crear&aacute;n demasiadas entradas.<BR>Por favor, revise las opciones";
-$vocab["returncal"]          = "Volver a Vista de Calendario";
-$vocab["failed_to_acquire"]  = "Error al obtener acceso a la Base de Datos"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Acceso Denegado";
-$vocab["norights"]           = "No tiene autorizaci&oacute;n para modificar este dato.";
-$vocab["please_login"]       = "Introduzca su Nombre de Usuario";
-$vocab["user_name"]          = "Nombre";
-$vocab["user_password"]      = "Contrase&ntilde;a";
-$vocab["unknown_user"]       = "Usuario An&oacute;nimo";
-$vocab["you_are"]            = "Hola";
-$vocab["login"]              = "Entrar";
-$vocab["logoff"]             = "Salir";
-
-# Authentication database
-$vocab["user_list"]          = "Lista de Usuarios";
-$vocab["edit_user"]          = "Editar Usuario";
-$vocab["delete_user"]        = "Borrar este Usuario";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Direcci&oacute;n de Correo Electr&oacute;nico";
-$vocab["password_twice"]     = "Si quieres cambiar la contrase&ntilde;a, por favor teclee la nueva dos veces";
-$vocab["passwords_not_eq"]   = "Error: Las contrase&ntilde;as no son iguales.";
-$vocab["add_new_user"]       = "A&ntilde;adir un Nuevo Usuario";
-$vocab["rights"]             = "Privilegios";
-$vocab["action"]             = "Acciones";
-$vocab["user"]               = "Usuario";
-$vocab["administrator"]      = "Administrador";
-$vocab["unknown"]            = "Desconocido";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Click para mostrar todos mis eventos futuros";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Cadena de b&uacute;squeda vac&iacute;a o incorrecta.";
-$vocab["search_results"]     = "Buscar resultados de:";
-$vocab["nothing_found"]      = "No se encontraron coincidencias.";
-$vocab["records"]            = "Registros ";
-$vocab["through"]            = " a trav&eacute;s ";
-$vocab["of"]                 = " de ";
-$vocab["previous"]           = "Anterior";
-$vocab["next"]               = "Siguiente";
-$vocab["entry"]              = "Entrada";
-$vocab["view"]               = "Ver";
-$vocab["advanced_search"]    = "B&uacute;squeda Advanzada";
-$vocab["search_button"]      = "B&uacute;squeda";
-$vocab["search_for"]         = "Buscar por";
-$vocab["from"]               = "Desde";
-
-# Used in report.php
-$vocab["report_on"]          = "Informe de Reuniones:";
-$vocab["report_start"]       = "Fecha Inicio:";
-$vocab["report_end"]         = "Fecha Fin:";
-$vocab["match_area"]         = "Edificio:";
-$vocab["match_room"]         = "Sala:";
-$vocab["match_type"]         = "Tipo de Coincidencia:";
-$vocab["ctrl_click_type"]    = "Use Control-Click para seleccionar m&aacute;s de un Tipo";
-$vocab["match_entry"]        = "Descripci&oacute;n Breve:";
-$vocab["match_descr"]        = "Descripci&oacute;n Completa:";
-$vocab["include"]            = "Incluir:";
-$vocab["report_only"]        = "Solamente Informe";
-$vocab["summary_only"]       = "Solamente Resumen";
-$vocab["report_and_summary"] = "Informe y Resumen";
-$vocab["summarize_by"]       = "Resumir por:";
-$vocab["sum_by_descrip"]     = "Descripci&oacute;n Breve";
-$vocab["sum_by_creator"]     = "Creador";
-$vocab["entry_found"]        = "registro encontrado";
-$vocab["entries_found"]      = "registros encontrados";
-$vocab["summary_header"]     = "Resumen de (Registros) Horas";
-$vocab["summary_header_per"] = "Resumen de (Entradas) Periodos";
-$vocab["total"]              = "Total";
-$vocab["submitquery"]        = "Pedir Informe";
-$vocab["sort_rep"]           = "Ordenar Informe por:";
-$vocab["sort_rep_time"]      = "Fecha/Hora de Comienzo";
-$vocab["rep_dsp"]            = "Mostrar en Informe:";
-$vocab["rep_dsp_dur"]        = "Duraci&oacute;n";
-$vocab["rep_dsp_end"]        = "Hora de Finalizaci&oacute;n";
-
-# Used in week.php
-$vocab["weekbefore"]         = "Ir a Semana Anterior";
-$vocab["weekafter"]          = "Ir a Semana Posterior";
-$vocab["gotothisweek"]       = "Ir a Semana Corriente";
-
-# Used in month.php
-$vocab["monthbefore"]        = "Ir a Mes Anterior";
-$vocab["monthafter"]         = "Ir a Mes Posterior";
-$vocab["gotothismonth"]      = "Ir a Mes Corriente";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "No hay Salas definidas para este Edificio";
-
-# Used in admin.php
-$vocab["edit"]               = "Editar";
-$vocab["delete"]             = "Borrar";
-$vocab["rooms"]              = "Salas";
-$vocab["in"]                 = "en";
-$vocab["noareas"]            = "No hay Edificios";
-$vocab["addarea"]            = "Agregar Edificio";
-$vocab["name"]               = "Nombre";
-$vocab["noarea"]             = "No se seleccion&oacute; Edificio";
-$vocab["browserlang"]        = "Su navegador est&aacute; configurado para usar los siguientes juegos de caracteres:";
-$vocab["postbrowserlang"]    = ".";
-$vocab["addroom"]            = "Agregar Sala";
-$vocab["capacity"]           = "Capacidad (Personas)";
-$vocab["norooms"]            = "No hay Salas.";
-$vocab["administration"]     = "Administraci&oacute;n";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Editar Edificio";
-$vocab["change"]             = "Cambiar";
-$vocab["backadmin"]          = "Volver a Admin";
-$vocab["editroomarea"]       = "Editar Descripci&oacute;n de Edificio o Sala";
-$vocab["editroom"]           = "Editar Sala";
-$vocab["update_room_failed"] = "Actualizaci&oacute;n de Sala fallida: ";
-$vocab["error_room"]         = "Error: Sala ";
-$vocab["not_found"]          = " no encontrado";
-$vocab["update_area_failed"] = "Actualizaci&oacute;n de Edificio fallida: ";
-$vocab["error_area"]         = "Error: Edificio ";
-$vocab["room_admin_email"]   = "Correo Electr&oacute;nico del Administrador de Sala:";
-$vocab["area_admin_email"]   = "Correo Electr&oacute;nico del Administrador de Edificio";
-$vocab["invalid_email"]      = "Correo Electr&oacute;nico Incorrecto!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "Esto borrar&aacute; las siguientes Agendas";
-$vocab["sure"]               = "EST&Aacute; SEGURO?";
-$vocab["YES"]                = "S&Iacute;";
-$vocab["NO"]                 = "NO";
-$vocab["delarea"]            = "Debe borrar todas las Salas antes de borrar este Edificio<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "Acerca de MRBS";
-$vocab["database"]           = "Base de Datos: ";
-$vocab["system"]             = "Sistema: ";
-$vocab["please_contact"]     = "Contacte con ";
-$vocab["for_any_questions"]  = "para cualquier duda.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Error: No se pudo conectar a la Base de Datos";
-
-?>
Index: web/lang.zh-tw
===================================================================
RCS file: web/lang.zh-tw
diff -N web/lang.zh-tw
--- web/lang.zh-tw	26 Apr 2006 10:01:43 -0000	1.15.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.zh-tw,v 1.15.2.2 2006/04/26 10:01:43 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is a Chinese (zh-tw Big5) file.
-#
-#
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "utf-8";
-
-# Used in style.inc
-$vocab["mrbs"]               = "會議室預約系統";
-
-# Used in functions.inc
-$vocab["report"]             = "報表";
-$vocab["admin"]              = "系統管理";
-$vocab["help"]               = "說明";
-$vocab["search"]             = "搜尋:";
-$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "預約:";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "區域";
-$vocab["daybefore"]          = "查看前一天";
-$vocab["dayafter"]           = "查看後一天";
-$vocab["gototoday"]          = "查看今天";
-$vocab["goto"]               = "goto";
-$vocab["highlight_line"]     = "加強顯示這行";
-$vocab["click_to_reserve"]   = "點選格子進行預約登記";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "查看日期 ";
-$vocab["viewweek"]           = "週顯示";
-$vocab["viewmonth"]          = "月顯示";
-$vocab["ppreview"]           = "預覽列印";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "新增";
-$vocab["editentry"]          = "修改";
-$vocab["editseries"]         = "整批修改";
-$vocab["namebooker"]         = "預約人姓名:";
-$vocab["fulldescription"]    = "說明:<br>&nbsp;&nbsp;(聯約電話,部門,,<br>&nbsp;&nbsp;會議主題 等)";
-$vocab["date"]               = "日期:";
-$vocab["start_date"]         = "起始時間:";
-$vocab["end_date"]           = "結束時間:";
-$vocab["time"]               = "時間:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "持續時間:";
-$vocab["seconds"]            = "秒";
-$vocab["minutes"]            = "分";
-$vocab["hours"]              = "小時";
-$vocab["days"]               = "天";
-$vocab["weeks"]              = "星期";
-$vocab["years"]              = "年";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "整天";
-$vocab["type"]               = "種類:";
-$vocab["internal"]           = "內部使用";
-$vocab["external"]           = "外部使用";
-$vocab["save"]               = "儲存";
-$vocab["rep_type"]           = "重覆預約:";
-$vocab["rep_type_0"]         = "不重覆";
-$vocab["rep_type_1"]         = "每天";
-$vocab["rep_type_2"]         = "每週";
-$vocab["rep_type_3"]         = "每月";
-$vocab["rep_type_4"]         = "每年";
-$vocab["rep_type_5"]         = "每月對應的日期";
-$vocab["rep_type_6"]         = "(每週)";
-$vocab["rep_end_date"]       = "結束重覆的日期:";
-$vocab["rep_rep_day"]        = "重覆的星期:";
-$vocab["rep_for_weekly"]     = "(每週)";
-$vocab["rep_freq"]           = "頻率:";
-$vocab["rep_num_weeks"]      = "重覆幾週";
-$vocab["rep_for_nweekly"]    = "(每週)";
-$vocab["ctrl_click"]         = "用Control+滑鼠右鍵可以重覆選擇";
-$vocab["entryid"]            = "登記序號 ";
-$vocab["repeat_id"]          = "重覆序號 "; 
-$vocab["you_have_not_entered"] = "你沒有輸入";
-$vocab["you_have_not_selected"] = "你沒有選";
-$vocab["valid_room"]         = "會議室/設備.";
-$vocab["valid_time_of_day"]  = "可以預約的時間.";
-$vocab["brief_description"]  = "簡要說明.";
-$vocab["useful_n-weekly_value"] = "可以提供預約的星期.";
-
-# Used in view_entry.php
-$vocab["description"]        = "說明:";
-$vocab["room"]               = "會議室/設備";
-$vocab["createdby"]          = "預約人:";
-$vocab["lastupdate"]         = "最後更新:";
-$vocab["deleteentry"]        = "刪除";
-$vocab["deleteseries"]       = "整批刪除";
-$vocab["confirmdel"]         = "你確定要刪除此記錄??\\n";
-$vocab["returnprev"]         = "回前一頁";
-$vocab["invalid_entry_id"]   = "預約序號錯誤.";
-$vocab["invalid_series_id"]  = "序列號錯誤.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "錯誤";
-$vocab["sched_conflict"]     = "時段衝突";
-$vocab["conflict"]           = "此時段已被預約";
-$vocab["too_may_entrys"]     = "這個選擇造成太多輸入.<BR>請重新選擇!";
-$vocab["returncal"]          = "查看日程表";
-$vocab["failed_to_acquire"]  = "無法存取資料庫"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "限制存取";
-$vocab["norights"]           = "您無權利修改此筆記錄!!";
-$vocab["please_login"]       = "請先登入";
-$vocab["user_name"]          = "名稱";
-$vocab["user_password"]      = "密碼";
-$vocab["unknown_user"]       = "使用者不存在或密碼錯誤";
-$vocab["you_are"]            = "您是";
-$vocab["login"]              = "登入";
-$vocab["logoff"]             = "登出";
-
-# Authentication database
-$vocab["user_list"]          = "使用者清單";
-$vocab["edit_user"]          = "編輯使用者";
-$vocab["delete_user"]        = "刪除使用者";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email address";
-$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
-$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
-$vocab["add_new_user"]       = "新增使用者";
-$vocab["rights"]             = "權限";
-$vocab["action"]             = "動作";
-$vocab["user"]               = "使用者";
-$vocab["administrator"]      = "管理者";
-$vocab["unknown"]            = "未知的";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "顯示全部我的預約";
-
-# Used in search.php
-$vocab["invalid_search"]     = "空的或不合法的搜尋字串.";
-$vocab["search_results"]     = "搜尋結果:";
-$vocab["nothing_found"]      = "找不到.";
-$vocab["records"]            = "紀錄";
-$vocab["through"]            = "經由";
-$vocab["of"]                 = " of ";
-$vocab["previous"]           = "前一個";
-$vocab["next"]               = "下一個";
-$vocab["entry"]              = "登錄";
-$vocab["view"]               = "顯示";
-$vocab["advanced_search"]    = "進階搜尋";
-$vocab["search_button"]      = "搜尋";
-$vocab["search_for"]         = "搜尋";
-$vocab["from"]               = "From";
-
-# Used in report.php
-$vocab["report_on"]          = "會議室報表:";
-$vocab["report_start"]       = "報表起始日:";
-$vocab["report_end"]         = "報表結束日:";
-$vocab["match_area"]         = "符合的種類:";
-$vocab["match_room"]         = "符合的會議室:";
-$vocab["match_type"]         = "符合的類型:";
-$vocab["ctrl_click_type"]    = "使用Control-Click選取一個以上的類型";
-$vocab["match_entry"]        = "符合部份的簡述:";
-$vocab["match_descr"]        = "符合全部簡述:";
-$vocab["include"]            = "包含:";
-$vocab["report_only"]        = "只要明細";
-$vocab["summary_only"]       = "只要加總";
-$vocab["report_and_summary"] = "明細和加總";
-$vocab["summarize_by"]       = "加總項目:";
-$vocab["sum_by_descrip"]     = "簡述";
-$vocab["sum_by_creator"]     = "預約人";
-$vocab["entry_found"]        = "找到預約";
-$vocab["entries_found"]      = "找到預約";
-$vocab["summary_header"]     = "總共預約(小時)";
-$vocab["summary_header_per"] = "總共預約(次)";
-$vocab["total"]              = "全部";
-$vocab["submitquery"]        = "產生報表";
-$vocab["sort_rep"]           = "排序:";
-$vocab["sort_rep_time"]      = "起始日/時";
-$vocab["rep_dsp"]            = "顯示在報表:";
-$vocab["rep_dsp_dur"]        = "持續時間";
-$vocab["rep_dsp_end"]        = "結束時間";
-
-# Used in week.php
-$vocab["weekbefore"]         = "前一週";
-$vocab["weekafter"]          = "後一週";
-$vocab["gotothisweek"]       = "這一週";
-
-# Used in month.php
-$vocab["monthbefore"]        = "上一月";
-$vocab["monthafter"]         = "下一月";
-$vocab["gotothismonth"]      = "這個月";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "這個種類沒有定義會議室/設備";
-
-# Used in admin.php
-$vocab["edit"]               = "編輯";
-$vocab["delete"]             = "刪除";
-$vocab["rooms"]              = "會議室/設備";
-$vocab["in"]                 = "在";
-$vocab["noareas"]            = "沒有種類";
-$vocab["addarea"]            = "新增種類";
-$vocab["name"]               = "名稱";
-$vocab["noarea"]             = "還沒選擇種類";
-$vocab["browserlang"]        = "你的瀏覽器設為";
-$vocab["postbrowserlang"]    = "語系.";
-$vocab["addroom"]            = "新增會議室/設備";
-$vocab["capacity"]           = "容量";
-$vocab["norooms"]            = "沒有會議室/設備.";
-$vocab["administration"]     = "管理者";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "新增種類";
-$vocab["change"]             = "改變";
-$vocab["backadmin"]          = "回到管理首頁";
-$vocab["editroomarea"]       = "修改描述";
-$vocab["editroom"]           = "修改會議室/設備";
-$vocab["update_room_failed"] = "更新失敗: ";
-$vocab["error_room"]         = "錯誤: 會議室/設備 ";
-$vocab["not_found"]          = "找不到";
-$vocab["update_area_failed"] = "更新區域失敗: ";
-$vocab["error_area"]         = "錯誤: 區域 ";
-$vocab["room_admin_email"]   = "會議室管理者email:";
-$vocab["area_admin_email"]   = "區域管理者email:";
-$vocab["invalid_email"]      = "不合法的email!";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "這個動作會刪除相關的預約紀錄";
-$vocab["sure"]               = "確定嗎?";
-$vocab["YES"]                = "YES";
-$vocab["NO"]                 = "NO";
-$vocab["delarea"]            = "你必須先刪除所屬的會議室<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "關於MRBS";
-$vocab["database"]           = "資料庫: ";
-$vocab["system"]             = "系統: ";
-$vocab["please_contact"]     = "請聯絡";
-$vocab["for_any_questions"]  = ",關於任何在這裡找不到答案的問題.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fatal Error: 無法連上資料庫";
-
-?>
Index: web/mrbs_sql.inc
===================================================================
RCS file: web/mrbs_sql.inc
diff -N web/mrbs_sql.inc
--- web/mrbs_sql.inc	26 Jan 2006 11:34:02 -0000	1.18.2.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,473 +0,0 @@
-<?php
-// $Id: mrbs_sql.inc,v 1.18.2.3 2006/01/26 11:34:02 jberanek Exp $
-
-/** mrbsCheckFree()
- * 
- * Check to see if the time period specified is free
- * 
- * $room_id   - Which room are we checking
- * $starttime - The start of period
- * $endtime   - The end of the period
- * $ignore    - An entry ID to ignore, 0 to ignore no entries
- * $repignore - A repeat ID to ignore everything in the series, 0 to ignore no series
- * 
- * Returns:
- *   nothing   - The area is free
- *   something - An error occured, the return value is human readable
- */
-function mrbsCheckFree($room_id, $starttime, $endtime, $ignore, $repignore)
-{
-	global $tbl_entry;
-	global $enable_periods;
-    global $periods;
-
-    # Select any meetings which overlap ($starttime,$endtime) for this room:
-	$sql = "SELECT id, name, start_time FROM $tbl_entry WHERE
-		start_time < $endtime AND end_time > $starttime
-		AND room_id = $room_id";
-
-	if ($ignore > 0)
-		$sql .= " AND id <> $ignore";
-	if ($repignore > 0)
-		$sql .= " AND repeat_id <> $repignore";
-	$sql .= " ORDER BY start_time";
-
-	$res = sql_query($sql);
-	if(! $res)
-		return sql_error();
-	if (sql_count($res) == 0)
-	{
-		sql_free($res);
-		return "";
-	}
-	# Get the room's area ID for linking to day, week, and month views:
-	$area = mrbsGetRoomArea($room_id);
-	
-	# Build a string listing all the conflicts:
-	$err = "";
-	for ($i = 0; ($row = sql_row($res, $i)); $i++)
-	{
-		$starts = getdate($row[2]);
-		$param_ym = "area=$area&year=$starts[year]&month=$starts[mon]";
-		$param_ymd = $param_ym . "&day=$starts[mday]";
-
-
-		if( $enable_periods ) {
-        	$p_num =$starts['minutes'];
-        	$startstr = utf8_strftime('%A %d %B %Y, ', $row[2]) . $periods[$p_num];
-        }
-		else
-        	$startstr = utf8_strftime('%A %d %B %Y %H:%M:%S', $row[2]);
-
-        $err .= "<LI><A HREF=\"view_entry.php?id=$row[0]\">$row[1]</A>"
-		. " ( " . $startstr . ") "
-		. "(<A HREF=\"day.php?$param_ymd\">".get_vocab("viewday")."</a>"
-		. " | <A HREF=\"week.php?room=$room_id&$param_ymd\">".get_vocab("viewweek")."</a>"
-		. " | <A HREF=\"month.php?room=$room_id&$param_ym\">".get_vocab("viewmonth")."</a>)";
-	}
-	
-	return $err;
-}
-
-/** mrbsDelEntry()
- * 
- * Delete an entry, or optionally all entrys.
- * 
- * $user   - Who's making the request
- * $id     - The entry to delete
- * $series - If set, delete the series, except user modified entrys
- * $all    - If set, include user modified entrys in the series delete
- *
- * Returns:
- *   0        - An error occured
- *   non-zero - The entry was deleted
- */
-function mrbsDelEntry($user, $id, $series, $all)
-{
-	global $tbl_entry, $tbl_repeat;
-
-	$repeat_id = sql_query1("SELECT repeat_id FROM $tbl_entry WHERE id=$id");
-	if ($repeat_id < 0)
-		return 0;
-	
-	$sql = "SELECT create_by, id, entry_type FROM $tbl_entry WHERE ";
-	
-	if($series)
-		$sql .= "repeat_id=$repeat_id";
-	else
-		$sql .= "id=$id";
-	
-	$res = sql_query($sql);
-	
-	$removed = 0;
-	
-	for ($i = 0; ($row = sql_row($res, $i)); $i++)
-	{
-		if(!getWritable($row[0], $user))
-			continue;
-		
-		if($series && $row[2] == 2 && !$all)
-			continue;
-		
-		if (sql_command("DELETE FROM $tbl_entry WHERE id=" . $row[1]) > 0)
-			$removed++;
-	}
-	
-	if ($repeat_id > 0 &&
-            sql_query1("SELECT count(*) FROM $tbl_entry WHERE repeat_id=$repeat_id") == 0)
-		sql_command("DELETE FROM $tbl_repeat WHERE id=$repeat_id");
-	
-	return $removed > 0;
-}
-
-/** mrbsCreateSingleEntry()
- * 
- * Create a single (non-repeating) entry in the database
- * 
- * $starttime   - Start time of entry
- * $endtime     - End time of entry
- * $entry_type  - Entry type
- * $repeat_id   - Repeat ID
- * $room_id     - Room ID
- * $owner       - Owner
- * $name        - Name
- * $type        - Type (Internal/External)
- * $description - Description
- * 
- * Returns:
- *   0        - An error occured while inserting the entry
- *   non-zero - The entry's ID
- */
-function mrbsCreateSingleEntry($starttime, $endtime, $entry_type, $repeat_id, $room_id,
-                               $owner, $name, $type, $description)
-{
-	global $tbl_entry;
-
-	$name        = slashes($name);
-	$description = slashes($description);
-	
-	# make sure that any entry is of a positive duration
-	# this is to trap potential negative duration created when DST comes
-	# into effect
-	if( $endtime > $starttime )
-	$sql = "INSERT INTO $tbl_entry (  start_time,   end_time,   entry_type,    repeat_id,   room_id,
-	                                  create_by,    name,       type,          description)
-	                        VALUES ($starttime, $endtime, $entry_type, $repeat_id, $room_id,
-	                                '$owner',     '$name',    '$type',       '$description')";
-	
-	if (sql_command($sql) < 0) return 0;
-	
-	return sql_insert_id("$tbl_entry", "id");
-}
-
-/** mrbsCreateRepeatEntry()
- * 
- * Creates a repeat entry in the data base
- * 
- * $starttime   - Start time of entry
- * $endtime     - End time of entry
- * $rep_type    - The repeat type
- * $rep_enddate - When the repeating ends
- * $rep_opt     - Any options associated with the entry
- * $room_id     - Room ID
- * $owner       - Owner
- * $name        - Name
- * $type        - Type (Internal/External)
- * $description - Description
- * 
- * Returns:
- *   0        - An error occured while inserting the entry
- *   non-zero - The entry's ID
- */
-function mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt,
-                               $room_id, $owner, $name, $type, $description, $rep_num_weeks)
-{
-	global $tbl_repeat;
-
-	$name        = slashes($name);
-	$description = slashes($description);
-	
-	// Let's construct the sql statement:
-	$sql_coln = array(); $sql_val = array();
-
-        // Mandatory things:
-	$sql_coln[] = 'start_time'; 	$sql_val[] = $starttime;
-	$sql_coln[] = 'end_time'; 	$sql_val[] = $endtime;
-	$sql_coln[] = 'rep_type'; 	$sql_val[] = $rep_type;
-	$sql_coln[] = 'end_date';	$sql_val[] = $rep_enddate;
-	$sql_coln[] = 'room_id';	$sql_val[] = $room_id;
-	$sql_coln[] = 'create_by';	$sql_val[] = '\''.$owner.'\'';
-	$sql_coln[] = 'type';		$sql_val[] = '\''.$type.'\'';
-	$sql_coln[] = 'name';		$sql_val[] = '\''.$name.'\'';
-
-	// Optional things, pgsql doesn't like empty strings!
-	if (!empty($rep_opt))
-		{$sql_coln[] = 'rep_opt';	$sql_val[] = '\''.$rep_opt.'\'';}
-	else
-		{$sql_coln[] = 'rep_opt';	$sql_val[] = '\'0\'';}
-	if (!empty($description))
-		{$sql_coln[] = 'description';	$sql_val[] = '\''.$description.'\'';}
-	if (!empty($rep_num_weeks))
-		{$sql_coln[] = 'rep_num_weeks';	$sql_val[] = $rep_num_weeks;}
-
-	$sql = 'INSERT INTO ' . $tbl_repeat .
-	       ' (' . implode(', ',$sql_coln) . ') '.
-	       'VALUES (' . implode(', ',$sql_val) . ')';
-
-	if (sql_command($sql) < 0) return 0;
-	
-	return sql_insert_id("$tbl_repeat", "id");
-}
-
-/** same_day_next_month()
-* Find the same day of the week in next month, same week number.
-*
-* Return the number of days to step forward for a "monthly repeat,
-* corresponding day" serie - same week number and day of week next month.
-* This function always returns either 28 or 35.
-* For dates in the 5th week of a month, the resulting day will be in the 4th
-* week of the next month if no 5th week corresponding day exist.
-* :TODO: thierry_bo 030510: repeat 5th week entries only if 5th week exist.
-* If we want a 5th week repeat type, only 5th weeks have to be booked. We need
-* also a new "monthly repeat, corresponding day, last week of the month" type.
-*
-* @param    integer     $time           timestamp of the day from which we want to find
-*                                       the same day of the week in next month, same
-*                                       week number
-* @return   integer     $days_jump      number of days to step forward to find the next occurence (28 or 35)
-* @var      integer     $days_in_month  number of days in month
-* @var      integer     $day            day of the month (01 to 31)
-* @var      integer     $weeknumber     week number for each occurence ($time)
-* @var      boolean     $temp1          first step to compute $days_jump
-* @var      integer     $next_month     intermediate next month number (1 to 12)
-* @global   integer     $_initial_weeknumber    used only for 5th weeks repeat type
- */
-function same_day_next_month($time)
-{
-    global $_initial_weeknumber;
-
-    $days_in_month = date("t", $time);
-    $day = date("d", $time);
-    $weeknumber = (int)(($day - 1) / 7) + 1;
-    $temp1 = ($day + 7 * (5 - $weeknumber) <= $days_in_month);
-
-    // keep month number > 12 for the test purpose in line beginning with "days_jump = 28 +..."
-    $next_month = date("n", mktime(11, 0 ,0, date("n", $time), $day +35, date("Y", $time))) + (date("n", mktime(11, 0 ,0, date("n", $time), $day +35, date("Y", $time))) < date("n", $time)) * 12;
-
-    // prevent 2 months jumps if $time is in 5th week
-    $days_jump = 28 + (($temp1 && !($next_month - date("n", $time) - 1)) * 7);
-
-    /* if initial week number is 5 and the new occurence month number ($time + $days_jump)
-     * is not changed if we add 7 days, then we can add 7 days to $days_jump to come
-     * back to the 5th week (yuh!) */
-    $days_jump += 7 * (($_initial_weeknumber == 5) && (date("n", mktime(11, 0 ,0, date("n", $time), $day + $days_jump, date("Y", $time))) == date("n", mktime(11, 0 ,0, date("n", $time), $day + $days_jump + 7, date("Y", $time)))));
-
-    return $days_jump;
-}
-
-/** mrbsGetRepeatEntryList
- * 
- * Returns a list of the repeating entrys
- * 
- * $time     - The start time
- * $enddate  - When the repeat ends
- * $rep_type - What type of repeat is it
- * $rep_opt  - The repeat entrys
- * $max_ittr - After going through this many entrys assume an error has occured
- * $_initial_weeknumber - Save initial week number for use in 'monthly repeat same week number' case
- * 
- * Returns:
- *   empty     - The entry does not repeat
- *   an array  - This is a list of start times of each of the repeat entrys
- */
-function mrbsGetRepeatEntryList($time, $enddate, $rep_type, $rep_opt, $max_ittr, $rep_num_weeks)
-{
-	$sec   = date("s", $time);
-	$min   = date("i", $time);
-	$hour  = date("G", $time);
-	$day   = date("d", $time);
-	$month = date("m", $time);
-	$year  = date("Y", $time);
-
-	global $_initial_weeknumber;
-	$_initial_weeknumber = (int)(($day - 1) / 7) + 1;
-	$week_num = 0;
-	$start_day = date('w', mktime($hour, $min, $sec, $month, $day, $year));
-	$cur_day = $start_day;
-
-	$entrys = "";
-	for($i = 0; $i < $max_ittr; $i++)
-	{
-		$time = mktime($hour, $min, $sec, $month, $day, $year);
-		if ($time > $enddate)
-			break;
-
-		$entrys[$i] = $time;
-		
-		switch($rep_type)
-		{
-			// Daily repeat
-			case 1:
-				$day += 1;
-				break;
-			
-			// Weekly repeat
-			case 2:
-				$j = $cur_day = date("w", $entrys[$i]);
-				// Skip over days of the week which are not enabled:
-				while (($j = ($j + 1) % 7) != $cur_day && !$rep_opt[$j])
-					$day += 1;
-
-				$day += 1;
-				break;
-			
-			// Monthly repeat
-			case 3:
-				$month += 1;
-				break;
-			
-			// Yearly repeat
-			case 4:
-				$year += 1;
-				break;
-			
-			// Monthly repeat on same week number and day of week
-			case 5:
-				$day += same_day_next_month($time);
-				break;
-
-			// n Weekly repeat
-			case 6:
-
-				while (1)
-				{
-					$day++;
-					$cur_day = ($cur_day + 1) % 7;
-
-					if (($cur_day % 7) == $start_day)
-					{
-						$week_num++;
-					}
-
-					if (($week_num % $rep_num_weeks == 0) &&
-					    ($rep_opt[$cur_day] == 1))
-					{
-						break;
-					}
-				}
-
-				break;	
-				
-			// Unknown repeat option
-			default:
-				return;
-		}
-	}
-
-	return $entrys;
-}
-
-/** mrbsCreateRepeatingEntrys()
- * 
- * Creates a repeat entry in the data base + all the repeating entrys
- * 
- * $starttime   - Start time of entry
- * $endtime     - End time of entry
- * $rep_type    - The repeat type
- * $rep_enddate - When the repeating ends
- * $rep_opt     - Any options associated with the entry
- * $room_id     - Room ID
- * $owner       - Owner
- * $name        - Name
- * $type        - Type (Internal/External)
- * $description - Description
- * 
- * Returns:
- *   0        - An error occured while inserting the entry
- *   non-zero - The entry's ID
- */
-function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt,
-                                   $room_id, $owner, $name, $type, $description, $rep_num_weeks)
-{
-	global $max_rep_entrys;
-	
-	$reps = mrbsGetRepeatEntryList($starttime, $rep_enddate, $rep_type, $rep_opt, $max_rep_entrys, $rep_num_weeks);
-	if(count($reps) > $max_rep_entrys)
-		return 0;
-	
-	if(empty($reps))
-	{
-		$ent = mrbsCreateSingleEntry($starttime, $endtime, 0, 0, $room_id, $owner, $name, $type, $description);
-		return $ent;
-	}
-	
-	$ent = mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $owner, $name, $type, $description, $rep_num_weeks);
-	if($ent)
-	{
-	
-		for($i = 0; $i < count($reps); $i++)
-		{
-			# calculate diff each time and correct where events
-			# cross DST
-			$diff = $endtime - $starttime;
-			$diff += cross_dst($reps[$i], $reps[$i] + $diff);
-	    
-			mrbsCreateSingleEntry($reps[$i], $reps[$i] + $diff, 1, $ent,
-				 $room_id, $owner, $name, $type, $description);
-		}
-	}
-	return $ent;
-}
-
-/* mrbsGetEntryInfo()
- *
- * Get the booking's entrys
- * 
- * $id = The ID for which to get the info for.
- * 
- * Returns:
- *    nothing = The ID does not exist
- *    array   = The bookings info
- */
-function mrbsGetEntryInfo($id)
-{
-	global $tbl_entry;
-
-	$sql = "SELECT start_time, end_time, entry_type, repeat_id, room_id,
-	               timestamp, create_by, name, type, description
-                FROM $tbl_entry WHERE (ID = $id)";
-	
-	$res = sql_query($sql);
-	if (! $res) return;
-	
-	$ret = "";
-	if(sql_count($res) > 0)
-	{
-		$row = sql_row($res, 0);
-		
-		$ret["start_time"]  = $row[0];
-		$ret["end_time"]    = $row[1];
-		$ret["entry_type"]  = $row[2];
-		$ret["repeat_id"]   = $row[3];
-		$ret["room_id"]     = $row[4];
-		$ret["timestamp"]   = $row[5];
-		$ret["create_by"]   = $row[6];
-		$ret["name"]        = $row[7];
-		$ret["type"]        = $row[8];
-		$ret["description"] = $row[9];
-	}
-	sql_free($res);
-	
-	return $ret;
-}
-
-function mrbsGetRoomArea($id)
-{
-	global $tbl_room;
-
-	$id = sql_query1("SELECT area_id FROM $tbl_room WHERE (id = $id)");
-	if ($id <= 0) return 0;
-	return $id;
-}
-
-?>
\ No newline at end of file
Index: web/pgsql.inc
===================================================================
RCS file: web/pgsql.inc
diff -N web/pgsql.inc
--- web/pgsql.inc	25 Apr 2004 18:10:58 -0000	1.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,257 +0,0 @@
-<?php
-// $Id: pgsql.inc,v 1.6 2004/04/25 18:10:58 jflarvoire Exp $
-
-// pgsql.inc - Simple PHP database support for PostgreSQL.
-// Include this file after defining the following variables:
-//   $db_host = The hostname of the database server
-//   $db_login = The username to use when connecting to the database
-//   $db_password = The database account password
-//   $db_database = The database name.
-// Including this file connects you to the database, or exits on error.
-// This code hides an implementation difference in error reporting by the PHP
-// PostgreSQL and MySQL extensions. PostgreSQL reports an E_WARNING error
-// for some queries which MySQL does not; both properly set their own
-// error code and the PHP error raised by PostgreSQL is not needed.
-// The code here turns that off with error_reporting() calls around each
-// pg_exec call, so as not to make you change the display_errors
-// setting in your php.ini configuration file.
-
-
-// Free a results handle. You need not call this if you call sql_row or
-// sql_row_keyed until the row returns 0, since sql_row frees the results
-// handle when you finish reading the rows.
-function sql_free ($r)
-{
-	pg_free_result($r);
-}
-
-// Execute a non-SELECT SQL command (insert/update/delete).
-// Returns the number of tuples affected if OK (a number >= 0).
-// Returns -1 on error; use sql_error to get the error message.
-function sql_command ($sql)
-{
-	global $db_c;
-	$e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
-	$r = pg_query($db_c, $sql);
-	error_reporting($e);
-	if (! $r) return -1;
-	$n = pg_affected_rows($r);
-	pg_free_result($r);
-	return $n;
-}
-
-// Execute an SQL query which should return a single non-negative number value.
-// This is a lightweight alternative to sql_query, good for use with count(*)
-// and similar queries. It returns -1 on error or if the query did not return
-// exactly one value, so error checking is somewhat limited.
-// It also returns -1 if the query returns a single NULL value, such as from
-// a MIN or MAX aggregate function applied over no rows.
-function sql_query1 ($sql)
-{
-	global $db_c;
-	$e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
-	$r = pg_query($db_c, $sql);
-	error_reporting($e);
-	if (! $r) return -1;
-	if (pg_num_rows($r) != 1 || pg_num_fields($r) != 1
-		|| ($result = pg_fetch_result($r, 0, 0)) == "") $result = -1;
-	pg_free_result($r);
-	return $result;
-}
-
-// Execute an SQL query. Returns a database-dependent result handle,
-// which should be passed back to sql_row or sql_row_keyed to get the results.
-// Returns 0 on error; use sql_error to get the error message.
-function sql_query ($sql)
-{
-	global $db_c;
-	$e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
-	$r = pg_query($db_c, $sql);
-	error_reporting($e);
-	return $r;
-}
-
-// Return a row from a result. The first row is 0.
-// The row is returned as an array with index 0=first column, etc.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-// Typical usage: $i = 0; while ((a = sql_row($r, $i++))) { ... }
-function sql_row ($r, $i)
-{
-	if ($i >= pg_num_rows($r))
-	{
-		pg_free_result($r);
-		return 0;
-	}
-	return pg_fetch_row($r, $i);
-}
-
-// Return a row from a result as an associative array keyed by field name.
-// The first row is 0.
-// This is actually upward compatible with sql_row since the underlying
-// routing also stores the data under number indexes.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-function sql_row_keyed ($r, $i)
-{
-	if ($i >= pg_num_rows($r))
-	{
-		pg_free_result($r);
-		return 0;
-	}
-	return pg_fetch_array($r, $i);
-}
-
-// Return the number of rows returned by a result handle from sql_query.
-function sql_count ($r)
-{
-	return pg_num_rows($r);
-}
-
-// Return the value of an autoincrement field from the last insert.
-// For PostgreSQL, this must be a SERIAL type field.
-function sql_insert_id($table, $field)
-{
-	$seq_name = $table . "_" . $field . "_seq";
-	return sql_query1("select last_value from $seq_name");
-}
-
-// Return the text of the last error message.
-function sql_error()
-{
-	global $db_c;
-	return pg_last_error($db_c);
-}
-
-// Begin a transaction, if the database supports it. This is used to
-// improve PostgreSQL performance for multiple insert/delete/updates.
-// There is no rollback support, since MySQL doesn't support it.
-function sql_begin()
-{
-	sql_command("BEGIN");
-}
-
-// Commit (end) a transaction. See sql_begin().
-function sql_commit()
-{
-	sql_command("COMMIT");
-}
-
-// Acquire a mutual-exclusion lock on the named table. For portability:
-// This will not lock out SELECTs.
-// It may lock out DELETE/UPDATE/INSERT or not, depending on the implementation.
-// It will lock out other callers of this routine with the same name argument.
-// It may timeout in 20 seconds and return 0, or may wait forever.
-// It returns 1 when the lock has been acquired.
-// Caller must release the lock with sql_mutex_unlock().
-// Caller must not have more than one mutex at any time.
-// Do not mix this with sql_begin()/sql_end() calls.
-//
-// In PostgreSQL, the EXCLUSIVE mode lock excludes all but SELECT.
-// It does not timeout, but waits forever for the lock.
-function sql_mutex_lock($name)
-{
-	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
-	if (sql_command("BEGIN") < 0
-		|| sql_command("LOCK TABLE $name IN EXCLUSIVE MODE") < 0) return 0;
-	$sql_mutex_unlock_name = $name;
-	if (empty($sql_mutex_shutdown_registered))
-	{
-		register_shutdown_function("sql_mutex_cleanup");
-		$sql_mutex_shutdown_registered = 1;
-	}
-	return 1;
-}
-
-// Release a mutual-exclusion lock on the named table. See sql_mutex_lock.
-// In PostgreSQL, all locks are released by closing the transaction; there
-// is no other way.
-function sql_mutex_unlock($name)
-{
-	global $sql_mutex_unlock_name;
-	sql_command("COMMIT");
-	$sql_mutex_unlock_name = "";
-}
-
-// Shutdown function to clean up a forgotten lock. For internal use only.
-function sql_mutex_cleanup()
-{
-	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
-	if (!empty($sql_mutex_unlock_name))
-	{
-		sql_command("ABORT");
-		$sql_mutex_unlock_name = "";
-	}
-}
-
-// Return a string identifying the database version:
-function sql_version()
-{
-	$r = sql_query("select version()");
-	$v = sql_row($r, 0);
-	sql_free($r);
-	return $v[0];
-}
-
-// Generate non-standard SQL for LIMIT clauses:
-function sql_syntax_limit($count, $offset)
-{
-	return " LIMIT $count OFFSET $offset ";
-}
-
-// Generate non-standard SQL to output a TIMESTAMP as a Unix-time:
-function sql_syntax_timestamp_to_unix($fieldname)
-{
-	return " DATE_PART('epoch', $fieldname) ";
-}
-
-// Generate non-standard SQL to match a string anywhere in a field's value
-// in a case insensitive manner. $s is the un-escaped/un-slashed string.
-// In PostgreSQL, we can do case insensitive regexp with ~*, but not case
-// insensitive LIKE matching.
-// Quotemeta escapes everything we need except for single quotes.
-function sql_syntax_caseless_contains($fieldname, $s)
-{
-	$s = quotemeta($s);
-	$s = str_replace("'", "''", $s);
-	return " $fieldname ~* '$s' ";
-}
-
-// Returns the name of a field.
-function sql_field_name($result, $index)
-{
-	return pg_field_name($result, $index);
-}
-
-// Returns the type of a field. (one of "int", "real", "string", "blob", etc...)
-function sql_field_type($result, $index)
-{
-	return pg_field_type($result, $index);
-}
-
-// Returns the number of fields in a result.
-function sql_num_fields($result)
-{
-	return pg_num_fields($result);
-}
-
-// Establish a database connection.
-// On connection error, the message will be output without a proper HTML
-// header. There is no way I can see around this; if track_errors isn't on
-// there seems to be no way to supress the automatic error message output and
-// still be able to access the error text.
-$conninfo = (empty($db_host) ? "" : "host=$db_host ")
-	. "dbname=$db_database user=$db_login password=$db_password";
-if (empty($db_nopersist))
-	$db_c = pg_pconnect($conninfo);
-else
-	$db_c = pg_connect($conninfo);
-unset($conninfo);
-
-if (!$db_c)
-{
-	echo "\n<p>\n" . get_vocab("failed_connect_db") . "\n";
-	exit;
-}
-
-?>
Index: web/auth_db_ext.inc
===================================================================
RCS file: web/auth_db_ext.inc
diff -N web/auth_db_ext.inc
--- web/auth_db_ext.inc	20 Aug 2005 09:46:44 -0000	1.1.2.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,130 +0,0 @@
-<?php
-/*****************************************************************************\
-*									      *
-*   File name       auth_db_ext.inc					      *
-*									      *
-*   Description	    Authenticate users from a table in another database.      *
-*									      *
-*   Notes	    To use this authentication scheme, set in config.inc.php: *
-*			$auth["type"]  = "db_ext";			      *
-*                   Assumes passwords are stored in the other table in        *
-*                   plaintext, authValidateUser() will need to be changed if  *
-*                   the password is stored differently.                       *
-*									      *
-*   History								      *
-*    2005/05/11 JPB Created this file					      *
-*									      *
-\*****************************************************************************/
-
-// $Id: auth_db_ext.inc,v 1.1.2.2 2005/08/20 09:46:44 jberanek Exp $
-
-
-/* authValidateUser($user, $pass)
- * 
- * Checks if the specified username/password pair are valid
- * 
- * $user  - The user name
- * $pass  - The password
- * 
- * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
- */
-
-function authValidateUser($user, $pass)
-{
-   global $auth;
-
-   $retval = 0;
-
-   $user=strtolower($user);
-
-   $conn = mysql_connect($auth['db_ext']['db_host'],
-                         $auth['db_ext']['db_username'],
-                         $auth['db_ext']['db_password']);
-
-   mysql_select_db($auth['db_ext']['db_name'], $conn);
-
-   $user = addslashes($user);
-
-   if ($auth['db_ext']['use_md5_passwords'] == 1)
-   {
-     $pass = md5($pass);
-   }
-
-   $query = "SELECT " . $auth['db_ext']['column_name_password'] .
-            " FROM " . $auth['db_ext']['db_table'] .
-            " WHERE ". $auth['db_ext']['column_name_username'] . "='$user'";
-
-   $r = mysql_query($query, $conn);
-
-   if ($r && (mysql_num_rows($r) == 1)) // force a unique match
-   {
-     $row = mysql_fetch_row($r);
-
-     switch ($auth['db_ext']['password_format'])
-     {
-       case 'md5':
-         if (md5($pass) == $row[0])
-         {
-           $retval = 1;
-         }
-         break;
-
-       case 'sha1':
-         if (sha1($pass) == $row[0])
-         {
-           $retval = 1;
-         }
-         break;
-
-       case 'crypt':
-         $recrypt = crypt($pass,$row[0]);
-         if ($row[0] == $recrypt)
-         {
-           $retval = 1;
-         }
-         break;
-
-       default:
-         // Otherwise assume plaintext
-         if ($pass == $row[0])
-         {
-           $retval = 1;
-         }
-         break;
-     }
-   }
-
-   mysql_close($conn);
-
-   return $retval;
-}
-
-/* authGetUserLevel($user)
- * 
- * Determines the users access level
- * 
- * $user - The user name
- *
- * Returns:
- *   The users access level
- */
-function authGetUserLevel($user, $lev1_admin)
-{
-   // User not logged in, user level '0'
-   if(!isset($user))
-      return 0;
-
-   // Check if the user is can modify
-   for($i = 0; isset($lev1_admin[$i]); $i++)
-   {
-      if(strcasecmp($user, $lev1_admin[$i]) == 0)
-	 return 2;
-   }
-
-   // Everybody else is access level '1'
-   return 1;
-}
-
-?>
Index: web/session_remote_user.inc
===================================================================
RCS file: web/session_remote_user.inc
diff -N web/session_remote_user.inc
--- web/session_remote_user.inc	26 Apr 2006 10:01:43 -0000	1.1.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,90 +0,0 @@
-<?php 
-/********************************************************************************************\
-*                                                                                            *
-*   File name       session_remote_user.inc                                                  *
-*                                                                                            *
-*   Description     Get user identity/password using the REMOTE_USER environment variable.   *
-*                   Both identity and password equal the value of REMOTE_USER.               *
-*                                                                                            *
-*   Notes           To use this session scheme, set in config.inc.php:                       *
-*                     $auth['session']  = 'remote_user';                                     *
-*                     $auth['type'] = 'none';
-*                                                                                            *
-*                   If you want to display a logout link, set in config.inc.php:             *
-*                     $auth['remote_user']['logout_link'] = '/logout/link.html';             *
-*                                                                                            *
-*   History                                                                                  *
-*    2006-01-04 Bjorn.Wiberg@its.uu.se  Created based on session_http.inc                    *
-*    2006-02-16 Bjorn.Wiberg@its.uu.se  Made logout link a configuration item                *
-*                                                                                            *
-\*********************************************************************************************/
-
-// $Id: session_remote_user.inc,v 1.1.2.1 2006/04/26 10:01:43 jberanek Exp $
-
-/* authGet()
- * 
- * Request the user name/password
- * 
- * Returns: Nothing
- */
-function authGet()
-{
-  // User is expected to already be authenticated by the web server, so do nothing
-}
-
-function getUserName()
-{
-  if ((!isset($_SERVER['REMOTE_USER'])) || (!is_string($_SERVER['REMOTE_USER'])) || (empty($_SERVER['REMOTE_USER']))) {
-    return NULL;
-  } else {
-    return $_SERVER['REMOTE_USER'];
-  }
-}
-
-// Print the logon entry on the top banner.
-function PrintLogonBox()
-{
-	global $user_list_link;
-        global $auth;
-  
-	$user = getUserName();
-
-	if (isset($user))
-	{
-	// words 'you are xxxx' becomes a link to the
-        // report page with only entries created by xxx. Past entries are not
-        // displayed but this can be changed
-       	$search_string = "report.php?From_day=$day&From_month=$month&".
-          "From_year=$year&To_day=1&To_month=12&To_year=2030&areamatch=&".
-          "roommatch=&namematch=&descrmatch=&summarize=1&sortby=r&display=d&".
-          "sumby=d&creatormatch=$user"; ?>
-
-    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
-      <A name="logonBox" href="<?php echo "$search_string\" title=\""
-         . get_vocab('show_my_entries') . "\">" . get_vocab('you_are')." "
-         .$user ?></A><br>
-<?php if (isset($user_list_link)) print "	  <br>\n	  " .
-	    "<A href='$user_list_link'>" . get_vocab('user_list') . "</A><br>\n" ;
-?>
-
-<?php
-// Retrieve logout link from configuration, if specified
-if (isset($auth['remote_user']['logout_link']) && is_string($auth['remote_user']['logout_link']) && (!empty($auth['remote_user']['logout_link']))) {
-  print '<A HREF="' . $auth['remote_user']['logout_link'] .'">' . get_vocab('logoff') . "</A><BR>\n";
-}
-?>
-
-    </TD>
-<?php
-    }
-    else
-    {
-?>
-    </TABLE>
-    <H1>Error, REMOTE_USER was not set when it should have been</H1>
-<?php
-    exit;
-    }
-}
-
-?>
Index: web/lang.nl
===================================================================
RCS file: web/lang.nl
diff -N web/lang.nl
--- web/lang.nl	14 Sep 2004 09:01:26 -0000	1.16.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-<?php
-# $Id: lang.nl,v 1.16.2.1 2004/09/14 09:01:26 jberanek Exp $
-
-# This file contains PHP code that specifies language specific strings
-# The default strings come from lang.en, and anything in a locale
-# specific file will overwrite the default. This is an NL Dutch file.
-#
-# Translations provided by: Marc ter Horst
-#
-#
-# This file is PHP code. Treat it as such.
-
-# The charset to use in "Content-type" header
-$vocab["charset"]            = "iso-8859-1";
-
-# Used in style.inc
-$vocab["mrbs"]               = "Vergaderruimte Boekingssysteem";
-
-# Used in functions.inc
-$vocab["report"]             = "Rapportage";
-$vocab["admin"]              = "Admin";
-$vocab["help"]               = "Help";
-$vocab["search"]             = "Zoek:";
-$vocab["not_php3"]             = "<H1>Waarschuwing: Werkt waarschijnlijk niet met PHP3</H1>";
-
-# Used in day.php
-$vocab["bookingsfor"]        = "Boekingen voor";
-$vocab["bookingsforpost"]    = "";
-$vocab["areas"]              = "Gebouwen";
-$vocab["daybefore"]          = "Naar Vorige Dag";
-$vocab["dayafter"]           = "Naar Volgende Dag";
-$vocab["gototoday"]          = "Naar Vandaag";
-$vocab["goto"]               = "ga naar";
-$vocab["highlight_line"]     = "Markeer deze regel";
-$vocab["click_to_reserve"]   = "Klik op dit vak om een reservering te maken.";
-
-# Used in trailer.inc
-$vocab["viewday"]            = "Bekijk Dag";
-$vocab["viewweek"]           = "Bekijk Week";
-$vocab["viewmonth"]          = "Bekijk Maand";
-$vocab["ppreview"]           = "Afdruk Voorbeeld";
-
-# Used in edit_entry.php
-$vocab["addentry"]           = "Boeking Toevoegen";
-$vocab["editentry"]          = "Boeking Wijzigen";
-$vocab["editseries"]         = "Wijzig Reeks";
-$vocab["namebooker"]         = "Korte Omschrijving:";
-$vocab["fulldescription"]    = "Volledige Omschrijving:<br>&nbsp;&nbsp;(Aantal mensen,<br>&nbsp;&nbsp;Intern/Extern etc)";
-$vocab["date"]               = "Datum:";
-$vocab["start_date"]         = "Start Tijd:";
-$vocab["end_date"]           = "Eind Tijd:";
-$vocab["time"]               = "Tijd:";
-$vocab["period"]             = "Period:";
-$vocab["duration"]           = "Tijdsduur:";
-$vocab["seconds"]            = "seconden";
-$vocab["minutes"]            = "minuten";
-$vocab["hours"]              = "uren";
-$vocab["days"]               = "dagen";
-$vocab["weeks"]              = "weken";
-$vocab["years"]              = "jaren";
-$vocab["periods"]            = "periods";
-$vocab["all_day"]            = "Hele Dag";
-$vocab["type"]               = "Soort:";
-$vocab["internal"]           = "Intern";
-$vocab["external"]           = "Extern";
-$vocab["save"]               = "Opslaan";
-$vocab["rep_type"]           = "Soort Herhaling:";
-$vocab["rep_type_0"]         = "Geen";
-$vocab["rep_type_1"]         = "Dagelijks";
-$vocab["rep_type_2"]         = "Wekelijks";
-$vocab["rep_type_3"]         = "Maandelijks";
-$vocab["rep_type_4"]         = "Jaarlijks";
-$vocab["rep_type_5"]         = "Maandelijks, Overeenkomstige dag";
-$vocab["rep_type_6"]         = "n-wekelijks";
-$vocab["rep_end_date"]       = "Einde herhaling datum:";
-$vocab["rep_rep_day"]        = "Herhalingsdag:";
-$vocab["rep_for_weekly"]     = "(t.b.v. wekelijks)";
-$vocab["rep_freq"]           = "Frequentie:";
-$vocab["rep_num_weeks"]      = "Aantal weken";
-$vocab["rep_for_nweekly"]    = "(Voor n-wekelijks)";
-$vocab["ctrl_click"]         = "Gebruik Control-Linker muis klik om meer dan 1 ruimte te reserveren";
-$vocab["entryid"]            = "Boeking-ID ";
-$vocab["repeat_id"]          = "Herhalings-ID "; 
-$vocab["you_have_not_entered"] = "U heeft het volgende niet ingevoerd : ";
-$vocab["you_have_not_selected"] = "U heeft het volgende niet geselecteerd : ";
-$vocab["valid_room"]         = "kamer.";
-$vocab["valid_time_of_day"]  = "geldige tijd.";
-$vocab["brief_description"]  = "Korte Omschrijving.";
-$vocab["useful_n-weekly_value"] = "bruikbaar n-wekelijks aantal.";
-
-# Used in view_entry.php
-$vocab["description"]        = "Omschrijving:";
-$vocab["room"]               = "Kamer";
-$vocab["createdby"]          = "Aangemaakt door:";
-$vocab["lastupdate"]         = "Laatste aanpassing:";
-$vocab["deleteentry"]        = "Boeking verwijderen";
-$vocab["deleteseries"]       = "Herhalingen verwijderen";
-$vocab["confirmdel"]         = "Weet U zeker\\ndat U deze\\nBoeking wilt verwijderen?\\n\\n";
-$vocab["returnprev"]         = "Terug naar vorige pagina";
-$vocab["invalid_entry_id"]   = "Ongeldig Boeking-ID.";
-$vocab["invalid_series_id"]  = "Ongeldig Herhalings-ID.";
-
-# Used in edit_entry_handler.php
-$vocab["error"]              = "Fout";
-$vocab["sched_conflict"]     = "Overlappende Boeking";
-$vocab["conflict"]           = "De nieuwe boeking overlapt de volgende boeking(en):";
-$vocab["too_may_entrys"]     = "De door U geselecteerde opties zullen teveel boekingen genereren.<BR>Pas A.U.B. uw opties aan !";
-$vocab["returncal"]          = "Terug naar kalender overzicht";
-$vocab["failed_to_acquire"]  = "Het is niet gelukt om exclusive toegang tot de database te verkrijgen"; 
-$vocab["mail_subject_entry"] = $mail["subject"];
-$vocab["mail_body_new_entry"] = $mail["new_entry"];
-$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
-$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
-$vocab["mail_subject_delete"] = $mail["subject_delete"];
-
-# Authentication stuff
-$vocab["accessdenied"]       = "Geen Toegang";
-$vocab["norights"]           = "U heeft geen rechten om deze boeking aan te passen.";
-$vocab["please_login"]       = "Inloggen A.U.B";
-$vocab["user_name"]          = "Naam";
-$vocab["user_password"]      = "Wachtwoord";
-$vocab["unknown_user"]       = "Onbekende gebruiker";
-$vocab["you_are"]            = "U bent";
-$vocab["login"]              = "Inloggen";
-$vocab["logoff"]             = "Uitloggen";
-
-# Authentication database
-$vocab["user_list"]          = "Gebruikerslijst";
-$vocab["edit_user"]          = "Gebruiker aanpassen";
-$vocab["delete_user"]        = "Deze gebruiker verwijderen";
-#$vocab["user_name"]         = Use the same as above, for consistency.
-#$vocab["user_password"]     = Use the same as above, for consistency.
-$vocab["user_email"]         = "Email adres";
-$vocab["password_twice"]     = "Als u het wachtwoord wilt wijzigen dient u het nieuwe wachtwoord tweemaal in te voeren.";
-$vocab["passwords_not_eq"]   = "Fout: De wachtwoorden komen niet overeen.";
-$vocab["add_new_user"]       = "Nieuwe gebruiker toevoegen";
-$vocab["rights"]             = "Rechten";
-$vocab["action"]             = "Handelingen";
-$vocab["user"]               = "Gebruiker";
-$vocab["administrator"]      = "Beheerder";
-$vocab["unknown"]            = "Onbekend";
-$vocab["ok"]                 = "OK";
-$vocab["show_my_entries"]    = "Klikken om al mijn aankomende boekingen te tonen.";
-
-# Used in search.php
-$vocab["invalid_search"]     = "Niet bestaand of ongeldig zoek argument.";
-$vocab["search_results"]     = "Zoek resultaten voor:";
-$vocab["nothing_found"]      = "Geen resultaten voor uw zoek opdracht gevonden.";
-$vocab["records"]            = "Boekingregels ";
-$vocab["through"]            = " tot en met ";
-$vocab["of"]                 = " van ";
-$vocab["previous"]           = "Vorige";
-$vocab["next"]               = "Volgende";
-$vocab["entry"]              = "Boeking";
-$vocab["view"]               = "Overzicht";
-$vocab["advanced_search"]    = "Advanced search";
-$vocab["search_button"]      = "Zoek";
-$vocab["search_for"]         = "Zoeken naar";
-$vocab["from"]               = "Van";
-
-# Used in report.php
-$vocab["report_on"]          = "Boekingsoverzicht:";
-$vocab["report_start"]       = "Start datum overzicht:";
-$vocab["report_end"]         = "Eind datum overzicht:";
-$vocab["match_area"]         = "Gebied als:";
-$vocab["match_room"]         = "Kamer als:";
-$vocab["match_type"]         = "Match type:";
-$vocab["ctrl_click_type"]    = "Gebruik Control-Linker muis klik om meer dan 1 type te selekteren";
-$vocab["match_entry"]        = "Korte omschrijving als:";
-$vocab["match_descr"]        = "Volledige omschrijving als:";
-$vocab["include"]            = "Neem mee:";
-$vocab["report_only"]        = "Alleen overzicht";
-$vocab["summary_only"]       = "Alleen samenvatting";
-$vocab["report_and_summary"] = "Overzicht en samenvatting";
-$vocab["summarize_by"]       = "Samenvatten volgens:";
-$vocab["sum_by_descrip"]     = "Korte omschrijving";
-$vocab["sum_by_creator"]     = "Boeker";
-$vocab["entry_found"]        = "boeking gevonden";
-$vocab["entries_found"]      = "boekingen gevonden";
-$vocab["summary_header"]     = "Totaal aan (geboekte) uren";
-$vocab["summary_header_per"] = "Summary of (Entries) Periods";
-$vocab["total"]              = "Totaal";
-$vocab["submitquery"]        = "Rapport uitvoeren";
-$vocab["sort_rep"]           = "Rapport sorteren op:";
-$vocab["sort_rep_time"]      = "Start Datum/Tijd";
-$vocab["rep_dsp"]            = "Weergeven in rapport:";
-$vocab["rep_dsp_dur"]        = "Duur";
-$vocab["rep_dsp_end"]        = "Eind Tijd";
-
-# Used in week.php
-$vocab["weekbefore"]         = "Ga naar vorige week";
-$vocab["weekafter"]          = "Ga naar volgende week";
-$vocab["gotothisweek"]       = "Ga naar deze week";
-
-# Used in month.php
-$vocab["monthbefore"]        = "Ga naar vorige maand";
-$vocab["monthafter"]         = "Ga naar volgende maand";
-$vocab["gotothismonth"]      = "Ga naar deze maand";
-
-# Used in {day week month}.php
-$vocab["no_rooms_for_area"]  = "Nog geen kamers gedefini�erd voor dit gebouw";
-
-# Used in admin.php
-$vocab["edit"]               = "Wijzig";
-$vocab["delete"]             = "Wis";
-$vocab["rooms"]              = "Kamers";
-$vocab["in"]                 = "in";
-$vocab["noareas"]            = "Gebouwen";
-$vocab["addarea"]            = "Gebouw toevoegen";
-$vocab["name"]               = "Naam";
-$vocab["noarea"]             = "Geen gebouw geselecteerd";
-$vocab["browserlang"]        = "Uw browser is ingesteld op ";
-$vocab["postbrowserlang"]    = "Nederlands.";
-$vocab["addroom"]            = "Kamer toevoegen";
-$vocab["capacity"]           = "Zitplaatsen";
-$vocab["norooms"]            = "Geen Kamers.";
-$vocab["administration"]     = "Beheer";
-
-# Used in edit_area_room.php
-$vocab["editarea"]           = "Gebouw Wijzigen";
-$vocab["change"]             = "Wijzig";
-$vocab["backadmin"]          = "Terug naar Beheer";
-$vocab["editroomarea"]       = "Gebouw of Kamer wijzigen";
-$vocab["editroom"]           = "Kamer wijzigen";
-$vocab["update_room_failed"] = "Wijzigen kamer mislukt: ";
-$vocab["error_room"]         = "Fout: kamer ";
-$vocab["not_found"]          = " niet gevonden";
-$vocab["update_area_failed"] = "Wijzigen gebouw mislukt: ";
-$vocab["error_area"]         = "Fout: gebouw ";
-$vocab["room_admin_email"]   = "Kamer beheer email:";
-$vocab["area_admin_email"]   = "Gebouw beheer email:";
-$vocab["invalid_email"]      = "Ongeldig email adres !";
-
-# Used in del.php
-$vocab["deletefollowing"]    = "U gaat hiermee de volgende boekingen verwijderen";
-$vocab["sure"]               = "Weet U het zeker?";
-$vocab["YES"]                = "JA";
-$vocab["NO"]                 = "NEE";
-$vocab["delarea"]            = "U moet alle kamers in dit gebouw verwijderen voordat U het kunt verwijderen<p>";
-
-# Used in help.php
-$vocab["about_mrbs"]         = "Over MRBS";
-$vocab["database"]           = "Database: ";
-$vocab["system"]             = "Systeem: ";
-$vocab["please_contact"]     = "Neem contact op met ";
-$vocab["for_any_questions"]  = "Voor alle vragen die hier niet worden beantwoord.";
-
-# Used in mysql.inc AND pgsql.inc
-$vocab["failed_connect_db"]  = "Fatale Fout: Verbinding naar database server mislukt";
-
-?>
Index: web/session_omni.inc
===================================================================
RCS file: web/session_omni.inc
diff -N web/session_omni.inc
--- web/session_omni.inc	29 Mar 2005 13:26:27 -0000	1.1.4.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,51 +0,0 @@
-<?php
-
-/* $Id: session_omni.inc,v 1.1.4.1 2005/03/29 13:26:27 jberanek Exp $
- *
- * Session management scheme that relies on OmniHttpd security for user 
- * authentication. THIS is suitable for few users because we have to create all
- * users connecting to MRBS, since they will have to login.
- *
- * To use this authentication scheme set the following things :
- * - Edit your virtual server hosting MRBS.
- * - Select security tab.
- * - IF not yet set, choose "User and Directory" security type. 
- * - Select "Users and groups" tab. 
- * - Here, select "New User" and create as many users (Username/passwords) as 
- *   you have users using MRBS. 
- * - Select "New Group".
- * - Type "MRBS" as group name and add all users you just created to this group.
- * - Now select "Access Control list" tab. 
- * - Select New. ENTER the relative path to MRBS. FOR example, if you created 
- *   the MRBS folder on the root web folder, you should type /MRBS/. 
- * - Now go to "user permission" tab, select " * ",
- * - select Properties", and type MRBS (remove the star) and select "Is group".
- *
- * That's all ! Confirm all windows. Now it is the web server that authenticate
- * each user. 
- *
- * 
- * in config.inc.php:
- *
- * $auth["type"]    = "none";
- * $auth["session"] = "omni";
- *
- * Then, you may configure admin users:
- *
- * $auth["admin"][] = "user1";
- * $auth["admin"][] = "user2";
- */
- 
-/* getAuth()
- * 
- *  No need to prompt for a name - this is done by the server.
- */
-function authGet() { }
-
-function getUserName()
-{
-	global $REMOTE_USER;
-	return $REMOTE_USER;
-}
-
-?>
Index: web/escapeshellarg.inc
===================================================================
RCS file: web/escapeshellarg.inc
diff -N web/escapeshellarg.inc
--- web/escapeshellarg.inc	8 Oct 2002 13:19:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-<?php
-
-/* $Id: escapeshellarg.inc,v 1.1 2002/10/08 13:19:21 jberanek Exp $
- *
- * Included if your PHP version is less than 4.0.3 and therefore this
- * function doesn't exist.
- *
- */
-
-function escapeshellarg($x)
-{
-  return "'".ereg_replace("'", "'\\''", $x)."'";
-} 
-
-?>
Index: mrbs_create.php
===================================================================
RCS file: mrbs_create.php
diff -N mrbs_create.php
--- mrbs_create.php	17 Dec 2004 11:24:36 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,109 +0,0 @@
-<?php
-// +---------------------------------------------------------------------------+
-// | Meeting Room Booking System.
-// +---------------------------------------------------------------------------+
-// | MRBS Database Installation script
-// |---------------------------------------------------------------------------+
-// | How to use this script. Either:
-// | - Run the following command on your shell: $ php mrbs_create.php
-// | or
-// | - Copy mrbs_create.php and mrbs.schema.xml into the same web server 
-// |   directory as mrbs and run it from your web browser.
-// | Note: in either case, mrbs_create.php and mrbs.schema.xml must be in the 
-// |       same directory.
-// +---------------------------------------------------------------------------+
-// | @author    thierry_bo.
-// | @version   $Revision: 1.2 $.
-// +---------------------------------------------------------------------------+
-//
-// $Id: mrbs_create.php,v 1.2 2004/12/17 11:24:36 jberanek Exp $
-
-/**************************
-* Database settings
-* You shouldn't have to modify anything outside this section.
-**************************/
-
-// Choose database system: see INSTALL for the list of supported databases
-// ("mysql"=MySQL,...) and valid strings.
-$dbsys = "mysql";
-
-// Hostname of database server (SID for Oracle) :
-$db_host = "localhost";
-
-// Port of database server. Leave empty to use default for the database
-$db_port = "";
-
-// Database name:
-$db_database = "mrbs";
-
-// Database login user name:
-$db_login = "mrbs";
-
-// Database login password:
-$db_password = "mrbs-password";
-
-// Flag that indicates whether the database should be created or use a
-// previously installed database of the same name. Another circumstance on
-// which this flag may have to be set to 0 is when the DBMS driver does
-// not support database creation or if this operation requires special
-// database administrator permissions that may not be available to the
-// database user.
-// Set $db_create to 0 to NOT create the database.
-$db_create = 1;
-
-// Communication protocol tu use. For pgsql, you can use 'unix' instead of
-// 'tcp' to use Unix Domain Sockets instead of TCP/IP.
-$db_protocol = "tcp";
-
-/**************************
-* DBMS specific options
-***************************/
-
-//****ORACLE*****
-
-// Home directory path where Oracle is installed if it is running in the local machine.
-// Default value: value of the environment variable ORACLE_HOME
-$oci8_home = "";
-
-
-/**************************
-* End of database settings
-***************************/
-
-include_once("MDB.php");
-MDB::loadFile("Manager");
-
-$schema_file = "mrbs.schema.xml";
-$variables = array
-(
-    "database_name"   => $db_database,
-    "database_create" => $db_create
-);
-$dsn = array
-(
-    "phptype"  => $dbsys,
-    "username" => $db_login,
-    "password" => $db_password,
-    "hostspec" => $db_host,
-    "protocol" => $db_protocol,
-    "port"	   => $db_port
-);
-$options = array
-(
-    "HOME"       => $oci8_home,
-    "optimize"   => 'portability'
-);
-$manager = new MDB_manager;
-$manager->connect($dsn, $options);
-$success = $manager->updateDatabase($schema_file, $schema_file . ".before", $variables);
-if (MDB::isError($success))
-{
-    echo "Error: " . $success->getMessage() . "<BR>";
-    echo "Error: " . $success->getUserInfo() . "<BR>";
-}
-if (count($manager->warnings)>0)
-{
-	echo "WARNING:<BR>",implode($manager->getWarnings(),"!\n"),"\n";
-}
-
-?>
Index: web/auth_moodle.php
===================================================================
RCS file: web/auth_moodle.php
diff -N web/auth_moodle.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_moodle.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,85 @@
+<?php
+
+/* $Id: auth_moodle.php,v 1.1 2007/04/05 22:25:25 arborrow Exp $
+ *
+ * Assigns MRBS access levels based on the user status
+ * within your Moodle installation. 
+ *
+ *
+ * MRBS Levels
+ * 0 - View only
+ * 1 - View and make bookings
+ * 2 - Full administration - add rooms and bookings
+ *
+ * Moodle Integration 
+ * Defines one of the above levels to admins, teachers
+ * students, creators, and guests seperately.
+ *
+ * Used in conjunction with session_moodle.inc
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ *      $auth["type"]    = "moodle";
+ *      $auth["session"] = "moodle";
+ *
+ */
+
+require_once("../../../config.php");
+
+function authValidateUser($user, $pass)
+{
+    return 1;
+}
+
+function authGetUserLevel($user, $lev1_admin)
+{
+	global $USER;
+	// OLD MOODLE 1.6.X CODE 
+/* 
+	// Set access level for site admins
+	if (isadmin()) {
+	    return 2;
+    }
+	
+	// Set access level for course creators
+	if (iscreator()) {
+	    return 2;
+    }
+	
+	// Set access level for teachers, if at course level
+	if (isteacher()) {
+	    return 1;
+    }
+	
+	// Set access level for students - not implemented
+	if (! isstudent($course->id)) {
+		return 1;
+    	}
+	// Set access level for guest user
+    if (isguest()) {
+	return 0;
+	}
+*/
+
+// HACK For Moodle 1.7 With Roles Block...	
+    
+    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+   // Set Access leve for users via MRBS block and Moodle 1.7 roles
+    if (has_capability('block/mrbs:administermrbs', $context)) {
+    	    return 2;
+    }
+	// has_capability('block/mrbs:editmrbs', $context)
+    if (has_capability('block/mrbs:editmrbs', $context)) {
+    	    return 1;
+    }
+	if (has_capability('block/mrbs:viewmrbs', $context)) {
+    	    return 0;
+    }
+	// Set access level for other users (e.g. people who access url directly)
+	else {
+    return 0;
+	}
+}
+
+?>
Index: web/lang.sv.php
===================================================================
RCS file: web/lang.sv.php
diff -N web/lang.sv.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.sv.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,257 @@
+<?php
+# $Id: lang.sv,v 1.17.2.3 2007/02/13 13:05:53 jberanek Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is the Swedish file.
+#
+# Translated provede by: Bo Kleve (bok@unit.liu.se), MissterX
+# Modified on 2006-01-04 by: Bj�rn Wiberg <Bjorn.Wiberg@its.uu.se>
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "MRBS - M�tesRumsBokningsSystem";
+
+# Used in functions.php
+$vocab["report"]             = "Rapport";
+$vocab["admin"]              = "Admin";
+$vocab["help"]               = "Hj�lp";
+$vocab["search"]             = "S�k:";
+$vocab["not_php3"]           = "<H1>VARNING: Detta fungerar f�rmodligen inte med PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Bokningar f�r";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "Omr�den";
+$vocab["daybefore"]          = "G� till f�reg�ende dag";
+$vocab["dayafter"]           = "G� till n�sta dag";
+$vocab["gototoday"]          = "G� till idag";
+$vocab["goto"]               = "G� till";
+$vocab["highlight_line"]     = "Markera denna rad";
+$vocab["click_to_reserve"]   = "Klicka p� cellen f�r att g�ra en bokning.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Visa dag";
+$vocab["viewweek"]           = "Visa vecka";
+$vocab["viewmonth"]          = "Visa m�nad";
+$vocab["ppreview"]           = "F�rhandsgranska";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Ny bokning";
+$vocab["editentry"]          = "�ndra bokningen";
+$vocab["editseries"]         = "�ndra serie";
+$vocab["namebooker"]         = "Kort beskrivning:";
+$vocab["fulldescription"]    = "Fullst�ndig beskrivning:";
+$vocab["date"]               = "Datum:";
+$vocab["start_date"]         = "Starttid:";
+$vocab["end_date"]           = "Sluttid:";
+$vocab["time"]               = "Tid:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "L�ngd:";
+$vocab["seconds"]            = "sekunder";
+$vocab["minutes"]            = "minuter";
+$vocab["hours"]              = "timmar";
+$vocab["days"]               = "dagar";
+$vocab["weeks"]              = "veckor";
+$vocab["years"]              = "�r";
+$vocab["periods"]            = "perioder";
+$vocab["all_day"]            = "hela dagen";
+$vocab["type"]               = "Typ:";
+$vocab["internal"]           = "Internt";
+$vocab["external"]           = "Externt";
+$vocab["save"]               = "Spara";
+$vocab["rep_type"]           = "Repetitionstyp:";
+$vocab["rep_type_0"]         = "ingen";
+$vocab["rep_type_1"]         = "dagligen";
+$vocab["rep_type_2"]         = "varje vecka";
+$vocab["rep_type_3"]         = "m�natligen";
+$vocab["rep_type_4"]         = "�rligen";
+$vocab["rep_type_5"]         = "M�nadsvis, samma dag";
+$vocab["rep_type_6"]         = "Veckovis";
+$vocab["rep_end_date"]       = "Repetition slutdatum:";
+$vocab["rep_rep_day"]        = "Repetitionsdag:";
+$vocab["rep_for_weekly"]     = "(vid varje vecka)";
+$vocab["rep_freq"]           = "Intervall:";
+$vocab["rep_num_weeks"]      = "Antal veckor";
+$vocab["rep_for_nweekly"]    = "(F�r x-veckor)";
+$vocab["ctrl_click"]         = "H�ll ner tangenten <I>Ctrl</I> och klicka f�r att v�lja mer �n ett rum";
+$vocab["entryid"]            = "Boknings-ID ";
+$vocab["repeat_id"]          = "Repetions-ID "; 
+$vocab["you_have_not_entered"] = "Du har inte angivit";
+$vocab["you_have_not_selected"] = "Du har inte valt";
+$vocab["valid_room"]         = "ett giltigt rum.";
+$vocab["valid_time_of_day"]  = "en giltig tidpunkt p� dagen.";
+$vocab["brief_description"]  = "en kort beskrivning.";
+$vocab["useful_n-weekly_value"] = "ett anv�ndbart n-veckovist v�rde.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Beskrivning:";
+$vocab["room"]               = "Rum";
+$vocab["createdby"]          = "Skapad av:";
+$vocab["lastupdate"]         = "Senast uppdaterad:";
+$vocab["deleteentry"]        = "Radera bokningen";
+$vocab["deleteseries"]       = "Radera serie";
+$vocab["confirmdel"]         = "�r du s�ker att\\ndu vill radera\\nden h�r bokningen?\\n\\n";
+$vocab["returnprev"]         = "�ter till f�reg�ende sida";
+$vocab["invalid_entry_id"]   = "Ogiltigt boknings-ID!";
+$vocab["invalid_series_id"]  = "Ogiltigt serie-ID!";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Fel";
+$vocab["sched_conflict"]     = "Bokningskonflikt";
+$vocab["conflict"]           = "Den nya bokningen krockar med f�ljande bokning(ar):";
+$vocab["too_may_entrys"]     = "De valda inst�llningarna skapar f�r m�nga bokningar.<BR>V.g. anv�nd andra inst�llningar!";
+$vocab["returncal"]          = "�terg� till kalendervy";
+$vocab["failed_to_acquire"]  = "Kunde ej f� exklusiv databas�tkomst"; 
+$vocab["invalid_booking"]    = "Ogiltig bokning";
+$vocab["must_set_description"] = "Du m�ste ange en kort beskrivning f�r bokningen. V�nligen g� tillbaka och korrigera detta.";
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "�tkomst nekad";
+$vocab["norights"]           = "Du har inte r�ttighet att �ndra bokningen.";
+$vocab["please_login"]       = "V�nligen logga in";
+$vocab["user_name"]          = "Anv�ndarnamn";
+$vocab["user_password"]      = "L�senord";
+$vocab["unknown_user"]       = "Ok�nd anv�ndare";
+$vocab["you_are"]            = "Du �r";
+$vocab["login"]              = "Logga in";
+$vocab["logoff"]             = "Logga ut";
+
+# Authentication database
+$vocab["user_list"]          = "Anv�ndarlista";
+$vocab["edit_user"]          = "Editera anv�ndare";
+$vocab["delete_user"]        = "Radera denna anv�ndare";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "E-postadress";
+$vocab["password_twice"]     = "Om du vill �ndra ditt l�senord, v�nligen mata in detta tv� g�nger";
+$vocab["passwords_not_eq"]   = "Fel: L�senorden st�mmer inte �verens.";
+$vocab["add_new_user"]       = "L�gg till anv�ndare";
+$vocab["rights"]             = "R�ttigheter";
+$vocab["action"]             = "Aktion";
+$vocab["user"]               = "Anv�ndare";
+$vocab["administrator"]      = "Administrat�r";
+$vocab["unknown"]            = "Ok�nd";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Klicka f�r att visa alla dina aktuella bokningar";
+$vocab["no_users_initial"]   = "Inga anv�ndare finns i databasen. Till�ter initialt skapande av anv�ndare.";
+$vocab["no_users_create_first_admin"] = "Skapa en administrativ anv�ndare f�rst. D�refter kan du logga in och skapa fler anv�ndare.";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Tom eller ogiltig s�kstr�ng.";
+$vocab["search_results"]     = "S�kresultat f�r:";
+$vocab["nothing_found"]      = "Inga s�ktr�ffar hittades.";
+$vocab["records"]            = "Bokning ";
+$vocab["through"]            = " t.o.m. ";
+$vocab["of"]                 = " av ";
+$vocab["previous"]           = "F�reg�ende";
+$vocab["next"]               = "N�sta";
+$vocab["entry"]              = "Bokning";
+$vocab["view"]               = "Visa";
+$vocab["advanced_search"]    = "Avancerad s�kning";
+$vocab["search_button"]      = "S�k";
+$vocab["search_for"]         = "S�k f�r";
+$vocab["from"]               = "Fr�n";
+
+# Used in report.php
+$vocab["report_on"]          = "Rapport �ver m�ten:";
+$vocab["report_start"]       = "Startdatum f�r rapport:";
+$vocab["report_end"]         = "Slutdatum f�r rapport:";
+$vocab["match_area"]         = "S�k p� plats:";
+$vocab["match_room"]         = "S�k p� rum:";
+$vocab["match_type"]         = "S�k p� bokningstyp:";
+$vocab["ctrl_click_type"]    = "H�ll ner tangenten <I>Ctrl</I> och klicka f�r att v�lja fler �n en typ";
+$vocab["match_entry"]        = "S�k p� kort beskrivning:";
+$vocab["match_descr"]        = "S�k p� fullst�ndig beskrivning:";
+$vocab["include"]            = "Inkludera:";
+$vocab["report_only"]        = "Endast rapport";
+$vocab["summary_only"]       = "Endast sammanst�llning";
+$vocab["report_and_summary"] = "Rapport och sammanst�llning";
+$vocab["summarize_by"]       = "Sammanst�ll p�:";
+$vocab["sum_by_descrip"]     = "Kort beskrivning";
+$vocab["sum_by_creator"]     = "Skapare";
+$vocab["entry_found"]        = "bokning hittad";
+$vocab["entries_found"]      = "bokningar hittade";
+$vocab["summary_header"]     = "Sammanst�llning �ver (bokningar) timmar";
+$vocab["summary_header_per"] = "Sammanst�llning �ver (bokningar) perioder";
+$vocab["total"]              = "Totalt";
+$vocab["submitquery"]        = "Skapa rapport";
+$vocab["sort_rep"]           = "Sortera rapport efter:";
+$vocab["sort_rep_time"]      = "Startdatum/starttid";
+$vocab["rep_dsp"]            = "Visa i rapport:";
+$vocab["rep_dsp_dur"]        = "L�ngd";
+$vocab["rep_dsp_end"]        = "Sluttid";
+
+# Used in week.php
+$vocab["weekbefore"]         = "F�reg�ende vecka";
+$vocab["weekafter"]          = "N�sta vecka";
+$vocab["gotothisweek"]       = "Denna vecka";
+
+# Used in month.php
+$vocab["monthbefore"]        = "F�reg�ende m�nad";
+$vocab["monthafter"]         = "N�sta m�nad";
+$vocab["gotothismonth"]      = "Denna m�nad";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Rum saknas f�r denna plats";
+
+# Used in admin.php
+$vocab["edit"]               = "�ndra";
+$vocab["delete"]             = "Radera";
+$vocab["rooms"]              = "Rum";
+$vocab["in"]                 = "i";
+$vocab["noareas"]            = "Inget omr�de";
+$vocab["addarea"]            = "L�gg till omr�de";
+$vocab["name"]               = "Namn";
+$vocab["noarea"]             = "Inget omr�de valt";
+$vocab["browserlang"]        = "Din webbl�sare �r inst�lld att anv�nda spr�k(en)";
+$vocab["postbrowserlang"]    = "";
+$vocab["addroom"]            = "L�gg till rum";
+$vocab["capacity"]           = "Kapacitet";
+$vocab["norooms"]            = "Inga rum.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "�ndra omr�de";
+$vocab["change"]             = "�ndra";
+$vocab["backadmin"]          = "Tillbaka till Administration";
+$vocab["editroomarea"]       = "�ndra omr�de eller rum";
+$vocab["editroom"]           = "�ndra rum";
+$vocab["update_room_failed"] = "Uppdatering av rum misslyckades: ";
+$vocab["error_room"]         = "Fel: rum ";
+$vocab["not_found"]          = " hittades ej";
+$vocab["update_area_failed"] = "Uppdatering av omr�de misslyckades: ";
+$vocab["error_area"]         = "Fel: omr�de";
+$vocab["room_admin_email"]   = "E-postadress till rumsansvarig:";
+$vocab["area_admin_email"]   = "E-postadress till omr�desansvarig";
+$vocab["invalid_email"]      = "Ogiltig e-postadress!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Detta raderar f�ljande bokningar";
+$vocab["sure"]               = "�r du s�ker?";
+$vocab["YES"]                = "JA";
+$vocab["NO"]                 = "NEJ";
+$vocab["delarea"]            = "Du m�ste ta bort alla rum i detta omr�de innan du kan ta bort omr�det!<p>";
+$vocab["backadmin"]          = "Tillbaka till Administration";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "Om MRBS";
+$vocab["database"]           = "Databas: ";
+$vocab["system"]             = "System: ";
+$vocab["please_contact"]     = "Var v�nlig kontakta ";
+$vocab["for_any_questions"]  = "f�r eventuella fr�gor som ej besvaras h�r.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fatalt fel: Kunde ej ansluta till databasen!";
+
+?>
Index: web/lang.no.php
===================================================================
RCS file: web/lang.no.php
diff -N web/lang.no.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.no.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,252 @@
+<?php
+# $Id: lang.no.php,v 1.1 2007/04/05 22:25:32 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is the Norwegian file.
+#
+# Translations provided by: Rune Johansen (rune.johansen@finedamer.com)
+# Further translated by: Emil St�a (emil@consider.no)
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "M�teromsbooking";
+
+# Used in functions.php
+$vocab["report"]             = "Rapport";
+$vocab["admin"]              = "Admin";
+$vocab["help"]               = "Hjelp";
+$vocab["search"]             = "S�k:";
+$vocab["not_php3"]           = "<H1>NB: Dette virker sannsynligvis ikke med PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Booking for";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "Omr�de";
+$vocab["daybefore"]          = "G� til forrige dag";
+$vocab["dayafter"]           = "G� til neste dag";
+$vocab["gototoday"]          = "G� til idag";
+$vocab["goto"]               = "g� til";
+$vocab["highlight_line"]     = "Merk denne linjen";
+$vocab["click_to_reserve"]   = "Trykk i cellen for � reservere.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Vis dag";
+$vocab["viewweek"]           = "Vis Uke";
+$vocab["viewmonth"]          = "Vis M�ned";
+$vocab["ppreview"]           = "Forh�ndsvisning";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Booking";
+$vocab["editentry"]          = "Endre booking";
+$vocab["editseries"]         = "Endre serie";
+$vocab["namebooker"]         = "Kort beskrivelse:";
+$vocab["fulldescription"]    = "Lang beskrivelse:<br>&nbsp;&nbsp;(Antall personer,<br>&nbsp;&nbsp;Internt/Eksternt osv)";
+$vocab["date"]               = "Dato:";
+$vocab["start_date"]         = "Starttid:";
+$vocab["end_date"]           = "Sluttid:";
+$vocab["time"]               = "Tid:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "Lengde:";
+$vocab["seconds"]            = "sekunder";
+$vocab["minutes"]            = "minutter";
+$vocab["hours"]              = "timer";
+$vocab["days"]               = "dager";
+$vocab["weeks"]              = "uker";
+$vocab["years"]              = "�r";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "hele dagen";
+$vocab["type"]               = "Type:";
+$vocab["internal"]           = "Internt";
+$vocab["external"]           = "Eksternt";
+$vocab["save"]               = "Lagre";
+$vocab["rep_type"]           = "Repetisjonstype:";
+$vocab["rep_type_0"]         = "ingen";
+$vocab["rep_type_1"]         = "daglig";
+$vocab["rep_type_2"]         = "ukentlig";
+$vocab["rep_type_3"]         = "m�nedlig";
+$vocab["rep_type_4"]         = "�rlig";
+$vocab["rep_type_5"]         = "M�nedlig, samme dag";
+$vocab["rep_type_6"]         = "n-ukentlig";
+$vocab["rep_end_date"]       = "Repetisjon sluttdato:";
+$vocab["rep_rep_day"]        = "Repetisjonsdag:";
+$vocab["rep_for_weekly"]     = "(ved hver uke)";
+$vocab["rep_freq"]           = "Frekvens:";
+$vocab["rep_num_weeks"]      = "Antall uker";
+$vocab["rep_for_nweekly"]    = "(for n-uker)";
+$vocab["ctrl_click"]         = "Hold inne kontrolltasten for � velge mer enn ett rom";
+$vocab["entryid"]            = "Booking ID ";
+$vocab["repeat_id"]          = "Repetisjons ID "; 
+$vocab["you_have_not_entered"] = "Du har ikke angitt";
+$vocab["you_have_not_selected"] = "Du har ikke valgt ";
+$vocab["valid_room"]         = "ett rom.";
+$vocab["valid_time_of_day"]  = "ett gyldig tidspunkt.";
+$vocab["brief_description"]  = "en kort beskrivelse.";
+$vocab["useful_n-weekly_value"] = "en gyldig verdi for antall uker.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Beskrivelse:";
+$vocab["room"]               = "Rom";
+$vocab["createdby"]          = "Laget av:";
+$vocab["lastupdate"]         = "Senest oppdatert:";
+$vocab["deleteentry"]        = "Slett booking";
+$vocab["deleteseries"]       = "Slett serie";
+$vocab["confirmdel"]         = "Er du sikker p� at\\ndu vil slette bookingen?\\n\\n";
+$vocab["returnprev"]         = "Tilbake til forrige side";
+$vocab["invalid_entry_id"]   = "Ugyldig booking-ID.";
+$vocab["invalid_series_id"]  = "Ugyldig serie-ID.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Feil";
+$vocab["sched_conflict"]     = "Bookingkonflikt";
+$vocab["conflict"]           = "Bookingen er i konflikt med f�lgende booking(er):";
+$vocab["too_may_entrys"]     = "De valgte instillinger skaper for mange bookinger.<BR>Vennligst bruk andre instillinger!";
+$vocab["returncal"]          = "Tilbake til kalender";
+$vocab["failed_to_acquire"]  = "Kunne ikke oppn� eksklusiv databasetilgang"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Ingen adgang";
+$vocab["norights"]           = "Du har ingen rettigheter til � endre bookingen.";
+$vocab["please_login"]       = "Vennligst logg inn";
+$vocab["user_name"]          = "Navn";
+$vocab["user_password"]      = "Passord";
+$vocab["unknown_user"]       = "Ukjent bruker";
+$vocab["you_are"]            = "Bruker: ";
+$vocab["login"]              = "Logg inn";
+$vocab["logoff"]             = "Logg ut";
+
+# Authentication database
+$vocab["user_list"]          = "Brukerliste";
+$vocab["edit_user"]          = "Rediger bruker";
+$vocab["delete_user"]        = "Slett denne brukeren";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Epost-addresse";
+$vocab["password_twice"]     = "Hvis du vil endre passordet, skriv det nye passordet to ganger";
+$vocab["passwords_not_eq"]   = "Feil: Passordene er ikke like.";
+$vocab["add_new_user"]       = "Legg til ny bruker";
+$vocab["rights"]             = "Rettigheter";
+$vocab["action"]             = "Valg";
+$vocab["user"]               = "Bruker";
+$vocab["administrator"]      = "Administrator";
+$vocab["unknown"]            = "Ukjent";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Trykk for � vise kommende innlegg";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Tom eller ugyldig s�kestreng.";
+$vocab["search_results"]     = "S�keresultat for:";
+$vocab["nothing_found"]      = "Ingen poster ble funnet.";
+$vocab["records"]            = "Booking ";
+$vocab["through"]            = " til ";
+$vocab["of"]                 = " av ";
+$vocab["previous"]           = "Forrige";
+$vocab["next"]               = "Neste";
+$vocab["entry"]              = "Post";
+$vocab["view"]               = "Vis";
+$vocab["advanced_search"]    = "Avansert s�k";
+$vocab["search_button"]      = "S�k";
+$vocab["search_for"]         = "S�k etter";
+$vocab["from"]               = "Fra";
+
+# Used in report.php
+$vocab["report_on"]          = "Rapport:";
+$vocab["report_start"]       = "Start dato:";
+$vocab["report_end"]         = "Slutt dato:";
+$vocab["match_area"]         = "Omr�de:";
+$vocab["match_room"]         = "Rom:";
+$vocab["match_type"]         = "Velg type:";
+$vocab["ctrl_click_type"]    = "Bruk CTRL-tasten for � velge fler enn en type";
+$vocab["match_entry"]        = "Kort beskrivelse:";
+$vocab["match_descr"]        = "Lang beskrivelse:";
+$vocab["include"]            = "Skal inneholde:";
+$vocab["report_only"]        = "Bare rapport";
+$vocab["summary_only"]       = "Summering";
+$vocab["report_and_summary"] = "Rapport og Summering";
+$vocab["summarize_by"]       = "Summering etter:";
+$vocab["sum_by_descrip"]     = "Kort beskrivelse";
+$vocab["sum_by_creator"]     = "Hvem som booket";
+$vocab["entry_found"]        = "post funnet";
+$vocab["entries_found"]      = "poster funnet";
+$vocab["summary_header"]     = "Sum timer";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Totalt";
+$vocab["submitquery"]        = "Kj�r rapport";
+$vocab["sort_rep"]           = "Sorter rapport etter:";
+$vocab["sort_rep_time"]      = "Dato/Tid";
+$vocab["rep_dsp"]            = "Vis i rapport:";
+$vocab["rep_dsp_dur"]        = "Varighet";
+$vocab["rep_dsp_end"]        = "Slutt-tid";
+
+# Used in week.php
+$vocab["weekbefore"]         = "G� til uken f�r";
+$vocab["weekafter"]          = "G� til uken etter";
+$vocab["gotothisweek"]       = "G� til denne uken";
+
+# Used in month.php
+$vocab["monthbefore"]        = "G� til forrige m�ned";
+$vocab["monthafter"]         = "G� til neste m�ned";
+$vocab["gotothismonth"]      = "G� til denne m�neden";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Ingen rom definert for dette omr�det";
+
+# Used in admin.php
+$vocab["edit"]               = "Endre";
+$vocab["delete"]             = "Slett";
+$vocab["rooms"]              = "Rom";
+$vocab["in"]                 = "i";
+$vocab["noareas"]            = "Ingen omr�der";
+$vocab["addarea"]            = "Legg til omr�de";
+$vocab["name"]               = "Navn";
+$vocab["noarea"]             = "Omr�de ikke valgt";
+$vocab["browserlang"]        = "Din nettleser er satt opp til � bruke f�lgende spr�k:";
+$vocab["postbrowserlang"]    = "";
+$vocab["addroom"]            = "Legg til rom";
+$vocab["capacity"]           = "Kapasitet";
+$vocab["norooms"]            = "Ingen rom.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Endre omr�de";
+$vocab["change"]             = "Endre";
+$vocab["backadmin"]          = "Tilbake til admin";
+$vocab["editroomarea"]       = "Endre omr�de- eller rombeskrivelse";
+$vocab["editroom"]           = "Endre rom";
+$vocab["update_room_failed"] = "Oppdatering av rom feilet: ";
+$vocab["error_room"]         = "Feil: rom ";
+$vocab["not_found"]          = " ble ikke funnet";
+$vocab["update_area_failed"] = "Oppdatering av omr�de feilet: ";
+$vocab["error_area"]         = "Feil: omr�de ";
+$vocab["room_admin_email"]   = "Rom-administrators E-post:";
+$vocab["area_admin_email"]   = "Omr�de-administrators E-post:";
+$vocab["invalid_email"]      = "Ugyldig E-post!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Dette vil slette f�lgende bookinger";
+$vocab["sure"]               = "Er du sikker?";
+$vocab["YES"]                = "JA";
+$vocab["NO"]                 = "NEI";
+$vocab["delarea"]            = "Du m� slette alle rommene i dette omr�det f�r du kan slette det<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "Om MRBS";
+$vocab["database"]           = "Database: ";
+$vocab["system"]             = "System: ";
+$vocab["please_contact"]     = "Vennligst ta kontakt med ";
+$vocab["for_any_questions"]  = "for sp�rsm�l som ikke er besvart her.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Alvorlig feil: Kunne ikke koble til database";
+
+?>
Index: web/auth_nw.php
===================================================================
RCS file: web/auth_nw.php
diff -N web/auth_nw.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_nw.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,73 @@
+<?php
+
+// $Id: auth_nw.php,v 1.1 2007/04/05 22:25:25 arborrow Exp $
+
+/* ~~JFL 2003/11/12 By default, use the http session mechanism */
+if (!isset($auth['session'])) $auth['session']='http';
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+
+require_once("../../../config.php");
+
+function authValidateUser($user, $pass)
+{
+        global $auth;
+    
+    // Check if we do not have a username/password
+    if(empty($user) || empty($pass))
+    {
+        return 0;
+    }
+    
+    // Generate the command line
+    $cmd = $auth["prog"] . " -S " . $auth["params"] . " -U '$user'";
+    
+    // Run the program, sending the password to stdin.
+    $p = popen($cmd, "w");
+    if (!$p)
+        return 0;
+    fputs($p, $pass);
+    if (pclose($p) == 0)
+        return 1;
+    
+    // return failure
+    return 0;
+}
+
+/* authGetUserLevel($user)
+ * 
+ * Determines the users access level
+ * 
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+    // User not logged in, user level '0'
+    if(!isset($user))
+        return 0;
+    
+    // Check if the user is can modify
+    for($i = 0; $lev1_admin[$i]; $i++)
+    {
+        if(strcasecmp($user, $lev1_admin[$i]) == 0)
+            return 2;
+    }
+    
+    // Everybody else is access level '1'
+    return 1;
+}
+
+?>
Index: web/style.php
===================================================================
RCS file: web/style.php
diff -N web/style.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/style.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,30 @@
+<?php
+
+# $Id: style.inc,v 1.10.2.2 2006/10/09 15:54:00 jberanek Exp $
+require_once("../../../config.php"); //for Moodle integration
+global $unicode_encoding;
+
+?>
+    <LINK REL="stylesheet" href="mrbs.css" type="text/css">
+    <META HTTP-EQUIV="Content-Type" content="text/html; charset=<?php
+   if ($unicode_encoding)
+   {
+     echo "utf-8";
+   }
+   else
+   {
+     echo get_string('charset','block_mrbs');
+   }
+?>">
+    <META NAME="Robots" content="noindex">
+<?php
+
+global $refresh_rate;
+global $PHP_SELF;
+
+if (($refresh_rate != 0) &&
+    preg_match("/(day|week|month)\.php/",$PHP_SELF))
+{
+  echo "    <META HTTP-EQUIV=\"Refresh\" CONTENT=\"$refresh_rate\">\n";
+}
+?>
Index: web/auth_imap.php
===================================================================
RCS file: web/auth_imap.php
diff -N web/auth_imap.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_imap.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,152 @@
+<?php
+
+/* $Id: auth_imap.php,v 1.6.2.3 2006/10/09 15:53:59 jberanek Exp $
+ *
+ * Authentication scheme that uses IMAP as the source for user
+ * authentication.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ * $auth["realm"] = "MRBS";    # Or any other string
+ * $auth["type"]  = "imap";
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "imapuser1";
+ * $auth["admin"][] = "imapuser2";
+ */
+
+/* ~~JFL 2003/11/12 By default, use the http session mechanism */
+
+require_once("../../../config.php");
+
+if (!isset($auth['session'])) $auth['session']='http';
+
+/* quoteIMAP($str)
+ *
+ * quote char's into valid IMAP string
+ *
+ * $str - String to be quoted
+ *
+ * Returns:
+ *   quoted string
+ */
+function quoteIMAP($str)
+{
+    return ereg_replace('(["\\])', '\\\\1', $str);
+}
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+function authValidateUser($user, $pass)
+{
+	global $auth;
+	global $imap_host;
+	global $imap_port;
+	$all_imap_hosts = array();
+	$all_imap_ports = array();
+
+	// Check if we do not have a username/password
+	if(!isset($user) || !isset($pass) || strlen($pass)==0)
+	{
+		return 0;
+	}
+
+	# Check that if there is an array of hosts and an array of ports
+	# then the number of each is the same
+	if(is_array( $imap_host ) && is_array( $imap_port ) && count($imap_port) != count($imap_host) )
+	{
+		return 0;
+	}
+
+	# Transfer the list of imap hosts to an new value to ensure that
+	# an array is always used.
+	# If a single value is passed then turn it into an array
+	if(is_array( $imap_host ) )
+	{
+		$all_imap_hosts = $imap_host;
+	}
+	else
+	{
+		$all_imap_hosts = array($imap_host);
+	}
+
+	# create an array of the port numbers to match the number of
+	# hosts if a single port number has been passed.
+	if(is_array( $imap_port ) )
+	{
+		$all_imap_ports = $imap_port;
+	}
+	else
+	{
+		while( each($all_imap_hosts ) )
+		{
+			$all_imap_ports[] = $imap_port;
+		}
+	}
+
+	# iterate over all hosts and return if you get a successful login
+	foreach( $all_imap_hosts as $idx => $host)
+	{
+		$error_number = "";
+		$error_string = "";
+
+		// Connect to IMAP-server
+		$stream = fsockopen( $host, $all_imap_ports[$idx], $error_number, $error_string, 15 );
+		if( $stream ) {
+			$response = fgets( $stream, 1024 );
+			$logon_str = "a001 LOGIN \"" . quoteIMAP( $user ) . "\" \"" . quoteIMAP( $pass ) . "\"\r\n";
+			fputs( $stream, $logon_str );
+			$response = fgets( $stream, 1024 );
+			if( substr( $response, 5, 2 ) == 'OK' ) {
+				fputs( $stream, "a002 LOGOUT\r\n" );
+				$response = fgets( $stream, 1024 );
+				fclose( $stream );
+				return 1;
+			}
+			fputs( $stream, "a002 LOGOUT\r\n" );
+			fclose( $stream );
+		}
+	}
+
+	// return failure
+	return 0;
+}
+
+/* authGetUserLevel($user)
+ *
+ * Determines the users access level
+ *
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+	// User not logged in, user level '0'
+	if(!isset($user))
+		return 0;
+
+	// Check if the user is can modify
+	for($i = 0; $lev1_admin[$i]; $i++)
+	{
+		if(strcasecmp($user, $lev1_admin[$i]) == 0)
+			return 2;
+	}
+
+	// Everybody else is access level '1'
+	return 1;
+}
+
+?>
Index: web/functions.php
===================================================================
RCS file: web/functions.php
diff -N web/functions.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/functions.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,606 @@
+<?php
+
+# $Id: functions.php,v 1.34.2.5 2007/02/13 12:53:28 jberanek Exp $
+require_once("../../../config.php"); //for Moodle integration
+# probably a bad place to put this, but for error reporting purposes
+# $pview must be defined. if it's not then there's errors generated all
+# over the place. so we test to see if it is set, and if not then set
+# it.
+
+$pview = optional_param('pview', 0, PARAM_INT);
+
+// if (!isset($pview)) { //better to handle with optional_param
+//	$pview = 0;
+// }
+
+function print_header_mrbs($day, $month, $year, $area)
+{
+	global $mrbs_company, $mrbs_company_url, $search_str, $locale_warning;
+
+	# If we dont know the right date then make it up 
+	if(!$day)
+		$day   = date("d");
+	if(!$month)
+		$month = date("m");
+	if(!$year)
+		$year  = date("Y");
+	if (empty($search_str))
+		$search_str = "";
+
+	if ($unicode_encoding)
+	{
+		header("Content-Type: text/html; charset=utf-8");
+	}
+	else
+	{
+		
+		header("Content-Type: text/html; charset=".get_string('charset','block_mrbs'));
+	}
+
+	header("Pragma: no-cache");                          // HTTP 1.0
+	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+                      "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+  <HEAD>
+<?php
+   include "style.php";
+?>
+ <TITLE><?php echo get_string('mrbs','block_mrbs') ?></TITLE>
+    <SCRIPT LANGUAGE="JavaScript">
+
+<!-- Begin
+
+/*   Script inspired by "True Date Selector"
+     Created by: Lee Hinder, lee.hinder@ntlworld.com 
+     
+     Tested with Windows IE 6.0
+     Tested with Linux Opera 7.21, Mozilla 1.3, Konqueror 3.1.0
+     
+*/
+
+function daysInFebruary (year){
+  // February has 28 days unless the year is divisible by four,
+  // and if it is the turn of the century then the century year
+  // must also be divisible by 400 when it has 29 days
+  return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
+}
+
+//function for returning how many days there are in a month including leap years
+function DaysInMonth(WhichMonth, WhichYear)
+{
+  var DaysInMonth = 31;
+  if (WhichMonth == "4" || WhichMonth == "6" || WhichMonth == "9" || WhichMonth == "11")
+    DaysInMonth = 30;
+  if (WhichMonth == "2")
+    DaysInMonth = daysInFebruary( WhichYear );
+  return DaysInMonth;
+}
+
+//function to change the available days in a months
+function ChangeOptionDays(formObj, prefix)
+{
+  var DaysObject = eval("formObj." + prefix + "day");
+  var MonthObject = eval("formObj." + prefix + "month");
+  var YearObject = eval("formObj." + prefix + "year");
+
+  if (DaysObject.selectedIndex && DaysObject.options)
+    { // The DOM2 standard way
+    // alert("The DOM2 standard way");
+    var DaySelIdx = DaysObject.selectedIndex;
+    var Month = parseInt(MonthObject.options[MonthObject.selectedIndex].value);
+    var Year = parseInt(YearObject.options[YearObject.selectedIndex].value);
+    }
+  else if (DaysObject.selectedIndex && DaysObject[DaysObject.selectedIndex])
+    { // The legacy MRBS way
+    // alert("The legacy MRBS way");
+    var DaySelIdx = DaysObject.selectedIndex;
+    var Month = parseInt(MonthObject[MonthObject.selectedIndex].value);
+    var Year = parseInt(YearObject[YearObject.selectedIndex].value);
+    }
+  else if (DaysObject.value)
+    { // Opera 6 stores the selectedIndex in property 'value'.
+    // alert("The Opera 6 way");
+    var DaySelIdx = parseInt(DaysObject.value);
+    var Month = parseInt(MonthObject.options[MonthObject.value].value);
+    var Year = parseInt(YearObject.options[YearObject.value].value);
+    }
+
+  // alert("Day="+(DaySelIdx+1)+" Month="+Month+" Year="+Year);
+
+  var DaysForThisSelection = DaysInMonth(Month, Year);
+  var CurrentDaysInSelection = DaysObject.length;
+  if (CurrentDaysInSelection > DaysForThisSelection)
+  {
+    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
+    {
+      DaysObject.options[DaysObject.options.length - 1] = null
+    }
+  }
+  if (DaysForThisSelection > CurrentDaysInSelection)
+  {
+    for (i=0; i<DaysForThisSelection; i++)
+    {
+      DaysObject.options[i] = new Option(eval(i + 1));
+    }
+  }
+  if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex = 0;
+  if (DaySelIdx >= DaysForThisSelection)
+    DaysObject.selectedIndex = DaysForThisSelection-1;
+  else
+    DaysObject.selectedIndex = DaySelIdx;
+}
+
+  //  End -->
+    </SCRIPT>
+  </HEAD>
+  <BODY BGCOLOR="#ffffed" TEXT=black LINK="#5B69A6" VLINK="#5B69A6" ALINK=red>
+	   <?php if ( $GLOBALS["pview"] != 1 ) { ?>
+
+   <?php # show a warning if this is using a low version of php
+       if (substr(phpversion(), 0, 1) == 3)
+	       echo get_string('not_php3','block_mrbs');
+       if (!empty($locale_warning))
+               echo "[Warning: ".$locale_warning."]";
+   ?>
+
+    <TABLE WIDTH="100%">
+      <TR>
+        <TD BGCOLOR="#5B69A6">
+          <TABLE WIDTH="100%" BORDER=0>
+            <TR>
+              <TD CLASS="banner" BGCOLOR="#C0E0FF">
+          <FONT SIZE=4><B><a href='<?php echo $mrbs_company_url ?>'><?php echo $mrbs_company ?></a></B><BR>
+           <A HREF="index.php"><?php echo get_string('mrbs','block_mrbs') ?></A>
+                </FONT>
+              </TD>
+              <TD CLASS="banner" BGCOLOR="#C0E0FF">
+                <FORM ACTION="day.php" METHOD=GET name="Form1">
+                  <FONT SIZE=2>
+<?php
+   genDateSelector("", $day, $month, $year); // Note: The 1st arg must match the last arg in the call to ChangeOptionDays below.
+   if (!empty($area))
+        echo "
+                    <INPUT TYPE=HIDDEN NAME=area VALUE=$area>\n"
+ 
+?>
+	            <SCRIPT LANGUAGE="JavaScript">
+                    <!--
+                    // fix number of days for the $month/$year that you start with
+                    ChangeOptionDays(document.Form1, ''); // Note: The 2nd arg must match the first in the call to genDateSelector above.
+                    // -->
+                    </SCRIPT>
+	    <INPUT TYPE=SUBMIT VALUE="<?php echo get_string('goto','block_mrbs') ?>">
+                  </FONT>
+                </FORM>
+              </TD>
+              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+          <A HREF="help.php?day=<?php echo $day ?>&month=<?php echo $month ?>&year=<?php echo $year ?>"><?php echo get_string('help') ?></A>
+              </TD>
+              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+          <A HREF="admin.php?day=<?php echo $day ?>&month=<?php echo $month ?>&year=<?php echo $year ?>"><?php echo get_string('admin') ?></A>
+              </TD>
+              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+          <A HREF="report.php"><?php echo get_string('report') ?></A>
+              </TD>
+              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+                <FORM METHOD=GET ACTION="search.php">
+           <FONT SIZE=2><A HREF="search.php?advanced=1"><?php echo get_string('search') ?></A> </FONT>
+                  <INPUT TYPE=TEXT   NAME="search_str" VALUE="<?php echo $search_str ?>" SIZE=10>
+                  <INPUT TYPE=HIDDEN NAME=day        VALUE="<?php echo $day        ?>"        >
+                  <INPUT TYPE=HIDDEN NAME=month      VALUE="<?php echo $month      ?>"        >
+                  <INPUT TYPE=HIDDEN NAME=year       VALUE="<?php echo $year       ?>"        >
+<?php
+   if (!empty($area))
+        echo "
+                  <INPUT TYPE=HIDDEN NAME=area VALUE=$area>\n"
+?>
+                </FORM>
+              </TD>
+<?php
+    # For session protocols that define their own logon box...
+    if (function_exists('PrintLogonBox'))
+   	{
+   	PrintLogonBox();
+   	}
+?>
+            </TR>
+          </TABLE>
+        </TD>
+      </TR>
+    </TABLE>
+<?php } ?>
+<?php
+}
+
+function toTimeString(&$dur, &$units)
+{
+	if($dur >= 60)
+	{
+		$dur /= 60;
+
+		if($dur >= 60)
+		{
+			$dur /= 60;
+
+			if(($dur >= 24) && ($dur % 24 == 0))
+			{
+				$dur /= 24;
+
+				if(($dur >= 7) && ($dur % 7 == 0))
+				{
+					$dur /= 7;
+
+					if(($dur >= 52) && ($dur % 52 == 0))
+					{
+						$dur  /= 52;
+						$units = get_string('years');
+					}
+					else
+						$units = get_string('weeks','block_mrbs');
+				}
+				else
+					$units = get_string('days');
+			}
+			else
+				$units = get_string('hours','block_mrbs');
+		}
+		else
+			$units = get_string('minutes');
+	}
+	else
+		$units = get_string('secs');
+}
+
+
+function toPeriodString($start_period, &$dur, &$units)
+{
+	global $enable_periods;
+        global $periods;
+
+        $max_periods = count($periods);
+
+	$dur /= 60;
+
+        if( $dur >= $max_periods || $start_period == 0 )
+        {
+                if( $start_period == 0 && $dur == $max_periods )
+                {
+                        $units = get_string('days');
+                        $dur = 1;
+                        return;
+                }
+
+                $dur /= 60;
+                if(($dur >= 24) && is_int($dur))
+                {
+                	$dur /= 24;
+			$units = get_string('days');
+                        return;
+                }
+                else
+                {
+			$dur *= 60;
+                        $dur = ($dur % $max_periods) + floor( $dur/(24*60) ) * $max_periods;
+                        $units = get_string('periods','block_mrbs');
+                        return;
+		}
+        }
+        else
+		$units = get_string('periods','block_mrbs');
+}
+
+
+
+function genDateSelector($prefix, $day, $month, $year)
+{
+	if($day   == 0) $day = date("d");
+	if($month == 0) $month = date("m");
+	if($year  == 0) $year = date("Y");
+	
+	echo "
+                  <SELECT NAME=\"${prefix}day\">";
+	
+	for($i = 1; $i <= 31; $i++)
+		echo "
+                    <OPTION" . ($i == $day ? " SELECTED" : "") . ">$i";
+
+	echo "
+                  </SELECT>
+
+                  <SELECT NAME=\"${prefix}month\" onchange=\"ChangeOptionDays(this.form,'$prefix')\">";
+
+	for($i = 1; $i <= 12; $i++)
+	{
+		$m = utf8_strftime("%b", mktime(0, 0, 0, $i, 1, $year));
+		
+		print "
+                    <OPTION VALUE=\"$i\"" . ($i == $month ? " SELECTED" : "") . ">$m";
+	}
+
+	echo "
+                  </SELECT>
+	          <SELECT NAME=\"${prefix}year\" onchange=\"ChangeOptionDays(this.form,'$prefix')\">";
+
+	$min = min($year, date("Y")) - 5;
+	$max = max($year, date("Y")) + 5;
+
+	for($i = $min; $i <= $max; $i++)
+		print "
+                    <OPTION VALUE=\"$i\"" . ($i == $year ? " SELECTED" : "") . ">$i";
+
+	echo "
+                  </SELECT>";
+}
+
+# Error handler - this is used to display serious errors such as database
+# errors without sending incomplete HTML pages. This is only used for
+# errors which "should never happen", not those caused by bad inputs.
+# If $need_header!=0 output the top of the page too, else assume the
+# caller did that. Alway outputs the bottom of the page and exits.
+function fatal_error($need_header, $message)
+{
+	if ($need_header) print_header_mrbs(0, 0, 0, 0);
+	echo $message;
+	include "trailer.php";
+	exit;
+}
+
+# Apply backslash-escape quoting unless PHP is configured to do it
+# automatically. Use this for GET/POST form parameters, since we
+# cannot predict if the PHP configuration file has magic_quotes_gpc on.
+function slashes($s)
+{
+	if (get_magic_quotes_gpc()) return $s;
+	else return addslashes($s);
+}
+
+# Remove backslash-escape quoting if PHP is configured to do it with
+# magic_quotes_gpc. Use this whenever you need the actual value of a GET/POST
+# form parameter (which might have special characters) regardless of PHP's
+# magic_quotes_gpc setting.
+function unslashes($s)
+{
+	if (get_magic_quotes_gpc()) return stripslashes($s);
+	else return $s;
+}
+
+# Return a default area; used if no area is already known. This returns the
+# lowest area ID in the database (no guaranty there is an area 1).
+# This could be changed to implement something like per-user defaults.
+function get_default_area()
+{
+	global $tbl_area;
+	$area = sql_query1("SELECT id FROM $tbl_area ORDER BY area_name LIMIT 1");
+	return ($area < 0 ? 0 : $area);
+}
+
+# Return a default room given a valid area; used if no room is already known.
+# This returns the first room in alphbetic order in the database.
+# This could be changed to implement something like per-user defaults.
+function get_default_room($area)
+{
+	global $tbl_room;
+	$room = sql_query1("SELECT id FROM $tbl_room WHERE area_id=$area ORDER BY room_name LIMIT 1");
+	return ($room < 0 ? 0 : $room);
+}
+
+# Get the local day name based on language. Note 2000-01-02 is a Sunday.
+function day_name($daynumber)
+{
+	return utf8_strftime("%A", mktime(0,0,0,1,2+$daynumber,2000));
+}
+
+function hour_min_format()
+{
+        global $twentyfourhour_format;
+        if ($twentyfourhour_format)
+	{
+  	        return "%H:%M";
+	}
+	else
+	{
+		return "%I:%M%p";
+	}
+}
+
+function period_date_string($t, $mod_time=0)
+{
+        global $periods;
+
+	$time = getdate($t);
+        $p_num = $time["minutes"] + $mod_time;
+        if( $p_num < 0 ) $p_num = 0;
+        if( $p_num >= count($periods) - 1 ) $p_num = count($periods ) - 1;
+	# I have made the separater a ',' as a '-' leads to an ambiguious
+	# display in report.php when showing end times.
+        return array($p_num, $periods[$p_num] . utf8_strftime(", %A %d %B %Y",$t));
+}
+
+function period_time_string($t, $mod_time=0)
+{
+        global $periods;
+
+	$time = getdate($t);
+        $p_num = $time["minutes"] + $mod_time;
+        if( $p_num < 0 ) $p_num = 0;
+        if( $p_num >= count($periods) - 1 ) $p_num = count($periods ) - 1;
+        return $periods[$p_num];
+}
+
+function time_date_string($t)
+{
+        global $twentyfourhour_format;
+
+        if ($twentyfourhour_format)
+	{
+  	        return utf8_strftime("%H:%M:%S - %A %d %B %Y",$t);
+	}
+	else
+	{
+	        return utf8_strftime("%I:%M:%S%p - %A %d %B %Y",$t);
+	}
+}
+
+# Output a start table cell tag <td> with color class and fallback color.
+# $colclass is an entry type (A-J), "white" for empty, or "red" for highlighted.
+# The colors for CSS browsers can be found in the style sheet. The colors
+# in the array below are fallback for non-CSS browsers only.
+function tdcell($colclass)
+{
+	# This should be 'static $ecolors = array(...)' but that crashes PHP3.0.12!
+	static $ecolors;
+	if (!isset($ecolors)) $ecolors = array("A"=>"#FFCCFF", "B"=>"#99CCCC",
+		"C"=>"#FF9999", "D"=>"#FFFF99", "E"=>"#C0E0FF", "F"=>"#FFCC99",
+		"G"=>"#FF6666", "H"=>"#66FFFF", "I"=>"#DDFFDD", "J"=>"#CCCCCC",
+		"red"=>"#FFF0F0", "white"=>"#FFFFFF");
+	if (isset($ecolors[$colclass]))
+		echo "<td class=\"$colclass\" bgcolor=\"$ecolors[$colclass]\">";
+	else
+		echo "<td class=\"$colclass\">";
+}
+
+# Display the entry-type color key. This has up to 2 rows, up to 5 columns.
+function show_colour_key()
+{
+	global $typel;
+	echo "<table border=0><tr>\n";
+	$nct = 0;
+	for ($ct = "A"; $ct <= "Z"; $ct++)
+	{
+		if (!empty($typel[$ct]))
+		{
+			if (++$nct > 5)
+			{
+				$nct = 0;
+				echo "</tr><tr>";
+			}
+			tdcell($ct);
+			echo "$typel[$ct]</td>\n";
+		}
+	}
+	echo "</tr></table>\n";
+}
+
+# Round time down to the nearest resolution
+function round_t_down($t, $resolution, $am7)
+{
+        return (int)$t - (int)abs(((int)$t-(int)$am7)
+				  % $resolution);
+}
+
+# Round time up to the nearest resolution
+function round_t_up($t, $resolution, $am7)
+{
+	if (($t-$am7) % $resolution != 0)
+	{
+		return $t + $resolution - abs(((int)$t-(int)
+					       $am7) % $resolution);
+	}
+	else
+	{
+		return $t;
+	}
+}
+
+# generates some html that can be used to select which area should be
+# displayed.
+function make_area_select_html( $link, $current, $year, $month, $day )
+{
+	global $tbl_area;
+	$out_html = "
+<form name=\"areaChangeForm\" method=get action=\"$link\">
+  <select name=\"area\" onChange=\"document.areaChangeForm.submit()\">";
+
+	$sql = "select id, area_name from $tbl_area order by area_name";
+   	$res = sql_query($sql);
+   	if ($res) for ($i = 0; ($row = sql_row($res, $i)); $i++)
+   	{
+		$selected = ($row[0] == $current) ? "selected" : "";
+		$out_html .= "
+    <option $selected value=\"".$row[0]."\">" . htmlspecialchars($row[1]);
+   	}
+	$out_html .= "
+  </select>
+
+  <INPUT TYPE=HIDDEN NAME=day        VALUE=\"$day\">
+  <INPUT TYPE=HIDDEN NAME=month      VALUE=\"$month\">
+  <INPUT TYPE=HIDDEN NAME=year       VALUE=\"$year\">
+  <input type=submit value=\"".get_string('savechanges')."\">
+</form>\n";
+
+	return $out_html;
+} # end make_area_select_html
+
+function make_room_select_html( $link, $area, $current, $year, $month, $day )
+{
+	global $tbl_room;
+	$out_html = "
+<form name=\"roomChangeForm\" method=get action=\"$link\">
+  <select name=\"room\" onChange=\"document.roomChangeForm.submit()\">";
+
+	$sql = "select id, room_name from $tbl_room where area_id=$area order by room_name";
+   	$res = sql_query($sql);
+   	if ($res) for ($i = 0; ($row = sql_row($res, $i)); $i++)
+   	{
+		$selected = ($row[0] == $current) ? "selected" : "";
+		$out_html .= "
+    <option $selected value=\"".$row[0]."\">" . htmlspecialchars($row[1]);
+   	}
+	$out_html .= "
+  </select>
+  <INPUT TYPE=HIDDEN NAME=day        VALUE=\"$day\"        >
+  <INPUT TYPE=HIDDEN NAME=month      VALUE=\"$month\"        >
+  <INPUT TYPE=HIDDEN NAME=year       VALUE=\"$year\"      >
+  <INPUT TYPE=HIDDEN NAME=area       VALUE=\"$area\"         >
+  <input type=submit value=\"".get_string('savechanges')."\">
+</form>\n";
+
+	return $out_html;
+} # end make_area_select_html
+
+
+# This will return the appropriate value for isdst for mktime().
+# The order of the arguments was chosen to match those of mktime.
+# hour is added so that this function can when necessary only be
+# run if the time is between midnight and 3am (all DST changes
+# occur in this period.
+function is_dst ( $month, $day, $year, $hour="-1" )
+{
+
+	if( $hour != -1  && $hour > 3)
+		return( -1 );
+	
+	# entering DST
+	if( !date( "I", mktime(12, 0, 0, $month, $day-1, $year)) && 
+	    date( "I", mktime(12, 0, 0, $month, $day, $year)))
+		return( 0 ); 
+
+	# leaving DST
+	elseif( date( "I", mktime(12, 0, 0, $month, $day-1, $year)) && 
+	    !date( "I", mktime(12, 0, 0, $month, $day, $year)))
+		return( 1 );
+	else
+		return( -1 );
+}
+
+# if crossing dst determine if you need to make a modification
+# of 3600 seconds (1 hour) in either direction
+function cross_dst ( $start, $end )
+{
+	
+	# entering DST
+	if( !date( "I", $start) &&  date( "I", $end))
+		$modification = -3600;
+
+	# leaving DST
+	elseif(  date( "I", $start) && !date( "I", $end))
+		$modification = 3600;
+	else
+		$modification = 0;
+
+	return $modification;
+}
+?>
Index: web/session_php.php
===================================================================
RCS file: web/session_php.php
diff -N web/session_php.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_php.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,218 @@
+<?php
+/*****************************************************************************\
+*                                                                             *
+*   File name       session_php.php                                           *
+*                                                                             *
+*   Description     Use PHP built-in sessions handling                        *
+*                                                                             *
+*   Notes           To use this authentication scheme, set in                 *
+*                   config.inc.php:                                           *
+*                       $auth["session"]  = "php";                            *
+*                                                                             *
+*                                                                             *
+*   History                                                                   *
+*    2003/11/09 JFL Created this file                                         *
+*    Remaining history in ChangeLog and CVS logs                              *
+*                                                                             *
+\*****************************************************************************/
+
+// $Id: session_php.php,v 1.3 2008/08/01 04:02:10 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
+global $PHP_SELF, $USER;
+
+if (isset($cookie_path_override))
+{
+    $cookie_path = $cookie_path_override;
+}
+else
+{
+    $cookie_path = $PHP_SELF;
+    $cookie_path = ereg_replace('[^/]*$', '', $cookie_path);
+}
+session_set_cookie_params(0, $cookie_path);
+session_start();
+
+/*
+  Target of the form with sets the URL argument "Action=SetName".
+  Will eventually return to URL argument "TargetURL=whatever".
+*/
+if (isset($Action) && ($Action == "SetName"))
+{
+    /* First make sure the password is valid */
+    if ($NewUserName == "") {
+
+        // Unset the session variables
+        if (isset($_SESSION)) {
+            $_SESSION = array();
+        } else {
+            global $HTTP_SESSION_VARS;
+            $HTTP_SESSION_VARS = array();
+        }
+    } else {
+        $NewUserName = unslashes($NewUserName);
+        $NewUserPassword = unslashes($NewUserPassword);
+        if (!authValidateUser($NewUserName, $NewUserPassword)) {
+            print_header_mrbs(0, 0, 0, 0);
+            echo "<P>".get_string('usernamenotfound')."</P>\n";
+            printLoginForm($TargetURL);
+            exit();
+        }
+
+        if (isset($_SESSION)) {
+            $_SESSION["UserName"] = $NewUserName;
+        } else {
+            global $HTTP_SESSION_VARS;
+            $HTTP_SESSION_VARS["UserName"] = $NewUserName;
+        }
+    }
+
+    header ("Location: $TargetURL"); /* Redirect browser to initial page */
+    /* Note HTTP 1.1 mandates an absolute URL. Most modern browsers support relative URLs,
+        which allows to work around problems with DNS inconsistencies in the server name.
+        Anyway, if the browser cannot redirect automatically, the manual link below will work. */
+    print_header_mrbs(0, 0, 0, 0);
+    echo "<br />\n";
+    echo "<p>Please click <a href=\"$TargetURL\">here</a> if you're not redirected automatically to the page you requested.</p>\n";
+    echo "</body>\n";
+    echo "</html>\n";
+    exit();
+}
+
+/*
+  Display the login form. Used by two routines below.
+  Will eventually return to $TargetURL.
+*/
+function printLoginForm($TargetURL)
+{
+    global $PHP_SELF;
+?>
+<p>
+  <?php echo get_string('loginsite') ?>
+</p>
+<form method="post" action="<?php echo basename($PHP_SELF) ?>">
+  <table>
+    <tr>
+      <td align="right"><?php echo get_string('username') ?></td>
+      <td><input type="text" name="NewUserName" /></td>
+    </tr>
+    <tr>
+      <td align="right"><?php echo get_string('password') ?></td>
+      <td><input type="password" name="NewUserPassword" /></td>
+    </tr>
+  </table>
+  <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" /> <br />
+  <input type="hidden" name="Action" value="SetName" /> <br />
+  <input type="submit" value=" <?php echo get_string('login') ?> " /> <br />
+</form>
+</body>
+</html>
+<?php
+}
+
+/*
+  Target of the form with sets the URL argument "Action=QueryName".
+  Will eventually return to URL argument "TargetURL=whatever".
+*/
+if (isset($Action) && ($Action == "QueryName"))
+{
+    print_header_mrbs(0, 0, 0, 0);
+    printLoginForm($TargetURL);
+    exit();
+}
+
+/* authGet()
+ * 
+ * Request the user name/password
+ * 
+ * Returns: Nothing
+ */
+function authGet()
+{
+    global $PHP_SELF, $QUERY_STRING;
+
+    print_header_mrbs(0, 0, 0, 0);
+
+    echo "<p>".get_string('norights','block_mrbs')."</p>\n";
+
+    $TargetURL = basename($PHP_SELF);
+    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
+    printLoginForm($TargetURL);
+
+    exit();
+}
+
+function getUserName()
+{ global $USER;
+   return $USER->username;
+/*
+    if (isset($_SESSION) && isset($_SESSION["UserName"]) && ($_SESSION["UserName"] != ""))
+    {
+        return 'aborrow'; //$_SESSION["UserName"];
+    }
+    else
+    {
+        global $HTTP_SESSION_VARS;
+        if (isset($HTTP_SESSION_VARS["UserName"]) && ($HTTP_SESSION_VARS["UserName"] != ""))
+            return 'arborrow'; //$HTTP_SESSION_VARS["UserName"];
+    }
+    return 'aborrow';
+*/
+}
+
+// Print the logon entry on the top banner.
+function PrintLogonBox()
+{
+    global $PHP_SELF, $QUERY_STRING, $user_list_link, $user_link, $day, $month;
+    global $year, $auth;
+
+    $TargetURL = basename($PHP_SELF);
+    if (isset($url_base) && ($url_base != "")) $TargetURL = $url_base . '/' . $TargetURL;
+    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
+    $user=getUserName();
+    if (isset($user))
+    {
+        // words 'you are xxxx' becomes a link to the
+        // report page with only entries created by xxx. Past entries are not
+        // displayed but this can be changed
+       	$search_string = "report.php?From_day=$day&From_month=$month&".
+          "From_year=$year&To_day=1&To_month=12&To_year=2030&areamatch=&".
+          "roommatch=&namematch=&descrmatch=&summarize=1&sortby=r&display=d&".
+          "sumby=d&creatormatch=$user"; ?>
+
+              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+                <A name="logonBox" href="<?php echo "$search_string\" title=\""
+         . get_string('show_my_entries','block_mrbs') . "\">" . get_string('you_are','block_mrbs')." "
+         .$user ?></A><br>
+                <FORM METHOD=POST ACTION="admin.php">
+	          <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
+	          <input type="hidden" name="Action" value="SetName" />
+	          <input type="hidden" name="NewUserName" value="" />
+	          <input type="hidden" name="NewUserPassword" value="" />
+	    <input type="submit" value=" <?php echo get_string('logout') ?> " />
+                </FORM>
+<?php if (isset($user_list_link)) print "
+                <br>
+                <A href=\"$user_list_link\">" . get_string('user_list') . "</A><br>\n";
+?>
+              </TD>
+<?php
+    }
+else
+    {
+?>
+              <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+	  <A name="logonBox" href=""><?php echo get_string('usernamenotfound'); ?></A><br>
+                <FORM METHOD=POST ACTION="admin.php">
+                  <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
+                  <input type="hidden" name="Action" value="QueryName" />
+	    <input type="submit" value=" <?php echo get_string('login') ?> " />
+                </FORM>
+<?php if (isset($user_list_link)) print "
+	        <br>
+                <A href=\"$user_list_link\">" . get_string('user_list') . "</A><br>\n";
+?>
+              </TD>
+<?php
+    }
+}
+?>
Index: web/auth_nis.php
===================================================================
RCS file: web/auth_nis.php
diff -N web/auth_nis.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_nis.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,92 @@
+<?php
+
+/* $Id: auth_nis.php,v 1.1 2007/04/05 22:25:25 arborrow Exp $
+ *
+ * Authentication scheme that uses NIS as the source for user
+ * authentication.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ * $auth["realm"] = "MRBS";    # Or any other string
+ * $auth["type"]  = "nis";
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "nisuser1";
+ * $auth["admin"][] = "nisuser2";
+ *
+ */
+
+/* ~~JFL 2003/11/12 By default, use the http session mechanism */
+
+require_once("../../../config.php");
+
+if (!isset($auth['session'])) $auth['session']='http';
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+function authValidateUser($user, $pass)
+{
+        global $auth;
+
+	// Check if we do not have a username/password
+	if(!isset($user) || !isset($pass))
+	{
+		return 0;
+	}
+
+        // untaint $user
+        //preg_match("/(^\w+).*/",$user,$regs);
+        //$user = $regs[1];
+
+        $rs = yp_match (yp_get_default_domain(), "passwd.byname", $user);
+	if ( ! empty ( $rs ) ) {
+          $rs = explode ( ":", $rs );
+	  if ( $rs[1] == crypt ( $pass, substr ( $rs[1], 0, 2 ) ) ) { 
+            return 1;
+          } else {
+            return 0;
+          }
+        }
+
+	// return failure
+	return 0;
+}
+
+/* authGetUserLevel($user)
+ *
+ * Determines the users access level
+ *
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+	// User not logged in, user level '0'
+	if(!isset($user))
+		return 0;
+
+	// Check if the user is can modify
+	for($i = 0; $lev1_admin[$i]; $i++)
+	{
+		if(strcasecmp($user, $lev1_admin[$i]) == 0)
+			return 2;
+	}
+	
+	// Everybody else is access level '1'
+	return 1;
+}
+
+?>
Index: web/mincals.php
===================================================================
RCS file: web/mincals.php
diff -N web/mincals.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/mincals.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,228 @@
+<?php
+// $Id: mincals.php,v 1.2 2007/12/28 05:53:05 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
+function minicals($year, $month, $day, $area, $room, $dmy) {
+
+// PHP Calendar Class
+//  
+// Copyright David Wilkinson 2000. All Rights reserved.
+// 
+// This software may be used, modified and distributed freely
+// providing this copyright notice remains intact at the head 
+// of the file.
+//
+// This software is freeware. The author accepts no liability for
+// any loss or damages whatsoever incurred directly or indirectly 
+// from the use of this script.
+//
+// URL:   http://www.cascade.org.uk/software/php/calendar/
+// Email: davidw@cascade.org.uk
+
+class Calendar
+{
+    var $month;
+    var $year;
+    var $day;
+    var $h;
+    var $area;
+    var $room;
+    var $dmy;
+    
+    function Calendar($day, $month, $year, $h, $area, $room, $dmy)
+    {
+        $this->day   = $day;
+        $this->month = $month;
+        $this->year  = $year;
+        $this->h     = $h;
+        $this->area  = $area;
+        $this->room  = $room;
+        $this->dmy   = $dmy;
+    }
+   
+    
+    function getCalendarLink($month, $year)
+    {
+        return "";
+    }
+    
+   function getDateLink($day, $month, $year)
+   {
+      if( empty($this->room) )
+         return $this->dmy.".php?year=$year&month=$month&day=$day&area=".$this->area;
+      else
+         return $this->dmy.".php?year=$year&month=$month&day=$day&area=".$this->area."&room=".$this->room;
+   }
+    
+
+    function getDaysInMonth($month, $year)
+    {
+        if ($month < 1 || $month > 12)
+        {
+            return 0;
+        }
+    
+        $days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+   
+        $d = $days[$month - 1];
+   
+        if ($month == 2)
+        {
+            // Check for leap year
+            // Forget the 4000 rule, I doubt I'll be around then...
+        
+            if ($year%4 == 0)
+            {
+                if ($year%100 == 0)
+                {
+                    if ($year%400 == 0)
+                    {
+                        $d = 29;
+                    }
+                }
+                else
+                {
+                    $d = 29;
+                }
+            }
+        }
+    
+        return $d;
+    }
+
+    function getFirstDays()
+    {
+      global $weekstarts;
+
+      $basetime = mktime(12,0,0,6,11+$weekstarts,2000);
+      for ($i = 0, $s = ""; $i < 7; $i++)
+      {
+         $show = $basetime + ($i * 24 * 60 * 60);
+         $fl = utf8_strftime('%a',$show);
+         $s .= "<td align=center valign=top class=\"calendarHeader\">$fl</td>\n";
+      }
+      return $s;
+    }
+
+    function getHTML()
+    {
+        global $weekstarts;
+        global $PHP_SELF;
+        global $day;
+        global $month;
+
+        if (!isset($weekstarts)) $weekstarts = 0;
+        $s = "";
+        
+        $daysInMonth = $this->getDaysInMonth($this->month, $this->year);
+	// $prevYear is the current year unless the previous month is
+	// December then you need to decrement the year
+	if( $this->month - 1 > 0 )
+	{
+		$prevMonth = $this->month - 1;
+		$prevYear = $this->year;
+	}
+	else
+	{
+		$prevMonth = 12;
+		$prevYear = $this->year -1;
+	}
+        $daysInPrevMonth = $this->getDaysInMonth($prevMonth, $prevYear);
+        $date = mktime(12, 0, 0, $this->month, 1, $this->year);
+        
+        $first = (strftime("%w",$date) + 7 - $weekstarts) % 7;
+        $monthName = utf8_strftime("%B",$date);
+        
+        //$prevMonth = $this->getCalendarLink($this->month - 1 >   0 ? $this->month - 1 : 12, $this->month - 1 >   0 ? $this->year : $this->year - 1);
+        //$nextMonth = $this->getCalendarLink($this->month + 1 <= 12 ? $this->month + 1 :  1, $this->month + 1 <= 12 ? $this->year : $this->year + 1);
+        
+        $s .= "<table class=\"calendar\">\n";
+        // prints month name and year
+        $s .= "<tr>\n";
+        //$s .= "<td align=center valign=top>" . (($prevMonth == "") ? "&nbsp;" : "<a href=\"$prevMonth\">&lt;&lt;</a>")  . "</td>\n";
+        $s .= "<td align=center valign=top class=\"calendarHeader\" colspan=7>$monthName&nbsp;$this->year</td>\n"; 
+        //$s .= "<td align=center valign=top>" . (($nextMonth == "") ? "&nbsp;" : "<a href=\"$nextMonth\">&gt;&gt;</a>")  . "</td>\n";
+        $s .= "</tr>\n";
+        
+        $s .= "<tr>\n";
+        // gets days of week
+        $s .= $this->getFirstDays();
+        $s .= "</tr>\n";
+
+        $d = 1 - $first;
+            
+        # this is used to highlight days in upcoming month
+        $days_to_highlight = ($d + 7);
+
+        while ($d <= $daysInMonth)
+        {
+            $s .= "<tr>\n";
+
+            for ($i = 0; $i < 7; $i++)
+            {
+                $s .= "<td class=\"calendar\" align=\"center\" valign=\"top\">";
+                if ($d > 0 && $d <= $daysInMonth)
+                {
+                    $link = $this->getDateLink($d, $this->month, $this->year);
+                    $d_week = ($d - 7);
+
+                    if ($link == "")
+                        $s .= $d;
+                    elseif (preg_match("/day/i", basename($PHP_SELF)))
+                    {
+                        if (($d == $this->day) and ($this->h))
+                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
+                        else
+                            $s .= "<a href=\"$link\">$d</a>";
+                    }
+                    elseif (preg_match("/week/i", basename($PHP_SELF)))
+                    {
+		    #echo "((".$this->day." < $days_to_highlight) && ($d < $days_to_highlight) && (($day - $daysInMonth) > (-6)) && (".$this->month." == ($month + 1)) && ($first != 0))<br>";
+                        if (($this->day <= $d) && ($this->day > $d_week) && ($this->h))
+                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
+                        elseif (($this->day < $days_to_highlight) && ($d < $days_to_highlight) && (($day - $daysInPrevMonth) > (-6)) && ($this->month == (($month + 1)%12)) && ($first != 0))
+                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
+                        else
+                            $s .= "<a href=\"$link\">$d</a>";
+                    }
+                    elseif (preg_match("/month/i", basename($PHP_SELF)))
+                        if ( $this->h )
+                            $s .= "<a href=\"$link\"><font class=\"calendarHighlight\">$d</font></a>";
+                        else
+                            $s .= "<a href=\"$link\">$d</a>";
+                }
+                else
+                {
+                    $s .= "&nbsp;";
+                }
+                $s .= "</td>\n";
+                $d++;
+            }
+            $s .= "</tr>\n";
+        }
+        
+        $s .= "</table>\n";
+        
+        return $s;
+    }
+}
+
+$lastmonth = mktime(12, 0, 0, $month-1, 1, $year);
+$thismonth = mktime(12, 0, 0, $month,   $day, $year);
+$nextmonth = mktime(12, 0, 0, $month+1, 1, $year);
+
+echo "<td>";
+$cal = new Calendar(date("d",$lastmonth), date("m",$lastmonth), date("Y",$lastmonth), 0, $area, $room, $dmy);
+echo $cal->getHTML();
+echo "</td>";
+
+echo "<td>";
+$cal = new Calendar(date("d",$thismonth), date("m",$thismonth), date("Y",$thismonth), 1, $area, $room, $dmy);
+echo $cal->getHTML();
+echo "</td>";
+
+echo "<td>";
+$cal = new Calendar(date("d",$nextmonth), date("m",$nextmonth), date("Y",$nextmonth), 0, $area, $room, $dmy);
+echo $cal->getHTML();
+echo "</td>";
+}
+?>
Index: web/mrbs_sql.php
===================================================================
RCS file: web/mrbs_sql.php
diff -N web/mrbs_sql.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/mrbs_sql.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,474 @@
+<?php
+// $Id: mrbs_sql.inc,v 1.18.2.3 2006/01/26 11:34:02 jberanek Exp $
+require_once("../../../config.php"); //for Moodle integration
+/** mrbsCheckFree()
+ * 
+ * Check to see if the time period specified is free
+ * 
+ * $room_id   - Which room are we checking
+ * $starttime - The start of period
+ * $endtime   - The end of the period
+ * $ignore    - An entry ID to ignore, 0 to ignore no entries
+ * $repignore - A repeat ID to ignore everything in the series, 0 to ignore no series
+ * 
+ * Returns:
+ *   nothing   - The area is free
+ *   something - An error occured, the return value is human readable
+ */
+function mrbsCheckFree($room_id, $starttime, $endtime, $ignore, $repignore)
+{
+	global $tbl_entry;
+	global $enable_periods;
+    global $periods;
+
+    # Select any meetings which overlap ($starttime,$endtime) for this room:
+	$sql = "SELECT id, name, start_time FROM $tbl_entry WHERE
+		start_time < $endtime AND end_time > $starttime
+		AND room_id = $room_id";
+
+	if ($ignore > 0)
+		$sql .= " AND id <> $ignore";
+	if ($repignore > 0)
+		$sql .= " AND repeat_id <> $repignore";
+	$sql .= " ORDER BY start_time";
+
+	$res = sql_query($sql);
+	if(! $res)
+		return sql_error();
+	if (sql_count($res) == 0)
+	{
+		sql_free($res);
+		return "";
+	}
+	# Get the room's area ID for linking to day, week, and month views:
+	$area = mrbsGetRoomArea($room_id);
+	
+	# Build a string listing all the conflicts:
+	$err = "";
+	for ($i = 0; ($row = sql_row($res, $i)); $i++)
+	{
+		$starts = getdate($row[2]);
+		$param_ym = "area=$area&year=$starts[year]&month=$starts[mon]";
+		$param_ymd = $param_ym . "&day=$starts[mday]";
+
+
+		if( $enable_periods ) {
+        	$p_num =$starts['minutes'];
+        	$startstr = utf8_strftime('%A %d %B %Y, ', $row[2]) . $periods[$p_num];
+        }
+		else
+        	$startstr = utf8_strftime('%A %d %B %Y %H:%M:%S', $row[2]);
+
+        $err .= "<LI><A HREF=\"view_entry.php?id=$row[0]\">$row[1]</A>"
+		. " ( " . $startstr . ") "
+		. "(<A HREF=\"day.php?$param_ymd\">".get_string('viewday','block_mrbs')."</a>"
+		. " | <A HREF=\"week.php?room=$room_id&$param_ymd\">".get_string('viewweek','block_mrbs')."</a>"
+		. " | <A HREF=\"month.php?room=$room_id&$param_ym\">".get_string('viewmonth','block_mrbs')."</a>)";
+	}
+	
+	return $err;
+}
+
+/** mrbsDelEntry()
+ * 
+ * Delete an entry, or optionally all entrys.
+ * 
+ * $user   - Who's making the request
+ * $id     - The entry to delete
+ * $series - If set, delete the series, except user modified entrys
+ * $all    - If set, include user modified entrys in the series delete
+ *
+ * Returns:
+ *   0        - An error occured
+ *   non-zero - The entry was deleted
+ */
+function mrbsDelEntry($user, $id, $series, $all)
+{
+	global $tbl_entry, $tbl_repeat;
+
+	$repeat_id = sql_query1("SELECT repeat_id FROM $tbl_entry WHERE id=$id");
+	if ($repeat_id < 0)
+		return 0;
+	
+	$sql = "SELECT create_by, id, entry_type FROM $tbl_entry WHERE ";
+	
+	if($series)
+		$sql .= "repeat_id=$repeat_id";
+	else
+		$sql .= "id=$id";
+	
+	$res = sql_query($sql);
+	
+	$removed = 0;
+	
+	for ($i = 0; ($row = sql_row($res, $i)); $i++)
+	{
+		if(!getWritable($row[0], $user))
+			continue;
+		
+		if($series && $row[2] == 2 && !$all)
+			continue;
+		
+		if (sql_command("DELETE FROM $tbl_entry WHERE id=" . $row[1]) > 0)
+			$removed++;
+	}
+	
+	if ($repeat_id > 0 &&
+            sql_query1("SELECT count(*) FROM $tbl_entry WHERE repeat_id=$repeat_id") == 0)
+		sql_command("DELETE FROM $tbl_repeat WHERE id=$repeat_id");
+	
+	return $removed > 0;
+}
+
+/** mrbsCreateSingleEntry()
+ * 
+ * Create a single (non-repeating) entry in the database
+ * 
+ * $starttime   - Start time of entry
+ * $endtime     - End time of entry
+ * $entry_type  - Entry type
+ * $repeat_id   - Repeat ID
+ * $room_id     - Room ID
+ * $owner       - Owner
+ * $name        - Name
+ * $type        - Type (Internal/External)
+ * $description - Description
+ * 
+ * Returns:
+ *   0        - An error occured while inserting the entry
+ *   non-zero - The entry's ID
+ */
+function mrbsCreateSingleEntry($starttime, $endtime, $entry_type, $repeat_id, $room_id,
+                               $owner, $name, $type, $description)
+{
+	global $tbl_entry;
+
+	$name        = slashes($name);
+	$description = slashes($description);
+	$timestamp = time();
+	# make sure that any entry is of a positive duration
+	# this is to trap potential negative duration created when DST comes
+	# into effect
+	if( $endtime > $starttime )
+	$sql = "INSERT INTO $tbl_entry (  start_time,   end_time,   entry_type,    repeat_id,   room_id,
+	                                  create_by,    name,       type,          description, timestamp)
+	                        VALUES ($starttime, $endtime, $entry_type, $repeat_id, $room_id,
+	                                '$owner',     '$name',    '$type',       '$description', $timestamp)";
+	
+	if (sql_command($sql) < 0) return 0;
+	
+	return sql_insert_id("$tbl_entry", "id");
+}
+
+/** mrbsCreateRepeatEntry()
+ * 
+ * Creates a repeat entry in the data base
+ * 
+ * $starttime   - Start time of entry
+ * $endtime     - End time of entry
+ * $rep_type    - The repeat type
+ * $rep_enddate - When the repeating ends
+ * $rep_opt     - Any options associated with the entry
+ * $room_id     - Room ID
+ * $owner       - Owner
+ * $name        - Name
+ * $type        - Type (Internal/External)
+ * $description - Description
+ * 
+ * Returns:
+ *   0        - An error occured while inserting the entry
+ *   non-zero - The entry's ID
+ */
+function mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt,
+                               $room_id, $owner, $name, $type, $description, $rep_num_weeks)
+{
+	global $tbl_repeat;
+
+	$name        = slashes($name);
+	$description = slashes($description);
+	$timestamp = time();
+	// Let's construct the sql statement:
+	$sql_coln = array(); $sql_val = array();
+
+        // Mandatory things:
+	$sql_coln[] = 'start_time'; 	$sql_val[] = $starttime;
+	$sql_coln[] = 'end_time'; 	$sql_val[] = $endtime;
+	$sql_coln[] = 'rep_type'; 	$sql_val[] = $rep_type;
+	$sql_coln[] = 'end_date';	$sql_val[] = $rep_enddate;
+	$sql_coln[] = 'room_id';	$sql_val[] = $room_id;
+	$sql_coln[] = 'create_by';	$sql_val[] = '\''.$owner.'\'';
+	$sql_coln[] = 'type';		$sql_val[] = '\''.$type.'\'';
+	$sql_coln[] = 'name';		$sql_val[] = '\''.$name.'\'';
+
+	// Optional things, pgsql doesn't like empty strings!
+	if (!empty($rep_opt))
+		{$sql_coln[] = 'rep_opt';	$sql_val[] = '\''.$rep_opt.'\'';}
+	else
+		{$sql_coln[] = 'rep_opt';	$sql_val[] = '\'0\'';}
+	if (!empty($description))
+		{$sql_coln[] = 'description';	$sql_val[] = '\''.$description.'\'';}
+	if (!empty($rep_num_weeks))
+		{$sql_coln[] = 'rep_num_weeks';	$sql_val[] = $rep_num_weeks;}
+
+	$sql = 'INSERT INTO ' . $tbl_repeat .
+	       ' (' . implode(', ',$sql_coln) . 'timestamp) '.
+	       'VALUES (' . implode(', ',$sql_val) . ',$timestamp)';
+
+
+	if (sql_command($sql) < 0) return 0;
+	
+	return sql_insert_id("$tbl_repeat", "id");
+}
+
+/** same_day_next_month()
+* Find the same day of the week in next month, same week number.
+*
+* Return the number of days to step forward for a "monthly repeat,
+* corresponding day" serie - same week number and day of week next month.
+* This function always returns either 28 or 35.
+* For dates in the 5th week of a month, the resulting day will be in the 4th
+* week of the next month if no 5th week corresponding day exist.
+* :TODO: thierry_bo 030510: repeat 5th week entries only if 5th week exist.
+* If we want a 5th week repeat type, only 5th weeks have to be booked. We need
+* also a new "monthly repeat, corresponding day, last week of the month" type.
+*
+* @param    integer     $time           timestamp of the day from which we want to find
+*                                       the same day of the week in next month, same
+*                                       week number
+* @return   integer     $days_jump      number of days to step forward to find the next occurence (28 or 35)
+* @var      integer     $days_in_month  number of days in month
+* @var      integer     $day            day of the month (01 to 31)
+* @var      integer     $weeknumber     week number for each occurence ($time)
+* @var      boolean     $temp1          first step to compute $days_jump
+* @var      integer     $next_month     intermediate next month number (1 to 12)
+* @global   integer     $_initial_weeknumber    used only for 5th weeks repeat type
+ */
+function same_day_next_month($time)
+{
+    global $_initial_weeknumber;
+
+    $days_in_month = date("t", $time);
+    $day = date("d", $time);
+    $weeknumber = (int)(($day - 1) / 7) + 1;
+    $temp1 = ($day + 7 * (5 - $weeknumber) <= $days_in_month);
+
+    // keep month number > 12 for the test purpose in line beginning with "days_jump = 28 +..."
+    $next_month = date("n", mktime(11, 0 ,0, date("n", $time), $day +35, date("Y", $time))) + (date("n", mktime(11, 0 ,0, date("n", $time), $day +35, date("Y", $time))) < date("n", $time)) * 12;
+
+    // prevent 2 months jumps if $time is in 5th week
+    $days_jump = 28 + (($temp1 && !($next_month - date("n", $time) - 1)) * 7);
+
+    /* if initial week number is 5 and the new occurence month number ($time + $days_jump)
+     * is not changed if we add 7 days, then we can add 7 days to $days_jump to come
+     * back to the 5th week (yuh!) */
+    $days_jump += 7 * (($_initial_weeknumber == 5) && (date("n", mktime(11, 0 ,0, date("n", $time), $day + $days_jump, date("Y", $time))) == date("n", mktime(11, 0 ,0, date("n", $time), $day + $days_jump + 7, date("Y", $time)))));
+
+    return $days_jump;
+}
+
+/** mrbsGetRepeatEntryList
+ * 
+ * Returns a list of the repeating entrys
+ * 
+ * $time     - The start time
+ * $enddate  - When the repeat ends
+ * $rep_type - What type of repeat is it
+ * $rep_opt  - The repeat entrys
+ * $max_ittr - After going through this many entrys assume an error has occured
+ * $_initial_weeknumber - Save initial week number for use in 'monthly repeat same week number' case
+ * 
+ * Returns:
+ *   empty     - The entry does not repeat
+ *   an array  - This is a list of start times of each of the repeat entrys
+ */
+function mrbsGetRepeatEntryList($time, $enddate, $rep_type, $rep_opt, $max_ittr, $rep_num_weeks)
+{
+	$sec   = date("s", $time);
+	$min   = date("i", $time);
+	$hour  = date("G", $time);
+	$day   = date("d", $time);
+	$month = date("m", $time);
+	$year  = date("Y", $time);
+
+	global $_initial_weeknumber;
+	$_initial_weeknumber = (int)(($day - 1) / 7) + 1;
+	$week_num = 0;
+	$start_day = date('w', mktime($hour, $min, $sec, $month, $day, $year));
+	$cur_day = $start_day;
+
+	$entrys = "";
+	for($i = 0; $i < $max_ittr; $i++)
+	{
+		$time = mktime($hour, $min, $sec, $month, $day, $year);
+		if ($time > $enddate)
+			break;
+
+		$entrys[$i] = $time;
+		
+		switch($rep_type)
+		{
+			// Daily repeat
+			case 1:
+				$day += 1;
+				break;
+			
+			// Weekly repeat
+			case 2:
+				$j = $cur_day = date("w", $entrys[$i]);
+				// Skip over days of the week which are not enabled:
+				while (($j = ($j + 1) % 7) != $cur_day && !$rep_opt[$j])
+					$day += 1;
+
+				$day += 1;
+				break;
+			
+			// Monthly repeat
+			case 3:
+				$month += 1;
+				break;
+			
+			// Yearly repeat
+			case 4:
+				$year += 1;
+				break;
+			
+			// Monthly repeat on same week number and day of week
+			case 5:
+				$day += same_day_next_month($time);
+				break;
+
+			// n Weekly repeat
+			case 6:
+
+				while (1)
+				{
+					$day++;
+					$cur_day = ($cur_day + 1) % 7;
+
+					if (($cur_day % 7) == $start_day)
+					{
+						$week_num++;
+					}
+
+					if (($week_num % $rep_num_weeks == 0) &&
+					    ($rep_opt[$cur_day] == 1))
+					{
+						break;
+					}
+				}
+
+				break;	
+				
+			// Unknown repeat option
+			default:
+				return;
+		}
+	}
+
+	return $entrys;
+}
+
+/** mrbsCreateRepeatingEntrys()
+ * 
+ * Creates a repeat entry in the data base + all the repeating entrys
+ * 
+ * $starttime   - Start time of entry
+ * $endtime     - End time of entry
+ * $rep_type    - The repeat type
+ * $rep_enddate - When the repeating ends
+ * $rep_opt     - Any options associated with the entry
+ * $room_id     - Room ID
+ * $owner       - Owner
+ * $name        - Name
+ * $type        - Type (Internal/External)
+ * $description - Description
+ * 
+ * Returns:
+ *   0        - An error occured while inserting the entry
+ *   non-zero - The entry's ID
+ */
+function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt,
+                                   $room_id, $owner, $name, $type, $description, $rep_num_weeks)
+{
+	global $max_rep_entrys;
+	
+	$reps = mrbsGetRepeatEntryList($starttime, $rep_enddate, $rep_type, $rep_opt, $max_rep_entrys, $rep_num_weeks);
+	if(count($reps) > $max_rep_entrys)
+		return 0;
+	
+	if(empty($reps))
+	{
+		$ent = mrbsCreateSingleEntry($starttime, $endtime, 0, 0, $room_id, $owner, $name, $type, $description);
+		return $ent;
+	}
+	
+	$ent = mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $owner, $name, $type, $description, $rep_num_weeks);
+	if($ent)
+	{
+	
+		for($i = 0; $i < count($reps); $i++)
+		{
+			# calculate diff each time and correct where events
+			# cross DST
+			$diff = $endtime - $starttime;
+			$diff += cross_dst($reps[$i], $reps[$i] + $diff);
+	    
+			mrbsCreateSingleEntry($reps[$i], $reps[$i] + $diff, 1, $ent,
+				 $room_id, $owner, $name, $type, $description);
+		}
+	}
+	return $ent;
+}
+
+/* mrbsGetEntryInfo()
+ *
+ * Get the booking's entrys
+ * 
+ * $id = The ID for which to get the info for.
+ * 
+ * Returns:
+ *    nothing = The ID does not exist
+ *    array   = The bookings info
+ */
+function mrbsGetEntryInfo($id)
+{
+	global $tbl_entry;
+
+	$sql = "SELECT start_time, end_time, entry_type, repeat_id, room_id,
+	               timestamp, create_by, name, type, description
+                FROM $tbl_entry WHERE (ID = $id)";
+	
+	$res = sql_query($sql);
+	if (! $res) return;
+	
+	$ret = "";
+	if(sql_count($res) > 0)
+	{
+		$row = sql_row($res, 0);
+		
+		$ret["start_time"]  = $row[0];
+		$ret["end_time"]    = $row[1];
+		$ret["entry_type"]  = $row[2];
+		$ret["repeat_id"]   = $row[3];
+		$ret["room_id"]     = $row[4];
+		$ret["timestamp"]   = $row[5];
+		$ret["create_by"]   = $row[6];
+		$ret["name"]        = $row[7];
+		$ret["type"]        = $row[8];
+		$ret["description"] = $row[9];
+	}
+	sql_free($res);
+	
+	return $ret;
+}
+
+function mrbsGetRoomArea($id)
+{
+	global $tbl_room;
+
+	$id = sql_query1("SELECT area_id FROM $tbl_room WHERE (id = $id)");
+	if ($id <= 0) return 0;
+	return $id;
+}
+
+?>
Index: web/auth_ext.php
===================================================================
RCS file: web/auth_ext.php
diff -N web/auth_ext.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_ext.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,128 @@
+<?php
+/* $Id: auth_ext.php,v 1.1 2007/04/05 22:25:24 arborrow Exp $
+ *
+ * Authentication scheme that uses an external script as the source
+ * for user authentication.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ * $auth["realm"]  = "MRBS";    # Or any other string
+ * $auth["type"]   = "ext";
+ * $auth["prog"]   = "authenticationprogram";  # The full path to the external
+ *                                             # script
+ * $auth["params"] = "#USERNAME# #PASSWORD# other-params" # Parameters to pass to
+ *                                                        # the script, #USERNAME#
+ *                                                        # and #PASSWORD#
+ *                                                        # will be expanded to
+ *                                                        # the values typed by
+ *                                                        # the user.
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "username1";
+ * $auth["admin"][] = "username2";
+ *
+ */
+
+/* ~~JFL 2003/11/12 By default, use the http session mechanism */
+
+require_once("../../../config.php");
+
+if (!isset($auth['session'])) $auth['session']='http';
+
+function version_check($vercheck)
+{
+  $minver = str_replace(".","", $vercheck);
+  $curver = str_replace(".","", phpversion());
+
+  if($curver >= $minver)
+  {
+    return true;
+  }
+  return false;
+}
+
+if (version_check("4.0.3") == false)
+{
+    include "escapeshellarg.php";
+}
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+function authValidateUser($user, $pass)
+{
+        global $auth;
+        return 1;
+	// Check if we do not have a username/password
+	if(!isset($user) || !isset($pass))
+	{
+		return 0;
+	}
+
+	// Generate the command line
+	$cmd = $auth["prog"] . ' ' . $auth["params"];
+	$cmd = preg_replace('/#USERNAME#/',escapeshellarg($user),$cmd);
+	$cmd = preg_replace('/#PASSWORD#/',escapeshellarg($pass),$cmd);
+
+/*
+	// Run the program
+	exec($cmd, $output, $ret);
+
+	// If it succeeded, return success
+	if($ret == 0)
+		return 1;
+
+	// return failure
+	return 0;
+*/
+
+    return 1;
+
+//    if (isset($USER->username))
+//    {
+//      return 1;
+//    }
+//    else
+//    {
+//      return 0;
+//    }
+
+}
+
+/* authGetUserLevel($user)
+ * 
+ * Determines the users access level
+ * 
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+	// User not logged in, user level '0'
+	if(!isset($user))
+		return 0;
+	
+	// Check if the user is can modify
+	for($i = 0; $lev1_admin[$i]; $i++)
+	{
+		if(strcasecmp($user, $lev1_admin[$i]) == 0)
+			return 2;
+	}
+	
+	// Everybody else is access level '1'
+	return 1;
+}
+
+?>
Index: web/pgsql.php
===================================================================
RCS file: web/pgsql.php
diff -N web/pgsql.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/pgsql.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,257 @@
+<?php
+// $Id: pgsql.php,v 1.3 2008/08/01 04:02:10 arborrow Exp $
+
+// pgsql.php - Simple PHP database support for PostgreSQL.
+// Include this file after defining the following variables:
+//   $db_host = The hostname of the database server
+//   $db_login = The username to use when connecting to the database
+//   $db_password = The database account password
+//   $db_database = The database name.
+// Including this file connects you to the database, or exits on error.
+// This code hides an implementation difference in error reporting by the PHP
+// PostgreSQL and MySQL extensions. PostgreSQL reports an E_WARNING error
+// for some queries which MySQL does not; both properly set their own
+// error code and the PHP error raised by PostgreSQL is not needed.
+// The code here turns that off with error_reporting() calls around each
+// pg_exec call, so as not to make you change the display_errors
+// setting in your php.ini configuration file.
+
+require_once("../../../config.php"); //for Moodle integration
+// Free a results handle. You need not call this if you call sql_row or
+// sql_row_keyed until the row returns 0, since sql_row frees the results
+// handle when you finish reading the rows.
+function sql_free ($r)
+{
+	pg_free_result($r);
+}
+
+// Execute a non-SELECT SQL command (insert/update/delete).
+// Returns the number of tuples affected if OK (a number >= 0).
+// Returns -1 on error; use sql_error to get the error message.
+function sql_command ($sql)
+{
+	global $db_c;
+	$e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
+	$r = pg_query($db_c, $sql);
+	error_reporting($e);
+	if (! $r) return -1;
+	$n = pg_affected_rows($r);
+	pg_free_result($r);
+	return $n;
+}
+
+// Execute an SQL query which should return a single non-negative number value.
+// This is a lightweight alternative to sql_query, good for use with count(*)
+// and similar queries. It returns -1 on error or if the query did not return
+// exactly one value, so error checking is somewhat limited.
+// It also returns -1 if the query returns a single NULL value, such as from
+// a MIN or MAX aggregate function applied over no rows.
+function sql_query1 ($sql)
+{
+	global $db_c;
+	$e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
+	$r = pg_query($db_c, $sql);
+	error_reporting($e);
+	if (! $r) return -1;
+	if (pg_num_rows($r) != 1 || pg_num_fields($r) != 1
+		|| ($result = pg_fetch_result($r, 0, 0)) == "") $result = -1;
+	pg_free_result($r);
+	return $result;
+}
+
+// Execute an SQL query. Returns a database-dependent result handle,
+// which should be passed back to sql_row or sql_row_keyed to get the results.
+// Returns 0 on error; use sql_error to get the error message.
+function sql_query ($sql)
+{
+	global $db_c;
+	$e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
+	$r = pg_query($db_c, $sql);
+	error_reporting($e);
+	return $r;
+}
+
+// Return a row from a result. The first row is 0.
+// The row is returned as an array with index 0=first column, etc.
+// When called with i >= number of rows in the result, cleans up from
+// the query and returns 0.
+// Typical usage: $i = 0; while ((a = sql_row($r, $i++))) { ... }
+function sql_row ($r, $i)
+{
+	if ($i >= pg_num_rows($r))
+	{
+		pg_free_result($r);
+		return 0;
+	}
+	return pg_fetch_row($r, $i);
+}
+
+// Return a row from a result as an associative array keyed by field name.
+// The first row is 0.
+// This is actually upward compatible with sql_row since the underlying
+// routing also stores the data under number indexes.
+// When called with i >= number of rows in the result, cleans up from
+// the query and returns 0.
+function sql_row_keyed ($r, $i)
+{
+	if ($i >= pg_num_rows($r))
+	{
+		pg_free_result($r);
+		return 0;
+	}
+	return pg_fetch_array($r, $i);
+}
+
+// Return the number of rows returned by a result handle from sql_query.
+function sql_count ($r)
+{
+	return pg_num_rows($r);
+}
+
+// Return the value of an autoincrement field from the last insert.
+// For PostgreSQL, this must be a SERIAL type field.
+function sql_insert_id($table, $field)
+{
+	$seq_name = $table . "_" . $field . "_seq";
+	return sql_query1("select last_value from $seq_name");
+}
+
+// Return the text of the last error message.
+function sql_error()
+{
+	global $db_c;
+	return pg_last_error($db_c);
+}
+
+// Begin a transaction, if the database supports it. This is used to
+// improve PostgreSQL performance for multiple insert/delete/updates.
+// There is no rollback support, since MySQL doesn't support it.
+function sql_begin()
+{
+	sql_command("BEGIN");
+}
+
+// Commit (end) a transaction. See sql_begin().
+function sql_commit()
+{
+	sql_command("COMMIT");
+}
+
+// Acquire a mutual-exclusion lock on the named table. For portability:
+// This will not lock out SELECTs.
+// It may lock out DELETE/UPDATE/INSERT or not, depending on the implementation.
+// It will lock out other callers of this routine with the same name argument.
+// It may timeout in 20 seconds and return 0, or may wait forever.
+// It returns 1 when the lock has been acquired.
+// Caller must release the lock with sql_mutex_unlock().
+// Caller must not have more than one mutex at any time.
+// Do not mix this with sql_begin()/sql_end() calls.
+//
+// In PostgreSQL, the EXCLUSIVE mode lock excludes all but SELECT.
+// It does not timeout, but waits forever for the lock.
+function sql_mutex_lock($name)
+{
+	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
+	if (sql_command("BEGIN") < 0
+		|| sql_command("LOCK TABLE $name IN EXCLUSIVE MODE") < 0) return 0;
+	$sql_mutex_unlock_name = $name;
+	if (empty($sql_mutex_shutdown_registered))
+	{
+		register_shutdown_function("sql_mutex_cleanup");
+		$sql_mutex_shutdown_registered = 1;
+	}
+	return 1;
+}
+
+// Release a mutual-exclusion lock on the named table. See sql_mutex_lock.
+// In PostgreSQL, all locks are released by closing the transaction; there
+// is no other way.
+function sql_mutex_unlock($name)
+{
+	global $sql_mutex_unlock_name;
+	sql_command("COMMIT");
+	$sql_mutex_unlock_name = "";
+}
+
+// Shutdown function to clean up a forgotten lock. For internal use only.
+function sql_mutex_cleanup()
+{
+	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
+	if (!empty($sql_mutex_unlock_name))
+	{
+		sql_command("ABORT");
+		$sql_mutex_unlock_name = "";
+	}
+}
+
+// Return a string identifying the database version:
+function sql_version()
+{
+	$r = sql_query("select version()");
+	$v = sql_row($r, 0);
+	sql_free($r);
+	return $v[0];
+}
+
+// Generate non-standard SQL for LIMIT clauses:
+function sql_syntax_limit($count, $offset)
+{
+	return " LIMIT $count OFFSET $offset ";
+}
+
+// Generate non-standard SQL to output a TIMESTAMP as a Unix-time:
+function sql_syntax_timestamp_to_unix($fieldname)
+{
+	return " DATE_PART('epoch', $fieldname) ";
+}
+
+// Generate non-standard SQL to match a string anywhere in a field's value
+// in a case insensitive manner. $s is the un-escaped/un-slashed string.
+// In PostgreSQL, we can do case insensitive regexp with ~*, but not case
+// insensitive LIKE matching.
+// Quotemeta escapes everything we need except for single quotes.
+function sql_syntax_caseless_contains($fieldname, $s)
+{
+	$s = quotemeta($s);
+	$s = str_replace("'", "''", $s);
+	return " $fieldname ~* '$s' ";
+}
+
+// Returns the name of a field.
+function sql_field_name($result, $index)
+{
+	return pg_field_name($result, $index);
+}
+
+// Returns the type of a field. (one of "int", "real", "string", "blob", etc...)
+function sql_field_type($result, $index)
+{
+	return pg_field_type($result, $index);
+}
+
+// Returns the number of fields in a result.
+function sql_num_fields($result)
+{
+	return pg_num_fields($result);
+}
+
+// Establish a database connection.
+// On connection error, the message will be output without a proper HTML
+// header. There is no way I can see around this; if track_errors isn't on
+// there seems to be no way to supress the automatic error message output and
+// still be able to access the error text.
+$conninfo = (empty($db_host) ? "" : "host=$db_host ")
+	. "dbname=$db_database user=$db_login password=$db_password";
+if (empty($db_nopersist))
+	$db_c = pg_pconnect($conninfo);
+else
+	$db_c = pg_connect($conninfo);
+unset($conninfo);
+
+if (!$db_c)
+{
+	echo "\n<p>\n" . get_string('failed_connect_db','block_mrbs') . "\n";
+	exit;
+}
+
+?>
Index: web/lang.es.php
===================================================================
RCS file: web/lang.es.php
diff -N web/lang.es.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.es.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?
+# $Id: lang.es.php,v 1.5 2008/08/01 04:02:10 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Spanish file.
+#
+#
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "utf-8";
+
+# Used in style.php
+$vocab["mrbs"]               = "Gestor de Reserva de Salas";
+
+# Used in functions.php
+$vocab["report"]             = "Informes";
+$vocab["admin"]              = "Administración";
+$vocab["help"]               = "Ayuda";
+$vocab["search"]             = "Búsqueda:";
+$vocab["not_php3"]             = "<H1>ATENCIÓN: Es probable que no funcione con PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Reservas para el";
+$vocab["bookingsforpost"]    = ""; # Goes after the date
+$vocab["areas"]              = "Edificios";
+$vocab["daybefore"]          = " Día anterior";
+$vocab["dayafter"]           = "Día siguiente ";
+$vocab["gototoday"]          = "Día actual";
+$vocab["goto"]               = "Ir a";
+$vocab["highlight_line"]     = "Resaltar esta línea";
+$vocab["click_to_reserve"]   = "Pulsa sobre la celda para hacer una reserva.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Ver día";
+$vocab["viewweek"]           = "Ver semana";
+$vocab["viewmonth"]          = "Ver mes";
+$vocab["ppreview"]           = "Previsualización para imprimir";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Nueva reserva";
+$vocab["editentry"]          = "Editar reserva";
+$vocab["editseries"]         = "Editar series";
+$vocab["namebooker"]         = "Nombre que figurará:";
+$vocab["fulldescription"]    = "Descripción completa:<br>&nbsp;&nbsp;(Número de personas,<br>&nbsp;&nbsp;Interna/Externa, etc)";
+$vocab["date"]               = "Fecha:";
+$vocab["start_date"]         = "Fecha comienzo:";
+$vocab["end_date"]           = "Fecha final:";
+$vocab["time"]               = "Hora:";
+$vocab["period"]             = "Periodo:";
+$vocab["duration"]           = "Duración:";
+$vocab["seconds"]            = "segundos";
+$vocab["minutes"]            = "minutos";
+$vocab["hours"]              = "horas";
+$vocab["days"]               = "días";
+$vocab["weeks"]              = "semanas";
+$vocab["years"]              = "años";
+$vocab["periods"]            = "periodos";
+$vocab["all_day"]            = "Día completo";
+$vocab["type"]               = "Tipo:";
+$vocab["internal"]           = "Interna";
+$vocab["external"]           = "Externa";
+$vocab["save"]               = "Guardar";
+$vocab["rep_type"]           = "Tipo de repetición:";
+$vocab["rep_type_0"]         = "Ninguna";
+$vocab["rep_type_1"]         = "Diaria";
+$vocab["rep_type_2"]         = "Semanal";
+$vocab["rep_type_3"]         = "Mensual";
+$vocab["rep_type_4"]         = "Anual";
+$vocab["rep_type_5"]         = "Mensual, día correspondiente";
+$vocab["rep_type_6"]         = "n-Semanal";
+$vocab["rep_end_date"]       = "Fecha límite de repetición:";
+$vocab["rep_rep_day"]        = "Día Repetición:";
+$vocab["rep_for_weekly"]     = "(para semanal)";
+$vocab["rep_freq"]           = "Frecuencia:";
+$vocab["rep_num_weeks"]      = "Número de semanas";
+$vocab["rep_for_nweekly"]    = "(n-semanas)";
+$vocab["ctrl_click"]         = "Utilice Control+Clic para seleccionar más de una sala";
+$vocab["entryid"]            = "Introducir ID ";
+$vocab["repeat_id"]          = "Repetir ID "; 
+$vocab["you_have_not_entered"] = "No ha introducido";
+$vocab["you_have_not_selected"] = "No ha seleccionado";
+$vocab["valid_room"]         = "sala.";
+$vocab["valid_time_of_day"]  = "horario válido del día.";
+$vocab["brief_description"]  = "Breve descripción.";
+$vocab["useful_n-weekly_value"] = "valor n-weekly útil.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Descripción:";
+$vocab["room"]               = "Sala";
+$vocab["createdby"]          = "Creada por:";
+$vocab["lastupdate"]         = "Última actualización:";
+$vocab["deleteentry"]        = "Borrar reserva";
+$vocab["deleteseries"]       = "Borrar serie";
+$vocab["confirmdel"]         = "¿Está seguro de querer borrar esta reserva?";
+$vocab["returnprev"]         = "Volver a la página anterior";
+$vocab["invalid_entry_id"]   = "Endrada id. inválida.";
+$vocab["invalid_series_id"]  = "Serie id. inválida.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Error";
+$vocab["sched_conflict"]     = "Conflicto de planificación";
+$vocab["conflict"]           = "La nueva reserva entra en conflicto con la(s) siguiente(s) entrada(s):";
+$vocab["too_may_entrys"]     = "Las opciones seleccionadas crearán demasiadas entradas.<BR>Por favor, revise las opciones";
+$vocab["returncal"]          = "Volver a vista de calendario";
+$vocab["failed_to_acquire"]  = "No ha sido posible adquirir acceso exclusivo a la base de datos"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Acceso denegado";
+$vocab["norights"]           = "No tiene autorización para modificar este dato.";
+$vocab["please_login"]       = "Por favor, autentifíquese";
+$vocab["user_name"]          = "Nombre";
+$vocab["user_password"]      = "Contraseña";
+$vocab["unknown_user"]       = "Usuario desconocido";
+$vocab["you_are"]            = "Está como";
+$vocab["login"]              = "Entrar";
+$vocab["logoff"]             = "Salir";
+
+# Authentication database
+$vocab["user_list"]          = "Lista de usuarios";
+$vocab["edit_user"]          = "Editar usuario";
+$vocab["delete_user"]        = "Borrar este usuario";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Direcciones de correo";
+$vocab["password_twice"]     = "Si desea cambiar la contraseña, escriba la nueva contraseña dos veces";
+$vocab["passwords_not_eq"]   = "Error: las contraseñas no coinciden.";
+$vocab["add_new_user"]       = "Añadir un nuevo usuario";
+$vocab["rights"]             = "Permisos";
+$vocab["action"]             = "Acción";
+$vocab["user"]               = "Usuario";
+$vocab["administrator"]      = "Administrador";
+$vocab["unknown"]            = "Desconocido";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Pulsa para mostrar todas mis entradas subidas";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Cadena de búsqueda vacía o incorrecta.";
+$vocab["search_results"]     = "Buscar resultados de:";
+$vocab["nothing_found"]      = "No se encontraron coincidencias.";
+$vocab["records"]            = "Registros ";
+$vocab["through"]            = " a través ";
+$vocab["of"]                 = " de ";
+$vocab["previous"]           = "Anterior";
+$vocab["next"]               = "Siguiente";
+$vocab["entry"]              = "Entrada";
+$vocab["view"]               = "Ver";
+$vocab["advanced_search"]    = "Búsqueda avanzada";
+$vocab["search_button"]      = "Búsqueda";
+$vocab["search_for"]         = "Búsqueda para";
+$vocab["from"]               = "De";
+
+# Used in report.php
+$vocab["report_on"]          = "Informe de reservas:";
+$vocab["report_start"]       = "Desde:";
+$vocab["report_end"]         = "Hasta:";
+$vocab["match_area"]         = "Encontrar edificio:";
+$vocab["match_room"]         = "Encontar sala:";
+$vocab["match_type"]         = "Seleccionar ítem:";
+$vocab["ctrl_click_type"]    = "Utilice Control+Clic para seleccionar más de un ítem";
+$vocab["match_entry"]        = "Encontrar descripción breve:";
+$vocab["match_descr"]        = "Encontrar descripción completa:";
+$vocab["include"]            = "Incluir:";
+$vocab["report_only"]        = "Sólo el Informe";
+$vocab["summary_only"]       = "Sólo el Resumen";
+$vocab["report_and_summary"] = "Informe y Resumen";
+$vocab["summarize_by"]       = "Resumir por:";
+$vocab["sum_by_descrip"]     = "Descripción breve";
+$vocab["sum_by_creator"]     = "Creador";
+$vocab["entry_found"]        = "registro encontrado";
+$vocab["entries_found"]      = "registros encontrados";
+$vocab["summary_header"]     = "Resumen de (Entradas) horas";
+$vocab["summary_header_per"] = "Resumen de (Entradas) Periodos";
+$vocab["total"]              = "Total";
+$vocab["submitquery"]        = "Enviar Informe";
+$vocab["sort_rep"]           = "Ordenar informes por:";
+$vocab["sort_rep_time"]      = "Inicio Fecha/Hora";
+$vocab["rep_dsp"]            = "Mostrar en el informe:";
+$vocab["rep_dsp_dur"]        = "Duración";
+$vocab["rep_dsp_end"]        = "Hora final";
+
+# Used in week.php
+$vocab["weekbefore"]         = "Ir a la semana anterior";
+$vocab["weekafter"]          = "Ir a la semana siguiente";
+$vocab["gotothisweek"]       = "Ir a la semana actual";
+
+# Used in month.php
+$vocab["monthbefore"]        = "Ir al mes anterior";
+$vocab["monthafter"]         = "Ir al mes siguiente";
+$vocab["gotothismonth"]      = "Ir al mes actual";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "No hay salas definidas para este edificio";
+
+# Used in admin.php
+$vocab["edit"]               = "Editar";
+$vocab["delete"]             = "Borrar";
+$vocab["rooms"]              = "Salas";
+$vocab["in"]                 = "en";
+$vocab["noareas"]            = "No hay Edificios";
+$vocab["addarea"]            = "Agregar Edificio";
+$vocab["name"]               = "Nombre";
+$vocab["noarea"]             = "No se seleccionó edificio";
+$vocab["browserlang"]        = "Su visor esta configurado para usar los siguientes idiomas:";
+$vocab["postbrowserlang"]    = ".";
+$vocab["addroom"]            = "Agregar sala";
+$vocab["capacity"]           = "Capacidad (personas)";
+$vocab["norooms"]            = "No hay salas.";
+$vocab["administration"]     = "Administración";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Editar Edificio";
+$vocab["change"]             = "Cambiar";
+$vocab["backadmin"]          = "Volver a Administración";
+$vocab["editroomarea"]       = "Editar descripción del Edificio o Sala";
+$vocab["editroom"]           = "Editar Sala";
+$vocab["update_room_failed"] = "Error en la actualización de la Sala: ";
+$vocab["error_room"]         = "Error: sala ";
+$vocab["not_found"]          = " no encontrado";
+$vocab["update_area_failed"] = "Error en la Actualización del Edificio: ";
+$vocab["error_area"]         = "Error: Edificio ";
+$vocab["room_admin_email"]   = "Email administrador de la Sala:";
+$vocab["area_admin_email"]   = "Email administrador del Edificio:";
+$vocab["invalid_email"]      = "Dirección de correo inválida";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Se borrarán las siguientes agendas";
+$vocab["sure"]               = "¿Está seguro?";
+$vocab["YES"]                = "SÍ";
+$vocab["NO"]                 = "NO";
+$vocab["delarea"]            = "Debe borrar todas las salas antes de poder borrar el edificio<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "Acerca de MRBS";
+$vocab["database"]           = "Base de datos: ";
+$vocab["system"]             = "Sistema: ";
+$vocab["please_contact"]     = "Por favor, póngase en contacto con ";
+$vocab["for_any_questions"]  = "para cualquier duda que tenga.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Error grave: No se puede conectar con la base de datos";
+
+?>
Index: web/lang.pt.php
===================================================================
RCS file: web/lang.pt.php
diff -N web/lang.pt.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.pt.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.pt.php,v 1.1 2007/04/05 22:25:32 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Portuguese file.
+#
+# Translated by: Lopo Pizarro
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "Hor�rios de salas";
+
+# Used in functions.php
+$vocab["report"]             = "Relat�rio";
+$vocab["admin"]              = "Administra��o";
+$vocab["help"]               = "Ajuda";
+$vocab["search"]             = "Pesquisa:";
+$vocab["not_php3"]             = "<H1>AVISO: Isto provavelmente n�o funciona com php3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Marca��es para";
+$vocab["bookingsforpost"]    = ""; # Goes after the date
+$vocab["areas"]              = "�reas";
+$vocab["daybefore"]          = "Ir para Dia Anterior";
+$vocab["dayafter"]           = "Ir para Dia Seguinte";
+$vocab["gototoday"]          = "Ir para hoje";
+$vocab["goto"]               = "ir para";
+$vocab["highlight_line"]     = "Highlight this line";
+$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Ver Dia";
+$vocab["viewweek"]           = "Ver Semana";
+$vocab["viewmonth"]          = "Ver M�s";
+$vocab["ppreview"]           = "Pr�-visualizar Inpress�o";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Nova entrada";
+$vocab["editentry"]          = "Editar entrada";
+$vocab["editseries"]         = "Editar Serie";
+$vocab["namebooker"]         = "Desci��o breve:";
+$vocab["fulldescription"]    = "Descri��o completa:<br>&nbsp;&nbsp;(Numero de Pessoas,<br>&nbsp;&nbsp;Internas/Externas etc)";
+$vocab["date"]               = "Data:";
+$vocab["start_date"]         = "Hora In�cio:";
+$vocab["end_date"]           = "Hora Fim:";
+$vocab["time"]               = "Hora:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "Dura��o:";
+$vocab["seconds"]            = "segundos";
+$vocab["minutes"]            = "minutos";
+$vocab["hours"]              = "horas";
+$vocab["days"]               = "dias";
+$vocab["weeks"]              = "semanas";
+$vocab["years"]              = "anos";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "Todos os dias";
+$vocab["type"]               = "Tipo:";
+$vocab["internal"]           = "Interno";
+$vocab["external"]           = "Externo";
+$vocab["save"]               = "Gravar";
+$vocab["rep_type"]           = "Repetir Tipo:";
+$vocab["rep_type_0"]         = "Nenhum";
+$vocab["rep_type_1"]         = "Diariamente";
+$vocab["rep_type_2"]         = "Semanalmente";
+$vocab["rep_type_3"]         = "Mensalmente";
+$vocab["rep_type_4"]         = "Anualmente";
+$vocab["rep_type_5"]         = "Mensalmente, no dia correspoondente";
+$vocab["rep_type_6"]         = "n-semanalmente";
+$vocab["rep_end_date"]       = "Repetir final de data:";
+$vocab["rep_rep_day"]        = "Repetir Dia:";
+$vocab["rep_for_weekly"]     = "(durante (n-)semanalmente)";
+$vocab["rep_freq"]           = "Frequ�ncia:";
+$vocab["rep_num_weeks"]      = "Numero de semanas";
+$vocab["rep_for_nweekly"]    = "(durante n-semanalmente)";
+$vocab["ctrl_click"]         = "Carregue Control-Click para seleccionar mais de uma sala";
+$vocab["entryid"]            = "ID de entrada";
+$vocab["repeat_id"]          = "Repetir ID "; 
+$vocab["you_have_not_entered"] = "N�o introduziu uma";
+$vocab["you_have_not_selected"] = "You have not selected a";
+$vocab["valid_room"]         = "room.";
+$vocab["valid_time_of_day"]  = "hora do dia v�lida.";
+$vocab["brief_description"]  = "Desci��o breve.";
+$vocab["useful_n-weekly_value"] = "valor n-semanal vi�vel.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Descri��o:";
+$vocab["room"]               = "Sala";
+$vocab["createdby"]          = "Marcado por:";
+$vocab["lastupdate"]         = "�ltima Actualiza��o:";
+$vocab["deleteentry"]        = "Apagar entrada";
+$vocab["deleteseries"]       = "Apagar Series";
+$vocab["confirmdel"]         = "Tem a certeza\\nque quer\\napagar esta entrada?\\n\\n";
+$vocab["returnprev"]         = "Voltar � P�gina anterior";
+$vocab["invalid_entry_id"]   = "Id inv�lido.";
+$vocab["invalid_series_id"]  = "Invalid series id.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Erro";
+$vocab["sched_conflict"]     = "Conflito de marca��es";
+$vocab["conflict"]           = "A nova marca��o entra em confito com as seguintes entrada(s):";
+$vocab["too_may_entrys"]     = "A op��o selecionada criar� demasiadas entradas.<BR>Use outras op��es por favor!";
+$vocab["returncal"]          = "Voltar � vista de Calend�rio";
+$vocab["failed_to_acquire"]  = "A tentativa de adquirir acesso exclusivo � base de dados falhou!"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Acesso Negado";
+$vocab["norights"]           = "N�o tem permiss�es para alterar este item.";
+$vocab["please_login"]       = "Please log in";
+$vocab["user_name"]          = "Name";
+$vocab["user_password"]      = "Password";
+$vocab["unknown_user"]       = "Unknown user";
+$vocab["you_are"]            = "You are";
+$vocab["login"]              = "Log in";
+$vocab["logoff"]             = "Log Off";
+
+# Authentication database
+$vocab["user_list"]          = "User list";
+$vocab["edit_user"]          = "Edit user";
+$vocab["delete_user"]        = "Delete this user";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email address";
+$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
+$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
+$vocab["add_new_user"]       = "Add a new user";
+$vocab["rights"]             = "Rights";
+$vocab["action"]             = "Action";
+$vocab["user"]               = "User";
+$vocab["administrator"]      = "Administrator";
+$vocab["unknown"]            = "Unknown";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Dados para pesquisa vazios ou inv�lidos.";
+$vocab["search_results"]     = "Resultados da pesquisa para:";
+$vocab["nothing_found"]      = "N�o foram encontrados registos.";
+$vocab["records"]            = "Registos ";
+$vocab["through"]            = " at� ";
+$vocab["of"]                 = " de ";
+$vocab["previous"]           = "Anterior";
+$vocab["next"]               = "Pr�ximo";
+$vocab["entry"]              = "Entrada";
+$vocab["view"]               = "Ver";
+$vocab["advanced_search"]    = "Pesquyisa Avan�ada";
+$vocab["search_button"]      = "Perquisar";
+$vocab["search_for"]         = "Pesquisar por";
+$vocab["from"]               = "De";
+
+# Used in report.php
+$vocab["report_on"]          = "Relat�rio de Disciplinas:";
+$vocab["report_start"]       = "Relat�rio de data inicial:";
+$vocab["report_end"]         = "Relat�rio de data final:";
+$vocab["match_area"]         = "Area correspondente:";
+$vocab["match_room"]         = "Sala correspondente:";
+$vocab["match_type"]         = "Match type:";
+$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
+$vocab["match_entry"]        = "Breve Descri��o correspondente:";
+$vocab["match_descr"]        = "Descri��o completa correspondente:";
+$vocab["include"]            = "Incluir:";
+$vocab["report_only"]        = "Apenas relat�rio";
+$vocab["summary_only"]       = "Apenas sum�rio";
+$vocab["report_and_summary"] = "Relat�rio e sum�rio";
+$vocab["summarize_by"]       = "Sum�rio por:";
+$vocab["sum_by_descrip"]     = "Descri��o por";
+$vocab["sum_by_creator"]     = "Criador";
+$vocab["entry_found"]        = "entrada encontrada";
+$vocab["entries_found"]      = "entradas encontradas";
+$vocab["summary_header"]     = "Sum�rio de (entradas) Horas";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Total";
+$vocab["submitquery"]        = "Correr relat�rio";
+$vocab["sort_rep"]           = "Sort Report by:";
+$vocab["sort_rep_time"]      = "Start Date/Time";
+$vocab["rep_dsp"]            = "Display in report:";
+$vocab["rep_dsp_dur"]        = "Duration";
+$vocab["rep_dsp_end"]        = "End Time";
+
+# Used in week.php
+$vocab["weekbefore"]         = "Ir para a semana Anterior";
+$vocab["weekafter"]          = "Ir para a semana seguinte";
+$vocab["gotothisweek"]       = "Ir para esta semana";
+
+# Used in month.php
+$vocab["monthbefore"]        = "Ir para o m�s Anterior";
+$vocab["monthafter"]         = "Ir para o m�s seguinte";
+$vocab["gotothismonth"]      = "Ir para este m�s";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "N�o h� salas definidas para esta �rea";
+
+# Used in admin.php
+$vocab["edit"]               = "Editar";
+$vocab["delete"]             = "Apagar";
+$vocab["rooms"]              = "Salas";
+$vocab["in"]                 = "em";
+$vocab["noareas"]            = "N�o h� �reas";
+$vocab["addarea"]            = "Acrescentar �rea";
+$vocab["name"]               = "Nome";
+$vocab["noarea"]             = "�rea n�o selecionada";
+$vocab["browserlang"]        = "O seu browser est� preparado para use";
+$vocab["postbrowserlang"]    = "Idioma.";
+$vocab["addroom"]            = "Acrescentar Sala";
+$vocab["capacity"]           = "Capacidade";
+$vocab["norooms"]            = "N�o h� salas.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Editar �rea";
+$vocab["change"]             = "Mudar";
+$vocab["backadmin"]          = "Voltar � administra��o";
+$vocab["editroomarea"]       = "Editar a descri��o de �rea ou Sala";
+$vocab["editroom"]           = "Editar Sala";
+$vocab["update_room_failed"] = "Actualizar a sala falhou: ";
+$vocab["error_room"]         = "Erro: sala ";
+$vocab["not_found"]          = " n�o encontrado";
+$vocab["update_area_failed"] = "Actualiza��o de �rea falhou: ";
+$vocab["error_area"]         = "Erro: �rea ";
+$vocab["room_admin_email"]   = "Room admin email:";
+$vocab["area_admin_email"]   = "Area admin email:";
+$vocab["invalid_email"]      = "Invalid email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Esta ac��o apagar� as seguintes Marca��es";
+$vocab["sure"]               = "Tem a certeza?";
+$vocab["YES"]                = "Sim";
+$vocab["NO"]                 = "N�o";
+$vocab["delarea"]            = "Tem que apagar todas as salas nesta �rea antes de a poder apagar<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "Sobre o MRBS";
+$vocab["database"]           = "Base de Dados: ";
+$vocab["system"]             = "Sistema: ";
+$vocab["please_contact"]     = "Contacte por favor ";
+$vocab["for_any_questions"]  = "for any questions that aren't answered here.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Erro: Failha ao ligar � base de dados";
+
+?>
Index: web/lang.en.php
===================================================================
RCS file: web/lang.en.php
diff -N web/lang.en.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.en.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,255 @@
+<?php
+# $Id: lang.en.php,v 1.26.2.2 2006/10/09 15:53:59 jberanek Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a US/UK English file.
+#
+#
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "utf-8";
+
+# Used in style.php
+$vocab["mrbs"]               = "Meeting Room Booking System";
+
+# Used in functions.php
+$vocab["report"]             = "Report";
+$vocab["admin"]              = "Admin";
+$vocab["help"]               = "Help";
+$vocab["search"]             = "Search:";
+$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Bookings for";
+$vocab["bookingsforpost"]    = ""; # Goes after the date
+$vocab["areas"]              = "Areas";
+$vocab["daybefore"]          = "Go To Day Before";
+$vocab["dayafter"]           = "Go To Day After";
+$vocab["gototoday"]          = "Go To Today";
+$vocab["goto"]               = "goto";
+$vocab["highlight_line"]     = "Highlight this line";
+$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "View Day";
+$vocab["viewweek"]           = "View Week";
+$vocab["viewmonth"]          = "View Month";
+$vocab["ppreview"]           = "Print Preview";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Add Entry";
+$vocab["editentry"]          = "Edit Entry";
+$vocab["editseries"]         = "Edit Series";
+$vocab["namebooker"]         = "Brief Description:";
+$vocab["fulldescription"]    = "Full Description:<br>&nbsp;&nbsp;(Number of people,<br>&nbsp;&nbsp;Internal/External etc)";
+$vocab["date"]               = "Date:";
+$vocab["start_date"]         = "Start Time:";
+$vocab["end_date"]           = "End Time:";
+$vocab["time"]               = "Time:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "Duration:";
+$vocab["seconds"]            = "seconds";
+$vocab["minutes"]            = "minutes";
+$vocab["hours"]              = "hours";
+$vocab["days"]               = "days";
+$vocab["weeks"]              = "weeks";
+$vocab["years"]              = "years";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "All day";
+$vocab["type"]               = "Type:";
+$vocab["internal"]           = "Class";
+$vocab["external"]           = "Non-class";
+$vocab["save"]               = "Save";
+$vocab["rep_type"]           = "Repeat Type:";
+$vocab["rep_type_0"]         = "None";
+$vocab["rep_type_1"]         = "Daily";
+$vocab["rep_type_2"]         = "Weekly";
+$vocab["rep_type_3"]         = "Monthly";
+$vocab["rep_type_4"]         = "Yearly";
+$vocab["rep_type_5"]         = "Monthly, corresponding day";
+$vocab["rep_type_6"]         = "n-Weekly";
+$vocab["rep_end_date"]       = "Repeat End Date:";
+$vocab["rep_rep_day"]        = "Repeat Day:";
+$vocab["rep_for_weekly"]     = "(for (n-)weekly)";
+$vocab["rep_freq"]           = "Frequency:";
+$vocab["rep_num_weeks"]      = "Number of weeks";
+$vocab["rep_for_nweekly"]    = "(for n-weekly)";
+$vocab["ctrl_click"]         = "Use Control-Click to select more than one room";
+$vocab["entryid"]            = "Entry ID ";
+$vocab["repeat_id"]          = "Repeat ID "; 
+$vocab["you_have_not_entered"] = "You have not entered a";
+$vocab["you_have_not_selected"] = "You have not selected a";
+$vocab["valid_room"]         = "room.";
+$vocab["valid_time_of_day"]  = "valid time of day.";
+$vocab["brief_description"]  = "Brief Description.";
+$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Description:";
+$vocab["room"]               = "Room";
+$vocab["createdby"]          = "Created By:";
+$vocab["lastupdate"]         = "Last Updated:";
+$vocab["deleteentry"]        = "Delete Entry";
+$vocab["deleteseries"]       = "Delete Series";
+$vocab["confirmdel"]         = "Are you sure\\nyou want to\\ndelete this entry?\\n\\n";
+$vocab["returnprev"]         = "Return to previous page";
+$vocab["invalid_entry_id"]   = "Invalid entry id.";
+$vocab["invalid_series_id"]  = "Invalid series id.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Error";
+$vocab["sched_conflict"]     = "Scheduling Conflict";
+$vocab["conflict"]           = "The new booking will conflict with the following entry(s):";
+$vocab["too_may_entrys"]     = "The selected options will create too many entries.<BR>Please use different options!";
+$vocab["returncal"]          = "Return to calendar view";
+$vocab["failed_to_acquire"]  = "Failed to acquire exclusive database access";
+$vocab["invalid_booking"]    = "Invalid booking";
+$vocab["must_set_description"] = "You must set a brief description for the booking. Please go back and enter one.";
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Access Denied";
+$vocab["norights"]           = "You do not have access rights to modify this item.";
+$vocab["please_login"]       = "Please log in";
+$vocab["user_name"]          = "Username";
+$vocab["user_password"]      = "Password";
+$vocab["unknown_user"]       = "Unknown user";
+$vocab["you_are"]            = "You are";
+$vocab["login"]              = "Log in";
+$vocab["logoff"]             = "Log Off";
+
+# Authentication database
+$vocab["user_list"]          = "User list";
+$vocab["edit_user"]          = "Edit user";
+$vocab["delete_user"]        = "Delete this user";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email address";
+$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
+$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
+$vocab["add_new_user"]       = "Add a new user";
+$vocab["rights"]             = "Rights";
+$vocab["action"]             = "Action";
+$vocab["user"]               = "User";
+$vocab["administrator"]      = "Administrator";
+$vocab["unknown"]            = "Unknown";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+$vocab["no_users_initial"]   = "No users in database, allowing initial user creation";
+$vocab["no_users_create_first_admin"] = "Create a user configured as administrator and then you can log in and create more users.";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Empty or invalid search string.";
+$vocab["search_results"]     = "Search Results for:";
+$vocab["nothing_found"]      = "No matching entries found.";
+$vocab["records"]            = "Records ";
+$vocab["through"]            = " through ";
+$vocab["of"]                 = " of ";
+$vocab["previous"]           = "Previous";
+$vocab["next"]               = "Next";
+$vocab["entry"]              = "Entry";
+$vocab["view"]               = "View";
+$vocab["advanced_search"]    = "Advanced search";
+$vocab["search_button"]      = "Search";
+$vocab["search_for"]         = "Search For";
+$vocab["from"]               = "From";
+
+# Used in report.php
+$vocab["report_on"]          = "Report on Meetings:";
+$vocab["report_start"]       = "Report start date:";
+$vocab["report_end"]         = "Report end date:";
+$vocab["match_area"]         = "Match area:";
+$vocab["match_room"]         = "Match room:";
+$vocab["match_type"]         = "Match type:";
+$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
+$vocab["match_entry"]        = "Match brief description:";
+$vocab["match_descr"]        = "Match full description:";
+$vocab["include"]            = "Include:";
+$vocab["report_only"]        = "Report only";
+$vocab["summary_only"]       = "Summary only";
+$vocab["report_and_summary"] = "Report and Summary";
+$vocab["summarize_by"]       = "Summarize by:";
+$vocab["sum_by_descrip"]     = "Brief description";
+$vocab["sum_by_creator"]     = "Creator";
+$vocab["entry_found"]        = "entry found";
+$vocab["entries_found"]      = "entries found";
+$vocab["summary_header"]     = "Summary of (Entries) Hours";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Total";
+$vocab["submitquery"]        = "Run Report";
+$vocab["sort_rep"]           = "Sort Report by:";
+$vocab["sort_rep_time"]      = "Start Date/Time";
+$vocab["rep_dsp"]            = "Display in report:";
+$vocab["rep_dsp_dur"]        = "Duration";
+$vocab["rep_dsp_end"]        = "End Time";
+
+# Used in week.php
+$vocab["weekbefore"]         = "Go To Week Before";
+$vocab["weekafter"]          = "Go To Week After";
+$vocab["gotothisweek"]       = "Go To This Week";
+
+# Used in month.php
+$vocab["monthbefore"]        = "Go To Month Before";
+$vocab["monthafter"]         = "Go To Month After";
+$vocab["gotothismonth"]      = "Go To This Month";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "No rooms defined for this area";
+
+# Used in admin.php
+$vocab["edit"]               = "Edit";
+$vocab["delete"]             = "Delete";
+$vocab["rooms"]              = "Rooms";
+$vocab["in"]                 = "in";
+$vocab["noareas"]            = "No Areas";
+$vocab["addarea"]            = "Add Area";
+$vocab["name"]               = "Name";
+$vocab["noarea"]             = "No area selected";
+$vocab["browserlang"]        = "Your browser is set to use";
+$vocab["postbrowserlang"]    = "language.";
+$vocab["addroom"]            = "Add Room";
+$vocab["capacity"]           = "Capacity";
+$vocab["norooms"]            = "No rooms.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Edit Area";
+$vocab["change"]             = "Change";
+$vocab["backadmin"]          = "Back to Admin";
+$vocab["editroomarea"]       = "Edit Area or Room Description";
+$vocab["editroom"]           = "Edit Room";
+$vocab["update_room_failed"] = "Update room failed: ";
+$vocab["error_room"]         = "Error: room ";
+$vocab["not_found"]          = " not found";
+$vocab["update_area_failed"] = "Update area failed: ";
+$vocab["error_area"]         = "Error: area ";
+$vocab["room_admin_email"]   = "Room admin email:";
+$vocab["area_admin_email"]   = "Area admin email:";
+$vocab["invalid_email"]      = "Invalid email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "This will delete the following bookings";
+$vocab["sure"]               = "Are you sure?";
+$vocab["YES"]                = "YES";
+$vocab["NO"]                 = "NO";
+$vocab["delarea"]            = "You must delete all rooms in this area before you can delete it<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "About MRBS";
+$vocab["database"]           = "Database: ";
+$vocab["system"]             = "System: ";
+$vocab["please_contact"]     = "Please contact ";
+$vocab["for_any_questions"]  = "for any questions that aren't answered here.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fatal Error: Failed to connect to database";
+
+?>
Index: web/lang.de.php
===================================================================
RCS file: web/lang.de.php
diff -N web/lang.de.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.de.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.de.php,v 1.1 2007/04/05 22:25:31 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a German file.
+#
+# Translations provided by: Michael Redinger
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "Raumbuchungssystem MRBS";
+
+# Used in functions.php
+$vocab["report"]             = "Bericht";
+$vocab["admin"]              = "Admin";
+$vocab["help"]               = "Hilfe";
+$vocab["search"]             = "Suche:";
+$vocab["not_php3"]             = "<H1>WARNUNG: Funktioniert warscheinlich nicht mit PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Eintr�ge f�r";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "Bereiche";
+$vocab["daybefore"]          = "gehe zum vorherigen Tag";
+$vocab["dayafter"]           = "gehe zum n�chsten Tag";
+$vocab["gototoday"]          = "gehe zum heutigen Tag";
+$vocab["goto"]               = "Start";
+$vocab["highlight_line"]     = "Markieren Sie diese Zeile";
+$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Zeige Tag";
+$vocab["viewweek"]           = "Zeige Woche";
+$vocab["viewmonth"]          = "Zeige Monat";
+$vocab["ppreview"]           = "Druckansicht";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Eintrag hinzuf�gen";
+$vocab["editentry"]          = "Eintrag �ndern";
+$vocab["editseries"]         = "Alle Eintr�ge �ndern";
+$vocab["namebooker"]         = "Kurzbeschreibung ";
+$vocab["fulldescription"]    = "Vollst�ndige Beschreibung:<br>&nbsp;&nbsp;(Anzahl der Teilnehmer etc;)";
+$vocab["date"]               = "Tag:";
+$vocab["start_date"]         = "Anfangsdatum:";
+$vocab["end_date"]           = "Enddatum:";
+$vocab["time"]               = "Zeit:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "Dauer:";
+$vocab["seconds"]            = "Sekunden";
+$vocab["minutes"]            = "Minuten";
+$vocab["hours"]              = "Stunden";
+$vocab["days"]               = "Tage";
+$vocab["weeks"]              = "Wochen";
+$vocab["years"]              = "Jahre";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "Ganzt�gig";
+$vocab["type"]               = "Art:";
+$vocab["internal"]           = "Intern";
+$vocab["external"]           = "Extern";
+$vocab["save"]               = "Speichern";
+$vocab["rep_type"]           = "Art der Wiederholung:";
+$vocab["rep_type_0"]         = "Keine";
+$vocab["rep_type_1"]         = "t�glich";
+$vocab["rep_type_2"]         = "w�chentlich";
+$vocab["rep_type_3"]         = "monatlich";
+$vocab["rep_type_4"]         = "j�hrlich";
+$vocab["rep_type_5"]         = "monatlich, entsprechender Tag";
+$vocab["rep_type_6"]         = "jede n-te Woche";
+$vocab["rep_end_date"]       = "Ende der Wiederholung:";
+$vocab["rep_rep_day"]        = "Tag der Wiederholung:";
+$vocab["rep_for_weekly"]     = "(f�r w�chentlich)";
+$vocab["rep_freq"]           = "H�ufigkeit:";
+$vocab["rep_num_weeks"]      = "Anzahl Wochen";
+$vocab["rep_for_nweekly"]    = "(f�r n-te Woche)";
+$vocab["ctrl_click"]         = "Strg-Click um mehr als einen Raum auszuw�hlen";
+$vocab["entryid"]            = "Entry ID ";
+$vocab["repeat_id"]          = "Repeat ID "; 
+$vocab["you_have_not_entered"] = "Sie haben folgendes Feld nicht ausgef�llt :";
+$vocab["you_have_not_selected"] = "You have not selected a";
+$vocab["valid_room"]         = "room.";
+$vocab["valid_time_of_day"]  = "G�ltige Uhrzeit.";
+$vocab["brief_description"]  = "Kurzbeschreibung.";
+$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Beschreibung:";
+$vocab["room"]               = "Raum";
+$vocab["createdby"]          = "Erstellt von:";
+$vocab["lastupdate"]         = "Letzte �nderung:";
+$vocab["deleteentry"]        = "Eintrag l�schen";
+$vocab["deleteseries"]       = "Alle Eintr�ge l�schen";
+$vocab["confirmdel"]         = "Sind Sie sicher,\\ndass Sie diesen Eintrag\\nl�schen wollen?\\n\\n";
+$vocab["returnprev"]         = "Zur�ck zur vorigen Seite";
+$vocab["invalid_entry_id"]   = "Invalid entry id.";
+$vocab["invalid_series_id"]  = "Invalid series id.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Fehler";
+$vocab["sched_conflict"]     = "Konflikt in der Planung";
+$vocab["conflict"]           = "Der neue Eintrag hat einen Konflikt mit folgenden Eintr�gen:";
+$vocab["too_may_entrys"]     = "Die gew�hlten Optionen w�rden zu viele Eintr�ge erzeugen.<BR>�ndern Sie bitte die Optionen!";
+$vocab["returncal"]          = "Zur�ck zur Kalenderansicht";
+$vocab["failed_to_acquire"]  = "Konnte nicht exclusiv auf die Datenbank zugreifen"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Zugang verweigert";
+$vocab["norights"]           = "Sie haben keine Berechtigung, diesen Eintrag zu �ndern";
+$vocab["please_login"]       = "Bitte einloggen";
+$vocab["user_name"]          = "Benutzername";
+$vocab["user_password"]      = "Passwort";
+$vocab["unknown_user"]       = "Unbekannter Benutzer";
+$vocab["you_are"]            = "Sie sind";
+$vocab["login"]              = "Einloggen";
+$vocab["logoff"]             = "Ausloggen";
+
+# Authentication database
+$vocab["user_list"]          = "Benutzerliste";
+$vocab["edit_user"]          = "Bearbeite Benutzer";
+$vocab["delete_user"]        = "L�sche diesen Benutzer";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email Addresse";
+$vocab["password_twice"]     = "Falls Sie Ihr Passwort �ndern wollen, geben Sie das neue Passwort zwei mal ein.";
+$vocab["passwords_not_eq"]   = "Fehler: Die Passw�rter stimmen nicht �berein.";
+$vocab["add_new_user"]       = "Benutzer hinzuf�gen";
+$vocab["rights"]             = "Rechte";
+$vocab["action"]             = "Action";
+$vocab["user"]               = "Benutzer";
+$vocab["administrator"]      = "Administrator";
+$vocab["unknown"]            = "Unbekannt";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Leerer oder ung�ltiger Suchbegriff.";
+$vocab["search_results"]     = "Suchergebnis f�r:";
+$vocab["nothing_found"]      = "Keine passenden Suchergebnisse gefunden.";
+$vocab["records"]            = "Ergebnisse ";
+$vocab["through"]            = " bis ";
+$vocab["of"]                 = " von ";
+$vocab["previous"]           = "Vorige";
+$vocab["next"]               = "N�chste";
+$vocab["entry"]              = "Eintrag";
+$vocab["view"]               = "�ffnen";
+$vocab["advanced_search"]    = "Erweiterte Suche";
+$vocab["search_button"]      = "Suche";
+$vocab["search_for"]         = "Suche nach";
+$vocab["from"]               = "Von";
+
+# Used in report.php
+$vocab["report_on"]          = "Bericht �ber Termine:";
+$vocab["report_start"]       = "Bericht Beginn:";
+$vocab["report_end"]         = "Bericht Ende:";
+$vocab["match_area"]         = "Suche Bereich:";
+$vocab["match_room"]         = "Suche Raum:";
+$vocab["match_type"]         = "Nach typ:";
+$vocab["ctrl_click_type"]    = "Strg-Click um mehr als einen Typus auszuw�hlen";
+$vocab["match_entry"]        = "Suche Kurzbeschreibung:";
+$vocab["match_descr"]        = "Suche Beschreibung:";
+$vocab["include"]            = "Generiere:";
+$vocab["report_only"]        = "nur Bericht";
+$vocab["summary_only"]       = "nur Zusammenfassung";
+$vocab["report_and_summary"] = "Bericht und Zusammenfassung";
+$vocab["summarize_by"]       = "Zusammenfassung nach:";
+$vocab["sum_by_descrip"]     = "Kurzbeschreibung";
+$vocab["sum_by_creator"]     = "Ersteller";
+$vocab["entry_found"]        = "Eintrag gefunden";
+$vocab["entries_found"]      = "Eintr�ge gefunden";
+$vocab["summary_header"]     = "Stundenzusammenfassung der Eintr�ge";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Gesamt";
+$vocab["submitquery"]        = "Bericht erstellen";
+$vocab["sort_rep"]           = "Sortiere Report nach:";
+$vocab["sort_rep_time"]      = "Startzeit/Datum ";
+$vocab["rep_dsp"]            = "zeige im Report:";
+$vocab["rep_dsp_dur"]        = "Dauer";
+$vocab["rep_dsp_end"]        = "Endzeit";
+
+# Used in week.php
+$vocab["weekbefore"]         = "gehe zur vorigen Woche";
+$vocab["weekafter"]          = "gehe zur n�chsten Woche";
+$vocab["gotothisweek"]       = "gehe zu dieser Woche";
+
+# Used in month.php
+$vocab["monthbefore"]        = "gehe zum vorigen Monat";
+$vocab["monthafter"]         = "gehe zum n�chsten Monat";
+$vocab["gotothismonth"]      = "gehe zu diesen Monat";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Der Bereich enth�lt keinen Raum";
+
+# Used in admin.php
+$vocab["edit"]               = "Bearbeiten";
+$vocab["delete"]             = "L�schen";
+$vocab["rooms"]              = "R�ume";
+$vocab["in"]                 = "in";
+$vocab["noareas"]            = "Keine Bereiche";
+$vocab["addarea"]            = "Bereich hinzuf�gen";
+$vocab["name"]               = "Name";
+$vocab["noarea"]             = "Kein Bereich ausgew�hlt";
+$vocab["browserlang"]        = "Die Spracheinstellung Ihres Browsers ist";
+$vocab["postbrowserlang"]    = ".";
+$vocab["addroom"]            = "Raum hinzuf�gen";
+$vocab["capacity"]           = "Kapazit�t";
+$vocab["norooms"]            = "Keine R�ume vorhanden.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Bereich bearbeiten";
+$vocab["change"]             = "�ndern";
+$vocab["backadmin"]          = "Zur�ck zu Admin";
+$vocab["editroomarea"]       = "Raum- oder Bereichsbeschreibung bearbeiten";
+$vocab["editroom"]           = "Raum bearbeiten";
+$vocab["update_room_failed"] = "Raum aktualisieren gescheitert: ";
+$vocab["error_room"]         = "Error: Raum ";
+$vocab["not_found"]          = " nicht gefunden";
+$vocab["update_area_failed"] = "Update area failed: ";
+$vocab["error_area"]         = "Fehler: Bereich ";
+$vocab["room_admin_email"]   = "E-mail des Raumadministrators";
+$vocab["area_admin_email"]   = "E-mail des Bereichsadministrators";
+$vocab["invalid_email"]      = "Ung�ltige e-mail Adresse !";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Dadurch werden die folgenden Eintr�ge gel�scht";
+$vocab["sure"]               = "Sind Sie sicher?";
+$vocab["YES"]                = "JA";
+$vocab["NO"]                 = "NEIN";
+$vocab["delarea"]            = "Sie m�ssen alle R�ume dieses Bereiches l�schen, damit Sie den Bereich l�schen k�nnen<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "�ber MRBS";
+$vocab["database"]           = "Datenbank: ";
+$vocab["system"]             = "System: ";
+$vocab["please_contact"]     = "Bitte kontaktieren Sie ";
+$vocab["for_any_questions"]  = "f�r Fragen die hier nicht beantwortet sind.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fataler Fehler: Kann nicht an Datenbank anbinden";
+
+?>
Index: web/auth_db_ext.php
===================================================================
RCS file: web/auth_db_ext.php
diff -N web/auth_db_ext.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_db_ext.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,138 @@
+<?php
+
+/*****************************************************************************\
+*									      *
+*   File name       auth_db_ext.php					      *
+*									      *
+*   Description	    Authenticate users from a table in another database.      *
+*									      *
+*   Notes	    To use this authentication scheme, set in config.inc.php: *
+*			$auth["type"]  = "db_ext";			      *
+*                   Assumes passwords are stored in the other table in        *
+*                   plaintext, authValidateUser() will need to be changed if  *
+*                   the password is stored differently.                       *
+*									      *
+*   History								      *
+*    2005/05/11 JPB Created this file					      *
+*									      *
+\*****************************************************************************/
+
+// $Id: auth_db_ext.php,v 1.1 2007/04/05 22:25:24 arborrow Exp $
+
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+
+require_once("../../../config.php");
+
+
+function authValidateUser($user, $pass)
+{
+   global $auth;
+
+   $retval = 0;
+
+   $user=strtolower($user);
+
+   $conn = mysql_connect($auth['db_ext']['db_host'],
+                         $auth['db_ext']['db_username'],
+                         $auth['db_ext']['db_password']);
+
+   mysql_select_db($auth['db_ext']['db_name'], $conn);
+
+   $user = addslashes($user);
+
+   if ($auth['db_ext']['use_md5_passwords'] == 1)
+   {
+//     $pass = md5($pass);
+        $pass = $USER->password;
+   }
+
+   $query = "SELECT " . $auth['db_ext']['column_name_password'] .
+            " FROM " . $auth['db_ext']['db_table'] .
+            " WHERE ". $auth['db_ext']['column_name_username'] . "='$user'";
+
+   $r = mysql_query($query, $conn);
+
+   if ($r && (mysql_num_rows($r) == 1)) // force a unique match
+   {
+     $row = mysql_fetch_row($r);
+
+     switch ($auth['db_ext']['password_format'])
+     {
+       case 'md5':
+         if (($pass == $row[0]) and substr($USER->username,0,1)>'0')
+         {
+           $retval = 1;
+         }
+         break;
+
+       case 'sha1':
+         if (sha1($pass) == $row[0])
+         {
+           $retval = 1;
+         }
+         break;
+
+       case 'crypt':
+         $recrypt = crypt($pass,$row[0]);
+         if ($row[0] == $recrypt)
+         {
+           $retval = 1;
+         }
+         break;
+
+       default:
+         // Otherwise assume plaintext
+         if ($pass == $row[0])
+         {
+           $retval = 1;
+         }
+         break;
+     }
+   }
+
+   mysql_close($conn);
+
+   return $retval;
+}
+
+/* authGetUserLevel($user)
+ * 
+ * Determines the users access level
+ * 
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{global $USER;
+$user=$USER->username;
+   // User not logged in, user level '0'
+//   if ((!isset($user)) or (substr($USER->username,0,1) == '0'))
+//hard coded course id (1492) for faculty (all faculty members who can schedule a room are teachers of this course)
+   if ( (!isset($user)) or (!isteacher(1492,$USER->id)) )
+      return 0;
+
+   // Check if the user is can modify
+   for($i = 0; isset($lev1_admin[$i]); $i++)
+   {
+      if(strcasecmp($user, $lev1_admin[$i]) == 0)
+	 return 2;
+   }
+
+   // Everybody else is access level '1'
+   return 1;
+}
+
+?>
Index: web/lang.ko.php
===================================================================
RCS file: web/lang.ko.php
diff -N web/lang.ko.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.ko.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.ko.php,v 1.1 2007/04/05 22:25:32 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Korean file.
+#
+#
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "utf-8";
+
+# Used in style.php
+$vocab["mrbs"]               = "회의실 예약 시스템";
+
+# Used in functions.php
+$vocab["report"]             = "보고서";
+$vocab["admin"]              = "관리자";
+$vocab["help"]               = "도움말";
+$vocab["search"]             = "검색:";
+$vocab["not_php3"]             = "<H1>주의: PHP3에서는 동작하지 않습니다.</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Bookings for";
+$vocab["bookingsforpost"]    = "의 예약입니다.";
+$vocab["areas"]              = "지역";
+$vocab["daybefore"]          = "이전으로";
+$vocab["dayafter"]           = "다음으로";
+$vocab["gototoday"]          = "오늘의 예약";
+$vocab["goto"]               = "바로가기";
+$vocab["highlight_line"]     = "Highlight this line";
+$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "일 단위";
+$vocab["viewweek"]           = "주 단위";
+$vocab["viewmonth"]          = "월 단위";
+$vocab["ppreview"]           = "인쇄용 미리보기";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "예약 등록";
+$vocab["editentry"]          = "예약 수정";
+$vocab["editseries"]         = "예약(Series) 수정";
+$vocab["namebooker"]         = "예약자명:";
+$vocab["fulldescription"]    = "상세정보(인원,내부/외부회의 등):";
+$vocab["date"]               = "날짜:";
+$vocab["start_date"]         = "시작일:";
+$vocab["end_date"]           = "종료일:";
+$vocab["time"]               = "시간:";
+$vocab["period"]             = "기간:";
+$vocab["duration"]           = "회의 시간:";
+$vocab["seconds"]            = "초";
+$vocab["minutes"]            = "분";
+$vocab["hours"]              = "시간";
+$vocab["days"]               = "일";
+$vocab["weeks"]              = "주";
+$vocab["years"]              = "년";
+$vocab["periods"]            = "기간";
+$vocab["all_day"]            = "하루종일";
+$vocab["type"]               = "회의 종류:";
+$vocab["internal"]           = "내부회의";
+$vocab["external"]           = "외부회의";
+$vocab["save"]               = "보존";
+$vocab["rep_type"]           = "반복 타입:";
+$vocab["rep_type_0"]         = "없음";
+$vocab["rep_type_1"]         = "일간";
+$vocab["rep_type_2"]         = "주간";
+$vocab["rep_type_3"]         = "월간";
+$vocab["rep_type_4"]         = "연간";
+$vocab["rep_type_5"]         = "월간, 해당일";
+$vocab["rep_type_6"]         = "몇주간";
+$vocab["rep_end_date"]       = "반복 종료일:";
+$vocab["rep_rep_day"]        = "반복일:";
+$vocab["rep_for_weekly"]     = "(몇 주간용)";
+$vocab["rep_freq"]           = "빈도:";
+$vocab["rep_num_weeks"]      = "몇 주";
+$vocab["rep_for_nweekly"]    = "(몇 주간용)";
+$vocab["ctrl_click"]         = "2개 이상을 선택하기 위해서는 Control-Click을 사용하세요";
+$vocab["entryid"]            = "엔트리 ID ";
+$vocab["repeat_id"]          = "반복 ID "; 
+$vocab["you_have_not_entered"] = "You have not entered a";
+$vocab["you_have_not_selected"] = "You have not selected a";
+$vocab["valid_room"]         = "room.";
+$vocab["valid_time_of_day"]  = "valid time of day.";
+$vocab["brief_description"]  = "간략 설명";
+$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
+
+# Used in view_entry.php
+$vocab["description"]        = "설명:";
+$vocab["room"]               = "회의실명";
+$vocab["createdby"]          = "예약자:";
+$vocab["lastupdate"]         = "최종 갱신일:";
+$vocab["deleteentry"]        = "예약 취소";
+$vocab["deleteseries"]       = "예약(Series) 취소";
+$vocab["confirmdel"]         = "예약을 취소하시겠습니까?";
+$vocab["returnprev"]         = "이전 페이지로";
+$vocab["invalid_entry_id"]   = "무효한 엔트리 ID.";
+$vocab["invalid_series_id"]  = "무효한 Serires ID.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "에러";
+$vocab["sched_conflict"]     = "스케쥴 중복";
+$vocab["conflict"]           = "이미 다른 예약이 되어있습니다.";
+$vocab["too_may_entrys"]     = "선택한 옵션은 너무 많은 엔트리를 작성하게 됩니다.<BR>다른 옵션을 선택해 주세요.";
+$vocab["returncal"]          = "달력 화면으로 돌아감";
+$vocab["failed_to_acquire"]  = "데이타베이스 접근에 실패하였습니다."; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "접근이 거부됨";
+$vocab["norights"]           = "수정할 수 있는 권한이 없습니다.";
+$vocab["please_login"]       = "로그인 하여 주십시오";
+$vocab["user_name"]          = "아이디";
+$vocab["user_password"]      = "비밀번호";
+$vocab["unknown_user"]       = "권한없는 사용자";
+$vocab["you_are"]            = "아이디: ";
+$vocab["login"]              = "로그인";
+$vocab["logoff"]             = "로그아웃";
+
+# Authentication database
+$vocab["user_list"]          = "사용자 리스트";
+$vocab["edit_user"]          = "사용자 수정";
+$vocab["delete_user"]        = "사용자 삭제";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "메일 주소";
+$vocab["password_twice"]     = "비밀번호를 변경하시려면, 새로운 비밀번호를 2회 입력하세요.";
+$vocab["passwords_not_eq"]   = "에러: 비밀번호가 바르지 않습니다.";
+$vocab["add_new_user"]       = "사용자 추가";
+$vocab["rights"]             = "권한";
+$vocab["action"]             = "동작";
+$vocab["user"]               = "사용자";
+$vocab["administrator"]      = "관리자";
+$vocab["unknown"]            = "Unknown";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+
+# Used in search.php
+$vocab["invalid_search"]     = "잘못된 검색어를 입력했음.";
+$vocab["search_results"]     = "검색 결과:";
+$vocab["nothing_found"]      = "검색 결과가 없습니다.";
+$vocab["records"]            = "Records ";
+$vocab["through"]            = " through ";
+$vocab["of"]                 = " of ";
+$vocab["previous"]           = "이전";
+$vocab["next"]               = "이후";
+$vocab["entry"]              = "Entry";
+$vocab["view"]               = "View";
+$vocab["advanced_search"]    = "상세 검색";
+$vocab["search_button"]      = "검색";
+$vocab["search_for"]         = "Search For";
+$vocab["from"]               = "From";
+
+# Used in report.php
+$vocab["report_on"]          = "회의에 관한 보고서 작성:";
+$vocab["report_start"]       = "시작일:";
+$vocab["report_end"]         = "종료일:";
+$vocab["match_area"]         = "검색할 지역:";
+$vocab["match_room"]         = "검색할 회의실:";
+$vocab["match_type"]         = "회의 타입:";
+$vocab["ctrl_click_type"]    = "2개 이상을 선택할 경우는 Control-Click을 사용하세요.";
+$vocab["match_entry"]        = "검색할 설명:";
+$vocab["match_descr"]        = "검색할 상세 정보:";
+$vocab["include"]            = "포함:";
+$vocab["report_only"]        = "보고서만";
+$vocab["summary_only"]       = "요약정보만";
+$vocab["report_and_summary"] = "보고서 및 요약정보";
+$vocab["summarize_by"]       = "다음에 의해 요약됨:";
+$vocab["sum_by_descrip"]     = "간략 설명";
+$vocab["sum_by_creator"]     = "작성자";
+$vocab["entry_found"]        = "entry found";
+$vocab["entries_found"]      = "entries found";
+$vocab["summary_header"]     = "Summary of (Entries) Hours";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "전체";
+$vocab["submitquery"]        = "보고서 실행";
+$vocab["sort_rep"]           = "정렬 순서:";
+$vocab["sort_rep_time"]      = "시작 일/시간";
+$vocab["rep_dsp"]            = "Display in report:";
+$vocab["rep_dsp_dur"]        = "기간";
+$vocab["rep_dsp_end"]        = "종료 시간";
+
+# Used in week.php
+$vocab["weekbefore"]         = "저번 주로";
+$vocab["weekafter"]          = "다음 주로";
+$vocab["gotothisweek"]       = "이번 주로";
+
+# Used in month.php
+$vocab["monthbefore"]        = "저번 달로";
+$vocab["monthafter"]         = "다음 달로";
+$vocab["gotothismonth"]      = "이번 달로";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "등록된 회의실이 없습니다.";
+
+# Used in admin.php
+$vocab["edit"]               = "수정";
+$vocab["delete"]             = "삭제";
+$vocab["rooms"]              = "회의실";
+$vocab["in"]                 = "in";
+$vocab["noareas"]            = "등록된 지역가 없음";
+$vocab["addarea"]            = "지역 추가";
+$vocab["name"]               = "이름";
+$vocab["noarea"]             = "지역이 선택되지 않았음";
+$vocab["browserlang"]        = "당신의 브라우저는 다음 언어를 사용하도록 설정되어 있음: ";
+$vocab["postbrowserlang"]    = "";
+$vocab["addroom"]            = "회의실 추가";
+$vocab["capacity"]           = "수용가능 인원";
+$vocab["norooms"]            = "등록된 회의실이 없음";
+$vocab["administration"]     = "지역 및 회의실 관리";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "지역 수정";
+$vocab["change"]             = "수정";
+$vocab["backadmin"]          = "돌아가기";
+$vocab["editroomarea"]       = "지역 또는 회의실 수정";
+$vocab["editroom"]           = "회의실 수정";
+$vocab["update_room_failed"] = "회의실 수정 실패: ";
+$vocab["error_room"]         = "에러: 회의실  ";
+$vocab["not_found"]          = "이(가) 발견되지 않음";
+$vocab["update_area_failed"] = "지역 수정 실패: ";
+$vocab["error_area"]         = "에러: 지역  ";
+$vocab["room_admin_email"]   = "회의실 관리자 메일주소:";
+$vocab["area_admin_email"]   = "지역 관리자 메일주소";
+$vocab["invalid_email"]      = "잘못된 메일주소입니다!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "다음의 예약들이 삭제됩니다.";
+$vocab["sure"]               = "삭제하시겠습니까?";
+$vocab["YES"]                = "예";
+$vocab["NO"]                 = "아니오";
+$vocab["delarea"]            = "지우기 전에 이 지역안에 있는 모든 회의실을 지워야 합니다.<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "About MRBS";
+$vocab["database"]           = "Database: ";
+$vocab["system"]             = "System: ";
+$vocab["please_contact"]     = "자세한 사항은 다음 관리자에게 연락주십시오: ";
+$vocab["for_any_questions"]  = " ";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "심각한 에러: 데이터베이스에 접속할 수 없습니다.";
+
+?>
Index: web/mysqli.php
===================================================================
RCS file: web/mysqli.php
diff -N web/mysqli.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/mysqli.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,249 @@
+<?php
+// $Id: mysqli.inc,v 1.1.2.2 2006/10/09 15:53:59 jberanek Exp $
+
+// mysqli.php - Simple PHP database support for MySQL, using mysqli extension.
+// Include this file after defining the following variables:
+//   $db_host = The hostname of the database server
+//   $db_login = The username to use when connecting to the database
+//   $db_password = The database account password
+//   $db_database = The database name.
+// Including this file connects you to the database, or exits on error.
+require_once("../../../config.php"); //for Moodle integration
+
+
+// Free a results handle. You need not call this if you call sql_row or
+// sql_row_keyed until the row returns 0, since sql_row frees the results
+// handle when you finish reading the rows.
+function sql_free ($r)
+{
+  $r->close();
+}
+
+// Execute a non-SELECT SQL command (insert/update/delete).
+// Returns the number of tuples affected if OK (a number >= 0).
+// Returns -1 on error; use sql_error to get the error message.
+function sql_command ($sql)
+{
+  global $mysqli;
+  
+  $ret = -1;
+
+  if ($mysqli->query($sql)) {
+    $ret = $mysqli->affected_rows;
+  }
+  return $ret;
+}
+
+// Execute an SQL query which should return a single non-negative number value.
+// This is a lightweight alternative to sql_query, good for use with count(*)
+// and similar queries. It returns -1 on error or if the query did not return
+// exactly one value, so error checking is somewhat limited.
+// It also returns -1 if the query returns a single NULL value, such as from
+// a MIN or MAX aggregate function applied over no rows.
+function sql_query1 ($sql)
+{
+    global $mysqli;
+    
+    $r = $mysqli->query($sql);
+    if (! $r) return -1;
+    if (($r->num_rows != 1) || ($r->field_count != 1) ||
+        (($row = $r->fetch_row()) == NULL)) {
+        $result = -1;
+    }
+    $r->close();
+    return $row[0];
+}
+
+// Execute an SQL query. Returns a database-dependent result handle,
+// which should be passed back to sql_row or sql_row_keyed to get the results.
+// Returns 0 on error; use sql_error to get the error message.
+function sql_query ($sql)
+{
+    global $mysqli;
+
+    $r = $mysqli->query($sql);
+    return $r;
+}
+
+// Return a row from a result. The first row is 0.
+// The row is returned as an array with index 0=first column, etc.
+// When called with i >= number of rows in the result, cleans up from
+// the query and returns 0.
+// Typical usage: $i = 0; while ((a = sql_row($r, $i++))) { ... }
+function sql_row ($r, $i)
+{
+    if ($i >= $r->num_rows) {
+      $r->close();
+      return 0;
+    }
+    $r->data_seek($i);
+    return $r->fetch_row();
+}
+
+// Return a row from a result as an associative array keyed by field name.
+// The first row is 0.
+// This is actually upward compatible with sql_row since the underlying
+// routing also stores the data under number indexes.
+// When called with i >= number of rows in the result, cleans up from
+// the query and returns 0.
+function sql_row_keyed ($r, $i)
+{
+    if ($i >= $r->num_rows) {
+        $r->close();
+        return 0;
+    }
+    $r->data_seek($i);
+    return $r->fetch_array();
+}
+
+// Return the number of rows returned by a result handle from sql_query.
+function sql_count ($r)
+{
+    return $r->num_rows;
+}
+
+// Return the value of an autoincrement field from the last insert.
+// Must be called right after an insert on that table!
+function sql_insert_id($table, $field)
+{
+    global $mysqli;
+
+    return $mysqli->insert_id;
+}
+
+// Return the text of the last error message.
+function sql_error()
+{
+    global $mysqli;
+
+    return $mysqli->error;
+}
+
+// Begin a transaction, if the database supports it. This is used to
+// improve PostgreSQL performance for multiple insert/delete/updates.
+// There is no rollback support, since MySQL doesn't support it.
+function sql_begin()
+{
+}
+
+// Commit (end) a transaction. See sql_begin().
+function sql_commit()
+{
+}
+
+// Acquire a mutual-exclusion lock on the named table. For portability:
+// This will not lock out SELECTs.
+// It may lock out DELETE/UPDATE/INSERT or not, depending on the implementation.
+// It will lock out other callers of this routine with the same name argument.
+// It may timeout in 20 seconds and return 0, or may wait forever.
+// It returns 1 when the lock has been acquired.
+// Caller must release the lock with sql_mutex_unlock().
+// Caller must not have more than one mutex at any time.
+// Do not mix this with sql_begin()/sql_end() calls.
+//
+// In MySQL, we avoid table locks, and use low-level locks instead.
+function sql_mutex_lock($name)
+{
+    global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
+    if (!sql_query1("SELECT GET_LOCK('$name', 20)")) {
+        return 0;
+    }
+    $sql_mutex_unlock_name = $name;
+    if (empty($sql_mutex_shutdown_registered)) {
+        register_shutdown_function("sql_mutex_cleanup");
+        $sql_mutex_shutdown_registered = 1;
+    }
+    return 1;
+}
+
+// Release a mutual-exclusion lock on the named table. See sql_mutex_unlock.
+function sql_mutex_unlock($name)
+{
+    global $sql_mutex_unlock_name;
+    sql_query1("SELECT RELEASE_LOCK('$name')");
+    $sql_mutex_unlock_name = "";
+}
+
+// Shutdown function to clean up a forgotten lock. For internal use only.
+function sql_mutex_cleanup()
+{
+    global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
+    if (!empty($sql_mutex_unlock_name)) {
+        sql_mutex_unlock($sql_mutex_unlock_name);
+        $sql_mutex_unlock_name = "";
+    }
+}
+
+
+// Return a string identifying the database version:
+function sql_version()
+{
+    $r = sql_query("select version()");
+    $v = sql_row($r, 0);
+    sql_free($r);
+    return "MySQL $v[0]";
+}
+
+
+// Generate non-standard SQL for LIMIT clauses:
+function sql_syntax_limit($count, $offset)
+{
+    return " LIMIT $offset,$count ";
+}
+
+// Generate non-standard SQL to output a TIMESTAMP as a Unix-time:
+function sql_syntax_timestamp_to_unix($fieldname)
+{
+    return " UNIX_TIMESTAMP($fieldname) ";
+}
+
+// Generate non-standard SQL to match a string anywhere in a field's value
+// in a case insensitive manner. $s is the un-escaped/un-slashed string.
+// In MySQL, REGEXP seems to be case sensitive, so use LIKE instead. But this
+// requires quoting of % and _ in addition to the usual.
+function sql_syntax_caseless_contains($fieldname, $s)
+{
+    $s = str_replace("\\", "\\\\", $s);
+    $s = str_replace("%", "\\%", $s);
+    $s = str_replace("_", "\\_", $s);
+    $s = str_replace("'", "''", $s);
+    return " $fieldname LIKE '%$s%' ";
+}
+
+// Returns the name of a field.
+function sql_field_name($result, $index)
+{
+    $finfo = $result->fetch_field_direct($index);
+    return $finfo->name;
+}
+
+// Returns the type of a field. (one of "int", "real", "string", "blob", etc...)
+function sql_field_type($result, $index)
+{
+    $finfo = $result->fetch_field_direct($index);
+    return $finfo->type;
+}
+
+// Returns the number of fields in a result.
+function sql_num_fields($result)
+{
+    return $result->field_count;
+}
+
+
+
+// Establish a database connection.
+// On connection error, the message will be output without a proper HTML
+// header. There is no way I can see around this; if track_errors isn't on
+// there seems to be no way to supress the automatic error message output and
+// still be able to access the error text.
+
+$mysqli = new mysqli($db_host, $db_login, $db_password, $db_database);
+
+/* check connection */
+if (mysqli_connect_errno()) {
+    echo "\n<p>\n" . get_vocab("failed_connect_db") . " : " . mysqli_connect_error();
+    exit;
+}
+
+?>
Index: web/trailer.php
===================================================================
RCS file: web/trailer.php
diff -N web/trailer.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/trailer.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,90 @@
+<?php
+# $Id: trailer.php,v 1.10.2.1 2006/10/09 15:54:00 jberanek Exp $
+require_once("../../../config.php"); //for Moodle integration
+if ( $pview != 1 ) {
+
+echo "<P><HR><B>".get_string('viewday','block_mrbs').":</B>\n";
+
+if(!isset($year))
+	$year = strftime("%Y");
+
+if(!isset($month))
+	$month = strftime("%m");
+
+if(!isset($day))
+	$day = strftime("%d");
+
+if (empty($area))
+	$params = "";
+else
+	$params = "&area=$area";
+
+for($i = -6; $i <= 7; $i++)
+{
+	$ctime = mktime(0, 0, 0, $month, $day + $i, $year);
+
+	$str = utf8_strftime(empty($dateformat)? "%b %d" : "%d %b", $ctime);
+
+	$cyear  = date("Y", $ctime);
+	$cmonth = date("m", $ctime);
+	$cday   = date("d", $ctime);
+	if ($i != -6) echo " | ";
+	if ($i == 0) echo '<b>[ ';
+	echo "<a href=\"day.php?year=$cyear&month=$cmonth&day=$cday$params\">$str</a>\n";
+	if ($i == 0) echo ']</b> ';
+}
+
+echo "<BR><B>".get_string('viewweek','block_mrbs').":</B>\n";
+
+if (!empty($room)) $params .= "&room=$room";
+
+$ctime = mktime(0, 0, 0, $month, $day, $year);
+# How many days to skip back to first day of week:
+$skipback = (date("w", $ctime) - $weekstarts + 7) % 7;
+	
+for ($i = -4; $i <= 4; $i++)
+{
+	$ctime = mktime(0, 0, 0, $month, $day + 7 * $i - $skipback, $year);
+
+	$cweek  = date("W", $ctime);
+	$cday   = date("d", $ctime);
+	$cmonth = date("m", $ctime);
+	$cyear  = date("Y", $ctime);
+	if ($i != -4) echo " | ";
+
+	if ($view_week_number)
+	{
+		$str = $cweek;
+	}
+	else
+	{
+		$str = utf8_strftime(empty($dateformat)? "%b %d" : "%d %b", $ctime);
+	}
+	if ($i == 0) echo '<b>[ ';
+	echo "<a href=\"week.php?year=$cyear&month=$cmonth&day=$cday$params\">$str</a>\n";
+	if ($i == 0) echo ']</b> ';
+}
+
+echo "<BR><B>".get_string('viewmonth','block_mrbs').":</B>\n";
+for ($i = -2; $i <= 6; $i++)
+{
+	$ctime = mktime(0, 0, 0, $month + $i, 1, $year);
+	$str = utf8_strftime("%b %Y", $ctime);
+	
+	$cmonth = date("m", $ctime);
+	$cyear  = date("Y", $ctime);
+	if ($i != -2) echo " | ";
+	if ($i == 0) echo '<b>[ ';
+	echo "<a href=\"month.php?year=$cyear&month=$cmonth$params\">$str</a>\n";
+	if ($i == 0) echo ']</b> ';
+}
+
+echo "<HR>";
+echo '<p><center><a href="' . basename($PHP_SELF) . '?' . $QUERY_STRING . '&pview=1">' . get_string('ppreview','block_mrbs') . '</a></center><p>';
+
+}
+?>
+
+<HR>
+</BODY>
+</HTML>
Index: web/localecheck.php
===================================================================
RCS file: web/localecheck.php
diff -N web/localecheck.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/localecheck.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,16 @@
+<?php
+function list_system_locales(){
+   ob_start();
+   system('locale -a');
+   $str = ob_get_contents();
+   ob_end_clean();
+   return split("\\n", trim($str));
+}
+
+$locale = "fr_FR.UTF8";
+$locales = list_system_locales();
+
+var_dump($locales);
+
+
+?>
Index: web/lang.fr.php
===================================================================
RCS file: web/lang.fr.php
diff -N web/lang.fr.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.fr.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.fr.php,v 1.1 2007/04/05 22:25:31 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a French file.
+#
+# Translations provided by: Thierry Wehr, thierry_bo
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "Syst�me de R�servation de Ressources";
+
+# Used in functions.php
+$vocab["report"]             = "Rapport";
+$vocab["admin"]              = "Gestion";
+$vocab["help"]               = "Aide";
+$vocab["search"]             = "Recherche:";
+$vocab["not_php3"]             = "<H1>ATTENTION: Cette application peut ne pas fonctionner correctement avec PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "R�servation pour<br>";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "Lieux";
+$vocab["daybefore"]          = "Aller au jour pr�c�dent";
+$vocab["dayafter"]           = "Aller au jour suivant";
+$vocab["gototoday"]          = "Aujourd'hui";
+$vocab["goto"]               = " Afficher";
+$vocab["highlight_line"]     = "Surligner cette ligne";
+$vocab["click_to_reserve"]   = "Cliquer sur la case pour r�server.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Voir la journ�e";
+$vocab["viewweek"]           = "Voir la semaine";
+$vocab["viewmonth"]          = "Voir le mois";
+$vocab["ppreview"]           = "Format imprimable";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Ajouter une r�servation";
+$vocab["editentry"]          = "Editer une r�servation";
+$vocab["editseries"]         = "Editer une p�riodicit�";
+$vocab["namebooker"]         = "Br�ve description :";
+$vocab["fulldescription"]    = "Description compl�te:<br>&nbsp;&nbsp;(Nombre de personnes,<br>&nbsp;&nbsp;Interne/Externe etc)";
+$vocab["date"]               = "Date :";
+$vocab["start_date"]         = "Date de d�but :";
+$vocab["end_date"]           = "Date de fin :";
+$vocab["time"]               = "Heure :";
+$vocab["period"]             = "P�riode:";
+$vocab["duration"]           = "Dur�e :";
+$vocab["seconds"]            = "secondes";
+$vocab["minutes"]            = "minutes";
+$vocab["hours"]              = "heures";
+$vocab["days"]               = "jours";
+$vocab["weeks"]              = "semaines";
+$vocab["years"]              = "ann�es";
+$vocab["periods"]            = "periodes";
+$vocab["all_day"]            = "Journ�e enti�re";
+$vocab["type"]               = "Type :";
+$vocab["internal"]           = "Interne";
+$vocab["external"]           = "Externe";
+$vocab["save"]               = "Enregistrer";
+$vocab["rep_type"]           = "Type de p�riodicit� :";
+$vocab["rep_type_0"]         = "Aucune";
+$vocab["rep_type_1"]         = "Jour";
+$vocab["rep_type_2"]         = "Semaine";
+$vocab["rep_type_3"]         = "Mois";
+$vocab["rep_type_4"]         = "Ann�e";
+$vocab["rep_type_5"]         = "Mois, m�me jour semaine";
+$vocab["rep_type_6"]         = "tous les n semaines";
+$vocab["rep_end_date"]       = "Date de fin de p�riodicit� :";
+$vocab["rep_rep_day"]        = "Jour :";
+$vocab["rep_for_weekly"]     = "(pour n-semaines)";
+$vocab["rep_freq"]           = "Fr�quence :";
+$vocab["rep_num_weeks"]      = "Intervalle de semaines";
+$vocab["rep_for_nweekly"]    = "(pour n-semaines)";
+$vocab["ctrl_click"]         = "CTRL + clic souris pour s�lectionner plusieurs salles";
+$vocab["entryid"]            = "R�servation N� ";
+$vocab["repeat_id"]          = "p�riodicit� N� ";
+$vocab["you_have_not_entered"] = "Vous n'avez pas saisi";
+$vocab["you_have_not_selected"] = "Vous n'avez pas s�lectionn�";
+$vocab["valid_room"]         = "salle.";
+$vocab["valid_time_of_day"]  = "une heure valide.";
+$vocab["brief_description"]  = "la description br�ve.";
+$vocab["useful_n-weekly_value"] = "un intervalle de semaines valide.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Description :";
+$vocab["room"]               = "Salle ";
+$vocab["createdby"]          = "Cr��e par :";
+$vocab["lastupdate"]         = "Derni�re mise � jour :";
+$vocab["deleteentry"]        = "Effacer une r�servation";
+$vocab["deleteseries"]       = "Effacer une p�riodicit�";
+$vocab["confirmdel"]         = "Etes-vous s�r\\nde vouloir effacer\\ncette r�servation ?\\n\\n";
+$vocab["returnprev"]         = "Retour � la page pr�c�dente";
+$vocab["invalid_entry_id"]   = "N� de r�servation non valide";
+$vocab["invalid_series_id"]  = "Invalid series id.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Erreur";
+$vocab["sched_conflict"]     = "Conflit entre r�servations ";
+$vocab["conflict"]           = "La nouvelle r�servation entre en conflit avec la(les) r�servation(s) suivante(s) :";
+$vocab["too_may_entrys"]     = "Les options choisies cr�erons trop de r�servations.<BR>Choisissez des options diff�rentes !";
+$vocab["returncal"]          = "Retour au calendrier";
+$vocab["failed_to_acquire"]  = "Erreur, impossible d'obtenir l'acc�s exclusif � la base de donn�es"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Acc�s refus�";
+$vocab["norights"]           = "Vous n'avez pas les droits suffisants pour faire une modification.";
+$vocab["please_login"]       = "Veuillez vous identifier";
+$vocab["user_name"]          = "Nom";
+$vocab["user_password"]      = "Mot de passe";
+$vocab["unknown_user"]       = "Utilisateur non identifi�";
+$vocab["you_are"]            = "Vous �tes";
+$vocab["login"]              = "S'identifier";
+$vocab["logoff"]             = "Se d�connecter";
+
+# Authentication database
+$vocab["user_list"]          = "Liste des utilisateurs";
+$vocab["edit_user"]          = "Modification de l'utilisateur";
+$vocab["delete_user"]        = "Supprimer cet utilisateur";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Adresse m�l";
+$vocab["password_twice"]     = "Pour changer le mot de passe, tapez le nouveau mot de passe ici deux fois";
+$vocab["passwords_not_eq"]   = "Erreur: Les mots de passe ne sont pas identiques.";
+$vocab["add_new_user"]       = "Ajouter un nouvel utilisateur";
+$vocab["rights"]             = "Droits";
+$vocab["action"]             = "Action";
+$vocab["user"]               = "Utilisateur";
+$vocab["administrator"]      = "Administrateur";
+$vocab["unknown"]            = "Inconnu";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Afficher mes r�servations � venir";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Recherche non valide.";
+$vocab["search_results"]     = "R�sultats de la recherche pour :";
+$vocab["nothing_found"]      = "Aucune r�servation n'a �t� trouv�e.";
+$vocab["records"]            = "Enregistrements ";
+$vocab["through"]            = " � ";
+$vocab["of"]                 = " sur ";
+$vocab["previous"]           = "Pr�c�dent";
+$vocab["next"]               = "Suivant";
+$vocab["entry"]              = "R�servation";
+$vocab["view"]               = "Voir";
+$vocab["advanced_search"]    = "Recherche avanc�e"; 
+$vocab["search_button"]      = "Recherche"; 
+$vocab["search_for"]         = "Rechercher"; 
+$vocab["from"]               = "A partir de"; 
+
+# Used in report.php
+$vocab["report_on"]          = "Rapport des r�servations :";
+$vocab["report_start"]       = "Date de d�but du rapport :";
+$vocab["report_end"]         = "Date de fin du rapport :";
+$vocab["match_area"]         = "Lieu :";
+$vocab["match_room"]         = "Salle :";
+$vocab["match_type"]         = "Type :";
+$vocab["ctrl_click_type"]    = "CTRL + clic souris pour s�lectionner plusieurs types";
+$vocab["match_entry"]        = "Br�ve description :";
+$vocab["match_descr"]        = "Description compl�te :";
+$vocab["include"]            = "Inclure :";
+$vocab["report_only"]        = "le rappport seulement";
+$vocab["summary_only"]       = "le r�sum� seulement";
+$vocab["report_and_summary"] = "le rapport et le r�sum�";
+$vocab["summarize_by"]       = "R�sum� par :";
+$vocab["sum_by_descrip"]     = "Br�ve description";
+$vocab["sum_by_creator"]     = "Cr�ateur";
+$vocab["entry_found"]        = "r�servation trouv�e";
+$vocab["entries_found"]      = "r�servations trouv�es";
+$vocab["summary_header"]     = "D�compte des Heures R�serv�es";
+$vocab["summary_header_per"] = "D�compte des P�riodes R�serv�es";
+$vocab["total"]              = "Total";
+$vocab["submitquery"]        = "Afficher le rapport";
+$vocab["sort_rep"]           = "Trier par :";
+$vocab["sort_rep_time"]      = "Date/Heure";
+$vocab["rep_dsp"]            = "Afficher :";
+$vocab["rep_dsp_dur"]        = "la dur�e";
+$vocab["rep_dsp_end"]        = "l'heure de fin";
+
+# Used in week.php
+$vocab["weekbefore"]         = "Voir la semaine pr�c�dente";
+$vocab["weekafter"]          = "Voir la semaine suivante";
+$vocab["gotothisweek"]       = "Voir cette semaine-ci";
+
+# Used in month.php
+$vocab["monthbefore"]        = "Voir le mois pr�c�dent";
+$vocab["monthafter"]         = "Voir le mois suivant";
+$vocab["gotothismonth"]      = "Voir ce mois-ci";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Aucune salle n'est d�finie pour ce lieu";
+
+# Used in admin.php
+$vocab["edit"]               = "Modifier";
+$vocab["delete"]             = "Supprimer";
+$vocab["rooms"]              = "Salles";
+$vocab["in"]                 = "de :";
+$vocab["noareas"]            = "Pas de lieux";
+$vocab["addarea"]            = "Ajouter un lieu";
+$vocab["name"]               = "Nom";
+$vocab["noarea"]             = "S�lectionnez d'abord un lieu";
+$vocab["browserlang"]        = "Votre navigateur est configur� pour utiliser la langue";
+$vocab["postbrowserlang"]    = ".";
+$vocab["addroom"]            = "Ajouter une salle";
+$vocab["capacity"]           = "Maximum de personnes";
+$vocab["norooms"]            = "Aucune salle n'est cr��e pour ce lieu.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Modifier le lieu";
+$vocab["change"]             = "Changer";
+$vocab["backadmin"]          = "Revenir � l'�cran de gestion";
+$vocab["editroomarea"]       = "Modifiez la description d'un lieu ou d'une salle";
+$vocab["editroom"]           = "Modifier la salle";
+$vocab["update_room_failed"] = "La mise � jour de la salle a �chou�: ";
+$vocab["error_room"]         = "Erreur: salle ";
+$vocab["not_found"]          = " non trouv�e";
+$vocab["update_area_failed"] = "La mise � jour du lieu a �chou�: ";
+$vocab["error_area"]         = "Erreur: lieu ";
+$vocab["room_admin_email"]   = "Emails des responsables:";
+$vocab["area_admin_email"]   = "Emails des responsables:";
+$vocab["invalid_email"]      = "Adresse email non valide !";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Vous allez supprimer les r�servations suivantes";
+$vocab["sure"]               = "Etes-vous certains ?";
+$vocab["YES"]                = "OUI";
+$vocab["NO"]                 = "NON";
+$vocab["delarea"]            = "Vous devez supprimer toutes les salles de ce lieu avant de pouvoir le supprimer<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "A propos de MRBS (Meeting Room Booking System)";
+$vocab["database"]           = "Base de donn�e: ";
+$vocab["system"]             = "Syst�me d'exploitation: ";
+$vocab["please_contact"]     = "Contactez ";
+$vocab["for_any_questions"]  = "si vous avez une question qui n'est pas trait�e ici.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Erreur grave: Echec de la connexion � la base de donn�es";
+
+?>
Index: web/language.php
===================================================================
RCS file: web/language.php
diff -N web/language.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/language.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,678 @@
+<?php
+
+# $Id: language.inc,v 1.13.2.4 2007/02/13 12:53:32 jberanek Exp $
+require_once("../../../config.php"); //for Moodle integration
+# A map is needed to convert from the HTTP language specifier to a
+# locale specifier for Windows
+$lang_map_windows = array
+(
+  'cs' => 'csy',
+  'cs-cs' => 'csy',
+  'cs-cz' => 'csy',
+  'cz' => 'csy',
+  'cz-cz' => 'csy',
+  'da' => 'dan',
+  'da-da' => 'dan',
+  'de' => 'deu',
+  'de-at' => 'dea',
+  'de-ch' => 'des',
+  'de-de' => 'deu',
+  'el' => 'ell',
+  'el-el' => 'ell',
+  'el-gr' => 'ell',
+  'en' => 'eng',
+  'en-au' => 'ena',
+  'en-ca' => 'enc',
+  'en-en' => 'eng',
+  'en-ie' => 'eng',
+  'en-nz' => 'enz',
+  'en-gb' => 'eng',
+  'en-us' => 'usa',
+  'es' => 'esp',
+  'es-es' => 'esp',
+  'es-mx' => 'esm',
+  'fi' => 'fin',
+  'fi-fi' => 'fin',
+  'fr' => 'fra',
+  'fr-be' => 'frb',
+  'fr-ca' => 'frc',
+  'fr-ch' => 'frs',
+  'fr-fr' => 'fra',
+  'it' => 'ita',
+  'it-ch' => 'its',
+  'it-it' => 'its',
+  'ja' => 'jpn',
+  'ja-ja' => 'jpn',
+  'ja-jp' => 'jpn',
+  'ko' => 'kor',
+  'ko-ko' => 'kor',
+  'ko-kr' => 'kor',
+  'nl' => 'nld',
+  'nl-be' => 'nlb',
+  'nl-nl' => 'nld',
+  'no' => 'norwegian',
+  'no-no' => 'norwegian',
+  'nb' => 'nor',
+  'nb-nb' => 'nor',
+  'nn' => 'non',
+  'nn-nn' => 'non',
+  'pl' => 'plk',
+  'pl-pl' => 'plk',
+  'pt' => 'ptg',
+  'pt-br' => 'ptb',
+  'pt-pt' => 'ptg',
+  'sv' => 'sve',
+  'sv-se' => 'sve',
+  'sv-sv' => 'sve',
+  'zh' => 'chinese',
+  'zh-tw' => 'cht',
+  'zh-cn' => 'chs',
+  'zh-hk' => 'cht',
+  'zh-sg' => 'cht',
+  'zh-zh' => 'chinese',
+);
+
+# This maps a Windows locale to the charset it uses, which are
+# all Windows code pages
+$winlocale_codepage_map = array
+(
+  'chs' => 'CP936',
+  'cht' => 'CP950',
+  'csy' => 'CP1250',
+  'dan' => 'CP1252',
+  'dea' => 'CP1252',
+  'des' => 'CP1252',
+  'deu' => 'CP1252',
+  'ell' => 'CP1253',
+  'ena' => 'CP1252',
+  'enc' => 'CP1252',
+  'eng' => 'CP1252',
+  'enz' => 'CP1252',
+  'esm' => 'CP1252',
+  'esp' => 'CP1252',
+  'fin' => 'CP1252',
+  'fra' => 'CP1252',
+  'frb' => 'CP1252',
+  'frc' => 'CP1252',
+  'frs' => 'CP1252',
+  'ita' => 'CP1252',
+  'its' => 'CP1252',
+  'jpn' => 'CP932',
+  'kor' => 'CP949',
+  'nlb' => 'CP1252',
+  'nld' => 'CP1252',
+  'norwegian' => 'CP1252',
+  'ptb' => 'CP1252',
+  'ptg' => 'CP1252',
+  'plk' => 'CP1250',
+  'sve' => 'CP1252',
+  'usa' => 'CP1252'
+);
+
+# These are special cases, generally we can convert from the HTTP
+# language specifier to a locale specifier without a map
+$lang_map_unix = array
+(
+  'cs_CS' => 'cs_CZ',
+  'da_DA' => 'da_DK',
+  'el_EL' => 'el_GR',
+  'en_EN' => 'en_GB',
+  'ja_JA' => 'ja_JP',
+  'ko_KO' => 'ko_KR',
+  'sv_SV' => 'sv_SE',
+  'zh_ZH' => 'zh_CN',
+);
+
+# IBM AIX locale to code set table
+# See http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf2/setlocale.htm
+$aixlocale_codepage_map = array
+(
+  'Ar_AA' => 'IBM-1046',
+  'ar_AA' => 'ISO8859-6',
+  'bg_BG' => 'ISO8856-5',
+  'cs_CZ' => 'ISO8859-2',
+  'Da_DK' => 'IBM-850',
+  'da_DK' => 'ISO8859-1',
+  'De_CH' => 'IBM-850',
+  'de_CH' => 'ISO8859-1',
+  'De_DE' => 'IBM-850',
+  'de_DE' => 'ISO8859-1',
+  'el_GR' => 'ISO8859-7',
+  'En_GB' => 'IBM-850',
+  'en_GB' => 'ISO8859-1',
+  'En_US' => 'IBM-850',
+  'en_US' => 'ISO8859-1',
+  'Es_ES' => 'IBM-850',
+  'es_ES' => 'ISO8859-1',
+  'Fi_FI' => 'IBM-850',
+  'fi_FI' => 'ISO8859-1',
+  'Fr_BE' => 'IBM-850',
+  'fr_BE' => 'ISO8859-1',
+  'Fr_CA' => 'IBM-850',
+  'fr_CA' => 'ISO8859-1',
+  'Fr_FR' => 'IBM-850',
+  'fr_FR' => 'ISO8859-1 ',
+  'Fr_CH' => 'IBM-850',
+  'fr_CH' => 'ISO8859-1',
+  'hr_HR' => 'ISO8859-2',
+  'hu_HU' => 'ISO8859-2',
+  'Is_IS' => 'IBM-850',
+  'is_IS' => 'ISO8859-1',
+  'It_IT' => 'IBM-850',
+  'it_IT' => 'ISO8859-1',
+  'Iw_IL' => 'IBM-856',
+  'iw_IL' => 'ISO8859-8',
+  'Ja_JP' => 'IBM-943',
+  'ko_KR' => 'IBM-eucKR',
+  'mk_MK' => 'ISO8859-5',
+  'Nl_BE' => 'IBM-850',
+  'nl_BE' => 'ISO8859-1',
+  'Nl_NL' => 'IBM-850',
+  'nl_NL' => 'ISO8859-1',
+  'No_NO' => 'IBM-850',
+  'no_NO' => 'ISO8859-1',
+  'pl_PL' => 'ISO8859-2',
+  'Pt_PT' => 'IBM-850',
+  'pt_PT' => 'ISO8859-1',
+  'ro_RO' => 'ISO8859-2',
+  'ru_RU' => 'ISO8859-5',
+  'sh_SP' => 'ISO8859-2',
+  'sl_SI' => 'ISO8859-2',
+  'sk_SK' => 'ISO8859-2',
+  'sr_SP' => 'ISO8859-5',
+  'Zh_CN' => 'GBK',
+  'Sv_SE' => 'IBM-850',
+  'sv_SE' => 'ISO8859-1',
+  'tr_TR' => 'ISO8859-9',
+  'zh_TW' => 'IBM-eucTW'
+);
+
+# GNU iconv code set to IBM AIX libiconv code set table
+# Keys of this table should be in lowercase, and searches should be performed using lowercase!
+$gnu_iconv_to_aix_iconv_codepage_map = array
+(
+  // "iso-8859-[1-9]" --> "ISO8859-[1-9]" according to http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf2/setlocale.htm
+  'iso-8859-1' => 'ISO8859-1',
+  'iso-8859-2' => 'ISO8859-2',
+  'iso-8859-3' => 'ISO8859-3',
+  'iso-8859-4' => 'ISO8859-4',
+  'iso-8859-5' => 'ISO8859-5',
+  'iso-8859-6' => 'ISO8859-6',
+  'iso-8859-7' => 'ISO8859-7',
+  'iso-8859-8' => 'ISO8859-8',
+  'iso-8859-9' => 'ISO8859-9',
+
+  // "big5" --> "IBM-eucTW" according to http://kadesh.cepba.upc.es/mancpp/classref/ref/ITranscoder_DSC.htm
+  'big5' => 'IBM-eucTW',
+
+  // "big-5" --> "IBM-eucTW" (see above)
+  'big-5' => 'IBM-eucTW'
+);
+
+# IBM AIX libiconv UTF-8 converters
+# See http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/convert_prg.htm#HDRDNNRI49HOWA
+$aix_utf8_converters = array
+(
+  'ISO8859-1',
+  'ISO8859-2',
+  'ISO8859-3',
+  'ISO8859-4',
+  'ISO8859-5',
+  'ISO8859-6',
+  'ISO8859-7',
+  'ISO8859-8',
+  'ISO8859-9',
+  'JISX0201.1976-0',
+  'JISX0208.1983-0',
+  'CNS11643.1986-1',
+  'CNS11643.1986-2',
+  'KSC5601.1987-0',
+  'IBM-eucCN',
+  'IBM-eucJP',
+  'IBM-eucKR',
+  'IBM-eucTW',
+  'IBM-udcJP',
+  'IBM-udcTW',
+  'IBM-sbdTW',
+  'UCS-2',
+  'IBM-437',
+  'IBM-850',
+  'IBM-852',
+  'IBM-857',
+  'IBM-860',
+  'IBM-861',
+  'IBM-863',
+  'IBM-865',
+  'IBM-869',
+  'IBM-921',
+  'IBM-922',
+  'IBM-932',
+  'IBM-943',
+  'IBM-934',
+  'IBM-935',
+  'IBM-936',
+  'IBM-938',
+  'IBM-942',
+  'IBM-944',
+  'IBM-946',
+  'IBM-948',
+  'IBM-1124',
+  'IBM-1129',
+  'TIS-620',
+  'IBM-037',
+  'IBM-273',
+  'IBM-277',
+  'IBM-278',
+  'IBM-280',
+  'IBM-284',
+  'IBM-285',
+  'IBM-297',
+  'IBM-500',
+  'IBM-875',
+  'IBM-930',
+  'IBM-933',
+  'IBM-937',
+  'IBM-939',
+  'IBM-1026',
+  'IBM-1112',
+  'IBM-1122',
+  'IBM-1124',
+  'IBM-1129',
+  'IBM-1381',
+  'GBK',
+  'TIS-620'
+);
+
+
+##############################################################################
+# Language token handling
+
+// Get first default set of language tokens for emails.
+if (MAIL_ADMIN_ON_BOOKINGS or MAIL_AREA_ADMIN_ON_BOOKINGS or
+    MAIL_ROOM_ADMIN_ON_BOOKINGS or MAIL_BOOKER)
+{
+    include "lang." . $default_language_tokens .".php";
+    include "lang." . MAIL_ADMIN_LANG .".php";
+    $mail_vocab = $vocab;
+    unset ($vocab);
+}
+
+# Get a default set of language tokens, you can change this if you like
+include "lang." . $default_language_tokens . ".php";
+
+# Define the default locale here. For a list of supported
+# locales on your system do "locale -a"
+setlocale(LC_ALL,'C');
+
+# We attempt to make up a sensible locale from the HTTP_ACCEPT_LANGUAGE
+# environment variable.
+
+# First we enumerate the user's language preferences...
+if (isset($HTTP_ACCEPT_LANGUAGE)) // Attempt to use $HTTP_ACCEPT_LANGUAGE only when defined.
+{
+  $lang_specifiers = explode(',',$HTTP_ACCEPT_LANGUAGE);
+  foreach ($lang_specifiers as $specifier)
+  {
+    if (preg_match('/([a-zA-Z\-]+);q=([0-9\.]+)/', $specifier, $matches))
+    {
+      $langs[$matches[1]] = $matches[2];
+    }
+    else if (preg_match("/([a-zA-Z\-]+)/", $specifier, $matches))
+    {
+      $langs[$matches[1]] = 1.0;
+    }
+  }
+  arsort($langs,SORT_NUMERIC);
+}
+else // Else use the value from config.inc.php.
+{
+  $langs[$default_language_tokens] = 1.0;
+}
+
+# The following attempts to import a language based on what the client
+# is using.
+
+if (!$disable_automatic_language_changing)
+{
+  $doneit = 0;
+
+  # First try for an exact match, so if the user specified en-gb, look
+  # for lang.en-gb
+
+  foreach ($langs as $lang => $qual)
+  {
+    $lang_file = "lang." . strtolower(substr($lang,0,2)).".php";
+
+    if (file_exists($lang_file))
+    {
+      include $lang_file;
+      $doneit = 1;
+      $locale = $lang;
+      break;
+    }
+  }
+  if ($doneit == 0)
+  {
+    # None of the user's preferred languages was available, so try to
+    # find a lang file for one of the base languages, e.g. look for
+    # lang.en if "en-ca" was specified.
+
+    foreach ($langs as $lang)
+    {
+      $lang_file = "lang." . strtolower(substr($lang,0,2)).".php";
+
+      if (file_exists($lang_file))
+      {
+        include $lang_file;
+        $locale = $lang;
+        break;
+      }
+    }
+  }
+}
+
+##############################################################################
+# Locale handling
+if (empty($locale)) { //quick and ugly hack to avoid PHP notice
+    $locale='en';
+}
+$windows_locale = "eng";
+
+# 2003/11/09 JF Larvoire: Help new admins understand what to do in case the iconv error occurs...
+if (($unicode_encoding) && (!function_exists('iconv')))
+{
+  exit('
+<P>
+  <B>Error:</B> The iconv module, which provides PHP support for Unicode, is not
+installed on your system.</P>
+<P>Unicode gives MRBS the ability to easily support languages other than
+English. Without Unicode, support for non-English-speaking users will be crippled.</P>
+<P>To fix this error, do one of the following:</P>
+<UL>
+<LI><P>Install and enable the iconv module.<BR>
+On a Windows server, enable php_iconv.dll in %windir%\php.ini, and make sure both
+%phpdir%\dlls\iconv.dll and %phpdir%\extensions\php_iconv.dll are in the
+path. One way to do this is to copy these two files to %windir%.<BR>
+On a Unix server, recompile your PHP module with the appropriate
+option for enabling the iconv extension. Consult your PHP server
+documentation for more information about enabling iconv support.</P></LI>
+<LI><P>Disable Unicode support by modifying config.inc.php and setting the
+variable $unicode_encoding to 0. If your MRBS installation is on a shared
+host, then this may be your only option.</P></LI>
+</UL>
+');
+}
+
+if ($override_locale != "")
+{
+  if (setlocale(LC_ALL,$override_locale) == FALSE)
+  {
+    $locale_warning = "Server failed to set locale to
+ \"".$override_locale."\" (Override locale)";
+  }
+  $windows_locale = $override_locale;
+}
+else
+{
+  $server_os = get_server_os();
+
+  if ($server_os == "windows")
+  {
+    if ($lang_map_windows[strtolower($locale)])
+    {
+      if (setlocale(LC_ALL, $lang_map_windows[strtolower($locale)]) == FALSE)
+      {
+        $locale_warning = "Server failed to set locale to
+ \"".$lang_map_windows[strtolower($locale)]."\" (Windows)";
+      }
+      $windows_locale = $lang_map_windows[strtolower($locale)];
+    }
+    else
+    {
+      $locale_warning = "Server failed to map browser language
+ \"".$locale."\" to a Windows locale specifier";
+    }
+  }
+  /* All of these Unix OSes work in mostly the same way... */
+  else if (($server_os == "linux") ||
+           ($server_os == "sunos") ||
+           ($server_os == "bsd") ||
+           ($server_os == "aix") ||
+           ($server_os == "macosx"))
+  {
+    if (strlen($locale) == 2)
+    {
+      # Convert locale=xx to xx_XX; this is not correct for some locales???
+      $locale = strtolower($locale)."_".strtoupper($locale);
+    }
+    else
+    {
+      # Convert locale=xx-xX or xx_Xx or xx_XxXx (etc.) to xx_XX[XX]; this is highly
+      # dependent on the machine's installed locales
+      $locale = strtolower(substr($locale,0,2))."_".strtoupper(substr($locale,3));
+    }
+    if (isset($lang_map_unix[$locale]) && ($lang_map_unix[$locale]))
+    {
+      $locale = $lang_map_unix[$locale];
+    }
+    if ($unicode_encoding)
+    {
+      if ($server_os == "sunos")
+      {
+        $locale .= ".UTF-8";
+      }
+      else
+      {
+        // On IBM AIX, do not add ".utf-8" as this yields an invalid
+        // locale name
+        if ($server_os != "aix")
+        {
+          $locale .= ".utf-8";
+        }
+      }
+    }
+    if (setlocale(LC_ALL, $locale) == FALSE)
+    {
+      $locale_warning = "Server failed to set locale to \"".$locale."\"
+(Unix)";
+    }
+  }
+}
+
+function get_server_os()
+{
+  if (stristr(PHP_OS,"Darwin"))
+  {
+    return "macosx";
+  }
+  else if (stristr(PHP_OS, "WIN"))
+  {
+    return "windows";
+  }
+  else if (stristr(PHP_OS, "Linux"))
+  {
+    return "linux";
+  }
+  else if (stristr(PHP_OS, "BSD"))
+  {
+    return "bsd";
+  }
+  else if (stristr(PHP_OS, "SunOS"))
+  {
+    return "sunos";
+  }
+  else if (stristr(PHP_OS, "AIX"))
+  {
+    return "aix";
+  }
+  else
+  {
+    return "unsupported";
+  }
+}
+
+// Translates a GNU libiconv character encoding name to its corresponding IBM AIX libiconv character
+// encoding name. Returns FALSE if character encoding name is unknown.
+function get_aix_character_encoding($character_encoding)
+{
+  global $gnu_iconv_to_aix_iconv_codepage_map;
+
+  // Check arguments
+  if ($character_encoding == NULL ||
+      !is_string($character_encoding) ||
+      empty($character_encoding))
+  {
+    return FALSE;
+  }
+
+  // Convert character encoding name to lowercase
+  $character_encoding = strtolower($character_encoding);
+
+  // Check that we know of an IBM AIX libiconv character encoding name equivalent for this character encoding name
+  if (!array_key_exists($character_encoding, $gnu_iconv_to_aix_iconv_codepage_map))
+  {
+    return FALSE;
+  }
+
+  return $gnu_iconv_to_aix_iconv_codepage_map[$character_encoding];
+}
+
+function get_vocab_utf8_aix($tag)
+{
+  global $aix_utf8_converters, $vocab;
+
+  // Attempt to translate character encoding name
+  $aix_character_set = get_aix_character_encoding($vocab['charset']);
+
+  // Check if character encoding name translation was successful
+  if ($aix_character_set === FALSE)
+  {
+    // Unsuccessful; just use the original character encoding name
+    $aix_character_set = $vocab['charset'];
+
+  }
+  else
+  {
+    // Successful; check that a corresponding UTF-8 converter exists
+    if (!in_array($aix_character_set, $aix_utf8_converters, TRUE))
+    {
+      // Corresponding UTF-8 converter does not exist; just use the original character encoding name
+      $aix_character_set = $vocab['charset'];
+
+    }
+    else
+    {
+      // Success; the translated character encoding name is ready to use
+    }
+  }
+
+  return iconv($aix_character_set, 'UTF-8', $vocab[$tag]);
+}
+
+
+# Get a vocab item, in UTF-8 or a local encoding, depending on
+# the setting of $unicode_encoding
+function get_vocab($tag)
+{
+  global $vocab, $unicode_encoding;
+
+  if ($unicode_encoding && (strcasecmp($vocab["charset"], "utf-8") != 0))
+  {
+    if ((get_server_os() == 'aix') &&
+        (strcasecmp(ICONV_IMPL, 'unknown') == 0) &&
+        (strcasecmp(ICONV_VERSION, 'unknown') == 0))
+    {
+      $translated = get_vocab_utf8_aix($tag);
+    }
+    else
+    {
+      $translated = iconv($vocab["charset"],"utf-8",$vocab[$tag]);
+    }
+  }
+  else
+  {
+    $translated = $vocab[$tag];
+  }
+  return $translated;
+}
+
+// AIX version of utf8_convert(); needed as locales won't give us UTF-8
+// NOTE: Should ONLY be called with input encoded in the default code set of the current locale!
+// NOTE: Uses the LC_TIME category for determining the current locale setting, so should preferrably be used on date/time input only!
+function utf8_convert_aix($string)
+{
+  global $aixlocale_codepage_map, $aix_utf8_converters, $unicode_encoding;
+
+  // Retrieve current locale setting
+  $aix_locale = setlocale(LC_TIME, '0');
+
+  if ($aix_locale === FALSE)
+  {
+    // Locale setting could not be retrieved; return string unchanged
+    return $string;
+  }
+
+  if (!array_key_exists($aix_locale, $aixlocale_codepage_map))
+  {
+    // Default code page of locale could not be found; return string unchanged
+    return $string;
+  }
+
+  $aix_codepage = $aixlocale_codepage_map[$aix_locale];
+
+  if (!in_array($aix_codepage, $aix_utf8_converters, TRUE))
+  {
+    // No suitable UTF-8 converter was found for this code page; return string unchanged
+    return $string;
+  }
+
+  // Convert string to UTF-8
+  $aix_string = iconv($aix_codepage, 'UTF-8', $string);
+
+  // Default to original string if conversion failed
+  $string = ($aix_string === FALSE) ? $string : $aix_string;
+
+  return $string;
+}
+
+function utf8_convert_from_locale($string)
+{
+  global $windows_locale, $unicode_encoding, $winlocale_codepage_map;
+
+  if ($unicode_encoding)
+  {
+    if (get_server_os() == "windows")
+    {
+      if ($winlocale_codepage_map[$windows_locale])
+      {
+        $string = iconv($winlocale_codepage_map[$windows_locale],"utf-8",
+                        $string);
+      }
+    }
+    else if (get_server_os() == "aix")
+    {
+      $string = utf8_convert_aix($string);
+    }
+  }
+  return $string;
+}
+  
+function utf8_strftime($format, $time)
+{
+  # %p doesn't actually work in some locales, we have to patch it up ourselves
+  if (preg_match('/%p/', $format))
+  {
+    $ampm = strftime('%p', $time);
+    if ($ampm == '')
+    {
+      $ampm = date('a',$time);
+    }
+
+    $format = preg_replace('/%p/', $ampm, $format);
+  }
+
+  $result = strftime($format,$time);
+  return utf8_convert_from_locale($result);
+}
+
+?>
Index: web/phpinfo2.php
===================================================================
RCS file: web/phpinfo2.php
diff -N web/phpinfo2.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/phpinfo2.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,45 @@
+<?PHP  // $Id: phpinfo2.php,v 1.1 2007/04/05 22:25:33 arborrow Exp $
+       // phpinfo.php - shows phpinfo for the current server
+
+    require_once("../../../config.php"); //for Moodle integration
+    $topframe    = optional_param('topframe', false, PARAM_BOOL);
+    $bottomframe = optional_param('bottomframe', false, PARAM_BOOL);
+
+    require_login();
+
+    if (!isadmin()) {
+        error("Only the admin can use this page");
+    }
+
+require_once "grab_globals.inc.php";
+include "config.inc.php";
+include "functions.php";
+include "$dbsys.php";
+include "mrbs_auth.php";
+include "mincals.php";
+
+    if (!$topframe && !$bottomframe) {
+        ?>
+
+        <head>
+        <title>PHP info</title>
+        </head>
+
+        <frameset rows="80,*">
+           <frame src="phpinfo2.php?topframe=true&amp;sesskey=<?php echo $USER->sesskey ?>">
+           <frame src="phpinfo2.php?bottomframe=true&amp;sesskey=<?php echo $USER->sesskey ?>">
+        </frameset>
+
+        <?php
+    } else if ($topframe && confirm_sesskey()) {
+        $stradministration = get_string("administration");
+        $site = get_site();
+
+        print_header_mrbs("$site->shortname: phpinfo", "$site->fullname",
+                     "<a target=\"$CFG->framename\" href=\"index.php\">$stradministration</a> -> PHP info");
+        exit;
+    } else if ($bottomframe && confirm_sesskey()) {
+        phpinfo();
+        exit;
+    }
+?>
Index: web/lang.el.php
===================================================================
RCS file: web/lang.el.php
diff -N web/lang.el.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.el.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.el.php,v 1.1 2007/04/05 22:25:31 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Greek file.
+#
+#
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-7";
+
+# Used in style.php
+$vocab["mrbs"]               = "������� ��������� �������� (MRBS)";
+
+# Used in functions.php
+$vocab["report"]             = "�������";
+$vocab["admin"]              = "����������";
+$vocab["help"]               = "�������";
+$vocab["search"]             = "���������:";
+$vocab["not_php3"]           = "<H1>�������: ���� � ������ ��� �������� �� PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "��������� ���";
+$vocab["bookingsforpost"]    = ""; # Goes after the date
+$vocab["areas"]              = "��������:";
+$vocab["daybefore"]          = "�������� ���� ����������� ����";
+$vocab["dayafter"]           = "�������� ���� ������� ����";
+$vocab["gototoday"]          = "�������� ��� �������� ����";
+$vocab["goto"]               = "��������";
+$vocab["highlight_line"]     = "Highlight this line";
+$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "������� ��� �����";
+$vocab["viewweek"]           = "������� ��� ��������";
+$vocab["viewmonth"]          = "������� ��� ����";
+$vocab["ppreview"]           = "������������� ���������";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "�������� ��������";
+$vocab["editentry"]          = "����������� ��������";
+$vocab["editseries"]         = "����������� ������";
+$vocab["namebooker"]         = "������� ���������:";
+$vocab["fulldescription"]    = "������ ���������:<br>&nbsp;&nbsp;(������� ������,<br>&nbsp;&nbsp;���������/��������� ���.)";
+$vocab["date"]               = "����������:";
+$vocab["start_date"]         = "��� �������:";
+$vocab["end_date"]           = "��� �����:";
+$vocab["time"]               = "���:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "��������:";
+$vocab["seconds"]            = "������������";
+$vocab["minutes"]            = "�����";
+$vocab["hours"]              = "����";
+$vocab["days"]               = "������";
+$vocab["weeks"]              = "���������";
+$vocab["years"]              = "������";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "�������� ����";
+$vocab["type"]               = "�����:";
+$vocab["internal"]           = "���������";
+$vocab["external"]           = "���������";
+$vocab["save"]               = "����������";
+$vocab["rep_type"]           = "����� ����������:";
+$vocab["rep_type_0"]         = "������";
+$vocab["rep_type_1"]         = "��������";
+$vocab["rep_type_2"]         = "�����������";
+$vocab["rep_type_3"]         = "�������";
+$vocab["rep_type_4"]         = "������";
+$vocab["rep_type_5"]         = "�������, ���������� �����";
+$vocab["rep_type_6"]         = "n-�����������";
+$vocab["rep_end_date"]       = "���������� ����������� ����������:";
+$vocab["rep_rep_day"]        = "����� ����������:";
+$vocab["rep_for_weekly"]     = "(��� (n-)�����������)";
+$vocab["rep_freq"]           = "���������:";
+$vocab["rep_num_weeks"]      = "������� ���������";
+$vocab["rep_for_nweekly"]    = "(��� n-�����������)";
+$vocab["ctrl_click"]         = "�������������� Control-Click ��� �� ��������� ������������ ��� ��� ��������";
+$vocab["entryid"]            = "�������������� ������� �������� ";
+$vocab["repeat_id"]          = "�������������� ������� ���������� "; 
+$vocab["you_have_not_entered"] = "��� �������� �� (��)";
+$vocab["you_have_not_selected"] = "You have not selected a";
+$vocab["valid_room"]         = "room.";
+$vocab["valid_time_of_day"]  = "������ ���.";
+$vocab["brief_description"]  = "������� ���������.";
+$vocab["useful_n-weekly_value"] = "������� n-����������� ����.";
+
+# Used in view_entry.php
+$vocab["description"]        = "���������:";
+$vocab["room"]               = "�������";
+$vocab["createdby"]          = "������������� ���:";
+$vocab["lastupdate"]         = "��������� ���������:";
+$vocab["deleteentry"]        = "�������� ��������";
+$vocab["deleteseries"]       = "�������� ������ ����������";
+$vocab["confirmdel"]         = "����� �������\\n��� ������ ��\\n���������� ���� ��� �������;\\n\\n";
+$vocab["returnprev"]         = "��������� ���� ����������� ������";
+$vocab["invalid_entry_id"]   = "����� �������������� ������� �������.";
+$vocab["invalid_series_id"]  = "Invalid series id.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "������";
+$vocab["sched_conflict"]     = "�������������� ���������������";
+$vocab["conflict"]           = "� ��� ������� ���������� �� ��� ��������� ��������:";
+$vocab["too_may_entrys"]     = "�� �������� �� ������������� ���������� ������ ��������.<BR>�������� ��������������� ������������ ��������!";
+$vocab["returncal"]          = "��������� �� ������� �����������";
+$vocab["failed_to_acquire"]  = "�������� ����������� ������������� ��������� ���� ���� ���������"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "������������ � ��������";
+$vocab["norights"]           = "��� ����� ���������� ��������� ��� �� ������������� ���� �� �����������.";
+$vocab["please_login"]       = "�������� ������ �������� (log in)";
+$vocab["user_name"]          = "����� ������";
+$vocab["user_password"]      = "������� ���������";
+$vocab["unknown_user"]       = "�������� �������";
+$vocab["you_are"]            = "�����";
+$vocab["login"]              = "�������� (Log in)";
+$vocab["logoff"]             = "������ (Log Off)";
+
+# Authentication database
+$vocab["user_list"]          = "User list";
+$vocab["edit_user"]          = "Edit user";
+$vocab["delete_user"]        = "Delete this user";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email address";
+$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
+$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
+$vocab["add_new_user"]       = "Add a new user";
+$vocab["rights"]             = "Rights";
+$vocab["action"]             = "Action";
+$vocab["user"]               = "User";
+$vocab["administrator"]      = "Administrator";
+$vocab["unknown"]            = "Unknown";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+
+# Used in search.php
+$vocab["invalid_search"]     = "���� � ���������� ������� ����������.";
+$vocab["search_results"]     = "������������ ���������� ���:";
+$vocab["nothing_found"]      = "��� �������� �������� ��� �� ����������.";
+$vocab["records"]            = "���������� ";
+$vocab["through"]            = " ��� ";
+$vocab["of"]                 = " ��� ";
+$vocab["previous"]           = "�����������";
+$vocab["next"]               = "�������";
+$vocab["entry"]              = "������";
+$vocab["view"]               = "�������";
+$vocab["advanced_search"]    = "��������� ���������";
+$vocab["search_button"]      = "���������";
+$vocab["search_for"]         = "��������� ���";
+$vocab["from"]               = "���";
+
+# Used in report.php
+$vocab["report_on"]          = "������� ��� �����������:";
+$vocab["report_start"]       = "���������� ������� ��������:";
+$vocab["report_end"]         = "���������� ����� ��������:";
+$vocab["match_area"]         = "��������� ��������:";
+$vocab["match_room"]         = "��������� ��������:";
+$vocab["match_type"]         = "Match type:";
+$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
+$vocab["match_entry"]        = "��������� �������� ����������:";
+$vocab["match_descr"]        = "��������� ���������� ����������:";
+$vocab["include"]            = "�� ��������������:";
+$vocab["report_only"]        = "������� ����";
+$vocab["summary_only"]       = "�������� ����";
+$vocab["report_and_summary"] = "������� ��� ��������";
+$vocab["summarize_by"]       = "������ ����:";
+$vocab["sum_by_descrip"]     = "������� ���������";
+$vocab["sum_by_creator"]     = "����������";
+$vocab["entry_found"]        = "���������� �������";
+$vocab["entries_found"]      = "������������ ��������";
+$vocab["summary_header"]     = "�������� ���� ��������";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "������";
+$vocab["submitquery"]        = "�������� ��������";
+$vocab["sort_rep"]           = "Sort Report by:";
+$vocab["sort_rep_time"]      = "Start Date/Time";
+$vocab["rep_dsp"]            = "Display in report:";
+$vocab["rep_dsp_dur"]        = "Duration";
+$vocab["rep_dsp_end"]        = "End Time";
+
+# Used in week.php
+$vocab["weekbefore"]         = "�������� ���� ����������� ��������";
+$vocab["weekafter"]          = "�������� ���� ������� ��������";
+$vocab["gotothisweek"]       = "�������� ���� �������� ��������";
+
+# Used in month.php
+$vocab["monthbefore"]        = "�������� ���� ����������� ����";
+$vocab["monthafter"]         = "�������� ���� ������� ����";
+$vocab["gotothismonth"]      = "�������� ���� �������� ����";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "��� ����� ������� �������� ��� ���� ��� �������";
+
+# Used in admin.php
+$vocab["edit"]               = "�����������";
+$vocab["delete"]             = "��������";
+$vocab["rooms"]              = "��������";
+$vocab["in"]                 = "���";
+$vocab["noareas"]            = "����� �������";
+$vocab["addarea"]            = "�������� ��������";
+$vocab["name"]               = "�����";
+$vocab["noarea"]             = "��� ���� ��������� �������";
+$vocab["browserlang"]        = "� ������������� ��� ������������";
+$vocab["postbrowserlang"]    = "������.";
+$vocab["addroom"]            = "�������� ��������";
+$vocab["capacity"]           = "������������";
+$vocab["norooms"]            = "����� �������.";
+$vocab["administration"]     = "����������";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "����������� ��������";
+$vocab["change"]             = "������";
+$vocab["backadmin"]          = "��������� ���� ����������";
+$vocab["editroomarea"]       = "����������� ���������� �������� � ��������";
+$vocab["editroom"]           = "����������� ��������";
+$vocab["update_room_failed"] = "� ��������� ��� �������� �������: ";
+$vocab["error_room"]         = "������: � ������� ";
+$vocab["not_found"]          = " ��� �������";
+$vocab["update_area_failed"] = "� ��������� ��� ������� �������: ";
+$vocab["error_area"]         = "������: � ������� ";
+$vocab["room_admin_email"]   = "Room admin email:";
+$vocab["area_admin_email"]   = "Area admin email:";
+$vocab["invalid_email"]      = "Invalid email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "� �������� ���� �� ��������� ��� ��������� ���������";
+$vocab["sure"]               = "����� ��������;";
+$vocab["YES"]                = "���";
+$vocab["NO"]                 = "���";
+$vocab["delarea"]            = "������ �� ���������� ���� ��� �������� �� ���� �� ������� ��� �� ��������� �� ��� ����������<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "������� �� �� MRBS";
+$vocab["database"]           = "���� ���������: ";
+$vocab["system"]             = "�������: ";
+$vocab["please_contact"]     = "�������� ������������� �� ";
+$vocab["for_any_questions"]  = "��� ���� ��������� ��� ���������� ���.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "������� ������: �������� �������� ��� ���� ���������";
+
+?>
Index: web/functions_mail.php
===================================================================
RCS file: web/functions_mail.php
diff -N web/functions_mail.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/functions_mail.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,893 @@
+<?php
+// +---------------------------------------------------------------------------+
+// | Meeting Room Booking System.                                              |
+// +---------------------------------------------------------------------------+
+// | Functions dedicated to emails handling.                                   |
+// |---------------------------------------------------------------------------+
+// | I keeped these functions in a separated file to avoid burden the main     |
+// | function.php files if emails are not used.                                |
+// |                                                                           |
+// | USE : This file should be included in all files where emails functions    |
+// |        are likely to be used.                                             |
+// +---------------------------------------------------------------------------+
+// | @author    thierry_bo.                                                    |
+// | @version   $Revision: 1.14.2.6 $.                                              |
+// +---------------------------------------------------------------------------+
+//
+// $Id: functions_mail.inc,v 1.14.2.6 2006/04/26 10:01:42 jberanek Exp $
+
+require_once("../../../config.php"); //for Moodle integration
+// {{{ removeMailUnicode()
+
+/**
+ * Convert already utf-8 encoded strings to charset defined for mails in
+ * c.i.php.
+ *
+ * @param string    $string   string to convert
+ * @return string   $string   string converted to $mail_vocab["charset"]
+ */
+function removeMailUnicode($string)
+{
+    global $unicode_encoding, $mail_vocab;
+    //
+    if ($unicode_encoding)
+    {
+        return iconv("utf-8", $mail_vocab["charset"], $string);
+    }
+    else
+    {
+        return $string;
+    }
+}
+
+// }}}
+// {{{ getMailPeriodDateString()
+
+/**
+ * Format a timestamp in non-unicode output (for emails).
+ *
+ * @param   timestamp   $t
+ * @param   int         $mod_time
+ * @return  array
+ */
+function getMailPeriodDateString($t, $mod_time=0)
+{
+    global $periods;
+    //
+    $time = getdate($t);
+    $p_num = $time['minutes'] + $mod_time;
+    ( $p_num < 0 ) ? $p_num = 0 : '';
+    ( $p_num >= count($periods) - 1 ) ? $p_num = count($periods ) - 1 : '';
+    // I have made the separater a ',' as a '-' leads to an ambiguious
+    // display in report.php when showing end times.
+    return array($p_num, $periods[$p_num] . strftime(", %A %d %B %Y",$t));
+}
+
+// }}}
+// {{{ getMailTimeDateString()
+
+/**
+ * Format a timestamp in non-unicode output (for emails).
+ *
+ * @param   timestamp   $t         timestamp to format
+ * @param   boolean     $inc_time  include time in return string
+ * @return  string                 formated string
+ */
+function getMailTimeDateString($t, $inc_time=TRUE)
+{
+    global $twentyfourhour_format;
+    // This bit's necessary, because it seems %p in strftime format
+    // strings doesn't work
+    $ampm = date("a",$t);
+    if ($inc_time)
+    {
+        if ($twentyfourhour_format)
+        {
+            return strftime("%H:%M:%S - %A %d %B %Y",$t);
+        }
+        else
+        {
+            return strftime("%I:%M:%S$ampm - %A %d %B %Y",$t);
+        }
+    }
+    else
+    {
+        return strftime("%A %d %B %Y",$t);
+    }
+}
+
+// }}}
+// {{{ notifyAdminOnBooking()
+
+/**
+ * Send email to administrator to notify a new/changed entry.
+ *
+ * @param bool    $new_entry    to know if this is a new entry or not
+ * @param int     $new_id       used for create a link to the new entry
+ * @return bool                 TRUE or PEAR error object if fails
+ */
+function notifyAdminOnBooking($new_entry , $new_id)
+{
+    global $url_base, $returl, $mail_vocab, $name, $description, $area_name;
+    global $room_name, $starttime, $duration, $dur_units, $end_date, $endtime;
+    global $rep_enddate, $typel, $type, $create_by, $rep_type, $enable_periods;
+    global $rep_opt, $rep_num_weeks;
+    global $tbl_room, $tbl_area, $tbl_entry, $tbl_users, $tbl_repeat;
+    global $mail_previous, $auth;
+    
+    //
+    $recipients = '';
+    $id_table = ($rep_type > 0) ? "rep" : "e";
+    (MAIL_ADMIN_ON_BOOKINGS) ? $recipients = MAIL_RECIPIENTS : '';
+    if (MAIL_AREA_ADMIN_ON_BOOKINGS)
+    {
+        // Look for list of area admins emails addresses
+        if ($new_entry)
+        {
+            $sql = "SELECT a.area_admin_email ";
+            $sql .= "FROM $tbl_room r, $tbl_area a, $tbl_entry e ";
+            // If this is a repeating entry...
+            if ($id_table == 'rep')
+            {
+                // ...use the repeat table
+                $sql .= ", $tbl_repeat rep ";
+            }
+            $sql .= "WHERE ${id_table}.id=$new_id AND r.id=${id_table}.room_id AND a.id=r.area_id";
+            $res = sql_query($sql);
+            (! $res) ? fatal_error(0, sql_error()) : '';
+            $row = sql_row($res, 0);
+            if ( !empty($recipients) && (NULL != $row[0]) )
+            {
+                $recipients .= ',';
+            }
+            if (NULL != $row[0])
+            {
+                $recipients .= $row[0];
+            }
+        }
+        else
+        // if this is an edited entry, we already have area_admin_email,
+        // avoiding a database hit.
+        {
+           if ( !empty($recipients) && ('' != $mail_previous['area_admin_email']) )
+           {
+               $recipients .= ',';
+           }
+           if ('' != $mail_previous['area_admin_email'])
+           {
+               $recipients .= $mail_previous['area_admin_email'];
+           }
+        }
+    }
+    if (MAIL_ROOM_ADMIN_ON_BOOKINGS)
+    {
+        // Look for list of room admins emails addresses
+        if ($new_entry)
+        {
+            $sql = "SELECT r.room_admin_email ";
+            $sql .= "FROM $tbl_room r, $tbl_entry e ";
+            // If this is a repeating entry...
+            if ($id_table == 'rep')
+            {
+                // ...use the repeat table
+                $sql .= ", $tbl_repeat rep ";
+            }
+            $sql .= "WHERE ${id_table}.id=$new_id AND r.id=${id_table}.room_id";
+            $res = sql_query($sql);
+            (! $res) ? fatal_error(0, sql_error()) : '';
+            $row = sql_row($res, 0);
+            if ( !empty($recipients) && (NULL != $row[0]) )
+            {
+                $recipients .= ',';
+            }
+            if (NULL != $row[0])
+            {
+                $recipients .= $row[0];
+            }
+        }
+        else
+        // if this is an edited entry, we already have room_admin_email,
+        // avoiding a database hit.
+        {
+           if ( !empty($recipients) && ('' != $mail_previous['room_admin_email']) )
+           {
+               $recipients .= ',';
+           }
+           if ('' != $mail_previous['room_admin_email'])
+           {
+               $recipients .= $mail_previous['room_admin_email'];
+           }
+        }
+    }
+    if (MAIL_BOOKER)
+    {
+        if ('db' == $auth['type'])
+        {
+            /* It would be possible to move this query within the query in
+               getPreviousEntryData to have all in one central place and to
+               reduce database hits by one. However this is a bad idea. If a
+               user is deleted from your user database, this will prevent all
+               mails to admins when this user previously booked entries will
+               be changed, as no user name will match the booker name */
+            $sql = "SELECT email FROM $tbl_users WHERE name='";
+            $sql .= ($new_entry) ? $create_by : $mail_previous['createdby'];
+            $sql .= "'";
+            $res = sql_query($sql);
+            (! $res) ? fatal_error(0, sql_error()) : '';
+            $row = sql_row($res, 0);
+            if ( !empty($recipients) && (NULL != $row[0]) )
+            {
+                $recipients .= ',';
+            }
+            if (NULL != $row[0])
+            {
+                $recipients .= $row[0];
+            }
+        }
+        else
+        {
+            if ($new_entry)
+            {
+                if ( !empty($recipients) && ('' != $create_by) )
+                {
+                    $recipients .= ',';
+                }
+                if ('' != $create_by)
+                {
+                    $recipients .= str_replace(MAIL_USERNAME_SUFFIX, '',
+                        $create_by) . MAIL_DOMAIN;
+                }
+            }
+            else
+            {
+                if ( !empty($recipients) && ('' != $mail_previous['createdby']) )
+                {
+                    $recipients .= ',';
+                }
+                if ('' != $mail_previous['createdby'])
+                {
+                    $recipients .= str_replace(MAIL_USERNAME_SUFFIX, '',
+                        $mail_previous['createdby']) . MAIL_DOMAIN;
+                }
+            }
+        }
+    }
+    // In case $recipients is empty, no need to go further
+    if ('' == $recipients)
+    {
+        return FALSE;
+    }
+    //
+    $subject = $mail_vocab["mail_subject_entry"];
+    if ($new_entry)
+    {
+        $body = $mail_vocab["mail_body_new_entry"] . "\n\n";
+    }
+    else
+    {
+        $body = $mail_vocab["mail_body_changed_entry"] . "\n\n";
+    }
+    // Set the link to view entry page
+    if (isset($url_base) && ($url_base != ""))
+    {
+        $body .= "$url_base/view_entry.php?id=$new_id";
+    }
+    else
+    {
+        ('' != $returl) ? $url = explode(basename($returl), $returl) : '';
+        $body .= $url[0] . "view_entry.php?id=$new_id";
+    }
+    if ($rep_type > 0)
+    {
+        $body .= "&series=1";
+    }
+    $body .= "\n";
+    // Displays/don't displays entry details
+    if (MAIL_DETAILS)
+    {
+        $body .= "\n" . $mail_vocab["namebooker"] . " ";
+        $body .= compareEntries(removeMailUnicode($name),
+            removeMailUnicode($mail_previous['namebooker']), $new_entry)  . "\n";
+        
+        // Description:
+        $body .= $mail_vocab["description"] . " ";
+        $body .= compareEntries(removeMailUnicode($description),
+            removeMailUnicode($mail_previous['description']), $new_entry) . "\n";
+        
+        // Room:
+        $body .= $mail_vocab["room"] . ": " .
+            compareEntries(removeMailUnicode($area_name),
+            removeMailUnicode($mail_previous['area_name']), $new_entry);
+        $body .= " - " . compareEntries(removeMailUnicode($room_name),
+            removeMailUnicode($mail_previous['room_name']), $new_entry) . "\n";
+        
+        // Start time
+        if ( $enable_periods )
+        {
+            list( $start_period, $start_date) =
+                getMailPeriodDateString($starttime);
+            $body .= $mail_vocab["start_date"] . " ";
+            $body .= compareEntries(unHtmlEntities($start_date),
+                unHtmlEntities($mail_previous['start_date']), $new_entry) . "\n";
+        }
+        else
+        {
+            $start_date = getMailTimeDateString($starttime);
+            $body .= $mail_vocab["start_date"] . " " .
+                compareEntries($start_date, $mail_previous['start_date'], $new_entry) . "\n";
+        }
+        
+        // Duration
+        $body .= $mail_vocab["duration"] . " " .
+            compareEntries($duration, $mail_previous['duration'], $new_entry);
+        $body .= " " . compareEntries($mail_vocab["$dur_units"],
+            $mail_previous['dur_units'], $new_entry) . "\n";
+        
+        // End time
+        if ( $enable_periods )
+        {
+            $myendtime = $endtime;
+            $mod_time = -1;
+            list($end_period, $end_date) =  getMailPeriodDateString($myendtime, $mod_time);
+            $body .= $mail_vocab["end_date"] . " ";
+            $body .= compareEntries(unHtmlEntities($end_date),
+                unHtmlEntities($mail_previous['end_date']), $new_entry) ."\n";
+        }
+        else
+        {
+            $myendtime = $endtime;
+            $end_date = getMailTimeDateString($myendtime);
+            $body .= $mail_vocab["end_date"] . " " .
+                compareEntries($end_date, $mail_previous['end_date'], $new_entry) . "\n";
+        }
+        
+        // Type of booking
+        $body .= $mail_vocab["type"] . " ";
+        if ($new_entry)
+        {
+            $body .= $typel[$type];
+        }
+        else
+        {
+            $temp = $mail_previous['type'];
+            $body .= compareEntries($typel[$type], $typel[$temp], $new_entry);
+        }
+        
+        // Created by
+        $body .= "\n" . $mail_vocab["createdby"] . " " .
+            compareEntries($create_by, $mail_previous['createdby'], $new_entry) . "\n";
+        
+        // Last updated
+        $body .= $mail_vocab["lastupdate"] . " " .
+            compareEntries(getMailTimeDateString(time()), $mail_previous['updated'], $new_entry);
+        
+        // Repeat Type
+        $body .= "\n" . $mail_vocab["rep_type"];
+        if ($new_entry)
+        {
+            $body .= " " . $mail_vocab["rep_type_$rep_type"];
+        }
+        else
+        {
+            $temp = $mail_previous['rep_type'];
+            $body .=  " " . compareEntries($mail_vocab["rep_type_$rep_type"],
+                $mail_vocab["rep_type_$temp"], $new_entry);
+        }
+        
+        // Details if a series
+        if ($rep_type > 0)
+        {
+	    $opt = "";
+	    if (($rep_type == 2) || ($rep_type == 6))
+	    {
+		# Display day names according to language and preferred weekday start.
+		for ($i = 0; $i < 7; $i++)
+		{
+			$daynum = ($i + $weekstarts) % 7;
+			if ($rep_opt[$daynum]) $opt .= day_name($daynum) . " ";
+		}
+	    }
+	    if ($rep_type == 6)
+	    {
+		$body .= "\n" . $mail_vocab["rep_num_weeks"];
+		$body .=  ": " . compareEntries($rep_num_weeks, $mail_previous["rep_num_weeks"], $new_entry);
+	    }
+	
+	    if($opt || $mail_previous["rep_opt"])
+	    {
+		$body .= "\n" . $mail_vocab["rep_rep_day"];
+		$body .=  " " . compareEntries($opt, $mail_previous["rep_opt"], $new_entry);
+	    }
+
+            $body .= "\n" . $mail_vocab["rep_end_date"];
+            if ($new_entry)
+            {
+                $body .= " " . utf8_strftime('%A %d %B %Y',$rep_enddate);
+            }
+            else
+            {
+                $temp = utf8_strftime('%A %d %B %Y',$rep_enddate);
+                $body .=  " " . 
+                    compareEntries($temp, $mail_previous['rep_end_date'], $new_entry) . "\n";
+            }
+        }
+	$body .= "\n";
+    }
+    $result = sendMail($recipients, $subject, $body, $mail_vocab['charset'] ,MAIL_CC);
+    return $result;
+}
+
+// }}}
+// {{{ notifyAdminOnDelete()
+
+/**
+ * Send email to administrator to notify a new/changed entry.
+ *
+ * @param   array   $mail_previous  contains deleted entry data forr email body
+ * @return  bool    TRUE or PEAR error object if fails
+ */
+function notifyAdminOnDelete($mail_previous)
+{
+    global $mail_vocab, $typel, $enable_periods, $auth, $tbl_users;
+    //
+    $recipients = '';
+    (MAIL_ADMIN_ON_BOOKINGS) ? $recipients = MAIL_RECIPIENTS : '';
+    if (MAIL_AREA_ADMIN_ON_BOOKINGS)
+    {
+        if ( !empty($recipients) && ('' != $mail_previous['area_admin_email']) )
+        {
+            $recipients .= ',';
+        }
+        if ('' != $mail_previous['area_admin_email'])
+        {
+            $recipients .= $mail_previous['area_admin_email'];
+        }
+    }
+    if (MAIL_ROOM_ADMIN_ON_BOOKINGS)
+    {
+        if ( !empty($recipients) && ('' != $mail_previous['room_admin_email']) )
+        {
+            $recipients .= ',';
+        }
+        if ('' != $mail_previous['room_admin_email'])
+        {
+            $recipients .= $mail_previous['room_admin_email'];
+        }
+    }
+    if (MAIL_BOOKER)
+    {
+        if ('db' == $auth['type'])
+        {
+            /* It would be possible to move this query within the query in
+               getPreviousEntryData to have all in one central place and to
+               reduce database hits by one. However this is a bad idea. If a
+               user is deleted from your user database, this will prevent all
+               mails to admins when this user previously booked entries will
+               be changed, as no user name will match the booker name */
+            $sql = "SELECT email
+                    FROM $tbl_users
+                    WHERE name='" . $mail_previous['createdby'] . "'";
+            $res = sql_query($sql);
+            (! $res) ? fatal_error(0, sql_error()) : '';
+            $row = sql_row($res, 0);
+            if ( !empty($recipients) && (NULL != $row[0]) )
+            {
+                $recipients .= ',';
+            }
+            if (NULL != $row[0])
+            {
+                $recipients .= $row[0];
+            }
+        }
+        else
+        {
+            if ( !empty($recipients) && ('' != $mail_previous['createdby']) )
+            {
+                $recipients .= ',';
+            }
+            if ('' != $mail_previous['createdby'])
+            {
+                $recipients .= str_replace(MAIL_USERNAME_SUFFIX, '',
+                    $mail_previous['createdby']) . MAIL_DOMAIN;
+            }
+        }
+    }
+    // In case mail is allowed but someone forgot to supply email addresses...
+    if ('' == $recipients)
+    {
+        return FALSE;
+    }
+    //
+    $subject = $mail_vocab["mail_subject_delete"];
+    $body = $mail_vocab["mail_body_del_entry"] . "\n\n";
+    // Displays deleted entry details
+    $body .= "\n" . $mail_vocab["namebooker"] . ' ';
+    $body .= removeMailUnicode($mail_previous['namebooker']) . "\n";
+    $body .= $mail_vocab["description"] . " ";
+    $body .= removeMailUnicode($mail_previous['description']) . "\n";
+    $body .= $mail_vocab["room"] . ": ";
+    $body .= removeMailUnicode($mail_previous['area_name']);
+    $body .= " - " . removeMailUnicode($mail_previous['room_name']) . "\n";
+    $body .= $mail_vocab["start_date"] . ' ';
+    if ( $enable_periods )
+    {
+        $body .= unHtmlEntities($mail_previous['start_date']) . "\n";
+    }
+    else
+    {
+        $body .= $mail_previous['start_date'] . "\n";
+    }
+    $body .= $mail_vocab["duration"] . ' ' . $mail_previous['duration'] . ' ';
+    $body .= $mail_previous['dur_units'] . "\n";
+    if ( $enable_periods )
+    {
+        $body .= $mail_vocab["end_date"] . " ";
+        $body .= unHtmlEntities($mail_previous['end_date']) ."\n";
+    }
+    else
+    {
+        $body .= $mail_vocab["end_date"] . " " . $mail_previous['end_date'];
+        $body .= "\n";
+    }
+    $body .= $mail_vocab["type"] . " ";
+    $body .=  (empty($typel[$mail_previous['type']])) ? "?" .
+        $mail_previous['type'] . "?" : $typel[$mail_previous['type']];
+    $body .= "\n" . $mail_vocab["createdby"] . " ";
+    $body .= $mail_previous['createdby'] . "\n";
+    $body .= $mail_vocab["lastupdate"] . " " . $mail_previous['updated'];
+    $body .= "\n" . $mail_vocab["rep_type"];
+    $temp = $mail_previous['rep_type'];
+    $body .=  " " . $mail_vocab["rep_type_$temp"];
+    if ($mail_previous['rep_type'] > 0)
+    {
+        if ($mail_previous['rep_type'] == 6)
+        {
+           $body .= "\n" . $mail_vocab["rep_num_weeks"];
+           $body .=  ": " . $mail_previous["rep_num_weeks"];
+        }
+   
+        if($mail_previous["rep_opt"])
+        {
+           $body .= "\n" . $mail_vocab["rep_rep_day"];
+           $body .=  " " . $mail_previous["rep_opt"];
+        }
+
+        $body .= "\n" . $mail_vocab["rep_end_date"];
+        $body .=  " " . $mail_previous['rep_end_date'] . "\n";
+    }
+    $body .= "\n";
+    // End of mail details
+    $result = sendMail($recipients, $subject, $body, $mail_vocab['charset'], MAIL_CC);
+    return $result;
+}
+
+// }}}
+// {{{ getPreviousEntryData()
+
+/**
+ * Gather all fields values for an entry. Used for emails to get previous
+ * entry state.
+ *
+ * @param int     $id       entry id to get data
+ * @param int     $series   1 if this is a serie or 0
+ * @return bool             TRUE or PEAR error object if fails
+ */
+function getPreviousEntryData($id, $series)
+{
+    global $tbl_area, $tbl_entry, $tbl_repeat, $tbl_room, $enable_periods;
+    //
+    $sql = "
+    SELECT  e.name,
+            e.description,
+            e.create_by,
+            r.room_name,
+            a.area_name,
+            e.type,
+            e.room_id,
+            e.repeat_id, " .
+            sql_syntax_timestamp_to_unix("e.timestamp") . ",
+            (e.end_time - e.start_time) AS tbl_e_duration,
+            e.start_time AS tbl_e_start_time,
+            e.end_time AS tbl_e_end_time,
+            a.area_admin_email,
+            r.room_admin_email";
+    // Here we could just use $tbl_repeat.start_time, and not use alias,
+    // as the last column will take precedence using mysql_fetch_array,
+    // but for portability purpose I will not use it.
+    if (1 == $series)
+    {
+        $sql .= ", re.rep_type, re.rep_opt, re.rep_num_weeks,
+            (re.end_time - re.start_time) AS tbl_r_duration,
+            re.start_time AS tbl_r_start_time,
+            re.end_time AS tbl_r_end_time,
+            re.end_date AS tbl_r_end_date";
+    }
+    $sql .= "
+    FROM $tbl_entry e, $tbl_room r, $tbl_area a ";
+    (1 == $series) ? $sql .= ', ' . $tbl_repeat . ' re ' : '';
+    $sql .= "
+    WHERE e.room_id = r.id
+    AND r.area_id = a.id
+    AND e.id=$id";
+    (1 == $series) ? $sql .= " AND e.repeat_id = re.id" : '';
+    //
+    $res = sql_query($sql);
+    (! $res) ? fatal_error(0, sql_error()) : '';
+    (sql_count($res) < 1) ? fatal_error(0, get_string('invalid_entry_id','block_mrbs')) : '';
+    $row = sql_row_keyed($res, 0);
+    sql_free($res);
+    // Store all needed values in $mail_previous array to pass to
+    // notifyAdminOnDelete function (shorter than individual variables -:) )
+    $mail_previous['namebooker']    = $row['name'];
+    $mail_previous['description']   = $row['description'];
+    $mail_previous['createdby']     = $row['create_by'];
+    $mail_previous['room_name']     = $row['room_name'];
+    $mail_previous['area_name']     = $row['area_name'];
+    $mail_previous['type']          = $row['type'];
+    $mail_previous['room_id']       = $row['room_id'];
+    $mail_previous['repeat_id']     = $row['repeat_id'];
+    $mail_previous['updated']       = getMailTimeDateString($row[8]);
+    $mail_previous['area_admin_email'] = $row['area_admin_email'];
+    $mail_previous['room_admin_email'] = $row['room_admin_email'];
+    // If we use periods
+    if ( $enable_periods )
+    {
+        // If we delete a serie, start_time and end_time must
+        // come from $tbl_repeat, not $tbl_entry.
+        //
+        // This is not a serie
+        if (1 != $series)
+        {
+            list( $mail_previous['start_period'], $mail_previous['start_date'])
+                =  getMailPeriodDateString($row['tbl_e_start_time']);
+            list( $mail_previous['end_period'] , $mail_previous['end_date']) =
+                getMailPeriodDateString($row['tbl_e_end_time'], -1);
+            // need to make DST correct in opposite direction to entry creation
+            // so that user see what he expects to see
+            $mail_previous['duration'] = $row['tbl_e_duration'] -
+                cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
+        }
+        // This is a serie
+        else
+        {
+            list( $mail_previous['start_period'], $mail_previous['start_date'])
+                =  getMailPeriodDateString($row['tbl_r_start_time']);
+            list( $mail_previous['end_period'] , $mail_previous['end_date']) =
+                getMailPeriodDateString($row['tbl_r_end_time'], 0);
+            // use getMailTimeDateString as all I want is the date
+	    $mail_previous['rep_end_date'] =
+                getMailTimeDateString($row['tbl_r_end_date'], FALSE);
+            // need to make DST correct in opposite direction to entry creation
+            // so that user see what he expects to see
+            $mail_previous['duration'] = $row['tbl_r_duration'] -
+                cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
+	    
+	    $mail_previous['rep_opt'] = "";
+	    switch($row['rep_type'])
+	    {
+		case 2:
+		case 6:
+			$rep_day[0] = $row['rep_opt'][0] != "0";
+			$rep_day[1] = $row['rep_opt'][1] != "0";
+			$rep_day[2] = $row['rep_opt'][2] != "0";
+			$rep_day[3] = $row['rep_opt'][3] != "0";
+			$rep_day[4] = $row['rep_opt'][4] != "0";
+			$rep_day[5] = $row['rep_opt'][5] != "0";
+			$rep_day[6] = $row['rep_opt'][6] != "0";
+
+			if ($row['rep_type'] == 6)
+			{
+				$mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
+			}
+			else
+			{
+				$mail_previous['rep_num_weeks'] = "";
+			}
+			
+			break;
+		
+		default:
+			$rep_day = array(0, 0, 0, 0, 0, 0, 0);
+	    }
+	    for ($i = 0; $i < 7; $i++)
+	    {
+		$wday = ($i + $weekstarts) % 7;
+		if ($rep_day[$wday])
+		    $mail_previous['rep_opt'] .= day_name($wday) . " ";
+	    }
+	    
+	    $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
+        }
+        toPeriodString($mail_previous['start_period'],
+            $mail_previous['duration'], $mail_previous['dur_units']);
+    }
+    // If we don't use periods
+    else
+    {
+        // This is not a serie
+        if (1 != $series)
+        {
+            $mail_previous['start_date'] =
+                getMailTimeDateString($row['tbl_e_start_time']);
+            $mail_previous['end_date'] =
+                getMailTimeDateString($row['tbl_e_end_time']);
+            // need to make DST correct in opposite direction to entry creation
+            // so that user see what he expects to see
+            $mail_previous['duration'] = $row['tbl_e_duration'] -
+                cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
+        }
+        // This is a serie
+        else
+        {
+            $mail_previous['start_date'] =
+                getMailTimeDateString($row['tbl_r_start_time']);
+            $mail_previous['end_date'] =
+                getMailTimeDateString($row['tbl_r_end_time']);
+            // use getMailTimeDateString as all I want is the date
+	    $mail_previous['rep_end_date'] =
+                getMailTimeDateString($row['tbl_r_end_date'], FALSE);
+            // need to make DST correct in opposite direction to entry creation
+            // so that user see what he expects to see
+            $mail_previous['duration'] = $row['tbl_r_duration'] -
+                cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
+            
+	    $mail_previous['rep_opt'] = "";
+	    switch($row['rep_type'])
+	    {
+		case 2:
+		case 6:
+			$rep_day[0] = $row['rep_opt'][0] != "0";
+			$rep_day[1] = $row['rep_opt'][1] != "0";
+			$rep_day[2] = $row['rep_opt'][2] != "0";
+			$rep_day[3] = $row['rep_opt'][3] != "0";
+			$rep_day[4] = $row['rep_opt'][4] != "0";
+			$rep_day[5] = $row['rep_opt'][5] != "0";
+			$rep_day[6] = $row['rep_opt'][6] != "0";
+
+			if ($row['rep_type'] == 6)
+			{
+				$mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
+			}
+			else
+			{
+				$mail_previous['rep_num_weeks'] = "";
+			}
+			
+			break;
+		
+		default:
+			$rep_day = array(0, 0, 0, 0, 0, 0, 0);
+	    }
+	    for ($i = 0; $i < 7; $i++)
+	    {
+		$wday = ($i + $weekstarts) % 7;
+		if ($rep_day[$wday])
+		    $mail_previous['rep_opt'] .= day_name($wday) . " ";
+	    }
+	    
+	    $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
+        }
+        toTimeString($mail_previous['duration'], $mail_previous['dur_units']);
+    }
+    (1 == $series) ? $mail_previous['rep_type'] = $row['rep_type']
+        : $mail_previous['rep_type'] = 0;
+    // return entry previous data as an array
+    return $mail_previous;
+}
+
+// }}}
+// {{{ compareEntries()
+
+/**
+ * Compare entries fields to show in emails.
+ *
+ * @param string  $new_value       new field value
+ * @param string  $previous_value  previous field value
+ * @return string                  new value if no difference, new value and
+ *                                 previous value in brackets otherwise
+ */
+function compareEntries($new_value, $previous_value, $new_entry)
+{
+    $suffix = "";
+    if ($new_entry)
+    {
+        return $new_value;
+    }
+    if ($new_value != $previous_value)
+    {
+        $suffix = " ($previous_value)";
+    }
+    return($new_value . $suffix);
+}
+
+// }}}
+// {{{ sendMail()
+
+/**
+ * Send emails using PEAR::Mail class.
+ * How to use this class -> http://www.pear.php.net/package/Mail then link
+ * "View documentation".
+ * Currently implemented version: Mail 1.1.3 and its dependancies
+ * Net_SMTP 1.2.6 and Net_Socket 1.0.2
+ *
+ * @param string  $recipients       comma separated list of recipients or array
+ * @param string  $subject          email subject
+ * @param string  $body             text message
+ * @param string  $charset          character set used in body
+ * @param string  $cc               Carbon Copy
+ * @param string  $bcc              Blind Carbon Copy
+ * @param string  $from             from field
+ * @param string  $backend          'mail', 'smtp' or 'sendmail'
+ * @param string  $sendmail_path    ie. "/usr/bin/sendmail"
+ * @param string  $sendmail_args    ie. "-t -i"
+ * @param string  $host             smtp server hostname
+ * @param string  $port             smtp server port
+ * @param string  $auth             smtp server authentication, TRUE/FALSE
+ * @param string  $username         smtp server username
+ * @param string  $password         smtp server password
+ * @return bool                     TRUE or PEAR error object if fails
+ */
+function sendMail($recipients, $subject, $body, $charset = 'us-ascii',
+    $cc = NULL, $bcc = NULL, $from = MAIL_FROM, $backend = MAIL_ADMIN_BACKEND,
+    $sendmail_path = SENDMAIL_PATH, $sendmail_args = SENDMAIL_ARGS,
+    $host = SMTP_HOST, $port = SMTP_PORT, $auth = SMTP_AUTH,
+    $username = SMTP_USERNAME, $password = SMTP_PASSWORD)
+{
+    require_once "Mail.php";
+
+    // Headers part
+    $headers['From']         = $from;
+    if( $backend != 'mail' ) {
+        $headers['To']           = $recipients;
+    }
+    (NULL != $cc) ? $headers['Cc'] = $cc : '';
+    (NULL != $bcc) ? $headers['Bcc'] = $bcc : '';
+    $headers['Subject']      = $subject;
+    $headers['MIME-Version'] = '1.0';
+    $headers['Content-Type'] = 'text/plain; charset=' . $charset;
+
+    // Parameters part
+    if( $backend == 'sendmail' ) {
+        $params['sendmail_path'] = $sendmail_path;
+        $params['sendmail_args'] = $sendmail_args;
+    }
+    if( $backend == "smtp" ) {
+        $params['host']          = $host;
+        $params['port']          = $port;
+        $params['auth']          = $auth;
+        $params['username']      = $username;
+        $params['password']      = $password;
+    }
+
+    // Call to the PEAR::Mail class
+    $mail_object =& Mail::factory($backend, $params);
+    $result = $mail_object->send($recipients, $headers, $body);
+
+    if (is_object($result))
+    {
+      error_log("Error sending email: ".$result->getMessage());
+    }
+    return $result;
+}
+
+// }}}
+// {{{ unHtmlEntities()
+
+/**
+ * Convert all HTML entities to their applicable characters.
+ * Added to remove HTML entities that are not suitable for plain text emails.
+ * May be replaced by PHP function 'html_entity_decode()' but this function
+ * only exist since PHP 4.3.0 and is buggy before PHP5.
+ *
+ * @param  string   $string     string to decode
+ * @return string               decoded string
+ */
+function unHtmlEntities($string)
+{
+    $trans_tbl = get_html_translation_table(HTML_ENTITIES);
+    $trans_tbl = array_flip($trans_tbl);
+    return strtr($string, $trans_tbl);
+}
+
+// }}}
+?>
Index: web/auth_config.php
===================================================================
RCS file: web/auth_config.php
diff -N web/auth_config.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_config.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,84 @@
+<?php 
+require_once("../../../config.php");
+
+/*****************************************************************************\
+*									      *
+*   File name       auth_config.php					      *
+*									      *
+*   Description	    Authenticate users from a list in config.inc.php.         *
+*									      *
+*   Notes	    To use this authentication scheme, set in config.inc.php: *
+*			$auth["type"]  = "config";			      *
+*									      *
+*		    Then for each user, add an entry formatted as:	      *
+*			$auth["user"]["username"] == "userpassword";          *
+*									      *
+*   History								      *
+*    2003/11/09 JFL Created this file					      *
+*									      *
+\*****************************************************************************/
+
+// $Id: auth_config.php,v 1.1 2007/04/05 22:25:24 arborrow Exp $
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+
+function authValidateUser($user, $pass)
+{
+   global $auth;
+
+   // Check if we do not have a username/password
+   if(!isset($user) || !isset($pass) || strlen($pass)==0)
+   {
+      return 0;
+   }
+
+   if ((isset($auth["user"][$user])
+        && ($auth["user"][$user] == $pass)
+       ) ||
+       (isset($auth["user"][strtolower($user)])
+        && ($auth["user"][strtolower($user)] == $pass)
+       ))
+   {
+      return 1; // User validated
+   }
+
+   return 0;		// User unknown or password invalid
+}
+
+/* authGetUserLevel($user)
+ * 
+ * Determines the users access level
+ * 
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+   // User not logged in, user level '0'
+   if(!isset($user))
+      return 0;
+
+   // Check if the user is can modify
+   for($i = 0; isset($lev1_admin[$i]); $i++)
+   {
+      if(strcasecmp($user, $lev1_admin[$i]) == 0)
+	 return 2;
+   }
+
+   // Everybody else is access level '1'
+   return 1;
+}
+
+?>
Index: web/mysql.php
===================================================================
RCS file: web/mysql.php
diff -N web/mysql.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/mysql.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,234 @@
+<?php
+// $Id: mysql.php,v 1.4 2008/08/01 04:02:10 arborrow Exp $
+
+// mysql.php - Simple PHP database support for MySQL.
+// Include this file after defining the following variables:
+//   $db_host = The hostname of the database server
+//   $db_login = The username to use when connecting to the database
+//   $db_password = The database account password
+//   $db_database = The database name.
+// Including this file connects you to the database, or exits on error.
+require_once("../../../config.php"); //for Moodle integration
+
+// Free a results handle. You need not call this if you call sql_row or
+// sql_row_keyed until the row returns 0, since sql_row frees the results
+// handle when you finish reading the rows.
+function sql_free ($r)
+{
+	mysql_free_result($r);
+}
+
+// Execute a non-SELECT SQL command (insert/update/delete).
+// Returns the number of tuples affected if OK (a number >= 0).
+// Returns -1 on error; use sql_error to get the error message.
+function sql_command ($sql)
+{
+	if (mysql_query($sql)) return mysql_affected_rows();
+	return -1;
+}
+
+// Execute an SQL query which should return a single non-negative number value.
+// This is a lightweight alternative to sql_query, good for use with count(*)
+// and similar queries. It returns -1 on error or if the query did not return
+// exactly one value, so error checking is somewhat limited.
+// It also returns -1 if the query returns a single NULL value, such as from
+// a MIN or MAX aggregate function applied over no rows.
+function sql_query1 ($sql)
+{
+	$r = mysql_query($sql);
+	if (! $r) return -1;
+	if (mysql_num_rows($r) != 1 || mysql_num_fields($r) != 1
+		|| ($result = mysql_result($r, 0, 0)) == "") $result = -1;
+	mysql_free_result($r);
+	return $result;
+}
+
+// Execute an SQL query. Returns a database-dependent result handle,
+// which should be passed back to sql_row or sql_row_keyed to get the results.
+// Returns 0 on error; use sql_error to get the error message.
+function sql_query ($sql)
+{
+	$r = mysql_query($sql);
+	return $r;
+}
+
+// Return a row from a result. The first row is 0.
+// The row is returned as an array with index 0=first column, etc.
+// When called with i >= number of rows in the result, cleans up from
+// the query and returns 0.
+// Typical usage: $i = 0; while ((a = sql_row($r, $i++))) { ... }
+function sql_row ($r, $i)
+{
+	if ($i >= mysql_num_rows($r))
+	{
+		mysql_free_result($r);
+		return 0;
+	}
+	mysql_data_seek($r, $i);
+	return mysql_fetch_row($r);
+}
+
+// Return a row from a result as an associative array keyed by field name.
+// The first row is 0.
+// This is actually upward compatible with sql_row since the underlying
+// routing also stores the data under number indexes.
+// When called with i >= number of rows in the result, cleans up from
+// the query and returns 0.
+function sql_row_keyed ($r, $i)
+{
+	if ($i >= mysql_num_rows($r))
+	{
+		mysql_free_result($r);
+		return 0;
+	}
+	mysql_data_seek($r, $i);
+	return mysql_fetch_array($r);
+}
+
+// Return the number of rows returned by a result handle from sql_query.
+function sql_count ($r)
+{
+	return mysql_num_rows($r);
+}
+
+// Return the value of an autoincrement field from the last insert.
+// Must be called right after an insert on that table!
+function sql_insert_id($table, $field)
+{
+	return mysql_insert_id();
+}
+
+// Return the text of the last error message.
+function sql_error()
+{
+	return mysql_error();
+}
+
+// Begin a transaction, if the database supports it. This is used to
+// improve PostgreSQL performance for multiple insert/delete/updates.
+// There is no rollback support, since MySQL doesn't support it.
+function sql_begin()
+{
+}
+
+// Commit (end) a transaction. See sql_begin().
+function sql_commit()
+{
+}
+
+// Acquire a mutual-exclusion lock on the named table. For portability:
+// This will not lock out SELECTs.
+// It may lock out DELETE/UPDATE/INSERT or not, depending on the implementation.
+// It will lock out other callers of this routine with the same name argument.
+// It may timeout in 20 seconds and return 0, or may wait forever.
+// It returns 1 when the lock has been acquired.
+// Caller must release the lock with sql_mutex_unlock().
+// Caller must not have more than one mutex at any time.
+// Do not mix this with sql_begin()/sql_end() calls.
+//
+// In MySQL, we avoid table locks, and use low-level locks instead.
+function sql_mutex_lock($name)
+{
+	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
+	if (!sql_query1("SELECT GET_LOCK('$name', 20)")) return 0;
+	$sql_mutex_unlock_name = $name;
+	if (empty($sql_mutex_shutdown_registered))
+	{
+		register_shutdown_function("sql_mutex_cleanup");
+		$sql_mutex_shutdown_registered = 1;
+	}
+	return 1;
+}
+
+// Release a mutual-exclusion lock on the named table. See sql_mutex_unlock.
+function sql_mutex_unlock($name)
+{
+	global $sql_mutex_unlock_name;
+	sql_query1("SELECT RELEASE_LOCK('$name')");
+	$sql_mutex_unlock_name = "";
+}
+
+// Shutdown function to clean up a forgotten lock. For internal use only.
+function sql_mutex_cleanup()
+{
+	global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
+	if (!empty($sql_mutex_unlock_name))
+	{
+		sql_mutex_unlock($sql_mutex_unlock_name);
+		$sql_mutex_unlock_name = "";
+	}
+}
+
+
+// Return a string identifying the database version:
+function sql_version()
+{
+	$r = sql_query("select version()");
+	$v = sql_row($r, 0);
+	sql_free($r);
+	return "MySQL $v[0]";
+}
+
+
+// Generate non-standard SQL for LIMIT clauses:
+function sql_syntax_limit($count, $offset)
+{
+	return " LIMIT $offset,$count ";
+}
+
+// Generate non-standard SQL to output a TIMESTAMP as a Unix-time:
+function sql_syntax_timestamp_to_unix($fieldname)
+{
+	return " UNIX_TIMESTAMP($fieldname) ";
+}
+
+// Generate non-standard SQL to match a string anywhere in a field's value
+// in a case insensitive manner. $s is the un-escaped/un-slashed string.
+// In MySQL, REGEXP seems to be case sensitive, so use LIKE instead. But this
+// requires quoting of % and _ in addition to the usual.
+function sql_syntax_caseless_contains($fieldname, $s)
+{
+	$s = str_replace("\\", "\\\\", $s);
+	$s = str_replace("%", "\\%", $s);
+	$s = str_replace("_", "\\_", $s);
+	$s = str_replace("'", "''", $s);
+	return " $fieldname LIKE '%$s%' ";
+}
+
+// Returns the name of a field.
+function sql_field_name($result, $index)
+{
+	return mysql_field_name($result, $index);
+}
+
+// Returns the type of a field. (one of "int", "real", "string", "blob", etc...)
+function sql_field_type($result, $index)
+{
+	return mysql_field_type($result, $index);
+}
+
+// Returns the number of fields in a result.
+function sql_num_fields($result)
+{
+	return mysql_num_fields($result);
+}
+
+
+
+// Establish a database connection.
+// On connection error, the message will be output without a proper HTML
+// header. There is no way I can see around this; if track_errors isn't on
+// there seems to be no way to supress the automatic error message output and
+// still be able to access the error text.
+if (empty($db_nopersist))
+	$db_c = mysql_pconnect($db_host, $db_login, $db_password);
+else
+	$db_c = mysql_connect($db_host, $db_login, $db_password);
+
+if (!$db_c || !mysql_select_db ($db_database))
+{
+	echo "\n<p>\n" . get_string('failed_connect_db','block_mrbs') . "\n";
+	exit;
+}
+
+?>
Index: web/session_nt.php
===================================================================
RCS file: web/session_nt.php
diff -N web/session_nt.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_nt.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,37 @@
+<?php
+
+/* $Id: session_nt.php,v 1.1 2007/04/05 22:25:33 arborrow Exp $
+ *
+ * Session management scheme that uses Windows NT domain users and Internet 
+ * Information Server as the source for user authentication.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ *      $auth["type"]    = "none";
+ *      $auth["session"] = "nt";
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "nt_username1";
+ * $auth["admin"][] = "nt_username2";
+ *
+ * See AUTHENTICATION  for more informations.
+ */
+require_once("../../../config.php"); //for Moodle integration
+/** 
+ * Request that the username/password be given.
+ *
+ * For this scheme no need to prompt for a name - NT User always there.
+ */
+function authGet() { }
+
+function getUserName()
+{
+	global $AUTH_USER;
+	$AUTH_USER = get_current_user();  
+	return $AUTH_USER;
+
+}
+
+?>
Index: web/session_host.php
===================================================================
RCS file: web/session_host.php
diff -N web/session_host.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_host.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,33 @@
+<?php
+
+/* $Id: session_host.php,v 1.1 2007/04/05 22:25:33 arborrow Exp $
+ *
+ * This is a slight variant of session_ip. 
+ * Session management scheme that uses the DNS name of the computer
+ * to identify users and administrators.
+ * Anyone who can access the server can make bookings etc.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ * $auth["type"]    = "none";
+ * $auth["session"] = "host";
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "DNSname1";
+ * $auth["admin"][] = "DNSname2";
+ */
+require_once("../../../config.php"); //for Moodle integration
+# No need to prompt for a name - if no DNSname is returned, ip address
+# is used
+function authGet() { }
+
+function getUserName()
+{
+	global $REMOTE_ADDR;
+	$remotehostname = gethostbyaddr($REMOTE_ADDR);
+        return $remotehostname;
+}
+
+?>
Index: web/lang.cz.php
===================================================================
RCS file: web/lang.cz.php
diff -N web/lang.cz.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.cz.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.cz.php,v 1.1 2007/04/05 22:25:31 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Czech file.
+#
+# Translations provided by: "SmEjDiL" <malyl@col.cz>, 
+#   "David Krotil" <David.Krotil@mu-sokolov.cz>
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-2";
+
+# Used in style.php
+$vocab["mrbs"]               = "MRBS - Rezerva�n� syst�m";
+
+# Used in functions.php
+$vocab["report"]             = "V�pis";
+$vocab["admin"]              = "Administr�tor";
+$vocab["help"]               = "Pomoc";
+$vocab["search"]             = "Hledat:";
+$vocab["not_php3"]             = "<H1>UPOZORN�N�: Toto z�ejm� nen� funk�n� s PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Objedn�no pro";
+$vocab["bookingsforpost"]    = ""; # Goes after the date
+$vocab["areas"]              = "Oblasti";
+$vocab["daybefore"]          = "Den vzad";
+$vocab["dayafter"]           = "Den vp�ed";
+$vocab["gototoday"]          = "Dnes";
+$vocab["goto"]               = "P�ej�t na";
+$vocab["highlight_line"]     = "Ozna�te tuto ��dku";
+$vocab["click_to_reserve"]   = "Klepn�te na bu�ku, aby jste provedli rezervaci.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Dny";
+$vocab["viewweek"]           = "T�dny";
+$vocab["viewmonth"]          = "M�s�ce ";
+$vocab["ppreview"]           = "Pro tisk";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "P�idat z�znam";
+$vocab["editentry"]          = "Editovat z�znam";
+$vocab["editseries"]         = "Editovat s�rii";
+$vocab["namebooker"]         = "Popis instrukce:";
+$vocab["fulldescription"]    = "Celkov� popis:<br>&nbsp;&nbsp;(Po�et cestuj�c�ch,<br>&nbsp;&nbsp;Obsazeno/Voln� m�sta atd)";
+$vocab["date"]               = "Datum:";
+$vocab["start_date"]         = "Za��tek:";
+$vocab["end_date"]           = "Konec:";
+$vocab["time"]               = "�as:";
+$vocab["period"]             = "Perioda:";
+$vocab["duration"]           = "Doba trv�n�:";
+$vocab["seconds"]            = "sekundy";
+$vocab["minutes"]            = "minuty";
+$vocab["hours"]              = "hodiny";
+$vocab["days"]               = "dny";
+$vocab["weeks"]              = "v�kendy";
+$vocab["years"]              = "roky";
+$vocab["periods"]            = "period";
+$vocab["all_day"]            = "V�echny dny";
+$vocab["type"]               = "Typ:";
+$vocab["internal"]           = "Voln� m�sta";
+$vocab["external"]           = "Obsazeno";
+$vocab["save"]               = "Ulo�it";
+$vocab["rep_type"]           = "Typ opakov�n�:";
+$vocab["rep_type_0"]         = "Nikdy";
+$vocab["rep_type_1"]         = "Denn�";
+$vocab["rep_type_2"]         = "T�dn�";
+$vocab["rep_type_3"]         = "M�s��n�";
+$vocab["rep_type_4"]         = "Ro�n�";
+$vocab["rep_type_5"]         = "M�s��n�, jednou za m�s�c";
+$vocab["rep_type_6"]         = "n-t�dn�";
+$vocab["rep_end_date"]       = "Konec opakov�n�:";
+$vocab["rep_rep_day"]        = "Opakovat v den:";
+$vocab["rep_for_weekly"]     = "(pro (n-)t�dn�)";
+$vocab["rep_freq"]           = "Frekvence:";
+$vocab["rep_num_weeks"]      = "�islo t�dne";
+$vocab["rep_for_nweekly"]    = "(pro n-t�dn�)";
+$vocab["ctrl_click"]         = "U��t CTRL pro v�b�r v�ce m�stnost�";
+$vocab["entryid"]            = "Vstupn� ID ";
+$vocab["repeat_id"]          = "ID pro opakov�n�"; 
+$vocab["you_have_not_entered"] = "Nevlo�il jste";
+$vocab["you_have_not_selected"] = "Nevybral jste";
+$vocab["valid_room"]         = "prost�edek.";
+$vocab["valid_time_of_day"]  = "platn� �asov� �sek dne.";
+$vocab["brief_description"]  = "Kr�tk� popis.";
+$vocab["useful_n-weekly_value"] = "pou�iteln� x-t�denn� hodnota.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Popis:";
+$vocab["room"]               = "M�stnost:";
+$vocab["createdby"]          = "Vytvo�il u�ivatel:";
+$vocab["lastupdate"]         = "Posledn� zm�na:";
+$vocab["deleteentry"]        = "Smazat z�znam";
+$vocab["deleteseries"]       = "Smazat s�rii";
+$vocab["confirmdel"]         = "Jste si jist�\\nsmaz�n�m tohoto z�znamu?\\n\\n";
+$vocab["returnprev"]         = "N�vrat na p�edchoz� str�nku";
+$vocab["invalid_entry_id"]   = "�patn� ID z�znamu.";
+$vocab["invalid_series_id"]  = "�patn� ID skupiny.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Chyba";
+$vocab["sched_conflict"]     = "Konflikt p�i pl�nov�n�";
+$vocab["conflict"]           = "Nov� rezervace je v konfliktu s jin�m z�znamem:";
+$vocab["too_may_entrys"]     = "Vybran� volba byla vytvo�ena pro jin� z�znamy.<BR>Pros�m vyberte jinou volbu!";
+$vocab["returncal"]          = "N�vrat do kalend��e";
+$vocab["failed_to_acquire"]  = "Chyba v�hradn�ho p��stupu do datab�ze"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "P��stup zam�tnut";
+$vocab["norights"]           = "Nem�te p��stupov� pr�vo pro zm�nu t�to polo�ky.";
+$vocab["please_login"]       = "Pros�m, p�ihla�te se";
+$vocab["user_name"]          = "Jm�no";
+$vocab["user_password"]      = "Heslo";
+$vocab["unknown_user"]       = "Nezn�m� u�ivatel";
+$vocab["you_are"]            = "Jste";
+$vocab["login"]              = "P�ihl�sit se";
+$vocab["logoff"]             = "Odhl�sit se";
+
+# Authentication database
+$vocab["user_list"]          = "Seznam u�ivatel�";
+$vocab["edit_user"]          = "Editovat u�ivatele";
+$vocab["delete_user"]        = "Smazat tohoto u�ivatele";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Emailov� adresa";
+$vocab["password_twice"]     = "Pokud chcete zm�nit heslo, pros�m napi�te ho dvakr�t";
+$vocab["passwords_not_eq"]   = "Chyba: Vlo�en� hesla se neshoduj�.";
+$vocab["add_new_user"]       = "P�idat nov�ho u�ivatele";
+$vocab["rights"]             = "Pr�va";
+$vocab["action"]             = "Akce";
+$vocab["user"]               = "U�ivatel";
+$vocab["administrator"]      = "Administr�tor";
+$vocab["unknown"]            = "Nezn�m�";
+$vocab["ok"]                 = "Ano";
+$vocab["show_my_entries"]    = "Klepnout pro zobraz�n� v�ech nadch�zej�c�ch z�znam�";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Pr�zdn� nebo neplatn� hledan� �et�zec.";
+$vocab["search_results"]     = "V�sledek hled�n� pro:";
+$vocab["nothing_found"]      = "Nic nenalezeno";
+$vocab["records"]            = "Z�znam";
+$vocab["through"]            = " skrze ";
+$vocab["of"]                 = " o ";
+$vocab["previous"]           = "P�edchozi";
+$vocab["next"]               = "Dal��";
+$vocab["entry"]              = "Z�znam";
+$vocab["view"]               = "N�hled";
+$vocab["advanced_search"]    = "Roz���en� hled�n�";
+$vocab["search_button"]      = "Hledat";
+$vocab["search_for"]         = "Hledat co";
+$vocab["from"]               = "Od";
+
+# Used in report.php
+$vocab["report_on"]          = "V�pis setk�n�:";
+$vocab["report_start"]       = "V�pis za��tk�:";
+$vocab["report_end"]         = "V�pis konc�:";
+$vocab["match_area"]         = "Hledan� oblast:";
+$vocab["match_room"]         = "Hledan� m�stnost:";
+$vocab["match_type"]         = "Hledan� typ:";
+$vocab["ctrl_click_type"]    = "U��t CTRL pro v�b�r v�ce typ�";
+$vocab["match_entry"]        = "Hledat v popisu:";
+$vocab["match_descr"]        = "Hledat v cel�m popisu:";
+$vocab["include"]            = "Zahrnovat:";
+$vocab["report_only"]        = "Jen v�pis";
+$vocab["summary_only"]       = "Jen p�ehled";
+$vocab["report_and_summary"] = "V�pis a p�ehled";
+$vocab["summarize_by"]       = "P�ehled od:";
+$vocab["sum_by_descrip"]     = "Popis instrukce";
+$vocab["sum_by_creator"]     = "Tv�rce";
+$vocab["entry_found"]        = "nalezeno";
+$vocab["entries_found"]      = "nalezeno";
+$vocab["summary_header"]     = "P�ehled  (z�znamu) hodiny";
+$vocab["summary_header_per"] = "P�ehled  (z�znamu) periody";
+$vocab["total"]              = "Celkem";
+$vocab["submitquery"]        = "Vytvo�it sestavu";
+$vocab["sort_rep"]           = "Se�adit v�pis podle:";
+$vocab["sort_rep_time"]      = "V�choz� den/�as";
+$vocab["rep_dsp"]            = "Zobrazit ve v�pisu:";
+$vocab["rep_dsp_dur"]        = "Trv�n�";
+$vocab["rep_dsp_end"]        = "�as ukon�en�";
+
+# Used in week.php
+$vocab["weekbefore"]         = "T�den dozadu";
+$vocab["weekafter"]          = "T�den dop�edu";
+$vocab["gotothisweek"]       = "Tento t�den";
+
+# Used in month.php
+$vocab["monthbefore"]        = "M�s�c dozadu";
+$vocab["monthafter"]         = "M�sic dop�edu";
+$vocab["gotothismonth"]      = "Tento m�s�c";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Pro tuto m�stnost nen� definov�na �adn� oblast!";
+
+# Used in admin.php
+$vocab["edit"]               = "Editovat";
+$vocab["delete"]             = "Smazat";
+$vocab["rooms"]              = "M�stnosti";
+$vocab["in"]                 = "v";
+$vocab["noareas"]            = "��dn� oblasti";
+$vocab["addarea"]            = "P�idat oblast";
+$vocab["name"]               = "Jm�no";
+$vocab["noarea"]             = "Nen� vybr�na ��dn� oblast";
+$vocab["browserlang"]        = "Prohl�ec je nastaven k pou�it�";
+$vocab["postbrowserlang"]    = "jazyku.";
+$vocab["addroom"]            = "P�idat m�stnost";
+$vocab["capacity"]           = "Kapacita";
+$vocab["norooms"]            = "��dn� m�stnost.";
+$vocab["administration"]     = "Administrace";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Editovat oblast";
+$vocab["change"]             = "Zm�na";
+$vocab["backadmin"]          = "N�vrat do administrace";
+$vocab["editroomarea"]       = "Editovat popis oblasti nebo m�stnosti";
+$vocab["editroom"]           = "Editovat m�stnosti";
+$vocab["update_room_failed"] = "Chyba editace m�stnosti: ";
+$vocab["error_room"]         = "Chyba: m�stnost ";
+$vocab["not_found"]          = " nenalezen";
+$vocab["update_area_failed"] = "Chyba editace oblasti: ";
+$vocab["error_area"]         = "Chyba: oblast ";
+$vocab["room_admin_email"]   = "Email administr�tora m�stnosti:";
+$vocab["area_admin_email"]   = "Email administr�tora oblasti";
+$vocab["invalid_email"]      = "�patn� email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Bylo smaz�no rezervov�n�";
+$vocab["sure"]               = "Jste si jist�?";
+$vocab["YES"]                = "ANO";
+$vocab["NO"]                 = "NE";
+$vocab["delarea"]            = "Mus�te smazat v�echny m�stnosti v t�to oblasti p�edt�m ne� ji m�ete smazat<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "O MRBS";
+$vocab["database"]           = "Datab�ze: ";
+$vocab["system"]             = "Syst�m: ";
+$vocab["please_contact"]     = "Pros�m kontaktujte ";
+$vocab["for_any_questions"]  = "pokud m�te n�jak� dal�� ot�zky.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fataln� chyba: Nepoda�ilo se p�ipojit do datab�ze";
+
+?>
Index: web/lang.ja.php
===================================================================
RCS file: web/lang.ja.php
diff -N web/lang.ja.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.ja.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.ja.php,v 1.1 2007/04/05 22:25:32 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Japanese file.
+#
+#
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "UTF-8";
+
+# Used in style.php
+$vocab["mrbs"]               = "X線発生装置予約システム";
+
+# Used in functions.php
+$vocab["report"]             = "報告";
+$vocab["admin"]              = "管理";
+$vocab["help"]               = "手引き";
+$vocab["search"]             = "検索:";
+$vocab["not_php3"]             = "<h1>警告: このスクリプトは、PHP3ではおそらく動作しません。</h1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "";
+$vocab["bookingsforpost"]    = "の予約です";
+$vocab["areas"]              = "X線発生装置";
+$vocab["daybefore"]          = "前の日に移動";
+$vocab["dayafter"]           = "次の日移動";
+$vocab["gototoday"]          = "本日に移動";
+$vocab["goto"]               = "移動";
+$vocab["highlight_line"]     = "この行を強調";
+$vocab["click_to_reserve"]   = "予約を入れたいセルをクリックしてください。";
+
+# Used in trailer.php
+$vocab["viewday"]            = "この日の予約状況";
+$vocab["viewweek"]           = "週間予約状況";
+$vocab["viewmonth"]          = "月間予約状況";
+$vocab["ppreview"]           = "印刷向けページ";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "予約登録";
+$vocab["editentry"]          = "予約の編集";
+$vocab["editseries"]         = "定例の編集";
+$vocab["namebooker"]         = "使用者:";
+$vocab["fulldescription"]    = "詳細な説明<br />(人数, 内部会議/外部会議 等):";
+$vocab["date"]               = "日付:";
+$vocab["start_date"]         = "開始時刻:";
+$vocab["end_date"]           = "終了時刻:";
+$vocab["time"]               = "時間:";
+$vocab["period"]             = "期間:";
+$vocab["duration"]           = "必要な時間:";
+$vocab["seconds"]            = "秒";
+$vocab["minutes"]            = "分";
+$vocab["hours"]              = "時間";
+$vocab["days"]               = "日";
+$vocab["weeks"]              = "週";
+$vocab["years"]              = "年";
+$vocab["periods"]            = "期間";
+$vocab["all_day"]            = "全日";
+$vocab["type"]               = "会議の種類:";
+$vocab["internal"]           = "内部会議";
+$vocab["external"]           = "外部会議";
+$vocab["save"]               = "保存";
+$vocab["rep_type"]           = "繰り返しの様式:";
+$vocab["rep_type_0"]         = "なし";
+$vocab["rep_type_1"]         = "毎日";
+$vocab["rep_type_2"]         = "毎週";
+$vocab["rep_type_3"]         = "毎月";
+$vocab["rep_type_4"]         = "毎年";
+$vocab["rep_type_5"]         = "毎月同じ日";
+$vocab["rep_type_6"]         = "n週毎";
+$vocab["rep_end_date"]       = "繰り返しの終了日:";
+$vocab["rep_rep_day"]        = "繰り返しの曜日:";
+$vocab["rep_for_weekly"]     = "(毎週, n週毎 選択時)";
+$vocab["rep_freq"]           = "頻度:";
+$vocab["rep_num_weeks"]      = "週の繰り返し数";
+$vocab["rep_for_nweekly"]    = "(n週毎 選択時)";
+$vocab["ctrl_click"]         = "複数のディテクターを選択するときは、<br />Controlキーを押しながらクリックしてください。";
+$vocab["entryid"]            = "予約ID ";
+$vocab["repeat_id"]          = "定例ID "; 
+$vocab["you_have_not_entered"] = "以下の項目が入力されていません:";
+$vocab["you_have_not_selected"] = "以下の項目が選択されていません:";
+$vocab["valid_room"]         = "X線発生装置";
+$vocab["valid_time_of_day"]  = "valid time of day.";
+$vocab["brief_description"]  = "簡単な説明";
+$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
+
+# Used in view_entry.php
+$vocab["description"]        = "説明:";
+$vocab["room"]               = "ディテクター:";
+$vocab["createdby"]          = "予約者:";
+$vocab["lastupdate"]         = "最後に更新した日:";
+$vocab["deleteentry"]        = "予約の削除";
+$vocab["deleteseries"]       = "定例の削除";
+$vocab["confirmdel"]         = "本当にこの予約を取り消してもよろしいですか?";
+$vocab["returnprev"]         = "前のページに戻る";
+$vocab["invalid_entry_id"]   = "不正な予約IDです。";
+$vocab["invalid_series_id"]  = "不正な定例IDです。";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "エラー";
+$vocab["sched_conflict"]     = "予定の重複";
+$vocab["conflict"]           = "新しい予約は、以下の登録と重複しています:";
+$vocab["too_may_entrys"]     = "選択されたオプションは大量のエントリーを作成します。<br />別のオプションを使用して下さい!";
+$vocab["returncal"]          = "カレンダー表示画面に戻る";
+$vocab["failed_to_acquire"]  = "排他的なデータベースアクセスの確保に失敗しました"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["新規登録"];
+$vocab["mail_body_del_entry"] = $mail["登録削除"];
+$vocab["mail_body_changed_entry"] = $mail["登録変更"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "アクセスが拒否されました";
+$vocab["norights"]           = "この項目を変更する権利がありません。";
+$vocab["please_login"]       = "ログインしてください";
+$vocab["user_name"]          = "名前";
+$vocab["user_password"]      = "パスワード";
+$vocab["unknown_user"]       = "不明なユーザ";
+$vocab["you_are"]            = "あなたは";
+$vocab["login"]              = "ログイン";
+$vocab["logoff"]             = "ロクオフ";
+
+# Authentication database
+$vocab["user_list"]          = "ユーザリスト";
+$vocab["edit_user"]          = "ユーザ編集";
+$vocab["delete_user"]        = "このユーザを削除";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Eメールアドレス";
+$vocab["password_twice"]     = "パスワードを変更したい場合は、新しいパスワードを2回入力してください";
+$vocab["passwords_not_eq"]   = "エラー: パスワードが一致しません。";
+$vocab["add_new_user"]       = "新しいユーザを追加";
+$vocab["rights"]             = "権限";
+$vocab["action"]             = "処置";
+$vocab["user"]               = "ユーザ";
+$vocab["administrator"]      = "管理者";
+$vocab["unknown"]            = "不明";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "クリックすると、これからの予定が表示されます。";
+
+# Used in search.php
+$vocab["invalid_search"]     = "検索語が空あるいは不適切です。";
+$vocab["search_results"]     = "検索結果:";
+$vocab["nothing_found"]      = "一致する項目は見つかりませんでした。";
+$vocab["records"]            = "履歴";
+$vocab["through"]            = "から";
+$vocab["of"]                 = ", 該当件数";
+$vocab["previous"]           = "前";
+$vocab["next"]               = "次";
+$vocab["entry"]              = "エントリー";
+$vocab["view"]               = "閲覧";
+$vocab["advanced_search"]    = "高度な検索";
+$vocab["search_button"]      = "検索";
+$vocab["search_for"]         = "検索語";
+$vocab["from"]               = "始点";
+
+# Used in report.php
+$vocab["report_on"]          = "会合の報告:";
+$vocab["report_start"]       = "報告開始日:";
+$vocab["report_end"]         = "報告終了日:";
+$vocab["match_area"]         = "X線発生装置の一致:";
+$vocab["match_room"]         = "ディテクターの一致:";
+$vocab["match_type"]         = "形態の一致:";
+$vocab["ctrl_click_type"]    = "複数の形態を選択するときは、<br />Controlキーを押しながらクリックしてください。";
+$vocab["match_entry"]        = "簡単な説明との一致:";
+$vocab["match_descr"]        = "詳細な説明との一致:";
+$vocab["include"]            = "内容:";
+$vocab["report_only"]        = "報告のみ";
+$vocab["summary_only"]       = "要約のみ";
+$vocab["report_and_summary"] = "報告と要約";
+$vocab["summarize_by"]       = "要約のまとめ方:";
+$vocab["sum_by_descrip"]     = "簡単な説明";
+$vocab["sum_by_creator"]     = "予約者";
+$vocab["entry_found"]        = "個のエントリーが見つかりました";
+$vocab["entries_found"]      = "個のエントリーが見つかりました";
+$vocab["summary_header"]     = "予約時間数の要約 (括弧内はエントリー数)";
+$vocab["summary_header_per"] = "予約時間帯数の要約 (括弧内はエントリー数)";
+$vocab["total"]              = "計";
+$vocab["submitquery"]        = "報告の作成";
+$vocab["sort_rep"]           = "報告の並べ方:";
+$vocab["sort_rep_time"]      = "開始日時";
+$vocab["rep_dsp"]            = "報告の表示:";
+$vocab["rep_dsp_dur"]        = "使用期間";
+$vocab["rep_dsp_end"]        = "終了時刻";
+
+# Used in week.php
+$vocab["weekbefore"]         = "前の週に移動";
+$vocab["weekafter"]          = "次の週に移動";
+$vocab["gotothisweek"]       = "今週に移動";
+
+# Used in month.php
+$vocab["monthbefore"]        = "前の月に移動";
+$vocab["monthafter"]         = "次の月に移動";
+$vocab["gotothismonth"]      = "今月に移動";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "このX線発生装置にはディテクターが設定されていません";
+
+# Used in admin.php
+$vocab["edit"]               = "編集";
+$vocab["delete"]             = "削除";
+$vocab["rooms"]              = "ディテクター";
+$vocab["in"]                 = "-";
+$vocab["noareas"]            = "X線発生装置がありません。";
+$vocab["addarea"]            = "X線発生装置を追加";
+$vocab["name"]               = "名称";
+$vocab["noarea"]             = "X線発生装置が選択されていません";
+$vocab["browserlang"]        = "あなたのブラウザの言語設定は";
+$vocab["postbrowserlang"]    = "です。";
+$vocab["addroom"]            = "ディテクターを追加";
+$vocab["capacity"]           = "収容人数";
+$vocab["norooms"]            = "ディテクターがありません。";
+$vocab["administration"]     = "管理";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "X線発生装置の編集";
+$vocab["change"]             = "変更";
+$vocab["backadmin"]          = "管理画面に戻る";
+$vocab["editroomarea"]       = "X線発生装置やディテクターの説明";
+$vocab["editroom"]           = "ディテクターの編集";
+$vocab["update_room_failed"] = "ディテクターの更新に失敗しました: ";
+$vocab["error_room"]         = "エラー: ディテクター ";
+$vocab["not_found"]          = "は見つかりませんでした";
+$vocab["update_area_failed"] = "X線発生装置の更新に失敗しました: ";
+$vocab["error_area"]         = "エラー: X線発生装置 ";
+$vocab["room_admin_email"]   = "ディテクターの管理者のEメール:";
+$vocab["area_admin_email"]   = "X線発生装置の管理者のEメール:";
+$vocab["invalid_email"]      = "不適切なEメールです!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "以下の予約を削除します";
+$vocab["sure"]               = "よろしいですか?";
+$vocab["YES"]                = "はい";
+$vocab["NO"]                 = "いいえ";
+$vocab["delarea"]            = "削除する前に、このX線発生装置に属するディテクターを全て削除してください。<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "MRBSについて";
+$vocab["database"]           = "データベース: ";
+$vocab["system"]             = "システム: ";
+$vocab["please_contact"]     = "ここに答えがない質問は、";
+$vocab["for_any_questions"]  = "にお尋ねください。";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "致命的なエラー: データベースに接続できませんでした。";
+
+?>
Index: web/escapeshellarg.php
===================================================================
RCS file: web/escapeshellarg.php
diff -N web/escapeshellarg.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/escapeshellarg.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,15 @@
+<?php
+require_once("../../../config.php"); //for Moodle integration
+/* $Id: escapeshellarg.php,v 1.2 2007/12/28 05:53:05 arborrow Exp $
+ *
+ * Included if your PHP version is less than 4.0.3 and therefore this
+ * function doesn't exist.
+ *
+ */
+
+function escapeshellarg($x)
+{
+  return "'".ereg_replace("'", "'\\''", $x)."'";
+} 
+
+?>
Index: web/lang.nl.php
===================================================================
RCS file: web/lang.nl.php
diff -N web/lang.nl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.nl.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.nl.php,v 1.1 2007/04/05 22:25:32 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is an NL Dutch file.
+#
+# Translations provided by: Marc ter Horst
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "Vergaderruimte Boekingssysteem";
+
+# Used in functions.php
+$vocab["report"]             = "Rapportage";
+$vocab["admin"]              = "Admin";
+$vocab["help"]               = "Help";
+$vocab["search"]             = "Zoek:";
+$vocab["not_php3"]             = "<H1>Waarschuwing: Werkt waarschijnlijk niet met PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Boekingen voor";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "Gebouwen";
+$vocab["daybefore"]          = "Naar Vorige Dag";
+$vocab["dayafter"]           = "Naar Volgende Dag";
+$vocab["gototoday"]          = "Naar Vandaag";
+$vocab["goto"]               = "ga naar";
+$vocab["highlight_line"]     = "Markeer deze regel";
+$vocab["click_to_reserve"]   = "Klik op dit vak om een reservering te maken.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Bekijk Dag";
+$vocab["viewweek"]           = "Bekijk Week";
+$vocab["viewmonth"]          = "Bekijk Maand";
+$vocab["ppreview"]           = "Afdruk Voorbeeld";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Boeking Toevoegen";
+$vocab["editentry"]          = "Boeking Wijzigen";
+$vocab["editseries"]         = "Wijzig Reeks";
+$vocab["namebooker"]         = "Korte Omschrijving:";
+$vocab["fulldescription"]    = "Volledige Omschrijving:<br>&nbsp;&nbsp;(Aantal mensen,<br>&nbsp;&nbsp;Intern/Extern etc)";
+$vocab["date"]               = "Datum:";
+$vocab["start_date"]         = "Start Tijd:";
+$vocab["end_date"]           = "Eind Tijd:";
+$vocab["time"]               = "Tijd:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "Tijdsduur:";
+$vocab["seconds"]            = "seconden";
+$vocab["minutes"]            = "minuten";
+$vocab["hours"]              = "uren";
+$vocab["days"]               = "dagen";
+$vocab["weeks"]              = "weken";
+$vocab["years"]              = "jaren";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "Hele Dag";
+$vocab["type"]               = "Soort:";
+$vocab["internal"]           = "Intern";
+$vocab["external"]           = "Extern";
+$vocab["save"]               = "Opslaan";
+$vocab["rep_type"]           = "Soort Herhaling:";
+$vocab["rep_type_0"]         = "Geen";
+$vocab["rep_type_1"]         = "Dagelijks";
+$vocab["rep_type_2"]         = "Wekelijks";
+$vocab["rep_type_3"]         = "Maandelijks";
+$vocab["rep_type_4"]         = "Jaarlijks";
+$vocab["rep_type_5"]         = "Maandelijks, Overeenkomstige dag";
+$vocab["rep_type_6"]         = "n-wekelijks";
+$vocab["rep_end_date"]       = "Einde herhaling datum:";
+$vocab["rep_rep_day"]        = "Herhalingsdag:";
+$vocab["rep_for_weekly"]     = "(t.b.v. wekelijks)";
+$vocab["rep_freq"]           = "Frequentie:";
+$vocab["rep_num_weeks"]      = "Aantal weken";
+$vocab["rep_for_nweekly"]    = "(Voor n-wekelijks)";
+$vocab["ctrl_click"]         = "Gebruik Control-Linker muis klik om meer dan 1 ruimte te reserveren";
+$vocab["entryid"]            = "Boeking-ID ";
+$vocab["repeat_id"]          = "Herhalings-ID "; 
+$vocab["you_have_not_entered"] = "U heeft het volgende niet ingevoerd : ";
+$vocab["you_have_not_selected"] = "U heeft het volgende niet geselecteerd : ";
+$vocab["valid_room"]         = "kamer.";
+$vocab["valid_time_of_day"]  = "geldige tijd.";
+$vocab["brief_description"]  = "Korte Omschrijving.";
+$vocab["useful_n-weekly_value"] = "bruikbaar n-wekelijks aantal.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Omschrijving:";
+$vocab["room"]               = "Kamer";
+$vocab["createdby"]          = "Aangemaakt door:";
+$vocab["lastupdate"]         = "Laatste aanpassing:";
+$vocab["deleteentry"]        = "Boeking verwijderen";
+$vocab["deleteseries"]       = "Herhalingen verwijderen";
+$vocab["confirmdel"]         = "Weet U zeker\\ndat U deze\\nBoeking wilt verwijderen?\\n\\n";
+$vocab["returnprev"]         = "Terug naar vorige pagina";
+$vocab["invalid_entry_id"]   = "Ongeldig Boeking-ID.";
+$vocab["invalid_series_id"]  = "Ongeldig Herhalings-ID.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Fout";
+$vocab["sched_conflict"]     = "Overlappende Boeking";
+$vocab["conflict"]           = "De nieuwe boeking overlapt de volgende boeking(en):";
+$vocab["too_may_entrys"]     = "De door U geselecteerde opties zullen teveel boekingen genereren.<BR>Pas A.U.B. uw opties aan !";
+$vocab["returncal"]          = "Terug naar kalender overzicht";
+$vocab["failed_to_acquire"]  = "Het is niet gelukt om exclusive toegang tot de database te verkrijgen"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Geen Toegang";
+$vocab["norights"]           = "U heeft geen rechten om deze boeking aan te passen.";
+$vocab["please_login"]       = "Inloggen A.U.B";
+$vocab["user_name"]          = "Naam";
+$vocab["user_password"]      = "Wachtwoord";
+$vocab["unknown_user"]       = "Onbekende gebruiker";
+$vocab["you_are"]            = "U bent";
+$vocab["login"]              = "Inloggen";
+$vocab["logoff"]             = "Uitloggen";
+
+# Authentication database
+$vocab["user_list"]          = "Gebruikerslijst";
+$vocab["edit_user"]          = "Gebruiker aanpassen";
+$vocab["delete_user"]        = "Deze gebruiker verwijderen";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email adres";
+$vocab["password_twice"]     = "Als u het wachtwoord wilt wijzigen dient u het nieuwe wachtwoord tweemaal in te voeren.";
+$vocab["passwords_not_eq"]   = "Fout: De wachtwoorden komen niet overeen.";
+$vocab["add_new_user"]       = "Nieuwe gebruiker toevoegen";
+$vocab["rights"]             = "Rechten";
+$vocab["action"]             = "Handelingen";
+$vocab["user"]               = "Gebruiker";
+$vocab["administrator"]      = "Beheerder";
+$vocab["unknown"]            = "Onbekend";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Klikken om al mijn aankomende boekingen te tonen.";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Niet bestaand of ongeldig zoek argument.";
+$vocab["search_results"]     = "Zoek resultaten voor:";
+$vocab["nothing_found"]      = "Geen resultaten voor uw zoek opdracht gevonden.";
+$vocab["records"]            = "Boekingregels ";
+$vocab["through"]            = " tot en met ";
+$vocab["of"]                 = " van ";
+$vocab["previous"]           = "Vorige";
+$vocab["next"]               = "Volgende";
+$vocab["entry"]              = "Boeking";
+$vocab["view"]               = "Overzicht";
+$vocab["advanced_search"]    = "Advanced search";
+$vocab["search_button"]      = "Zoek";
+$vocab["search_for"]         = "Zoeken naar";
+$vocab["from"]               = "Van";
+
+# Used in report.php
+$vocab["report_on"]          = "Boekingsoverzicht:";
+$vocab["report_start"]       = "Start datum overzicht:";
+$vocab["report_end"]         = "Eind datum overzicht:";
+$vocab["match_area"]         = "Gebied als:";
+$vocab["match_room"]         = "Kamer als:";
+$vocab["match_type"]         = "Match type:";
+$vocab["ctrl_click_type"]    = "Gebruik Control-Linker muis klik om meer dan 1 type te selekteren";
+$vocab["match_entry"]        = "Korte omschrijving als:";
+$vocab["match_descr"]        = "Volledige omschrijving als:";
+$vocab["include"]            = "Neem mee:";
+$vocab["report_only"]        = "Alleen overzicht";
+$vocab["summary_only"]       = "Alleen samenvatting";
+$vocab["report_and_summary"] = "Overzicht en samenvatting";
+$vocab["summarize_by"]       = "Samenvatten volgens:";
+$vocab["sum_by_descrip"]     = "Korte omschrijving";
+$vocab["sum_by_creator"]     = "Boeker";
+$vocab["entry_found"]        = "boeking gevonden";
+$vocab["entries_found"]      = "boekingen gevonden";
+$vocab["summary_header"]     = "Totaal aan (geboekte) uren";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Totaal";
+$vocab["submitquery"]        = "Rapport uitvoeren";
+$vocab["sort_rep"]           = "Rapport sorteren op:";
+$vocab["sort_rep_time"]      = "Start Datum/Tijd";
+$vocab["rep_dsp"]            = "Weergeven in rapport:";
+$vocab["rep_dsp_dur"]        = "Duur";
+$vocab["rep_dsp_end"]        = "Eind Tijd";
+
+# Used in week.php
+$vocab["weekbefore"]         = "Ga naar vorige week";
+$vocab["weekafter"]          = "Ga naar volgende week";
+$vocab["gotothisweek"]       = "Ga naar deze week";
+
+# Used in month.php
+$vocab["monthbefore"]        = "Ga naar vorige maand";
+$vocab["monthafter"]         = "Ga naar volgende maand";
+$vocab["gotothismonth"]      = "Ga naar deze maand";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Nog geen kamers gedefini�erd voor dit gebouw";
+
+# Used in admin.php
+$vocab["edit"]               = "Wijzig";
+$vocab["delete"]             = "Wis";
+$vocab["rooms"]              = "Kamers";
+$vocab["in"]                 = "in";
+$vocab["noareas"]            = "Gebouwen";
+$vocab["addarea"]            = "Gebouw toevoegen";
+$vocab["name"]               = "Naam";
+$vocab["noarea"]             = "Geen gebouw geselecteerd";
+$vocab["browserlang"]        = "Uw browser is ingesteld op ";
+$vocab["postbrowserlang"]    = "Nederlands.";
+$vocab["addroom"]            = "Kamer toevoegen";
+$vocab["capacity"]           = "Zitplaatsen";
+$vocab["norooms"]            = "Geen Kamers.";
+$vocab["administration"]     = "Beheer";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Gebouw Wijzigen";
+$vocab["change"]             = "Wijzig";
+$vocab["backadmin"]          = "Terug naar Beheer";
+$vocab["editroomarea"]       = "Gebouw of Kamer wijzigen";
+$vocab["editroom"]           = "Kamer wijzigen";
+$vocab["update_room_failed"] = "Wijzigen kamer mislukt: ";
+$vocab["error_room"]         = "Fout: kamer ";
+$vocab["not_found"]          = " niet gevonden";
+$vocab["update_area_failed"] = "Wijzigen gebouw mislukt: ";
+$vocab["error_area"]         = "Fout: gebouw ";
+$vocab["room_admin_email"]   = "Kamer beheer email:";
+$vocab["area_admin_email"]   = "Gebouw beheer email:";
+$vocab["invalid_email"]      = "Ongeldig email adres !";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "U gaat hiermee de volgende boekingen verwijderen";
+$vocab["sure"]               = "Weet U het zeker?";
+$vocab["YES"]                = "JA";
+$vocab["NO"]                 = "NEE";
+$vocab["delarea"]            = "U moet alle kamers in dit gebouw verwijderen voordat U het kunt verwijderen<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "Over MRBS";
+$vocab["database"]           = "Database: ";
+$vocab["system"]             = "Systeem: ";
+$vocab["please_contact"]     = "Neem contact op met ";
+$vocab["for_any_questions"]  = "Voor alle vragen die hier niet worden beantwoord.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fatale Fout: Verbinding naar database server mislukt";
+
+?>
Index: web/auth_none.php
===================================================================
RCS file: web/auth_none.php
diff -N web/auth_none.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_none.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,67 @@
+<?php
+
+/* $Id: auth_none.php,v 1.1 2007/04/05 22:25:25 arborrow Exp $
+ *
+ * Dummy authentication scheme, that accepts any user.
+ * Useful for using mrbs without authentication,
+ * or in combination with a session scheme that already enforces
+ * its own authentication. For example that in IIS.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ *      $auth["type"]    = "none";
+ *      $auth["session"] = your choice
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "nt_username1";
+ * $auth["admin"][] = "nt_username2";
+ *
+ * See AUTHENTICATION  for more informations.
+ */
+
+/** 
+ * Checks if the specified username/password pair are valid.
+ *
+ * For this authentication scheme always validates.
+ * 
+ * @param   string  $user   The user name
+ * @param   string  $pass   The password
+ * @return  int             non-zero - Always valid
+ */
+
+require_once("../../../config.php");
+
+function authValidateUser($user, $pass)
+{
+    return 1;
+}
+
+/* authGetUserLevel($user)
+ * 
+ * Determines the users access level
+ * 
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+    // User not logged in, user level '0'
+    if(!isset($user))
+	return 0;
+	
+    // Check if the user is can modify
+    for($i = 0; isset($lev1_admin[$i]); $i++)
+    {
+	if(strcasecmp($user, $lev1_admin[$i]) == 0)
+	    return 2;
+    }
+	
+    // Everybody else is access level '1'
+    return 1;
+}
+
+?>
Index: web/lang.fi.php
===================================================================
RCS file: web/lang.fi.php
diff -N web/lang.fi.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.fi.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id : lang.fi,v 1.1 Thu Jan 30 2003 thierry_bo Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is the Finnish version.
+#
+# Translation by Vesa Palmu ( vesa.palmu@no... ),
+# 2005 Tom Ingberg (tom.ingberg@iki.fi.invalid)
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "utf-8";
+
+# Used in style.inc
+$vocab["mrbs"]               = "Huonetilojen varausjärjestelmä";
+
+# Used in functions.inc
+$vocab["report"]             = "Raportit";
+$vocab["admin"]              = "Ylläpito";
+$vocab["help"]               = "Ohjeet";
+$vocab["search"]             = "Etsi:";
+$vocab["not_php3"]             = "Varoitus: Järjestelmä ei välttämättä toimi PHP3:lla.</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Varaukset";
+$vocab["bookingsforpost"]    = ""; # Goes after the date
+$vocab["areas"]              = "Tilat";
+$vocab["daybefore"]          = "Edelliseen päivään";
+$vocab["dayafter"]           = "Seuraavaan päivään";
+$vocab["gototoday"]          = "Tähän päivään";
+$vocab["goto"]               = "mene";
+$vocab["highlight_line"]     = "Korosta tämä rivi";
+$vocab["click_to_reserve"]   = "Napsauta solua tehdäksesi varauksen.";
+
+# Used in trailer.inc
+$vocab["viewday"]            = "Näytä päivä";
+$vocab["viewweek"]           = "Näytä viikko";
+$vocab["viewmonth"]          = "Näytä kuukausi";
+$vocab["ppreview"]           = "Tulostuksen esikatselu";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Lisää varaus";
+$vocab["editentry"]          = "Muokkaa varausta";
+$vocab["editseries"]         = "Muokkaa varaussarjaa";
+$vocab["namebooker"]         = "Lyhyt kuvaus:";
+$vocab["fulldescription"]    = "Täydellinen kuvaus:<br>&nbsp;&nbsp;(Montako ihmistä,<br>&nbsp;&nbsp;sisäinen/ulkoinen jne)";
+$vocab["date"]               = "Päivämäärä:";
+$vocab["start_date"]         = "Aloitusaika:";
+$vocab["end_date"]           = "Lopetusaika:";
+$vocab["time"]               = "Aika:";
+$vocab["period"]             = "Jakso:";
+$vocab["duration"]           = "Kesto:";
+$vocab["seconds"]            = "sekuntia";
+$vocab["minutes"]            = "minuuttia";
+$vocab["hours"]              = "tuntia";
+$vocab["days"]               = "päivää";
+$vocab["weeks"]              = "viikkoa";
+$vocab["years"]              = "vuotta";
+$vocab["periods"]            = "jaksoa";
+$vocab["all_day"]            = "Koko päivän";
+$vocab["type"]               = "Tyyppi:";
+$vocab["internal"]           = "Sisäinen";
+$vocab["external"]           = "Ulkoinen";
+$vocab["save"]               = "Tallenna";
+$vocab["rep_type"]           = "Toiston tyyppi:";
+$vocab["rep_type_0"]         = "Ei toistoa";
+$vocab["rep_type_1"]         = "Päivittäin";
+$vocab["rep_type_2"]         = "Viikoittain";
+$vocab["rep_type_3"]         = "Kuukausittain";
+$vocab["rep_type_4"]         = "Vuosittain";
+$vocab["rep_type_5"]         = "Kuukausittain samana viikonpäivänä";
+$vocab["rep_type_6"]         = "Määräaikainen viikoittainen";
+$vocab["rep_end_date"]       = "Toiston loppupäivämäärä:";
+$vocab["rep_rep_day"]        = "Toiston viikonpäivä:";
+$vocab["rep_for_weekly"]     = "(viikottaiselle toistolle)";
+$vocab["rep_freq"]           = "Tiheys:";
+$vocab["rep_num_weeks"]      = "Montako viikkoa";
+$vocab["rep_for_nweekly"]    = "(määräaikaiselle viikottaiselle)";
+$vocab["ctrl_click"]         = "Pidä CTRL-nappi pohjassa valitaksesi useita huoneita.";
+$vocab["entryid"]            = "Varauksen ID ";
+$vocab["repeat_id"]          = "Toiston ID "; 
+$vocab["you_have_not_entered"] = "Et ole antanut seuraavaa pakollista tietoa:";
+$vocab["you_have_not_selected"] = "Et ole valinnut";
+$vocab["valid_room"]         = "huonetta.";
+$vocab["valid_time_of_day"]  = "Ajankohta ei ole kelpaa.";
+$vocab["brief_description"]  = "Lyhyt kuvaus";
+$vocab["useful_n-weekly_value"] = "Määräaikaisen viikottaisen varauksen viikkomäärä.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Kuvaus:";
+$vocab["room"]               = "Huone:";
+$vocab["createdby"]          = "Varauksen tekijä:";
+$vocab["lastupdate"]         = "Päivitetty:";
+$vocab["deleteentry"]        = "Poista varaus";
+$vocab["deleteseries"]       = "Poista varaussarja";
+$vocab["confirmdel"]         = "Oletko varma että haluat poistaa\\ntämän varauksen?\\n\\n";
+$vocab["returnprev"]         = "Takaisin edelliselle sivulle";
+$vocab["invalid_entry_id"]   = "Virheellinen varauksen ID.";
+$vocab["invalid_series_id"]  = "Virheellinen sarjan ID.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Virhe";
+$vocab["sched_conflict"]     = "Päällekkäinen varaus";
+$vocab["conflict"]           = "Uusi varaus menee päällekkäin seuraavien varausten kanssa:";
+$vocab["too_may_entrys"]     = "Valituilla ehdoilla tulisi liian monta varausta.<br>Valittuja ehtoja on muutettava.";
+$vocab["returncal"]          = "Paluu kalenterinäkymään";
+$vocab["failed_to_acquire"]  = "Tietokantaan ei saatu (varauksetonta) yhteyttä."; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Pääsy kielletty";
+$vocab["norights"]           = "Sinulla ei ole riittävästi oikeuksia yrittämäsi toiminnon suorittamiseen.";
+$vocab["please_login"]       = "Ole hyvä ja kirjaudu sisään";
+$vocab["user_name"]          = "Käyttäjätunnus";
+$vocab["user_password"]      = "Salasana";
+$vocab["unknown_user"]       = "Tuntematon käyttäjä";
+$vocab["you_are"]            = "Olet";
+$vocab["login"]              = "Kirjaudu sisään";
+$vocab["logoff"]             = "Kirjaudu ulos";
+
+# Authentication database
+$vocab["user_list"]          = "Käyttäjälista";
+$vocab["edit_user"]          = "Muokkaa käyttäjää";
+$vocab["delete_user"]        = "Poista tämä käyttäjä";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Sähköpostiosoite";
+$vocab["password_twice"]     = "Jos haluat vaihtaa salasanan, ole hyvä ja anna uusi salasana kahdesti";
+$vocab["passwords_not_eq"]   = "Virhe: Salasanat eivät täsmää.";
+$vocab["add_new_user"]       = "Lisää uusi käyttäjä";
+$vocab["rights"]             = "Oikeudet";
+$vocab["action"]             = "Toiminto";
+$vocab["user"]               = "Käyttäjä";
+$vocab["administrator"]      = "Ylläpitäjä";
+$vocab["unknown"]            = "Tuntematon";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Tyhjä tai kelpaamaton haku.";
+$vocab["search_results"]     = "Hakutulokset:";
+$vocab["nothing_found"]      = "Yhtään varausta ei löytynyt antamillasi ehdoilla. ";
+$vocab["records"]            = "Tulokset ";
+$vocab["through"]            = " - ";
+$vocab["of"]                 = " tuloksia yhteensä: ";
+$vocab["previous"]           = "Edellinen";
+$vocab["next"]               = "Seuraava";
+$vocab["entry"]              = "Varaus";
+$vocab["view"]               = "Katsele";
+$vocab["advanced_search"]    = "Tarkennettu haku";
+$vocab["search_button"]      = "Hae";
+$vocab["search_for"]         = "Etsi:";
+$vocab["from"]               = "Alkaen";
+
+# Used in report.php
+$vocab["report_on"]          = "Raportti varauksista:";
+$vocab["report_start"]       = "Raportin alkupäivämäärä:";
+$vocab["report_end"]         = "Raportin loppupäivämäärä:";
+$vocab["match_area"]         = "Alue:";
+$vocab["match_room"]         = "Huone:";
+$vocab["match_type"]         = "Tyyppi:";
+$vocab["ctrl_click_type"]    = "Pidä Ctrl-näppäin alaspainettuna valitaksesi useamman tyypin.";
+$vocab["match_entry"]        = "Lyhyt kuvaus:";
+$vocab["match_descr"]        = "Täydellinen kuvaus:";
+$vocab["include"]            = "Sisältäen:";
+$vocab["report_only"]        = "Ainoastaan raportti";
+$vocab["summary_only"]       = "Ainoastaan yhteenveto";
+$vocab["report_and_summary"] = "Molemmat";
+$vocab["summarize_by"]       = "Yhteenvedon peruste:";
+$vocab["sum_by_descrip"]     = "Lyhyt kuvaus";
+$vocab["sum_by_creator"]     = "Varaaja";
+$vocab["entry_found"]        = "varaus löytyi";
+$vocab["entries_found"]      = "varausta löytyi";
+$vocab["summary_header"]     = "Varausten tunnit yhteensä";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Kaikkiaan";
+$vocab["submitquery"]        = "Tee raportti";
+$vocab["sort_rep"]           = "Raporttien lajittelun peruste:";
+$vocab["sort_rep_time"]      = "Aloitusaika";
+$vocab["rep_dsp"]            = "Näytä raportissa:";
+$vocab["rep_dsp_dur"]        = "Kesto";
+$vocab["rep_dsp_end"]        = "Loppumisaika";
+ 
+# Used in week.php
+$vocab["weekbefore"]         = "Edelliseen viikkoon";
+$vocab["weekafter"]          = "Seuraavaan viikkoon";
+$vocab["gotothisweek"]       = "Tähän viikkoon";
+
+# Used in month.php
+$vocab["monthbefore"]        = "Edelliseen kuukauteen";
+$vocab["monthafter"]         = "Seuraavaan kuukauteen";
+$vocab["gotothismonth"]      = "Tähän kuukauteen";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Tällä alueella ei ole yhtään huonetta.";
+
+# Used in admin.php
+$vocab["edit"]               = "Muokkaa";
+$vocab["delete"]             = "Poista";
+$vocab["rooms"]              = "Huoneet";
+$vocab["in"]                 = "alueella";
+$vocab["noareas"]            = "Ei alueita";
+$vocab["addarea"]            = "Lisää alue";
+$vocab["name"]               = "Nimi";
+$vocab["noarea"]             = "Ei valittua aluetta";
+$vocab["browserlang"]        = "Selaimesi kieliasetus on";
+$vocab["postbrowserlang"]    = ".";
+$vocab["addroom"]            = "Lisää huone";
+$vocab["capacity"]           = "Maksimi henkilömäärä";
+$vocab["norooms"]            = "Ei huoneita.";
+$vocab["administration"]     = "Ylläpito";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Muokkaa alueen tietoja";
+$vocab["change"]             = "Tallenna";
+$vocab["backadmin"]          = "Takaisin ylläpitoon";
+$vocab["editroomarea"]       = "Muokkaa alueen tai huoneen kuvausta";
+$vocab["editroom"]           = "Muokkaa huoneen tietoja";
+$vocab["update_room_failed"] = "Huoneen tietojen päivitys epäonnistui: ";
+$vocab["error_room"]         = "Virhe: huonetta ";
+$vocab["not_found"]          = " ei löytynyt";
+$vocab["update_area_failed"] = "Alueen tietojen päivitys epäonnistui: ";
+$vocab["error_area"]         = "Virhe: aluetta ";
+$vocab["room_admin_email"]   = "Huonevastaavan sähköposti:";
+$vocab["area_admin_email"]   = "Aluevastaavan sähköposti:";
+$vocab["invalid_email"]      = "Virheellinen sähköpostiosoite!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Seuraavat varaukset poistetaan";
+$vocab["sure"]               = "Oletko varma?";
+$vocab["YES"]                = "KYLLÄ";
+$vocab["NO"]                 = "EN";
+$vocab["delarea"]            = "Sinun täytyy poistaa kaikki alueen huoneet ennnen kuin voit poistaa alueen.<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "Tietoja varausjärjestelmästä";
+$vocab["database"]           = "Tietokanta: ";
+$vocab["system"]             = "Käyttöjärjestelmä: ";
+$vocab["please_contact"]     = "Järjestelmän yhteyshenkilö ";
+$vocab["for_any_questions"]  = "antaa lisätietoja mikäli et löydä vastausta kysymykseesi näistä ohjeista.";
+
+# Used in mysql.inc AND pgsql.inc
+$vocab["failed_connect_db"]  = "Järjestelmävirhe: Tietokantayhteyden avaaminen ei onnistu.";
+
+?>
Index: web/session_omni.php
===================================================================
RCS file: web/session_omni.php
diff -N web/session_omni.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_omni.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,51 @@
+<?php
+
+/* $Id: session_omni.php,v 1.1 2007/04/05 22:25:33 arborrow Exp $
+ *
+ * Session management scheme that relies on OmniHttpd security for user 
+ * authentication. THIS is suitable for few users because we have to create all
+ * users connecting to MRBS, since they will have to login.
+ *
+ * To use this authentication scheme set the following things :
+ * - Edit your virtual server hosting MRBS.
+ * - Select security tab.
+ * - IF not yet set, choose "User and Directory" security type. 
+ * - Select "Users and groups" tab. 
+ * - Here, select "New User" and create as many users (Username/passwords) as 
+ *   you have users using MRBS. 
+ * - Select "New Group".
+ * - Type "MRBS" as group name and add all users you just created to this group.
+ * - Now select "Access Control list" tab. 
+ * - Select New. ENTER the relative path to MRBS. FOR example, if you created 
+ *   the MRBS folder on the root web folder, you should type /MRBS/. 
+ * - Now go to "user permission" tab, select " * ",
+ * - select Properties", and type MRBS (remove the star) and select "Is group".
+ *
+ * That's all ! Confirm all windows. Now it is the web server that authenticate
+ * each user. 
+ *
+ * 
+ * in config.inc.php:
+ *
+ * $auth["type"]    = "none";
+ * $auth["session"] = "omni";
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "user1";
+ * $auth["admin"][] = "user2";
+ */
+require_once("../../../config.php"); //for Moodle integration
+/* getAuth()
+ * 
+ *  No need to prompt for a name - this is done by the server.
+ */
+function authGet() { }
+
+function getUserName()
+{
+	global $REMOTE_USER;
+	return $REMOTE_USER;
+}
+
+?>
Index: web/lang.da.php
===================================================================
RCS file: web/lang.da.php
diff -N web/lang.da.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.da.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.da.php,v 1.1 2007/04/05 22:25:31 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is the Danish file.
+#
+# Translations provided by: Claes Bolvig Pedersen (cp@dhi.dk)
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "Bookning af m�derum, MRBS";
+
+# Used in functions.php
+$vocab["report"]             = "Rapport";
+$vocab["admin"]              = "Admin";
+$vocab["help"]               = "Hj�lp";
+$vocab["search"]             = "S�g:";
+$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Booking for";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "Omr�de";
+$vocab["daybefore"]          = "G� til forrige dag";
+$vocab["dayafter"]           = "G� til n�ste dag";
+$vocab["gototoday"]          = "G� til idag";
+$vocab["goto"]               = "g� til";
+$vocab["highlight_line"]     = "Highlight this line";
+$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Vis dag";
+$vocab["viewweek"]           = "Vis Uge";
+$vocab["viewmonth"]          = "Vis M�ned";
+$vocab["ppreview"]           = "Forh�ndsvisning";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Booking";
+$vocab["editentry"]          = "�ndre booking";
+$vocab["editseries"]         = "�ndre serie";
+$vocab["namebooker"]         = "Kort beskrivelse:";
+$vocab["fulldescription"]    = "Lang beskrivelse:<br>&nbsp;&nbsp;(Antal personer,<br>&nbsp;&nbsp;Internt/Eksternt osv)";
+$vocab["date"]               = "Dato:";
+$vocab["start_date"]         = "Starttid:";
+$vocab["end_date"]           = "Sluttid:";
+$vocab["time"]               = "Tid:";
+$vocab["duration"]           = "L�ngde:";
+$vocab["period"]             = "Period:";
+$vocab["seconds"]            = "sekunder";
+$vocab["minutes"]            = "minutter";
+$vocab["hours"]              = "timer";
+$vocab["days"]               = "dage";
+$vocab["weeks"]              = "uger";
+$vocab["years"]              = "�r";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "hele dagen";
+$vocab["type"]               = "Type:";
+$vocab["internal"]           = "Internt";
+$vocab["external"]           = "Eksternt";
+$vocab["save"]               = "Gem";
+$vocab["rep_type"]           = "Repetitionstype:";
+$vocab["rep_type_0"]         = "ingen";
+$vocab["rep_type_1"]         = "daglig";
+$vocab["rep_type_2"]         = "ugentlig";
+$vocab["rep_type_3"]         = "m�nedlig";
+$vocab["rep_type_4"]         = "�rlig";
+$vocab["rep_type_5"]         = "M�nedlig, samme dag";
+$vocab["rep_type_6"]         = "n-ugentlig";
+$vocab["rep_end_date"]       = "Repetitionsslutdato:";
+$vocab["rep_rep_day"]        = "Repetitionsdag:";
+$vocab["rep_for_weekly"]     = "(ved hver uge)";
+$vocab["rep_freq"]           = "Frekvens:";
+$vocab["rep_num_weeks"]      = "Antal uger";
+$vocab["rep_for_nweekly"]    = "(for n-uger)";
+$vocab["ctrl_click"]         = "Hold kontroltasten nede for at v�lge mere end et rum";
+$vocab["entryid"]            = "Entry ID ";
+$vocab["repeat_id"]          = "Repeat ID "; 
+$vocab["you_have_not_entered"] = "Du har ikke indtastet et";
+$vocab["you_have_not_selected"] = "You have not selected a";
+$vocab["valid_room"]         = "room.";
+$vocab["valid_time_of_day"]  = "validt tidspunkt.";
+$vocab["brief_description"]  = "Kort beskrivelse.";
+$vocab["useful_n-weekly_value"] = "nyttig n-ugentlig v�rdi.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Beskrivelse:";
+$vocab["room"]               = "Rum";
+$vocab["createdby"]          = "Gemt af:";
+$vocab["lastupdate"]         = "Senest opdateret:";
+$vocab["deleteentry"]        = "Slet bookning";
+$vocab["deleteseries"]       = "Slet serie";
+$vocab["confirmdel"]         = "Er du sikker p� at\\ndu vil slette bookningen?\\n\\n";
+$vocab["returnprev"]         = "Tilbage til forrige side";
+$vocab["invalid_entry_id"]   = "Invalid entry id.";
+$vocab["invalid_series_id"]  = "Invalid series id.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Fejl";
+$vocab["sched_conflict"]     = "Bookningskonflikt";
+$vocab["conflict"]           = "Bookningen er i konflikt med f�lgende bookning(er):";
+$vocab["too_may_entrys"]     = "De valgte instillinger skaber for mange bookninger.<BR>Brug venligst andre indstillinger!";
+$vocab["returncal"]          = "Tilbage til kalender";
+$vocab["failed_to_acquire"]  = "Failed to acquire exclusive database access"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Ingen adgang";
+$vocab["norights"]           = "Du har ingen rettighed til at �ndre bookningen.";
+$vocab["please_login"]       = "Please log in";
+$vocab["user_name"]          = "Name";
+$vocab["user_password"]      = "Password";
+$vocab["unknown_user"]       = "Unknown user";
+$vocab["you_are"]            = "You are";
+$vocab["login"]              = "Log in";
+$vocab["logoff"]             = "Log Off";
+
+# Authentication database
+$vocab["user_list"]          = "User list";
+$vocab["edit_user"]          = "Edit user";
+$vocab["delete_user"]        = "Delete this user";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email address";
+$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
+$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
+$vocab["add_new_user"]       = "Add a new user";
+$vocab["rights"]             = "Rights";
+$vocab["action"]             = "Action";
+$vocab["user"]               = "User";
+$vocab["administrator"]      = "Administrator";
+$vocab["unknown"]            = "Unknown";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Tom eller ugyldig s�gestreng.";
+$vocab["search_results"]     = "S�geresultat for:";
+$vocab["nothing_found"]      = "Ingen poster blev fundet.";
+$vocab["records"]            = "Bookning ";
+$vocab["through"]            = " til ";
+$vocab["of"]                 = " af ";
+$vocab["previous"]           = "Forrige";
+$vocab["next"]               = "N�ste";
+$vocab["entry"]              = "Post";
+$vocab["view"]               = "Vis";
+$vocab["advanced_search"]    = "Avanceret s�gning";
+$vocab["search_button"]      = "S�g";
+$vocab["search_for"]         = "S�g efter";
+$vocab["from"]               = "Fra";
+
+# Used in report.php
+$vocab["report_on"]          = "Rapport:";
+$vocab["report_start"]       = "Start dato:";
+$vocab["report_end"]         = "Slut dato:";
+$vocab["match_area"]         = "Omr�de:";
+$vocab["match_room"]         = "Rum:";
+$vocab["match_type"]         = "Match type:";
+$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
+$vocab["match_entry"]        = "Kort beskrivelse:";
+$vocab["match_descr"]        = "Lang beskrivelse:";
+$vocab["include"]            = "Skal indeholde:";
+$vocab["report_only"]        = "Kun rapport";
+$vocab["summary_only"]       = "Opsummering";
+$vocab["report_and_summary"] = "Rapport og opsummering";
+$vocab["summarize_by"]       = "Opsummering efter:";
+$vocab["sum_by_descrip"]     = "Kort beskrivelse";
+$vocab["sum_by_creator"]     = "Hvem der har booket";
+$vocab["entry_found"]        = "post fundet";
+$vocab["entries_found"]      = "poster fundet";
+$vocab["summary_header"]     = "Sum timer";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Total";
+$vocab["submitquery"]        = "K�r rapport";
+$vocab["sort_rep"]           = "Sort Report by:";
+$vocab["sort_rep_time"]      = "Start Date/Time";
+$vocab["rep_dsp"]            = "Display in report:";
+$vocab["rep_dsp_dur"]        = "Duration";
+$vocab["rep_dsp_end"]        = "End Time";
+
+# Used in week.php
+$vocab["weekbefore"]         = "G� til ugen f�r";
+$vocab["weekafter"]          = "G� til ugen efter";
+$vocab["gotothisweek"]       = "G� til denne uge";
+
+# Used in month.php
+$vocab["monthbefore"]        = "G� til forrige m�ned";
+$vocab["monthafter"]         = "G� til n�ste m�ned";
+$vocab["gotothismonth"]      = "G� til denne m�ned";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Ingen rum er defineret for dette omr�de";
+
+# Used in admin.php
+$vocab["edit"]               = "�ndre";
+$vocab["delete"]             = "Slet";
+$vocab["rooms"]              = "Rum";
+$vocab["in"]                 = "i";
+$vocab["noareas"]            = "Ingen omr�der";
+$vocab["addarea"]            = "Tilf�j omr�de";
+$vocab["name"]               = "Navn";
+$vocab["noarea"]             = "Omr�de ikke valgt";
+$vocab["browserlang"]        = "Din browser er indstillet til at bruge f�lgende sprog:";
+$vocab["postbrowserlang"]    = "";
+$vocab["addroom"]            = "Tilf�j rom";
+$vocab["capacity"]           = "Kapacitet";
+$vocab["norooms"]            = "Ingen rum.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "�ndre omr�de";
+$vocab["change"]             = "�ndre";
+$vocab["backadmin"]          = "Tilbage til admin";
+$vocab["editroomarea"]       = "�ndre omr�de- eller rumbeskrivelse";
+$vocab["editroom"]           = "�ndre rom";
+$vocab["update_room_failed"] = "Updater rum fejlet: ";
+$vocab["error_room"]         = "Fejl: rum ";
+$vocab["not_found"]          = " ikke fundet";
+$vocab["update_area_failed"] = "Opdater omr�de fejlet: ";
+$vocab["error_area"]         = "Fejl: omr�de ";
+$vocab["room_admin_email"]   = "Room admin email:";
+$vocab["area_admin_email"]   = "Area admin email:";
+$vocab["invalid_email"]      = "Invalid email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Dette vil slette f�lgende bookninger";
+$vocab["sure"]               = "Er du sikker?";
+$vocab["YES"]                = "JA";
+$vocab["NO"]                 = "NEJ";
+$vocab["delarea"]            = "Du skal fjerne alle rum i dette omr�de f�r du kan slette det<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "Om MRBS";
+$vocab["database"]           = "Database: ";
+$vocab["system"]             = "System: ";
+$vocab["please_contact"]     = "Kontakt ";
+$vocab["for_any_questions"]  = "for sp�rgsm�l der ikke er besvaret her.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fatal Error: Failed to connect to database";
+
+?>
Index: web/session_http.php
===================================================================
RCS file: web/session_http.php
diff -N web/session_http.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_http.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,124 @@
+<?php 
+/*****************************************************************************\
+*                                                                             *
+*   File name       auth_http.php                                             *
+*                                                                             *
+*   Description     Get user identity using the HTTP basic authentication.    *
+*                                                                             *
+*   Notes           To use this session scheme, set in config.inc.php:        *
+*                       $auth["session"]  = "http";                           *
+*                                                                             *
+*   History                                                                   *
+*    2003/11/12 JFL Created this file                                         *
+*    Remaining history in ChangeLog and CVS logs                              *
+*                                                                             *
+\*****************************************************************************/
+
+// $Id: session_http.php,v 1.3 2008/08/01 04:02:10 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
+/* authGet()
+ * 
+ * Request the user name/password
+ * 
+ * Returns: Nothing
+ */
+function authGet()
+{
+    global $auth;
+    header("WWW-Authenticate: Basic realm=\"$auth[realm]\"");
+    Header("HTTP/1.0 401 Unauthorized");
+}
+
+function getAuthPassword()
+{
+    global $PHP_AUTH_PW;
+
+    if (isset($PHP_AUTH_PW))
+    {
+        $pw = $PHP_AUTH_PW;
+        if (get_magic_quotes_gpc())
+        {
+            $pw = stripslashes($pw);
+        }
+        return $pw;
+    }
+    else
+    {
+        return null;
+    }
+}
+
+function getUserName()
+{
+    global $PHP_AUTH_USER;
+    return 'aborrowhttp';
+/*    if (isset($PHP_AUTH_USER))
+    {
+        $user = $PHP_AUTH_USER;
+        if (get_magic_quotes_gpc())
+        {
+            $user = stripslashes($user);
+        }
+
+        if (authValidateUser($user,getAuthPassword()))
+        {
+            return $user;
+        }
+        else
+        {
+            return null;
+        }
+    }
+    else
+    {
+        return null;
+    }
+*/
+}
+
+// Print the logon entry on the top banner.
+function PrintLogonBox()
+{
+	global $user_list_link;
+  
+	$user = getUserName();
+
+	if (isset($user))
+	{
+		// words 'you are xxxx' becomes a link to the
+        // report page with only entries created by xxx. Past entries are not
+        // displayed but this can be changed
+       	$search_string = "report.php?From_day=$day&From_month=$month&".
+          "From_year=$year&To_day=1&To_month=12&To_year=2030&areamatch=&".
+          "roommatch=&namematch=&descrmatch=&summarize=1&sortby=r&display=d&".
+          "sumby=d&creatormatch=$user"; ?>
+
+    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+      <A name="logonBox" href="<?php echo "$search_string\" title=\""
+         . get_string('show_my_entries','block_mrbs') . "\">" . get_string('you_are','block_mrbs')." "
+         .$user ?></A><br>
+<?php if (isset($user_list_link)) print "	  <br>\n	  " .
+	    "<A href='$user_list_link'>" . get_string('userlist') . "</A><br>\n" ;
+?>
+    </TD>
+<?php
+    }
+    else
+    {
+?>
+    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+       <A name="logonBox" href=""><?php echo get_string('usernamenotfound').'http!'; ?></A><br>
+          <FORM METHOD=POST ACTION="admin.php">
+	    <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
+	    <input type="hidden" name="Action" value="QueryName" />
+	    <input type="submit" value=" <?php echo get_string('login') ?> " />
+	  </FORM>
+<?php if (isset($user_list_link)) print "	  <br>\n	  " .
+	    "<A href=\"$user_list_link\">" . get_string('userlist') . "</A><br>\n" ;
+?>
+	</TD>
+<?php
+    }
+}
+
+?>
Index: web/session_cookie.php
===================================================================
RCS file: web/session_cookie.php
diff -N web/session_cookie.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_cookie.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,212 @@
+<?php
+/*****************************************************************************\
+*									      *
+*   File name       session_cookie.php					      *
+*									      *
+*   Description	    Manage sessions via cookies stored in the client browser. *
+*									      *
+*   URL arguments   UserName		The user name			      *
+*		    UserPassword	His password			      *
+*		    TargetURL		Where we were going before login.     *
+*									      *
+*   Notes	    To use this session mechanism, set in config.inc.php:     *
+*			$auth["session"]  = "cookie";			      *
+*									      *
+*   History								      *
+*    2003/11/09 JFL Created this file					      *
+*    Remaining history in ChangeLog and CVS logs                              *
+*									      *
+\*****************************************************************************/
+
+// $Id: session_cookie.inc,v 1.9.2.4 2007/02/13 12:53:34 jberanek Exp $
+require_once("../../../config.php"); //for Moodle integration
+if (isset($cookie_path_override))
+{
+  $cookie_path = $cookie_path_override;
+}
+else
+{
+  $cookie_path = $PHP_SELF;
+  $cookie_path = ereg_replace('[^/]*$', '', $cookie_path);
+}
+
+/*
+  Target of the form with sets the URL argument "Action=SetName".
+  Will eventually return to URL argument "TargetURL=whatever".
+*/
+if (isset($Action) && ($Action == "SetName"))
+{
+    // Avoid errors with error level ALL
+    if ( !isset( $NewUserName ) )
+    {
+    	$NewUserName = "";
+    }
+    /* First make sure the password is valid */
+    if ($NewUserName == "") {
+        // Delete cookie
+
+        setcookie("UserName", '', time()-42000, $cookie_path);
+    } else {
+        $NewUserName = unslashes($NewUserName);
+        $NewPassword = unslashes($NewPassword);
+
+        if (!authValidateUser($NewUserName, $NewUserPassword))
+        {
+            print_header_mrbs(0, 0, 0, 0);
+            echo "<P>".get_string('usernamenotfound')."</P>\n";
+            printLoginForm($TargetURL);
+            exit();
+        }
+        else
+        {
+            $UserName     = $NewUserName;
+            $UserPassword = $NewUserPassword;
+        }
+
+        setcookie("UserName", $UserName, time()+(60*60*24*30), $cookie_path);
+    }
+    header ("Location: $TargetURL"); /* Redirect browser to initial page */
+    /* Note HTTP 1.1 mandates an absolute URL. Most modern browsers support relative URLs,
+        which allows to work around problems with DNS inconsistencies in the server name.
+        Anyway, if the browser cannot redirect automatically, the manual link below will work. */
+    print_header_mrbs(0, 0, 0, 0);
+    echo "<br />\n";
+    echo "<p>Please click <a href=\"$TargetURL\">here</a> if you're not redirected automatically to the page you requested.</p>\n";
+    echo "</body>\n";
+    echo "</html>\n";
+    exit();
+}
+
+/*
+  Display the login form. Used by two routines below.
+  Will eventually return to $TargetURL.
+*/
+function printLoginForm($TargetURL)
+{
+    global $PHP_SELF;
+?>
+<p>
+  <?php echo get_string('loginsite') ?>
+</p>
+<form method="post" action="<?php echo basename($PHP_SELF) ?>">
+  <table>
+    <tr>
+      <td align="right"><?php echo get_string('username') ?></td>
+      <td><input type="text" name="NewUserName" /></td>
+    </tr>
+    <tr>
+      <td align="right"><?php echo get_string('password') ?></td>
+      <td><input type="password" name="NewUserPassword" /></td>
+    </tr>
+  </table>
+  <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" /> <br />
+  <input type="hidden" name="Action" value="SetName" /> <br />
+  <input type="submit" value="<?php echo get_string('login') ?> " /> <br />
+</form>
+</body>
+</html>
+<?php
+}
+
+/*
+  Target of the form with sets the URL argument "Action=QueryName".
+  Will eventually return to URL argument "TargetURL=whatever".
+*/
+if (isset($Action) && ($Action == "QueryName"))
+{
+    print_header_mrbs(0, 0, 0, 0);
+    printLoginForm($TargetURL);
+    exit();
+}
+
+/* authGet()
+ * 
+ * Request the user name/password
+ * 
+ * Returns: Nothing
+ */
+function authGet()
+{
+    global $PHP_SELF, $QUERY_STRING;
+
+    print_header_mrbs(0, 0, 0, 0);
+
+    echo "<p>".get_string('norights','block_mrbs')."</p>\n";
+
+    $TargetURL = basename($PHP_SELF);
+    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
+    printLoginForm($TargetURL);
+
+    exit();
+}
+
+function getUserName()
+{   return 'cookie'; //I forget why this was added, apparently to avoid the rest of the function from working -arb
+    if (!empty($_COOKIE) && isset($_COOKIE["UserName"]))
+    {
+	return $_COOKIE["UserName"];
+    }
+    else
+    {
+        global $HTTP_COOKIE_VARS;
+	if (!empty($HTTP_COOKIE_VARS) && isset($HTTP_COOKIE_VARS["UserName"]))
+	    return $HTTP_COOKIE_VARS["UserName"];
+    }
+}
+
+// Print the logon entry on the top banner.
+function PrintLogonBox()
+{
+    global $PHP_SELF, $QUERY_STRING, $user_list_link, $user_link, $day, $month;
+    global $year, $auth;
+
+    $TargetURL = basename($PHP_SELF);
+    if (isset($url_base) && ($url_base != "")) $TargetURL = $url_base . '/' . $TargetURL;
+    if (isset($QUERY_STRING)) $TargetURL = $TargetURL . "?" . $QUERY_STRING;
+    $user=getUserName();
+    if (isset($user))
+    {
+        // words 'you are xxxx' becomes a link to the
+        // report page with only entries created by xxx. Past entries are not
+        // displayed but this can be changed
+           $search_string = "report.php?From_day=$day&From_month=$month&".
+             "From_year=$year&To_day=1&To_month=12&To_year=2030&".
+             "areamatch=&roommatch=&namematch=&descrmatch=&summarize=1&".
+             "sortby=r&display=d&sumby=d&creatormatch=$user"; ?>
+
+    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+      <A name="logonBox" href="<?php echo "$search_string\" title=\""
+         . get_string('show_my_entries','block_mrbs') . "\">" . get_string('you_are','block_mrbs')." "
+         .$user ?></A><br>
+          <FORM METHOD=POST ACTION="admin.php">
+	    <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
+	    <input type="hidden" name="Action" value="SetName" />
+	    <input type="hidden" name="UserName" value="" />
+	    <input type="hidden" name="UserPassword" value="" />
+	    <input type="submit" value=" <?php echo get_string('logout') ?> " />
+	  </FORM>
+<?php if (isset($user_list_link)) print "	  <br>\n	  " .
+	    "<A href=\"$user_list_link\">" . get_string('userlist') . "</A><br>\n" ;
+?>
+	</TD>
+<?php
+    }
+else
+    {
+?>
+	<TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+	  <A name="logonBox" href=""><?php echo get_string('usernamenotfound'); ?></A><br>
+          <FORM METHOD=POST ACTION="admin.php">
+	    <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>" />
+	    <input type="hidden" name="Action" value="QueryName" />
+	    <input type="submit" value=" <?php echo get_string('login') ?> " />
+	  </FORM>
+<?php if (isset($user_list_link)) print "	  <br>\n	  " .
+	    "<A href=\"$user_list_link\">" . get_string('userlist') . "</A><br>\n" ;
+?>
+	</TD>
+<?php
+    }
+}
+
+?>
Index: web/lang.zh-tw.php
===================================================================
RCS file: web/lang.zh-tw.php
diff -N web/lang.zh-tw.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.zh-tw.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.zh-tw,v 1.15.2.2 2006/04/26 10:01:43 jberanek Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Chinese (zh-tw Big5) file.
+#
+#
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "utf-8";
+
+# Used in style.php
+$vocab["mrbs"]               = "會議室預約系統";
+
+# Used in functions.php
+$vocab["report"]             = "報表";
+$vocab["admin"]              = "系統管理";
+$vocab["help"]               = "說明";
+$vocab["search"]             = "搜尋:";
+$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "預約:";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "區域";
+$vocab["daybefore"]          = "查看前一天";
+$vocab["dayafter"]           = "查看後一天";
+$vocab["gototoday"]          = "查看今天";
+$vocab["goto"]               = "goto";
+$vocab["highlight_line"]     = "加強顯示這行";
+$vocab["click_to_reserve"]   = "點選格子進行預約登記";
+
+# Used in trailer.php
+$vocab["viewday"]            = "查看日期 ";
+$vocab["viewweek"]           = "週顯示";
+$vocab["viewmonth"]          = "月顯示";
+$vocab["ppreview"]           = "預覽列印";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "新增";
+$vocab["editentry"]          = "修改";
+$vocab["editseries"]         = "整批修改";
+$vocab["namebooker"]         = "預約人姓名:";
+$vocab["fulldescription"]    = "說明:<br>&nbsp;&nbsp;(聯約電話,部門,,<br>&nbsp;&nbsp;會議主題 等)";
+$vocab["date"]               = "日期:";
+$vocab["start_date"]         = "起始時間:";
+$vocab["end_date"]           = "結束時間:";
+$vocab["time"]               = "時間:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "持續時間:";
+$vocab["seconds"]            = "秒";
+$vocab["minutes"]            = "分";
+$vocab["hours"]              = "小時";
+$vocab["days"]               = "天";
+$vocab["weeks"]              = "星期";
+$vocab["years"]              = "年";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "整天";
+$vocab["type"]               = "種類:";
+$vocab["internal"]           = "內部使用";
+$vocab["external"]           = "外部使用";
+$vocab["save"]               = "儲存";
+$vocab["rep_type"]           = "重覆預約:";
+$vocab["rep_type_0"]         = "不重覆";
+$vocab["rep_type_1"]         = "每天";
+$vocab["rep_type_2"]         = "每週";
+$vocab["rep_type_3"]         = "每月";
+$vocab["rep_type_4"]         = "每年";
+$vocab["rep_type_5"]         = "每月對應的日期";
+$vocab["rep_type_6"]         = "(每週)";
+$vocab["rep_end_date"]       = "結束重覆的日期:";
+$vocab["rep_rep_day"]        = "重覆的星期:";
+$vocab["rep_for_weekly"]     = "(每週)";
+$vocab["rep_freq"]           = "頻率:";
+$vocab["rep_num_weeks"]      = "重覆幾週";
+$vocab["rep_for_nweekly"]    = "(每週)";
+$vocab["ctrl_click"]         = "用Control+滑鼠右鍵可以重覆選擇";
+$vocab["entryid"]            = "登記序號 ";
+$vocab["repeat_id"]          = "重覆序號 "; 
+$vocab["you_have_not_entered"] = "你沒有輸入";
+$vocab["you_have_not_selected"] = "你沒有選";
+$vocab["valid_room"]         = "會議室/設備.";
+$vocab["valid_time_of_day"]  = "可以預約的時間.";
+$vocab["brief_description"]  = "簡要說明.";
+$vocab["useful_n-weekly_value"] = "可以提供預約的星期.";
+
+# Used in view_entry.php
+$vocab["description"]        = "說明:";
+$vocab["room"]               = "會議室/設備";
+$vocab["createdby"]          = "預約人:";
+$vocab["lastupdate"]         = "最後更新:";
+$vocab["deleteentry"]        = "刪除";
+$vocab["deleteseries"]       = "整批刪除";
+$vocab["confirmdel"]         = "你確定要刪除此記錄??\\n";
+$vocab["returnprev"]         = "回前一頁";
+$vocab["invalid_entry_id"]   = "預約序號錯誤.";
+$vocab["invalid_series_id"]  = "序列號錯誤.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "錯誤";
+$vocab["sched_conflict"]     = "時段衝突";
+$vocab["conflict"]           = "此時段已被預約";
+$vocab["too_may_entrys"]     = "這個選擇造成太多輸入.<BR>請重新選擇!";
+$vocab["returncal"]          = "查看日程表";
+$vocab["failed_to_acquire"]  = "無法存取資料庫"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "限制存取";
+$vocab["norights"]           = "您無權利修改此筆記錄!!";
+$vocab["please_login"]       = "請先登入";
+$vocab["user_name"]          = "名稱";
+$vocab["user_password"]      = "密碼";
+$vocab["unknown_user"]       = "使用者不存在或密碼錯誤";
+$vocab["you_are"]            = "您是";
+$vocab["login"]              = "登入";
+$vocab["logoff"]             = "登出";
+
+# Authentication database
+$vocab["user_list"]          = "使用者清單";
+$vocab["edit_user"]          = "編輯使用者";
+$vocab["delete_user"]        = "刪除使用者";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email address";
+$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
+$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
+$vocab["add_new_user"]       = "新增使用者";
+$vocab["rights"]             = "權限";
+$vocab["action"]             = "動作";
+$vocab["user"]               = "使用者";
+$vocab["administrator"]      = "管理者";
+$vocab["unknown"]            = "未知的";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "顯示全部我的預約";
+
+# Used in search.php
+$vocab["invalid_search"]     = "空的或不合法的搜尋字串.";
+$vocab["search_results"]     = "搜尋結果:";
+$vocab["nothing_found"]      = "找不到.";
+$vocab["records"]            = "紀錄";
+$vocab["through"]            = "經由";
+$vocab["of"]                 = " of ";
+$vocab["previous"]           = "前一個";
+$vocab["next"]               = "下一個";
+$vocab["entry"]              = "登錄";
+$vocab["view"]               = "顯示";
+$vocab["advanced_search"]    = "進階搜尋";
+$vocab["search_button"]      = "搜尋";
+$vocab["search_for"]         = "搜尋";
+$vocab["from"]               = "From";
+
+# Used in report.php
+$vocab["report_on"]          = "會議室報表:";
+$vocab["report_start"]       = "報表起始日:";
+$vocab["report_end"]         = "報表結束日:";
+$vocab["match_area"]         = "符合的種類:";
+$vocab["match_room"]         = "符合的會議室:";
+$vocab["match_type"]         = "符合的類型:";
+$vocab["ctrl_click_type"]    = "使用Control-Click選取一個以上的類型";
+$vocab["match_entry"]        = "符合部份的簡述:";
+$vocab["match_descr"]        = "符合全部簡述:";
+$vocab["include"]            = "包含:";
+$vocab["report_only"]        = "只要明細";
+$vocab["summary_only"]       = "只要加總";
+$vocab["report_and_summary"] = "明細和加總";
+$vocab["summarize_by"]       = "加總項目:";
+$vocab["sum_by_descrip"]     = "簡述";
+$vocab["sum_by_creator"]     = "預約人";
+$vocab["entry_found"]        = "找到預約";
+$vocab["entries_found"]      = "找到預約";
+$vocab["summary_header"]     = "總共預約(小時)";
+$vocab["summary_header_per"] = "總共預約(次)";
+$vocab["total"]              = "全部";
+$vocab["submitquery"]        = "產生報表";
+$vocab["sort_rep"]           = "排序:";
+$vocab["sort_rep_time"]      = "起始日/時";
+$vocab["rep_dsp"]            = "顯示在報表:";
+$vocab["rep_dsp_dur"]        = "持續時間";
+$vocab["rep_dsp_end"]        = "結束時間";
+
+# Used in week.php
+$vocab["weekbefore"]         = "前一週";
+$vocab["weekafter"]          = "後一週";
+$vocab["gotothisweek"]       = "這一週";
+
+# Used in month.php
+$vocab["monthbefore"]        = "上一月";
+$vocab["monthafter"]         = "下一月";
+$vocab["gotothismonth"]      = "這個月";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "這個種類沒有定義會議室/設備";
+
+# Used in admin.php
+$vocab["edit"]               = "編輯";
+$vocab["delete"]             = "刪除";
+$vocab["rooms"]              = "會議室/設備";
+$vocab["in"]                 = "在";
+$vocab["noareas"]            = "沒有種類";
+$vocab["addarea"]            = "新增種類";
+$vocab["name"]               = "名稱";
+$vocab["noarea"]             = "還沒選擇種類";
+$vocab["browserlang"]        = "你的瀏覽器設為";
+$vocab["postbrowserlang"]    = "語系.";
+$vocab["addroom"]            = "新增會議室/設備";
+$vocab["capacity"]           = "容量";
+$vocab["norooms"]            = "沒有會議室/設備.";
+$vocab["administration"]     = "管理者";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "新增種類";
+$vocab["change"]             = "改變";
+$vocab["backadmin"]          = "回到管理首頁";
+$vocab["editroomarea"]       = "修改描述";
+$vocab["editroom"]           = "修改會議室/設備";
+$vocab["update_room_failed"] = "更新失敗: ";
+$vocab["error_room"]         = "錯誤: 會議室/設備 ";
+$vocab["not_found"]          = "找不到";
+$vocab["update_area_failed"] = "更新區域失敗: ";
+$vocab["error_area"]         = "錯誤: 區域 ";
+$vocab["room_admin_email"]   = "會議室管理者email:";
+$vocab["area_admin_email"]   = "區域管理者email:";
+$vocab["invalid_email"]      = "不合法的email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "這個動作會刪除相關的預約紀錄";
+$vocab["sure"]               = "確定嗎?";
+$vocab["YES"]                = "YES";
+$vocab["NO"]                 = "NO";
+$vocab["delarea"]            = "你必須先刪除所屬的會議室<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "關於MRBS";
+$vocab["database"]           = "資料庫: ";
+$vocab["system"]             = "系統: ";
+$vocab["please_contact"]     = "請聯絡";
+$vocab["for_any_questions"]  = ",關於任何在這裡找不到答案的問題.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fatal Error: 無法連上資料庫";
+
+?>
Index: web/session_ip.php
===================================================================
RCS file: web/session_ip.php
diff -N web/session_ip.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_ip.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,30 @@
+<?php
+
+/* $Id: session_ip.php,v 1.1 2007/04/05 22:25:33 arborrow Exp $
+ *
+ * Session management scheme that uses IP addresses to identify users.
+ * Anyone who can access the server can make bookings.
+ * Administrators are also identified by their IP address.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ * $auth["type"]    = "none";
+ * $auth["session"] = "ip";
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "127.0.0.1"; // Local host = the server you're running on
+ * $auth["admin"][] = "192.168.0.1";
+ */
+require_once("../../../config.php"); //for Moodle integration
+# No need to prompt for a name - ip address always there
+function authGet() { }
+
+function getUserName()
+{
+	global $REMOTE_ADDR;
+	return $REMOTE_ADDR;
+}
+
+?>
Index: web/lang.it.php
===================================================================
RCS file: web/lang.it.php
diff -N web/lang.it.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.it.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.it.php,v 1.1 2007/04/05 22:25:32 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is an Italian file.
+#
+# Translations provided by: Gianni
+#
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-1";
+
+# Used in style.php
+$vocab["mrbs"]               = "Sistema di Prenotazione Sale";
+
+# Used in functions.php
+$vocab["report"]             = "Report";
+$vocab["admin"]              = "Admin";
+$vocab["help"]               = "Aiuto";
+$vocab["search"]             = "Ricerca:";
+$vocab["not_php3"]             = "<H1>WARNING: This probably doesn't work with PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Prenotazioni per";
+$vocab["bookingsforpost"]    = "";
+$vocab["areas"]              = "Aree";
+$vocab["daybefore"]          = "Vai al Giorno Prima";
+$vocab["dayafter"]           = "Vai al Giorno Dopo";
+$vocab["gototoday"]          = "Vai a oggi";
+$vocab["goto"]               = "Vai a";
+$vocab["highlight_line"]     = "Highlight this line";
+$vocab["click_to_reserve"]   = "Click on the cell to make a reservation.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Vedi Giorno";
+$vocab["viewweek"]           = "Vedi Settimana";
+$vocab["viewmonth"]          = "Vedi Mese";
+$vocab["ppreview"]           = "Anteprima Stampa";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "Aggiungi";
+$vocab["editentry"]          = "Modifica";
+$vocab["editseries"]         = "Modifica Serie";
+$vocab["namebooker"]         = "Breve Descrizione:";
+$vocab["fulldescription"]    = "Descrizione Completa:<br>&nbsp;&nbsp;(Numero di persone,<br>&nbsp;&nbsp;Interno/Esterno ecc..)";
+$vocab["date"]               = "Data:";
+$vocab["start_date"]         = "Ora Inizio:";
+$vocab["end_date"]           = "Ora Fine:";
+$vocab["time"]               = "Ora:";
+$vocab["period"]             = "Period:";
+$vocab["duration"]           = "Durata:";
+$vocab["seconds"]            = "secondi";
+$vocab["minutes"]            = "minuti";
+$vocab["hours"]              = "ora";
+$vocab["days"]               = "giorni";
+$vocab["weeks"]              = "settimane";
+$vocab["years"]              = "anni";
+$vocab["periods"]            = "periods";
+$vocab["all_day"]            = "Tutto il giorno";
+$vocab["type"]               = "Tipo:";
+$vocab["internal"]           = "Interno";
+$vocab["external"]           = "Esterno";
+$vocab["save"]               = "Salva";
+$vocab["rep_type"]           = "Ripeti Tipo:";
+$vocab["rep_type_0"]         = "Nessuno";
+$vocab["rep_type_1"]         = "Giornaliero";
+$vocab["rep_type_2"]         = "Settimanale";
+$vocab["rep_type_3"]         = "Mensile";
+$vocab["rep_type_4"]         = "Annuale";
+$vocab["rep_type_5"]         = "Mensile, giorno corrispondente";
+$vocab["rep_type_6"]         = "nSettimanale";
+$vocab["rep_end_date"]       = "Ripeti data di Fine:";
+$vocab["rep_rep_day"]        = "Ripeti Girno:";
+$vocab["rep_for_weekly"]     = "(per (n-)settimanale)";
+$vocab["rep_freq"]           = "Frequenza:";
+$vocab["rep_num_weeks"]      = "Numero di settimane";
+$vocab["rep_for_nweekly"]    = "(per n-settimanale)";
+$vocab["ctrl_click"]         = "Use Control-Click to select more than one room";
+$vocab["entryid"]            = "Entry ID ";
+$vocab["repeat_id"]          = "Repeat ID "; 
+$vocab["you_have_not_entered"] = "You have not entered a";
+$vocab["you_have_not_selected"] = "You have not selected a";
+$vocab["valid_room"]         = "room.";
+$vocab["valid_time_of_day"]  = "valid time of day.";
+$vocab["brief_description"]  = "Brief Description.";
+$vocab["useful_n-weekly_value"] = "useful n-weekly value.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Descrizione:";
+$vocab["room"]               = "Sala";
+$vocab["createdby"]          = "Creato da:";
+$vocab["lastupdate"]         = "Ultima Modifica:";
+$vocab["deleteentry"]        = "Cancella";
+$vocab["deleteseries"]       = "Cancella Series";
+$vocab["confirmdel"]         = "Sei sicuro\\nche vuoi\\ncancellare l\'elemento?\\n\\n";
+$vocab["returnprev"]         = "Ritorna alla Pagina Precedente";
+$vocab["invalid_entry_id"]   = "Invalid entry id.";
+$vocab["invalid_series_id"]  = "Invalid series id.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Errore";
+$vocab["sched_conflict"]     = "Conflitto di Prenotazione";
+$vocab["conflict"]           = "La nuova prenotazione sar� in conflitto con questa(e):";
+$vocab["too_may_entrys"]     = "L'opzione selezionata crea troppe entit�.<BR>Per favore usa una opzione differente!";
+$vocab["returncal"]          = "Ritorna al calendario";
+$vocab["failed_to_acquire"]  = "Failed to acquire exclusive database access"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "Accesso Negato";
+$vocab["norights"]           = "Non hai i diritti per modificare questo oggetto.";
+$vocab["please_login"]       = "Please log in";
+$vocab["user_name"]          = "Name";
+$vocab["user_password"]      = "Password";
+$vocab["unknown_user"]       = "Unknown user";
+$vocab["you_are"]            = "You are";
+$vocab["login"]              = "Log in";
+$vocab["logoff"]             = "Log Off";
+
+# Authentication database
+$vocab["user_list"]          = "User list";
+$vocab["edit_user"]          = "Edit user";
+$vocab["delete_user"]        = "Delete this user";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Email address";
+$vocab["password_twice"]     = "If you wish to change the password, please type the new password twice";
+$vocab["passwords_not_eq"]   = "Error: The passwords do not match.";
+$vocab["add_new_user"]       = "Add a new user";
+$vocab["rights"]             = "Rights";
+$vocab["action"]             = "Action";
+$vocab["user"]               = "User";
+$vocab["administrator"]      = "Administrator";
+$vocab["unknown"]            = "Unknown";
+$vocab["ok"]                 = "OK";
+$vocab["show_my_entries"]    = "Click to display all my upcoming entries";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Valore di Ricerca vuoto o sbagliato.";
+$vocab["search_results"]     = "Risultati ricerca per:";
+$vocab["nothing_found"]      = "Nessun risultato trovato.";
+$vocab["records"]            = "Trovati ";
+$vocab["through"]            = " attraverso ";
+$vocab["of"]                 = " di ";
+$vocab["previous"]           = "Precedente";
+$vocab["next"]               = "Successivo";
+$vocab["entry"]              = "Valore";
+$vocab["view"]               = "Vista";
+$vocab["advanced_search"]    = "Advanced search";
+$vocab["search_button"]      = "Ricerca";
+$vocab["search_for"]         = "Search For";
+$vocab["from"]               = "From";
+
+# Used in report.php
+$vocab["report_on"]          = "Report su Meetings:";
+$vocab["report_start"]       = "Report su data inizio:";
+$vocab["report_end"]         = "Report su data fine:";
+$vocab["match_area"]         = "Trovata area:";
+$vocab["match_room"]         = "Trovata stanza:";
+$vocab["match_type"]         = "Match type:";
+$vocab["ctrl_click_type"]    = "Use Control-Click to select more than one type";
+$vocab["match_entry"]        = "Trovata descrizione breve:";
+$vocab["match_descr"]        = "Trovata descrizione completa:";
+$vocab["include"]            = "Includi:";
+$vocab["report_only"]        = "Solo Report";
+$vocab["summary_only"]       = "Solo Raggruppamento";
+$vocab["report_and_summary"] = "Report e Raggruppamento";
+$vocab["summarize_by"]       = "Raggruppa per:";
+$vocab["sum_by_descrip"]     = "Breve descrizione";
+$vocab["sum_by_creator"]     = "Creatore";
+$vocab["entry_found"]        = "trovato valore";
+$vocab["entries_found"]      = "trovati valori";
+$vocab["summary_header"]     = "Gruppo di (Valori) Ore";
+$vocab["summary_header_per"] = "Summary of (Entries) Periods";
+$vocab["total"]              = "Totale";
+$vocab["submitquery"]        = "Run Report";
+$vocab["sort_rep"]           = "Sort Report by:";
+$vocab["sort_rep_time"]      = "Start Date/Time";
+$vocab["rep_dsp"]            = "Display in report:";
+$vocab["rep_dsp_dur"]        = "Duration";
+$vocab["rep_dsp_end"]        = "End Time";
+
+# Used in week.php
+$vocab["weekbefore"]         = "Vai alla Settimana Precedente";
+$vocab["weekafter"]          = "Vai alla Settimana Successiva";
+$vocab["gotothisweek"]       = "Vai alla Settimana Corrente";
+
+# Used in month.php
+$vocab["monthbefore"]        = "Vai al Mese Precedente";
+$vocab["monthafter"]         = "Vai al Mese Successivo";
+$vocab["gotothismonth"]      = "Vai al Mese Corrente";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Non ci sono sale per questa Area";
+
+# Used in admin.php
+$vocab["edit"]               = "Edit";
+$vocab["delete"]             = "Delete";
+$vocab["rooms"]              = "Rooms";
+$vocab["in"]                 = "in";
+$vocab["noareas"]            = "No Areas";
+$vocab["addarea"]            = "Add Area";
+$vocab["name"]               = "Name";
+$vocab["noarea"]             = "No area selected";
+$vocab["browserlang"]        = "Your browser is set to use";
+$vocab["postbrowserlang"]    = "language.";
+$vocab["addroom"]            = "Add Room";
+$vocab["capacity"]           = "Capacity";
+$vocab["norooms"]            = "No rooms.";
+$vocab["administration"]     = "Administration";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Edit Area";
+$vocab["change"]             = "Change";
+$vocab["backadmin"]          = "Back to Admin";
+$vocab["editroomarea"]       = "Edit Area or Room Description";
+$vocab["editroom"]           = "Edit Room";
+$vocab["update_room_failed"] = "Update room failed: ";
+$vocab["error_room"]         = "Error: room ";
+$vocab["not_found"]          = " not found";
+$vocab["update_area_failed"] = "Update area failed: ";
+$vocab["error_area"]         = "Error: area ";
+$vocab["room_admin_email"]   = "Room admin email:";
+$vocab["area_admin_email"]   = "Area admin email:";
+$vocab["invalid_email"]      = "Invalid email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "This will delete the following bookings";
+$vocab["sure"]               = "Are you sure?";
+$vocab["YES"]                = "YES";
+$vocab["NO"]                 = "NO";
+$vocab["delarea"]            = "You must delete all rooms in this area before you can delete it<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "About MRBS";
+$vocab["database"]           = "Database: ";
+$vocab["system"]             = "System: ";
+$vocab["please_contact"]     = "Please contact ";
+$vocab["for_any_questions"]  = "for any questions that aren't answered here.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fatal Error: Failed to connect to database";
+
+?>
Index: web/mrbs_auth.php
===================================================================
RCS file: web/mrbs_auth.php
diff -N web/mrbs_auth.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/mrbs_auth.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,82 @@
+<?php
+// $Id: mrbs_auth.php,v 1.3 2008/08/01 04:02:11 arborrow Exp $
+require_once("../../../config.php"); //for Moodle integration
+// include the authentification wrappers
+include "auth_$auth[type].php";
+if (isset($auth['session'])) include "session_$auth[session].php";
+
+/* getAuthorised($user, $pass, $level)
+ * 
+ * Check to see if the user name/password is valid
+ * 
+ * $user  - The user name
+ * $pass  - The users password
+ * $level - The access level required
+ * 
+ * Returns:
+ *   0        - The user does not have the required access
+ *   non-zero - The user has the required access
+ */
+function getAuthorised($level)
+{
+    global $auth;
+
+    $user = getUserName();
+    if(isset($user) == FALSE) {
+        authGet();
+        return 0;
+    }
+
+    return authGetUserLevel($user, $auth["admin"]) >= $level;
+}
+
+/* getWritable($creator, $user)
+ * 
+ * Determines if a user is able to modify an entry
+ *
+ * $creator - The creator of the entry
+ * $user    - Who wants to modify it
+ *
+ * Returns:
+ *   0        - The user does not have the required access
+ *   non-zero - The user has the required access
+ */
+function getWritable($creator, $user)
+{
+    global $auth;
+
+    // Always allowed to modify your own stuff
+    if(strcasecmp($creator, $user) == 0)
+        return 1;
+
+    if(authGetUserLevel($user, $auth["admin"]) >= 2)
+        return 1;
+
+    // Unathorised access
+    return 0;
+}
+
+/* showAccessDenied()
+ * 
+ * Displays an appropate message when access has been denied
+ * 
+ * Retusns: Nothing
+ */
+function showAccessDenied($day, $month, $year, $area)
+{
+    global $HTTP_REFERER;
+
+    print_header_mrbs($day, $month, $year, $area);
+?>
+  <H1><?php echo get_string('accessdenied','block_mrbs')?></H1>
+  <P>
+   <?php echo get_string('norights','block_mrbs')?>
+  </P>
+  <P>
+   <A HREF="<?php echo $HTTP_REFERER; ?>"><?php echo get_string('returnprev','block_mrbs'); ?></A>
+  </P>
+ </BODY>
+</HTML>
+<?php
+}
+?>
Index: web/README.txt
===================================================================
RCS file: web/README.txt
diff -N web/README.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/README.txt	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,17 @@
+MRBS 1.2.3 Integration with Moodle
+README Notes prepared by Anthony Borrow (arborrow@jesuits.net)
+
+I have integrated MRBS with Moodle so that it does not require a second logon. The MRBS block reads the login information from Moodle's config.php file.
+I am NOT a security expert and am not aware of what security holes this integration my introduce to either MRBS and/or Moodle. There is no change to the Moodle code.
+The integration uses MRBS's external database authentication against the Moodle database's mdl_user table (username and password fields).
+
+Since Moodle already has a print_header() function, there was one conflict that I discovered between MRBS and Moodle.
+In the functions.php file there is a function called print_header() which using grep I have renamed to print_header_mrbs().
+In addition, to conform with Moodle file name conventions, I changed all of the file extensions to php.
+
+Installation
+
+1) Copy the mrbs folder to the Moodle blocks folder
+2) Login to Moodle and go to the admin page - the tables should be created
+3) Roles for mrbs_admin, mrbs_scheduler, and mrbs_viewer should be automatically created
+4) By default, the mrbs installation should be found at http://mymoodlesite.com/blocks/mrbs/web/index.php
Index: web/auth_ldap.php
===================================================================
RCS file: web/auth_ldap.php
diff -N web/auth_ldap.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_ldap.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,168 @@
+<?php
+
+// $Id: auth_ldap.php,v 1.7.2.4 2007/02/13 12:53:23 jberanek Exp $
+
+/* ~~JFL 2003/11/12 By default, use the http session mechanism */
+if (!isset($auth['session'])) $auth['session']='http';
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+
+require_once("../../../config.php");
+
+function authValidateUser($user, $pass)
+{
+	global $auth;
+	global $ldap_host;
+	global $ldap_port;
+	global $ldap_v3;
+	global $ldap_tls;
+	global $ldap_base_dn;
+	global $ldap_user_attrib;
+	global $ldap_filter;
+
+	$all_ldap_base_dn     = array();
+	$all_ldap_user_attrib = array();
+
+	// Check if we do not have a username/password
+	// User can always bind to LDAP anonymously with empty password,
+	// therefore we need to block empty password here...
+	if(!isset($user) || !isset($pass) || strlen($pass)==0)
+	{
+		return 0;
+	}
+
+	# Check that if there is an array of hosts and an array of ports
+	# then the number of each must be the same or the authenication
+	# is forced to fail.
+	if(is_array( $ldap_base_dn ) && is_array( $ldap_user_attrib ) && count($ldap_user_attrib) != count($ldap_base_dn) )
+	{
+		return 0;
+	}
+
+	# Transfer the based dn(s) to an new value to ensure that
+	# an array is always used.
+	# If a single value is passed then turn it into an array
+	if(is_array( $ldap_base_dn ) )
+	{
+		$all_ldap_base_dn = $ldap_base_dn;
+	}
+	else
+	{
+		$all_ldap_base_dn = array($ldap_base_dn);
+	}
+
+	# Transfer the array of user attributes to a new value.
+	# Create an array of the user attributes to match the number of
+	# base dn's if a single user attribute has been passed.
+	if(is_array( $ldap_user_attrib ) )
+	{
+		$all_ldap_user_attrib = $ldap_user_attrib;
+	}
+	else
+	{
+		while( each($all_ldap_base_dn ) )
+		{
+			$all_ldap_user_attrib[] = $ldap_user_attrib;
+		}
+	}
+
+	// establish ldap connection
+	// the '@' suppresses errors
+	if (isset($ldap_port))
+	{
+		$ldap = @ldap_connect($ldap_host, $ldap_port);
+	}
+	else
+	{
+		$ldap = @ldap_connect($ldap_host);
+	}
+
+	// Check that connection was established
+	if($ldap)
+	{
+		if ($ldap_v3)
+		{
+			ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
+		}
+		if ($ldap_tls)
+		{
+			ldap_start_tls($ldap);
+		}
+
+		// now process all base dn's until authentication is achieved
+		// or fail
+		foreach( $all_ldap_base_dn as $idx => $base_dn)
+		{
+			// construct dn for user
+			$dn = $all_ldap_user_attrib[$idx] . "=" . $user . "," . $base_dn;
+
+			// try an authenticated bind
+			// use this to confirm that the user/password pair
+			if(@ldap_bind($ldap, $dn, $pass))
+			{
+				// however if there is a filter check that the
+				// user is part of the group defined by the filter
+				if (! $ldap_filter)
+				{
+					@ldap_unbind($ldap);
+					return 1;
+				}
+				else
+				{
+					$res = @ldap_search(
+						$ldap,
+						$base_dn,
+						"(&(". $all_ldap_user_attrib[$idx] ."=$user)($ldap_filter))",
+						array()
+						);
+					if (@ldap_count_entries($ldap, $res) > 0)
+					{
+						@ldap_unbind($ldap);
+						return 1;
+					}
+				}
+			}
+		}
+		@ldap_unbind($ldap);
+	}
+	// return failure if no connection is established
+	return 0;
+}
+
+/* authGetUserLevel($user)
+ *
+ * Determines the users access level
+ *
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+    // User not logged in, user level '0'
+    if(!isset($user))
+        return 0;
+    
+    // Check if the user is can modify
+    for($i = 0; $lev1_admin[$i]; $i++)
+    {
+        if(strcasecmp($user, $lev1_admin[$i]) == 0)
+            return 2;
+    }
+    
+    // Everybody else is access level '1'
+    return 1;
+}
+
+?>
Index: web/auth_db.php
===================================================================
RCS file: web/auth_db.php
diff -N web/auth_db.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_db.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,73 @@
+<?php
+/*****************************************************************************\
+*									      *
+*   File name       auth_db.php						      *
+*									      *
+*   Description	    Authenticate users from a table in the MRBS database.     *
+*									      *
+*   Notes	    To use this authentication scheme, set in config.inc.php: *
+*			$auth["type"]  = "db";				      *
+*									      *
+*   History								      *
+*    2004/01/11 JFL Created this file					      *
+*									      *
+\*****************************************************************************/
+
+// $Id: auth_db.php,v 1.1 2007/04/05 22:25:24 arborrow Exp $
+
+require_once("../../../config.php");
+
+/* session_php.php and session_cookie.php will add a link to the user list
+    in the logon box, if the value $user_list_link is set. */
+
+$user_list_link = "edit_users.php";
+
+/* authValidateUser($user, $pass)
+ * 
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+
+function authValidateUser($user, $pass)
+{
+   global $tbl_users;
+
+   $user=slashes($user);
+   $user=strtolower($user);
+   $pass = md5($pass);
+   return sql_query1("select count(*) from $tbl_users where name='$user' and password='$pass';");
+}
+
+/* authGetUserLevel($user)
+ * 
+ * Determines the users access level
+ * 
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+   // User not logged in, user level '0'
+   if(!isset($user))
+      return 0;
+
+   // Check if the user is can modify
+   for($i = 0; isset($lev1_admin[$i]); $i++)
+   {
+      if(strcasecmp($user, $lev1_admin[$i]) == 0)
+	 return 2;
+   }
+
+   // Everybody else is access level '1'
+   return 1;
+}
+
+?>
Index: web/session_remote_user.php
===================================================================
RCS file: web/session_remote_user.php
diff -N web/session_remote_user.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/session_remote_user.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,90 @@
+<?php 
+/********************************************************************************************\
+*                                                                                            *
+*   File name       session_remote_user.inc                                                  *
+*                                                                                            *
+*   Description     Get user identity/password using the REMOTE_USER environment variable.   *
+*                   Both identity and password equal the value of REMOTE_USER.               *
+*                                                                                            *
+*   Notes           To use this session scheme, set in config.inc.php:                       *
+*                     $auth['session']  = 'remote_user';                                     *
+*                     $auth['type'] = 'none';
+*                                                                                            *
+*                   If you want to display a logout link, set in config.inc.php:             *
+*                     $auth['remote_user']['logout_link'] = '/logout/link.html';             *
+*                                                                                            *
+*   History                                                                                  *
+*    2006-01-04 Bjorn.Wiberg@its.uu.se  Created based on session_http.inc                    *
+*    2006-02-16 Bjorn.Wiberg@its.uu.se  Made logout link a configuration item                *
+*                                                                                            *
+\*********************************************************************************************/
+
+// $Id: session_remote_user.inc,v 1.1.2.1 2006/04/26 10:01:43 jberanek Exp $
+require_once("../../../config.php"); //for Moodle integration
+/* authGet()
+ * 
+ * Request the user name/password
+ * 
+ * Returns: Nothing
+ */
+function authGet()
+{
+  // User is expected to already be authenticated by the web server, so do nothing
+}
+
+function getUserName()
+{
+  if ((!isset($_SERVER['REMOTE_USER'])) || (!is_string($_SERVER['REMOTE_USER'])) || (empty($_SERVER['REMOTE_USER']))) {
+    return NULL;
+  } else {
+    return $_SERVER['REMOTE_USER'];
+  }
+}
+
+// Print the logon entry on the top banner.
+function PrintLogonBox()
+{
+	global $user_list_link;
+        global $auth;
+  
+	$user = getUserName();
+
+	if (isset($user))
+	{
+	// words 'you are xxxx' becomes a link to the
+        // report page with only entries created by xxx. Past entries are not
+        // displayed but this can be changed
+       	$search_string = "report.php?From_day=$day&From_month=$month&".
+          "From_year=$year&To_day=1&To_month=12&To_year=2030&areamatch=&".
+          "roommatch=&namematch=&descrmatch=&summarize=1&sortby=r&display=d&".
+          "sumby=d&creatormatch=$user"; ?>
+
+    <TD CLASS="banner" BGCOLOR="#C0E0FF" ALIGN=CENTER>
+      <A name="logonBox" href="<?php echo "$search_string\" title=\""
+         . get_vocab('show_my_entries') . "\">" . get_vocab('you_are')." "
+         .$user ?></A><br>
+<?php if (isset($user_list_link)) print "	  <br>\n	  " .
+	    "<A href='$user_list_link'>" . get_vocab('user_list') . "</A><br>\n" ;
+?>
+
+<?php
+// Retrieve logout link from configuration, if specified
+if (isset($auth['remote_user']['logout_link']) && is_string($auth['remote_user']['logout_link']) && (!empty($auth['remote_user']['logout_link']))) {
+  print '<A HREF="' . $auth['remote_user']['logout_link'] .'">' . get_vocab('logoff') . "</A><BR>\n";
+}
+?>
+
+    </TD>
+<?php
+    }
+    else
+    {
+?>
+    </TABLE>
+    <H1>Error, REMOTE_USER was not set when it should have been</H1>
+<?php
+    exit;
+    }
+}
+
+?>
Index: web/lang.cs.php
===================================================================
RCS file: web/lang.cs.php
diff -N web/lang.cs.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/lang.cs.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,251 @@
+<?php
+# $Id: lang.cs.php,v 1.1 2007/04/05 22:25:31 arborrow Exp $
+
+# This file contains PHP code that specifies language specific strings
+# The default strings come from lang.en, and anything in a locale
+# specific file will overwrite the default. This is a Czech file.
+#
+# Translations provided by: "SmEjDiL" <malyl@col.cz>, 
+#   "David Krotil" <David.Krotil@mu-sokolov.cz>
+#
+# This file is PHP code. Treat it as such.
+
+# The charset to use in "Content-type" header
+$vocab["charset"]            = "iso-8859-2";
+
+# Used in style.php
+$vocab["mrbs"]               = "MRBS - Rezerva�n� syst�m";
+
+# Used in functions.php
+$vocab["report"]             = "V�pis";
+$vocab["admin"]              = "Administr�tor";
+$vocab["help"]               = "Pomoc";
+$vocab["search"]             = "Hledat:";
+$vocab["not_php3"]             = "<H1>UPOZORN�N�: Toto z�ejm� nen� funk�n� s PHP3</H1>";
+
+# Used in day.php
+$vocab["bookingsfor"]        = "Objedn�no pro";
+$vocab["bookingsforpost"]    = ""; # Goes after the date
+$vocab["areas"]              = "Oblasti";
+$vocab["daybefore"]          = "Den vzad";
+$vocab["dayafter"]           = "Den vp�ed";
+$vocab["gototoday"]          = "Dnes";
+$vocab["goto"]               = "P�ej�t na";
+$vocab["highlight_line"]     = "Ozna�te tuto ��dku";
+$vocab["click_to_reserve"]   = "Klepn�te na bu�ku, aby jste provedli rezervaci.";
+
+# Used in trailer.php
+$vocab["viewday"]            = "Dny";
+$vocab["viewweek"]           = "T�dny";
+$vocab["viewmonth"]          = "M�s�ce ";
+$vocab["ppreview"]           = "Pro tisk";
+
+# Used in edit_entry.php
+$vocab["addentry"]           = "P�idat z�znam";
+$vocab["editentry"]          = "Editovat z�znam";
+$vocab["editseries"]         = "Editovat s�rii";
+$vocab["namebooker"]         = "Popis instrukce:";
+$vocab["fulldescription"]    = "Celkov� popis:<br>&nbsp;&nbsp;(Po�et cestuj�c�ch,<br>&nbsp;&nbsp;Obsazeno/Voln� m�sta atd)";
+$vocab["date"]               = "Datum:";
+$vocab["start_date"]         = "Za��tek:";
+$vocab["end_date"]           = "Konec:";
+$vocab["time"]               = "�as:";
+$vocab["period"]             = "Perioda:";
+$vocab["duration"]           = "Doba trv�n�:";
+$vocab["seconds"]            = "sekundy";
+$vocab["minutes"]            = "minuty";
+$vocab["hours"]              = "hodiny";
+$vocab["days"]               = "dny";
+$vocab["weeks"]              = "v�kendy";
+$vocab["years"]              = "roky";
+$vocab["periods"]            = "period";
+$vocab["all_day"]            = "V�echny dny";
+$vocab["type"]               = "Typ:";
+$vocab["internal"]           = "Voln� m�sta";
+$vocab["external"]           = "Obsazeno";
+$vocab["save"]               = "Ulo�it";
+$vocab["rep_type"]           = "Typ opakov�n�:";
+$vocab["rep_type_0"]         = "Nikdy";
+$vocab["rep_type_1"]         = "Denn�";
+$vocab["rep_type_2"]         = "T�dn�";
+$vocab["rep_type_3"]         = "M�s��n�";
+$vocab["rep_type_4"]         = "Ro�n�";
+$vocab["rep_type_5"]         = "M�s��n�, jednou za m�s�c";
+$vocab["rep_type_6"]         = "n-t�dn�";
+$vocab["rep_end_date"]       = "Konec opakov�n�:";
+$vocab["rep_rep_day"]        = "Opakovat v den:";
+$vocab["rep_for_weekly"]     = "(pro (n-)t�dn�)";
+$vocab["rep_freq"]           = "Frekvence:";
+$vocab["rep_num_weeks"]      = "�islo t�dne";
+$vocab["rep_for_nweekly"]    = "(pro n-t�dn�)";
+$vocab["ctrl_click"]         = "U��t CTRL pro v�b�r v�ce m�stnost�";
+$vocab["entryid"]            = "Vstupn� ID ";
+$vocab["repeat_id"]          = "ID pro opakov�n�"; 
+$vocab["you_have_not_entered"] = "Nevlo�il jste";
+$vocab["you_have_not_selected"] = "Nevybral jste";
+$vocab["valid_room"]         = "prost�edek.";
+$vocab["valid_time_of_day"]  = "platn� �asov� �sek dne.";
+$vocab["brief_description"]  = "Kr�tk� popis.";
+$vocab["useful_n-weekly_value"] = "pou�iteln� x-t�denn� hodnota.";
+
+# Used in view_entry.php
+$vocab["description"]        = "Popis:";
+$vocab["room"]               = "M�stnost:";
+$vocab["createdby"]          = "Vytvo�il u�ivatel:";
+$vocab["lastupdate"]         = "Posledn� zm�na:";
+$vocab["deleteentry"]        = "Smazat z�znam";
+$vocab["deleteseries"]       = "Smazat s�rii";
+$vocab["confirmdel"]         = "Jste si jist�\\nsmaz�n�m tohoto z�znamu?\\n\\n";
+$vocab["returnprev"]         = "N�vrat na p�edchoz� str�nku";
+$vocab["invalid_entry_id"]   = "�patn� ID z�znamu.";
+$vocab["invalid_series_id"]  = "�patn� ID skupiny.";
+
+# Used in edit_entry_handler.php
+$vocab["error"]              = "Chyba";
+$vocab["sched_conflict"]     = "Konflikt p�i pl�nov�n�";
+$vocab["conflict"]           = "Nov� rezervace je v konfliktu s jin�m z�znamem:";
+$vocab["too_may_entrys"]     = "Vybran� volba byla vytvo�ena pro jin� z�znamy.<BR>Pros�m vyberte jinou volbu!";
+$vocab["returncal"]          = "N�vrat do kalend��e";
+$vocab["failed_to_acquire"]  = "Chyba v�hradn�ho p��stupu do datab�ze"; 
+$vocab["mail_subject_entry"] = $mail["subject"];
+$vocab["mail_body_new_entry"] = $mail["new_entry"];
+$vocab["mail_body_del_entry"] = $mail["deleted_entry"];
+$vocab["mail_body_changed_entry"] = $mail["changed_entry"];
+$vocab["mail_subject_delete"] = $mail["subject_delete"];
+
+# Authentication stuff
+$vocab["accessdenied"]       = "P��stup zam�tnut";
+$vocab["norights"]           = "Nem�te p��stupov� pr�vo pro zm�nu t�to polo�ky.";
+$vocab["please_login"]       = "Pros�m, p�ihla�te se";
+$vocab["user_name"]          = "Jm�no";
+$vocab["user_password"]      = "Heslo";
+$vocab["unknown_user"]       = "Nezn�m� u�ivatel";
+$vocab["you_are"]            = "Jste";
+$vocab["login"]              = "P�ihl�sit se";
+$vocab["logoff"]             = "Odhl�sit se";
+
+# Authentication database
+$vocab["user_list"]          = "Seznam u�ivatel�";
+$vocab["edit_user"]          = "Editovat u�ivatele";
+$vocab["delete_user"]        = "Smazat tohoto u�ivatele";
+#$vocab["user_name"]         = Use the same as above, for consistency.
+#$vocab["user_password"]     = Use the same as above, for consistency.
+$vocab["user_email"]         = "Emailov� adresa";
+$vocab["password_twice"]     = "Pokud chcete zm�nit heslo, pros�m napi�te ho dvakr�t";
+$vocab["passwords_not_eq"]   = "Chyba: Vlo�en� hesla se neshoduj�.";
+$vocab["add_new_user"]       = "P�idat nov�ho u�ivatele";
+$vocab["rights"]             = "Pr�va";
+$vocab["action"]             = "Akce";
+$vocab["user"]               = "U�ivatel";
+$vocab["administrator"]      = "Administr�tor";
+$vocab["unknown"]            = "Nezn�m�";
+$vocab["ok"]                 = "Ano";
+$vocab["show_my_entries"]    = "Klepnout pro zobraz�n� v�ech nadch�zej�c�ch z�znam�";
+
+# Used in search.php
+$vocab["invalid_search"]     = "Pr�zdn� nebo neplatn� hledan� �et�zec.";
+$vocab["search_results"]     = "V�sledek hled�n� pro:";
+$vocab["nothing_found"]      = "Nic nenalezeno";
+$vocab["records"]            = "Z�znam";
+$vocab["through"]            = " skrze ";
+$vocab["of"]                 = " o ";
+$vocab["previous"]           = "P�edchozi";
+$vocab["next"]               = "Dal��";
+$vocab["entry"]              = "Z�znam";
+$vocab["view"]               = "N�hled";
+$vocab["advanced_search"]    = "Roz���en� hled�n�";
+$vocab["search_button"]      = "Hledat";
+$vocab["search_for"]         = "Hledat co";
+$vocab["from"]               = "Od";
+
+# Used in report.php
+$vocab["report_on"]          = "V�pis setk�n�:";
+$vocab["report_start"]       = "V�pis za��tk�:";
+$vocab["report_end"]         = "V�pis konc�:";
+$vocab["match_area"]         = "Hledan� oblast:";
+$vocab["match_room"]         = "Hledan� m�stnost:";
+$vocab["match_type"]         = "Hledan� typ:";
+$vocab["ctrl_click_type"]    = "U��t CTRL pro v�b�r v�ce typ�";
+$vocab["match_entry"]        = "Hledat v popisu:";
+$vocab["match_descr"]        = "Hledat v cel�m popisu:";
+$vocab["include"]            = "Zahrnovat:";
+$vocab["report_only"]        = "Jen v�pis";
+$vocab["summary_only"]       = "Jen p�ehled";
+$vocab["report_and_summary"] = "V�pis a p�ehled";
+$vocab["summarize_by"]       = "P�ehled od:";
+$vocab["sum_by_descrip"]     = "Popis instrukce";
+$vocab["sum_by_creator"]     = "Tv�rce";
+$vocab["entry_found"]        = "nalezeno";
+$vocab["entries_found"]      = "nalezeno";
+$vocab["summary_header"]     = "P�ehled  (z�znamu) hodiny";
+$vocab["summary_header_per"] = "P�ehled  (z�znamu) periody";
+$vocab["total"]              = "Celkem";
+$vocab["submitquery"]        = "Vytvo�it sestavu";
+$vocab["sort_rep"]           = "Se�adit v�pis podle:";
+$vocab["sort_rep_time"]      = "V�choz� den/�as";
+$vocab["rep_dsp"]            = "Zobrazit ve v�pisu:";
+$vocab["rep_dsp_dur"]        = "Trv�n�";
+$vocab["rep_dsp_end"]        = "�as ukon�en�";
+
+# Used in week.php
+$vocab["weekbefore"]         = "T�den dozadu";
+$vocab["weekafter"]          = "T�den dop�edu";
+$vocab["gotothisweek"]       = "Tento t�den";
+
+# Used in month.php
+$vocab["monthbefore"]        = "M�s�c dozadu";
+$vocab["monthafter"]         = "M�sic dop�edu";
+$vocab["gotothismonth"]      = "Tento m�s�c";
+
+# Used in {day week month}.php
+$vocab["no_rooms_for_area"]  = "Pro tuto m�stnost nen� definov�na �adn� oblast!";
+
+# Used in admin.php
+$vocab["edit"]               = "Editovat";
+$vocab["delete"]             = "Smazat";
+$vocab["rooms"]              = "M�stnosti";
+$vocab["in"]                 = "v";
+$vocab["noareas"]            = "��dn� oblasti";
+$vocab["addarea"]            = "P�idat oblast";
+$vocab["name"]               = "Jm�no";
+$vocab["noarea"]             = "Nen� vybr�na ��dn� oblast";
+$vocab["browserlang"]        = "Prohl�ec je nastaven k pou�it�";
+$vocab["postbrowserlang"]    = "jazyku.";
+$vocab["addroom"]            = "P�idat m�stnost";
+$vocab["capacity"]           = "Kapacita";
+$vocab["norooms"]            = "��dn� m�stnost.";
+$vocab["administration"]     = "Administrace";
+
+# Used in edit_area_room.php
+$vocab["editarea"]           = "Editovat oblast";
+$vocab["change"]             = "Zm�na";
+$vocab["backadmin"]          = "N�vrat do administrace";
+$vocab["editroomarea"]       = "Editovat popis oblasti nebo m�stnosti";
+$vocab["editroom"]           = "Editovat m�stnosti";
+$vocab["update_room_failed"] = "Chyba editace m�stnosti: ";
+$vocab["error_room"]         = "Chyba: m�stnost ";
+$vocab["not_found"]          = " nenalezen";
+$vocab["update_area_failed"] = "Chyba editace oblasti: ";
+$vocab["error_area"]         = "Chyba: oblast ";
+$vocab["room_admin_email"]   = "Email administr�tora m�stnosti:";
+$vocab["area_admin_email"]   = "Email administr�tora oblasti";
+$vocab["invalid_email"]      = "�patn� email!";
+
+# Used in del.php
+$vocab["deletefollowing"]    = "Bylo smaz�no rezervov�n�";
+$vocab["sure"]               = "Jste si jist�?";
+$vocab["YES"]                = "ANO";
+$vocab["NO"]                 = "NE";
+$vocab["delarea"]            = "Mus�te smazat v�echny m�stnosti v t�to oblasti p�edt�m ne� ji m�ete smazat<p>";
+
+# Used in help.php
+$vocab["about_mrbs"]         = "O MRBS";
+$vocab["database"]           = "Datab�ze: ";
+$vocab["system"]             = "Syst�m: ";
+$vocab["please_contact"]     = "Pros�m kontaktujte ";
+$vocab["for_any_questions"]  = "pokud m�te n�jak� dal�� ot�zky.";
+
+# Used in mysql.php AND pgsql.php
+$vocab["failed_connect_db"]  = "Fataln� chyba: Nepoda�ilo se p�ipojit do datab�ze";
+
+?>
Index: web/auth_pop3.php
===================================================================
RCS file: web/auth_pop3.php
diff -N web/auth_pop3.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/auth_pop3.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,173 @@
+<?php
+
+/* $Id: auth_pop3.php,v 1.1 2007/04/05 22:25:25 arborrow Exp $
+ *
+ * Authentication scheme that uses POP3 as the source for user
+ * authentication.
+ *
+ * To use this authentication scheme set the following
+ * things in config.inc.php:
+ *
+ * $auth["realm"] = "MRBS";    # Or any other string
+ * $auth["type"]  = "pop3";
+ *
+ * Then, you may configure admin users:
+ *
+ * $auth["admin"][] = "pop3user1";
+ * $auth["admin"][] = "pop3user2";
+ */
+
+require_once("../../../config.php");
+
+
+/* ~~JFL 2003/11/12 By default, use the http session mechanism */
+if (!isset($auth['session'])) $auth['session']='http';
+
+/* authValidateUser($user, $pass)
+ *
+ * Checks if the specified username/password pair are valid
+ * 
+ * $user  - The user name
+ * $pass  - The password
+ * 
+ * Returns:
+ *   0        - The pair are invalid or do not exist
+ *   non-zero - The pair are valid
+ */
+function authValidateUser($user, $pass)
+{
+   global $auth;
+   global $pop3_host;
+   global $pop3_port;
+   $match= array();
+   $shared_secret = "";
+   $all_pop3_hosts = array();
+   $all_pop3_ports = array();
+
+   // Check if we do not have a username/password
+   if(!isset($user) || !isset($pass) || strlen($pass)==0)
+   {
+      return 0;
+   }
+
+   # Check that if there is an array of hosts and an array of ports
+   # then the number of each is the same
+   if(is_array( $pop3_host ) && is_array( $pop3_port ) && count($pop3_port) != count($pop3_host) )
+   {
+      return 0;
+   }
+
+   # Transfer the list of pop3 hosts to an new value to ensure that
+   # an array is always used.
+   # If a single value is passed then turn it into an array
+   if(is_array( $pop3_host ) )
+   {
+      $all_pop3_hosts = $pop3_host;
+   }
+   else
+   {
+      $all_pop3_hosts = array($pop3_host);
+   }
+
+   # create an array of the port numbers to match the number of
+   # hosts if a single port number has been passed.
+   if(is_array( $pop3_port ) )
+   {
+      $all_pop3_ports = $pop3_port;
+   }
+   else
+   {
+       while( each($all_pop3_hosts ) )
+       {
+          $all_pop3_ports[] = $pop3_port;
+       }
+   }
+
+   # iterate over all hosts and return if you get a successful login
+   foreach( $all_pop3_hosts as $idx => $host)
+   {
+      $error_number = "";
+      $error_string = "";
+
+      // Connect to POP3 server
+      $stream = fsockopen( $host, $all_pop3_ports[$idx], $error_number, $error_string, 15 );
+      $response = fgets( $stream, 1024 );
+
+      // first we try to use APOP, and then if that fails we fall back to traditional stuff
+
+      // get the shared secret ( something on the greeting line that looks like <XXXX> )
+      if ( preg_match( '/(<[^>]*>)/', $response, $match ) )
+      {
+	  $shared_secret = $match[0];
+      }
+
+      // if we have a shared secret then try APOP
+      if ($shared_secret) {
+	 $md5_token = md5("$shared_secret$pass");
+
+	 if ($stream) {
+	    $auth_string = "APOP $user $md5_token\r\n";
+	    fputs( $stream, $auth_string );
+
+	    // read the response. if it's an OK then we're authenticated
+	    $response = fgets( $stream, 1024 );
+	    if( substr( $response, 0, 3 ) == '+OK' ) {
+	       fputs( $stream, "QUIT\r\n" );
+	       return 1;
+	    }
+	 }
+      } // end shared secret if
+
+      // if we've still not authenticated then try using traditional methods
+      // need to reconnect if we tried APOP
+      if ($shared_secret) {
+	 $stream = fsockopen( $host, $all_pop3_ports[$idx], $error_number, $error_string, 15 );
+	 $response = fgets( $stream, 1024 );
+      }
+
+      // send standard POP3 USER and PASS commands
+      if( $stream ) {
+	 fputs( $stream, "USER $user\r\n" );
+	 $response = fgets( $stream, 1024 );
+	 if( substr( $response, 0, 3 ) == '+OK' ) {
+	    fputs( $stream, "PASS $pass\r\n" );
+	    $response = fgets( $stream, 1024 );
+	    if( substr( $response, 0, 3 ) == '+OK' ) {
+	       return 1;
+	    }
+	 }
+	 fputs( $stream, "QUIT\r\n" );
+      }
+   }
+
+   // return failure
+   return 0;
+}
+
+/* authGetUserLevel($user)
+ * 
+ * Determines the users access level
+ * 
+ * $user - The user name
+ *
+ * Returns:
+ *   The users access level
+ */
+function authGetUserLevel($user, $lev1_admin)
+{
+   // User not logged in, user level '0'
+   if(!isset($user))
+      return 0;
+
+   // Check if the user is can modify
+   for($i = 0; $lev1_admin[$i]; $i++)
+   {
+      if(strcasecmp($user, $lev1_admin[$i]) == 0)
+	 return 2;
+   }
+
+   // Everybody else is access level '1'
+   return 1;
+}
+
+?>
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .project	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>mrbs</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
Index: web/version.php
===================================================================
RCS file: web/version.php
diff -N web/version.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ web/version.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,14 @@
+<?php
+
+# This should probably be a class, but you can only have protected
+# class members in PHP 5, so we won't bother
+require_once("../../../config.php"); //for Moodle integration
+function get_mrbs_version()
+{
+  # MRBS developers, make sure to update this string before each release
+  $mrbs_version = "MRBS 1.2.5";
+
+  return $mrbs_version;
+}
+
+?>
