diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/cmdshell.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/cmdshell.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/cmdshell.php	2006-02-24 23:48:29.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/cmdshell.php	2007-01-02 14:54:03.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/cmdshell.php,v 1.9.10.6 2006/02/24 22:48:29 chuck Exp $
+ * $Horde: horde/admin/cmdshell.php,v 1.9.10.7 2007/01/02 13:54:03 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/datatree.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/datatree.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/datatree.php	2006-02-01 10:30:46.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/datatree.php	2007-02-08 01:03:00.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/datatree.php,v 1.7.2.4 2006/02/01 09:30:46 selsky Exp $
+ * $Horde: horde/admin/datatree.php,v 1.7.2.6 2007/02/08 00:03:00 jan Exp $
  *
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -69,8 +69,10 @@
 $tree->renderTree();
 if ($show) {
     echo '<br /><div class="text" style="white-space:pre"><a id="show"></a>';
+    ob_start('htmlspecialchars');
     print_r($data);
     print_r($attributes);
+    ob_end_flush();
     echo '</div>';
 }
 require HORDE_TEMPLATES . '/common-footer.inc';
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/groups.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/groups.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/groups.php	2006-07-13 11:01:53.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/groups.php	2007-01-02 14:54:03.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/groups.php,v 1.50.2.6 2006/07/13 09:01:53 jan Exp $
+ * $Horde: horde/admin/groups.php,v 1.50.2.8 2007/01/02 13:54:03 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -44,11 +44,16 @@
     $parent = $cid;
     if ($parent == DATATREE_ROOT) {
         $child = &$groups->newGroup(Util::getFormData('child'));
-        $result = $groups->addGroup($child);
     } else {
         $child = &$groups->newGroup(Util::getFormData('child'), $parent);
-        $result = $groups->addGroup($child);
     }
+    if (is_a($child, 'PEAR_Error')) {
+        Horde::logMessage($child, __FILE__, __LINE__, PEAR_LOG_ERR);
+        $notification->push(sprintf(_("Group was not created: %s."), $child->getMessage()), 'horde.error');
+        break;
+    }
+
+    $result = $groups->addGroup($child);
     if (is_a($result, 'PEAR_Error')) {
         Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
         $notification->push(sprintf(_("\"%s\" was not created: %s."), $child->getShortName(), $result->getMessage()), 'horde.error');
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/index.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/index.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/index.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/index.php	2007-01-02 14:54:03.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/index.php,v 1.15.8.3 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/index.php,v 1.15.8.4 2007/01/02 13:54:03 jan Exp $
  *
- * Copyright 1999-2006 Charles J. Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Charles J. Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/addchild.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/addchild.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/addchild.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/addchild.php	2007-01-02 14:54:04.000000000 +0100
@@ -1,9 +1,9 @@
 <?php
 /**
- * $Horde: horde/admin/perms/addchild.php,v 1.27.2.4 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/perms/addchild.php,v 1.27.2.5 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/delete.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/delete.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/delete.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/delete.php	2007-01-02 14:54:04.000000000 +0100
@@ -1,9 +1,9 @@
 <?php
 /**
- * $Horde: horde/admin/perms/delete.php,v 1.19.8.4 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/perms/delete.php,v 1.19.8.5 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/edit.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/edit.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/edit.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/edit.php	2007-01-02 14:54:04.000000000 +0100
@@ -1,9 +1,9 @@
 <?php
 /**
- * $Horde: horde/admin/perms/edit.php,v 1.38.2.5 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/perms/edit.php,v 1.38.2.6 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/index.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/index.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/perms/index.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/perms/index.php	2007-01-02 14:54:04.000000000 +0100
@@ -1,9 +1,9 @@
 <?php
 /**
- * $Horde: horde/admin/perms/index.php,v 1.10.10.3 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/perms/index.php,v 1.10.10.4 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/phpshell.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/phpshell.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/phpshell.php	2006-02-24 23:48:29.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/phpshell.php	2007-01-02 14:54:03.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/phpshell.php,v 1.24.10.8 2006/02/24 22:48:29 chuck Exp $
+ * $Horde: horde/admin/phpshell.php,v 1.24.10.9 2007/01/02 13:54:03 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/sessions.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/sessions.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/sessions.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/sessions.php	2007-01-02 14:54:03.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/sessions.php,v 1.2.2.3 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/sessions.php,v 1.2.2.4 2007/01/02 13:54:03 jan Exp $
  *
- * Copyright 2005-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/config.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/config.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/config.php	2006-03-30 12:15:30.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/config.php	2007-01-02 14:54:04.000000000 +0100
@@ -1,9 +1,9 @@
 <?php
 /**
- * $Horde: horde/admin/setup/config.php,v 1.24.4.10 2006/03/30 10:15:30 selsky Exp $
+ * $Horde: horde/admin/setup/config.php,v 1.24.4.11 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 1999-2006 Charles J. Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Charles J. Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/diff.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/diff.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/diff.php	2006-05-23 04:13:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/diff.php	2007-01-02 14:54:04.000000000 +0100
@@ -3,9 +3,9 @@
  * Script to show the differences between the currently saved and the newly
  * generated configuration.
  *
- * $Horde: horde/admin/setup/diff.php,v 1.4.10.5 2006/05/23 02:13:42 selsky Exp $
+ * $Horde: horde/admin/setup/diff.php,v 1.4.10.6 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 2004-2006 The Horde Project (http://www.horde.org/)
+ * Copyright 2004-2007 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/index.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/index.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/index.php	2006-03-28 14:31:08.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/index.php	2007-01-02 14:54:04.000000000 +0100
@@ -1,9 +1,9 @@
 <?php
 /**
- * $Horde: horde/admin/setup/index.php,v 1.28.4.12 2006/03/28 12:31:08 jan Exp $
+ * $Horde: horde/admin/setup/index.php,v 1.28.4.13 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 1999-2006 Charles J. Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Charles J. Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/scripts.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/scripts.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/setup/scripts.php	2006-06-16 10:24:27.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/setup/scripts.php	2007-01-02 14:54:04.000000000 +0100
@@ -4,10 +4,10 @@
  * of PHP upgrade scripts for conf.php files either as download or saved to the
  * server's temporary directory.
  *
- * $Horde: horde/admin/setup/scripts.php,v 1.9.10.6 2006/06/16 08:24:27 jan Exp $
+ * $Horde: horde/admin/setup/scripts.php,v 1.9.10.7 2007/01/02 13:54:04 jan Exp $
  *
- * Copyright 1999-2006 Charles J. Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Charles J. Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/sqlshell.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/sqlshell.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/sqlshell.php	2006-02-24 23:48:29.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/sqlshell.php	2007-01-02 14:54:03.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/sqlshell.php,v 1.18.10.9 2006/02/24 22:48:29 chuck Exp $
+ * $Horde: horde/admin/sqlshell.php,v 1.18.10.10 2007/01/02 13:54:03 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/templates.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/templates.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/templates.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/templates.php	2007-01-02 14:54:03.000000000 +0100
@@ -2,7 +2,7 @@
 /**
  * Horde Template Admin
  *
- * $Horde: horde/admin/templates.php,v 1.15.10.3 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/templates.php,v 1.15.10.4 2007/01/02 13:54:03 jan Exp $
  *
  * First stab at a template loader for horde, to be used by the horde
  * admin to load alternate individual templates or entire themes for the
@@ -25,7 +25,7 @@
  *   checking; downloading of original templates; the application side of
  *   allowing a different template to be chosen/prefs/etc.
  *
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/admin/user.php /tmp/aodTV4Q0QM/horde3-3.1.4/admin/user.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/admin/user.php	2006-01-01 22:28:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/admin/user.php	2007-01-02 14:54:03.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/admin/user.php,v 1.47.10.7 2006/01/01 21:28:05 jan Exp $
+ * $Horde: horde/admin/user.php,v 1.47.10.10 2007/01/02 13:54:03 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -23,21 +23,25 @@
 
 if ($conf['signup']['allow'] && $conf['signup']['approve']) {
     require_once 'Horde/Auth/Signup.php';
-    $signup = &Auth_Signup::singleton();
+    $signup = new Auth_Signup();
 }
 
-$vars = &Variables::getDefaultVariables();
+$vars = Variables::getDefaultVariables();
 $addForm = &new Horde_Form($vars, _("Add a new user:"), 'adduser');
 $addForm->setButtons(_("Add user"), _("Reset"));
 
 $vars->set('form', 'add');
 $addForm->addHidden('', 'form', 'text', true, true);
-$addForm->addVariable(_("Username"), 'user_name', 'text', true);
-$addForm->addVariable(_("Password"), 'password', 'passwordconfirm', false, false, _("type the password twice to confirm"));
 
 /* Use hooks get any extra fields for new accounts. */
 $extra = Horde::callHook('_horde_hook_signup_getextra');
 if (!is_a($extra, 'PEAR_Error') && !empty($extra)) {
+    if (!isset($extra['user_name'])) {
+        $addForm->addVariable(_("Username"), 'user_name', 'text', true);
+    }
+    if (!isset($extra['password'])) {
+        $addForm->addVariable(_("Password"), 'password', 'passwordconfirm', false, false, _("type the password twice to confirm"));
+    }
     foreach ($extra as $field_name => $field) {
         $readonly = isset($field['readonly']) ? $field['readonly'] : null;
         $desc = isset($field['desc']) ? $field['desc'] : null;
@@ -45,6 +49,9 @@
 
         $addForm->addVariable($field['label'], 'extra[' . $field_name . ']', $field['type'], $field['required'], $readonly, $desc, $field_params);
     }
+} else {
+    $addForm->addVariable(_("Username"), 'user_name', 'text', true);
+    $addForm->addVariable(_("Password"), 'password', 'passwordconfirm', false, false, _("type the password twice to confirm"));
 }
 
 
@@ -138,6 +145,7 @@
     $fullname = Util::getPost('user_fullname');
     $email = Util::getPost('user_email');
 
+    $result = false;
     if ($auth->hasCapability('update')) {
         $user_pass_1 = Util::getPost('user_pass_1');
         $user_pass_2 = Util::getPost('user_pass_2');
@@ -155,7 +163,7 @@
         }
     }
 
-    if (isset($result) && is_a($result, 'PEAR_Error')) {
+    if (is_a($result, 'PEAR_Error')) {
         $notification->push(sprintf(_("There was a problem updating \"%s\": %s"),
                                     $user_name_1, $result->getMessage()), 'horde.error');
     } else {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/config/conf.xml /tmp/aodTV4Q0QM/horde3-3.1.4/config/conf.xml
--- /tmp/3MTByFMvwV/horde3-3.1.3/config/conf.xml	2007-07-22 07:32:06.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/config/conf.xml	2007-07-22 07:32:12.000000000 +0200
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
-<!-- $Horde: horde/config/conf.xml,v 1.74.2.41 2006/08/04 17:13:25 jan Exp $ -->
+<!-- $Horde: horde/config/conf.xml,v 1.74.2.48 2007/02/02 11:03:05 jan Exp $ -->
 <configuration>
  <configtab name="general" desc="General">
-  <configheader>General Horde Settings</configheader>
+  <configheader>PHP Settings</configheader>
   <configphp name="debug_level" desc="The value to set
   error_reporting() to.
   See http://www.php.net/manual/function.error-reporting.php for more
@@ -12,6 +12,20 @@
   limit; however, a value of 0 will cause a warning if you are running in safe
   mode. See http://www.php.net/manual/function.set-time-limit.php for more
   information.">0</configinteger>
+  <configboolean name="compress_pages" desc="If this option is set to true, and
+  you have the php zlib extension, pages over a certain size will be compressed
+  and sent to the browser as gzip-encoded data in order to save
+  bandwidth. There is a CPU-usage penalty to pay for this, but the decrease in
+  page size can be dramatic (70k to under 10k for a full mailbox page), and is
+  more than worth it over anything but an extremely fast
+  link.">true</configboolean>
+  <configinteger name="umask" octal="true" desc="What umask should we run
+  with? This will affect the permissions on any temporary files that are
+  created. This value is an integer.">077</configinteger>
+  <configstring name="tmpdir" required="false" desc="If you want to use a
+  temporary directory other than the system default or the one specified in
+  php's upload_tmp_dir value, enter it here."/>
+  <configheader>URL Settings</configheader>
   <configenum name="use_ssl" quote="false" desc="Determines how we generate
   full URLs (for location headers and such).&lt;br /&gt;NOTE: If you choose to
   always generate https URLs, you MUST hardcode the correct HTTPS port number
@@ -35,28 +49,19 @@
    you do. The exception is if you have chosen to always generate https URLs, as
    described above.">$_SERVER['SERVER_PORT']</configphp>
   </configsection>
-  <configboolean name="compress_pages" desc="If this option is set to true, and
-  you have the php zlib extension, pages over a certain size will be compressed
-  and sent to the browser as gzip-encoded data in order to save
-  bandwidth. There is a CPU-usage penalty to pay for this, but the decrease in
-  page size can be dramatic (70k to under 10k for a full mailbox page), and is
-  more than worth it over anything but an extremely fast
-  link.">true</configboolean>
-  <configinteger name="umask" octal="true" desc="What umask should we run with? This will affect the permissions on any temporary files that are created. This value is an integer.">077</configinteger>
-  <configstring name="tmpdir" required="false" desc="If you want to use a
-  temporary directory other than the system default or the one specified in
-  php's upload_tmp_dir value, enter it here."/>
+  <configheader>Session Settings</configheader>
   <configsection name="session">
-   <configstring name="name" desc="What name should we use for the session that
-   Horde apps share? If you want to share sessions with other applications on
-   your webserver, you will need to make sure that they are using the same
-   session name.  Note: Session names must consist of only alphanumeric
-   characters.">Horde</configstring>
+   <configstring name="name" desc="What name should we use for the session
+   that Horde applications share? If you want to share sessions with other
+   applications on your webserver, you will need to make sure that they are
+   using the same session name.  Note: Session names must consist of only
+   alphanumeric characters.">Horde</configstring>
    <configboolean name="use_only_cookies" desc="Should we only allow session
    information to be stored in a session cookie and not be passed by URL (GET)
    parameters? This is on by default because passing session information in
-   the URL is a security risk. Consider carefully before turning it off.">
-   true</configboolean>
+   the URL is a security risk. &lt;b&gt;Consider carefully before turning it
+   off&lt;/b&gt;. Cookies must be working and enabled in the browser though, or
+   you won't be able to login to Horde.">true</configboolean>
    <configstring name="cache_limiter" desc="What caching level should we use
    for the session? DO NOT CHANGE THIS UNLESS YOU &lt;strong&gt;REALLY&lt;/strong&gt; KNOW
    WHAT YOU ARE DOING. Setting this to anything other than 'nocache' will almost
@@ -69,8 +74,11 @@
   <configsection name="cookie">
    <configphp name="domain" desc="What domain should we set cookies from? If
    you have a cluster that needs to share cookies, this might be '.example.com'
-   - the leading '.' is important. Most likely, though, you won't have to change
-   the default.">$_SERVER['SERVER_NAME']</configphp>
+   - the leading '.' is important. If you only use session cookies (see
+   above), but your are running Horde on an intranet server without a domain
+   part, i.e. http//horde/, you need to set this value to ''. Most likely,
+   though, you won't have to change the
+   default.">$_SERVER['SERVER_NAME']</configphp>
    <configstring name="path" desc="What path should we set cookies to? This
    should match where Horde is on your webserver - if it is at /horde3, then this
    should be '/horde3'. If Horde is installed as the document root, then this
@@ -225,10 +233,13 @@
 
     <case name="kolab" desc="Kolab authentication">
      <configsection name="params">
-      <configboolean name="login_block" desc="Should the login be blocked after a given number of failed logins?">
+      <configboolean name="login_block" desc="Should the login be
+      blocked after a given number of failed logins?">
       false</configboolean>
-      <configinteger name="login_block_count" desc="After howmany failed logins the login should be blocked?">3</configinteger>
-      <configinteger name="login_block_time" desc="Howmany minutes the login should be blocked?">5</configinteger>
+      <configinteger name="login_block_count" desc="After how many
+      failed logins the login should be blocked?">3</configinteger>
+      <configinteger name="login_block_time" desc="How many minutes
+      the login should be blocked?">5</configinteger>
      </configsection>
     </case>
 
@@ -334,7 +345,7 @@
      </configsection>
     </case>
 
-    <case name="sasl" desc="SASL authentication">
+    <case name="peclsasl" desc="SASL authentication">
      <configsection name="params">
       <configstring name="app" desc="The name of the authenticating
       application">horde</configstring>
@@ -343,7 +354,7 @@
      </configsection>
     </case>
 
-    <case name="smb" desc="SMB authentication">
+    <case name="smb" desc="SMB (smbauth extension) authentication">
      <configsection name="params">
       <configstring name="hostspec" desc="IP, DNS Name, or NetBios Name of the
       SMB server to authenticate with">localhost</configstring>
@@ -353,6 +364,15 @@
      </configsection>
     </case>
 
+    <case name="smbclient" desc="SMB (smbclient) authentication">
+     <configsection name="params">
+      <configstring name="hostspec" desc="IP, DNS Name, or NetBios Name of the
+      SMB server to authenticate with">localhost</configstring>
+      <configstring name="domain" desc="The domain name to authenticate with"/>
+      <configstring name="smbclient_path" desc="The location of the smbclient program">/usr/bin/smbclient</configstring>
+     </configsection>
+    </case>
+
     <case name="sql" desc="SQL authentication">
      <configsection name="params">
       <configsql switchname="driverconfig" />
@@ -927,7 +947,14 @@
    <configheader>Custom Session Handler</configheader>
    <configswitch name="type" desc="What sessionhandler driver should we
    use?">none
-    <case name="none" desc="Use the default PHP (file-based) session handler"/>
+    <case name="none" desc="Use the default PHP session handler (file-based by default)">
+     <configdescription>
+      If you have configured a custom session extension in php.ini,
+      such as mm sessions, then you should use this option. Horde
+      doesn't force PHP to use the file-based session handler, so your
+      php.ini settings will be deferred to this way.
+     </configdescription>
+    </case>
     <case name="external" desc="Use your own custom session handler">
      <configsection name="params">
       <configstring name="open" desc="Your open() function"/>
@@ -1277,6 +1304,19 @@
         <value desc="LDAPv3">3</value>
        </values>
       </configenum>
+      <configboolean name="strip" desc="Strip domain from user
+      name?">false</configboolean>
+     </configsection>
+    </case>
+    <case name="kolab" desc="Kolab (LDAP)">
+     <configsection name="params">
+      <configdescription>This will use the parameters set in the Kolab
+      Groupware Server tab. You must enable Kolab integration for this to
+      work.</configdescription>
+      <configstring name="attr" desc="LDAP attribute to search
+      on">uid</configstring>
+      <configboolean name="strip" desc="Strip domain from user
+      name?">false</configboolean>
      </configsection>
     </case>
    </configswitch>
@@ -1342,28 +1382,26 @@
       <configstring name="server" desc="Server
       address:">localhost</configstring>
       <configinteger name="port" desc="Server port:">389</configinteger>
-      <configstring name="basedn" desc="Base DN:">dc=example,
-      dc=com</configstring>
-      <configstring name="binddn" desc="Bind DN:">cn=manager, cn=internal,
-      dc=example, dc=com</configstring>
-      <configstring name="bindpw" desc="Bind Password:">password</configstring>
-      <configstring name="phpdn" desc="Search DN:">cn=nobody, cn=internal,
-      dc=example, dc=com</configstring>
-      <configstring name="phppw" desc="Search
-      Password:">password</configstring>
+      <configstring name="basedn" desc="Base
+      DN:">dc=example,dc=com</configstring>
+      <configstring name="binddn" desc="Bind
+      DN:">cn=manager,cn=internal,dc=example,dc=com</configstring>
+      <configstring name="bindpw" desc="Bind Password:"/>
+      <configstring name="phpdn" desc="Search
+      DN:">cn=nobody,cn=internal,dc=example,dc=com</configstring>
+      <configstring name="phppw" desc="Search Password:"/>
      </configsection>
      <configheader>Kolab Cyrus IMAP Server Settings</configheader>
      <configsection name="imap">
       <configstring name="server" desc="Server
-      address:">mail.example.com</configstring>
+      address:">localhost</configstring>
       <configinteger name="port" desc="Server port:">143</configinteger>
       <configinteger name="sieveport" desc="Sieve port:">2000</configinteger>
       <configstring name="maildomain" desc="Default
       maildomain:">example.com</configstring>
       <configstring name="adminuser" desc="Administrator
       user:">manager</configstring>
-      <configstring name="adminpw" desc="Administrator
-      password:">password</configstring>
+      <configstring name="adminpw" desc="Administrator password:"/>
       <configboolean name="virtdomains" desc="Virtual
       domains:">true</configboolean>
      </configsection>
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/config/hooks.php.dist /tmp/aodTV4Q0QM/horde3-3.1.4/config/hooks.php.dist
--- /tmp/3MTByFMvwV/horde3-3.1.3/config/hooks.php.dist	2006-05-23 04:13:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/config/hooks.php.dist	2006-08-19 01:26:32.000000000 +0200
@@ -44,7 +44,7 @@
  *    we saved the results of the hook for them. However, if the preference is
  *    locked, the result of the hook will never be saved.
  *
- * $Horde: horde/config/hooks.php.dist,v 1.73.6.13 2006/05/23 02:13:42 selsky Exp $
+ * $Horde: horde/config/hooks.php.dist,v 1.73.6.14 2006/08/18 23:26:32 chuck Exp $
  */
 
 // Example theme hook function. This shows how you can access things like the
@@ -130,6 +130,9 @@
 //
 //         if (is_null($user)) {
 //             $user = Auth::getAuth();
+//             if ($user === false) {
+//                 return '';
+//             }
 //         }
 //
 //         // You will probably need to replace cn= with uid=; this
@@ -156,6 +159,9 @@
 //     {
 //         if (is_null($user)) {
 //             $user = Auth::getBareAuth();
+//             if ($user === false) {
+//                 return '';
+//             }
 //         }
 //         $array = posix_getpwnam($user);
 //         $gecos_array = explode(',', $array['gecos']);
@@ -180,6 +186,9 @@
 //
 //         if (is_null($user)) {
 //             $user = Auth::getAuth();
+//             if ($user === false) {
+//                 return '';
+//             }
 //         }
 //         $searchResult = @ldap_search($ds, $searchBase, 'uid=' . $user);
 //         $information = @ldap_get_entries($ds, $searchResult);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/config/prefs.php.dist /tmp/aodTV4Q0QM/horde3-3.1.4/config/prefs.php.dist
--- /tmp/3MTByFMvwV/horde3-3.1.3/config/prefs.php.dist	2006-06-22 20:47:55.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/config/prefs.php.dist	2006-12-08 16:29:16.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * $Horde: horde/config/prefs.php.dist,v 1.85.2.7 2006/06/22 18:47:55 chuck Exp $
+ * $Horde: horde/config/prefs.php.dist,v 1.85.2.8 2006/12/08 15:29:16 jan Exp $
  *
  * Preferences Information
  * =======================
@@ -27,34 +27,47 @@
  * The $_prefs array's are listed in the same order as listed in the
  * members element of $prefGroups.
  *
- *   value: This entry will either hold a number or a text value based on the
+ *   value: This entry will hold the default preference value depending on the
  *          preference type:
+ *            checkbox:  0 or false for unchecked, 1 or true for checked
+ *                enum:  Preselected item from associated enumeration
  *            implicit:  See Preference type
- *                text:  Text value
+ *                link:  Not used
  *              number:  Number value
- *            checkbox:  Value should be 0 for unchecked, 1 for checked
- *              select:  Value associated with that selection list
+ *            password:  Should be ''
+ *              select:  Preselected item from associated selection list
+ *             special:  Not used
+ *                text:  Text value
+ *            textarea:  Text value, lines separated with "\n"
  *
  *  locked: Allow preference to be changed from UI
- *             true:  Do not show this preference in the UI
- *            false:  Show this preference in the UI and allow changing
+ *             true:  Do not show this preference in the UI.
+ *                    This has no effect on 'link' type preferences.
+ *            false:  Show this preference in the UI and allow changing.
  *
  *  shared: Share with other horde apps
  *             true:  Share this pref with other Horde apps
  *            false:  Keep this pref local to the current app
  *
  *    type: Preference type
- *             special:  Provides a UI widget
- *              select:  Provides a selection list in the UI
- *            checkbox:  Provides a checkbox
- *            implicit:  Provides storage for 'special' types
+ *            checkbox:  Provides a checkbox.
+ *                enum:  Provides a selection list in the UI, list is
+ *                       specified in the associated 'enum' setting.
+ *            implicit:  Provides storage for 'special' types.
+ *                link:  Provides a link to another data entry form.
+ *              number:  Provides a 3-character textbox to enter a natural
+ *                       number; syntaxcheck is performed after data entry.
  *            password:  Provides a textbox for password entry.
- *                enum:  Use static list of elements...similar to 'select'
+ *              select:  Provides a selection list in the UI that is built in
+ *                       lib/prefs.php.
+ *             special:  Provides an UI widget.
+ *                text:  Provides a single-line textbox.
+ *            textarea:  Provides a multi-line textbox.
  *
- *    enum: Static list of elements.
+ *    enum: Static list of elements for 'type' => 'enum'.
  *
- * escaped: For an enum or a select, are the keys and values already html-escaped?
- *          Defaults to false if not present.
+ * escaped: For an enum or a select, are the keys and values already
+ *          html-escaped? Defaults to false if not present.
  *
  *    hook: Call a hook function for the value of this preference
  *             true:  Will call the function _prefs_hook_<prefname>
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/config/registry.php.dist /tmp/aodTV4Q0QM/horde3-3.1.4/config/registry.php.dist
--- /tmp/3MTByFMvwV/horde3-3.1.3/config/registry.php.dist	2007-07-22 07:32:06.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/config/registry.php.dist	2007-07-22 07:32:12.000000000 +0200
@@ -2,7 +2,7 @@
 /**
  * registry.php -- Horde application registry.
  *
- * $Horde: horde/config/registry.php.dist,v 1.255.2.17 2006/07/21 15:49:46 jan Exp $
+ * $Horde: horde/config/registry.php.dist,v 1.255.2.19 2006/11/24 10:48:30 jan Exp $
  *
  * This configuration file is used by Horde to determine which Horde
  * applications are installed and where, as well as how they interact.
@@ -38,31 +38,17 @@
  * url           string   The (optional) URL of 'heading' entries.
  */
 
-// We try to automatically determine the proper webroot for Horde
-// here. This still assumes that applications live under horde3/. If
-// this results in incorrect results for you, simply change the
-// use of the $webroot variable in the 'horde' stanza below.
-//
-// Note for Windows users: the below assumes that your PHP_SELF
-// variable uses forward slashes. If it does not, you'll have to tweak
-// this.
-if (isset($_SERVER['PHP_SELF'])) {
-    $webroot = preg_split(';/;', $_SERVER['PHP_SELF'], 2, PREG_SPLIT_NO_EMPTY);
-    $webroot = strstr(dirname(__FILE__), DIRECTORY_SEPARATOR . array_shift($webroot));
-    if ($webroot !== false) {
-        $webroot = preg_replace(array('/\\\\/', ';/config$;'), array('/', ''), $webroot);
-    } elseif ($webroot === false) {
-        $webroot = '';
-    } else {
-        $webroot = '/horde3';
-    }
-} else {
-    $webroot = '/horde3';
-}
+// We try to automatically determine the proper webroot for Horde here. This
+// still assumes that applications live under horde/. If this results in
+// incorrect results for you, simply change the 'webroot' setting in the
+// 'horde' stanza below.
 
 $this->applications['horde'] = array(
     'fileroot' => dirname(__FILE__) . '/..',
-    'webroot' => $webroot,
+    // To respect Debian FHS policy, config/ is in /etc/ directory
+    // Then _detect_webroot() is unusable in Debian
+    // 'webroot' => _detect_webroot(),
+    'webroot' => '/horde3',
     'initial_page' => 'login.php',
     'name' => _("Horde"),
     'status' => 'active',
@@ -525,3 +511,30 @@
     'status' => 'inactive',
     'menu_parent' => 'administration'
 );
+
+function _detect_webroot()
+{
+    // Note for Windows users: the below assumes that your PHP_SELF variable
+    // uses forward slashes. If it does not, you'll have to tweak this.
+    if (isset($_SERVER['SCRIPT_URL']) || isset($_SERVER['SCRIPT_NAME'])) {
+        $path = empty($_SERVER['SCRIPT_URL']) ?
+            $_SERVER['SCRIPT_NAME'] :
+            $_SERVER['SCRIPT_URL'];
+        $hordedir = basename(preg_replace(';/config/registry.php$;', '', __FILE__));
+        $webroot = preg_replace(';/' . $hordedir . '.*;', '/' . $hordedir, $path);
+    } elseif (isset($_SERVER['PHP_SELF'])) {
+        $webroot = preg_split(';/;', $_SERVER['PHP_SELF'], 2, PREG_SPLIT_NO_EMPTY);
+        $webroot = strstr(dirname(__FILE__), DIRECTORY_SEPARATOR . array_shift($webroot));
+        if ($webroot !== false) {
+            $webroot = preg_replace(array('/\\\\/', ';/config$;'), array('/', ''), $webroot);
+        } elseif ($webroot === false) {
+            $webroot = '';
+        } else {
+            $webroot = '/horde3';
+        }
+    } else {
+        $webroot = '/horde3';
+    }
+
+    return $webroot;
+}
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/COPYING /tmp/aodTV4Q0QM/horde3-3.1.4/COPYING
--- /tmp/3MTByFMvwV/horde3-3.1.3/COPYING	2000-02-12 03:47:07.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/COPYING	2006-08-21 16:21:10.000000000 +0200
@@ -435,47 +435,3 @@
 DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public
-    License along with this library; if not, write to the Free
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/debian/changelog /tmp/aodTV4Q0QM/horde3-3.1.4/debian/changelog
--- /tmp/3MTByFMvwV/horde3-3.1.3/debian/changelog	2007-07-22 07:32:06.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/debian/changelog	2007-07-22 07:32:12.000000000 +0200
@@ -1,3 +1,17 @@
+horde3 (3.1.4-1) unstable; urgency=high
+
+  * New upstream release.
+  * Transition to PHP5 for Recommends and Suggests fields. (Closes: #432237)
+  * Remove old phpapi-* from Depends: (Closes: #420644)
+  * Clean Depends, Recommends and Suggests fields.
+  * Remove exec right for XML files in debian/rules.
+  * Add locales in Recommends.
+  * Disable upstream _detect_webroot() function (unsable in Debian).
+  * Fix XSS vulnerability. See CVE-2007-1473 for more information.
+    (Closes: #434045)
+
+ -- Gregory Colpart (evolix) <reg@evolix.fr>  Mon, 16 Jul 2007 01:40:30 +0200
+
 horde3 (3.1.3-5) unstable; urgency=low
 
   * Changed webroot from /horde to /horde3, especially regarding cookie
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/debian/control /tmp/aodTV4Q0QM/horde3-3.1.4/debian/control
--- /tmp/3MTByFMvwV/horde3-3.1.3/debian/control	2007-07-22 07:32:06.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/debian/control	2007-07-22 07:32:12.000000000 +0200
@@ -2,15 +2,15 @@
 Section: web
 Priority: optional
 Maintainer: Horde Maintainers <pkg-horde-hackers@lists.alioth.debian.org>
-Uploaders: Ola Lundqvist <opal@debian.org>, Lionel Elie Mamane <lmamane@debian.org>
+Uploaders: Ola Lundqvist <opal@debian.org>, Lionel Elie Mamane <lmamane@debian.org>, Gregory Colpart (evolix) <reg@evolix.fr>
 Build-Depends: debhelper (>= 4.1.16)
 Standards-Version: 3.7.2
 
 Package: horde3
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, libapache2-mod-php4 (>= 4:4.3.10) | libapache-mod-php4 (>= 4:4.3.10) | libapache2-mod-php5 | libapache-mod-php5 | phpapi-20041030 | phpapi-20020918 | phpapi-20050606, php-log | php4-pear (<< 4:4.3.2+rc3-1) | php4-pear-log, php-pear | php4-pear | php5-pear, apache | apache2 | apache-ssl | httpd, php4-domxml | libapache2-mod-php5 | libapache-mod-php5
-Recommends: php4-mysql | php5-mysql | php5-pgsql | php4-pgsql | php4-ldap | php5-ldap, logrotate, php-file, php-date, php-mail-mime, php-mail, php-services-weather, php4-gd | php5-gd | php4-gd2, php4-mcrypt, php-db
-Suggests: imp4, turba2, php4-cli, gollem, webcpp, chora2, xlhtml, ppthtml, wv, source-highlight, enscript, rpm, php4-mhash, gettext
+Depends: ${shlibs:Depends}, ${misc:Depends}, libapache2-mod-php5 | libapache2-mod-php4 (>= 4:4.3.10) | php5-cgi | php4-cgi (>= 4:4.3.10), libapache2-mod-php5 | php5-cgi | php4-domxml, php-log, php-pear, apache2 | httpd
+Recommends: php5-mysql | php5-pgsql | php5-ldap, logrotate, php-file, php-date, php-mail-mime, php-mail, php-services-weather, php5-gd, php5-mcrypt, php-db, locales
+Suggests: imp4, turba2, php5-cli, gollem, webcpp, chora2, xlhtml, ppthtml, wv, source-highlight, enscript, rpm, php5-mhash, gettext
 Conflicts: horde, turba2 (<< 2.1)
 Description: horde web application framework
  The Horde Framework is written in PHP, and provides the common
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/debian/rules /tmp/aodTV4Q0QM/horde3-3.1.4/debian/rules
--- /tmp/3MTByFMvwV/horde3-3.1.3/debian/rules	2007-07-22 07:32:06.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/debian/rules	2007-07-22 07:32:12.000000000 +0200
@@ -62,7 +62,7 @@
 	#### log file ####
 	printf "\n\$$conf[\'log\'][\'name\'] = \'/var/log/horde/horde3.log\';" >> \
 		debian/horde3/etc/horde/horde3/conf.php
-	chown www-data:root debian/horde3/var/log/horde
+	chown root:www-data debian/horde3/var/log/horde
 
 	#### change made for program run with no problems ###
 	cat config/registry.php.dist | \
@@ -89,6 +89,9 @@
 	#dh_link usr/share/horde3 var/www/horde3
 	#### end ####
 
+	#### no exec right for .xml files (lintian warnings) ####
+	find ./ -name "*.xml" -exec chmod -x '{}' \;
+
 	#### CREDITS file accessible to help viewer ####
 	mkdir -m 755 debian/horde3/usr/share/horde3/docs
 	cp -a docs/CREDITS debian/horde3/usr/share/horde3/docs/
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/docs/CHANGES /tmp/aodTV4Q0QM/horde3-3.1.4/docs/CHANGES
--- /tmp/3MTByFMvwV/horde3-3.1.3/docs/CHANGES	2006-08-17 14:29:54.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/docs/CHANGES	2007-03-14 19:32:26.000000000 +0100
@@ -1,4 +1,61 @@
 ------
+v3.1.4
+------
+
+[jan] SECURITY: Correctly quote file names in cleanup script for temporary
+      files.
+[jan] Fix RPC authentication on CGI SAPIs.
+[jan] Detect unencrypted PGP messages.
+
+
+----------
+v3.1.4-RC1
+----------
+
+[jan] SECURITY: Fix an XSS vulnerability in the language selection.
+[jan] Complete Cyrus virtual domain support in cyrsql driver (Vilius Sumskas
+      <vilius@lnk.lt>, Request #4967).
+[jan] Add option whether to strip domains from usernames in the account block
+      (Request #4955).
+[jan] Fix email lists not being validated under certain conditions (Bug #4834).
+[cjh] Add a REST-ful preferences interface.
+[cjh] Faster DataTree-to-SQL History migration script
+      (josh@endries.org, Request #4732).
+[cjh] Improved automatic webroot detection (Ben Klang, Request #4126).
+[cjh] Rewrite and fix the OCI8 SessionHandler (Bug #3452).
+[cjh] Allow signup hooks to override the user_name and password fields
+      (thomas@gelf.net, Request #2904).
+[cjh] Fix creation of mailbox quotas by the Auth_cyrus driver
+      (pascal@vmfacility.fr, Bug #4678).
+[cjh] Add "Save and Finish" to the share edit window (webmgr@muskingum.edu,
+      Request #4307).
+[cjh] Let mailto: and anchor (#) links through Horde::externalUrl (Bug #3079).
+[cjh] Add smbclient version of the SMB Auth class (larry@wimble.biz,
+      Request #4338).
+[cjh] Remove problematic "data descriptor" segment from generated ZIP files
+      (reitsma@denison.edu, Bug #4670).
+[cjh] Strip accesskeys from menu tooltips when only showing icons (Bug #4667).
+[jan] Fix saving files in the root directory of an SQL VFS backend (Bug #4652,
+      Ben Klang <ben@alkaloid.net>).
+[jan] Fix displaying all maintenance tasks to be confirmed at once (Bug #4377).
+[cjh] Fix return format of DataTree_null::getByAttributes()
+      (thomas.jarosch@intra2net.com, Bug #4651).
+[jan] Support departments in vCard's ORG properties (martin@matuska.org,
+      Request #4285).
+[cjh] Rename Auth_sasl backend to Auth_peclsasl to avoid conflicts with PEAR's
+      Auth_SASL (Bug #4547).
+[cjh] Implement handling of vTimezones in iCalendar data
+      (Carl Thompson <lists-horde@carlthompson.net>, Bug #4399).
+[cjh] keybindings.js now works with Safari/KHTML.
+[jan] Avoid recursive folder creation when sharing Kolab folders
+      (michael.sheldon@credativ.de, Bug #4325).
+[jan] Add Kolab specific account block driver to support special Kolab users
+      (mzizka@hotmail.com, Request: #4119).
+[mms] Only dim below the last signature line of input text in the dimsignature
+      Text_Filter driver.
+
+
+------
 v3.1.3
 ------
 
@@ -208,6 +265,14 @@
 
 
 -------
+v3.0.12
+-------
+
+[cjh] SECURITY: Validate GET-based URL parameters provided to Horde's
+      index.php.
+
+
+-------
 v3.0.11
 -------
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/docs/CODING_STANDARDS /tmp/aodTV4Q0QM/horde3-3.1.4/docs/CODING_STANDARDS
--- /tmp/3MTByFMvwV/horde3-3.1.3/docs/CODING_STANDARDS	2006-03-17 07:18:07.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/docs/CODING_STANDARDS	2006-09-06 10:02:48.000000000 +0200
@@ -2,8 +2,8 @@
  Horde Coding Standards
 ========================
 
-:Last update:   $Date: 2006/03/17 06:18:07 $
-:Revision:      $Revision: 1.84.10.15 $
+:Last update:   $Date: 2006/09/06 08:02:48 $
+:Revision:      $Revision: 1.84.10.16 $
 :Authors:       Jon Parise, Chuck Hagenbuch
 :Contact:       dev@lists.horde.org
 
@@ -342,7 +342,7 @@
 must also be surrounded by quotes).  For parameters that had no value in HTML,
 the parameter name is the value.  For example::
 
-    <input type="checkbox" checked="checked">
+    <input type="checkbox" checked="checked" />
     <select name="example">
         <option selected="selected" value="1">Example</option>
     </select>
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/docs/INSTALL /tmp/aodTV4Q0QM/horde3-3.1.4/docs/INSTALL
--- /tmp/3MTByFMvwV/horde3-3.1.3/docs/INSTALL	2006-08-15 11:30:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/docs/INSTALL	2007-01-26 12:18:26.000000000 +0100
@@ -2,8 +2,8 @@
  Installing the Horde 3.1 Framework
 ====================================
 
-:Last update:   $Date: 2006/08/15 09:30:43 $
-:Revision:      $Revision: 1.90.6.16 $
+:Last update:   $Date: 2007/01/26 11:18:26 $
+:Revision:      $Revision: 1.90.6.17 $
 :Contact:       horde@lists.horde.org
 
 .. contents:: Contents
@@ -585,9 +585,11 @@
 5. Completing Configuration
 
    You can now access Horde without a password, and you will be logged in as
-   an administrator. You should first configure a real authentication backend.
-   Click on ``Setup`` in the ``Administration`` menu and configure
-   Horde.  Start in the ``Authentication`` tab.
+   an administrator.
+
+   .. Important:: You should first configure a real authentication backend.
+                  Click on ``Setup`` in the ``Administration`` menu and
+                  configure Horde.  Start in the ``Authentication`` tab.
 
    Here is an example for configuring authentication against a remote IMAP
    server.  Similar steps apply for authenticating against a database, an LDAP
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/docs/PERFORMANCE /tmp/aodTV4Q0QM/horde3-3.1.4/docs/PERFORMANCE
--- /tmp/3MTByFMvwV/horde3-3.1.3/docs/PERFORMANCE	2006-05-31 21:14:14.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/docs/PERFORMANCE	2007-02-27 11:34:39.000000000 +0100
@@ -2,8 +2,8 @@
  Horde Performance Guide
 =========================
 
-:Last update:   $Date: 2006/05/31 19:14:14 $
-:Revision:      $Revision: 1.9.10.13 $
+:Last update:   $Date: 2007/02/27 10:34:39 $
+:Revision:      $Revision: 1.9.10.16 $
 :Contact:       horde@lists.horde.org
 
 .. contents:: Contents
@@ -27,8 +27,8 @@
   This applies most to your Apache, PHP, IMAP, and POP3 packages.
 
 
-Apache/PHP tuning
-=================
+Webserver/PHP tuning
+====================
 
 * Consider a PHP accelerator program.  See for example `The Zend Performance
   Suite`_, The `ionCube PHP Accelerator`_, `Turck MMCache for PHP`_, or
@@ -44,17 +44,17 @@
 * Use of the mcrypt PHP extension should significantly increase performance
   while also increasing security.
 
-* Enable PHP output compression (either in ``php.ini`` or
-  ``horde/config/conf.php``).
-
-* Disable the memory limit in ``php.ini``.
+* Enable PHP output compression in the Horde configuration. Do not enable
+  compression in the PHP configuration, because certain scripts don't work
+  well with compression and Horde takes care of disabling compression
+  conditionally.
 
 * Keep the include path defined in ``php.ini`` as short as possible, with the
   most frequently used library paths first.  You don't need to include the
   local directory ``.`` because Horde always uses full paths instead of
   relative paths.
 
-* Use an optimized ``php.ini``, start from ``php.ini-recommended`` of your PHP
+* Use an optimized ``php.ini``: start with ``php.ini-recommended`` in your PHP
   dsitribution.
 
 * Don't run PHP session garbage collection too often if using a slow storage
@@ -103,11 +103,27 @@
 
 * Enable Apache keepalives.
 
+* You can configure Horde to serve all images, style sheets and/or static
+  javascript files from a different server. This could be a very lightweight
+  server without PHP (and other CGI modules) builtin.  If using SSL to serve
+  all pages, the images/js server will also have to serve SSL content or else
+  browsers will complain about non-secure content in a secure page. Good
+  lightweight servers that support SSL include lighttpd_ and Hiawatha_. If
+  using a Horde installation that doesn't use SSL (or only uses SSL for
+  logins), good choices for servers include thttpd_ or Boa_. You need to set
+  the ``themesuri`` and/or ``jsuri`` parameters in ``config/registry.php`` for
+  all applications and copy all ``themes`` and/or ``js`` directories in the
+  same directory layout to the other server.
+
 .. _`The Zend Performance Suite`: http://www.zend.com/horde.php
-.. _`ionCube PHP Accelerator`: http://www.php-accelerator.co.uk
-.. _`Turck MMCache for PHP`: http://turck-mmcache.sourceforge.net
-.. _eAccelerator: http://eaccelerator.net
+.. _`ionCube PHP Accelerator`: http://www.php-accelerator.co.uk/
+.. _`Turck MMCache for PHP`: http://turck-mmcache.sourceforge.net/
+.. _eAccelerator: http://eaccelerator.net/
 .. _`Turck MMCache Troubleshooting`: http://wiki.horde.org/TurckMMCacheTroubleshooting
+.. _`lighttpd`: http://www.lighttpd.net/
+.. _`Hiawatha`: http://hiawatha.leisink.org/
+.. _`thttpd`: http://www.acme.com/software/thttpd/
+.. _`Boa`: http://www.boa.org/
 
 
 Sending Mail
@@ -139,10 +155,10 @@
 .. _Perdition: http://www.vergenet.net/linux/perdition/
 
 
-Postgresql tuning
+PostgreSQL tuning
 =================
 
-* Do a vacuum command periodically to tune your database
+* Do a ``VACUUM`` command periodically to tune your database
 
 * Increase ``shared_buffers`` and ``sort_mem`` memory settings.
 
@@ -163,19 +179,6 @@
     set-variable = query_cache_size=128M
 
 
-Horde tuning
-============
-
-* You can configure Horde to serve all images and style sheets from a
-  different server. This could be a very lightweight server without all the
-  overhead for processing PHP files, like lighttpd. You need to set the
-  ``themesuri`` parameter in ``config/registry.php`` for all applications and
-  copy all ``themes`` directories in the same directory layout to the other
-  server.
-
-.. _lighttpd: http://www.lighttpd.net/
-
-
 Application tuning
 ==================
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/docs/RELEASE_NOTES /tmp/aodTV4Q0QM/horde3-3.1.4/docs/RELEASE_NOTES
--- /tmp/3MTByFMvwV/horde3-3.1.3/docs/RELEASE_NOTES	2006-08-17 15:24:49.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/docs/RELEASE_NOTES	2007-03-14 19:32:26.000000000 +0100
@@ -17,37 +17,52 @@
 /* Mailing list release notes. */
 $this->notes['ml']['changes'] = <<<ML
 The Horde Team is pleased to announce the final release of the Horde
-Application Framework version 3.1.3.
+Application Framework version 3.1.4.
 
-This is a bugfix release that also fixes a cross site scripting vulnerability
-and improves protection against phishing attempts.
+This is a bugfix release that also fixes an arbitrary file deletion
+vulnerability exploitable by local system (not Horde) users on systems using
+the example cron cleanup script.
 
-Many thanks to the "immerda project group" (http://www.immmerda.ch) and Marc
-Ruef for reporting these problems and working with us to test the fixes.
+Many thanks to the iDefense Vulnerability Contributor Program for reporting
+these problems and working with us to test the fixes.
 
 The Horde Application Framework is a modular, general-purpose web application
-framework written in PHP.  It provides an extensive array of libraries that
-are targeted at the common problems and tasks involved in developing modern
-web applications.
-
-Major changes compared to Horde 3.1.2 are:
-    * Security Fixes
-      - Closed an XSS problem in index.php and improved protection against
-        phishing attempts.
-    * Bugfixes and improvements
-      - Added Kolab group ACL support.
-      - Improved import of date and time fields.
-      - Fixed synchronization support.
-      - Updated Catalan, German and Slovenian translations.
+framework written in PHP. It provides an extensive array of libraries that are
+targeted at the common problems and tasks involved in developing modern web
+applications.
+
+Major changes compared to Horde 3.1.4-RC1 are:
+    * Correctly quote file names in cleanup script for temporary files.
+    * Detect unencrypted PGP messages.
+
+Major changes compared to Horde 3.1.3 are:
+    * Rewritten Oracle session handler.
+    * Added vTimezone support to iCalendar API and ORG support to vCard API.
+    * Improved virtual domain support for Cyrus SQL authentication driver.
+    * Improved Samba authentication driver.
+    * Improved automatic webroot detection.
+    * Improved signature dimming.
+    * Improved compatibility of generated ZIP files.
+    * Fixed an XSS vulnerability in the language selection.
+    * Fixed validation of some email distribution lists.
+    * Several Kolab related fixes.
+    * Lots of small fixes and improvements.
+    * Updated Brazilian Portuguese, Catalan, Dutch, French, German, Portuguese
+      and Traditional Chinese translations.
 ML;
 
 /* Freshmeat release notes, not more than 600 characters. */
 $this->notes['fm']['changes'] = <<<FM
-This is a bugfix release that also fixes a cross site scripting vulnerability
-and improves protection against phishing attempts.
-Kolab group ACL support has been added, import of date and time fields has
-been improved, and synchronization support has been fixed.
-Catalan, German and Slovenian translations have been updated.
+A local arbitrary file deletion vulnerability has been fixed.
+The Oracle session handler has been rewritten.
+vTimezone support for iCalendar data and ORG support for vCard data has been
+added.
+Samba and Cyrus SQL authentication drivers, automatic webroot detection,
+signature dimming and compatibility of generated ZIP files have been improved.
+Validation of some email distribution lists has been fixed.
+Lots of small fixes and improvements have been made.
+Brazilian Portuguese, Catalan, Dutch, French, German, Portuguese and
+Traditional Chinese translations have been updated.
 FM;
 
 $this->notes['name'] = 'Horde';
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/docs/SECURITY /tmp/aodTV4Q0QM/horde3-3.1.4/docs/SECURITY
--- /tmp/3MTByFMvwV/horde3-3.1.3/docs/SECURITY	2004-09-27 01:33:07.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/docs/SECURITY	2007-03-07 01:13:05.000000000 +0100
@@ -2,8 +2,8 @@
  Horde Security Notes
 ======================
 
-:Last update:   $Date: 2004/09/26 23:33:07 $
-:Revision:      $Revision: 1.9 $
+:Last update:   $Date: 2007/03/07 00:13:05 $
+:Revision:      $Revision: 1.9.10.1 $
 :Contact:       horde@lists.horde.org
 
 .. contents:: Contents
@@ -28,12 +28,13 @@
 ============
 
 For the most security, you should enable PHP session cookies by enabling the
-php setting ``session.use_cookies``.  When doing so, be sure to set an
-appropriate ``session.cookie_path`` and ``session.cookie_domain`` also to
-secure your cookies.
+PHP setting ``session.use_cookies``. When doing so, be sure to set an
+appropriate cookie path and cookie domain in the Horde configuration also to
+secure your cookies. You should even force session cookie usage in the Horde
+configuration, which is the default setting in all Horde versions now.
 
 If PHP sessions are set to use the ``files`` save_handler, then these files
-should be secured properly.  Sites can increase security by setting the php
+should be secured properly. Sites can increase security by setting the PHP
 setting ``session.save_path`` to a directory that is only readable and
 writable by the web server process.
 
@@ -41,7 +42,7 @@
 ``session.entropy_file`` and ``session.entropy_length`` to appropriate values.
 
 Horde will encrypt the user credentials before storing them in the session.
-However, this encryption can be improved if you have and enable the php
+However, this encryption can be improved if you have and enable the PHP
 extension "mcrypt" which allows for stronger encryption than is otherwise
 provided by Horde.
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/index.php /tmp/aodTV4Q0QM/horde3-3.1.4/index.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/index.php	2006-07-29 18:49:19.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/index.php	2007-01-02 14:42:40.000000000 +0100
@@ -1,9 +1,9 @@
 <?php
 /**
- * $Horde: horde/index.php,v 2.105.4.8 2006/07/29 16:49:19 jan Exp $
+ * $Horde: horde/index.php,v 2.105.4.9 2007/01/02 13:42:40 jan Exp $
  *
- * Copyright 1999-2006 Charles J. Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Charles J. Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/js/addEvent.php /tmp/aodTV4Q0QM/horde3-3.1.4/js/addEvent.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/js/addEvent.php	2006-01-01 22:29:02.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/js/addEvent.php	2007-01-02 14:55:04.000000000 +0100
@@ -1,9 +1,9 @@
 /**
  * Generic function to add an event handler to any DOM element.
  *
- * $Horde: horde/js/addEvent.php,v 1.1.2.2 2006/01/01 21:29:02 jan Exp $
+ * $Horde: horde/js/addEvent.php,v 1.1.2.3 2007/01/02 13:55:04 jan Exp $
  *
- * Copyright 2005-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/js/alphaImageLoader.php /tmp/aodTV4Q0QM/horde3-3.1.4/js/alphaImageLoader.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/js/alphaImageLoader.php	2006-01-01 22:29:02.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/js/alphaImageLoader.php	2007-01-02 14:55:04.000000000 +0100
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Horde: horde/js/alphaImageLoader.php,v 1.2.8.4 2006/01/01 21:29:02 jan Exp $
+ * $Horde: horde/js/alphaImageLoader.php,v 1.2.8.5 2007/01/02 13:55:04 jan Exp $
  *
- * Copyright 2004-2006 Charles J. Hagenbuch <chuck@horde.org>
+ * Copyright 2004-2007 Charles J. Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/js/form_assign.js /tmp/aodTV4Q0QM/horde3-3.1.4/js/form_assign.js
--- /tmp/3MTByFMvwV/horde3-3.1.3/js/form_assign.js	2006-03-24 06:17:59.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/js/form_assign.js	2007-01-02 14:55:04.000000000 +0100
@@ -3,9 +3,9 @@
  *
  * Provides the javascript class to accompany the Horde_Form assign field.
  *
- * $Horde: horde/js/form_assign.js,v 1.2.10.4 2006/03/24 05:17:59 chuck Exp $
+ * $Horde: horde/js/form_assign.js,v 1.2.10.5 2007/01/02 13:55:04 jan Exp $
  *
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/js/form_helpers.js /tmp/aodTV4Q0QM/horde3-3.1.4/js/form_helpers.js
--- /tmp/3MTByFMvwV/horde3-3.1.3/js/form_helpers.js	2006-03-24 06:17:59.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/js/form_helpers.js	2007-01-02 14:55:04.000000000 +0100
@@ -1,9 +1,9 @@
 /**
  * Javascript to add events to form elements
  *
- * $Horde: horde/js/form_helpers.js,v 1.3.4.6 2006/03/24 05:17:59 chuck Exp $
+ * $Horde: horde/js/form_helpers.js,v 1.3.4.7 2007/01/02 13:55:04 jan Exp $
  *
- * Copyright 2004-2006 Matt Kynaston <matt@kynx.org>
+ * Copyright 2004-2007 Matt Kynaston <matt@kynx.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/js/form_sections.js /tmp/aodTV4Q0QM/horde3-3.1.4/js/form_sections.js
--- /tmp/3MTByFMvwV/horde3-3.1.3/js/form_sections.js	2006-04-16 00:23:36.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/js/form_sections.js	2007-01-02 14:55:04.000000000 +0100
@@ -3,12 +3,12 @@
  *
  * Provides the javascript class for handling tabbed sections in Horde Forms.
  *
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did not
  * receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  *
- * $Horde: horde/js/form_sections.js,v 1.1.2.2 2006/04/15 22:23:36 chuck Exp $
+ * $Horde: horde/js/form_sections.js,v 1.1.2.3 2007/01/02 13:55:04 jan Exp $
  *
  * @author  Marko Djukic <marko@oblo.com>
  * @package Horde_Form
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/js/image.js /tmp/aodTV4Q0QM/horde3-3.1.4/js/image.js
--- /tmp/3MTByFMvwV/horde3-3.1.3/js/image.js	2006-01-01 22:29:02.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/js/image.js	2007-01-02 14:55:04.000000000 +0100
@@ -3,9 +3,9 @@
  *
  * Provides the javascript to help during the uploading of images in Horde_Form.
  *
- * $Horde: horde/js/image.js,v 1.3.4.3 2006/01/01 21:29:02 jan Exp $
+ * $Horde: horde/js/image.js,v 1.3.4.4 2007/01/02 13:55:04 jan Exp $
  *
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did not
  * receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/js/sorter.js /tmp/aodTV4Q0QM/horde3-3.1.4/js/sorter.js
--- /tmp/3MTByFMvwV/horde3-3.1.3/js/sorter.js	2006-01-01 22:29:02.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/js/sorter.js	2007-01-02 14:55:04.000000000 +0100
@@ -4,9 +4,9 @@
  * Provides the javascript class to accompany the Horde_Form sorter
  * field.
  *
- * $Horde: horde/js/sorter.js,v 1.2.10.3 2006/01/01 21:29:02 jan Exp $
+ * $Horde: horde/js/sorter.js,v 1.2.10.4 2007/01/02 13:55:04 jan Exp $
  *
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/api.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/api.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/api.php	2006-05-04 15:27:28.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/api.php	2007-01-29 13:30:05.000000000 +0100
@@ -5,14 +5,14 @@
  * This file defines Horde's external API interface. Other
  * applications can interact with Horde through this API.
  *
- * $Horde: horde/lib/api.php,v 1.43.2.5 2006/05/04 13:27:28 jan Exp $
+ * $Horde: horde/lib/api.php,v 1.43.2.6 2007/01/29 12:30:05 jan Exp $
  *
  * @package Horde
  */
 
 /* Complex types. */
 $_types = array(
-    '{urn:horde}stringArray' => array(array('item' => 'string')),
+    'stringArray' => array(array('item' => 'string')),
     'hashItem' => array('key' => 'string', 'value' => 'string'),
     'hash' => array(array('item' => '{urn:horde}hashItem')),
     'hashHashItem' => array('key' => 'string', 'value' => '{urn:horde}hash'),
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/base.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/base.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/base.php	2006-01-01 22:29:05.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/base.php	2007-01-02 14:55:07.000000000 +0100
@@ -10,9 +10,9 @@
  * avoid an infinite loop on the Horde login page. You'll need to do
  * it yourself in framework-level pages.
  *
- * $Horde: horde/lib/base.php,v 1.40.10.3 2006/01/01 21:29:05 jan Exp $
+ * $Horde: horde/lib/base.php,v 1.40.10.4 2007/01/02 13:55:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Block/account.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Block/account.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Block/account.php	2006-03-10 18:28:44.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Block/account.php	2007-02-02 12:03:22.000000000 +0100
@@ -3,10 +3,10 @@
 $block_name = _("Account Information");
 
 /**
- * $Horde: horde/lib/Block/account.php,v 1.7.2.4 2006/03/10 17:28:44 jan Exp $
+ * $Horde: horde/lib/Block/account.php,v 1.7.2.7 2007/02/02 11:03:22 jan Exp $
  *
- * Copyright 2001-2006 Eric Rostetter <eric.rostetter@physics.utexas.edu>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2001-2007 Eric Rostetter <eric.rostetter@physics.utexas.edu>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -43,6 +43,7 @@
             break;
         case 'localhost':
         case 'ldap':
+        case 'kolab':
             $class = 'Accounts_Driver_' . $conf['accounts']['driver'];
             $mydriver = &new $class($conf['accounts']['params']);
             break;
@@ -125,7 +126,7 @@
  * Accounts_Driver:: defines an API for getting/displaying account information
  * for a user for the accounts module.
  *
- * Copyright 2001-2006 Eric Rostetter <eric.rostetter@physics.utexas.edu>
+ * Copyright 2001-2007 Eric Rostetter <eric.rostetter@physics.utexas.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -151,8 +152,7 @@
      */
     function getUsername()
     {
-        $auth = explode('@', Auth::getAuth());
-        return String::lower($auth[0]);
+        return String::lower(Auth::getBareAuth());
     }
 
     /**
@@ -162,8 +162,7 @@
      */
     function getRealm()
     {
-        $auth = explode('@', Auth::getAuth());
-        return isset($auth[1]) ? $auth[1] : '';
+        return (string)Auth::getAuthDomain();
     }
 
     /**
@@ -237,7 +236,7 @@
  * local accounts on the local machine.  The exception is the quota support.
  * See that routine for additional comments.
  *
- * Copyright 2002-2006 Eric Jon Rostetter <eric.rostetter@physics.utexas.edu>
+ * Copyright 2002-2007 Eric Jon Rostetter <eric.rostetter@physics.utexas.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -405,7 +404,7 @@
  * The ldap class attempts to return user information stored in an ldap
  * directory service.
  *
- * Copyright 2001-2006 Eric Rostetter <eric.rostetter@physics.utexas.edu>
+ * Copyright 2001-2007 Eric Rostetter <eric.rostetter@physics.utexas.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -448,6 +447,16 @@
 
 
     /**
+     * A wrapper method for anonymous binding.
+     *
+     * @return boolean  False if binding failed.
+     */
+    function _ldapBind()
+    {
+        return @ldap_bind($this->_ds);
+    }
+
+    /**
      * Returns the user account from the ldap source.
      *
      * @return array  A hash with complete account details.
@@ -477,7 +486,7 @@
             }
 
             // bind as anonymous
-            $result = @ldap_bind($this->_ds);
+            $result = $this->_ldapBind();
             if (!$result) {
                 return PEAR::raiseError(_("Could not bind to LDAP server."));
             }
@@ -499,6 +508,18 @@
     }
 
     /**
+     * Returns the username. Since this method is called for authenticating
+     * in the parent class, we also have the option to NOT strip the domain
+     * name if there is one. This is a configuration checkbox.
+     *
+     * @return string  The username.
+     */
+    function getUsername()
+    {
+        return $this->_params['strip'] ? Auth::getBareAuth() : Auth::getAuth();
+    }
+
+    /**
      * Returns the user's full name.
      *
      * @return mixed  The user's full name (string), or false (error).
@@ -601,3 +622,46 @@
     }
 
 }
+
+/**
+ * The kolab driver class is merely an extension to the ldap class. It reuses
+ * existing Kolab configuration instead of requiring another set of
+ * parameters. It also binds using a set internal user (normally this is
+ * cn=nobody,cn=internal), so that account information can be fetched even for
+ * internal accounts.
+ *
+ * @author mzizka@hotmail.com
+ */
+class Accounts_Driver_kolab extends Accounts_Driver_ldap {
+
+    /**
+     * Constructs a new Accounts_Driver_kolab object. Uses Kolab configuration.
+     *
+     * @param array $params  A hash containing connection parameters.
+     */
+    function Accounts_Driver_kolab($params = array())
+    {
+        $ldap_params = array('host'   => $GLOBALS['conf']['kolab']['ldap']['server'],
+                             'port'   => $GLOBALS['conf']['kolab']['ldap']['port'],
+                             'basedn' => $GLOBALS['conf']['kolab']['ldap']['basedn'],
+                             'phpdn'  => $GLOBALS['conf']['kolab']['ldap']['phpdn'],
+                             'phppw'  => $GLOBALS['conf']['kolab']['ldap']['phppw']);
+        $params = array_merge($ldap_params, $params);
+        parent::Accounts_Driver_ldap($params);
+    }
+
+    /**
+     * Overrides the binding method so it uses the Kolab user instead.
+     * Typically this will be the internal nobody user.
+     *
+     * @return boolean  False if binding failed.
+     */
+    function _ldapBind()
+    {
+        if (!empty($this->_params['phpdn'])) {
+           return @ldap_bind($this->_ds, $this->_params['phpdn'], $this->_params['phppw']);
+        }
+        return parent::_ldapBind();
+    }
+
+}
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Block/iframe.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Block/iframe.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Block/iframe.php	2006-02-21 11:53:45.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Block/iframe.php	2006-12-08 22:51:36.000000000 +0100
@@ -3,7 +3,7 @@
 $block_name = _("View an external web page");
 
 /**
- * $Horde: horde/lib/Block/iframe.php,v 1.18.8.4 2006/02/21 10:53:45 jan Exp $
+ * $Horde: horde/lib/Block/iframe.php,v 1.18.8.5 2006/12/08 21:51:36 jan Exp $
  *
  * @package Horde_Block
  */
@@ -18,8 +18,13 @@
                                        'default' => ''),
                      'title'  => array('type' => 'text',
                                        'name' => _("Title")),
-                     'height' => array('type' => 'int',
-                                       'name' => _("Height")));
+                     'height' => array('type' => 'enum',
+                                       'name' => _("Height"),
+                                       'default' => '600',
+                                       'values' => array('480' => _("Small"),
+                                                         '600' => _("Medium"),
+                                                         '768' => _("Large"),
+                                                         '1024' => _("Extra Large"))));
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/core.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/core.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/core.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/core.php	2007-03-14 20:59:24.000000000 +0100
@@ -5,9 +5,9 @@
  * This file sets up any necessary include path variables and includes
  * the minimum required Horde libraries.
  *
- * $Horde: horde/lib/core.php,v 1.26.6.7 2006/01/07 16:40:28 chuck Exp $
+ * $Horde: horde/lib/core.php,v 1.26.6.9 2007/01/02 13:55:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -16,6 +16,7 @@
 /* Turn PHP stuff off that can really screw things up. */
 ini_set('magic_quotes_sybase', 0);
 ini_set('magic_quotes_runtime', 0);
+ini_set('zend.ze1_compatibility_mode', 0);
 
 /* Unset all variables populated through register_globals. */
 if (ini_get('register_globals')) {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/CSV.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/CSV.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/CSV.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/CSV.php	2007-03-14 20:59:20.000000000 +0100
@@ -6,10 +6,10 @@
 /**
  * The File_CSV package allows reading and creating of CSV data and files.
  *
- * $Horde: framework/File_CSV/CSV.php,v 1.4.2.7 2006/03/30 10:15:29 selsky Exp $
+ * $Horde: framework/File_CSV/CSV.php,v 1.4.2.9 2007/01/02 13:54:16 jan Exp $
  *
- * Copyright 2002-2003 Tomas Von Veschler Cox <cox@idecnet.com>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Tomas Von Veschler Cox <cox@idecnet.com>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * This source file is subject to version 2.0 of the PHP license, that is
  * bundled with this package in the file LICENSE, and is available at through
@@ -431,21 +431,20 @@
         static $resources = array();
         static $config = array();
 
-        $signature = $file . serialize($conf);
-        if (isset($resources[$signature])) {
-            $conf = $config[$signature];
-            return $resources[$signature];
+        if (isset($resources[$file])) {
+            $conf = $config[$file];
+            return $resources[$file];
         }
         if (is_a($error = File_CSV::_checkConfig($conf), 'PEAR_Error')) {
             return $error;
         }
-        $config[$signature] = $conf;
+        $config[$file] = $conf;
 
         $fp = @fopen($file, $mode);
         if (!is_resource($fp)) {
             return PEAR::raiseError(sprintf(_("Can't open file \"%s\"."), $file));
         }
-        $resources[$signature] = $fp;
+        $resources[$file] = $fp;
         File_CSV::_line(0);
 
         if ($mode == FILE_MODE_READ && !empty($conf['header'])) {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/courier.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/courier.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/courier.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/courier.php	2007-03-14 20:59:21.000000000 +0100
@@ -7,4 +7,4 @@
 }
 $font_widths['courierB'] = $font_widths['courier'];
 $font_widths['courierI'] = $font_widths['courier'];
-$font_widths['courierBI'] = $fpdf_widths['courier'];
+$font_widths['courierBI'] = $font_widths['courier'];
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helveticabi.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helveticabi.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helveticabi.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helveticabi.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['helveticaBI'] = array(
-    chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
-    chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
-    ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
-    'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
-    'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
-    'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
-    chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
-    chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
-    chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
-    chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
-    chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+    chr(0) => 278,
+    chr(1) => 278,
+    chr(2) => 278,
+    chr(3) => 278,
+    chr(4) => 278,
+    chr(5) => 278,
+    chr(6) => 278,
+    chr(7) => 278,
+    chr(8) => 278,
+    chr(9) => 278,
+    chr(10) => 278,
+    chr(11) => 278,
+    chr(12) => 278,
+    chr(13) => 278,
+    chr(14) => 278,
+    chr(15) => 278,
+    chr(16) => 278,
+    chr(17) => 278,
+    chr(18) => 278,
+    chr(19) => 278,
+    chr(20) => 278,
+    chr(21) => 278,
+    
+    chr(22) => 278,
+    chr(23) => 278,
+    chr(24) => 278,
+    chr(25) => 278,
+    chr(26) => 278,
+    chr(27) => 278,
+    chr(28) => 278,
+    chr(29) => 278,
+    chr(30) => 278,
+    chr(31) => 278,
+    ' ' => 278,
+    '!' => 333,
+    '"' => 474,
+    '#' => 556,
+    '$' => 556,
+    '%' => 889,
+    '&' => 722,
+    '\'' => 238,
+    '(' => 333,
+    ')' => 333,
+    '*' => 389,
+    '+' => 584,
+    
+    ',' => 278,
+    '-' => 333,
+    '.' => 278,
+    '/' => 278,
+    '0' => 556,
+    '1' => 556,
+    '2' => 556,
+    '3' => 556,
+    '4' => 556,
+    '5' => 556,
+    '6' => 556,
+    '7' => 556,
+    '8' => 556,
+    '9' => 556,
+    ':' => 333,
+    ';' => 333,
+    '<' => 584,
+    '=' => 584,
+    '>' => 584,
+    '?' => 611,
+    '@' => 975,
+    'A' => 722,
+    
+    'B' => 722,
+    'C' => 722,
+    'D' => 722,
+    'E' => 667,
+    'F' => 611,
+    'G' => 778,
+    'H' => 722,
+    'I' => 278,
+    'J' => 556,
+    'K' => 722,
+    'L' => 611,
+    'M' => 833,
+    'N' => 722,
+    'O' => 778,
+    'P' => 667,
+    'Q' => 778,
+    'R' => 722,
+    'S' => 667,
+    'T' => 611,
+    'U' => 722,
+    'V' => 667,
+    'W' => 944,
+    
+    'X' => 667,
+    'Y' => 667,
+    'Z' => 611,
+    '[' => 333,
+    '\\' => 278,
+    ']' => 333,
+    '^' => 584,
+    '_' => 556,
+    '`' => 333,
+    'a' => 556,
+    'b' => 611,
+    'c' => 556,
+    'd' => 611,
+    'e' => 556,
+    'f' => 333,
+    'g' => 611,
+    'h' => 611,
+    'i' => 278,
+    'j' => 278,
+    'k' => 556,
+    'l' => 278,
+    'm' => 889,
+    
+    'n' => 611,
+    'o' => 611,
+    'p' => 611,
+    'q' => 611,
+    'r' => 389,
+    's' => 556,
+    't' => 333,
+    'u' => 611,
+    'v' => 556,
+    'w' => 778,
+    'x' => 556,
+    'y' => 556,
+    'z' => 500,
+    '{' => 389,
+    '|' => 280,
+    '}' => 389,
+    '~' => 584,
+    chr(127) => 350,
+    chr(128) => 556,
+    chr(129) => 350,
+    chr(130) => 278,
+    chr(131) => 556,
+    
+    chr(132) => 500,
+    chr(133) => 1000,
+    chr(134) => 556,
+    chr(135) => 556,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 667,
+    chr(139) => 333,
+    chr(140) => 1000,
+    chr(141) => 350,
+    chr(142) => 611,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 278,
+    chr(146) => 278,
+    chr(147) => 500,
+    chr(148) => 500,
+    chr(149) => 350,
+    chr(150) => 556,
+    chr(151) => 1000,
+    chr(152) => 333,
+    chr(153) => 1000,
+    
+    chr(154) => 556,
+    chr(155) => 333,
+    chr(156) => 944,
+    chr(157) => 350,
+    chr(158) => 500,
+    chr(159) => 667,
+    chr(160) => 278,
+    chr(161) => 333,
+    chr(162) => 556,
+    chr(163) => 556,
+    chr(164) => 556,
+    chr(165) => 556,
+    chr(166) => 280,
+    chr(167) => 556,
+    chr(168) => 333,
+    chr(169) => 737,
+    chr(170) => 370,
+    chr(171) => 556,
+    chr(172) => 584,
+    chr(173) => 333,
+    chr(174) => 737,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 584,
+    chr(178) => 333,
+    chr(179) => 333,
+    chr(180) => 333,
+    chr(181) => 611,
+    chr(182) => 556,
+    chr(183) => 278,
+    chr(184) => 333,
+    chr(185) => 333,
+    chr(186) => 365,
+    chr(187) => 556,
+    chr(188) => 834,
+    chr(189) => 834,
+    chr(190) => 834,
+    chr(191) => 611,
+    chr(192) => 722,
+    chr(193) => 722,
+    chr(194) => 722,
+    chr(195) => 722,
+    chr(196) => 722,
+    chr(197) => 722,
+    
+    chr(198) => 1000,
+    chr(199) => 722,
+    chr(200) => 667,
+    chr(201) => 667,
+    chr(202) => 667,
+    chr(203) => 667,
+    chr(204) => 278,
+    chr(205) => 278,
+    chr(206) => 278,
+    chr(207) => 278,
+    chr(208) => 722,
+    chr(209) => 722,
+    chr(210) => 778,
+    chr(211) => 778,
+    chr(212) => 778,
+    chr(213) => 778,
+    chr(214) => 778,
+    chr(215) => 584,
+    chr(216) => 778,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 667,
+    chr(222) => 667,
+    chr(223) => 611,
+    chr(224) => 556,
+    chr(225) => 556,
+    chr(226) => 556,
+    chr(227) => 556,
+    chr(228) => 556,
+    chr(229) => 556,
+    chr(230) => 889,
+    chr(231) => 556,
+    chr(232) => 556,
+    chr(233) => 556,
+    chr(234) => 556,
+    chr(235) => 556,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 611,
+    chr(241) => 611,
+    
+    chr(242) => 611,
+    chr(243) => 611,
+    chr(244) => 611,
+    chr(245) => 611,
+    chr(246) => 611,
+    chr(247) => 584,
+    chr(248) => 611,
+    chr(249) => 611,
+    chr(250) => 611,
+    chr(251) => 611,
+    chr(252) => 611,
+    chr(253) => 556,
+    chr(254) => 611,
+    chr(255) => 556);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helveticab.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helveticab.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helveticab.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helveticab.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['helveticaB'] = array(
-    chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
-    chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
-    ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
-    'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
-    'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
-    'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
-    chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
-    chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
-    chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
-    chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
-    chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+    chr(0) => 278,
+    chr(1) => 278,
+    chr(2) => 278,
+    chr(3) => 278,
+    chr(4) => 278,
+    chr(5) => 278,
+    chr(6) => 278,
+    chr(7) => 278,
+    chr(8) => 278,
+    chr(9) => 278,
+    chr(10) => 278,
+    chr(11) => 278,
+    chr(12) => 278,
+    chr(13) => 278,
+    chr(14) => 278,
+    chr(15) => 278,
+    chr(16) => 278,
+    chr(17) => 278,
+    chr(18) => 278,
+    chr(19) => 278,
+    chr(20) => 278,
+    chr(21) => 278,
+    
+    chr(22) => 278,
+    chr(23) => 278,
+    chr(24) => 278,
+    chr(25) => 278,
+    chr(26) => 278,
+    chr(27) => 278,
+    chr(28) => 278,
+    chr(29) => 278,
+    chr(30) => 278,
+    chr(31) => 278,
+    ' ' => 278,
+    '!' => 333,
+    '"' => 474,
+    '#' => 556,
+    '$' => 556,
+    '%' => 889,
+    '&' => 722,
+    '\'' => 238,
+    '(' => 333,
+    ')' => 333,
+    '*' => 389,
+    '+' => 584,
+    
+    ',' => 278,
+    '-' => 333,
+    '.' => 278,
+    '/' => 278,
+    '0' => 556,
+    '1' => 556,
+    '2' => 556,
+    '3' => 556,
+    '4' => 556,
+    '5' => 556,
+    '6' => 556,
+    '7' => 556,
+    '8' => 556,
+    '9' => 556,
+    ':' => 333,
+    ';' => 333,
+    '<' => 584,
+    '=' => 584,
+    '>' => 584,
+    '?' => 611,
+    '@' => 975,
+    'A' => 722,
+    
+    'B' => 722,
+    'C' => 722,
+    'D' => 722,
+    'E' => 667,
+    'F' => 611,
+    'G' => 778,
+    'H' => 722,
+    'I' => 278,
+    'J' => 556,
+    'K' => 722,
+    'L' => 611,
+    'M' => 833,
+    'N' => 722,
+    'O' => 778,
+    'P' => 667,
+    'Q' => 778,
+    'R' => 722,
+    'S' => 667,
+    'T' => 611,
+    'U' => 722,
+    'V' => 667,
+    'W' => 944,
+    
+    'X' => 667,
+    'Y' => 667,
+    'Z' => 611,
+    '[' => 333,
+    '\\' => 278,
+    ']' => 333,
+    '^' => 584,
+    '_' => 556,
+    '`' => 333,
+    'a' => 556,
+    'b' => 611,
+    'c' => 556,
+    'd' => 611,
+    'e' => 556,
+    'f' => 333,
+    'g' => 611,
+    'h' => 611,
+    'i' => 278,
+    'j' => 278,
+    'k' => 556,
+    'l' => 278,
+    'm' => 889,
+    
+    'n' => 611,
+    'o' => 611,
+    'p' => 611,
+    'q' => 611,
+    'r' => 389,
+    's' => 556,
+    't' => 333,
+    'u' => 611,
+    'v' => 556,
+    'w' => 778,
+    'x' => 556,
+    'y' => 556,
+    'z' => 500,
+    '{' => 389,
+    '|' => 280,
+    '}' => 389,
+    '~' => 584,
+    chr(127) => 350,
+    chr(128) => 556,
+    chr(129) => 350,
+    chr(130) => 278,
+    chr(131) => 556,
+    
+    chr(132) => 500,
+    chr(133) => 1000,
+    chr(134) => 556,
+    chr(135) => 556,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 667,
+    chr(139) => 333,
+    chr(140) => 1000,
+    chr(141) => 350,
+    chr(142) => 611,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 278,
+    chr(146) => 278,
+    chr(147) => 500,
+    chr(148) => 500,
+    chr(149) => 350,
+    chr(150) => 556,
+    chr(151) => 1000,
+    chr(152) => 333,
+    chr(153) => 1000,
+    
+    chr(154) => 556,
+    chr(155) => 333,
+    chr(156) => 944,
+    chr(157) => 350,
+    chr(158) => 500,
+    chr(159) => 667,
+    chr(160) => 278,
+    chr(161) => 333,
+    chr(162) => 556,
+    chr(163) => 556,
+    chr(164) => 556,
+    chr(165) => 556,
+    chr(166) => 280,
+    chr(167) => 556,
+    chr(168) => 333,
+    chr(169) => 737,
+    chr(170) => 370,
+    chr(171) => 556,
+    chr(172) => 584,
+    chr(173) => 333,
+    chr(174) => 737,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 584,
+    chr(178) => 333,
+    chr(179) => 333,
+    chr(180) => 333,
+    chr(181) => 611,
+    chr(182) => 556,
+    chr(183) => 278,
+    chr(184) => 333,
+    chr(185) => 333,
+    chr(186) => 365,
+    chr(187) => 556,
+    chr(188) => 834,
+    chr(189) => 834,
+    chr(190) => 834,
+    chr(191) => 611,
+    chr(192) => 722,
+    chr(193) => 722,
+    chr(194) => 722,
+    chr(195) => 722,
+    chr(196) => 722,
+    chr(197) => 722,
+    
+    chr(198) => 1000,
+    chr(199) => 722,
+    chr(200) => 667,
+    chr(201) => 667,
+    chr(202) => 667,
+    chr(203) => 667,
+    chr(204) => 278,
+    chr(205) => 278,
+    chr(206) => 278,
+    chr(207) => 278,
+    chr(208) => 722,
+    chr(209) => 722,
+    chr(210) => 778,
+    chr(211) => 778,
+    chr(212) => 778,
+    chr(213) => 778,
+    chr(214) => 778,
+    chr(215) => 584,
+    chr(216) => 778,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 667,
+    chr(222) => 667,
+    chr(223) => 611,
+    chr(224) => 556,
+    chr(225) => 556,
+    chr(226) => 556,
+    chr(227) => 556,
+    chr(228) => 556,
+    chr(229) => 556,
+    chr(230) => 889,
+    chr(231) => 556,
+    chr(232) => 556,
+    chr(233) => 556,
+    chr(234) => 556,
+    chr(235) => 556,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 611,
+    chr(241) => 611,
+    
+    chr(242) => 611,
+    chr(243) => 611,
+    chr(244) => 611,
+    chr(245) => 611,
+    chr(246) => 611,
+    chr(247) => 584,
+    chr(248) => 611,
+    chr(249) => 611,
+    chr(250) => 611,
+    chr(251) => 611,
+    chr(252) => 611,
+    chr(253) => 556,
+    chr(254) => 611,
+    chr(255) => 556);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helveticai.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helveticai.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helveticai.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helveticai.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['helveticaI'] = array(
-    chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
-    chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
-    ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
-    'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
-    'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
-    'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
-    chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
-    chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
-    chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
-    chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
-    chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+    chr(0) => 278,
+    chr(1) => 278,
+    chr(2) => 278,
+    chr(3) => 278,
+    chr(4) => 278,
+    chr(5) => 278,
+    chr(6) => 278,
+    chr(7) => 278,
+    chr(8) => 278,
+    chr(9) => 278,
+    chr(10) => 278,
+    chr(11) => 278,
+    chr(12) => 278,
+    chr(13) => 278,
+    chr(14) => 278,
+    chr(15) => 278,
+    chr(16) => 278,
+    chr(17) => 278,
+    chr(18) => 278,
+    chr(19) => 278,
+    chr(20) => 278,
+    chr(21) => 278,
+    
+    chr(22) => 278,
+    chr(23) => 278,
+    chr(24) => 278,
+    chr(25) => 278,
+    chr(26) => 278,
+    chr(27) => 278,
+    chr(28) => 278,
+    chr(29) => 278,
+    chr(30) => 278,
+    chr(31) => 278,
+    ' ' => 278,
+    '!' => 278,
+    '"' => 355,
+    '#' => 556,
+    '$' => 556,
+    '%' => 889,
+    '&' => 667,
+    '\'' => 191,
+    '(' => 333,
+    ')' => 333,
+    '*' => 389,
+    '+' => 584,
+    
+    ',' => 278,
+    '-' => 333,
+    '.' => 278,
+    '/' => 278,
+    '0' => 556,
+    '1' => 556,
+    '2' => 556,
+    '3' => 556,
+    '4' => 556,
+    '5' => 556,
+    '6' => 556,
+    '7' => 556,
+    '8' => 556,
+    '9' => 556,
+    ':' => 278,
+    ';' => 278,
+    '<' => 584,
+    '=' => 584,
+    '>' => 584,
+    '?' => 556,
+    '@' => 1015,
+    'A' => 667,
+    
+    'B' => 667,
+    'C' => 722,
+    'D' => 722,
+    'E' => 667,
+    'F' => 611,
+    'G' => 778,
+    'H' => 722,
+    'I' => 278,
+    'J' => 500,
+    'K' => 667,
+    'L' => 556,
+    'M' => 833,
+    'N' => 722,
+    'O' => 778,
+    'P' => 667,
+    'Q' => 778,
+    'R' => 722,
+    'S' => 667,
+    'T' => 611,
+    'U' => 722,
+    'V' => 667,
+    'W' => 944,
+    
+    'X' => 667,
+    'Y' => 667,
+    'Z' => 611,
+    '[' => 278,
+    '\\' => 278,
+    ']' => 278,
+    '^' => 469,
+    '_' => 556,
+    '`' => 333,
+    'a' => 556,
+    'b' => 556,
+    'c' => 500,
+    'd' => 556,
+    'e' => 556,
+    'f' => 278,
+    'g' => 556,
+    'h' => 556,
+    'i' => 222,
+    'j' => 222,
+    'k' => 500,
+    'l' => 222,
+    'm' => 833,
+    
+    'n' => 556,
+    'o' => 556,
+    'p' => 556,
+    'q' => 556,
+    'r' => 333,
+    's' => 500,
+    't' => 278,
+    'u' => 556,
+    'v' => 500,
+    'w' => 722,
+    'x' => 500,
+    'y' => 500,
+    'z' => 500,
+    '{' => 334,
+    '|' => 260,
+    '}' => 334,
+    '~' => 584,
+    chr(127) => 350,
+    chr(128) => 556,
+    chr(129) => 350,
+    chr(130) => 222,
+    chr(131) => 556,
+    
+    chr(132) => 333,
+    chr(133) => 1000,
+    chr(134) => 556,
+    chr(135) => 556,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 667,
+    chr(139) => 333,
+    chr(140) => 1000,
+    chr(141) => 350,
+    chr(142) => 611,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 222,
+    chr(146) => 222,
+    chr(147) => 333,
+    chr(148) => 333,
+    chr(149) => 350,
+    chr(150) => 556,
+    chr(151) => 1000,
+    chr(152) => 333,
+    chr(153) => 1000,
+    
+    chr(154) => 500,
+    chr(155) => 333,
+    chr(156) => 944,
+    chr(157) => 350,
+    chr(158) => 500,
+    chr(159) => 667,
+    chr(160) => 278,
+    chr(161) => 333,
+    chr(162) => 556,
+    chr(163) => 556,
+    chr(164) => 556,
+    chr(165) => 556,
+    chr(166) => 260,
+    chr(167) => 556,
+    chr(168) => 333,
+    chr(169) => 737,
+    chr(170) => 370,
+    chr(171) => 556,
+    chr(172) => 584,
+    chr(173) => 333,
+    chr(174) => 737,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 584,
+    chr(178) => 333,
+    chr(179) => 333,
+    chr(180) => 333,
+    chr(181) => 556,
+    chr(182) => 537,
+    chr(183) => 278,
+    chr(184) => 333,
+    chr(185) => 333,
+    chr(186) => 365,
+    chr(187) => 556,
+    chr(188) => 834,
+    chr(189) => 834,
+    chr(190) => 834,
+    chr(191) => 611,
+    chr(192) => 667,
+    chr(193) => 667,
+    chr(194) => 667,
+    chr(195) => 667,
+    chr(196) => 667,
+    chr(197) => 667,
+    
+    chr(198) => 1000,
+    chr(199) => 722,
+    chr(200) => 667,
+    chr(201) => 667,
+    chr(202) => 667,
+    chr(203) => 667,
+    chr(204) => 278,
+    chr(205) => 278,
+    chr(206) => 278,
+    chr(207) => 278,
+    chr(208) => 722,
+    chr(209) => 722,
+    chr(210) => 778,
+    chr(211) => 778,
+    chr(212) => 778,
+    chr(213) => 778,
+    chr(214) => 778,
+    chr(215) => 584,
+    chr(216) => 778,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 667,
+    chr(222) => 667,
+    chr(223) => 611,
+    chr(224) => 556,
+    chr(225) => 556,
+    chr(226) => 556,
+    chr(227) => 556,
+    chr(228) => 556,
+    chr(229) => 556,
+    chr(230) => 889,
+    chr(231) => 500,
+    chr(232) => 556,
+    chr(233) => 556,
+    chr(234) => 556,
+    chr(235) => 556,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 556,
+    chr(241) => 556,
+    
+    chr(242) => 556,
+    chr(243) => 556,
+    chr(244) => 556,
+    chr(245) => 556,
+    chr(246) => 556,
+    chr(247) => 584,
+    chr(248) => 611,
+    chr(249) => 556,
+    chr(250) => 556,
+    chr(251) => 556,
+    chr(252) => 556,
+    chr(253) => 500,
+    chr(254) => 556,
+    chr(255) => 500);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helvetica.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helvetica.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/helvetica.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/helvetica.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['helvetica'] = array(
-    chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
-    chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
-    ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
-    'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
-    'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
-    'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
-    chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
-    chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
-    chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
-    chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
-    chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+    chr(0) => 278,
+    chr(1) => 278,
+    chr(2) => 278,
+    chr(3) => 278,
+    chr(4) => 278,
+    chr(5) => 278,
+    chr(6) => 278,
+    chr(7) => 278,
+    chr(8) => 278,
+    chr(9) => 278,
+    chr(10) => 278,
+    chr(11) => 278,
+    chr(12) => 278,
+    chr(13) => 278,
+    chr(14) => 278,
+    chr(15) => 278,
+    chr(16) => 278,
+    chr(17) => 278,
+    chr(18) => 278,
+    chr(19) => 278,
+    chr(20) => 278,
+    chr(21) => 278,
+    
+    chr(22) => 278,
+    chr(23) => 278,
+    chr(24) => 278,
+    chr(25) => 278,
+    chr(26) => 278,
+    chr(27) => 278,
+    chr(28) => 278,
+    chr(29) => 278,
+    chr(30) => 278,
+    chr(31) => 278,
+    ' ' => 278,
+    '!' => 278,
+    '"' => 355,
+    '#' => 556,
+    '$' => 556,
+    '%' => 889,
+    '&' => 667,
+    '\'' => 191,
+    '(' => 333,
+    ')' => 333,
+    '*' => 389,
+    '+' => 584,
+    
+    ',' => 278,
+    '-' => 333,
+    '.' => 278,
+    '/' => 278,
+    '0' => 556,
+    '1' => 556,
+    '2' => 556,
+    '3' => 556,
+    '4' => 556,
+    '5' => 556,
+    '6' => 556,
+    '7' => 556,
+    '8' => 556,
+    '9' => 556,
+    ':' => 278,
+    ';' => 278,
+    '<' => 584,
+    '=' => 584,
+    '>' => 584,
+    '?' => 556,
+    '@' => 1015,
+    'A' => 667,
+    
+    'B' => 667,
+    'C' => 722,
+    'D' => 722,
+    'E' => 667,
+    'F' => 611,
+    'G' => 778,
+    'H' => 722,
+    'I' => 278,
+    'J' => 500,
+    'K' => 667,
+    'L' => 556,
+    'M' => 833,
+    'N' => 722,
+    'O' => 778,
+    'P' => 667,
+    'Q' => 778,
+    'R' => 722,
+    'S' => 667,
+    'T' => 611,
+    'U' => 722,
+    'V' => 667,
+    'W' => 944,
+    
+    'X' => 667,
+    'Y' => 667,
+    'Z' => 611,
+    '[' => 278,
+    '\\' => 278,
+    ']' => 278,
+    '^' => 469,
+    '_' => 556,
+    '`' => 333,
+    'a' => 556,
+    'b' => 556,
+    'c' => 500,
+    'd' => 556,
+    'e' => 556,
+    'f' => 278,
+    'g' => 556,
+    'h' => 556,
+    'i' => 222,
+    'j' => 222,
+    'k' => 500,
+    'l' => 222,
+    'm' => 833,
+    
+    'n' => 556,
+    'o' => 556,
+    'p' => 556,
+    'q' => 556,
+    'r' => 333,
+    's' => 500,
+    't' => 278,
+    'u' => 556,
+    'v' => 500,
+    'w' => 722,
+    'x' => 500,
+    'y' => 500,
+    'z' => 500,
+    '{' => 334,
+    '|' => 260,
+    '}' => 334,
+    '~' => 584,
+    chr(127) => 350,
+    chr(128) => 556,
+    chr(129) => 350,
+    chr(130) => 222,
+    chr(131) => 556,
+    
+    chr(132) => 333,
+    chr(133) => 1000,
+    chr(134) => 556,
+    chr(135) => 556,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 667,
+    chr(139) => 333,
+    chr(140) => 1000,
+    chr(141) => 350,
+    chr(142) => 611,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 222,
+    chr(146) => 222,
+    chr(147) => 333,
+    chr(148) => 333,
+    chr(149) => 350,
+    chr(150) => 556,
+    chr(151) => 1000,
+    chr(152) => 333,
+    chr(153) => 1000,
+    
+    chr(154) => 500,
+    chr(155) => 333,
+    chr(156) => 944,
+    chr(157) => 350,
+    chr(158) => 500,
+    chr(159) => 667,
+    chr(160) => 278,
+    chr(161) => 333,
+    chr(162) => 556,
+    chr(163) => 556,
+    chr(164) => 556,
+    chr(165) => 556,
+    chr(166) => 260,
+    chr(167) => 556,
+    chr(168) => 333,
+    chr(169) => 737,
+    chr(170) => 370,
+    chr(171) => 556,
+    chr(172) => 584,
+    chr(173) => 333,
+    chr(174) => 737,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 584,
+    chr(178) => 333,
+    chr(179) => 333,
+    chr(180) => 333,
+    chr(181) => 556,
+    chr(182) => 537,
+    chr(183) => 278,
+    chr(184) => 333,
+    chr(185) => 333,
+    chr(186) => 365,
+    chr(187) => 556,
+    chr(188) => 834,
+    chr(189) => 834,
+    chr(190) => 834,
+    chr(191) => 611,
+    chr(192) => 667,
+    chr(193) => 667,
+    chr(194) => 667,
+    chr(195) => 667,
+    chr(196) => 667,
+    chr(197) => 667,
+    
+    chr(198) => 1000,
+    chr(199) => 722,
+    chr(200) => 667,
+    chr(201) => 667,
+    chr(202) => 667,
+    chr(203) => 667,
+    chr(204) => 278,
+    chr(205) => 278,
+    chr(206) => 278,
+    chr(207) => 278,
+    chr(208) => 722,
+    chr(209) => 722,
+    chr(210) => 778,
+    chr(211) => 778,
+    chr(212) => 778,
+    chr(213) => 778,
+    chr(214) => 778,
+    chr(215) => 584,
+    chr(216) => 778,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 667,
+    chr(222) => 667,
+    chr(223) => 611,
+    chr(224) => 556,
+    chr(225) => 556,
+    chr(226) => 556,
+    chr(227) => 556,
+    chr(228) => 556,
+    chr(229) => 556,
+    chr(230) => 889,
+    chr(231) => 500,
+    chr(232) => 556,
+    chr(233) => 556,
+    chr(234) => 556,
+    chr(235) => 556,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 556,
+    chr(241) => 556,
+    
+    chr(242) => 556,
+    chr(243) => 556,
+    chr(244) => 556,
+    chr(245) => 556,
+    chr(246) => 556,
+    chr(247) => 584,
+    chr(248) => 611,
+    chr(249) => 556,
+    chr(250) => 556,
+    chr(251) => 556,
+    chr(252) => 556,
+    chr(253) => 500,
+    chr(254) => 556,
+    chr(255) => 500);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/symbol.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/symbol.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/symbol.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/symbol.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['symbol'] = array(
-    chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
-    chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
-    ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
-    'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
-    'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
-    'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
-    chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
-    chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
-    chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
-    chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
-    chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
-    chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
+    chr(0) => 250,
+    chr(1) => 250,
+    chr(2) => 250,
+    chr(3) => 250,
+    chr(4) => 250,
+    chr(5) => 250,
+    chr(6) => 250,
+    chr(7) => 250,
+    chr(8) => 250,
+    chr(9) => 250,
+    chr(10) => 250,
+    chr(11) => 250,
+    chr(12) => 250,
+    chr(13) => 250,
+    chr(14) => 250,
+    chr(15) => 250,
+    chr(16) => 250,
+    chr(17) => 250,
+    chr(18) => 250,
+    chr(19) => 250,
+    chr(20) => 250,
+    chr(21) => 250,
+    
+    chr(22) => 250,
+    chr(23) => 250,
+    chr(24) => 250,
+    chr(25) => 250,
+    chr(26) => 250,
+    chr(27) => 250,
+    chr(28) => 250,
+    chr(29) => 250,
+    chr(30) => 250,
+    chr(31) => 250,
+    ' ' => 250,
+    '!' => 333,
+    '"' => 713,
+    '#' => 500,
+    '$' => 549,
+    '%' => 833,
+    '&' => 778,
+    '\'' => 439,
+    '(' => 333,
+    ')' => 333,
+    '*' => 500,
+    '+' => 549,
+    
+    ',' => 250,
+    '-' => 549,
+    '.' => 250,
+    '/' => 278,
+    '0' => 500,
+    '1' => 500,
+    '2' => 500,
+    '3' => 500,
+    '4' => 500,
+    '5' => 500,
+    '6' => 500,
+    '7' => 500,
+    '8' => 500,
+    '9' => 500,
+    ':' => 278,
+    ';' => 278,
+    '<' => 549,
+    '=' => 549,
+    '>' => 549,
+    '?' => 444,
+    '@' => 549,
+    'A' => 722,
+    
+    'B' => 667,
+    'C' => 722,
+    'D' => 612,
+    'E' => 611,
+    'F' => 763,
+    'G' => 603,
+    'H' => 722,
+    'I' => 333,
+    'J' => 631,
+    'K' => 722,
+    'L' => 686,
+    'M' => 889,
+    'N' => 722,
+    'O' => 722,
+    'P' => 768,
+    'Q' => 741,
+    'R' => 556,
+    'S' => 592,
+    'T' => 611,
+    'U' => 690,
+    'V' => 439,
+    'W' => 768,
+    
+    'X' => 645,
+    'Y' => 795,
+    'Z' => 611,
+    '[' => 333,
+    '\\' => 863,
+    ']' => 333,
+    '^' => 658,
+    '_' => 500,
+    '`' => 500,
+    'a' => 631,
+    'b' => 549,
+    'c' => 549,
+    'd' => 494,
+    'e' => 439,
+    'f' => 521,
+    'g' => 411,
+    'h' => 603,
+    'i' => 329,
+    'j' => 603,
+    'k' => 549,
+    'l' => 549,
+    'm' => 576,
+    
+    'n' => 521,
+    'o' => 549,
+    'p' => 549,
+    'q' => 521,
+    'r' => 549,
+    's' => 603,
+    't' => 439,
+    'u' => 576,
+    'v' => 713,
+    'w' => 686,
+    'x' => 493,
+    'y' => 686,
+    'z' => 494,
+    '{' => 480,
+    '|' => 200,
+    '}' => 480,
+    '~' => 549,
+    chr(127) => 0,
+    chr(128) => 0,
+    chr(129) => 0,
+    chr(130) => 0,
+    chr(131) => 0,
+    
+    chr(132) => 0,
+    chr(133) => 0,
+    chr(134) => 0,
+    chr(135) => 0,
+    chr(136) => 0,
+    chr(137) => 0,
+    chr(138) => 0,
+    chr(139) => 0,
+    chr(140) => 0,
+    chr(141) => 0,
+    chr(142) => 0,
+    chr(143) => 0,
+    chr(144) => 0,
+    chr(145) => 0,
+    chr(146) => 0,
+    chr(147) => 0,
+    chr(148) => 0,
+    chr(149) => 0,
+    chr(150) => 0,
+    chr(151) => 0,
+    chr(152) => 0,
+    chr(153) => 0,
+    
+    chr(154) => 0,
+    chr(155) => 0,
+    chr(156) => 0,
+    chr(157) => 0,
+    chr(158) => 0,
+    chr(159) => 0,
+    chr(160) => 750,
+    chr(161) => 620,
+    chr(162) => 247,
+    chr(163) => 549,
+    chr(164) => 167,
+    chr(165) => 713,
+    chr(166) => 500,
+    chr(167) => 753,
+    chr(168) => 753,
+    chr(169) => 753,
+    chr(170) => 753,
+    chr(171) => 1042,
+    chr(172) => 987,
+    chr(173) => 603,
+    chr(174) => 987,
+    chr(175) => 603,
+    
+    chr(176) => 400,
+    chr(177) => 549,
+    chr(178) => 411,
+    chr(179) => 549,
+    chr(180) => 549,
+    chr(181) => 713,
+    chr(182) => 494,
+    chr(183) => 460,
+    chr(184) => 549,
+    chr(185) => 549,
+    chr(186) => 549,
+    chr(187) => 549,
+    chr(188) => 1000,
+    chr(189) => 603,
+    chr(190) => 1000,
+    chr(191) => 658,
+    chr(192) => 823,
+    chr(193) => 686,
+    chr(194) => 795,
+    chr(195) => 987,
+    chr(196) => 768,
+    chr(197) => 768,
+    
+    chr(198) => 823,
+    chr(199) => 768,
+    chr(200) => 768,
+    chr(201) => 713,
+    chr(202) => 713,
+    chr(203) => 713,
+    chr(204) => 713,
+    chr(205) => 713,
+    chr(206) => 713,
+    chr(207) => 713,
+    chr(208) => 768,
+    chr(209) => 713,
+    chr(210) => 790,
+    chr(211) => 790,
+    chr(212) => 890,
+    chr(213) => 823,
+    chr(214) => 549,
+    chr(215) => 250,
+    chr(216) => 713,
+    chr(217) => 603,
+    chr(218) => 603,
+    chr(219) => 1042,
+    
+    chr(220) => 987,
+    chr(221) => 603,
+    chr(222) => 987,
+    chr(223) => 603,
+    chr(224) => 494,
+    chr(225) => 329,
+    chr(226) => 790,
+    chr(227) => 790,
+    chr(228) => 786,
+    chr(229) => 713,
+    chr(230) => 384,
+    chr(231) => 384,
+    chr(232) => 384,
+    chr(233) => 384,
+    chr(234) => 384,
+    chr(235) => 384,
+    chr(236) => 494,
+    chr(237) => 494,
+    chr(238) => 494,
+    chr(239) => 494,
+    chr(240) => 0,
+    chr(241) => 329,
+    
+    chr(242) => 274,
+    chr(243) => 686,
+    chr(244) => 686,
+    chr(245) => 686,
+    chr(246) => 384,
+    chr(247) => 384,
+    chr(248) => 384,
+    chr(249) => 384,
+    chr(250) => 384,
+    chr(251) => 384,
+    chr(252) => 494,
+    chr(253) => 494,
+    chr(254) => 494,
+    chr(255) => 0);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/timesbi.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/timesbi.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/timesbi.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/timesbi.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['timesBI'] = array(
-    chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
-    chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
-    ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
-    'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
-    'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
-    'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
-    chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
-    chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
-    chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
-    chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
-    chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+    chr(0) => 250,
+    chr(1) => 250,
+    chr(2) => 250,
+    chr(3) => 250,
+    chr(4) => 250,
+    chr(5) => 250,
+    chr(6) => 250,
+    chr(7) => 250,
+    chr(8) => 250,
+    chr(9) => 250,
+    chr(10) => 250,
+    chr(11) => 250,
+    chr(12) => 250,
+    chr(13) => 250,
+    chr(14) => 250,
+    chr(15) => 250,
+    chr(16) => 250,
+    chr(17) => 250,
+    chr(18) => 250,
+    chr(19) => 250,
+    chr(20) => 250,
+    chr(21) => 250,
+    
+    chr(22) => 250,
+    chr(23) => 250,
+    chr(24) => 250,
+    chr(25) => 250,
+    chr(26) => 250,
+    chr(27) => 250,
+    chr(28) => 250,
+    chr(29) => 250,
+    chr(30) => 250,
+    chr(31) => 250,
+    ' ' => 250,
+    '!' => 389,
+    '"' => 555,
+    '#' => 500,
+    '$' => 500,
+    '%' => 833,
+    '&' => 778,
+    '\'' => 278,
+    '(' => 333,
+    ')' => 333,
+    '*' => 500,
+    '+' => 570,
+    
+    ',' => 250,
+    '-' => 333,
+    '.' => 250,
+    '/' => 278,
+    '0' => 500,
+    '1' => 500,
+    '2' => 500,
+    '3' => 500,
+    '4' => 500,
+    '5' => 500,
+    '6' => 500,
+    '7' => 500,
+    '8' => 500,
+    '9' => 500,
+    ':' => 333,
+    ';' => 333,
+    '<' => 570,
+    '=' => 570,
+    '>' => 570,
+    '?' => 500,
+    '@' => 832,
+    'A' => 667,
+    
+    'B' => 667,
+    'C' => 667,
+    'D' => 722,
+    'E' => 667,
+    'F' => 667,
+    'G' => 722,
+    'H' => 778,
+    'I' => 389,
+    'J' => 500,
+    'K' => 667,
+    'L' => 611,
+    'M' => 889,
+    'N' => 722,
+    'O' => 722,
+    'P' => 611,
+    'Q' => 722,
+    'R' => 667,
+    'S' => 556,
+    'T' => 611,
+    'U' => 722,
+    'V' => 667,
+    'W' => 889,
+    
+    'X' => 667,
+    'Y' => 611,
+    'Z' => 611,
+    '[' => 333,
+    '\\' => 278,
+    ']' => 333,
+    '^' => 570,
+    '_' => 500,
+    '`' => 333,
+    'a' => 500,
+    'b' => 500,
+    'c' => 444,
+    'd' => 500,
+    'e' => 444,
+    'f' => 333,
+    'g' => 500,
+    'h' => 556,
+    'i' => 278,
+    'j' => 278,
+    'k' => 500,
+    'l' => 278,
+    'm' => 778,
+    
+    'n' => 556,
+    'o' => 500,
+    'p' => 500,
+    'q' => 500,
+    'r' => 389,
+    's' => 389,
+    't' => 278,
+    'u' => 556,
+    'v' => 444,
+    'w' => 667,
+    'x' => 500,
+    'y' => 444,
+    'z' => 389,
+    '{' => 348,
+    '|' => 220,
+    '}' => 348,
+    '~' => 570,
+    chr(127) => 350,
+    chr(128) => 500,
+    chr(129) => 350,
+    chr(130) => 333,
+    chr(131) => 500,
+    
+    chr(132) => 500,
+    chr(133) => 1000,
+    chr(134) => 500,
+    chr(135) => 500,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 556,
+    chr(139) => 333,
+    chr(140) => 944,
+    chr(141) => 350,
+    chr(142) => 611,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 333,
+    chr(146) => 333,
+    chr(147) => 500,
+    chr(148) => 500,
+    chr(149) => 350,
+    chr(150) => 500,
+    chr(151) => 1000,
+    chr(152) => 333,
+    chr(153) => 1000,
+    
+    chr(154) => 389,
+    chr(155) => 333,
+    chr(156) => 722,
+    chr(157) => 350,
+    chr(158) => 389,
+    chr(159) => 611,
+    chr(160) => 250,
+    chr(161) => 389,
+    chr(162) => 500,
+    chr(163) => 500,
+    chr(164) => 500,
+    chr(165) => 500,
+    chr(166) => 220,
+    chr(167) => 500,
+    chr(168) => 333,
+    chr(169) => 747,
+    chr(170) => 266,
+    chr(171) => 500,
+    chr(172) => 606,
+    chr(173) => 333,
+    chr(174) => 747,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 570,
+    chr(178) => 300,
+    chr(179) => 300,
+    chr(180) => 333,
+    chr(181) => 576,
+    chr(182) => 500,
+    chr(183) => 250,
+    chr(184) => 333,
+    chr(185) => 300,
+    chr(186) => 300,
+    chr(187) => 500,
+    chr(188) => 750,
+    chr(189) => 750,
+    chr(190) => 750,
+    chr(191) => 500,
+    chr(192) => 667,
+    chr(193) => 667,
+    chr(194) => 667,
+    chr(195) => 667,
+    chr(196) => 667,
+    chr(197) => 667,
+    
+    chr(198) => 944,
+    chr(199) => 667,
+    chr(200) => 667,
+    chr(201) => 667,
+    chr(202) => 667,
+    chr(203) => 667,
+    chr(204) => 389,
+    chr(205) => 389,
+    chr(206) => 389,
+    chr(207) => 389,
+    chr(208) => 722,
+    chr(209) => 722,
+    chr(210) => 722,
+    chr(211) => 722,
+    chr(212) => 722,
+    chr(213) => 722,
+    chr(214) => 722,
+    chr(215) => 570,
+    chr(216) => 722,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 611,
+    chr(222) => 611,
+    chr(223) => 500,
+    chr(224) => 500,
+    chr(225) => 500,
+    chr(226) => 500,
+    chr(227) => 500,
+    chr(228) => 500,
+    chr(229) => 500,
+    chr(230) => 722,
+    chr(231) => 444,
+    chr(232) => 444,
+    chr(233) => 444,
+    chr(234) => 444,
+    chr(235) => 444,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 500,
+    chr(241) => 556,
+    
+    chr(242) => 500,
+    chr(243) => 500,
+    chr(244) => 500,
+    chr(245) => 500,
+    chr(246) => 500,
+    chr(247) => 570,
+    chr(248) => 500,
+    chr(249) => 556,
+    chr(250) => 556,
+    chr(251) => 556,
+    chr(252) => 556,
+    chr(253) => 444,
+    chr(254) => 500,
+    chr(255) => 444);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/timesb.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/timesb.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/timesb.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/timesb.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['timesB'] = array(
-    chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
-    chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
-    ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
-    'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
-    'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
-    'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
-    chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
-    chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
-    chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
-    chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
-    chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+    chr(0) => 250,
+    chr(1) => 250,
+    chr(2) => 250,
+    chr(3) => 250,
+    chr(4) => 250,
+    chr(5) => 250,
+    chr(6) => 250,
+    chr(7) => 250,
+    chr(8) => 250,
+    chr(9) => 250,
+    chr(10) => 250,
+    chr(11) => 250,
+    chr(12) => 250,
+    chr(13) => 250,
+    chr(14) => 250,
+    chr(15) => 250,
+    chr(16) => 250,
+    chr(17) => 250,
+    chr(18) => 250,
+    chr(19) => 250,
+    chr(20) => 250,
+    chr(21) => 250,
+    
+    chr(22) => 250,
+    chr(23) => 250,
+    chr(24) => 250,
+    chr(25) => 250,
+    chr(26) => 250,
+    chr(27) => 250,
+    chr(28) => 250,
+    chr(29) => 250,
+    chr(30) => 250,
+    chr(31) => 250,
+    ' ' => 250,
+    '!' => 333,
+    '"' => 555,
+    '#' => 500,
+    '$' => 500,
+    '%' => 1000,
+    '&' => 833,
+    '\'' => 278,
+    '(' => 333,
+    ')' => 333,
+    '*' => 500,
+    '+' => 570,
+    
+    ',' => 250,
+    '-' => 333,
+    '.' => 250,
+    '/' => 278,
+    '0' => 500,
+    '1' => 500,
+    '2' => 500,
+    '3' => 500,
+    '4' => 500,
+    '5' => 500,
+    '6' => 500,
+    '7' => 500,
+    '8' => 500,
+    '9' => 500,
+    ':' => 333,
+    ';' => 333,
+    '<' => 570,
+    '=' => 570,
+    '>' => 570,
+    '?' => 500,
+    '@' => 930,
+    'A' => 722,
+    
+    'B' => 667,
+    'C' => 722,
+    'D' => 722,
+    'E' => 667,
+    'F' => 611,
+    'G' => 778,
+    'H' => 778,
+    'I' => 389,
+    'J' => 500,
+    'K' => 778,
+    'L' => 667,
+    'M' => 944,
+    'N' => 722,
+    'O' => 778,
+    'P' => 611,
+    'Q' => 778,
+    'R' => 722,
+    'S' => 556,
+    'T' => 667,
+    'U' => 722,
+    'V' => 722,
+    'W' => 1000,
+    
+    'X' => 722,
+    'Y' => 722,
+    'Z' => 667,
+    '[' => 333,
+    '\\' => 278,
+    ']' => 333,
+    '^' => 581,
+    '_' => 500,
+    '`' => 333,
+    'a' => 500,
+    'b' => 556,
+    'c' => 444,
+    'd' => 556,
+    'e' => 444,
+    'f' => 333,
+    'g' => 500,
+    'h' => 556,
+    'i' => 278,
+    'j' => 333,
+    'k' => 556,
+    'l' => 278,
+    'm' => 833,
+    
+    'n' => 556,
+    'o' => 500,
+    'p' => 556,
+    'q' => 556,
+    'r' => 444,
+    's' => 389,
+    't' => 333,
+    'u' => 556,
+    'v' => 500,
+    'w' => 722,
+    'x' => 500,
+    'y' => 500,
+    'z' => 444,
+    '{' => 394,
+    '|' => 220,
+    '}' => 394,
+    '~' => 520,
+    chr(127) => 350,
+    chr(128) => 500,
+    chr(129) => 350,
+    chr(130) => 333,
+    chr(131) => 500,
+    
+    chr(132) => 500,
+    chr(133) => 1000,
+    chr(134) => 500,
+    chr(135) => 500,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 556,
+    chr(139) => 333,
+    chr(140) => 1000,
+    chr(141) => 350,
+    chr(142) => 667,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 333,
+    chr(146) => 333,
+    chr(147) => 500,
+    chr(148) => 500,
+    chr(149) => 350,
+    chr(150) => 500,
+    chr(151) => 1000,
+    chr(152) => 333,
+    chr(153) => 1000,
+    
+    chr(154) => 389,
+    chr(155) => 333,
+    chr(156) => 722,
+    chr(157) => 350,
+    chr(158) => 444,
+    chr(159) => 722,
+    chr(160) => 250,
+    chr(161) => 333,
+    chr(162) => 500,
+    chr(163) => 500,
+    chr(164) => 500,
+    chr(165) => 500,
+    chr(166) => 220,
+    chr(167) => 500,
+    chr(168) => 333,
+    chr(169) => 747,
+    chr(170) => 300,
+    chr(171) => 500,
+    chr(172) => 570,
+    chr(173) => 333,
+    chr(174) => 747,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 570,
+    chr(178) => 300,
+    chr(179) => 300,
+    chr(180) => 333,
+    chr(181) => 556,
+    chr(182) => 540,
+    chr(183) => 250,
+    chr(184) => 333,
+    chr(185) => 300,
+    chr(186) => 330,
+    chr(187) => 500,
+    chr(188) => 750,
+    chr(189) => 750,
+    chr(190) => 750,
+    chr(191) => 500,
+    chr(192) => 722,
+    chr(193) => 722,
+    chr(194) => 722,
+    chr(195) => 722,
+    chr(196) => 722,
+    chr(197) => 722,
+    
+    chr(198) => 1000,
+    chr(199) => 722,
+    chr(200) => 667,
+    chr(201) => 667,
+    chr(202) => 667,
+    chr(203) => 667,
+    chr(204) => 389,
+    chr(205) => 389,
+    chr(206) => 389,
+    chr(207) => 389,
+    chr(208) => 722,
+    chr(209) => 722,
+    chr(210) => 778,
+    chr(211) => 778,
+    chr(212) => 778,
+    chr(213) => 778,
+    chr(214) => 778,
+    chr(215) => 570,
+    chr(216) => 778,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 722,
+    chr(222) => 611,
+    chr(223) => 556,
+    chr(224) => 500,
+    chr(225) => 500,
+    chr(226) => 500,
+    chr(227) => 500,
+    chr(228) => 500,
+    chr(229) => 500,
+    chr(230) => 722,
+    chr(231) => 444,
+    chr(232) => 444,
+    chr(233) => 444,
+    chr(234) => 444,
+    chr(235) => 444,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 500,
+    chr(241) => 556,
+    
+    chr(242) => 500,
+    chr(243) => 500,
+    chr(244) => 500,
+    chr(245) => 500,
+    chr(246) => 500,
+    chr(247) => 570,
+    chr(248) => 500,
+    chr(249) => 556,
+    chr(250) => 556,
+    chr(251) => 556,
+    chr(252) => 556,
+    chr(253) => 500,
+    chr(254) => 556,
+    chr(255) => 500);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/timesi.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/timesi.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/timesi.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/timesi.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['timesI'] = array(
-    chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
-    chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
-    ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
-    'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
-    'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
-    'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
-    chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
-    chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
-    chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
-    chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
-    chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+    chr(0) => 250,
+    chr(1) => 250,
+    chr(2) => 250,
+    chr(3) => 250,
+    chr(4) => 250,
+    chr(5) => 250,
+    chr(6) => 250,
+    chr(7) => 250,
+    chr(8) => 250,
+    chr(9) => 250,
+    chr(10) => 250,
+    chr(11) => 250,
+    chr(12) => 250,
+    chr(13) => 250,
+    chr(14) => 250,
+    chr(15) => 250,
+    chr(16) => 250,
+    chr(17) => 250,
+    chr(18) => 250,
+    chr(19) => 250,
+    chr(20) => 250,
+    chr(21) => 250,
+    
+    chr(22) => 250,
+    chr(23) => 250,
+    chr(24) => 250,
+    chr(25) => 250,
+    chr(26) => 250,
+    chr(27) => 250,
+    chr(28) => 250,
+    chr(29) => 250,
+    chr(30) => 250,
+    chr(31) => 250,
+    ' ' => 250,
+    '!' => 333,
+    '"' => 420,
+    '#' => 500,
+    '$' => 500,
+    '%' => 833,
+    '&' => 778,
+    '\'' => 214,
+    '(' => 333,
+    ')' => 333,
+    '*' => 500,
+    '+' => 675,
+    
+    ',' => 250,
+    '-' => 333,
+    '.' => 250,
+    '/' => 278,
+    '0' => 500,
+    '1' => 500,
+    '2' => 500,
+    '3' => 500,
+    '4' => 500,
+    '5' => 500,
+    '6' => 500,
+    '7' => 500,
+    '8' => 500,
+    '9' => 500,
+    ':' => 333,
+    ';' => 333,
+    '<' => 675,
+    '=' => 675,
+    '>' => 675,
+    '?' => 500,
+    '@' => 920,
+    'A' => 611,
+    
+    'B' => 611,
+    'C' => 667,
+    'D' => 722,
+    'E' => 611,
+    'F' => 611,
+    'G' => 722,
+    'H' => 722,
+    'I' => 333,
+    'J' => 444,
+    'K' => 667,
+    'L' => 556,
+    'M' => 833,
+    'N' => 667,
+    'O' => 722,
+    'P' => 611,
+    'Q' => 722,
+    'R' => 611,
+    'S' => 500,
+    'T' => 556,
+    'U' => 722,
+    'V' => 611,
+    'W' => 833,
+    
+    'X' => 611,
+    'Y' => 556,
+    'Z' => 556,
+    '[' => 389,
+    '\\' => 278,
+    ']' => 389,
+    '^' => 422,
+    '_' => 500,
+    '`' => 333,
+    'a' => 500,
+    'b' => 500,
+    'c' => 444,
+    'd' => 500,
+    'e' => 444,
+    'f' => 278,
+    'g' => 500,
+    'h' => 500,
+    'i' => 278,
+    'j' => 278,
+    'k' => 444,
+    'l' => 278,
+    'm' => 722,
+    
+    'n' => 500,
+    'o' => 500,
+    'p' => 500,
+    'q' => 500,
+    'r' => 389,
+    's' => 389,
+    't' => 278,
+    'u' => 500,
+    'v' => 444,
+    'w' => 667,
+    'x' => 444,
+    'y' => 444,
+    'z' => 389,
+    '{' => 400,
+    '|' => 275,
+    '}' => 400,
+    '~' => 541,
+    chr(127) => 350,
+    chr(128) => 500,
+    chr(129) => 350,
+    chr(130) => 333,
+    chr(131) => 500,
+    
+    chr(132) => 556,
+    chr(133) => 889,
+    chr(134) => 500,
+    chr(135) => 500,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 500,
+    chr(139) => 333,
+    chr(140) => 944,
+    chr(141) => 350,
+    chr(142) => 556,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 333,
+    chr(146) => 333,
+    chr(147) => 556,
+    chr(148) => 556,
+    chr(149) => 350,
+    chr(150) => 500,
+    chr(151) => 889,
+    chr(152) => 333,
+    chr(153) => 980,
+    
+    chr(154) => 389,
+    chr(155) => 333,
+    chr(156) => 667,
+    chr(157) => 350,
+    chr(158) => 389,
+    chr(159) => 556,
+    chr(160) => 250,
+    chr(161) => 389,
+    chr(162) => 500,
+    chr(163) => 500,
+    chr(164) => 500,
+    chr(165) => 500,
+    chr(166) => 275,
+    chr(167) => 500,
+    chr(168) => 333,
+    chr(169) => 760,
+    chr(170) => 276,
+    chr(171) => 500,
+    chr(172) => 675,
+    chr(173) => 333,
+    chr(174) => 760,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 675,
+    chr(178) => 300,
+    chr(179) => 300,
+    chr(180) => 333,
+    chr(181) => 500,
+    chr(182) => 523,
+    chr(183) => 250,
+    chr(184) => 333,
+    chr(185) => 300,
+    chr(186) => 310,
+    chr(187) => 500,
+    chr(188) => 750,
+    chr(189) => 750,
+    chr(190) => 750,
+    chr(191) => 500,
+    chr(192) => 611,
+    chr(193) => 611,
+    chr(194) => 611,
+    chr(195) => 611,
+    chr(196) => 611,
+    chr(197) => 611,
+    
+    chr(198) => 889,
+    chr(199) => 667,
+    chr(200) => 611,
+    chr(201) => 611,
+    chr(202) => 611,
+    chr(203) => 611,
+    chr(204) => 333,
+    chr(205) => 333,
+    chr(206) => 333,
+    chr(207) => 333,
+    chr(208) => 722,
+    chr(209) => 667,
+    chr(210) => 722,
+    chr(211) => 722,
+    chr(212) => 722,
+    chr(213) => 722,
+    chr(214) => 722,
+    chr(215) => 675,
+    chr(216) => 722,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 556,
+    chr(222) => 611,
+    chr(223) => 500,
+    chr(224) => 500,
+    chr(225) => 500,
+    chr(226) => 500,
+    chr(227) => 500,
+    chr(228) => 500,
+    chr(229) => 500,
+    chr(230) => 667,
+    chr(231) => 444,
+    chr(232) => 444,
+    chr(233) => 444,
+    chr(234) => 444,
+    chr(235) => 444,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 500,
+    chr(241) => 500,
+    
+    chr(242) => 500,
+    chr(243) => 500,
+    chr(244) => 500,
+    chr(245) => 500,
+    chr(246) => 500,
+    chr(247) => 675,
+    chr(248) => 500,
+    chr(249) => 500,
+    chr(250) => 500,
+    chr(251) => 500,
+    chr(252) => 500,
+    chr(253) => 444,
+    chr(254) => 500,
+    chr(255) => 444);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/times.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/times.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/times.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/times.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['times'] = array(
-    chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
-    chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
-    ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
-    'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
-    'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
-    'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
-    chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
-    chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
-    chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
-    chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
-    chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
-    chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
+    chr(0) => 250,
+    chr(1) => 250,
+    chr(2) => 250,
+    chr(3) => 250,
+    chr(4) => 250,
+    chr(5) => 250,
+    chr(6) => 250,
+    chr(7) => 250,
+    chr(8) => 250,
+    chr(9) => 250,
+    chr(10) => 250,
+    chr(11) => 250,
+    chr(12) => 250,
+    chr(13) => 250,
+    chr(14) => 250,
+    chr(15) => 250,
+    chr(16) => 250,
+    chr(17) => 250,
+    chr(18) => 250,
+    chr(19) => 250,
+    chr(20) => 250,
+    chr(21) => 250,
+    
+    chr(22) => 250,
+    chr(23) => 250,
+    chr(24) => 250,
+    chr(25) => 250,
+    chr(26) => 250,
+    chr(27) => 250,
+    chr(28) => 250,
+    chr(29) => 250,
+    chr(30) => 250,
+    chr(31) => 250,
+    ' ' => 250,
+    '!' => 333,
+    '"' => 408,
+    '#' => 500,
+    '$' => 500,
+    '%' => 833,
+    '&' => 778,
+    '\'' => 180,
+    '(' => 333,
+    ')' => 333,
+    '*' => 500,
+    '+' => 564,
+    
+    ',' => 250,
+    '-' => 333,
+    '.' => 250,
+    '/' => 278,
+    '0' => 500,
+    '1' => 500,
+    '2' => 500,
+    '3' => 500,
+    '4' => 500,
+    '5' => 500,
+    '6' => 500,
+    '7' => 500,
+    '8' => 500,
+    '9' => 500,
+    ':' => 278,
+    ';' => 278,
+    '<' => 564,
+    '=' => 564,
+    '>' => 564,
+    '?' => 444,
+    '@' => 921,
+    'A' => 722,
+    
+    'B' => 667,
+    'C' => 667,
+    'D' => 722,
+    'E' => 611,
+    'F' => 556,
+    'G' => 722,
+    'H' => 722,
+    'I' => 333,
+    'J' => 389,
+    'K' => 722,
+    'L' => 611,
+    'M' => 889,
+    'N' => 722,
+    'O' => 722,
+    'P' => 556,
+    'Q' => 722,
+    'R' => 667,
+    'S' => 556,
+    'T' => 611,
+    'U' => 722,
+    'V' => 722,
+    'W' => 944,
+    
+    'X' => 722,
+    'Y' => 722,
+    'Z' => 611,
+    '[' => 333,
+    '\\' => 278,
+    ']' => 333,
+    '^' => 469,
+    '_' => 500,
+    '`' => 333,
+    'a' => 444,
+    'b' => 500,
+    'c' => 444,
+    'd' => 500,
+    'e' => 444,
+    'f' => 333,
+    'g' => 500,
+    'h' => 500,
+    'i' => 278,
+    'j' => 278,
+    'k' => 500,
+    'l' => 278,
+    'm' => 778,
+    
+    'n' => 500,
+    'o' => 500,
+    'p' => 500,
+    'q' => 500,
+    'r' => 333,
+    's' => 389,
+    't' => 278,
+    'u' => 500,
+    'v' => 500,
+    'w' => 722,
+    'x' => 500,
+    'y' => 500,
+    'z' => 444,
+    '{' => 480,
+    '|' => 200,
+    '}' => 480,
+    '~' => 541,
+    chr(127) => 350,
+    chr(128) => 500,
+    chr(129) => 350,
+    chr(130) => 333,
+    chr(131) => 500,
+    
+    chr(132) => 444,
+    chr(133) => 1000,
+    chr(134) => 500,
+    chr(135) => 500,
+    chr(136) => 333,
+    chr(137) => 1000,
+    chr(138) => 556,
+    chr(139) => 333,
+    chr(140) => 889,
+    chr(141) => 350,
+    chr(142) => 611,
+    chr(143) => 350,
+    chr(144) => 350,
+    chr(145) => 333,
+    chr(146) => 333,
+    chr(147) => 444,
+    chr(148) => 444,
+    chr(149) => 350,
+    chr(150) => 500,
+    chr(151) => 1000,
+    chr(152) => 333,
+    chr(153) => 980,
+    
+    chr(154) => 389,
+    chr(155) => 333,
+    chr(156) => 722,
+    chr(157) => 350,
+    chr(158) => 444,
+    chr(159) => 722,
+    chr(160) => 250,
+    chr(161) => 333,
+    chr(162) => 500,
+    chr(163) => 500,
+    chr(164) => 500,
+    chr(165) => 500,
+    chr(166) => 200,
+    chr(167) => 500,
+    chr(168) => 333,
+    chr(169) => 760,
+    chr(170) => 276,
+    chr(171) => 500,
+    chr(172) => 564,
+    chr(173) => 333,
+    chr(174) => 760,
+    chr(175) => 333,
+    
+    chr(176) => 400,
+    chr(177) => 564,
+    chr(178) => 300,
+    chr(179) => 300,
+    chr(180) => 333,
+    chr(181) => 500,
+    chr(182) => 453,
+    chr(183) => 250,
+    chr(184) => 333,
+    chr(185) => 300,
+    chr(186) => 310,
+    chr(187) => 500,
+    chr(188) => 750,
+    chr(189) => 750,
+    chr(190) => 750,
+    chr(191) => 444,
+    chr(192) => 722,
+    chr(193) => 722,
+    chr(194) => 722,
+    chr(195) => 722,
+    chr(196) => 722,
+    chr(197) => 722,
+    
+    chr(198) => 889,
+    chr(199) => 667,
+    chr(200) => 611,
+    chr(201) => 611,
+    chr(202) => 611,
+    chr(203) => 611,
+    chr(204) => 333,
+    chr(205) => 333,
+    chr(206) => 333,
+    chr(207) => 333,
+    chr(208) => 722,
+    chr(209) => 722,
+    chr(210) => 722,
+    chr(211) => 722,
+    chr(212) => 722,
+    chr(213) => 722,
+    chr(214) => 722,
+    chr(215) => 564,
+    chr(216) => 722,
+    chr(217) => 722,
+    chr(218) => 722,
+    chr(219) => 722,
+    
+    chr(220) => 722,
+    chr(221) => 722,
+    chr(222) => 556,
+    chr(223) => 500,
+    chr(224) => 444,
+    chr(225) => 444,
+    chr(226) => 444,
+    chr(227) => 444,
+    chr(228) => 444,
+    chr(229) => 444,
+    chr(230) => 667,
+    chr(231) => 444,
+    chr(232) => 444,
+    chr(233) => 444,
+    chr(234) => 444,
+    chr(235) => 444,
+    chr(236) => 278,
+    chr(237) => 278,
+    chr(238) => 278,
+    chr(239) => 278,
+    chr(240) => 500,
+    chr(241) => 500,
+    
+    chr(242) => 500,
+    chr(243) => 500,
+    chr(244) => 500,
+    chr(245) => 500,
+    chr(246) => 500,
+    chr(247) => 564,
+    chr(248) => 500,
+    chr(249) => 500,
+    chr(250) => 500,
+    chr(251) => 500,
+    chr(252) => 500,
+    chr(253) => 500,
+    chr(254) => 500,
+    chr(255) => 500);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/zapfdingbats.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/zapfdingbats.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF/fonts/zapfdingbats.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF/fonts/zapfdingbats.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,15 +3,270 @@
  * @package File_PDF
  */
 $font_widths['zapfdingbats'] = array(
-    chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
-    chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
-    ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
-    'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
-    'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
-    'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
-    chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
-    chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
-    chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
-    chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
-    chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
-    chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
+    chr(0) => 0,
+    chr(1) => 0,
+    chr(2) => 0,
+    chr(3) => 0,
+    chr(4) => 0,
+    chr(5) => 0,
+    chr(6) => 0,
+    chr(7) => 0,
+    chr(8) => 0,
+    chr(9) => 0,
+    chr(10) => 0,
+    chr(11) => 0,
+    chr(12) => 0,
+    chr(13) => 0,
+    chr(14) => 0,
+    chr(15) => 0,
+    chr(16) => 0,
+    chr(17) => 0,
+    chr(18) => 0,
+    chr(19) => 0,
+    chr(20) => 0,
+    chr(21) => 0,
+    
+    chr(22) => 0,
+    chr(23) => 0,
+    chr(24) => 0,
+    chr(25) => 0,
+    chr(26) => 0,
+    chr(27) => 0,
+    chr(28) => 0,
+    chr(29) => 0,
+    chr(30) => 0,
+    chr(31) => 0,
+    ' ' => 278,
+    '!' => 974,
+    '"' => 961,
+    '#' => 974,
+    '$' => 980,
+    '%' => 719,
+    '&' => 789,
+    '\'' => 790,
+    '(' => 791,
+    ')' => 690,
+    '*' => 960,
+    '+' => 939,
+    
+    ',' => 549,
+    '-' => 855,
+    '.' => 911,
+    '/' => 933,
+    '0' => 911,
+    '1' => 945,
+    '2' => 974,
+    '3' => 755,
+    '4' => 846,
+    '5' => 762,
+    '6' => 761,
+    '7' => 571,
+    '8' => 677,
+    '9' => 763,
+    ':' => 760,
+    ';' => 759,
+    '<' => 754,
+    '=' => 494,
+    '>' => 552,
+    '?' => 537,
+    '@' => 577,
+    'A' => 692,
+    
+    'B' => 786,
+    'C' => 788,
+    'D' => 788,
+    'E' => 790,
+    'F' => 793,
+    'G' => 794,
+    'H' => 816,
+    'I' => 823,
+    'J' => 789,
+    'K' => 841,
+    'L' => 823,
+    'M' => 833,
+    'N' => 816,
+    'O' => 831,
+    'P' => 923,
+    'Q' => 744,
+    'R' => 723,
+    'S' => 749,
+    'T' => 790,
+    'U' => 792,
+    'V' => 695,
+    'W' => 776,
+    
+    'X' => 768,
+    'Y' => 792,
+    'Z' => 759,
+    '[' => 707,
+    '\\' => 708,
+    ']' => 682,
+    '^' => 701,
+    '_' => 826,
+    '`' => 815,
+    'a' => 789,
+    'b' => 789,
+    'c' => 707,
+    'd' => 687,
+    'e' => 696,
+    'f' => 689,
+    'g' => 786,
+    'h' => 787,
+    'i' => 713,
+    'j' => 791,
+    'k' => 785,
+    'l' => 791,
+    'm' => 873,
+    
+    'n' => 761,
+    'o' => 762,
+    'p' => 762,
+    'q' => 759,
+    'r' => 759,
+    's' => 892,
+    't' => 892,
+    'u' => 788,
+    'v' => 784,
+    'w' => 438,
+    'x' => 138,
+    'y' => 277,
+    'z' => 415,
+    '{' => 392,
+    '|' => 392,
+    '}' => 668,
+    '~' => 668,
+    chr(127) => 0,
+    chr(128) => 390,
+    chr(129) => 390,
+    chr(130) => 317,
+    chr(131) => 317,
+    
+    chr(132) => 276,
+    chr(133) => 276,
+    chr(134) => 509,
+    chr(135) => 509,
+    chr(136) => 410,
+    chr(137) => 410,
+    chr(138) => 234,
+    chr(139) => 234,
+    chr(140) => 334,
+    chr(141) => 334,
+    chr(142) => 0,
+    chr(143) => 0,
+    chr(144) => 0,
+    chr(145) => 0,
+    chr(146) => 0,
+    chr(147) => 0,
+    chr(148) => 0,
+    chr(149) => 0,
+    chr(150) => 0,
+    chr(151) => 0,
+    chr(152) => 0,
+    chr(153) => 0,
+    
+    chr(154) => 0,
+    chr(155) => 0,
+    chr(156) => 0,
+    chr(157) => 0,
+    chr(158) => 0,
+    chr(159) => 0,
+    chr(160) => 0,
+    chr(161) => 732,
+    chr(162) => 544,
+    chr(163) => 544,
+    chr(164) => 910,
+    chr(165) => 667,
+    chr(166) => 760,
+    chr(167) => 760,
+    chr(168) => 776,
+    chr(169) => 595,
+    chr(170) => 694,
+    chr(171) => 626,
+    chr(172) => 788,
+    chr(173) => 788,
+    chr(174) => 788,
+    chr(175) => 788,
+    
+    chr(176) => 788,
+    chr(177) => 788,
+    chr(178) => 788,
+    chr(179) => 788,
+    chr(180) => 788,
+    chr(181) => 788,
+    chr(182) => 788,
+    chr(183) => 788,
+    chr(184) => 788,
+    chr(185) => 788,
+    chr(186) => 788,
+    chr(187) => 788,
+    chr(188) => 788,
+    chr(189) => 788,
+    chr(190) => 788,
+    chr(191) => 788,
+    chr(192) => 788,
+    chr(193) => 788,
+    chr(194) => 788,
+    chr(195) => 788,
+    chr(196) => 788,
+    chr(197) => 788,
+    
+    chr(198) => 788,
+    chr(199) => 788,
+    chr(200) => 788,
+    chr(201) => 788,
+    chr(202) => 788,
+    chr(203) => 788,
+    chr(204) => 788,
+    chr(205) => 788,
+    chr(206) => 788,
+    chr(207) => 788,
+    chr(208) => 788,
+    chr(209) => 788,
+    chr(210) => 788,
+    chr(211) => 788,
+    chr(212) => 894,
+    chr(213) => 838,
+    chr(214) => 1016,
+    chr(215) => 458,
+    chr(216) => 748,
+    chr(217) => 924,
+    chr(218) => 748,
+    chr(219) => 918,
+    
+    chr(220) => 927,
+    chr(221) => 928,
+    chr(222) => 928,
+    chr(223) => 834,
+    chr(224) => 873,
+    chr(225) => 828,
+    chr(226) => 924,
+    chr(227) => 924,
+    chr(228) => 917,
+    chr(229) => 930,
+    chr(230) => 931,
+    chr(231) => 463,
+    chr(232) => 883,
+    chr(233) => 836,
+    chr(234) => 836,
+    chr(235) => 867,
+    chr(236) => 867,
+    chr(237) => 696,
+    chr(238) => 696,
+    chr(239) => 874,
+    chr(240) => 0,
+    chr(241) => 874,
+    
+    chr(242) => 760,
+    chr(243) => 946,
+    chr(244) => 771,
+    chr(245) => 865,
+    chr(246) => 771,
+    chr(247) => 888,
+    chr(248) => 967,
+    chr(249) => 888,
+    chr(250) => 831,
+    chr(251) => 873,
+    chr(252) => 927,
+    chr(253) => 970,
+    chr(254) => 918,
+    chr(255) => 0);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/File/PDF.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/File/PDF.php	2007-03-14 20:59:21.000000000 +0100
@@ -7,13 +7,13 @@
  *
  * Based on the FPDF class by Olivier Plathey (http://www.fpdf.org).
  *
- * Copyright 2003-2006 Olivier Plathey <olivier@fpdf.org>
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Olivier Plathey <olivier@fpdf.org>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did not
  * receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  *
- * $Horde: framework/File_PDF/PDF.php,v 1.18.10.12 2006/01/01 21:28:15 jan Exp $
+ * $Horde: framework/File_PDF/PDF.php,v 1.18.10.17 2007/01/02 13:54:16 jan Exp $
  *
  * @author  Olivier Plathey <olivier@fpdf.org>
  * @author  Marko Djukic <marko@oblo.com>
@@ -455,7 +455,8 @@
     {
         /* Check for PHP locale-related bug. */
         if (1.1 == 1) {
-            return File_PDF::raiseError('Do not alter the locale before including the class file.');
+            $error = File_PDF::raiseError('Do not alter the locale before including the class file.');
+            return $error;
         }
 
         /* Default parameters. */
@@ -487,7 +488,8 @@
         } elseif ($params['unit'] == 'in') {
             $pdf->_scale = 72;
         } else {
-            return File_PDF::raiseError(sprintf('Incorrect units: %s', $params['unit']));
+            $error = File_PDF::raiseError(sprintf('Incorrect units: %s', $params['unit']));
+            return $error;
         }
         /* Page format. */
         if (is_string($params['format'])) {
@@ -503,7 +505,8 @@
             } elseif ($params['format'] == 'legal') {
                 $params['format'] = array(612, 1008);
             } else {
-                return File_PDF::raiseError(sprintf('Unknown page format: %s', $params['format']));
+                $error = File_PDF::raiseError(sprintf('Unknown page format: %s', $params['format']));
+                return $error;
             }
             $pdf->fwPt = $params['format'][0];
             $pdf->fhPt = $params['format'][1];
@@ -525,7 +528,8 @@
             $pdf->wPt = $pdf->fhPt;
             $pdf->hPt = $pdf->fwPt;
         } else {
-            return File_PDF::raiseError(sprintf('Incorrect orientation: %s', $params['orientation']));
+            $error = File_PDF::raiseError(sprintf('Incorrect orientation: %s', $params['orientation']));
+            return $error;
         }
         $pdf->_current_orientation = $pdf->_default_orientation;
         $pdf->w = $pdf->wPt / $pdf->_scale;
@@ -636,6 +640,30 @@
     }
 
     /**
+     * Returns the actual page width.
+     *
+     * @since File_PDF 0.2.0
+     *
+     * @return float  The page width.
+     */
+    function getPageWidth()
+    {
+    	return ($this->w - $this->_right_margin - $this->_left_margin);
+    }
+
+    /**
+     * Returns the actual page height.
+     *
+     * @since File_PDF 0.2.0
+     *
+     * @return float  The page height.
+     */
+    function getPageHeight()
+    {
+    	return ($this->h - $this->_top_margin - $this->_break_margin);
+    }
+
+    /**
      * Enables or disables the automatic page breaking mode. When enabling,
      * the second parameter is the distance from the bottom of the page that
      * defines the triggering limit. By default, the mode is on and the margin
@@ -831,8 +859,7 @@
         /* For good measure make sure this is called. */
         $this->_beginDoc();
 
-        /* Save style settings so that they are not overridden by
-         * header(). */
+        /* Save style settings so that they are not overridden by footer(). */
         $lw = $this->_line_width;
         $dc = $this->_draw_color;
         $fc = $this->_fill_color;
@@ -852,11 +879,12 @@
         $this->_line_width = $lw;
         $this->_out(sprintf('%.2f w', $lw * $this->_scale));
         /* Set font for the beginning of the page. */
+        $font_family = null;
         if ($this->_font_family) {
-            $this->setFont($this->_font_family, $style, $this->_font_size_pt);
             $font_family = $this->_font_family;
             $font_style = $this->_font_style . ($this->_underline ? 'U' : '');
             $font_size  = $this->_font_size_pt;
+            $this->setFont($font_family, $font_style, $font_size);
         }
         /* Set colors. */
         $this->_fill_color = $fc;
@@ -2021,6 +2049,9 @@
             } else {
                 return $this->raiseError(sprintf('Unsupported image file type: %s', $type));
             }
+            if (is_a($info, 'PEAR_Error')) {
+                return $info;
+            }
             set_magic_quotes_runtime($mqr);
             $info['i'] = count($this->_images) + 1;
             $this->_images[$file] = $info;
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Array.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Array.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Array.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Array.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,11 +2,11 @@
 /**
  * The Horde_Array:: class provides various methods for array manipulation.
  *
- * $Horde: framework/Util/Array.php,v 1.26.2.8 2006/01/01 21:28:41 jan Exp $
+ * $Horde: framework/Util/Array.php,v 1.26.2.9 2007/01/02 13:54:47 jan Exp $
  *
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/application.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/application.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/application.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/application.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,9 +8,9 @@
  *   'app'  The application which is providing authentication.</pre>
  *
  *
- * $Horde: framework/Auth/Auth/application.php,v 1.27.10.12 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/application.php,v 1.27.10.13 2007/01/02 13:54:06 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/auto.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/auto.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/auto.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/auto.php	2007-03-14 20:59:19.000000000 +0100
@@ -14,9 +14,9 @@
  *                  cookie.</pre>
  *
  *
- * $Horde: framework/Auth/Auth/auto.php,v 1.12.4.8 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/auto.php,v 1.12.4.9 2007/01/02 13:54:06 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/composite.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/composite.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/composite.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/composite.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,9 +8,9 @@
  *   None.</pre>
  *
  *
- * $Horde: framework/Auth/Auth/composite.php,v 1.26.10.10 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/composite.php,v 1.26.10.11 2007/01/02 13:54:06 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/customsql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/customsql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/customsql.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/customsql.php	2007-03-14 20:59:19.000000000 +0100
@@ -48,9 +48,9 @@
  *   'tty'       The TTY on which to connect to the database.</pre>
  *
  *
- * $Horde: framework/Auth/Auth/customsql.php,v 1.16.10.8 2005/11/30 00:03:39 jan Exp $
+ * $Horde: framework/Auth/Auth/customsql.php,v 1.16.10.9 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2002 Ronnie Garcia <ronnie@mk2.net>
+ * Copyright 2002-2007 Ronnie Garcia <ronnie@mk2.net>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/cyrsql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/cyrsql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/cyrsql.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/cyrsql.php	2007-03-14 20:59:19.000000000 +0100
@@ -121,10 +121,10 @@
  * );
  * </pre>
  *
- * $Horde: framework/Auth/Auth/cyrsql.php,v 1.33.10.14 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/cyrsql.php,v 1.33.10.16 2007/02/05 18:00:59 jan Exp $
  *
- * Copyright 2002-2006 Ilya <mail@krel.org>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Ilya <mail@krel.org>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -179,6 +179,80 @@
     }
 
     /**
+     * Find out if a set of login credentials are valid.
+     *
+     * @access private
+     *
+     * @param string $userId      The userId to check.
+     * @param array $credentials  The credentials to use.
+     *
+     * @return boolean  Whether or not the credentials are valid.
+     */
+    function _authenticate($userId, $credentials)
+    {
+        if (is_a(($result = $this->_connect()), 'PEAR_Error')) {
+            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+            $this->_setAuthError(AUTH_REASON_FAILED);
+            return false;
+        }
+
+        if (!empty($this->_params['domain_field']) &&
+            ($this->_params['domain_field'] != 'none')) {
+            /* Build the SQL query with domain. */
+            $query = sprintf('SELECT * FROM %s WHERE %s = ? AND %s = ?',
+                             $this->_params['table'],
+                             $this->_params['username_field'],
+                             $this->_params['domain_field']);
+            $values = explode('@', $userId);
+        } else {
+            /* Build the SQL query without domain. */
+            $query = sprintf('SELECT * FROM %s WHERE %s = ?',
+                             $this->_params['table'],
+                             $this->_params['username_field']);
+            $values = array($userId);
+        }
+
+        Horde::logMessage('SQL Query by Auth_cyrsql::_authenticate(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
+
+        $result = $this->_db->query($query, $values);
+        if (is_a($result, 'PEAR_Error')) {
+            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+            $this->_setAuthError(AUTH_REASON_FAILED);
+            return false;
+        }
+
+        $row = $result->fetchRow(DB_GETMODE_ASSOC);
+        if (is_array($row)) {
+            $result->free();
+        } else {
+            $this->_setAuthError(AUTH_REASON_BADLOGIN);
+            return false;
+        }
+
+        if (!$this->_comparePasswords($row[$this->_params['password_field']],
+                                      $credentials['password'])) {
+            $this->_setAuthError(AUTH_REASON_BADLOGIN);
+            return false;
+        }
+
+        $now = time();
+        if (!empty($this->_params['hard_expiration_field']) &&
+            !empty($row[$this->_params['hard_expiration_field']]) &&
+            ($now > $row[$this->_params['hard_expiration_field']])) {
+            $this->_setAuthError(AUTH_REASON_EXPIRED);
+            return false;
+        }
+
+        if (!empty($this->_params['soft_expiration_field']) &&
+            !empty($row[$this->_params['soft_expiration_field']]) &&
+            ($now > $row[$this->_params['soft_expiration_field']])) {
+            $this->_authCredentials['changeRequested'] = true;
+        }
+
+        return true;
+    }
+
+    /**
      * Add a set of authentication credentials.
      *
      * @param string $userId       The userId to add.
@@ -210,7 +284,7 @@
 
             $dbresult = $this->_db->query($query, $values);
             $query = 'INSERT INTO virtual (alias, dest, username, status) VALUES (?, ?, ?, 1)';
-            $values = array($userId, $name, $name);
+            $values = array($userId, $userId, $name);
 
             Horde::logMessage('SQL Query by Auth_cyrsql::addUser(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
 
@@ -220,24 +294,23 @@
             }
         } else {
             $dbresult = parent::addUser($userId, $credentials);
-            $name = $userId;
         }
         if (is_a($dbresult, 'PEAR_Error')) {
             return $dbresult;
         }
 
-        if (!is_a($result = $this->_admin->addMailbox($name), 'PEAR_Error')) {
+        if (!is_a($result = $this->_admin->addMailbox($userId), 'PEAR_Error')) {
             @array_walk($this->_params['folders'],
-                        array($this, '_createSubFolders'), $name);
+                        array($this, '_createSubFolders'), $userId);
         } else {
-            Horde::logMessage('IMAP mailbox creation for ' . $name . ' failed: ' . $result->getMessage(),
+            Horde::logMessage('IMAP mailbox creation for ' . $userId . ' failed: ' . $result->getMessage(),
                               __FILE__, __LINE__, PEAR_LOG_ERR);
             return PEAR::raiseError(sprintf(_("IMAP mailbox creation failed: %s"), $result->getMessage()));
         }
 
         if (isset($this->_params['quota']) && $this->_params['quota'] >= 0) {
             if (!@imap_set_quota($this->_imapStream,
-                                 'user' . $this->_separator . $name,
+                                 'user' . $this->_separator . $userId,
                                  $this->_params['quota'])) {
                 return PEAR::raiseError(sprintf(_("IMAP mailbox quota creation failed: %s"), imap_last_error()));
             }
@@ -271,7 +344,7 @@
 
             $dbresult = $this->_db->query($query, $values);
             $query = 'DELETE FROM virtual WHERE dest = ?';
-            $values = array($name);
+            $values = array($userId);
 
             Horde::logMessage('SQL Query by Auth_cyrsql::removeUser(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
 
@@ -281,7 +354,6 @@
             }
         } else {
             $dbresult = parent::removeUser($userId);
-            $name = $userId;
         }
 
         if (is_a($dbresult, 'PEAR_Error')) {
@@ -289,7 +361,7 @@
         }
 
         /* Delete IMAP mailbox. */
-        $imapresult = $this->_admin->removeMailbox($name);
+        $imapresult = $this->_admin->removeMailbox($userId);
 
         if (is_a($imapresult, 'PEAR_Error')) {
             return PEAR::raiseError(sprintf(_("IMAP mailbox deletion failed: %s"), $imapresult->getMessage()));
@@ -358,9 +430,11 @@
     {
         if (!empty($this->_params['domain_field']) &&
             ($this->_params['domain_field'] != 'none')) {
-            list($userName) = explode('@', $userName);
+            list($userName, $domain) = explode('@', $userName);
+            $this->_admin->addMailbox($userName . $this->_separator . $value . '@' . $domain);
+        } else {
+            $this->_admin->addMailbox($userName . $this->_separator . $value);
         }
-        $this->_admin->addMailbox($userName . $this->_separator . $value);
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/cyrus.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/cyrus.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/cyrus.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/cyrus.php	2007-03-14 20:59:19.000000000 +0100
@@ -51,10 +51,10 @@
  *       }
  *   }</pre>
  *
- * $Horde: framework/Auth/Auth/cyrus.php,v 1.15.10.14 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/cyrus.php,v 1.15.10.16 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2002-2006 Ilya <mail@krel.org>
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Ilya <mail@krel.org>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -174,7 +174,7 @@
 
         if (isset($this->_params['quota']) && $this->_params['quota'] >= 0) {
             if (!@imap_set_quota($this->_imapStream,
-                                 'user' . $this->_separator . $name,
+                                 'user' . $this->_params['separator'] . $name,
                                  $this->_params['quota'])) {
                 return PEAR::raiseError(sprintf(_("IMAP mailbox quota creation failed: %s"), imap_last_error()));
             }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ftp.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ftp.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ftp.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ftp.php	2007-03-14 20:59:19.000000000 +0100
@@ -10,10 +10,10 @@
  *               DEFAULT: 21</pre>
  *
  *
- * $Horde: framework/Auth/Auth/ftp.php,v 1.23.12.8 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/ftp.php,v 1.23.12.9 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Max Kalika <max@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Max Kalika <max@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/http.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/http.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/http.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/http.php	2007-03-14 20:59:19.000000000 +0100
@@ -9,9 +9,9 @@
  * you want to directly authenticate users with this driver, instead
  * of relying on transparent auth.
  *
- * $Horde: framework/Auth/Auth/http.php,v 1.21.10.9 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/http.php,v 1.21.10.10 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/imap.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/imap.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/imap.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/imap.php	2007-03-14 20:59:19.000000000 +0100
@@ -32,11 +32,11 @@
  *   $conf['auth']['params']['protocol'] = 'imap/notls/novalidate-cert';</pre>
  *
  *
- * $Horde: framework/Auth/Auth/imap.php,v 1.28.10.9 2006/05/31 19:39:48 slusarz Exp $
+ * $Horde: framework/Auth/Auth/imap.php,v 1.28.10.10 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Gaudenz Steinlin <gaudenz.steinlin@id.unibe.ch>
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Gaudenz Steinlin <gaudenz.steinlin@id.unibe.ch>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/imsp.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/imsp.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/imsp.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/imsp.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * This will be most benificial if already using an IMSP based preference
  * system or IMSP based addressbook system
  *
- * $Horde: framework/Auth/Auth/imsp.php,v 1.2.10.10 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/imsp.php,v 1.2.10.11 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2004-2006 Michael Rubinsky <mrubinsk@horde.org>
+ * Copyright 2004-2007 Michael Rubinsky <mrubinsk@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ipbasic.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ipbasic.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ipbasic.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ipbasic.php	2007-03-14 20:59:19.000000000 +0100
@@ -11,9 +11,9 @@
  * Parameters:
  *   'blocks'     An array of CIDR masks which are allowed access.
  *
- * $Horde: framework/Auth/Auth/ipbasic.php,v 1.20.10.7 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/ipbasic.php,v 1.20.10.8 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ipmap.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ipmap.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ipmap.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ipmap.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,9 +8,9 @@
  * Parameters:
  *   NONE
  *
- * $Horde: framework/Auth/Auth/ipmap.php,v 1.14.10.6 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/ipmap.php,v 1.14.10.7 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/kolab.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/kolab.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/kolab.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/kolab.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,9 +8,9 @@
  * Auth_imap IMAP authentication object, and simply provides parameters to it
  * based on the global Kolab configuration.
  *
- * $Horde: framework/Auth/Auth/kolab.php,v 1.1.10.8 2006/03/03 23:00:28 chuck Exp $
+ * $Horde: framework/Auth/Auth/kolab.php,v 1.1.10.9 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2004-2006 Stuart Binge <s.binge@codefusion.co.za>
+ * Copyright 2004-2007 Stuart Binge <s.binge@codefusion.co.za>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/krb5.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/krb5.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/krb5.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/krb5.php	2007-03-14 20:59:19.000000000 +0100
@@ -14,9 +14,9 @@
  *   /etc/krb5.conf) for this class to work correctly.
  *
  *
- * $Horde: framework/Auth/Auth/krb5.php,v 1.21.10.8 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/krb5.php,v 1.21.10.9 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ldap.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ldap.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/ldap.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/ldap.php	2007-03-14 20:59:19.000000000 +0100
@@ -19,9 +19,9 @@
  *                  DEFAULT: NONE (system default will be used)</pre>
  *
  *
- * $Horde: framework/Auth/Auth/ldap.php,v 1.47.10.19 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/ldap.php,v 1.47.10.21 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -299,7 +299,7 @@
     function addUser($userId, $credentials)
     {
         if ($this->_params['ad']) {
-           return PEAR::raiseError(_("Auth_ldap: Adding users is not supported for Active Directory"), __FILE__, __LINE__);
+           return PEAR::raiseError(_("Auth_ldap: Adding users is not supported for Active Directory"));
         }
 
         /* Connect to the LDAP server. */
@@ -354,7 +354,7 @@
     function removeUser($userId)
     {
         if ($this->_params['ad']) {
-           return PEAR::raiseError(_("Auth_ldap: Removing users is not supported for Active Directory"), __FILE__, __LINE__);
+           return PEAR::raiseError(_("Auth_ldap: Removing users is not supported for Active Directory"));
         }
 
         /* Connect to the LDAP server. */
@@ -382,7 +382,7 @@
 
         $success = @ldap_delete($this->_ds,$dn);
         if (!$success) {
-           return PEAR::raiseError(sprintf(_("Auth_ldap: Unable to remove user %s"), $userId), __FILE__, __LINE__);
+           return PEAR::raiseError(sprintf(_("Auth_ldap: Unable to remove user %s"), $userId));
         }
 
         @ldap_close($this->_ds);
@@ -402,13 +402,13 @@
     function updateUser($oldID, $newID, $credentials)
     {
         if ($this->_params['ad']) {
-           return PEAR::raiseError(_("Auth_ldap: Updating users is not supported for Active Directory."), __FILE__, __LINE__);
+           return PEAR::raiseError(_("Auth_ldap: Updating users is not supported for Active Directory."));
         }
 
         /* Connect to the LDAP server. */
         $success = $this->_connect();
         if (is_a($success, 'PEAR_Error')) {
-            return PEAR::raiseError($success->getMessage(), __FILE__, __LINE__);
+            return PEAR::raiseError($success->getMessage());
         }
 
         global $conf;
@@ -426,7 +426,7 @@
             $dn = $this->_findDN($oldID);
 
             if (is_a($dn, 'PEAR_Error')) {
-                return PEAR::raiseError($success->getMessage(), __FILE__, __LINE__);
+                return PEAR::raiseError($success->getMessage());
             } else {
                 $olddn = $dn;
                 $newdn = preg_replace('/uid=.*?,/','uid='.$newID.',',$dn,1);
@@ -496,7 +496,7 @@
         }
 
         if (!$success) {
-            return PEAR::raiseError(sprintf(_("Auth_ldap: Unable to update user %s"), $newID), __FILE__, __LINE__);
+            return PEAR::raiseError(sprintf(_("Auth_ldap: Unable to update user %s"), $newID));
         }
 
         @ldap_close($this->_ds);
@@ -514,7 +514,7 @@
         /* Connect to the LDAP server. */
         $success = $this->_connect();
         if (is_a($success, 'PEAR_Error')) {
-            return PEAR::raiseError($success->getMessage(), __FILE__, __LINE__);
+            return PEAR::raiseError($success->getMessage());
         }
 
         if (!empty($this->_params['filter'])) {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/login.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/login.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/login.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/login.php	2007-03-14 20:59:19.000000000 +0100
@@ -10,9 +10,9 @@
  *               DEFAULT: /bin/su</pre>
  *
  *
- * $Horde: framework/Auth/Auth/login.php,v 1.3.10.9 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/login.php,v 1.3.10.10 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/mcal.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/mcal.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/mcal.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/mcal.php	2007-03-14 20:59:19.000000000 +0100
@@ -9,9 +9,9 @@
  *   'calendar'  The MCAL calendar name.</pre>
  *
  *
- * $Horde: framework/Auth/Auth/mcal.php,v 1.27.10.9 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/mcal.php,v 1.27.10.10 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/pam.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/pam.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/pam.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/pam.php	2007-03-14 20:59:19.000000000 +0100
@@ -16,9 +16,9 @@
  *              DEFAULT: php</pre>
  *
  *
- * $Horde: framework/Auth/Auth/pam.php,v 1.3.10.11 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/pam.php,v 1.3.10.12 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2004-2006 Jon Parise <jon@horde.org>
+ * Copyright 2004-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/passwd.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/passwd.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/passwd.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/passwd.php	2007-03-14 20:59:19.000000000 +0100
@@ -10,10 +10,10 @@
  *               DEFAULT: false</pre>
  *
  *
- * $Horde: framework/Auth/Auth/passwd.php,v 1.16.10.11 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/passwd.php,v 1.16.10.12 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1997-2006 Rasmus Lerdorf <rasmus@php.net>
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1997-2007 Rasmus Lerdorf <rasmus@php.net>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/peclsasl.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/peclsasl.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/peclsasl.php	1970-01-01 01:00:00.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/peclsasl.php	2007-03-14 20:59:19.000000000 +0100
@@ -0,0 +1,101 @@
+<?php
+/**
+ * The Auth_peclsasl:: class provides a SASL-based implementation of the Horde
+ * authentication system.
+ *
+ * SASL is the Simple Authentication and Security Layer (as defined by RFC
+ * 2222). It provides a system for adding plugable authenticating support to
+ * connection-based protocols.
+ *
+ * This driver relies on the PECL sasl package:
+ *
+ *      http://pecl.php.net/package/sasl
+ *
+ * Optional parameters:<pre>
+ *   'app'      The name of the authenticating application.
+ *              DEFAULT: horde
+ *   'service'  The name of the SASL service to use when authenticating.
+ *              DEFAULT: php</pre>
+ *
+ *
+ * $Horde: framework/Auth/Auth/peclsasl.php,v 1.1.2.2 2007/01/02 13:54:07 jan Exp $
+ *
+ * Copyright 2004-2007 Jon Parise <jon@horde.org>
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author  Jan Parise <jon@horde.org>
+ * @since   Horde 3.0
+ * @package Horde_Auth
+ */
+class Auth_peclsasl extends Auth {
+
+    /**
+     * An array of capabilities, so that the driver can report which
+     * operations it supports and which it doesn't.
+     *
+     * @var array
+     */
+    var $capabilities = array('add'           => false,
+                              'update'        => false,
+                              'resetpassword' => false,
+                              'remove'        => false,
+                              'list'          => false,
+                              'transparent'   => false);
+
+    /**
+     * Constructs a new SASL authentication object.
+     *
+     * @param array $params  A hash containing connection parameters.
+     */
+    function Auth_peclsasl($params = array())
+    {
+        $this->_params = $params;
+
+        if (!extension_loaded('sasl')) {
+            dl('sasl.so');
+        }
+
+        $app = (!empty($params['app'])) ? $params['app'] : 'horde';
+        sasl_server_init($app);
+    }
+
+    /**
+     * Find out if a set of login credentials are valid.
+     *
+     * @access private
+     *
+     * @param string $userId      The userId to check.
+     * @param array $credentials  An array of login credentials.
+     *
+     * @return boolean  Whether or not the credentials are valid.
+     */
+    function _authenticate($userId, $credentials)
+    {
+        if (empty($credentials['password'])) {
+            $this->_setAuthError(AUTH_REASON_BADLOGIN);
+            return false;
+        }
+
+        if (!extension_loaded('sasl')) {
+            $this->_setAuthError(AUTH_REASON_MESSAGE, _("SASL authentication is not available."));
+            return false;
+        }
+
+        $service = (!empty($params['service'])) ? $params['service'] : 'php';
+        $conn = sasl_server_new($service);
+        if (!is_resource($conn)) {
+            $this->_setAuthError(AUTH_REASON_MESSAGE, _("Failed to create new SASL connection."));
+            return false;
+        }
+
+        if (!sasl_checkpass($conn, $userId, $credentials['password'])) {
+            $this->_setAuthError(AUTH_REASON_MESSAGE, sasl_errdetail($conn));
+            return false;
+        }
+
+        return true;
+    }
+
+}
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/radius.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/radius.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/radius.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/radius.php	2007-03-14 20:59:19.000000000 +0100
@@ -40,9 +40,9 @@
  *              DEFAULT: 3 seconds</pre>
  *
  *
- * $Horde: framework/Auth/Auth/radius.php,v 1.24.8.8 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/radius.php,v 1.24.8.9 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/sasl.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/sasl.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/sasl.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/sasl.php	1970-01-01 01:00:00.000000000 +0100
@@ -1,98 +0,0 @@
-<?php
-/**
- * The Auth_sasl:: class provides a SASL-based implementation of the Horde
- * authentication system.
- *
- * SASL is the Simple Authentication and Security Layer (as defined by RFC
- * 2222). It provides a system for adding plugable authenticating support to
- * connection-based protocols.
- *
- * This driver relies on the PECL sasl package:
- *
- *      http://pecl.php.net/package/sasl
- *
- * Optional parameters:<pre>
- *   'app'      The name of the authenticating application.
- *              DEFAULT: horde
- *   'service'  The name of the SASL service to use when authenticating.
- *              DEFAULT: php</pre>
- *
- *
- * $Horde: framework/Auth/Auth/sasl.php,v 1.4.10.9 2006/01/01 21:28:07 jan Exp $
- *
- * Copyright 2004-2006 Jon Parise <jon@horde.org>
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author  Jan Parise <jon@horde.org>
- * @since   Horde 3.0
- * @package Horde_Auth
- */
-class Auth_sasl extends Auth {
-
-    /**
-     * An array of capabilities, so that the driver can report which
-     * operations it supports and which it doesn't.
-     *
-     * @var array
-     */
-    var $capabilities = array('add'           => false,
-                              'update'        => false,
-                              'resetpassword' => false,
-                              'remove'        => false,
-                              'list'          => false,
-                              'transparent'   => false);
-
-    /**
-     * Constructs a new SASL authentication object.
-     *
-     * @param array $params  A hash containing connection parameters.
-     */
-    function Auth_sasl($params = array())
-    {
-        $this->_params = $params;
-
-        if (!extension_loaded('sasl')) {
-            dl('sasl.so');
-        }
-
-        $app = (!empty($params['app'])) ? $params['app'] : 'horde';
-        sasl_server_init($app);
-    }
-
-    /**
-     * Find out if a set of login credentials are valid.
-     *
-     * @access private
-     *
-     * @param string $userId      The userId to check.
-     * @param array $credentials  An array of login credentials.
-     *
-     * @return boolean  Whether or not the credentials are valid.
-     */
-    function _authenticate($userId, $credentials)
-    {
-        if (empty($credentials['password'])) {
-            Horde::fatal(_("No password provided for Login authentication."), __FILE__, __LINE__);
-        }
-
-        if (!extension_loaded('sasl')) {
-            Horde::fatal(_("SASL authentication is not available."), __FILE__, __LINE__);
-        }
-
-        $service = (!empty($params['service'])) ? $params['service'] : 'php';
-        $conn = sasl_server_new($service);
-        if (!is_resource($conn)) {
-            Horde::fatal(_("Failed to create new SASL connection."), __FILE__, __LINE__);
-        }
-
-        if (!sasl_checkpass($conn, $userId, $credentials['password'])) {
-            $this->_setAuthError(AUTH_REASON_MESSAGE, sasl_errdetail($conn));
-            return false;
-        }
-
-        return true;
-    }
-
-}
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/Signup.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/Signup.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/Signup.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/Signup.php	2007-03-14 20:59:19.000000000 +0100
@@ -9,9 +9,9 @@
  * new users sign themselves up into the horde installation, depending
  * on how the admin has configured Horde.
  *
- * $Horde: framework/Auth/Auth/Signup.php,v 1.38.2.11 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/Signup.php,v 1.38.2.13 2007/01/02 13:54:06 jan Exp $
  *
- * Copyright 2002-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2002-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -43,26 +43,6 @@
     }
 
     /**
-     * Attempts to return a reference to a concrete Auth_Signup
-     * instance. It will only create a new instance if no Auth_Signup
-     * instance currently exists.
-     *
-     * This method must be invoked as: $var = &Auth_Signup::singleton()
-     *
-     * @return Auth_Signup  The concrete Auth_Signup reference, or false on error.
-     */
-    function &singleton()
-    {
-        static $signup;
-
-        if (!isset($signup)) {
-            $signup = new Auth_Signup();
-        }
-
-        return $signup;
-    }
-
-    /**
      * Adds a new user to the system and handles any extra fields that may have
      * been compiled, relying on the hooks.php file.
      *
@@ -250,7 +230,7 @@
 /**
  * Horde Signup Form, extending of Horde_Form::
  *
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (GPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
@@ -272,12 +252,16 @@
         $this->setButtons(_("Sign up"), true);
 
         $this->addHidden('', 'url', 'text', false);
-        $this->addVariable(_("Choose a username"), 'user_name', 'text', true);
-        $this->addVariable(_("Choose a password"), 'password', 'passwordconfirm', true, false, _("type the password twice to confirm"));
 
         /* Use hooks get any extra fields required in signing up. */
         $extra = Horde::callHook('_horde_hook_signup_getextra');
         if (!is_a($extra, 'PEAR_Error') && !empty($extra)) {
+            if (!isset($extra['user_name'])) {
+                $this->addVariable(_("Choose a username"), 'user_name', 'text', true);
+            }
+            if (!isset($extra['password'])) {
+                $this->addVariable(_("Choose a password"), 'password', 'passwordconfirm', true, false, _("type the password twice to confirm"));
+            }
             foreach ($extra as $field_name => $field) {
                 $readonly = isset($field['readonly']) ? $field['readonly'] : null;
                 $desc = isset($field['desc']) ? $field['desc'] : null;
@@ -288,6 +272,9 @@
                                    $field['type'], $required, $readonly,
                                    $desc, $field_params);
             }
+        } else {
+            $this->addVariable(_("Choose a username"), 'user_name', 'text', true);
+            $this->addVariable(_("Choose a password"), 'password', 'passwordconfirm', true, false, _("type the password twice to confirm"));
         }
     }
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/smbclient.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/smbclient.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/smbclient.php	1970-01-01 01:00:00.000000000 +0100
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/smbclient.php	2007-03-14 20:59:19.000000000 +0100
@@ -0,0 +1,103 @@
+<?php
+/**
+ * The Auth_smbclient class provides an smbclient implementation of
+ * the Horde authentication system.
+ *
+ * Required parameters:<pre>
+ *   'hostspec'        IP, DNS Name, or NetBios Name of the SMB server to
+ *                     authenticate with.
+ *   'domain'          The domain name to authenticate with.</pre>
+ *   'smbclient_path'  The location of the smbclient(1) utility.
+ *
+ * Optional parameters:<pre>
+ *   'group'     Group name that the user must be a member of. Will be
+ *               ignored if the value passed is a zero length string.</pre>
+ *
+ *
+ * $Horde: framework/Auth/Auth/smbclient.php,v 1.1.2.2 2007/01/02 13:54:07 jan Exp $
+ *
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
+ * Copyright 2002-2007 Marcus I. Ryan <marcus@riboflavin.net>
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author  Jon Parise <jon@horde.org>
+ * @author  Marcus I. Ryan <marcus@riboflavin.net>
+ * @since   Horde 3.1.4
+ * @package Horde_Auth
+ */
+class Auth_smbclient extends Auth {
+
+    /**
+     * An array of capabilities, so that the driver can report which
+     * operations it supports and which it doesn't.
+     *
+     * @var array
+     */
+    var $capabilities = array('add'           => false,
+                              'update'        => false,
+                              'resetpassword' => false,
+                              'remove'        => false,
+                              'list'          => false,
+                              'transparent'   => false);
+
+    /**
+     * Constructs a new SMB authentication object.
+     *
+     * @param array $params  A hash containing connection parameters.
+     */
+    function Auth_smbclient($params = array())
+    {
+        /* Ensure we've been provided with all of the necessary parameters. */
+        Horde::assertDriverConfig($params, 'auth',
+            array('hostspec', 'domain', 'smbclient_path'),
+            'authentication smbclient');
+
+        $this->_params = $params;
+    }
+
+    /**
+     * Find out if the given set of login credentials are valid.
+     *
+     * @access private
+     *
+     * @param string $userId      The userId to check.
+     * @param array $credentials  An array of login credentials.
+     *
+     * @return boolean  True on success or a PEAR_Error object on failure.
+     */
+    function _authenticate($userId, $credentials)
+    {
+        if (empty($credentials['password'])) {
+            $this->_setAuthError(AUTH_REASON_BADLOGIN);
+            return false;
+        }
+
+        /* Authenticate. */
+        $cmdline = implode(' ', array($this->_params['smbclient_path'],
+                                      '-L',
+                                      $this->_params['hostspec'],
+                                      '-W',
+                                      $this->_params['domain'],
+                                      '-U',
+                                      $userId));
+
+        $sc = popen($cmdline, 'w');
+        if ($sc === false) {
+            $this->_setAuthError(AUTH_REASON_MESSAGE,
+                                 _("Unable to execute smbclient."));
+            return false;
+        }
+
+        fwrite($sc, $credentials['password']);
+        $rc = pclose($sc);
+        if ((int)($rc & 0xff) == 0) {
+            return true;
+        }
+
+        $this->_setAuthError(AUTH_REASON_BADLOGIN);
+        return false;
+    }
+
+}
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/smb.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/smb.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/smb.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/smb.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,7 +4,7 @@
  * authentication system.
  *
  * This module requires the smbauth extension for PHP:
- *   http://www.tekrat.com/smbauth/
+ *   http://tekrat.com/wp/smbauth/
  *
  * At the time of this writing, the extension, and thus this module, only
  * supported authentication against a domain, and pdc and bdc must be non-null
@@ -21,10 +21,10 @@
  *               ignored if the value passed is a zero length string.</pre>
  *
  *
- * $Horde: framework/Auth/Auth/smb.php,v 1.20.10.8 2006/01/01 21:28:07 jan Exp $
+ * $Horde: framework/Auth/Auth/smb.php,v 1.20.10.10 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
- * Copyright 2002-2006 Marcus I. Ryan <marcus@riboflavin.net>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
+ * Copyright 2002-2007 Marcus I. Ryan <marcus@riboflavin.net>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/sql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/sql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/sql.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/sql.php	2007-03-14 20:59:19.000000000 +0100
@@ -42,9 +42,9 @@
  * The table structure for the Auth system is in
  * scripts/sql/horde_users.sql.
  *
- * $Horde: framework/Auth/Auth/sql.php,v 1.69.10.19 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth/sql.php,v 1.69.10.20 2007/01/02 13:54:07 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/yahoo.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/yahoo.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth/yahoo.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth/yahoo.php	1970-01-01 01:00:00.000000000 +0100
@@ -1,86 +0,0 @@
-<?php
-/**
- * The Auth_yahoo:: class checks login credentials against Yahoo! mail
- * accounts.
- *
- * $Horde: framework/Auth/Auth/yahoo.php,v 1.13.12.7 2006/01/01 21:28:07 jan Exp $
- *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see yahoo://www.fsf.org/copyleft/lgpl.html.
- *
- * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Horde 3.0
- * @package Horde_Auth
- */
-class Auth_yahoo extends Auth {
-
-    /**
-     * @var HTTP_Request
-     */
-    var $_http;
-
-    /**
-     * Constructs a new Yahoo authentication object.
-     *
-     * @param array $params  A hash containing parameters.
-     */
-    function Auth_yahoo($params = array())
-    {
-        $this->_params = $params;
-    }
-
-    /**
-     * Find out if a set of login credentials are valid.
-     *
-     * @access private
-     *
-     * @param string $userId       The userId to check.
-     * @param array  $credentials  The credentials to use.
-     *
-     * @return boolean  Whether or not the credentials are valid.
-     */
-    function _authenticate($userId, $credentials)
-    {
-        require_once 'HTTP/Request.php';
-
-        // Make sure that we have a bare username - strip off anything
-        // after (and including) the first @, if there is one.
-        $pos = strpos($userId, '@');
-        if ($pos !== false) {
-            $userId = substr($userId, 0, $pos);
-        }
-
-        $options['method'] = HTTP_REQUEST_METHOD_POST;
-        $options['timeout'] = 5;
-        $options['allowRedirects'] = true;
-
-        $this->_http = &new HTTP_Request('http://login.yahoo.com/config/login', $options);
-        $this->_http->addPostData('login', $userId);
-        $this->_http->addPostData('passwd', $credentials['password']);
-
-        $result = $this->_http->sendRequest();
-        if (is_a($result, 'PEAR_Error')) {
-            $result = $result->getMessage();
-        } else {
-            $result = $this->_http->getResponseBody();
-            $cookies = $this->_http->getResponseCookies();
-            if (is_array($cookies)) {
-                foreach ($cookies as $cookie) {
-                    $this->_http->addCookie($cookie['name'], $cookie['value']);
-                }
-            }
-        }
-
-        // This is _such_ a hack, but it works.
-        if (!preg_match('|invalid password|i', $result)) {
-            return true;
-        } else {
-            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-            $this->_setAuthError(AUTH_REASON_BADLOGIN);
-            return false;
-        }
-    }
-
-}
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Auth.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Auth.php	2007-03-14 20:59:19.000000000 +0100
@@ -65,9 +65,9 @@
  * The Auth:: class provides a common abstracted interface into the various
  * backends for the Horde authentication system.
  *
- * $Horde: framework/Auth/Auth.php,v 1.142.10.23 2006/08/14 02:48:48 chuck Exp $
+ * $Horde: framework/Auth/Auth.php,v 1.142.10.25 2007/01/02 13:54:06 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -338,14 +338,14 @@
 
         case 'ssha':
             if ($seed) {
-                return substr(preg_replace('|^{SSHA}|', '', $seed), -20);
+                return substr(base64_decode(preg_replace('|^{SSHA}|i', '', $seed)), 20);
             } else {
                 return mhash_keygen_s2k(MHASH_SHA1, $plaintext, substr(pack('h*', md5(mt_rand())), 0, 8), 4);
             }
 
         case 'smd5':
             if ($seed) {
-                return substr(preg_replace('|^{SMD5}|', '', $seed), -16);
+                return substr(base64_decode(preg_replace('|^{SMD5}|i', '', $seed)), 16);
             } else {
                 return mhash_keygen_s2k(MHASH_MD5, $plaintext, substr(pack('h*', md5(mt_rand())), 0, 8), 4);
             }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/Collection.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/Collection.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/Collection.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/Collection.php	2007-03-14 20:59:21.000000000 +0100
@@ -6,10 +6,10 @@
  * The Horde_Block_Collection:: class provides an API to the blocks
  * (applets) framework.
  *
- * $Horde: framework/Block/Block/Collection.php,v 1.36.4.17 2006/03/08 17:53:52 chuck Exp $
+ * $Horde: framework/Block/Block/Collection.php,v 1.36.4.18 2007/01/02 13:54:08 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/Layout/Manager.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/Layout/Manager.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/Layout/Manager.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/Layout/Manager.php	2007-03-14 20:59:21.000000000 +0100
@@ -6,10 +6,10 @@
  * The Horde_Block_Layout_Manager class allows manipulation of
  * Horde_Block layouts.
  *
- * $Horde: framework/Block/Block/Layout/Manager.php,v 1.4.2.3 2006/03/08 17:54:08 chuck Exp $
+ * $Horde: framework/Block/Block/Layout/Manager.php,v 1.4.2.5 2007/02/07 19:46:12 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -1007,11 +1007,11 @@
                     continue;
                 }
                 if (empty($moved[$block[1] . ':' . $block[0]])) {
-                    $moved[$block[1] . ':' . $block[0]] = true;
                     $result = $this->moveDown($block[0], $block[1]);
                     if (is_a($result, 'PEAR_Error')) {
                         return false;
                     }
+                    $moved[$block[1] . ':' . ($block[0] + 1)] = true;
                 }
             }
         }
@@ -1155,11 +1155,11 @@
                     continue;
                 }
                 if (empty($moved[$block[1] . ':' . $block[0]])) {
-                    $moved[$block[1] . ':' . $block[0]] = true;
                     $result = $this->moveRight($block[0], $block[1]);
                     if (is_a($result, 'PEAR_Error')) {
                         return false;
                     }
+                    $moved[($block[1] + 1) . ':' . $block[0]] = true;
                 }
             }
         }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/Layout/View.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/Layout/View.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/Layout/View.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/Layout/View.php	2007-03-14 20:59:21.000000000 +0100
@@ -6,10 +6,10 @@
 /**
  * The Horde_Block_Layout_View class represents the user defined portal layout.
  *
- * $Horde: framework/Block/Block/Layout/View.php,v 1.4.2.3 2006/06/23 04:35:21 chuck Exp $
+ * $Horde: framework/Block/Block/Layout/View.php,v 1.4.2.4 2007/01/02 13:54:08 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/UI.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/UI.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block/UI.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block/UI.php	2007-03-14 20:59:21.000000000 +0100
@@ -2,12 +2,12 @@
 /**
  * Class for setting up Horde Blocks using the Horde_Form:: classes.
  *
- * Copyright 2004-2006 Marko Djukic <marko@oblo.com>
+ * Copyright 2004-2007 Marko Djukic <marko@oblo.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  *
- * $Horde: framework/Block/Block/UI.php,v 1.8.10.5 2006/01/02 17:46:35 jan Exp $
+ * $Horde: framework/Block/Block/UI.php,v 1.8.10.6 2007/01/02 13:54:08 jan Exp $
  *
  * @author  Marko Djukic <marko@oblo.com>
  * @since   Horde 3.0
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Block.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Block.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,10 +3,10 @@
  * The abstract Horde_Block:: class represents a single block within
  * the Blocks framework.
  *
- * $Horde: framework/Block/Block.php,v 1.33.10.5 2006/01/01 21:28:08 jan Exp $
+ * $Horde: framework/Block/Block.php,v 1.33.10.6 2007/01/02 13:54:08 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Browser/imode.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Browser/imode.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Browser/imode.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Browser/imode.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,10 +3,10 @@
  * The Browser_imode:: class extends the Browser API by providing
  * specific information about Imode handsets.
  *
- * $Horde: framework/Browser/Browser/imode.php,v 1.7.12.5 2006/01/01 21:28:09 jan Exp $
+ * $Horde: framework/Browser/Browser/imode.php,v 1.7.12.6 2007/01/02 13:54:09 jan Exp $
  *
- * Copyright 2000-2006 Mika Tuupola
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2000-2007 Mika Tuupola
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Browser.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Browser.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Browser.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Browser.php	2007-03-14 20:59:23.000000000 +0100
@@ -1,5 +1,6 @@
 <?php
 
+/** Horde_String */
 require_once 'Horde/String.php';
 
 /**
@@ -9,10 +10,10 @@
  * Browser identification is performed by examining the HTTP_USER_AGENT
  * environment variable provided by the web server.
  *
- * $Horde: framework/Browser/Browser.php,v 1.153.2.47 2006/07/17 09:52:00 jan Exp $
+ * $Horde: framework/Browser/Browser.php,v 1.153.2.52 2007/02/02 04:00:22 chuck Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -125,6 +126,7 @@
         'RufusBot',
         'Scooter',
         'Seekbot',
+        'sogou spider',
         'sproose',
         'Teoma',
         'TheSuBot',
@@ -132,6 +134,7 @@
         'Ultraseek',
         'ViolaBot',
         'voyager',
+        'W3C-checklink',
         'webbandit',
         'www.almaden.ibm.com/cs/crawler',
         'yacy',
@@ -289,10 +292,16 @@
                 $this->setQuirk('avoid_popup_windows');
                 $this->_mobile = true;
             } elseif (preg_match('|Opera[/ ]([0-9.]+)|', $this->_agent, $version)) {
-                      $this->setBrowser('opera');
-                      list($this->_majorVersion, $this->_minorVersion) = explode('.', $version[1]);
-                      $this->setFeature('javascript', true);
-                      $this->setQuirk('no_filename_spaces');
+                $this->setBrowser('opera');
+                list($this->_majorVersion, $this->_minorVersion) = explode('.', $version[1]);
+                $this->setFeature('javascript', true);
+                $this->setQuirk('no_filename_spaces');
+
+                /* Opera Mobile reports its screen resolution in the
+                 * user agent strings. */
+                if (preg_match('/; (120x160|240x280|240x320|320x320)\)/', $this->_agent)) {
+                    $this->_mobile = true;
+                }
 
                 if ($this->_majorVersion >= 7) {
                     $this->setFeature('dom');
@@ -1067,7 +1076,7 @@
             ($this->isBrowser('mozilla') && ($this->getMajor() >= 5)) ||
             $this->isBrowser('konqueror')) {
             $from = array('%23', '%26', '%2B');
-            $to = array(urlencode('%23'), urlencode('%26'), urlencode('%2B'));
+            $to = array('%2523', '%2526', '%252B');
         }
         $from[] = '%27';
         $to[] = '\%27';
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cache/file.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cache/file.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cache/file.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cache/file.php	2007-03-14 20:59:21.000000000 +0100
@@ -7,10 +7,10 @@
  *   'dir'     The directory to store the cache files in.
  *   'prefix'  The filename prefix to use for the cache files.</pre>
  *
- * $Horde: framework/Cache/Cache/file.php,v 1.28.10.9 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cache/Cache/file.php,v 1.28.10.14 2007/03/09 04:54:37 slusarz Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -74,10 +74,7 @@
             if (!$size) {
                 return '';
             }
-            $data = file_get_contents($filename);
-            if ($data !== false) {
-                return $data;
-            }
+            return file_get_contents($filename);
         }
 
         /* Nothing cached, return failure. */
@@ -88,7 +85,7 @@
      * Attempts to store data to the filesystem.
      *
      * @param string $key   Cache key.
-     * @param mixed  $data  Data to store in the cache.
+     * @param mixed  $data  Data to store in the cache. (MUST BE A STRING)
      *
      * @return boolean  True on success, false on failure.
      */
@@ -98,15 +95,22 @@
         $filename = $this->_keyToFile($key);
         $tmp_file = Util::getTempFile('HordeCache', true, $this->_dir);
 
-        if ($fd = fopen($tmp_file, 'w')) {
-            if (fwrite($fd, $data) < strlen($data)) {
-                fclose($fd);
+        if (function_exists('file_put_contents')) {
+            if (file_put_contents($tmp_file, $data) === false) {
                 return false;
-            } else {
-                fclose($fd);
-                @rename($tmp_file, $filename);
             }
+        } elseif ($fd = fopen($tmp_file, 'w')) {
+            $res = fwrite($fd, $data);
+            fclose($fd);
+            if ($res < strlen($data)) {
+                return false;
+            }
+        } else {
+            return false;
         }
+
+        @rename($tmp_file, $filename);
+        return true;
     }
 
     /**
@@ -115,21 +119,17 @@
      * @param string  $key       Cache key to output.
      * @param integer $lifetime  Lifetime of the data in seconds.
      *
-     * @return mixed  Cached data, or false if none was found.
+     * @return boolean  True if output or false if no object was found.
      */
     function output($key, $lifetime = 1)
     {
-        if ($this->exists($key, $lifetime)) {
-            $filename = $this->_keyToFile($key);
-            $fd = @fopen($filename, 'r');
-            if ($fd) {
-                fpassthru($fd);
-                return true;
-            }
+        $data = $this->get($key, $lifetime);
+        if ($data === false) {
+            return false;
+        } else {
+            echo $data;
+            return true;
         }
-
-        /* Nothing cached, return failure. */
-        return false;
     }
 
     /**
@@ -194,7 +194,7 @@
     /**
      * Do any garbage collection needed for the driver.
      *
-     * @private
+     * @access private
      *
      * @param integer $secs  The minimum amount of time (in seconds) required
      *                       before a cache item is removed.
@@ -222,9 +222,13 @@
         }
         $d->close();
  
-        $fp = fopen($filename, 'w');
-        fwrite($fp, time());
-        fclose($fp);
+        if (function_exists('file_put_contents')) {
+            file_put_contents($filename, time());
+        } else {
+            $fp = fopen($filename, 'w');
+            fwrite($fp, time());
+            fclose($fp);
+        }
     }
 
 }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cache/zps4.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cache/zps4.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cache/zps4.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cache/zps4.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,9 +3,9 @@
  * The Horde_Cache_zps4:: class provides a Zend Performance Suite
  * (version 4.0+) implementation of the Horde caching system.
  *
- * $Horde: framework/Cache/Cache/zps4.php,v 1.1.10.4 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cache/Cache/zps4.php,v 1.1.10.6 2007/03/08 23:20:54 slusarz Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -49,11 +49,11 @@
      * @param string  $key       Cache key to output.
      * @param integer $lifetime  Lifetime of the key in seconds.
      *
-     * @return mixed  Cached data, or false if none was found.
+     * @return boolean  True if output or false if no object was found.
      */
     function output($key, $lifetime = 1)
     {
-        echo $this->fetch($key, $lifetime);
+        echo $this->get($key, $lifetime);
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cache.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cache.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cache.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cache.php	2007-03-14 20:59:21.000000000 +0100
@@ -4,10 +4,10 @@
  * the various caching backends.  It also provides functions for
  * checking in, retrieving, and flushing a cache.
  *
- * $Horde: framework/Cache/Cache.php,v 1.31.10.11 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cache/Cache.php,v 1.31.10.14 2007/03/09 04:42:06 slusarz Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -73,7 +73,7 @@
      * @param string  $key       Object ID to query.
      * @param integer $lifetime  Lifetime of the object in seconds.
      *
-     * @return mixed  Cached data, or false if none was found.
+     * @return boolean  True if output or false if no object was found.
      */
     function output($key, $lifetime = 1)
     {
@@ -188,8 +188,7 @@
      * @param array $params  A hash containing any additional configuration or
      *                       connection parameters a subclass might need.
      *
-     * @return Horde_Cache  The concrete Horde_Cache reference, or false on
-     *                      error.
+     * @return Horde_Cache  The concrete Horde_Cache reference, or PEAR_Error.
      */
     function &singleton($driver, $params = array())
     {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/cbc.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/cbc.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/cbc.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/cbc.php	2007-03-14 20:59:20.000000000 +0100
@@ -4,9 +4,9 @@
  * Horde_Cipher_BlockMode using the Cipher Block Chaining method of
  * encrypting blocks of data.
  *
- * $Horde: framework/Cipher/Cipher/BlockMode/cbc.php,v 1.7.12.5 2006/01/01 21:28:11 jan Exp $
+ * $Horde: framework/Cipher/Cipher/BlockMode/cbc.php,v 1.7.12.6 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/cfb64.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/cfb64.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/cfb64.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/cfb64.php	2007-03-14 20:59:20.000000000 +0100
@@ -6,9 +6,9 @@
  * This can be used to encrypt any length string and the encrypted
  * version will be the same length.
  *
- * $Horde: framework/Cipher/Cipher/BlockMode/cfb64.php,v 1.7.12.5 2006/01/01 21:28:11 jan Exp $
+ * $Horde: framework/Cipher/Cipher/BlockMode/cfb64.php,v 1.7.12.6 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/ecb.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/ecb.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/ecb.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/ecb.php	2007-03-14 20:59:20.000000000 +0100
@@ -4,9 +4,9 @@
  * Horde_Cipher_BlockMode using the Electronic Code Book method of
  * encrypting blocks of data.
  *
- * $Horde: framework/Cipher/Cipher/BlockMode/ecb.php,v 1.7.12.5 2006/01/01 21:28:11 jan Exp $
+ * $Horde: framework/Cipher/Cipher/BlockMode/ecb.php,v 1.7.12.6 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/ofb64.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/ofb64.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode/ofb64.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode/ofb64.php	2007-03-14 20:59:20.000000000 +0100
@@ -6,9 +6,9 @@
  * This can used to encrypt any length string and the encrypted version
  * will be the same length.
  *
- * $Horde: framework/Cipher/Cipher/BlockMode/ofb64.php,v 1.7.12.5 2006/01/01 21:28:11 jan Exp $
+ * $Horde: framework/Cipher/Cipher/BlockMode/ofb64.php,v 1.7.12.6 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/BlockMode.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/BlockMode.php	2007-03-14 20:59:20.000000000 +0100
@@ -3,9 +3,9 @@
  * The Horde_Cipher_BlockMode:: class provides a common abstracted
  * interface to various block mode handlers for ciphers.
  *
- * $Horde: framework/Cipher/Cipher/BlockMode.php,v 1.14.12.9 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cipher/Cipher/BlockMode.php,v 1.14.12.10 2007/01/02 13:54:10 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/blowfish.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/blowfish.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/blowfish.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/blowfish.php	2007-03-14 20:59:20.000000000 +0100
@@ -3,9 +3,9 @@
  * The Cipher_blowfish:: class implements the Cipher interface encryption data
  * using the Blowfish algorithm.
  *
- * $Horde: framework/Cipher/Cipher/blowfish.php,v 1.14.12.9 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cipher/Cipher/blowfish.php,v 1.14.12.10 2007/01/02 13:54:10 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/cast128.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/cast128.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/cast128.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/cast128.php	2007-03-14 20:59:20.000000000 +0100
@@ -3,9 +3,9 @@
  * The Cipher_cast128:: class implements the Cipher interface encryption data
  * using the CAST128 (aka Cast5) algorithm as defined in RFC2144.
  *
- * $Horde: framework/Cipher/Cipher/cast128.php,v 1.7.12.8 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cipher/Cipher/cast128.php,v 1.7.12.9 2007/01/02 13:54:10 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/des.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/des.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/des.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/des.php	2007-03-14 20:59:20.000000000 +0100
@@ -3,9 +3,9 @@
  * The Cipher_des:: class implements the Cipher interface encryption data
  * using the Data Encryption Standard (DES) algorithm as define in FIPS46-3.
  *
- * $Horde: framework/Cipher/Cipher/des.php,v 1.4.12.7 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cipher/Cipher/des.php,v 1.4.12.8 2007/01/02 13:54:10 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/rc2.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/rc2.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/rc2.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/rc2.php	2007-03-14 20:59:20.000000000 +0100
@@ -7,9 +7,9 @@
  * http://www.mirrors.wiretapped.net/security/cryptography/
  *   algorithms/rc2/comments/gutman-960211
  *
- * $Horde: framework/Cipher/Cipher/rc2.php,v 1.9.12.7 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cipher/Cipher/rc2.php,v 1.9.12.8 2007/01/02 13:54:10 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/rc4.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/rc4.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher/rc4.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher/rc4.php	2007-03-14 20:59:20.000000000 +0100
@@ -4,9 +4,9 @@
  * using the RC4 encryption algorthim. This class uses the PEAR Crypt_RC4
  * class to do the encryption.
  *
- * $Horde: framework/Cipher/Cipher/rc4.php,v 1.4.12.7 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cipher/Cipher/rc4.php,v 1.4.12.8 2007/01/02 13:54:10 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Cipher.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Cipher.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,12 +3,12 @@
  * The Horde_Cipher:: class provides a common abstracted interface to
  * various Ciphers for encryption of arbitrary length pieces of data.
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  *
- * $Horde: framework/Cipher/Cipher.php,v 1.16.12.8 2006/01/01 21:28:10 jan Exp $
+ * $Horde: framework/Cipher/Cipher.php,v 1.16.12.9 2007/01/02 13:54:10 jan Exp $
  *
  * @author  Mike Cochrane <mike@graftonhall.co.nz>
  * @since   Horde 2.2
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/CLI.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/CLI.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/CLI.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/CLI.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,10 +2,10 @@
 /**
  * Horde_CLI:: API for basic command-line functionality/checks.
  *
- * $Horde: framework/CLI/CLI.php,v 1.42.6.13 2006/05/31 12:31:00 jan Exp $
+ * $Horde: framework/CLI/CLI.php,v 1.42.6.18 2007/01/14 15:20:54 jan Exp $
  *
- * Copyright 2003-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -83,6 +83,10 @@
     /**
      * Detect the current environment (web server or console) and sets
      * internal values accordingly.
+     *
+     * The constructor must not be called after init(). Either use the
+     * singleton() method to retrieve a Horde_CLI object, or don't call init()
+     * statically.
      */
     function Horde_CLI()
     {
@@ -284,6 +288,7 @@
                     $this->writeln(sprintf(_("\"%s\" is not a valid choice."), $response));
                 }
             } else {
+                @ob_flush();
                 $response = trim(fgets(STDIN));
                 if ($response === '' && $default !== null) {
                     $response = $default;
@@ -315,6 +320,10 @@
      * none. Also initialize a few variables in $_SERVER that aren't present
      * from the CLI.
      *
+     * You must not call init() statically before calling the constructor.
+     * Either use the singleton() method to retrieve a Horde_CLI object after
+     * calling init(), or don't call init() statically.
+     *
      * @static
      */
     function init()
@@ -356,7 +365,8 @@
         if ($sapi == 'cli') {
             return true;
         } else {
-            return $sapi == 'cgi' && empty($_SERVER['SERVER_NAME']);
+            return ($sapi == 'cgi' || $sapi == 'cgi-fcgi') &&
+                empty($_SERVER['SERVER_NAME']);
         }
     }
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/dbx.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/dbx.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/dbx.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/dbx.php	2007-03-14 20:59:23.000000000 +0100
@@ -7,9 +7,9 @@
  * Antony Raijekov <dev@strategma.bg>
  * http://uruds.gateway.bg/zeos/
  *
- * $Horde: framework/Compress/Compress/dbx.php,v 1.3.12.9 2006/01/01 21:28:11 jan Exp $
+ * $Horde: framework/Compress/Compress/dbx.php,v 1.3.12.10 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/gzip.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/gzip.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/gzip.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/gzip.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,10 +2,10 @@
 /**
  * The Horde_Compress_gzip class allows gzip files to be read.
  *
- * $Horde: framework/Compress/Compress/gzip.php,v 1.7.12.9 2006/04/30 22:28:29 chuck Exp $
+ * $Horde: framework/Compress/Compress/gzip.php,v 1.7.12.10 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Michael Cochrane <mike@graftonhall.co.nz>
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/tar.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/tar.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/tar.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/tar.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,10 +2,10 @@
 /**
  * The Horde_Compress_tar class allows tar files to be read.
  *
- * $Horde: framework/Compress/Compress/tar.php,v 1.4.12.9 2006/04/30 22:28:29 chuck Exp $
+ * $Horde: framework/Compress/Compress/tar.php,v 1.4.12.10 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Michael Cochrane <mike@graftonhall.co.nz>
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/tnef.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/tnef.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/tnef.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/tnef.php	2007-03-14 20:59:23.000000000 +0100
@@ -49,10 +49,10 @@
  * Original design by:
  *   Thomas Boll <tb@boll.ch>, Mark Simpson <damned@world.std.com>
  *
- * $Horde: framework/Compress/Compress/tnef.php,v 1.6.12.9 2006/01/01 21:28:11 jan Exp $
+ * $Horde: framework/Compress/Compress/tnef.php,v 1.6.12.10 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Jan Schneider <jan@horde.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/zip.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/zip.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress/zip.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress/zip.php	2007-03-14 20:59:23.000000000 +0100
@@ -14,7 +14,7 @@
  * The Horde_Compress_zip class allows ZIP files to be created and
  * read.
  *
- * $Horde: framework/Compress/Compress/zip.php,v 1.11.12.16 2006/06/29 08:34:30 jan Exp $
+ * $Horde: framework/Compress/Compress/zip.php,v 1.11.12.18 2007/01/02 13:54:11 jan Exp $
  *
  * The ZIP compression code is partially based on code from:
  *   Eric Mueller <eric@themepark.com>
@@ -26,9 +26,9 @@
  * The ZIP compression date code is partially based on code from
  *   Peter Listiak <mlady@users.sourceforge.net>
  *
- * Copyright 2000-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2002-2006 Michael Cochrane <mike@graftonhall.co.nz>
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2000-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Michael Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -343,12 +343,6 @@
         /* "File data" segment. */
         $fr .= $zdata;
 
-        /* "Data descriptor" segment (optional but necessary if archive is
-           not served as file). */
-        $fr .= pack('V', $crc);
-        $fr .= pack('V', $c_len);
-        $fr .= pack('V', $unc_len);
-
         /* Add this entry to array. */
         $old_offset = strlen(implode('', $contents));
         $contents[] = &$fr;
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Compress.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Compress.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,9 +3,9 @@
  * The Horde_Compress:: class provides an API for various compression
  * techniques that can be used by Horde applications.
  *
- * $Horde: framework/Compress/Compress.php,v 1.7.12.10 2006/01/01 21:28:11 jan Exp $
+ * $Horde: framework/Compress/Compress.php,v 1.7.12.11 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Config.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Config.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Config.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Config.php	2007-03-14 20:59:22.000000000 +0100
@@ -16,9 +16,9 @@
  *
  *   http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
  *
- * $Horde: framework/Horde/Horde/Config.php,v 1.80.2.26 2006/06/01 23:44:32 jan Exp $
+ * $Horde: framework/Horde/Horde/Config.php,v 1.80.2.30 2007/01/12 18:28:37 chuck Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -614,6 +614,7 @@
                 'tcp' => array(
                     'desc' => 'TCP/IP',
                     'fields' => array(
+                        'hostspec' => $hostspec,
                         'port' => $port))));
         $mysql_protocol = $protocol;
         $mysql_protocol['switch']['tcp']['fields']['port']['default'] = $this->_default($ctx . '|port', 3306);
@@ -740,7 +741,6 @@
                     'desc' => 'MySQL',
                     'fields' => array(
                         'persistent' => $persistent,
-                        'hostspec' => $hostspec,
                         'username' => $username,
                         'password' => $password,
                         'protocol' => $mysql_protocol,
@@ -749,12 +749,9 @@
                 'mysqli' => array(
                     'desc' => 'MySQL (mysqli)',
                     'fields' => array(
-                        'persistent' => $persistent,
-                        'hostspec' => $hostspec,
                         'username' => $username,
                         'password' => $password,
-                        'port' => $port,
-                        'socket' => $socket,
+                        'protocol' => $mysql_protocol,
                         'database' => $database,
                         'charset' => $charset)),
                 'oci8' => array(
@@ -969,7 +966,7 @@
     function _defaultRaw($ctx, $default)
     {
         $ctx = explode('|', $ctx);
-        $pattern = '/^\$conf\[\'' . implode("'\]\['", $ctx) . '\'\] = (.*);$/m';
+        $pattern = '/^\$conf\[\'' . implode("'\]\['", $ctx) . '\'\] = (.*);\r?$/m';
         if (preg_match($pattern, $this->getPHPConfig(), $matches)) {
             return $matches[1];
         }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Crypt/pgp.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Crypt/pgp.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Crypt/pgp.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Crypt/pgp.php	2007-03-14 20:59:22.000000000 +0100
@@ -65,9 +65,9 @@
  * This class has been developed with, and is only guaranteed to work with,
  * Version 1.21 or above of GnuPG.
  *
- * $Horde: framework/Crypt/Crypt/pgp.php,v 1.85.2.15 2006/07/20 09:02:38 jan Exp $
+ * $Horde: framework/Crypt/Crypt/pgp.php,v 1.85.2.18 2007/03/08 17:49:31 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -355,17 +355,23 @@
                         $data_array['signature'][$header]['sig_' . $sig_id]['fingerprint'] = $matches[1];
                         $data_array['fingerprint'] = $matches[1];
                     }
+                } elseif (strpos($lowerLine, ':literal data packet:') !== false) {
+                    $header = 'literal';
+                } elseif (strpos($lowerLine, ':encrypted data packet:') !== false) {
+                    $header = 'encrypted';
                 } else {
                     $header = null;
                 }
             } else {
-                if (($header == 'secret_key') || ($header == 'public_key')) {
+                if ($header == 'secret_key' || $header == 'public_key') {
                     if (preg_match("/created\s+(\d+),\s+expires\s+(\d+)/i", $line, $matches)) {
                         $data_array[$header]['created'] = $matches[1];
                         $data_array[$header]['expires'] = $matches[2];
                     } elseif (preg_match("/\s+[sp]key\[0\]:\s+\[(\d+)/i", $line, $matches)) {
                         $data_array[$header]['size'] = $matches[1];
                     }
+                } elseif ($header == 'literal' || $header == 'encrypted') {
+                    $data_array[$header] = true;
                 } elseif ($header) {
                     if (preg_match("/version\s+\d+,\s+created\s+(\d+)/i", $line, $matches)) {
                         $data_array['signature'][$header]['sig_' . $sig_id]['created'] = $matches[1];
@@ -1102,19 +1108,16 @@
         $good_sig_flag = false;
 
         /* Check for required parameters. */
-        if (!isset($params['pubkey']) ||
-            !isset($params['privkey']) ||
-            !isset($params['passphrase'])) {
+        if (empty($params['no_passphrase']) &&
+            (!isset($params['pubkey']) ||
+             !isset($params['privkey']) ||
+             !isset($params['passphrase']))) {
             return PEAR::raiseError(_("A public PGP key, private PGP key, and passphrase are required to decrypt a message."), 'horde.error');
         }
 
         /* Create temp files. */
         $input = $this->_createTempFile('horde-pgp');
 
-        /* Decryption requires both keyrings. */
-        $pub_keyring = $this->_putInKeyring(array($params['pubkey']));
-        $sec_keyring = $this->_putInKeyring(array($params['privkey']), 'private');
-
         /* Store message in file. */
         $fp = fopen($input, 'w+');
         fputs($fp, $text);
@@ -1124,14 +1127,25 @@
         $cmdline = array(
             '--always-trust',
             '--armor',
-            '--batch',
-            '--passphrase-fd 0',
-            $sec_keyring,
-            $pub_keyring,
-            '--decrypt',
-            $input
+            '--batch'
         );
-        $result = $this->_callGpg($cmdline, 'w', $params['passphrase'], true, true);
+        if (empty($params['no_passphrase'])) {
+            /* Decryption requires both keyrings. */
+            $pub_keyring = $this->_putInKeyring(array($params['pubkey']));
+            $sec_keyring = $this->_putInKeyring(array($params['privkey']), 'private');
+            $cmdline[] = '--passphrase-fd 0';
+            $cmdline[] = $sec_keyring;
+            $cmdline[] = $pub_keyring;
+        }
+        $cmdline[] = '--decrypt';
+        $cmdline[] = $input;
+
+        /* Decrypt the document now. */
+        if (empty($params['no_passphrase'])) {
+            $result = $this->_callGpg($cmdline, 'w', $params['passphrase'], true, true);
+        } else {
+            $result = $this->_callGpg($cmdline, 'r', null, true, true);
+        }
         if (empty($result->output)) {
             $error = preg_replace('/\n.*/', '', $result->stderr);
             return PEAR::raiseError(_("Could not decrypt PGP data: ") . $error, 'horde.error');
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Crypt/smime.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Crypt/smime.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Crypt/smime.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Crypt/smime.php	2007-03-14 20:59:22.000000000 +0100
@@ -6,9 +6,9 @@
  * Horde_Crypt_smime:: provides a framework for Horde applications to
  * interact with the OpenSSL library and implement S/MIME.
  *
- * $Horde: framework/Crypt/Crypt/smime.php,v 1.49.2.12 2006/02/03 15:52:55 slusarz Exp $
+ * $Horde: framework/Crypt/Crypt/smime.php,v 1.49.2.13 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Crypt.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Crypt.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Crypt.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Crypt.php	2007-03-14 20:59:21.000000000 +0100
@@ -3,9 +3,9 @@
  * The Horde_Crypt:: class provides an API for various cryptographic
  * systems used by Horde applications.
  *
- * $Horde: framework/Crypt/Crypt.php,v 1.27.10.9 2006/01/01 21:28:12 jan Exp $
+ * $Horde: framework/Crypt/Crypt.php,v 1.27.10.10 2007/01/02 13:54:11 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/csv.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/csv.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/csv.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/csv.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Horde_Data implementation for comma-separated data (CSV).
  *
- * $Horde: framework/Data/Data/csv.php,v 1.30.10.8 2006/01/28 16:21:58 chuck Exp $
+ * $Horde: framework/Data/Data/csv.php,v 1.30.10.9 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 1999-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/icalendar.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/icalendar.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/icalendar.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/icalendar.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
 /**
  * This is iCalendar (vCalendar).
  *
- * $Horde: framework/Data/Data/icalendar.php,v 1.31.10.3 2006/01/01 21:28:13 jan Exp $
+ * $Horde: framework/Data/Data/icalendar.php,v 1.31.10.4 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/imc.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/imc.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/imc.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/imc.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,9 +8,9 @@
  * methods that vCard and iCalendar implementation can share and rely
  * on.
  *
- * $Horde: framework/Data/Data/imc.php,v 1.32.10.8 2006/05/09 23:06:09 chuck Exp $
+ * $Horde: framework/Data/Data/imc.php,v 1.32.10.9 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 1999-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/tsv.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/tsv.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/tsv.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/tsv.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Horde_Data implementation for tab-separated data (TSV).
  *
- * $Horde: framework/Data/Data/tsv.php,v 1.23.10.10 2006/08/03 02:50:40 selsky Exp $
+ * $Horde: framework/Data/Data/tsv.php,v 1.23.10.12 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 1999-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -21,6 +21,9 @@
 
     function importData($contents, $header = false, $delimiter = "\t")
     {
+        if ($_SESSION['import_data']['format'] == 'pine') {
+            $contents = preg_replace('/\n +/', '', $contents);
+        }
         $contents = explode("\n", $contents);
         $data = array();
         if ($header) {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/vcard.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/vcard.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/vcard.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/vcard.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
 /**
  * Implement the Horde_Data:: API for vCard data.
  *
- * $Horde: framework/Data/Data/vcard.php,v 1.33.10.7 2006/01/01 21:28:13 jan Exp $
+ * $Horde: framework/Data/Data/vcard.php,v 1.33.10.8 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 1999-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/vnote.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/vnote.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/vnote.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/vnote.php	2007-03-14 20:59:19.000000000 +0100
@@ -5,10 +5,10 @@
 /**
  * Implement the Horde_Data:: API for vNote data.
  *
- * $Horde: framework/Data/Data/vnote.php,v 1.8.10.5 2006/01/01 21:28:13 jan Exp $
+ * $Horde: framework/Data/Data/vnote.php,v 1.8.10.6 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 1999-2006 Jan Schneider <jan@horde.org>
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/vtodo.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/vtodo.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data/vtodo.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data/vtodo.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,10 +6,10 @@
 /**
  * Implement the Horde_Data:: API for vTodo data.
  *
- * $Horde: framework/Data/Data/vtodo.php,v 1.8.10.3 2006/01/01 21:28:13 jan Exp $
+ * $Horde: framework/Data/Data/vtodo.php,v 1.8.10.4 2007/01/02 13:54:13 jan Exp $
  *
- * Copyright 1999-2006 Jan Schneider <jan@horde.org>
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Data.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Data.php	2007-03-14 20:59:19.000000000 +0100
@@ -26,9 +26,9 @@
  * Abstract class to handle different kinds of Data formats and to
  * help data exchange between Horde applications and external sources.
  *
- * $Horde: framework/Data/Data.php,v 1.80.10.12 2006/08/08 17:15:22 jan Exp $
+ * $Horde: framework/Data/Data.php,v 1.80.10.14 2007/01/02 13:54:12 jan Exp $
  *
- * Copyright 1999-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -40,12 +40,24 @@
  */
 class Horde_Data extends PEAR {
 
+    /**
+     * File extension.
+     *
+     * @var string
+     */
     var $_extension;
+
+    /**
+     * MIME content type.
+     *
+     * @var string
+     */
     var $_contentType = 'text/plain';
 
     /**
      * A list of warnings raised during the last operation.
      *
+     * @var array
      * @since Horde 3.1
      */
     var $_warnings = array();
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/DataTree/null.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/DataTree/null.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/DataTree/null.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/DataTree/null.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,7 +3,7 @@
  * The DataTree_null:: class provides a dummy implementation of the
  * DataTree:: API; no data will last beyond a single page request.
  *
- * $Horde: framework/DataTree/DataTree/null.php,v 1.15.2.4 2005/10/18 11:01:05 jan Exp $
+ * $Horde: framework/DataTree/DataTree/null.php,v 1.15.2.5 2006/11/13 02:12:47 chuck Exp $
  *
  * Copyright 1999, 2000, 2001, 2002 Stephane Huther <shuther@bigfoot.com>
  * Copyright 2001, 2002 Chuck Hagenbuch <chuck@horde.org>
@@ -295,7 +295,11 @@
             return PEAR::raiseError('no criteria');
         }
 
-        return array_keys($this->_attributeCache);
+        $cids = array();
+        foreach (array_keys($this->_attributeCache) as $cid) {
+            $cids[$cid] = null;
+        }
+        return $cids;
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/DataTree/sql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/DataTree/sql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/DataTree/sql.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/DataTree/sql.php	2007-03-14 20:59:23.000000000 +0100
@@ -24,11 +24,11 @@
  * The table structure for the DataTree system is in
  * scripts/sql/horde_datatree.sql.
  *
- * $Horde: framework/DataTree/DataTree/sql.php,v 1.156.2.30 2006/07/13 09:04:20 jan Exp $
+ * $Horde: framework/DataTree/DataTree/sql.php,v 1.156.2.32 2007/01/02 13:54:13 jan Exp $
  *
- * Copyright 1999-2006 Stephane Huther <shuther@bigfoot.com>
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Stephane Huther <shuther@bigfoot.com>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If
  * you did not receive this file, see
@@ -659,6 +659,9 @@
     function remove($object, $force = false)
     {
         $id = $this->getId($object);
+        if (is_a($id, 'PEAR_Error')) {
+            return $id;
+        }
         $order = $this->getOrder($object);
 
         $query = 'SELECT datatree_id FROM ' . $this->_params['table'] .
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/DataTree.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/DataTree.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/DataTree.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/DataTree.php	2007-03-14 20:59:23.000000000 +0100
@@ -36,10 +36,10 @@
  * Required values for $params:<pre>
  *   'group' -- Define each group of objects we want to build.</pre>
  *
- * $Horde: framework/DataTree/DataTree.php,v 1.151.2.18 2006/07/13 08:58:44 jan Exp $
+ * $Horde: framework/DataTree/DataTree.php,v 1.151.2.19 2007/01/02 13:54:13 jan Exp $
  *
- * Copyright 1999-2003 Stephane Huther <shuther@bigfoot.com>
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Stephane Huther <shuther@bigfoot.com>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Date.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Date.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Date.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Date.php	2007-03-14 20:59:19.000000000 +0100
@@ -31,7 +31,7 @@
  * Horde Date wrapper/logic class, including some calculation
  * functions.
  *
- * $Horde: framework/Date/Date.php,v 1.8.10.7 2006/05/04 03:42:32 selsky Exp $
+ * $Horde: framework/Date/Date.php,v 1.8.10.8 2006/11/24 23:52:56 chuck Exp $
  *
  * @package Horde_Date
  */
@@ -92,8 +92,8 @@
                 }
             }
         } elseif (!is_null($date)) {
-            // Match YYYY-MM-DD HH:MM:SS and YYYYMMDDHHMMSS.
-            if (preg_match('/(\d{4})-?(\d{2})-?(\d{2}) ?(\d{2}):?(\d{2}):?(\d{2})/', $date, $parts)) {
+            // Match YYYY-MM-DD HH:MM:SS, YYYYMMDDHHMMSS and YYYYMMDD'T'HHMMSS'Z'.
+            if (preg_match('/(\d{4})-?(\d{2})-?(\d{2})T? ?(\d{2}):?(\d{2}):?(\d{2})Z?/', $date, $parts)) {
                 $this->year = (int)$parts[1];
                 $this->month = (int)$parts[2];
                 $this->mday = (int)$parts[3];
@@ -151,6 +151,8 @@
      * Returns the day of the year (1-366) that corresponds to the
      * first day of the given week.
      *
+     * TODO: with PHP 5.1+, see http://derickrethans.nl/calculating_start_and_end_dates_of_a_week.php
+     *
      * @param integer $week  The week of the year to find the first day of.
      * @param integer $year  The year to calculate for.
      *
@@ -158,7 +160,7 @@
      */
     function firstDayOfWeek($week, $year)
     {
-        $jan1 = &new Horde_Date(array('year' => $year, 'month' => 1, 'mday' => 1));
+        $jan1 = new Horde_Date(array('year' => $year, 'month' => 1, 'mday' => 1));
         $start = $jan1->dayOfWeek();
         if ($start > HORDE_DATE_THURSDAY) {
             $start -= 7;
@@ -219,7 +221,7 @@
         $monthTotals = array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334);
         $dayOfYear = $this->mday + $monthTotals[$this->month - 1];
         if (Horde_Date::isLeapYear($this->year) && $this->month > 2) {
-            $dayOfYear++;
+            ++$dayOfYear;
         }
 
         return $dayOfYear;
@@ -248,10 +250,10 @@
         // Find the last Thursday of the year.
         $day = 31;
         while (date('w', mktime(0, 0, 0, 12, $day, $year)) != HORDE_DATE_THURSDAY) {
-            $day--;
+            --$day;
         }
 
-        $date = &new Horde_Date(array('year' => $year, 'month' => 12, 'mday' => $day));
+        $date = new Horde_Date(array('year' => $year, 'month' => 12, 'mday' => $day));
         return $date->weekOfYear();
     }
 
@@ -308,44 +310,44 @@
     {
         if ($mask & HORDE_DATE_MASK_SECOND) {
             while ($this->sec < 0) {
-                $this->min--;
+                --$this->min;
                 $this->sec += 60;
             }
             while ($this->sec > 59) {
-                $this->min++;
+                ++$this->min;
                 $this->sec -= 60;
             }
         }
 
         if ($mask & HORDE_DATE_MASK_MINUTE) {
             while ($this->min < 0) {
-                $this->hour--;
+                --$this->hour;
                 $this->min += 60;
             }
             while ($this->min > 59) {
-                $this->hour++;
+                ++$this->hour;
                 $this->min -= 60;
             }
         }
 
         if ($mask & HORDE_DATE_MASK_HOUR) {
             while ($this->hour < 0) {
-                $this->mday--;
+                --$this->mday;
                 $this->hour += 24;
             }
             while ($this->hour > 23) {
-                $this->mday++;
+                ++$this->mday;
                 $this->hour -= 24;
             }
         }
 
         if ($mask & HORDE_DATE_MASK_MONTH) {
             while ($this->month > 12) {
-                $this->year++;
+                ++$this->year;
                 $this->month -= 12;
             }
             while ($this->month < 1) {
-                $this->year--;
+                --$this->year;
                 $this->month += 12;
             }
         }
@@ -353,11 +355,11 @@
         if ($mask & HORDE_DATE_MASK_DAY) {
             while ($this->mday > Horde_Date::daysInMonth($this->month, $this->year)) {
                 $this->mday -= Horde_Date::daysInMonth($this->month, $this->year);
-                $this->month++;
+                ++$this->month;
                 $this->correct(HORDE_DATE_MASK_MONTH);
             }
             while ($this->mday < 1) {
-                $this->month--;
+                --$this->month;
                 $this->correct(HORDE_DATE_MASK_MONTH);
                 $this->mday += Horde_Date::daysInMonth($this->month, $this->year);
             }
@@ -378,7 +380,7 @@
     function compareDate($date)
     {
         if (!is_a($date, 'Horde_Date')) {
-            $date = &new Horde_Date($date);
+            $date = new Horde_Date($date);
         }
 
         if ($this->year != $date->year) {
@@ -404,7 +406,7 @@
     function compareTime($date)
     {
         if (!is_a($date, 'Horde_Date')) {
-            $date = &new Horde_Date($date);
+            $date = new Horde_Date($date);
         }
 
         if ($this->hour != $date->hour) {
@@ -430,7 +432,7 @@
     function compareDateTime($date)
     {
         if (!is_a($date, 'Horde_Date')) {
-            $date = &new Horde_Date($date);
+            $date = new Horde_Date($date);
         }
 
         if ($diff = $this->compareDate($date)) {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Editor/htmlarea.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Editor/htmlarea.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Editor/htmlarea.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Editor/htmlarea.php	2007-03-14 20:59:20.000000000 +0100
@@ -3,10 +3,10 @@
  * The Editor_htmlarea:: class provides an WYSIWYG editor for use
  * in the Horde Framework.
  *
- * $Horde: framework/Editor/Editor/htmlarea.php,v 1.24.4.4 2006/01/01 21:28:14 jan Exp $
+ * $Horde: framework/Editor/Editor/htmlarea.php,v 1.24.4.5 2007/01/02 13:54:16 jan Exp $
  *
- * Copyright 2003-2006 Nuno Loureiro <nuno@co.sapo.pt>
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Nuno Loureiro <nuno@co.sapo.pt>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Editor.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Editor.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Editor.php	2006-08-17 15:27:42.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Editor.php	2007-03-14 20:59:20.000000000 +0100
@@ -5,9 +5,9 @@
  * The Editor:: package provides an rte editor for the Horde
  * Application Framework.
  *
- * $Horde: framework/Editor/Editor.php,v 1.8.10.8 2006/01/01 21:28:14 jan Exp $
+ * $Horde: framework/Editor/Editor.php,v 1.8.10.9 2007/01/02 13:54:15 jan Exp $
  *
- * Copyright 2003-2006 Nuno Loureiro <nuno@co.sapo.pt>
+ * Copyright 2003-2007 Nuno Loureiro <nuno@co.sapo.pt>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/conditional_enable.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/conditional_enable.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/conditional_enable.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/conditional_enable.php	2007-03-14 20:59:19.000000000 +0100
@@ -16,9 +16,9 @@
  * action is attached to if the value of 'foo' is 1 or 2, and disable it
  * otherwise.
  *
- * $Horde: framework/Form/Form/Action/conditional_enable.php,v 1.4.10.3 2006/01/01 21:28:17 jan Exp $
+ * $Horde: framework/Form/Form/Action/conditional_enable.php,v 1.4.10.4 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Matt Kynaston <matt@kynx.org>
+ * Copyright 2002-2007 Matt Kynaston <matt@kynx.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/conditional_setvalue.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/conditional_setvalue.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/conditional_setvalue.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/conditional_setvalue.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * sets the value of one Horde_Form variable based on the value of the
  * variable the action is attached to.
  *
- * $Horde: framework/Form/Form/Action/conditional_setvalue.php,v 1.19.10.5 2006/01/01 21:28:17 jan Exp $
+ * $Horde: framework/Form/Form/Action/conditional_setvalue.php,v 1.19.10.6 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/reload.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/reload.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/reload.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/reload.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * form with the current (not the original) value after the form element
  * that the action is attached to is modified.
  *
- * $Horde: framework/Form/Form/Action/reload.php,v 1.7.10.4 2006/01/01 21:28:17 jan Exp $
+ * $Horde: framework/Form/Form/Action/reload.php,v 1.7.10.5 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/submit.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/submit.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/submit.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/submit.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * form after the form element that the action is attached to is
  * modified.
  *
- * $Horde: framework/Form/Form/Action/submit.php,v 1.10.12.4 2006/01/01 21:28:17 jan Exp $
+ * $Horde: framework/Form/Form/Action/submit.php,v 1.10.12.5 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/sum_fields.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/sum_fields.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/sum_fields.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/sum_fields.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
  * The params array should contain the names of the fields which will be
  * summed.
  *
- * $Horde: framework/Form/Form/Action/sum_fields.php,v 1.5.10.4 2006/01/01 21:28:17 jan Exp $
+ * $Horde: framework/Form/Form/Action/sum_fields.php,v 1.5.10.5 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Matt Kynaston <matt@kynx.org>
+ * Copyright 2002-2007 Matt Kynaston <matt@kynx.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/updatefield.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/updatefield.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action/updatefield.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action/updatefield.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * the value of one Horde_Form variable as the variable the action is
  * attached to is updated.
  *
- * $Horde: framework/Form/Form/Action/updatefield.php,v 1.5.12.4 2006/01/01 21:28:17 jan Exp $
+ * $Horde: framework/Form/Form/Action/updatefield.php,v 1.5.12.5 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Action.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Action.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,8 +3,8 @@
  * The Horde_Form_Action class provides an API for adding actions to
  * Horde_Form variables.
  *
- * $Horde: framework/Form/Form/Action.php,v 1.19.10.6 2006/01/01 21:28:17 jan Exp $
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * $Horde: framework/Form/Form/Action.php,v 1.19.10.7 2007/01/02 13:54:17 jan Exp $
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Renderer.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Renderer.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form/Renderer.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form/Renderer.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The Horde_Form_Renderer class provides HTML and other renderings of
  * forms for the Horde_Form:: package.
  *
- * $Horde: framework/Form/Form/Renderer.php,v 1.185.4.15 2006/04/15 18:05:04 chuck Exp $
+ * $Horde: framework/Form/Form/Renderer.php,v 1.185.4.16 2007/01/02 13:54:17 jan Exp $
  *
- * Copyright 2001-2006 Robert E. Coyle <robertecoyle@hotmail.com>
+ * Copyright 2001-2007 Robert E. Coyle <robertecoyle@hotmail.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Form.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Form.php	2007-03-14 20:59:19.000000000 +0100
@@ -5,10 +5,10 @@
  * The Horde_Form:: package provides form rendering, validation, and
  * other functionality for the Horde Application Framework.
  *
- * $Horde: framework/Form/Form.php,v 1.306.2.48 2006/04/26 15:52:29 jan Exp $
+ * $Horde: framework/Form/Form.php,v 1.306.2.53 2007/01/02 13:54:17 jan Exp $
  *
- * Copyright 2001-2006 Robert E. Coyle <robertecoyle@hotmail.com>
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2001-2007 Robert E. Coyle <robertecoyle@hotmail.com>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -39,7 +39,7 @@
 
     function Horde_Form(&$vars, $title = '', $name = null)
     {
-        if (is_null($name)) {
+        if (empty($name)) {
             $name = String::lower(get_class($this));
         }
 
@@ -1795,6 +1795,14 @@
 
 class Horde_Form_Type_link extends Horde_Form_Type {
 
+    /**
+     * List of hashes containing link parameters. Possible keys: 'url', 'text',
+     * 'target', 'onclick', 'title', 'accesskey'.
+     *
+     * @var array
+     */
+    var $values;
+
     function init($values)
     {
         $this->values = $values;
@@ -2683,7 +2691,7 @@
         if ($empty == 0) {
             /* If no empty parts return 0. */
             return 0;
-        } elseif ($empty == 3) {
+        } elseif ($empty == count($date)) {
             /* If all empty parts return 1. */
             return 1;
         } else {
@@ -3055,7 +3063,7 @@
     function getOptions($side, $formname)
     {
         $html = '';
-        $header = false;
+        $headers = false;
         if ($side) {
             $values = $this->_rightValues;
             if (!empty($this->_rightHeader)) {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Chart/pie3d.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Chart/pie3d.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Chart/pie3d.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Chart/pie3d.php	2007-03-14 20:59:22.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * 3D Pie graph implementation for the Horde_Graph package.
  *
- * $Horde: framework/Graph/Graph/Chart/pie3d.php,v 1.1.10.4 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph/Chart/pie3d.php,v 1.1.10.5 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Chart/pie.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Chart/pie.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Chart/pie.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Chart/pie.php	2007-03-14 20:59:22.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Pie graph implementation for the Horde_Graph package.
  *
- * $Horde: framework/Graph/Graph/Chart/pie.php,v 1.10.10.4 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph/Chart/pie.php,v 1.10.10.5 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/bargrouped.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/bargrouped.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/bargrouped.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/bargrouped.php	2007-03-14 20:59:22.000000000 +0100
@@ -5,9 +5,9 @@
 /**
  * Grouped bar graph implementation for the Horde_Graph package.
  *
- * $Horde: framework/Graph/Graph/Plot/bargrouped.php,v 1.1.10.4 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph/Plot/bargrouped.php,v 1.1.10.5 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/bar.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/bar.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/bar.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/bar.php	2007-03-14 20:59:22.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Bar graph implementation for the Horde_Graph package.
  *
- * $Horde: framework/Graph/Graph/Plot/bar.php,v 1.5.12.4 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph/Plot/bar.php,v 1.5.12.5 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/barstacked.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/barstacked.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/barstacked.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/barstacked.php	2007-03-14 20:59:22.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Stacked bar graph implementation for the Horde_Graph package.
  *
- * $Horde: framework/Graph/Graph/Plot/barstacked.php,v 1.1.10.4 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph/Plot/barstacked.php,v 1.1.10.5 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/line.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/line.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/line.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/line.php	2007-03-14 20:59:22.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Line graph implementation for the Horde_Graph package.
  *
- * $Horde: framework/Graph/Graph/Plot/line.php,v 1.4.12.4 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph/Plot/line.php,v 1.4.12.5 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/scatter.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/scatter.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph/Plot/scatter.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph/Plot/scatter.php	2007-03-14 20:59:22.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Scatter plot implementation for the Horde_Graph package.
  *
- * $Horde: framework/Graph/Graph/Plot/scatter.php,v 1.3.12.4 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph/Plot/scatter.php,v 1.3.12.5 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Graph.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Graph.php	2007-03-14 20:59:22.000000000 +0100
@@ -5,9 +5,9 @@
  * Provides a set of graph backends and methods for creating graphs as
  * HTML tables, SVG images, etc.
  *
- * $Horde: framework/Graph/Graph.php,v 1.27.10.7 2006/01/01 21:28:18 jan Exp $
+ * $Horde: framework/Graph/Graph.php,v 1.27.10.8 2007/01/02 13:54:19 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Group/hooks.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Group/hooks.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Group/hooks.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Group/hooks.php	2007-03-14 20:59:22.000000000 +0100
@@ -4,9 +4,9 @@
  * addition of adding support for hook functions to define if a user
  * is in a group.
  *
- * $Horde: framework/Group/Group/hooks.php,v 1.7.2.10 2006/01/01 21:28:19 jan Exp $
+ * $Horde: framework/Group/Group/hooks.php,v 1.7.2.11 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 2003-2006 Jason Rust <jrust@rustyparts.com>
+ * Copyright 2003-2007 Jason Rust <jrust@rustyparts.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Group/ldap.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Group/ldap.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Group/ldap.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Group/ldap.php	2007-03-14 20:59:22.000000000 +0100
@@ -3,9 +3,9 @@
  * The Group_ldap class provides an LDAP backend for the Horde groups
  * system.
  *
- * $Horde: framework/Group/Group/ldap.php,v 1.18.2.2 2006/01/01 21:28:19 jan Exp $
+ * $Horde: framework/Group/Group/ldap.php,v 1.18.2.5 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 2005-2006 Ben Chavet <ben@horde.org>
+ * Copyright 2005-2007 Ben Chavet <ben@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -139,7 +139,7 @@
             return PEAR::raiseError($success->getMessage());
         }
 
-        $search = @ldap_search($this->_ds, $dn, $this->_filter);
+        $search = @ldap_search($this->_ds, $this->_params['basedn'], $this->_filter);
         if (!$search) {
             return PEAR::raiseError(_("Could not reach the LDAP server."));
         }
@@ -149,7 +149,7 @@
         @ldap_close($this->_ds);
 
         if (!is_array($result) || (count($result) <= 1)) {
-            return 0;
+            return 1;
         }
 
         return $result[$result['count'] - 1]['gidnumber'][0] + 1;
@@ -511,7 +511,7 @@
                 return PEAR::raiseError($success->getMessage());
             }
 
-            $search = @ldap_search($this->_ds, $dn, '(&' . $this->_filter . '(' . $this->_params['gid'] . '=' . $group . '))');
+            $search = @ldap_search($this->_ds, $this->_params['basedn'], '(&' . $this->_filter . '(' . $this->_params['gid'] . '=' . $group . '))');
             if (!$search) {
                 return PEAR::raiseError(_("Could not reach the LDAP server."));
             }
@@ -651,22 +651,21 @@
                 return PEAR::raiseError($success->getMessage());
             }
 
-            $search = @ldap_search($this->_ds, $this->getGroupParent($dn), $this->_filer);
+            $search = @ldap_search($this->_ds, $dn, $this->_filter);
             if (!$search) {
-                return PEAR::raiseError(_("Could not reach the LDAP server."));
+                return PEAR::raiseError(sprintf(_("Could not reach the LDAP server: %s"), @ldap_error($this->_ds)));
             }
 
             $result = @ldap_get_entries($this->_ds, $search);
             @ldap_close($this->_ds);
             if (!is_array($result) || (count($result) <= 1)) {
-                return PEAR::raiseError(_("Empty result."));
+                // Not an error, we just don't have any users in this group.
+                return array();
             }
 
             $users = array();
             for ($i = 0; $i < $result['count']; $i++) {
-                for ($j = 0; $j < $result[$i][$this->_params['memberuid']]['count']; $j++) {
-                    $users[] = $result[$i][$this->_params['memberuid']][$j];
-                }
+                $users = array_merge($users, $this->listUsers($result[$i]['dn']));
             }
 
             $cache[$dn] = array_unique($users);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Group.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Group.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Group.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Group.php	2007-03-14 20:59:22.000000000 +0100
@@ -6,10 +6,10 @@
 /**
  * The Group:: class provides the Horde groups system.
  *
- * $Horde: framework/Group/Group.php,v 1.67.2.15 2006/07/17 14:40:19 jan Exp $
+ * $Horde: framework/Group/Group.php,v 1.67.2.16 2007/01/02 13:54:20 jan Exp $
  *
- * Copyright 1999-2006 Stephane Huther <shuther@bigfoot.com>
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Stephane Huther <shuther@bigfoot.com>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Help.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Help.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Help.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Help.php	2007-03-14 20:59:22.000000000 +0100
@@ -13,9 +13,9 @@
 /**
  * The Help:: class provides an interface to the online help subsystem.
  *
- * $Horde: framework/Horde/Horde/Help.php,v 1.68.8.18 2006/03/02 05:27:35 slusarz Exp $
+ * $Horde: framework/Horde/Horde/Help.php,v 1.68.8.19 2007/01/02 13:54:21 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/History.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/History.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/History.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/History.php	2007-03-14 20:59:20.000000000 +0100
@@ -3,9 +3,9 @@
  * The History:: class provides a method of tracking changes in Horde
  * objects, stored in a SQL table.
  *
- * $Horde: framework/History/History.php,v 1.28.2.14 2006/05/03 21:46:13 jan Exp $
+ * $Horde: framework/History/History.php,v 1.28.2.15 2007/01/02 13:54:21 jan Exp $
  *
- * Copyright 2003-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2003-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/valarm.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/valarm.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/valarm.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/valarm.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Class representing vAlarms.
  *
- * $Horde: framework/iCalendar/iCalendar/valarm.php,v 1.8.10.4 2006/01/01 21:28:47 jan Exp $
+ * $Horde: framework/iCalendar/iCalendar/valarm.php,v 1.8.10.5 2007/01/02 13:54:51 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vcard.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vcard.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vcard.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vcard.php	2007-03-14 20:59:23.000000000 +0100
@@ -26,9 +26,9 @@
 /**
  * Class representing vCard entries.
  *
- * $Horde: framework/iCalendar/iCalendar/vcard.php,v 1.3.10.8 2006/05/09 23:08:22 chuck Exp $
+ * $Horde: framework/iCalendar/iCalendar/vcard.php,v 1.3.10.10 2007/01/02 13:54:51 jan Exp $
  *
- * Copyright 2003-2006 Karsten Fourmont (karsten@horde.org)
+ * Copyright 2003-2007 Karsten Fourmont (karsten@horde.org)
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -79,8 +79,7 @@
      * to
      *   "Professor Dagobert T Duck Sen"
      *
-     * @return string  Full name of vcard "N" tag
-     *                 or null if no N tag.
+     * @return string  Full name of vcard "N" tag or null if no N tag.
      */
     function printableName()
     {
@@ -89,6 +88,8 @@
             return null;
         }
 
+        $name_arr = array();
+
         if (!empty($name_parts[VCARD_N_PREFIX])) {
             $name_arr[] = $name_parts[VCARD_N_PREFIX];
         }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vevent.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vevent.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vevent.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vevent.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Class representing vEvents.
  *
- * $Horde: framework/iCalendar/iCalendar/vevent.php,v 1.31.10.8 2006/01/01 21:28:47 jan Exp $
+ * $Horde: framework/iCalendar/iCalendar/vevent.php,v 1.31.10.11 2007/01/11 18:17:46 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -30,8 +30,9 @@
         // Default values.
         $requiredAttributes = array();
         $requiredAttributes['DTSTAMP'] = time();
-        $requiredAttributes['ORGANIZER'] = 'Unknown Organizer';
-        $requiredAttributes['UID'] = $this->_exportDateTime(time()) . '@' . (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost');
+        $requiredAttributes['UID'] = $this->_exportDateTime(time()) .
+            substr(base_convert(microtime(), 10, 36), -16) . '@' .
+            (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost');
 
         $method = !empty($this->_container) ?
             $this->_container->getAttribute('METHOD') : 'PUBLISH';
@@ -87,7 +88,8 @@
     function updateAttendee($email, $status, $fullname = '')
     {
         foreach ($this->_attributes as $key => $attribute) {
-            if ($attribute['name'] == 'ATTENDEE' && $attribute['value'] == 'MAILTO:' . $email) {
+            if ($attribute['name'] == 'ATTENDEE' &&
+                $attribute['value'] == 'mailto:' . $email) {
                 $this->_attributes[$key]['params']['PARTSTAT'] = $status;
                 if (!empty($fullname)) {
                     $this->_attributes[$key]['params']['CN'] = $fullname;
@@ -100,7 +102,7 @@
         if (!empty($fullname)) {
             $params['CN'] = $fullname;
         }
-        $this->setAttribute('ATTENDEE', 'MAILTO:' . $email, $params);
+        $this->setAttribute('ATTENDEE', 'mailto:' . $email, $params);
     }
 
     /**
@@ -136,7 +138,9 @@
             $currentValue = $this->getAttribute($newAttribute['name']);
             if (is_a($currentValue, 'PEAR_error')) {
                 // Already exists so just add it.
-                $this->setAttribute($newAttribute['name'], $newAttribute['value'], $newAttribute['params']);
+                $this->setAttribute($newAttribute['name'],
+                                    $newAttribute['value'],
+                                    $newAttribute['params']);
             } else {
                 // Already exists so locate and modify.
                 $found = false;
@@ -189,7 +193,9 @@
             $currentValue = $this->getAttribute($newAttribute['name']);
             if (is_a($currentValue, 'PEAR_error')) {
                 // Already exists so just add it.
-                $this->setAttribute($newAttribute['name'], $newAttribute['value'], $newAttribute['params']);
+                $this->setAttribute($newAttribute['name'],
+                                    $newAttribute['value'],
+                                    $newAttribute['params']);
             } else {
                 // Already exists so locate and modify.
                 $found = false;
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vfreebusy.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vfreebusy.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vfreebusy.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vfreebusy.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Class representing vFreebusy components.
  *
- * $Horde: framework/iCalendar/iCalendar/vfreebusy.php,v 1.16.10.9 2006/02/06 17:53:39 mrubinsk Exp $
+ * $Horde: framework/iCalendar/iCalendar/vfreebusy.php,v 1.16.10.10 2007/01/02 13:54:51 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vjournal.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vjournal.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vjournal.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vjournal.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Class representing vJournals.
  *
- * $Horde: framework/iCalendar/iCalendar/vjournal.php,v 1.8.10.4 2006/01/01 21:28:47 jan Exp $
+ * $Horde: framework/iCalendar/iCalendar/vjournal.php,v 1.8.10.5 2007/01/02 13:54:51 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vnote.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vnote.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vnote.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vnote.php	2007-03-14 20:59:23.000000000 +0100
@@ -5,9 +5,9 @@
 /**
  * Class representing vNotes.
  *
- * $Horde: framework/iCalendar/iCalendar/vnote.php,v 1.3.10.5 2006/03/03 09:07:31 jan Exp $
+ * $Horde: framework/iCalendar/iCalendar/vnote.php,v 1.3.10.6 2007/01/02 13:54:51 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vtimezone.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vtimezone.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vtimezone.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vtimezone.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Class representing vTimezones.
  *
- * $Horde: framework/iCalendar/iCalendar/vtimezone.php,v 1.8.10.4 2006/01/01 21:28:47 jan Exp $
+ * $Horde: framework/iCalendar/iCalendar/vtimezone.php,v 1.8.10.6 2007/01/02 13:54:51 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -30,6 +30,140 @@
         return parent::_exportvData('VTIMEZONE');
     }
 
+    /**
+     * Parse child components of the vTimezone component. Returns an
+     * array with the exact time of the time change as well as the
+     * 'from' and 'to' offsets around the change. Time is arbitrarily
+     * based on UTC for comparison.
+     */
+    function parseChild(&$child, $year)
+    {
+        // Make sure 'time' key is first for sort().
+        $result['time'] = 0;
+
+        $t = $child->getAttribute('TZOFFSETFROM');
+        if (is_a($t, 'PEAR_Error')) {
+            return false;
+        }
+        $result['from'] = ($t['hour'] * 60 * 60 + $t['minute'] * 60) * ($t['ahead'] ? 1 : -1);
+
+        $t = $child->getAttribute('TZOFFSETTO');
+        if (is_a($t, 'PEAR_Error')) {
+            return false;
+        }
+        $result['to'] = ($t['hour'] * 60 * 60 + $t['minute'] * 60) * ($t['ahead'] ? 1 : -1);
+
+        $switch_time = $child->getAttribute('DTSTART');
+        if (is_a($switch_time, 'PEAR_Error')) {
+            return false;
+        }
+
+        $rrules = $child->getAttribute('RRULE');
+        if (is_a($rrules, 'PEAR_Error')) {
+            if (!is_int($switch_time)) {
+                return false;
+            }
+            // Convert this timestamp from local time to UTC for
+            // comparison (All dates are compared as if they are UTC).
+            $t = getdate($switch_time);
+            $result['time'] = @gmmktime($t['hours'], $t['minutes'], $t['seconds'],
+                                        $t['mon'], $t['mday'], $t['year']);
+            return $result;
+        }
+
+        $rrules = explode(';', $rrules);
+        foreach ($rrules as $rrule) {
+            $t = explode('=', $rrule);
+            switch ($t[0]) {
+            case 'FREQ':
+                if ($t[1] != 'YEARLY') {
+                    return false;
+                }
+                break;
+
+            case 'INTERVAL':
+                if ($t[1] != '1') {
+                    return false;
+                }
+                break;
+
+            case 'BYMONTH':
+                $month = intval($t[1]);
+                break;
+
+            case 'BYDAY':
+                $len = strspn($t[1], '1234567890-+');
+                if ($len == 0) {
+                    return false;
+                }
+                $weekday = substr($t[1], $len);
+                $weekdays = array(
+                    'SU' => 0,
+                    'MO' => 1,
+                    'TU' => 2,
+                    'WE' => 3,
+                    'TH' => 4,
+                    'FR' => 5,
+                    'SA' => 6
+                );
+                $weekday = $weekdays[$weekday];
+                $which = intval(substr($t[1], 0, $len));
+                break;
+
+            case 'UNTIL':
+                if (intval($year) > intval(substr($t[1], 0, 4))) {
+                    return false;
+                }
+                break;
+            }
+        }
+
+        if (empty($month) || !isset($weekday)) {
+            return false;
+        }
+
+        if (is_int($switch_time)) {
+            // Was stored as localtime.
+            $switch_time = strftime('%H:%M:%S', $switch_time);
+            $switch_time = explode(':', $switch_time);
+        } else {
+            $switch_time = explode('T', $switch_time);
+            if (count($switch_time) != 2) {
+                return false;
+            }
+            $switch_time[0] = substr($switch_time[1], 0, 2);
+            $switch_time[2] = substr($switch_time[1], 4, 2);
+            $switch_time[1] = substr($switch_time[1], 2, 2);
+        }
+
+        // Get the timestamp for the first day of $month.
+        $when = gmmktime($switch_time[0], $switch_time[1], $switch_time[2],
+                         $month, 1, $year);
+        // Get the day of the week for the first day of $month.
+        $first_of_month_weekday = intval(gmstrftime('%w', $when));
+
+        // Go to the first $weekday before first day of $month.
+        if ($weekday >= $first_of_month_weekday) {
+            $weekday -= 7;
+        }
+        $when -= ($first_of_month_weekday - $weekday) * 60 * 60 * 24;
+
+        // If going backwards go to the first $weekday after last day
+        // of $month.
+        if ($which < 0) {
+            do {
+                $when += 60*60*24*7;
+            } while (intval(gmstrftime('%m', $when)) == $month);
+        }
+
+        // Calculate $weekday number $which.
+        $when += $which * 60 * 60 * 24 * 7;
+
+        $result['time'] = $when;
+
+        return $result;
+    }
+
 }
 
 /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vtodo.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vtodo.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar/vtodo.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar/vtodo.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Class representing vTodos.
  *
- * $Horde: framework/iCalendar/iCalendar/vtodo.php,v 1.13.10.4 2006/01/01 21:28:47 jan Exp $
+ * $Horde: framework/iCalendar/iCalendar/vtodo.php,v 1.13.10.5 2007/01/02 13:54:51 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/iCalendar.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/iCalendar.php	2007-03-14 20:59:23.000000000 +0100
@@ -11,9 +11,9 @@
 /**
  * Class representing iCalendar files.
  *
- * $Horde: framework/iCalendar/iCalendar.php,v 1.57.4.34 2006/08/05 13:43:47 karsten Exp $
+ * $Horde: framework/iCalendar/iCalendar.php,v 1.57.4.45 2007/03/14 15:58:24 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -370,14 +370,14 @@
     }
 
     /**
-     * Locates the first child component of the specified class, and
-     * returns a reference to this component.
+     * Locates the first child component of the specified class, and returns a
+     * reference to it.
      *
      * @param string $type  The type of component to find.
      *
-     * @return mixed (boolean) False if no subcomponent of the specified
-     *                         class exists.
-     *               (Horde_iCalendar_*) A reference to the requested component.
+     * @return boolean|Horde_iCalendar_*  False if no subcomponent of the
+     *                                    specified class exists or a reference
+     *                                    to the requested component.
      */
     function &findComponent($childclass)
     {
@@ -389,7 +389,42 @@
             }
         }
 
-        return false;
+        $component = false;
+        return $component;
+    }
+
+    /**
+     * Locates the first matching child component of the specified class, and
+     * returns a reference to it.
+     *
+     * @param string $childclass  The type of component to find.
+     * @param string $attribute   This attribute must be set in the component
+     *                            for it to match.
+     * @param string $value       Optional value that $attribute must match.
+     *
+     * @return boolean|Horde_iCalendar_*  False if no matching subcomponent of
+     *                                    the specified class exists, or a
+     *                                    reference to the requested component.
+     */
+    function &findComponentByAttribute($childclass, $attribute, $value = null)
+    {
+        $childclass = 'Horde_iCalendar_' . String::lower($childclass);
+        $keys = array_keys($this->_components);
+        foreach ($keys as $key) {
+            if (is_a($this->_components[$key], $childclass)) {
+                $attr = $this->_components[$key]->getAttribute($attribute);
+                if (is_a($attr, 'PEAR_Error')) {
+                    continue;
+                }
+                if ($value !== null && $value != $attr) {
+                    continue;
+                }
+                return $this->_components[$key];
+            }
+        }
+
+        $component = false;
+        return $component;
     }
 
     /**
@@ -503,8 +538,31 @@
         // All subcomponents.
         $matches = null;
         if (preg_match_all('/BEGIN:([\W\w]*)(\r\n|\r|\n)([\W\w]*)END:\1(\r\n|\r|\n)/Ui', $vCal, $matches)) {
+            // vTimezone components are processed first. They are
+            // needed to process vEvents that may use a TZID.
             foreach ($matches[0] as $key => $data) {
                 $type = trim($matches[1][$key]);
+                if ($type != 'VTIMEZONE') {
+                    continue;
+                }
+                $component = &Horde_iCalendar::newComponent($type, $this);
+                if ($component === false) {
+                    return PEAR::raiseError("Unable to create object for type $type");
+                }
+                $component->parsevCalendar($data);
+
+                $this->addComponent($component);
+
+                // Remove from the vCalendar data.
+                $vCal = str_replace($data, '', $vCal);
+            }
+
+            // Now process the non-vTimezone components.
+            foreach ($matches[0] as $key => $data) {
+                $type = trim($matches[1][$key]);
+                if ($type == 'VTIMEZONE') {
+                    continue;
+                }
                 $component = &Horde_iCalendar::newComponent($type, $this);
                 if ($component === false) {
                     return PEAR::raiseError("Unable to create object for type $type");
@@ -569,12 +627,15 @@
                     $value = String::convertCharset($value, $charset);
                 }
 
+                // Get timezone info for date fields from $params.
+                $tzid = isset($params['TZID']) ? trim($params['TZID'], '\"') : false;
+
                 switch ($tag) {
                 // Date fields.
                 case 'COMPLETED':
                 case 'CREATED':
                 case 'LAST-MODIFIED':
-                    $this->setAttribute($tag, $this->_parseDateTime($value), $params);
+                    $this->setAttribute($tag, $this->_parseDateTime($value, $tzid), $params);
                     break;
 
                 case 'BDAY':
@@ -590,14 +651,14 @@
                     if (isset($params['VALUE']) && $params['VALUE'] == 'DATE') {
                         $this->setAttribute($tag, $this->_parseDate($value), $params);
                     } else {
-                        $this->setAttribute($tag, $this->_parseDateTime($value), $params);
+                        $this->setAttribute($tag, $this->_parseDateTime($value, $tzid), $params);
                     }
                     break;
 
                 case 'TRIGGER':
                     if (isset($params['VALUE'])) {
                         if ($params['VALUE'] == 'DATE-TIME') {
-                            $this->setAttribute($tag, $this->_parseDateTime($value), $params);
+                            $this->setAttribute($tag, $this->_parseDateTime($value, $tzid), $params);
                         } else {
                             $this->setAttribute($tag, $this->_parseDuration($value), $params);
                         }
@@ -662,38 +723,20 @@
                     $this->setAttribute($tag, trim($value), $params);
                     break;
 
-                // ADR, and N are lists seperated by unescaped
-                // semicolons with a specific number of slots.
+                // ADR, ORG and N are lists seperated by unescaped semicolons
+                // with a specific number of slots.
                 case 'ADR':
                 case 'N':
-                    $value = trim($value);
-                    // As of rfc 2426 2.4.2 semicolon, comma, and
-                    // colon must be escaped (comma is unescaped after
-                    // splitting below).
-                    $value = str_replace(array('\\n', '\\;', '\\:'),
-                                         array($this->_newline, ';', ':'),
-                                         $value);
-
-                    // Split by unescaped semicolons:
-                    $values = preg_split('/(?<!\\\\);/', $value);
-                    $value = str_replace('\\;', ';', $value);
-                    $values = str_replace('\\;', ';', $values);
-                    $this->setAttribute($tag, trim($value), $params, true, $values);
-                    break;
-
-                // ORG is a list seperated by unescaped semicolons but
-                // with no empty values.
                 case 'ORG':
                     $value = trim($value);
-                    // As of rfc 2426 2.4.2 semicolon, comma, and
-                    // colon must be escaped (comma is unescaped after
-                    // splitting below).
-                    $value = str_replace(array('\\n', '\\;', '\\:'),
-                                         array($this->_newline, ';', ':'),
+                    // As of rfc 2426 2.4.2 semicolon, comma, and colon must
+                    // be escaped (comma is unescaped after splitting below).
+                    $value = str_replace(array('\\n', '\\N', '\\;', '\\:'),
+                                         array($this->_newline, $this->_newline, ';', ':'),
                                          $value);
 
                     // Split by unescaped semicolons:
-                    $values = preg_split('/(?<!\\\\);/', $value, -1, PREG_SPLIT_NO_EMPTY);
+                    $values = preg_split('/(?<!\\\\);/', $value);
                     $value = str_replace('\\;', ';', $value);
                     $values = str_replace('\\;', ';', $values);
                     $this->setAttribute($tag, trim($value), $params, true, $values);
@@ -702,8 +745,9 @@
                 // String fields.
                 default:
                     if ($this->isOldFormat()) {
-                        // vcalendar 1.0 and vcard 2.1 only escape semicolons
-                        // and use unescaped semicolons to create lists.
+                        // vCalendar 1.0 and vcCard 2.1 only escape
+                        // semicolons and use unescaped semicolons to
+                        // create lists.
                         $value = trim($value);
                         // Split by unescaped semicolons:
                         $values = preg_split('/(?<!\\\\);/', $value);
@@ -715,8 +759,8 @@
                         // As of rfc 2426 2.4.2 semicolon, comma, and
                         // colon must be escaped (comma is unescaped after
                         // splitting below).
-                        $value = str_replace(array('\\n', '\\;', '\\:'),
-                                             array($this->_newline, ';', ':'),
+                        $value = str_replace(array('\\n', '\\N', '\\;', '\\:', '\\\\'),
+                                             array($this->_newline, $this->_newline, ';', ':', '\\'),
                                              $value);
 
                         // Split by unescaped commas:
@@ -763,12 +807,21 @@
             $params = $attribute['params'];
             if ($params) {
                 foreach ($params as $param_name => $param_value) {
-                    // Skip CHARSET for iCalendar 2.0 data, not
-                    // allowed.
+                    /* Skip CHARSET for iCalendar 2.0 data, not allowed. */
                     if ($param_name == 'CHARSET' && !$this->isOldFormat()) {
                         continue;
                     }
-                    $params_str .= ";$param_name=$param_value";
+                    /* Skip VALUE=DATE for vCalendar 1.0 data, not allowed. */
+                    if ($this->isOldFormat() &&
+                         $param_name == 'VALUE' && $param_value == 'DATE') {
+                        continue;
+                    }
+
+                    if ($param_value === null) {
+                        $params_str .= ";$param_name";
+                    } else {
+                        $params_str .= ";$param_name=$param_value";
+                    }
                 }
             }
 
@@ -790,7 +843,7 @@
             case 'RECURRENCE-ID':
                 if (isset($params['VALUE'])) {
                     if ($params['VALUE'] == 'DATE') {
-                        $value = $this->_exportDate($value);
+                        $value = $this->_exportDate($value, $name == 'DTEND' ? '235959' : '000000');
                     } else {
                         $value = $this->_exportDateTime($value);
                     }
@@ -806,7 +859,7 @@
                 foreach ($value as $date) {
                     if (isset($params['VALUE'])) {
                         if ($params['VALUE'] == 'DATE') {
-                            $dates[] = $this->_exportDate($date);
+                            $dates[] = $this->_exportDate($date, '000000');
                         } elseif ($params['VALUE'] == 'PERIOD') {
                             $dates[] = $this->_exportPeriod($date);
                         } else {
@@ -877,7 +930,7 @@
                 // Example of 1.0 style:
                 // ATTENDEE;ROLE=OWNER;STATUS=CONFIRMED:John Smith <jsmith@host1.com>
                 if ($this->isOldFormat()) {
-                    $value = preg_replace('/MAILTO:/', '', $value);
+                    $value = preg_replace('/MAILTO:/i', '', $value);
                     $value =  $value . ' <' . $value . '>';
                     $params_str = str_replace('PARTSTAT=', 'STATUS=', $params_str);
                     $params_str = str_replace('STATUS=NEEDS-ACTION', 'STATUS=NEEDS ACTION', $params_str);
@@ -888,26 +941,23 @@
                     $params_str = str_replace('RSVP=FALSE', 'RSVP=NO', $params_str);
                 }
                 break;
+
             default:
                 if ($this->isOldFormat()) {
-                    if (is_array($attribute['values'])
-                            && count($attribute['values'])>1) {
+                    if (is_array($attribute['values']) &&
+                        count($attribute['values']) > 1) {
                         $values = $attribute['values'];
-                        if ($name == 'N' || $name == 'ADR') {
+                        if ($name == 'N' || $name == 'ADR' || $name == 'ORG') {
                             $glue = ';';
                         } else {
                             $glue = ',';
                         }
-                        $values  = str_replace(array(';'),
-                                             array('\\;'),
-                                             $values);
+                        $values = str_replace(';', '\\;', $values);
                         $value = implode($glue, $values);
                     } else {
                         /* vcard 2.1 and vcalendar 1.0 escape only
                          * semicolons */
-                        $value = str_replace(array(';'),
-                                             array('\\;'),
-                                             $value);
+                        $value = str_replace(';', '\\;', $value);
                     }
                     if ($name == 'STATUS') {
                         // vcalendar 1.0 has STATUS:NEEDS ACTION while 2.0 has
@@ -918,36 +968,37 @@
                     // or QUOTED-PRINTABLE encoded. Currently we use
                     // QUOTED-PRINTABLE as default.
                     // FIXME: deal with base64 encodings!
-                    if (preg_match("/[^\x20-\x7F]/", $value)
-                            && empty($params['ENCODING']))  {
+                    if (preg_match("/[^\x20-\x7F\r\n]/", $value) &&
+                        empty($params['ENCODING']))  {
                         $params['ENCODING'] = 'QUOTED-PRINTABLE';
                         $params_str .= ';ENCODING=QUOTED-PRINTABLE';
                         // Add CHARSET as well. At least the synthesis client
                         // gets confused otherwise
                         if (empty($params['CHARSET'])) {
-                            $params['CARSET'] = NLS::getCharset();
-                            $params_str .= ';CHARSET=' . $params['CARSET'];
+                            $params['CHARSET'] = NLS::getCharset();
+                            $params_str .= ';CHARSET=' . $params['CHARSET'];
                         }
                     }
                 } else {
-                    if (is_array($attribute['values'])
-                            && count($attribute['values'])>1) {
+                    if (is_array($attribute['values']) &&
+                        count($attribute['values']) > 1) {
                         $values = $attribute['values'];
-                        if ($name == 'N' || $name == 'ADR') {
+                        if ($name == 'N' || $name == 'ADR' || $name == 'ORG') {
                             $glue = ';';
                         } else {
                             $glue = ',';
                         }
-                        $values = str_replace(array(';', ':', ',', 'MAILTO\\:'),
-                                             array('\\;', '\\:', '\\,', 'MAILTO:'),
-                                             $values);
+                        // As of rfc 2426 2.5 semicolon and comma must be
+                        // escaped.
+                        $values = str_replace(array(';', ',', '\\'),
+                                              array('\\;', '\\,', '\\\\'),
+                                              $values);
                         $value = implode($glue, $values);
                     } else {
-                        // As of rfc 2426 2.4.2 semicolon, comma, and colon
-                        // must be escaped. Exclude MAILTO: though. This is a
-                        // hack!
-                        $value = str_replace(array(';', ':', ',', 'MAILTO\\:'),
-                                             array('\\;', '\\:', '\\,', 'MAILTO:'),
+                        // As of rfc 2426 2.5 semicolon and comma must be
+                        // escaped.
+                        $value = str_replace(array(';', ',', '\\'),
+                                             array('\\;', '\\,', '\\\\'),
                                              $value);
                     }
                 }
@@ -955,7 +1006,8 @@
             }
 
             if (!empty($params['ENCODING']) &&
-                $params['ENCODING'] == 'QUOTED-PRINTABLE' && strlen(trim($value)) > 0) {
+                $params['ENCODING'] == 'QUOTED-PRINTABLE' &&
+                strlen(trim($value))) {
                 /* quotedPrintableEncode does not escape CRLFs, but strange
                  * enough single LFs. so convert everything to LF only and
                  * replace afterwards. */
@@ -1042,36 +1094,97 @@
     }
 
     /**
-     * Parses a DateTime field into a unix timestamp.
+     * Grok the TZID and return an offset in seconds from UTC for this
+     * date and time.
+     */
+    function _parseTZID($date, $time, $tzid)
+    {
+        $vtimezone = $this->_container->findComponentByAttribute('vtimezone', 'TZID', $tzid);
+        if (!$vtimezone) {
+            return false;
+        }
+
+        $change_times = array();
+        foreach ($vtimezone->getComponents() as $o) {
+            $t = $vtimezone->parseChild($o, $date['year']);
+            if ($t !== false) {
+                $change_times[] = $t;
+            }
+        }
+
+        if (!$change_times) {
+            return false;
+        }
+
+        sort($change_times);
+
+        // Time is arbitrarily based on UTC for comparison.
+        $t = @gmmktime($time['hour'], $time['minute'], $time['second'],
+                       $date['month'], $date['mday'], $date['year']);
+
+        if ($t < $change_times[0]['time']) {
+            return $change_times[0]['from'];
+        }
+
+        for ($i = 0, $n = count($change_times); $i < $n - 1; $i++) {
+            if (($t >= $change_times[$i]['time']) &&
+                ($t < $change_times[$i + 1]['time'])) {
+                return $change_times[$i]['to'];
+            }
+        }
+
+        if ($t >= $change_times[$n - 1]['time']) {
+            return $change_times[$n - 1]['to'];
+        }
+
+        return false;
+    }
+
+    /**
+     * Parses a DateTime field and returns a unix timestamp. If the
+     * field cannot be parsed then the original text is returned
+     * unmodified.
      *
      * @todo This function should be moved to Horde_Date and made public.
-     * @static
      */
-    function _parseDateTime($text)
+    function _parseDateTime($text, $tzid = false)
     {
         $dateParts = explode('T', $text);
         if (count($dateParts) != 2 && !empty($text)) {
             // Not a datetime field but may be just a date field.
-            if (!$date = Horde_iCalendar::_parseDate($text)) {
-                return $date;
+            if (!preg_match('/^(\d{4})-?(\d{2})-?(\d{2})$/', $text, $match)) {
+                // Or not
+                return $text;
             }
-            return @gmmktime(0, 0, 0, $date['month'], $date['mday'], $date['year']);
+            $newtext = $text.'T000000';
+            $dateParts = explode('T', $newtext);
         }
 
         if (!$date = Horde_iCalendar::_parseDate($dateParts[0])) {
-            return $date;
+            return $text;
         }
         if (!$time = Horde_iCalendar::_parseTime($dateParts[1])) {
-            return $time;
+            return $text;
         }
 
-        if ($time['zone'] == 'UTC') {
-            return @gmmktime($time['hour'], $time['minute'], $time['second'],
-                             $date['month'], $date['mday'], $date['year']);
+        // Get timezone info for date fields from $tzid and container.
+        $tzoffset = ($time['zone'] == 'Local' && $tzid && is_a($this->_container, 'Horde_iCalendar')) ?
+            $this->_parseTZID($date, $time, $tzid) : false;
+        if ($time['zone'] == 'UTC' || $tzoffset !== false) {
+            $result = @gmmktime($time['hour'], $time['minute'], $time['second'],
+                                $date['month'], $date['mday'], $date['year']);
+            if ($tzoffset) {
+                $result -= $tzoffset;
+            }
         } else {
-            return @mktime($time['hour'], $time['minute'], $time['second'],
-                           $date['month'], $date['mday'], $date['year']);
+            // We don't know the timezone so assume local timezone.
+            // FIXME: shouldn't this be based on the user's timezone
+            // preference rather than the server's timezone?
+            $result = @mktime($time['hour'], $time['minute'], $time['second'],
+                              $date['month'], $date['mday'], $date['year']);
         }
+
+        return ($result !== false) ? $result : $text;
     }
 
     /**
@@ -1157,14 +1270,23 @@
     }
 
     /**
-     * Export a Date field.
+     * Exports a date field.
+     *
+     * @param object|array $value  Date object or hash.
+     * @param string $autoconvert  If set, use this as time part to export the
+     *                             date as datetime when exporting to Vcalendar
+     *                             1.0. Examples: '000000' or '235959'
      */
-    function _exportDate($value)
+    function _exportDate($value, $autoconvert = false)
     {
         if (is_object($value)) {
             $value = array('year' => $value->year, 'month' => $value->month, 'mday' => $value->mday);
         }
-        return sprintf('%04d%02d%02d', $value['year'], $value['month'], $value['mday']);
+        if ($autoconvert !== false && $this->isOldFormat()) {
+            return sprintf('%04d%02d%02dT%s', $value['year'], $value['month'], $value['mday'], $autoconvert);
+        } else {
+            return sprintf('%04d%02d%02d', $value['year'], $value['month'], $value['mday']);
+        }
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Identity.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Identity.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Identity.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Identity.php	2007-03-14 20:59:22.000000000 +0100
@@ -4,16 +4,16 @@
  * methods take care of any site-specific restrictions configured in prefs.php
  * and conf.php.
  *
- * $Horde: framework/Prefs/Identity.php,v 1.1.2.2 2006/06/28 20:52:53 jan Exp $
+ * $Horde: framework/Prefs/Identity.php,v 1.1.2.6 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 2001-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2001-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  *
  * @author  Jan Schneider <jan@horde.org>
  * @since   Horde 1.3.5
- * @package Horde_Identity
+ * @package Horde_Prefs
  */
 class Identity {
 
@@ -76,7 +76,7 @@
 
         if (!($this->_identities = @unserialize($this->_prefs->getValue('identities', false)))) {
             /* Convert identities from the old format. */
-            $this->_identities = unserialize($this->_prefs->getValue('identities'));
+            $this->_identities = @unserialize($this->_prefs->getValue('identities'));
         } elseif (is_array($this->_identities)) {
             $this->_identities = $this->_prefs->convertFromDriver($this->_identities, NLS::getCharset());
         }
@@ -333,7 +333,7 @@
 
         $addr = $this->getValue('from_addr');
         if (empty($addr)) {
-            $addr = Auth::getAuth();
+            $addr = $this->_user;
         }
 
         return $from_addr . '<' . $addr . '>';
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/gd.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/gd.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/gd.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/gd.php	2007-03-14 20:59:22.000000000 +0100
@@ -7,9 +7,9 @@
  * extension. It mainly provides some utility functions, such as the
  * ability to make pixels, for now.
  *
- * $Horde: framework/Image/Image/gd.php,v 1.48.10.14 2006/01/01 21:28:22 jan Exp $
+ * $Horde: framework/Image/Image/gd.php,v 1.48.10.17 2007/01/03 00:07:32 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -1023,10 +1023,16 @@
     {
         unset($php_errormsg);
         $track = ini_set('track_errors', 1);
-        $result = @call_user_func_array($function, $params);
+        $error_mask = E_ALL & ~E_WARNING & ~E_NOTICE;
+        if (defined('E_STRICT')) {
+            $error_mask &= ~E_STRICT;
+        }
+        error_reporting($error_mask);
+        $result = call_user_func_array($function, $params);
         if ($track !== false) {
             ini_set('track_errors', $track);
         }
+        error_reporting($GLOBALS['conf']['debug_level']);
         if (!empty($php_errormsg)) {
             require_once 'PEAR.php';
             $result = PEAR::raiseError($function . ': ' . $php_errormsg);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/im.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/im.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/im.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/im.php	2007-03-14 20:59:22.000000000 +0100
@@ -5,10 +5,10 @@
 /**
  * This class implements the Horde_Image:: API for ImageMagick.
  *
- * $Horde: framework/Image/Image/im.php,v 1.34.10.11 2006/01/01 21:28:22 jan Exp $
+ * $Horde: framework/Image/Image/im.php,v 1.34.10.13 2007/01/02 13:54:23 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -222,7 +222,7 @@
      */
     function grayscale()
     {
-        $this->_operations[] = '-colorspace GRAY -colors 256';
+        $this->_operations[] = '-colorspace GRAY';
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/png.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/png.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/png.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/png.php	2007-03-14 20:59:22.000000000 +0100
@@ -7,9 +7,9 @@
  * mainly provides some utility functions, such as the ability to make
  * pixels or solid images for now.
  *
- * $Horde: framework/Image/Image/png.php,v 1.19.10.8 2006/05/31 17:06:36 selsky Exp $
+ * $Horde: framework/Image/Image/png.php,v 1.19.10.9 2007/01/02 13:54:23 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/svg.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/svg.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/svg.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/svg.php	2007-03-14 20:59:22.000000000 +0100
@@ -6,9 +6,9 @@
 /**
  * This class implements the Horde_Image:: API for SVG.
  *
- * $Horde: framework/Image/Image/svg.php,v 1.31.10.6 2006/01/01 21:28:22 jan Exp $
+ * $Horde: framework/Image/Image/svg.php,v 1.31.10.7 2007/01/02 13:54:23 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/swf.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/swf.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image/swf.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image/swf.php	2007-03-14 20:59:22.000000000 +0100
@@ -6,9 +6,9 @@
  * This class implements the Horde_Image:: API for SWF, using the PHP
  * Ming extension.
  *
- * $Horde: framework/Image/Image/swf.php,v 1.24.10.6 2006/01/01 21:28:22 jan Exp $
+ * $Horde: framework/Image/Image/swf.php,v 1.24.10.7 2007/01/02 13:54:23 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Image.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Image.php	2007-03-14 20:59:22.000000000 +0100
@@ -6,9 +6,9 @@
  * This class defines the Horde_Image:: API, and also provides some
  * utility functions, such as generating highlights of a color.
  *
- * $Horde: framework/Image/Image.php,v 1.39.10.13 2006/01/01 21:28:22 jan Exp $
+ * $Horde: framework/Image/Image.php,v 1.39.10.14 2007/01/02 13:54:23 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/ACL/rfc2086.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/ACL/rfc2086.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/ACL/rfc2086.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/ACL/rfc2086.php	2007-03-14 20:59:19.000000000 +0100
@@ -17,9 +17,9 @@
  *               'imap/ssl/novalidate-cert' (for a self-signed certificate).
  *               DEFAULT: 'imap'</pre>
  *
- * $Horde: framework/IMAP/IMAP/ACL/rfc2086.php,v 1.6.8.12 2006/07/26 19:34:45 chuck Exp $
+ * $Horde: framework/IMAP/IMAP/ACL/rfc2086.php,v 1.6.8.17 2007/01/17 03:16:01 selsky Exp $
  *
- * Copyright 2003-2006 Chris Hastie <imp@oak-wood.co.uk>
+ * Copyright 2003-2007 Chris Hastie <imp@oak-wood.co.uk>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -213,7 +213,14 @@
                     foreach ($response_array as $var) {
                         if (strpos($var, '=') !== false) {
                             $var2 = explode('=', $var, 2);
-                            $capabilities[String::lower($var2[0])][String::lower($var2[1])] = 1;
+                            $capability = String::lower($var2[0]);
+                            /* We need to make sure this array element exists and is not a
+                             * scalar (1) when we want to set a qualified capability. */
+                            if (!isset($capabilities[$capability]) ||
+                                !is_array($capabilities[$capability])) {
+                                $capabilities[$capability] = array();
+                            }
+                            $capabilities[$capability][String::lower($var2[1])] = 1;
                         } else {
                             $capabilities[String::lower($var)] = 1;
                         }
@@ -251,12 +258,21 @@
     function getACL($folder)
     {
         if (isset($this->_caps['auth']['digest-md5'])) {
-            return $this->_getACL($folder, 'digest-md5');
-        } elseif (isset($this->_caps['auth']['cram-md5'])) {
-            return $this->_getACL($folder, 'cram-md5');
-        } else {
-            return $this->_getACL($folder, 'login');
+            $acl = $this->_getACL($folder, 'digest-md5');
+            if (!is_a($acl, 'PEAR_Error')) {
+                return $acl;
+            }
         }
+
+        if (isset($this->_caps['auth']['cram-md5'])) {
+            $acl = $this->_getACL($folder, 'cram-md5');
+            if (!is_a($acl, 'PEAR_Error')) {
+                return $acl;
+            }
+        }
+
+        // Fall through to plain.
+        return $this->_getACL($folder, 'login');
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/ACL/rfc4314.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/ACL/rfc4314.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/ACL/rfc4314.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/ACL/rfc4314.php	2007-03-14 20:59:19.000000000 +0100
@@ -20,9 +20,9 @@
  *               'imap/ssl/novalidate-cert' (for a self-signed certificate).
  *               DEFAULT: 'imap'</pre>
  *
- * $Horde: framework/IMAP/IMAP/ACL/rfc4314.php,v 1.2.2.1 2006/02/06 23:21:19 selsky Exp $
+ * $Horde: framework/IMAP/IMAP/ACL/rfc4314.php,v 1.2.2.2 2007/01/02 13:54:23 jan Exp $
  *
- * Copyright 2006 Matt Selsky <selsky@columbia.edu>
+ * Copyright 2006-2007 Matt Selsky <selsky@columbia.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/ACL.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/ACL.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/ACL.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/ACL.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * Contains functions related to managing
  * Access Control Lists.
  *
- * $Horde: framework/IMAP/IMAP/ACL.php,v 1.2.12.10 2006/02/03 03:07:57 selsky Exp $
+ * $Horde: framework/IMAP/IMAP/ACL.php,v 1.2.12.11 2007/01/02 13:54:22 jan Exp $
  *
- * Copyright 2003-2006 Chris Hastie <imp@oak-wood.co.uk>
+ * Copyright 2003-2007 Chris Hastie <imp@oak-wood.co.uk>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Admin.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Admin.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Admin.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Admin.php	2007-03-14 20:59:19.000000000 +0100
@@ -24,9 +24,9 @@
  *                    If not present, this is built from 'hostspec', 'port'
  *                    and 'protocol' parameters.</pre>
  *
- * $Horde: framework/IMAP/IMAP/Admin.php,v 1.5.6.9 2006/05/31 19:39:47 slusarz Exp $
+ * $Horde: framework/IMAP/IMAP/Admin.php,v 1.5.6.10 2007/01/02 13:54:22 jan Exp $
  *
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Cache.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Cache.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Cache.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Cache.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The IMAP_Cache:: class facilitates in caching output from the PHP imap
  * extension in the current session.
  *
- * $Horde: framework/IMAP/IMAP/Cache.php,v 1.4.12.11 2006/04/28 15:43:40 slusarz Exp $
+ * $Horde: framework/IMAP/IMAP/Cache.php,v 1.4.12.12 2007/01/02 13:54:22 jan Exp $
  *
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Search.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Search.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Search.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Search.php	2007-03-14 20:59:19.000000000 +0100
@@ -7,9 +7,9 @@
  * This library allows more complex searches to be created (e.g. OR searches,
  * searching specific headers).
  *
- * $Horde: framework/IMAP/IMAP/Search.php,v 1.29.10.25 2006/06/06 15:44:27 slusarz Exp $
+ * $Horde: framework/IMAP/IMAP/Search.php,v 1.29.10.26 2007/01/02 13:54:22 jan Exp $
  *
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (GPL). If you did not
  * receive this file, see http://www.fsf.org/copyleft/gpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Sort.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Sort.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Sort.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Sort.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * IMAP_Sort provides functions for sorting lists of IMAP mailboxes/folders.
  *
- * $Horde: framework/IMAP/IMAP/Sort.php,v 1.6.8.13 2006/02/15 18:07:52 slusarz Exp $
+ * $Horde: framework/IMAP/IMAP/Sort.php,v 1.6.8.14 2007/01/02 13:54:22 jan Exp $
  *
- * Copyright 2004-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2004-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Thread.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Thread.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Thread.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Thread.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * IMAP_Thread provides functions for working with imap_thread() output.
  *
- * $Horde: framework/IMAP/IMAP/Thread.php,v 1.4.10.13 2006/01/01 21:28:21 jan Exp $
+ * $Horde: framework/IMAP/IMAP/Thread.php,v 1.4.10.16 2007/02/16 07:00:58 slusarz Exp $
  *
- * Copyright 2004-2006 Michael Slusarz <slusarz@curecanti.org>
+ * Copyright 2004-2007 Michael Slusarz <slusarz@curecanti.org>
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
@@ -176,11 +176,12 @@
      */
     function _processStructure()
     {
-        $container = $container_base = $last_index = $thread_base = $thread_base_idx =  null;
+        $container = $container_base = $last_index = $thread_base = $thread_base_idx = null;
         $indices = array();
         $i = $last_i = $level = 0;
 
-        foreach ($this->_threadarray as $key => $val) {
+        reset($this->_threadarray);
+        while (list($key, $val) = each($this->_threadarray)) {
             $pos = strpos($key, '.');
             $index = substr($key, 0, $pos);
             $type = substr($key, $pos + 1);
@@ -190,14 +191,15 @@
                 if ($val === 0) {
                     $container = $index;
                 } else {
-                    $i++;
+                    ++$i;
                     if (is_null($container) && empty($level)) {
                         $thread_base = $val;
                         $thread_base_idx = $index;
                     }
                     $this->_lookup[$val] = $index;
-                    $this->_thread[$index] = array();
-                    $this->_thread[$index]['index'] = $val;
+                    $this->_thread[$index] = array(
+                        'index' => $val
+                    );
                 }
                 break;
 
@@ -205,13 +207,11 @@
                 if (!is_null($container) && ($container === $index)) {
                     $container_base = $this->_threadarray[$val . '.num'];
                 } else {
-                    $i++;
-                    if (!is_null($container)) {
-                        $this->_thread[$index]['base'] = $container_base;
-                    } else {
-                        $this->_thread[$index]['base'] = (!empty($level) || ($val != 0)) ? $thread_base : null;
-                    }
-                    $level++;
+                    $this->_thread[$index]['base'] = (!is_null($container))
+                        ? $container_base
+                        : ((!empty($level) || ($val != 0)) ? $thread_base : null);
+                    ++$i;
+                    ++$level;
                 }
                 break;
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Tree.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Tree.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/IMAP/Tree.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/IMAP/Tree.php	2007-03-14 20:59:19.000000000 +0100
@@ -56,12 +56,12 @@
  * functions to iterate through this tree and query information about
  * individual mailboxes/folders.
  *
- * $Horde: framework/IMAP/IMAP/Tree.php,v 1.48.2.43 2006/05/12 16:29:29 slusarz Exp $
+ * $Horde: framework/IMAP/IMAP/Tree.php,v 1.48.2.44 2007/01/02 13:54:22 jan Exp $
  *
- * Copyright 2000-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2000-2006 Jon Parise <jon@horde.org>
- * Copyright 2000-2006 Anil Madhavapeddy <avsm@horde.org>
- * Copyright 2003-2006 Michael Slusarz <slusarz@horde.org>
+ * Copyright 2000-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2000-2007 Jon Parise <jon@horde.org>
+ * Copyright 2000-2007 Anil Madhavapeddy <avsm@horde.org>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@horde.org>
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Kolab.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Kolab.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Kolab.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Kolab.php	2007-03-14 20:59:22.000000000 +0100
@@ -93,9 +93,9 @@
  * several functions to help in the IMAP folder <-> Horde Share synchronisation
  * process.
  *
- * $Horde: framework/Kolab/Kolab.php,v 1.26.10.16 2006/07/17 09:30:50 jan Exp $
+ * $Horde: framework/Kolab/Kolab.php,v 1.26.10.20 2007/01/02 13:54:24 jan Exp $
  *
- * Copyright 2004-2006 Horde Project (http://horde.org/)
+ * Copyright 2004-2007 Horde Project (http://horde.org/)
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -436,7 +436,8 @@
     function &loadObject($uid, $is_msgno = false)
     {
         if (empty($this->_imap)) {
-            return false;
+            $object = false;
+            return $object;
         }
 
         if ($is_msgno === false) {
@@ -448,7 +449,7 @@
 
         $this->_headers = $this->_imap->getParsedHeaders($uid);
         if (is_a($this->_headers, 'PEAR_Error')) {
-            return $result;
+            return $this->_headers;
         }
 
         $message_text = $this->_imap->getMessages($uid);
@@ -464,16 +465,20 @@
         $this->_message = &MIME_Structure::parseTextMIMEMessage($message_text);
 
         $parts = $this->_message->contentTypeMap();
-        if (($this->_mime_id = array_search($this->_mime_type, $parts)) !== false) {
+        $this->_mime_id = array_search($this->_mime_type, $parts);
+        if ($this->_mime_id !== false) {
             $part = $this->_message->getPart($this->_mime_id);
             $text = $part->transferDecode();
         } else {
             return PEAR::raiseError(sprintf(_("Horde/Kolab: No object of type %s found in message %s"), $this->_mime_type, $uid));
         }
 
-        $this->_xml = @domxml_open_mem($text, DOMXML_LOAD_PARSING |
-            DOMXML_LOAD_COMPLETE_ATTRS | DOMXML_LOAD_SUBSTITUTE_ENTITIES |
-            DOMXML_LOAD_DONT_KEEP_BLANKS, $error);
+        $this->_xml = @domxml_open_mem($text,
+                                       DOMXML_LOAD_PARSING |
+                                       DOMXML_LOAD_COMPLETE_ATTRS |
+                                       DOMXML_LOAD_SUBSTITUTE_ENTITIES |
+                                       DOMXML_LOAD_DONT_KEEP_BLANKS,
+                                       $error);
         if (!empty($error)) {
             return PEAR::raiseError(sprintf(_("Horde/Kolab: Invalid %s XML data encountered in message %s"), $this->_object_type, $uid));
         }
@@ -485,17 +490,17 @@
     function &newObject($uid)
     {
         if (empty($this->_imap)) {
-            return false;
+            $object = false;
+            return $object;
         }
 
         $this->_msg_no = -1;
-
         $this->_message = new MIME_Message();
 
         $kolab_text = sprintf(_("This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %s"),
                               'http://www.kolab.org/kolab2-clients.html');
-
-        $part = new MIME_Part('text/plain', String::wrap($kolab_text, 76, KOLAB_NEWLINE, NLS::getCharset()),
+        $part = new MIME_Part('text/plain',
+                              String::wrap($kolab_text, 76, KOLAB_NEWLINE, NLS::getCharset()),
                               NLS::getCharset());
         $part->setTransferEncoding('quoted-printable');
         $this->_message->addPart($part);
@@ -505,7 +510,8 @@
         $this->_message->addPart($part);
 
         $parts = $this->_message->contentTypeMap();
-        if (($this->_mime_id = array_search($this->_mime_type, $parts)) === false) {
+        $this->_mime_id = array_search($this->_mime_type, $parts);
+        if ($this->_mime_id === false) {
             return PEAR::raiseError(sprintf(_("Horde/Kolab: Unable to retrieve MIME ID for the part of type %s"), $this->_mime_type));
         }
 
@@ -592,7 +598,8 @@
         $elements = &$this->getAllElems($name, $parent);
 
         if (empty($elements)) {
-            return false;
+            $elements = false;
+            return $elements;
         }
 
         return $elements[0];
@@ -1117,6 +1124,14 @@
             return PEAR::raiseError(_("Invalid share object"));
         }
 
+        if (strpos($share->get('name'), 'user/') === 0) {
+            // In this case we are the owner of a share which is shared
+            // with a group we are also in. This folder will get synched
+            // anyway (since we're also a user of the share), so we
+            // return to prevent folders being created recursively
+            return true;
+        }
+
         $share_uid = $share->getName();
         $owner = $share->get('owner');
         $default = $share_uid == $owner;
@@ -1180,13 +1195,16 @@
                 return $result;
             }
 
-            unset($acl[$user]);
+            // Mail ACL usernames are lowercase only, while Horde's are mixed
+            // case, so we must always convert to lower case when accessing
+            // the array.
+            unset($acl[String::lower($user)]);
         }
 
         // Make sure we don't delete the current user or the Cyrus
         // Administrator from the folder's ACL, or else we'll be locked out
-        unset($acl[$owner]);
-        unset($acl[$conf['kolab']['imap']['adminuser']]);
+        unset($acl[String::lower($owner)]);
+        unset($acl[String::lower($conf['kolab']['imap']['adminuser'])]);
 
         foreach ($acl as $user => $user_acl) {
             $result = $imap->deleteACL($folder_name, $user);
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/LDAP.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/LDAP.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/LDAP.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/LDAP.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * This is a utility class, every method is static.
  *
- * $Horde: framework/LDAP/LDAP.php,v 1.5.12.10 2006/01/01 21:28:23 jan Exp $
+ * $Horde: framework/LDAP/LDAP.php,v 1.5.12.11 2007/01/02 13:54:24 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Maintenance.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Maintenance.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Maintenance.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Maintenance.php	2007-03-14 20:59:23.000000000 +0100
@@ -64,9 +64,9 @@
  * The Maintenance:: class provides a set of methods for dealing with
  * maintenance operations run upon login to Horde applications.
  *
- * $Horde: framework/Maintenance/Maintenance.php,v 1.52.10.13 2006/01/01 21:28:26 jan Exp $
+ * $Horde: framework/Maintenance/Maintenance.php,v 1.52.10.16 2007/02/09 12:32:10 jan Exp $
  *
- * Copyright 2001-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2001-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -161,20 +161,19 @@
     }
 
     /**
-     * Do maintenance operations needed for this login.  This function
-     * will generate the list of tasks to perform during this login
-     * and will redirect to the maintenance page if necessary.  This
-     * is the function that should be called from the application upon
-     * login.
+     * Do maintenance operations needed for this login.
+     *
+     * This function will generate the list of tasks to perform during this
+     * login and will redirect to the maintenance page if necessary.  This is
+     * the function that should be called from the application upon login.
      */
     function runMaintenance()
     {
-        /* Check to see if we are finished with maintenance
-         * operations. */
+        /* Check to see if we are finished with maintenance operations. */
         if (!Util::getFormData(MAINTENANCE_DONE_PARAM)) {
             /* Determine if we should redirect to the maintenance page. */
             if ($this->_needMaintenancePage() !== null) {
-                header('Location: ' . $this->_getMaintenanceURL(), true);
+                header('Location: ' . $this->_getMaintenanceURL());
                 exit;
             }
         }
@@ -185,8 +184,10 @@
 
     /**
      * Do the necessary maintenance tasks for this loading of the maintenance
-     * page.  This is the function that is called from the maintenance page
-     * every time it is loaded.
+     * page.
+     *
+     * This is the function that is called from the maintenance page every
+     * time it is loaded.
      *
      * @return integer  The display required for the maintenance page.
      */
@@ -196,19 +197,22 @@
         $this->_doMaintenanceTasks();
 
         /* Get the list of tasks we need to display to the user. */
-        $task_no = $this->_needMaintenancePage();
+        $tasks_page = $this->_needMaintenancePage();
         $tasks = $this->_tasklist->getList();
 
         /* Remove 'newflag' from first task. */
         if (!$this->_tasklist->processed(true)) {
-            if (count($tasks)) {
-                reset($tasks);
-                $this->_tasklist->setNewPage(key($tasks), false);
+            if (count($tasks_page)) {
+                $this->_tasklist->setNewPage($tasks_page[0], false);
             }
         }
 
-        if (!is_null($task_no)) {
-            $tasks = array_slice($tasks, 0, $task_no + 1);
+        if (!is_null($tasks_page)) {
+            foreach (array_keys($tasks) as $key) {
+                if (!in_array($key, $tasks_page)) {
+                    unset($tasks[$key]);
+                }
+            }
         }
 
         if (count($tasks)) {
@@ -326,8 +330,9 @@
         /* Go through each item in $maint_tasks and determine if we need to
            run it during this maintenance run. */
         foreach ($this->maint_tasks as $key => $val) {
-            /* Skip item if it already appears in the tasks list. */
-            if ($this->_tasklist->inList($key)) {
+            /* Skip item if it already appears in the tasks list or task is
+             * not set in the preferences. */
+            if ($this->_tasklist->inList($key) || !$prefs->getValue($key)) {
                 continue;
             }
 
@@ -376,10 +381,11 @@
             elseif ($val == MAINTENANCE_EVERY) {
                 $addTask = true;
             }
-            /* Skip the task if any of the following:
-               + This task does not need to be run in this login
-               + This task is not set in the preferences */
-            if (!$addTask || !$prefs->getValue($key)) continue;
+            /* Skip the task if this task does not need to be run in this
+             * login. */
+            if (!$addTask) {
+                continue;
+            }
 
             /* Load the task module now. */
             $mod = &$this->_loadModule($key);
@@ -387,11 +393,7 @@
             /* Determine if this task has already been confirmed/set via some
                sort of admin setting. Also, if the user/admin has set the
                'confirm_maintenance' flag, skip confirmation. */
-            $confirmed = false;
-            if ($prefs->isLocked($key) ||
-                !$prefs->getValue('confirm_maintenance')) {
-                $confirmed = true;
-            }
+            $confirmed = $prefs->isLocked($key) || !$prefs->getValue('confirm_maintenance');
 
             /* Add the task to the tasklist. */
             $this->_tasklist->addTask($key, $confirmed, $mod->getDisplayType());
@@ -514,9 +516,8 @@
             $this->_tasklist->removeTask($key);
         }
 
-        /* If we've successfully completed every task in the list (or
-         * skipped it), record now as the last time maintenance was
-         * run. */
+        /* If we've successfully completed every task in the list (or skipped
+         * it), record now as the last time maintenance was run. */
         if (!count($this->_tasklist->getList())) {
             $GLOBALS['prefs']->setValue('last_maintenance', time());
         }
@@ -527,23 +528,27 @@
      *
      * @access private
      *
-     * @return integer  The key of the task that requires the maintenance
-     *                  page. Returns null if the maintenance page is no
-     *                  longer needed.
+     * @return array  The list of tasks that require the maintenance page or
+     *                null if the maintenance page is no longer needed.
      */
     function _needMaintenancePage()
     {
-        $i = 0;
-        foreach ($this->_tasklist->getList() as $key => $val) {
+        $tasks = array();
+        $tasklist = $this->_tasklist->getList();
+        while (list($key, $val) = each($tasklist)) {
             if ($val['newpage']) {
-                return $i;
+                $tasks[] = $key;
+                while ((list($key, $val) = each($tasklist)) &&
+                       !$val['newpage']) {
+                    $tasks[] = $key;
+                }
+                return $tasks;
             }
             if (!empty($val['process']) &&
                 !Util::getFormData('domaintenance')) {
                 $this->_tasklist->setNewPage($key, true);
-                return $i;
+                return $this->_needMaintenancePage();
             }
-            $i++;
         }
 
         return null;
@@ -555,7 +560,7 @@
  * The Maintenance_Tasklist:: class is used to store the list of maintenance
  * tasks that need to be run during this login.
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -624,7 +629,7 @@
         global $registry;
 
         $this->_module = $registry->getApp();
-        $this->_target = Horde::selfUrl(true);
+        $this->_target = Horde::selfUrl(true, true, true);
     }
 
     /**
@@ -644,7 +649,7 @@
             ($display == MAINTENANCE_OUTPUT_NOTICE)) {
             $this->_tasks[$key]['newpage'] = true;
             $this->_addFlag = false;
-        } elseif (($confirmed == false) && (!$this->_addFlag)) {
+        } elseif (!$confirmed && !$this->_addFlag) {
             $this->_tasks[$key]['newpage'] = true;
             $this->_addFlag = true;
         } else {
@@ -805,7 +810,7 @@
  *     text. doMaintenance() will ALWAYS be run.
  *     * This style will be displayed on its own, separate maintenance page. *
  *
- * Copyright 2001-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2001-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Menu.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Menu.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Menu.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Menu.php	2007-03-14 20:59:22.000000000 +0100
@@ -13,10 +13,10 @@
  * The Menu:: class provides standardized methods for creating menus in
  * Horde applications.
  *
- * $Horde: framework/Horde/Horde/Menu.php,v 1.35.2.11 2006/07/20 04:31:27 slusarz Exp $
+ * $Horde: framework/Horde/Horde/Menu.php,v 1.35.2.13 2007/01/02 13:54:21 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -234,7 +234,7 @@
 
             /* Link. */
             $accesskey = Horde::getAccessKey($m['text']);
-            $link = Horde::link($m['url'], $menu_view == 'icon' ? $m['text'] : '',
+            $link = Horde::link($m['url'], $menu_view == 'icon' ? Horde::stripAccessKey($m['text']) : '',
                                 isset($m['class']) ? $m['class'] : '',
                                 isset($m['target']) ? $m['target'] : '',
                                 isset($m['onclick']) ? $m['onclick'] : '',
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Contents.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Contents.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Contents.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Contents.php	2007-03-14 20:59:19.000000000 +0100
@@ -28,9 +28,9 @@
  * The MIME_Contents:: class contains functions related to handling the output
  * of MIME content.
  *
- * $Horde: framework/MIME/MIME/Contents.php,v 1.129.4.35 2006/05/05 03:30:22 slusarz Exp $
+ * $Horde: framework/MIME/MIME/Contents.php,v 1.129.4.37 2007/01/02 13:54:24 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (GPL). If you did not
  * receive this file, see http://www.fsf.org/copyleft/gpl.html.
@@ -416,6 +416,9 @@
     function canDisplayInline(&$mime_part)
     {
         $viewer = &$this->getMIMEViewer($mime_part);
+        if (!$viewer) {
+            return false;
+        }
 
         /* First check: The MIME headers allow the part to be inlined.
          * However, if we are already in view mode, then we can skip this
@@ -442,7 +445,8 @@
     {
         /* Make sure we have a MIME_Part to process. */
         if (empty($mime_part)) {
-            return false;
+            $result = false;
+            return $result;
         }
 
         require_once dirname(__FILE__) . '/Viewer.php';
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Headers.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Headers.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Headers.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Headers.php	2007-03-14 20:59:19.000000000 +0100
@@ -12,9 +12,9 @@
  * variable $GLOBALS['mime_headers']['default_charset'] (defaults to US-ASCII
  * per RFC 2045).
  *
- * $Horde: framework/MIME/MIME/Headers.php,v 1.29.10.20 2006/04/15 17:24:19 slusarz Exp $
+ * $Horde: framework/MIME/MIME/Headers.php,v 1.29.10.22 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -230,14 +230,12 @@
         $return_array = array();
 
         foreach ($this->_headers as $ob) {
-            $eol = $this->getEOL();
             $header = $ob['header'];
             if (is_array($ob['value'])) {
-                require_once dirname(__FILE__) . '/../MIME.php';
-                $return_array[$header] = MIME::wrapHeaders($header, reset($ob['value']));
-                next($ob['value']);
-                while (list(,$val) = each($ob['value'])) {
-                    $return_array[$header] .= $eol . $header . ': ' . MIME::wrapHeaders($header, $val, $eol);
+                if (String::lower($header) == 'received') {
+                    $return_array[$header] = $ob['value'];
+                } else {
+                    $return_array[$header] = reset($ob['value']);
                 }
             } else {
                 $return_array[$header] = $ob['value'];
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Magic.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Magic.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Magic.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Magic.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,10 +4,10 @@
  * MIME type for various content, if it provided with different
  * levels of information.
  *
- * $Horde: framework/MIME/MIME/Magic.php,v 1.52.8.12 2006/01/01 21:28:24 jan Exp $
+ * $Horde: framework/MIME/MIME/Magic.php,v 1.52.8.13 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/MDN.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/MDN.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/MDN.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/MDN.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_MDN:: class implements Message Disposition Notifications as
  * described by RFC 2298.
  *
- * $Horde: framework/MIME/MIME/MDN.php,v 1.4.10.8 2006/01/24 21:32:56 slusarz Exp $
+ * $Horde: framework/MIME/MIME/MDN.php,v 1.4.10.9 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 2004-2006 Michael Slusarz <slusarz@curecanti.org>
+ * Copyright 2004-2007 Michael Slusarz <slusarz@curecanti.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Message.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Message.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Message.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Message.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,10 +6,10 @@
  * The MIME_Message:: class provides methods for creating and manipulating
  * MIME email messages.
  *
- * $Horde: framework/MIME/MIME/Message.php,v 1.76.10.12 2006/01/01 21:28:24 jan Exp $
+ * $Horde: framework/MIME/MIME/Message.php,v 1.76.10.14 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -205,15 +205,21 @@
 
         $addressKeys = array('To', 'Cc', 'Bcc', 'From');
         foreach ($headers as $key => $val) {
-            if (in_array($key, $addressKeys)) {
-                $text = MIME::encodeAddress($val, $charset, $this->_defaultServer);
-                if (is_a($text, 'PEAR_Error')) {
-                    $text = $val;
+            if (is_array($val)) {
+                foreach ($val as $key2 => $val2) {
+                    $headers[$key][$key2] = MIME::wrapHeaders($key, $val2, $this->getEOL());
                 }
             } else {
-                $text = MIME::encode($val, $charset);
+                if (in_array($key, $addressKeys)) {
+                    $text = MIME::encodeAddress($val, $charset, $this->_defaultServer);
+                    if (is_a($text, 'PEAR_Error')) {
+                        $text = $val;
+                    }
+                } else {
+                    $text = MIME::encode($val, $charset);
+                }
+                $headers[$key] = MIME::wrapHeaders($key, $text, $this->getEOL());
             }
-            $headers[$key] = MIME::wrapHeaders($key, $text, $this->getEOL());
         }
 
         return $headers;
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Part.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Part.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Part.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Part.php	2007-03-14 20:59:19.000000000 +0100
@@ -40,10 +40,10 @@
  * The MIME_Part:: class provides a wrapper around MIME parts and methods
  * for dealing with them.
  *
- * $Horde: framework/MIME/MIME/Part.php,v 1.177.4.20 2006/03/09 21:59:31 chuck Exp $
+ * $Horde: framework/MIME/MIME/Part.php,v 1.177.4.21 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Structure.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Structure.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Structure.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Structure.php	2007-03-14 20:59:19.000000000 +0100
@@ -5,7 +5,7 @@
 require_once dirname(__FILE__) . '/../MIME.php';
 
 /**
- * $Horde: framework/MIME/MIME/Structure.php,v 1.87.10.19 2006/05/04 18:03:25 slusarz Exp $
+ * $Horde: framework/MIME/MIME/Structure.php,v 1.87.10.21 2007/02/16 07:32:11 slusarz Exp $
  *
  * The MIME_Structure:: class provides methods for dealing with MIME mail.
  *
@@ -15,8 +15,8 @@
  *
  * TODO: Convert to OO
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -160,7 +160,8 @@
         }
 
         /* Set the default character set. */
-        if (($ob->getCharset() == 'us-ascii') &&
+        if (($ob->getPrimaryType() == 'text') &&
+            ($ob->getCharset() == 'us-ascii') &&
             isset($GLOBALS['mime_structure']['default_charset'])) {
             $ob->setCharset($GLOBALS['mime_structure']['default_charset']);
         }
@@ -207,21 +208,35 @@
         $pexists = 'if' . $ptype;
 
         if ($part->$pexists) {
+            $attr_list = $rfc2231_list = array();
             foreach ($part->$ptype as $param) {
                 $param->value = str_replace(array("\t", '\"'), array(' ', '"'), $param->value);
+                /* Look for an asterisk in the attribute name.  If found we
+                 * know we have RFC 2231 information. */
+                $pos = strpos($param->attribute, '*');
+                if ($pos) {
+                    $attr = substr($param->attribute, 0, $pos);
+                    $rfc2231_list[$attr][] = $param->attribute . '=' . $param->value;
+                } else {
+                    $attr_list[$param->attribute] = $param->value;
+                }
+            }
 
-                $res = MIME::decodeRFC2231($param->attribute . '=' . $param->value);
+            foreach ($rfc2231_list as $val) {
+                $res = MIME::decodeRFC2231(implode(' ', $val));
                 if ($res) {
-                    $param->attribute = $res['attribute'];
-                    $param->value = $res['value'];
+                    $attr_list[$res['attribute']] = $res['value'];
                 }
-                $field = String::lower($param->attribute);
+            }
+
+            foreach ($attr_list as $attr => $val) {
+                $field = String::lower($attr);
                 if ($field == 'type') {
-                    if (($type = MIME::type($param->value))) {
+                    if (($type = MIME::type($val))) {
                         $param_list['type'] = $type;
                     }
                 } else {
-                    $param_list[$field] = $param->value;
+                    $param_list[$field] = $val;
                 }
             }
         }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/css.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/css.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/css.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/css.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
  * The MIME_Viewer_css class renders CSS source as HTML with an effort
  * to remove potentially malicious code.
  *
- * $Horde: framework/MIME/MIME/Viewer/css.php,v 1.1.10.8 2006/06/01 03:08:53 chuck Exp $
+ * $Horde: framework/MIME/MIME/Viewer/css.php,v 1.1.10.9 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 2004-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2004-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/deb.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/deb.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/deb.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/deb.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_deb class renders out lists of files in Debian packages by
  * using the dpkg tool to query the package.
  *
- * $Horde: framework/MIME/MIME/Viewer/deb.php,v 1.11.10.8 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/deb.php,v 1.11.10.9 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/default.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/default.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/default.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/default.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * content.  It exists as a fallback if no other intelligent rendering
  * mechanism could be used.
  *
- * $Horde: framework/MIME/MIME/Viewer/default.php,v 1.9.12.4 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/default.php,v 1.9.12.5 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/enriched.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/enriched.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/enriched.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/enriched.php	2007-03-14 20:59:19.000000000 +0100
@@ -15,9 +15,9 @@
  * environment, that is we do CRLF conversion even if <nofill> is
  * specified in the text, but we're close at least.
  *
- * $Horde: framework/MIME/MIME/Viewer/enriched.php,v 1.23.10.6 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/enriched.php,v 1.23.10.7 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 2001-2006 Eric Rostetter <eric.rostetter@physics.utexas.edu>
+ * Copyright 2001-2007 Eric Rostetter <eric.rostetter@physics.utexas.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/enscript.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/enscript.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/enscript.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/enscript.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
  * The MIME_Viewer_enscript class renders out various content
  * in HTML format by using GNU Enscript.
  *
- * $Horde: framework/MIME/MIME/Viewer/enscript.php,v 1.39.10.8 2006/06/01 03:08:53 chuck Exp $
+ * $Horde: framework/MIME/MIME/Viewer/enscript.php,v 1.39.10.9 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/html.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/html.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/html.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/html.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,11 +3,11 @@
  * The MIME_Viewer_html class renders out HTML text with an effort to
  * remove potentially malicious code.
  *
- * $Horde: framework/MIME/MIME/Viewer/html.php,v 1.14.4.20 2006/06/07 13:34:16 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/html.php,v 1.14.4.24 2007/01/10 17:54:59 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@horde.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@horde.org>
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
@@ -37,6 +37,8 @@
      * etc.
      *
      * @access private
+     * @todo Use IP checks from
+     * http://lxr.mozilla.org/mailnews/source/mail/base/content/phishingDetector.js.
      *
      * @param string $data  The HTML data.
      *
@@ -105,7 +107,7 @@
                     /* Don't consider the link a phishing link if the domain
                      * is the same on both links (e.g. adtracking.example.com
                      * & www.example.com). */
-                    preg_match('/\.?([^\.\/]+\.[^\.\/]+)\//', $m[1][$i], $host1);
+                    preg_match('/\.?([^\.\/]+\.[^\.\/]+)[\/?]/', $m[1][$i], $host1);
                     preg_match('/\.?([^\.\/]+\.[^\.\/]+)(\/.*)?$/', $m[2][$i], $host2);
                     if (!(count($host1) && count($host2)) ||
                         strcasecmp($host1[1], $host2[1]) !== 0) {
@@ -117,13 +119,13 @@
 
         /* Try to derefer all external references. */
         $data = preg_replace_callback('/href\s*=\s*(["\'])?((?(1)[^\1]*?|[^\s>]+))(?(1)\1|)/i',
-                                      create_function('$m', 'return \'href="\' . (strlen($m[2]) && $m[2]{0} == \'#\' ? $m[2] : Horde::externalUrl($m[2])) . \'"\';'),
+                                      create_function('$m', 'return \'href="\' . Horde::externalUrl($m[2]) . \'"\';'),
                                       $data);
 
         /* Prepend phishing warning. */
         if ($phish_warn) {
             require_once 'Horde/MIME/Contents.php';
-            $contents = &new MIME_Contents(new MIME_Part());
+            $contents = new MIME_Contents(new MIME_Part());
             $phish_warning = sprintf(_("%s: This message may not be from whom it claims to be. Beware of following any links in it or of providing the sender with any personal information."), _("Warning"));
             if ($contents->viewAsAttachment()) {
                 $phish_warning = '<span style="background-color:#ffd0af;color:black">' . String::convertCharset($phish_warning, NLS::getCharset(), $this->mime_part->getCharset()) . '</span><br />';
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/images.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/images.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/images.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/images.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * The MIME_Viewer_images class allows images to be displayed.
  *
- * $Horde: framework/MIME/MIME/Viewer/images.php,v 1.18.8.9 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/images.php,v 1.18.8.10 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/msexcel.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/msexcel.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/msexcel.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/msexcel.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_msexcel class renders out Microsoft Excel
  * documents in HTML format by using the xlHtml package.
  *
- * $Horde: framework/MIME/MIME/Viewer/msexcel.php,v 1.20.10.7 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/msexcel.php,v 1.20.10.8 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/mspowerpoint.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/mspowerpoint.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/mspowerpoint.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/mspowerpoint.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_mspowerpoint class renders out Microsoft Powerpoint
  * documents in HTML format by using the xlHtml package.
  *
- * $Horde: framework/MIME/MIME/Viewer/mspowerpoint.php,v 1.13.10.7 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/mspowerpoint.php,v 1.13.10.8 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/msword.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/msword.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/msword.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/msword.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_msword class renders out Microsoft Word
  * documents in HTML format by using the wvWare package.
  *
- * $Horde: framework/MIME/MIME/Viewer/msword.php,v 1.25.10.8 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/msword.php,v 1.25.10.10 2007/01/20 05:33:28 selsky Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -59,13 +59,7 @@
             return _("Unable to translate this Word document");
         }
 
-        $fh = fopen($tmp_output, 'r');
-        while (($rc = fgets($fh, 8192))) {
-            $data .= $rc;
-        }
-        fclose($fh);
-
-        return $data;
+        return file_get_contents($tmp_output);
     }
 
     /**
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/ooo.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/ooo.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/ooo.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/ooo.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,10 +3,10 @@
  * The MIME_Viewer_ooo class renders out OpenOffice.org
  * documents in HTML format.
  *
- * $Horde: framework/MIME/MIME/Viewer/ooo.php,v 1.14.10.7 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/ooo.php,v 1.14.10.8 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Marko Djukic <marko@oblo.com>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/pdf.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/pdf.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/pdf.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/pdf.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * 'application/pdf' enabling web browsers with a PDF viewer plugin to view
  * the PDF file inside the browser.
  *
- * $Horde: framework/MIME/MIME/Viewer/pdf.php,v 1.3.12.5 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/pdf.php,v 1.3.12.6 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/php.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/php.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/php.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/php.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
  * The MIME_Viewer_php class renders out syntax-highlighted PHP code
  * in HTML format.
  *
- * $Horde: framework/MIME/MIME/Viewer/php.php,v 1.22.10.8 2006/06/01 03:08:53 chuck Exp $
+ * $Horde: framework/MIME/MIME/Viewer/php.php,v 1.22.10.9 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/plain.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/plain.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/plain.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/plain.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,10 +3,10 @@
  * The MIME_Viewer_plain class renders out plain text with URLs made
  * into hyperlinks (if viewing inline).
  *
- * $Horde: framework/MIME/MIME/Viewer/plain.php,v 1.18.6.10 2006/01/23 15:35:06 slusarz Exp $
+ * $Horde: framework/MIME/MIME/Viewer/plain.php,v 1.18.6.11 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@horde.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/rar.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/rar.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/rar.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/rar.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,10 +3,10 @@
  * The MIME_Viewer_rar class renders out the contents of .rar archives in HTML
  * format.
  *
- * $Horde: framework/MIME/MIME/Viewer/rar.php,v 1.18.10.9 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/rar.php,v 1.18.10.10 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
- * Copyright 2002-2006 Michael Cochrane <mike@graftonhall.co.nz>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 2002-2007 Michael Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/report.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/report.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/report.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/report.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_report class is a wrapper used to load the appropriate
  * MIME_Viewer for multipart/report data (RFC 3462).
  *
- * $Horde: framework/MIME/MIME/Viewer/report.php,v 1.6.10.6 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/report.php,v 1.6.10.7 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/rfc822.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/rfc822.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/rfc822.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/rfc822.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_rfc822 class renders out messages from the
  * message/rfc822 content type.
  *
- * $Horde: framework/MIME/MIME/Viewer/rfc822.php,v 1.8.10.8 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/rfc822.php,v 1.8.10.10 2007/03/01 07:10:30 slusarz Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
@@ -81,7 +81,7 @@
                 if (is_array($headers[$key])) {
                     $headers[$key] = $headers[$key][0];
                 }
-                $header_output[] = '<strong>' . $val . ':</strong> ' . $headers[$key];
+                $header_output[] = '<strong>' . $val . ':</strong> ' . htmlspecialchars($headers[$key]);
             }
         }
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/richtext.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/richtext.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/richtext.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/richtext.php	2007-03-14 20:59:19.000000000 +0100
@@ -24,9 +24,9 @@
  * <indentright>, <outdent>, <outdentright>, <samepage>, <iso-8859-X>,
  * <us-ascii>,
  *
- * $Horde: framework/MIME/MIME/Viewer/richtext.php,v 1.4.10.7 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/richtext.php,v 1.4.10.8 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2004-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2004-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/rpm.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/rpm.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/rpm.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/rpm.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_rpm class renders out lists of files in RPM
  * packages by using the rpm tool to query the package.
  *
- * $Horde: framework/MIME/MIME/Viewer/rpm.php,v 1.12.10.7 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/rpm.php,v 1.12.10.8 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/security.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/security.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/security.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/security.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,9 +4,9 @@
  * MIME_Viewer for secure multipart messages (defined by RFC 1847). This
  * class handles multipart/signed and multipart/encrypted data.
  *
- * $Horde: framework/MIME/MIME/Viewer/security.php,v 1.6.10.5 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/security.php,v 1.6.10.6 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/simple.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/simple.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/simple.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/simple.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_simple class renders out plain text without any
  * modifications.
  *
- * $Horde: framework/MIME/MIME/Viewer/simple.php,v 1.1.6.5 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/simple.php,v 1.1.6.6 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2004-2006 Michael Slusarz <slusarz@horde.org>
+ * Copyright 2004-2007 Michael Slusarz <slusarz@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/source.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/source.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/source.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/source.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The MIME_Viewer_source class is a class for any viewer that wants
  * to provide line numbers to extend.
  *
- * $Horde: framework/MIME/MIME/Viewer/source.php,v 1.9.10.9 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/source.php,v 1.9.10.10 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/srchighlite.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/srchighlite.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/srchighlite.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/srchighlite.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,9 +8,9 @@
  *
  * Source-highlight: http://www.gnu.org/software/src-highlite/
  *
- * $Horde: framework/MIME/MIME/Viewer/srchighlite.php,v 1.14.10.8 2006/06/01 03:08:53 chuck Exp $
+ * $Horde: framework/MIME/MIME/Viewer/srchighlite.php,v 1.14.10.9 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2003-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2003-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/tgz.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/tgz.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/tgz.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/tgz.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,10 +2,10 @@
 /**
  * The MIME_Viewer_tgz class renders out plain or gzipped tarballs in HTML.
  *
- * $Horde: framework/MIME/MIME/Viewer/tgz.php,v 1.37.10.13 2006/01/26 10:22:46 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/tgz.php,v 1.37.10.14 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
- * Copyright 2002-2006 Michael Cochrane <mike@graftonhall.co.nz>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 2002-2007 Michael Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/tnef.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/tnef.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/tnef.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/tnef.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,10 +2,10 @@
 /**
  * The MIME_Viewer_tnef class allows MS-TNEF attachments to be displayed.
  *
- * $Horde: framework/MIME/MIME/Viewer/tnef.php,v 1.13.10.9 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/tnef.php,v 1.13.10.10 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2002-2006 Jan Schneider <jan@horde.org>
- * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2002-2007 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/vcard.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/vcard.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/vcard.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/vcard.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * The MIME_Viewer_vcard class renders out vCards in HTML format.
  *
- * $Horde: framework/MIME/MIME/Viewer/vcard.php,v 1.34.10.7 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/vcard.php,v 1.34.10.11 2007/03/14 15:58:41 jan Exp $
  *
- * Copyright 2002-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -55,13 +55,12 @@
             }
         }
 
-        $html  = Util::bufferOutput('include', $registry->get('templates', 'horde') . '/common-header.inc');
         $html .= '<table cellspacing="1" border="0" cellpadding="1">';
         if (!is_null($import_msg)) {
             $html .= '<tr><td colspan="2" class="header">' . $import_msg . '</td></tr><tr><td>&nbsp;</td></tr>';
         } elseif ($registry->hasMethod('contacts/import') &&
                   $registry->hasMethod('contacts/sources')) {
-            $html .= '<tr><td colspan="2" class="header"><form action="' . $_SERVER['PHP_SELF'] . '" method="get" name="vcard_import">' . Util::formInput();
+            $html .= '<tr><td colspan="2" class="smallheader"><form action="' . $_SERVER['PHP_SELF'] . '" method="get" name="vcard_import">' . Util::formInput();
             foreach ($_GET as $key => $val) {
                 $html .= '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '" />';
             }
@@ -179,6 +178,9 @@
 
             foreach ($numbers as $number) {
                 if (isset($number['params']['TYPE'])) {
+                    if (!is_array($number['params']['TYPE'])) {
+                        $number['params']['TYPE'] = array($number['params']['TYPE']);
+                    }
                     foreach ($number['params']['TYPE'] as $type) {
                         $number['params'][String::upper($type)] = true;
                     }
@@ -237,6 +239,7 @@
             $org = $vc->getAttributeValues('ORG');
             if (!is_a($org, 'PEAR_Error')) {
                 $html .= $this->_row(_("Company"), $org[0]);
+                $html .= $this->_row(_("Department"), $org[1]);
             }
 
             $notes = $vc->getAttributeValues('NOTE');
@@ -250,10 +253,10 @@
             }
         }
 
-        $html .= '</table>';
-        $html .= Util::bufferOutput('include', $registry->get('templates', 'horde') . '/common-footer.inc');
-
-        return $html;
+        return Util::bufferOutput('include', $registry->get('templates', 'horde') . '/common-header.inc') .
+               $html .
+               '</table>' .
+               Util::bufferOutput('include', $registry->get('templates', 'horde') . '/common-footer.inc');
     }
 
     function _row($label, $value)
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/webcpp.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/webcpp.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/webcpp.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/webcpp.php	2007-03-14 20:59:19.000000000 +0100
@@ -5,9 +5,9 @@
  *
  * Web C Plus plus: http://webcpp.sourceforge.net/
  *
- * $Horde: framework/MIME/MIME/Viewer/webcpp.php,v 1.11.10.8 2006/01/01 21:28:25 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/webcpp.php,v 1.11.10.9 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/zip.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/zip.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer/zip.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer/zip.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,10 +3,10 @@
  * The MIME_Viewer_zip class renders out the contents of ZIP files in HTML
  * format.
  *
- * $Horde: framework/MIME/MIME/Viewer/zip.php,v 1.30.10.10 2006/02/10 13:54:04 jan Exp $
+ * $Horde: framework/MIME/MIME/Viewer/zip.php,v 1.30.10.11 2007/01/02 13:54:26 jan Exp $
  *
- * Copyright 2000-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2002-2006 Michael Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2000-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Michael Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME/Viewer.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME/Viewer.php	2007-03-14 20:59:19.000000000 +0100
@@ -5,9 +5,9 @@
  * set of MIME_Viewer_* drivers which handle the actual rendering,
  * and also a configuration file to map MIME types to drivers.
  *
- * $Horde: framework/MIME/MIME/Viewer.php,v 1.64.10.10 2006/05/05 03:30:23 slusarz Exp $
+ * $Horde: framework/MIME/MIME/Viewer.php,v 1.64.10.12 2007/01/02 13:54:25 jan Exp $
  *
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -60,21 +60,21 @@
      */
     function &factory(&$mime_part, $mime_type = null)
     {
+        $viewer = false;
+
         /* Check that we have a valid MIME_Part object */
         if (!is_a($mime_part, 'MIME_Part')) {
-            return false;
+            return $viewer;
         }
 
         /* Determine driver type from the MIME type */
         if (empty($mime_type)) {
             $mime_type = $mime_part->getType();
             if (empty($mime_type)) {
-                return false;
+                return $viewer;
             }
         }
 
-        $viewer = false;
-
         /* Spawn the relevant driver, and return it (or false on failure) */
         if (($ob = MIME_Viewer::includeDriver($mime_type))) {
             $class = (($ob->module == 'horde') ? '' : $ob->module . '_') . 'MIME_Viewer_' . $ob->driver;
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/MIME.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/MIME.php	2007-03-14 20:59:19.000000000 +0100
@@ -47,9 +47,9 @@
 /**
  * The MIME:: class provides methods for dealing with MIME standards.
  *
- * $Horde: framework/MIME/MIME.php,v 1.139.4.20 2006/03/24 04:29:52 chuck Exp $
+ * $Horde: framework/MIME/MIME.php,v 1.139.4.23 2007/01/11 23:45:39 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -260,6 +260,9 @@
         $text = '';
         if (is_array($addr_arr)) {
             foreach ($addr_arr as $addr) {
+                if (strlen($text) != 0) {
+                    $text .= ', ';
+                }
                 // Check for groups.
                 if (!empty($addr->groupname)) {
                     $text .= MIME::encode($addr->groupname, $charset) . ': ' . MIME::encodeAddress($addr->addresses) . ';';
@@ -275,9 +278,6 @@
                     }
                     $personal = MIME::encode($addr->personal, $charset);
                 }
-                if (strlen($text) != 0) {
-                    $text .= ', ';
-                }
                 $text .= MIME::trimEmailAddress(MIME::rfc822WriteAddress($addr->mailbox, $addr->host, $personal));
             }
         }
@@ -389,7 +389,7 @@
             $string = str_replace($charset . "'" . $lang . "'", '', $string);
         }
 
-        $lines = preg_split('/' . preg_quote($attribute) . '(?:\*\d)*/', $string);
+        $lines = preg_split('/\s*' . preg_quote($attribute) . '(?:\*\d)*/', $string);
         foreach ($lines as $line) {
             $pos = strpos($line, '*=');
             if ($pos === 0) {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile/Renderer/html.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile/Renderer/html.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile/Renderer/html.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile/Renderer/html.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,9 +3,9 @@
  * Horde_Mobile_Renderer:: output module for simple HTML and
  * Imode/Avantgo/similar devices.
  *
- * $Horde: framework/Mobile/Mobile/Renderer/html.php,v 1.28.10.6 2006/01/01 21:28:26 jan Exp $
+ * $Horde: framework/Mobile/Mobile/Renderer/html.php,v 1.28.10.7 2007/01/02 13:54:27 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile/Renderer/wml.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile/Renderer/wml.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile/Renderer/wml.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile/Renderer/wml.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Horde_Mobile_Renderer:: output module for WML (Wireless Markup Language).
  *
- * $Horde: framework/Mobile/Mobile/Renderer/wml.php,v 1.32.10.7 2006/02/24 20:40:38 chuck Exp $
+ * $Horde: framework/Mobile/Mobile/Renderer/wml.php,v 1.32.10.8 2007/01/02 13:54:27 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile/Renderer.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile/Renderer.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile/Renderer.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile/Renderer.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,9 +3,9 @@
  * Horde_Mobile_Renderer:: framework for mobile device markup
  * renderers.
  *
- * $Horde: framework/Mobile/Mobile/Renderer.php,v 1.15.10.8 2006/01/01 21:28:26 jan Exp $
+ * $Horde: framework/Mobile/Mobile/Renderer.php,v 1.15.10.9 2007/01/02 13:54:27 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Mobile.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Mobile.php	2007-03-14 20:59:23.000000000 +0100
@@ -105,9 +105,9 @@
  *
  * $myPage->render();
  *
- * $Horde: framework/Mobile/Mobile.php,v 1.32.10.9 2006/06/26 06:27:23 selsky Exp $
+ * $Horde: framework/Mobile/Mobile.php,v 1.32.10.10 2007/01/02 13:54:27 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/NLS/GeoIP.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/NLS/GeoIP.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/NLS/GeoIP.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/NLS/GeoIP.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,7 +3,7 @@
  * Horde optimized interface to the MaxMind IP Address->Country
  * listing.
  *
- * $Horde: framework/NLS/NLS/GeoIP.php,v 1.10.10.7 2006/06/27 15:19:12 slusarz Exp $
+ * $Horde: framework/NLS/NLS/GeoIP.php,v 1.10.10.8 2007/01/02 13:54:28 jan Exp $
  *
  * Based on PHP geoip.inc library by MaxMind LLC:
  *   http://www.maxmind.com/download/geoip/api/php/
@@ -12,7 +12,7 @@
  * 2002 by jim winstead <jimw@apache.org>
  *
  * Copyright (C) 2003 MaxMind LLC
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/NLS.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/NLS.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/NLS.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/NLS.php	2007-03-14 20:59:19.000000000 +0100
@@ -4,12 +4,12 @@
  * methods for handling language detection and selection, timezones, and
  * hostname->country lookups.
  *
- * $Horde: framework/NLS/NLS.php,v 1.82.4.13 2006/01/24 07:50:26 selsky Exp $
+ * $Horde: framework/NLS/NLS.php,v 1.82.4.15 2007/01/02 13:54:28 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2002-2006 Jan Schneider <jan@horde.org>
- * Copyright 2003-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -35,13 +35,13 @@
         $lang = Util::getFormData('new_lang');
 
         /* First, check if language pref is locked and, if so, set it to its
-           value */
+         * value */
         if (isset($prefs) && $prefs->isLocked('language')) {
             $language = $prefs->getValue('language');
         /* Check if the user selected a language from the login screen */
-        } elseif (!empty($lang)) {
+        } elseif (!empty($lang) && NLS::isValid($lang)) {
             $language = $lang;
-        /* Check if we have a language set in a cookie */
+        /* Check if we have a language set in the session */
         } elseif (isset($_SESSION['horde_language'])) {
             $language = $_SESSION['horde_language'];
         /* Use site-wide default, if one is defined */
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Event.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Event.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Event.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Event.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,9 +3,9 @@
  * The Notification_Event:: class provides a container for passing
  * messages to Notification_Listener classes.
  *
- * $Horde: framework/Notification/Notification/Event.php,v 1.5.2.5 2006/01/01 21:28:29 jan Exp $
+ * $Horde: framework/Notification/Notification/Event.php,v 1.5.2.6 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2002-2006 Hans Lellelid <hans@velum.net>
+ * Copyright 2002-2007 Hans Lellelid <hans@velum.net>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/audio.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/audio.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/audio.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/audio.php	2007-03-14 20:59:23.000000000 +0100
@@ -6,9 +6,9 @@
  * The Notification_Listener_audio:: class provides functionality for
  * inserting embedded audio notifications from the stack into the page.
  *
- * $Horde: framework/Notification/Notification/Listener/audio.php,v 1.3.2.2 2006/01/01 21:28:30 jan Exp $
+ * $Horde: framework/Notification/Notification/Listener/audio.php,v 1.3.2.3 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2005-2006 Cronosys, LLC <http://www.cronosys.com/>
+ * Copyright 2005-2007 Cronosys, LLC <http://www.cronosys.com/>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/javascript.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/javascript.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/javascript.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/javascript.php	2007-03-14 20:59:23.000000000 +0100
@@ -6,9 +6,9 @@
  * The Notification_Listener_javascript:: class provides functionality for
  * inserting javascript code from the message stack into the page.
  *
- * $Horde: framework/Notification/Notification/Listener/javascript.php,v 1.7.10.6 2006/01/01 21:28:30 jan Exp $
+ * $Horde: framework/Notification/Notification/Listener/javascript.php,v 1.7.10.7 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/mobile.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/mobile.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/mobile.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/mobile.php	2007-03-14 20:59:23.000000000 +0100
@@ -6,9 +6,9 @@
  * The Notification_Listener_mobile:: class provides functionality for
  * displaying messages from the message stack on mobile devices.
  *
- * $Horde: framework/Notification/Notification/Listener/mobile.php,v 1.8.10.8 2006/01/01 21:28:30 jan Exp $
+ * $Horde: framework/Notification/Notification/Listener/mobile.php,v 1.8.10.9 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2003-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2003-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/status.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/status.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener/status.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener/status.php	2007-03-14 20:59:23.000000000 +0100
@@ -6,9 +6,9 @@
  * The Notification_Listener_status:: class provides functionality for
  * displaying messages from the message stack as a status line.
  *
- * $Horde: framework/Notification/Notification/Listener/status.php,v 1.29.2.5 2006/01/01 21:28:30 jan Exp $
+ * $Horde: framework/Notification/Notification/Listener/status.php,v 1.29.2.6 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2001-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2001-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification/Listener.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification/Listener.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,9 +3,9 @@
  * The Notification_Listener:: class provides functionality for displaying
  * messages from the message stack as a status line.
  *
- * $Horde: framework/Notification/Notification/Listener.php,v 1.16.2.7 2006/01/01 21:28:29 jan Exp $
+ * $Horde: framework/Notification/Notification/Listener.php,v 1.16.2.11 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -85,27 +85,40 @@
         } else {
             require_once dirname(__FILE__) . '/Event.php';
             $ob = @unserialize($message['event']);
-            if (!method_exists($ob, 'getMessage')) {
+            if (!is_callable(array($ob, 'getMessage'))) {
                 if (isset($ob->_message)) {
-                    $ob = &new Notification_Event($ob->_message);
+                    $ob = new Notification_Event($ob->_message);
                 }
             }
         }
 
         /* If we've failed to create a valid Notification_Event object
          * (or subclass object) so far, return a PEAR_Error. */
-        if (!method_exists($ob, 'getMessage')) {
+        if (!is_callable(array($ob, 'getMessage'))) {
             $ob = PEAR::raiseError('Unable to decode message event: ' . $message['event']);
         }
 
         /* Specially handle PEAR_Error objects and add userinfo if
          * it's there. */
-        if (method_exists($ob, 'getUserInfo')) {
+        if (is_callable(array($ob, 'getUserInfo'))) {
             $userinfo = $ob->getUserInfo();
             if ($userinfo) {
                 if (is_array($userinfo)) {
-                    $userinfo = @implode(', ', $userinfo);
+                    $userinfo_elts = array();
+                    foreach ($userinfo as $userinfo_elt) {
+                        if (is_scalar($userinfo_elt)) {
+                            $userinfo_elts[] = $userinfo_elt;
+                        } elseif (is_object($userinfo_elt)) {
+                            if (is_callable(array($userinfo_elt, '__toString'))) {
+                                $userinfo_elts[] = $userinfo_elt->__toString();
+                            } elseif (is_callable(array($userinfo_elt, 'getMessage'))) {
+                                $userinfo_elts[] = $userinfo_elt->getMessage();
+                            }
+                        }
+                    }
+                    $userinfo = implode(', ', $userinfo_elts);
                 }
+
                 $ob->_message = $ob->getMessage() . ' : ' . $userinfo;
             }
         }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Notification.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Notification.php	2007-03-14 20:59:23.000000000 +0100
@@ -4,9 +4,9 @@
  * raising and showing messages of different types and to different
  * listeners.
  *
- * $Horde: framework/Notification/Notification.php,v 1.46.2.11 2006/01/18 15:19:01 jan Exp $
+ * $Horde: framework/Notification/Notification.php,v 1.46.2.12 2007/01/02 13:54:33 jan Exp $
  *
- * Copyright 2001-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2001-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Perms/datatree.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Perms/datatree.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Perms/datatree.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Perms/datatree.php	2007-03-14 20:59:22.000000000 +0100
@@ -6,10 +6,10 @@
  * The Perms_datatree:: class provides a DataTree driver for the Horde
  * permissions system.
  *
- * $Horde: framework/Perms/Perms/datatree.php,v 1.6.2.12 2006/07/20 18:50:05 chuck Exp $
+ * $Horde: framework/Perms/Perms/datatree.php,v 1.6.2.13 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Perms/UI.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Perms/UI.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Perms/UI.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Perms/UI.php	2007-03-14 20:59:22.000000000 +0100
@@ -3,9 +3,9 @@
  * The Perms_UI:: class provides UI methods for the Horde permissions
  * system.
  *
- * $Horde: framework/Perms/Perms/UI.php,v 1.27.2.8 2006/01/01 21:28:31 jan Exp $
+ * $Horde: framework/Perms/Perms/UI.php,v 1.27.2.9 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Perms.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Perms.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Perms.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Perms.php	2007-03-14 20:59:22.000000000 +0100
@@ -21,10 +21,10 @@
 /**
  * The Perms:: class provides the Horde permissions system.
  *
- * $Horde: framework/Perms/Perms.php,v 1.80.10.9 2006/05/05 04:08:59 selsky Exp $
+ * $Horde: framework/Perms/Perms.php,v 1.80.10.10 2007/01/02 13:54:34 jan Exp $
  *
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/CategoryManager.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/CategoryManager.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/CategoryManager.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/CategoryManager.php	2007-03-14 20:59:22.000000000 +0100
@@ -3,9 +3,9 @@
  * Class for handling a list of categories stored in a user's
  * preferences.
  *
- * $Horde: framework/Prefs/Prefs/CategoryManager.php,v 1.11.10.5 2006/01/01 21:28:32 jan Exp $
+ * $Horde: framework/Prefs/Prefs/CategoryManager.php,v 1.11.10.6 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 2004-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2004-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/imsp.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/imsp.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/imsp.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/imsp.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Preference storage implementation for an IMSP server.
  *
- * $Horde: framework/Prefs/Prefs/imsp.php,v 1.1.10.11 2006/02/28 05:59:19 slusarz Exp $
+ * $Horde: framework/Prefs/Prefs/imsp.php,v 1.1.10.12 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 2004-2006 Michael Rubinsky <mrubinsk@horde.org>
+ * Copyright 2004-2007 Michael Rubinsky <mrubinsk@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/kolab.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/kolab.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/kolab.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/kolab.php	2007-03-14 20:59:23.000000000 +0100
@@ -7,9 +7,9 @@
  * Prefs_ldap LDAP authentication object, and simply provides parameters to it
  * based on the global Kolab configuration.
  *
- * $Horde: framework/Prefs/Prefs/kolab.php,v 1.1.10.8 2006/06/21 20:09:07 jan Exp $
+ * $Horde: framework/Prefs/Prefs/kolab.php,v 1.1.10.10 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 2004-2006 Stuart Binge <s.binge@codefusion.co.za>
+ * Copyright 2004-2007 Stuart Binge <s.binge@codefusion.co.za>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -32,14 +32,14 @@
     function Prefs_kolab($user, $password, $scope = '',
                          $params = array(), $caching = false)
     {
-        $params['hostspec'] = $GLOBALS['conf']['kolab']['ldap']['server'];
-        $params['port'] = $GLOBALS['conf']['kolab']['ldap']['port'];
-        $params['version'] = '3';
-        $params['basedn'] = $GLOBALS['conf']['kolab']['ldap']['basedn'];
-        $params['fetchdn'] = true;
-        $params['searchdn'] = $GLOBALS['conf']['kolab']['ldap']['phpdn'];
-        $params['searchpass'] = $GLOBALS['conf']['kolab']['ldap']['phppw'];
-        $params['uid'] = array('mail', 'uid');
+        $params = array('hostspec' => $GLOBALS['conf']['kolab']['ldap']['server'],
+                        'port' => $GLOBALS['conf']['kolab']['ldap']['port'],
+                        'version' => '3',
+                        'basedn' => $GLOBALS['conf']['kolab']['ldap']['basedn'],
+                        'fetchdn' => true,
+                        'searchdn' => $GLOBALS['conf']['kolab']['ldap']['phpdn'],
+                        'searchpass' => $GLOBALS['conf']['kolab']['ldap']['phppw'],
+                        'uid' => array('mail', 'uid'));
 
         parent::Prefs_ldap($user, $password, $scope, $params, $caching);
     }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/ldap.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/ldap.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/ldap.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/ldap.php	2007-03-14 20:59:23.000000000 +0100
@@ -47,9 +47,9 @@
  * </pre>
  *
  *
- * $Horde: framework/Prefs/Prefs/ldap.php,v 1.85.10.20 2006/06/21 20:07:55 jan Exp $
+ * $Horde: framework/Prefs/Prefs/ldap.php,v 1.85.10.22 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -155,7 +155,7 @@
             Horde::logMessage(
                 sprintf('Failed to open an LDAP connection to %s.',
                         $this->_params['hostspec']),
-                __FILE__, __LINE__);
+                __FILE__, __LINE__, PEAR_LOG_ERR);
             return false;
         }
 
@@ -166,9 +166,9 @@
                 Horde::logMessage(
                     sprintf('Set LDAP protocol version to %d failed: [%d] %s',
                             $this->_params['version'],
-                            ldap_errno($this->_connection),
-                            ldap_error($this->_connection)),
-                            __FILE__, __LINE__);
+                            ldap_errno($conn),
+                            ldap_error($conn)),
+                    __FILE__, __LINE__, PEAR_LOG_ERR);
             }
         }
 
@@ -178,12 +178,14 @@
             $bind = @ldap_bind($conn, $this->_params['searchdn'],
                                $this->_params['searchpass']);
             if (!$bind) {
-                return PEAR::raiseError(sprintf('Bind to server %s:%d with DN %s failed: [%d] %s',
-                                                $this->_params['hostspec'],
-                                                $this->_params['port'],
-                                                $this->_params['searchdn'],
-                                                ldap_errno($this->_connection),
-                                                ldap_error($this->_connection)));
+                Horde::logMessage(sprintf('Bind to server %s:%d with DN %s failed: [%d] %s',
+                                          $this->_params['hostspec'],
+                                          $this->_params['port'],
+                                          $this->_params['searchdn'],
+                                          ldap_errno($conn),
+                                          ldap_error($conn)),
+                                  __FILE__, __LINE__, PEAR_LOG_ERR);
+                return false;
             }
 	}
 
@@ -192,9 +194,9 @@
             !ldap_set_rebind_proc($conn, array($this, '_rebindProc'))) {
             Horde::logMessage(
                 sprintf('Set rebind proc failed: [%d] %s',
-                        ldap_errno($this->_connection),
-                        ldap_error($this->_connection)),
-                __FILE__, __LINE__);
+                        ldap_errno($conn),
+                        ldap_error($conn)),
+                __FILE__, __LINE__, PEAR_LOG_ERR);
             return false;
         }
 
@@ -228,7 +230,7 @@
                             $bind_dn,
                             ldap_errno($this->_connection),
                             ldap_error($this->_connection)),
-                    __FILE__, __LINE__);
+                    __FILE__, __LINE__, PEAR_LOG_ERR);
                 return false;
             }
         }
@@ -255,7 +257,7 @@
             sprintf('Failed to retrieve user\'s DN: [%d] %s',
                     ldap_errno($this->_connection),
                     ldap_error($this->_connection)),
-            __FILE__, __LINE__);
+            __FILE__, __LINE__, PEAR_LOG_ERR);
 
         return false;
     }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/session.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/session.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/session.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/session.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,9 +2,9 @@
 /**
  * Preferences storage implementation for PHP's session implementation.
  *
- * $Horde: framework/Prefs/Prefs/session.php,v 1.32.12.7 2006/05/11 17:13:23 jan Exp $
+ * $Horde: framework/Prefs/Prefs/session.php,v 1.32.12.8 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/sql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/sql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/sql.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/sql.php	2007-03-14 20:59:23.000000000 +0100
@@ -38,9 +38,9 @@
  * The table structure for the Prefs system is in
  * scripts/sql/horde_prefs.sql.
  *
- * $Horde: framework/Prefs/Prefs/sql.php,v 1.91.10.20 2006/04/10 15:58:14 chuck Exp $
+ * $Horde: framework/Prefs/Prefs/sql.php,v 1.91.10.21 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/UI.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/UI.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs/UI.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs/UI.php	2007-03-14 20:59:22.000000000 +0100
@@ -3,9 +3,9 @@
  * Class for auto-generating the preferences user interface and
  * processing the forms.
  *
- * $Horde: framework/Prefs/Prefs/UI.php,v 1.63.2.15 2006/01/12 22:25:14 jan Exp $
+ * $Horde: framework/Prefs/Prefs/UI.php,v 1.63.2.16 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 2001-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2001-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Prefs.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Prefs.php	2007-03-14 20:59:22.000000000 +0100
@@ -48,9 +48,9 @@
  *     'help'   => *Name of the entry in the XML help file*
  * );
  *
- * $Horde: framework/Prefs/Prefs.php,v 1.137.10.27 2006/07/03 17:38:11 chuck Exp $
+ * $Horde: framework/Prefs/Prefs.php,v 1.137.10.29 2007/01/02 13:54:35 jan Exp $
  *
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -324,11 +324,23 @@
             $charset = NLS::getCharset();
         }
 
-        return (isset($this->_prefs[$pref]['v'])) ?
-            ($convert ?
-             $this->convertFromDriver($this->_prefs[$pref]['v'], $charset) :
-             $this->_prefs[$pref]['v']) :
-            null;
+        if (isset($this->_prefs[$pref]['v'])) {
+            if ($convert) {
+                if ($this->isDefault($pref)) {
+                    /* Default values have the current UI charset. */
+                    $value = String::convertCharset($this->_prefs[$pref]['v'], NLS::getCharset(), $charset);
+                } else {
+                    /* Stored values have the backend charset. */
+                    $value = $this->convertFromDriver($this->_prefs[$pref]['v'], $charset);
+                }
+            } else {
+                $value = $this->_prefs[$pref]['v'];
+            }
+        } else {
+            $value = null;
+        }
+
+        return $value;
     }
 
     function __get($name)
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Registry.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Registry.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Registry.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Registry.php	2007-03-14 20:59:22.000000000 +0100
@@ -11,11 +11,11 @@
  * between Horde applications and keeping track of application
  * configuration information.
  *
- * $Horde: framework/Horde/Horde/Registry.php,v 1.243.2.22 2006/05/04 22:35:26 jan Exp $
+ * $Horde: framework/Horde/Horde/Registry.php,v 1.243.2.25 2007/03/13 00:04:45 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 1999-2006 Jon Parise <jon@horde.org>
- * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Jon Parise <jon@horde.org>
+ * Copyright 1999-2007 Anil Madhavapeddy <anil@recoil.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -191,12 +191,12 @@
             $appList = array_keys($this->applications);
             foreach ($appList as $appName) {
                 $app = &$this->applications[$appName];
-                if (($app['status'] == 'heading') ||
-                    ($app['status'] == 'inactive') ||
-                    ($app['status'] == 'admin' && !Auth::isAdmin())) {
+                if ($app['status'] == 'heading') {
                     continue;
                 }
-                if (isset($app['provides'])) {
+                if ($app['status'] != 'inactive' &&
+                    ($app['status'] != 'admin' || Auth::isAdmin()) &&
+                    isset($app['provides'])) {
                     if (is_array($app['provides'])) {
                         foreach ($app['provides'] as $interface) {
                             $this->_interfaces[$interface] = $appName;
@@ -767,8 +767,8 @@
          *  - To all authenticated users if no permission is set on $app.
          *  - To anyone who is allowed by an explicit ACL on $app. */
         if ($checkPerms && !$this->hasPermission($app)) {
-            Horde::logMessage(sprintf('User %s does not have READ permission for %s', Auth::getAuth(), $app), __FILE__, __LINE__, PEAR_LOG_DEBUG);
-            return PEAR::raiseError(sprintf(_("User %s is not authorised for %s."), Auth::getAuth(), $this->applications[$app]['name']), 'permission_denied');
+            Horde::logMessage(sprintf('%s does not have READ permission for %s', Auth::getAuth() ? 'User ' . Auth::getAuth() : 'Guest user', $app), __FILE__, __LINE__, PEAR_LOG_DEBUG);
+            return PEAR::raiseError(sprintf(_('%s is not authorised for %s.'), Auth::getAuth() ? 'User ' . Auth::getAuth() : 'Guest user', $this->applications[$app]['name']), 'permission_denied');
         }
 
         /* Import this application's configuration values. */
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/soap.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/soap.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/soap.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/soap.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The Horde_RPC_soap class provides an SOAP implementation of the
  * Horde RPC system.
  *
- * $Horde: framework/RPC/RPC/soap.php,v 1.13.10.7 2006/01/01 21:28:33 jan Exp $
+ * $Horde: framework/RPC/RPC/soap.php,v 1.13.10.10 2007/01/02 13:54:36 jan Exp $
  *
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -37,14 +37,22 @@
      */
     function Horde_RPC_soap($params = null)
     {
-        if ($params == 'wsdl' || $params == 'disco') {
-            $this->_authorize = false;
+        if ($params !== null) {
+            // BC: $params should be an array, but until 3.1.4 $params required
+            //     a string here.
+            if (is_string($params)) {
+                if (($params == 'wsdl') || ($params == 'disco')) {
+                    $this->_authorize = false;
+                }
+            } else {
+                if (!empty($params['wsdl']) || !empty($params['disco'])) {
+                    $this->_authorize = false;
+                }
+            }
         }
 
         parent::Horde_RPC();
 
-        global $registry;
-
         require_once 'SOAP/Server.php';
         $this->_server = &new SOAP_Server();
         $this->_server->_auto_translation = true;
@@ -126,7 +134,7 @@
      *
      * @param string  The raw request string.
      * @param string  String specifying what kind of data to return. Defaults
-     *                to SOAP request. Possible other values: "wdsl" and
+     *                to SOAP request. Possible other values: "wsdl" and
      *                "disco".
      *
      * @return string  The XML encoded response from the server.
@@ -145,7 +153,10 @@
         } else {
             require_once 'SOAP/Disco.php';
             $disco = new SOAP_DISCO_Server($this->_server, 'horde');
-            if ($params == 'wsdl') {
+            // BC: $params should be an array, but until 3.1.4 $params
+            //     required a string here.
+            if ((is_string($params) && $params == 'wsdl') ||
+                (is_array($params) && !empty($params['wsdl']))) {
                 $this->_setupDispatchMap();
                 $output = $disco->getWSDL();
             } else {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/syncml.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/syncml.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/syncml.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/syncml.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,10 +8,10 @@
  * The Horde_RPC_syncml class provides a SyncML implementation of the Horde
  * RPC system.
  *
- * $Horde: framework/RPC/RPC/syncml.php,v 1.18.10.7 2006/05/01 12:05:13 jan Exp $
+ * $Horde: framework/RPC/RPC/syncml.php,v 1.18.10.8 2007/01/02 13:54:36 jan Exp $
  *
- * Copyright 2003-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2003-2006 Anthony Mills <amills@pyramid6.com>
+ * Copyright 2003-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2003-2007 Anthony Mills <amills@pyramid6.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/syncml_wbxml.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/syncml_wbxml.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/syncml_wbxml.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/syncml_wbxml.php	2007-03-14 20:59:19.000000000 +0100
@@ -8,10 +8,10 @@
  * The Horde_RPC_syncml_wbxml class provides a SyncML implementation of the
  * Horde RPC system using WBXML encoding.
  *
- * $Horde: framework/RPC/RPC/syncml_wbxml.php,v 1.11.10.6 2006/01/01 21:28:33 jan Exp $
+ * $Horde: framework/RPC/RPC/syncml_wbxml.php,v 1.11.10.7 2007/01/02 13:54:36 jan Exp $
  *
- * Copyright 2003-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2003-2006 Anthony Mills <amills@pyramid6.com>
+ * Copyright 2003-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2003-2007 Anthony Mills <amills@pyramid6.com>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/webdav.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/webdav.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/webdav.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/webdav.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
  * The Horde_RPC_webdav class provides a WebDAV implementation of the
  * Horde RPC system.
  *
- * $Horde: framework/RPC/RPC/webdav.php,v 1.1.12.6 2006/01/01 21:28:33 jan Exp $
+ * $Horde: framework/RPC/RPC/webdav.php,v 1.1.12.7 2007/01/02 13:54:36 jan Exp $
  *
- * Copyright 2004-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2004-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/xmlrpc.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/xmlrpc.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC/xmlrpc.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC/xmlrpc.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * The Horde_RPC_xmlrpc class provides an XMLRPC implementation of the
  * Horde RPC system.
  *
- * $Horde: framework/RPC/RPC/xmlrpc.php,v 1.9.10.8 2006/07/01 04:54:16 chuck Exp $
+ * $Horde: framework/RPC/RPC/xmlrpc.php,v 1.9.10.9 2007/01/02 13:54:36 jan Exp $
  *
- * Copyright 2002-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/RPC.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/RPC.php	2007-03-14 20:59:19.000000000 +0100
@@ -17,9 +17,9 @@
  *                                      'pass' => Auth::getCredential('password')));
  * </code>
  *
- * $Horde: framework/RPC/RPC.php,v 1.7.10.8 2006/01/01 21:28:33 jan Exp $
+ * $Horde: framework/RPC/RPC.php,v 1.7.10.11 2007/03/09 17:19:29 jan Exp $
  *
- * Copyright 2002-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -39,13 +39,27 @@
     var $_authorize = true;
 
     /**
-     * RPC server constructor
+     * Whether we should exit if auth fails instead of giving the user a
+     * chance to auth.
      *
-     * @access private
-     * @return object   An RPC server instance.
+     * @var boolean
+     */
+    var $_noauth = false;
+
+    /**
+     * RPC server constructor.
+     *
+     * @param array $params  A hash containing any additional configuration or
+     *                       connection parameters a subclass might need.
+     *
+     * @return Horde_RPC  An RPC server instance.
      */
-    function Horde_RPC()
+    function Horde_RPC($params = array())
     {
+        if (!empty($params['noauth'])) {
+            $this->_noauth = true;
+        }
+
         register_shutdown_function(array($this, 'shutdown'));
     }
 
@@ -79,11 +93,19 @@
         if (isset($_SERVER['PHP_AUTH_USER'])) {
             $user = $_SERVER['PHP_AUTH_USER'];
             $pass = $_SERVER['PHP_AUTH_PW'];
+        } elseif (isset($_SERVER['Authorization'])) {
+            $hash = str_replace('Basic ', '', $_SERVER['Authorization']);
+            $hash = base64_decode($hash);
+            if (strpos($hash, ':') !== false) {
+                list($user, $pass) = explode(':', $hash, 2);
+            }
         }
 
         if (!isset($user)
             || !$auth->authenticate($user, array('password' => $pass))) {
-            header('WWW-Authenticate: Basic realm="Horde RPC"');
+            if (!$this->_noauth) {
+                header('WWW-Authenticate: Basic realm="Horde RPC"');
+            }
             header('HTTP/1.0 401 Unauthorized');
             echo '401 Unauthorized';
             exit;
@@ -187,7 +209,7 @@
      *                       connection parameters a subclass might need.
      *
      * @return Horde_RPC  The newly created concrete Horde_RPC server instance,
-     *                    or a PEAR_Error on an error.
+     *                    or PEAR_Error on error.
      */
     function &factory($driver, $params = null)
     {
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Secret.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Secret.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Secret.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Secret.php	2007-03-14 20:59:23.000000000 +0100
@@ -6,9 +6,9 @@
  * The Secret:: functions use the Horde Cipher:: class if mcrypt is not
  * available.
  *
- * $Horde: framework/Secret/Secret.php,v 1.45.10.7 2006/03/02 05:25:10 slusarz Exp $
+ * $Horde: framework/Secret/Secret.php,v 1.45.10.8 2007/01/02 13:54:37 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Serialize.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Serialize.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Serialize.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Serialize.php	2007-03-14 20:59:23.000000000 +0100
@@ -16,17 +16,15 @@
 define('SERIALIZE_RAW', 12);
 define('SERIALIZE_URL', 13);
 define('SERIALIZE_UTF7', 14);
-
-/** Use SERIALIZE_UTF7 and SERIALIZE_BASIC stacked.  */
 define('SERIALIZE_UTF7_BASIC', 15);
-
+define('SERIALIZE_LZF', 17);
 
 /**
  * The Serialize:: class provides various methods of encapsulating data.
  *
- * $Horde: framework/Serialize/Serialize.php,v 1.25.10.9 2006/01/01 21:28:34 jan Exp $
+ * $Horde: framework/Serialize/Serialize.php,v 1.25.10.13 2007/03/10 08:37:58 slusarz Exp $
  *
- * Copyright 2001-2006 Stephane Huther <shuther@bigfoot.com>
+ * Copyright 2001-2007 Stephane Huther <shuther@bigfoot.com>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -98,8 +96,12 @@
         case SERIALIZE_NONE:
             break;
 
+        // $params['level'] = Level of compression (default: 3)
+        // $params['workfactor'] = How does compression phase behave when given
+        //                         worst case, highly repetitive, input data
+        //                         (default: 30)
         case SERIALIZE_BZIP:
-            $data = bzcompress($data, 9, 30);
+            $data = bzcompress($data, isset($params['level']) ? $params['level'] : 3, isset($params['workfactor']) ? $params['workfactor'] : 30);
             break;
 
         case SERIALIZE_WDDX:
@@ -118,24 +120,27 @@
             $data = imap_utf8($data);
             break;
 
+        // $params['level'] = Level of compression (default: 3)
         case SERIALIZE_GZ_DEFLATE:
-            $data = gzdeflate($data, 9);
+            $data = gzdeflate($data, isset($params['level']) ? $params['level'] : 3);
             break;
 
         case SERIALIZE_BASIC:
             $data = serialize($data);
             break;
 
+        // $params['level'] = Level of compression (default: 3)
         case SERIALIZE_GZ_COMPRESS:
-            $data = gzcompress($data, 9);
+            $data = gzcompress($data, isset($params['level']) ? $params['level'] : 3);
             break;
 
         case SERIALIZE_BASE64:
             $data = base64_encode($data);
             break;
 
+        // $params['level'] = Level of compression (default: 3)
         case SERIALIZE_GZ_ENCOD:
-            $data = gzencode($data, 9);
+            $data = gzencode($data, isset($params['level']) ? $params['level'] : 3);
             break;
 
         case SERIALIZE_RAW:
@@ -152,15 +157,21 @@
             $data = $sql2xml->getXML($data);
             break;
 
+        // $params = Source character set
         case SERIALIZE_UTF7:
             require_once 'Horde/String.php';
             $data = String::convertCharset($data, $params, 'utf-7');
             break;
 
+        // $params = Source character set
         case SERIALIZE_UTF7_BASIC:
             Horde_Serialize::_serialize($data, SERIALIZE_UTF7, $params);
             Horde_Serialize::_serialize($data, SERIALIZE_BASIC, $params);
             break;
+
+        case SERIALIZE_LZF:
+            $data = lzf_compress($data);
+            break;
         }
     }
 
@@ -261,15 +272,21 @@
             $data = gzuncompress($data);
             break;
 
+        // $params = Output character set
         case SERIALIZE_UTF7:
             require_once 'Horde/String.php';
             $data = String::convertCharset($data, 'utf-7', $params);
             break;
 
+        // $params = Output character set
         case SERIALIZE_UTF7_BASIC:
             Horde_Serialize::_unserialize($data, SERIALIZE_BASIC, $params);
             Horde_Serialize::_unserialize($data, SERIALIZE_UTF7, $params);
             break;
+
+        case SERIALIZE_LZF:
+            $data = @lzf_decompress($data);
+            break;
         }
     }
 
@@ -302,6 +319,9 @@
         case SERIALIZE_SQLXML:
             return @include_once 'XML/sql2xml.php';
 
+        case SERIALIZE_LZF:
+            return Util::extensionExists('lzf');
+
         case SERIALIZE_NONE:
         case SERIALIZE_BASIC:
         case SERIALIZE_BASE64:
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/dbm.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/dbm.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/dbm.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/dbm.php	2007-03-14 20:59:23.000000000 +0100
@@ -5,9 +5,9 @@
  *
  * No additional configuration parameters needed.
  *
- * $Horde: framework/SessionHandler/SessionHandler/dbm.php,v 1.9.12.7 2006/01/01 21:28:34 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/dbm.php,v 1.9.12.8 2007/01/02 13:54:38 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/memcache.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/memcache.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/memcache.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/memcache.php	2007-03-14 20:59:23.000000000 +0100
@@ -11,9 +11,9 @@
  *   'persistent'  Use persistent DB connections? (boolean)
  *   'compression' Use compression when storing sessions.</pre>
  *
- * $Horde: framework/SessionHandler/SessionHandler/memcache.php,v 1.1.2.1 2006/05/02 17:27:49 chuck Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/memcache.php,v 1.1.2.2 2007/01/02 13:54:38 jan Exp $
  *
- * Copyright 2005-2006 Rong-En Fan <rafan@infor.org>
+ * Copyright 2005-2007 Rong-En Fan <rafan@infor.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/mysql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/mysql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/mysql.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/mysql.php	2007-03-14 20:59:23.000000000 +0100
@@ -21,11 +21,11 @@
  * The table structure for the SessionHandler can be found in
  * horde/scripts/sql/horde_sessionhandler.sql.
  *
- * $Horde: framework/SessionHandler/SessionHandler/mysql.php,v 1.16.12.14 2006/03/29 19:06:46 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/mysql.php,v 1.16.12.15 2007/01/02 13:54:38 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2006 Jan Schneider <jan@horde.org>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2006-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/none.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/none.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/none.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/none.php	2007-03-14 20:59:23.000000000 +0100
@@ -8,9 +8,9 @@
  * Optional parameters:<pre>
  *   None.</pre>
  *
- * $Horde: framework/SessionHandler/SessionHandler/none.php,v 1.3.2.4 2006/01/01 21:28:34 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/none.php,v 1.3.2.5 2007/01/02 13:54:38 jan Exp $
  *
- * Copyright 2005-2006 Matt Selsky <selsky@columbia.edu>
+ * Copyright 2005-2007 Matt Selsky <selsky@columbia.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/oci8.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/oci8.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/oci8.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/oci8.php	2007-03-14 20:59:23.000000000 +0100
@@ -4,7 +4,6 @@
  *
  * Required parameters:<pre>
  *   'hostspec'  The hostname of the database server.
- *   'protocol'  The communication protocol ('tcp', 'unix', etc.).
  *   'username'  The username with which to connect to the database.
  *   'password'  The password associated with 'username'.
  *   'database'  The name of the database.
@@ -19,9 +18,9 @@
  * The table structure for the SessionHandler can be found in
  * horde/scripts/sql/horde_sessionhandler.oci8.sql.
  *
- * $Horde: framework/SessionHandler/SessionHandler/oci8.php,v 1.8.4.11 2006/02/10 18:46:53 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/oci8.php,v 1.8.4.14 2007/03/14 09:45:37 jan Exp $
  *
- * Copyright 2003-2006 Liam Hoekenga <liamr@umich.edu>
+ * Copyright 2003-2007 Liam Hoekenga <liamr@umich.edu>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -72,38 +71,27 @@
     function read($id)
     {
         /* Make sure we have a valid database connection. */
-        $this->_connect();
+        if (is_a(($result = $this->_connect()), 'PEAR_Error')) {
+            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+            return '';
+        }
 
         $select_query = sprintf('SELECT session_data FROM %s WHERE session_id = %s FOR UPDATE',
                                 $this->_params['table'], $this->_quote($id));
 
-        /* Log the query at a DEBUG log level. */
         Horde::logMessage(sprintf('SQL Query by SessionHandler_oci8::read(): query = "%s"', $select_query),
                           __FILE__, __LINE__, PEAR_LOG_DEBUG);
 
-        /* Execute query */
         $select_statement = OCIParse($this->_db, $select_query);
-        OCIExecute($select_statement);
-        if (!OCIFetchInto($select_statement, $result)) {
-            $insert_query = sprintf('INSERT INTO %s (session_id, session_lastmodified, session_data) VALUES (%s, %s, EMPTY_BLOB()) RETURNING session_data INTO :blob',
-                                    $this->_params['table'],
-                                    $this->_quote($id),
-                                    $this->_quote(time()));
-            $insert_statement = OCIParse($this->_db, $insert_query);
-            $lob = OCINewDescriptor($this->_db);
-            OCIBindByName($insert_statement, ':blob', $lob, -1, SQLT_BLOB);
-            OCIExecute($insert_statement, OCI_DEFAULT);
-            if ($session_data) {
-                $lob->save($session_data);
-            }
-            $result = OCICommit($this->_db);
-            OCIFreeStatement($insert_statement);
-            OCIExecute($select_statement);
-            OCIFetchInto($select_statement, $result);
+        OCIExecute($select_statement, OCI_DEFAULT);
+        if (OCIFetchInto($select_statement, $result)) {
+            $value = $result[0]->load();
+        } else {
+            $value = '';
         }
-        $value = $result[0]->load();
+
         OCIFreeStatement($select_statement);
-        return($value);
+        return $value;
     }
 
     /**
@@ -117,30 +105,53 @@
     function write($id, $session_data)
     {
         /* Make sure we have a valid database connection. */
-        $this->_connect();
+        if (is_a(($result = $this->_connect()), 'PEAR_Error')) {
+            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+            return false;
+        }
 
-        /* Build the SQL query. */
-        $query = sprintf('UPDATE %s SET session_lastmodified = %s, session_data = EMPTY_BLOB() WHERE session_id = %s RETURNING session_data INTO :blob',
-                         $this->_params['table'],
-                         $this->_quote(time()),
-                         $this->_quote($id));
+        $select_query = sprintf('SELECT session_data FROM %s WHERE session_id = %s FOR UPDATE',
+                                $this->_params['table'], $this->_quote($id));
 
-        /* Log the query at a DEBUG log level. */
-        Horde::logMessage(sprintf('SQL Query by SessionHandler_oci8::write(): query = "%s"', $query),
+        Horde::logMessage(sprintf('SQL Query by SessionHandler_oci8::write(): query = "%s"', $select_query),
                           __FILE__, __LINE__, PEAR_LOG_DEBUG);
 
-        /* Execute query */
-        $statement = OCIParse($this->_db, $query);
-        $lob = OCINewDescriptor($this->_db);
-        OCIBindByName($statement, ':blob', $lob, -1, SQLT_BLOB);
-        OCIExecute($statement, OCI_DEFAULT);
-        if ($session_data) {
-            $lob->save($session_data);
-        }
-        $result = OCICommit($this->_db);
-        if (!$result) {
-            Horde::logMessage('Error writing session data', __FILE__, __LINE__, PEAR_LOG_ERR);
-            return false;
+        $select_statement = OCIParse($this->_db, $select_query);
+        OCIExecute($select_statement, OCI_DEFAULT);
+        if (OCIFetchInto($select_statement, $result)) {
+            /* Discard the existing LOB contents. */
+            if (!$result[0]->truncate()) {
+                OCIRollback($this->_db);
+                return false;
+            }
+
+            /* Save the session data. */
+            if ($result[0]->save($session_data)) {
+                OCICommit($this->_db);
+                OCIFreeStatement($select_statement);
+            } else {
+                OCIRollback($this->_db);
+                return false;
+            }
+        } else {
+            $insert_query = sprintf('INSERT INTO %s (session_id, session_lastmodified, session_data) VALUES (%s, %s, EMPTY_BLOB()) RETURNING session_data INTO :blob',
+                                    $this->_params['table'],
+                                    $this->_quote($id),
+                                    $this->_quote(time()));
+
+            Horde::logMessage(sprintf('SQL Query by SessionHandler_oci8::read(): query = "%s"', $insert_query),
+                              __FILE__, __LINE__, PEAR_LOG_DEBUG);
+
+            $insert_statement = OCIParse($this->_db, $insert_query);
+            $lob = OCINewDescriptor($this->_db);
+            OCIBindByName($insert_statement, ':blob', $lob, -1, SQLT_BLOB);
+            OCIExecute($insert_statement, OCI_DEFAULT);
+            if (!$lob->save($session_data)) {
+                OCIRollback($this->_db);
+                return false;
+            }
+            OCICommit($this->_db);
+            OCIFreeStatement($insert_statement);
         }
 
         return true;
@@ -157,11 +168,14 @@
     function destroy($id)
     {
         /* Make sure we have a valid database connection. */
-        $this->_connect();
+        if (is_a(($result = $this->_connect()), 'PEAR_Error')) {
+            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+            return false;
+        }
 
         /* Build the SQL query. */
-        $query = sprintf( 'DELETE FROM %s WHERE session_id = %s',
-                          $this->_params['table'], $this->_quote($id));
+        $query = sprintf('DELETE FROM %s WHERE session_id = %s',
+                         $this->_params['table'], $this->_quote($id));
 
         /* Log the query at a DEBUG log level. */
         Horde::logMessage(sprintf('SQL Query by SessionHandler_oci8::destroy(): query = "%s"', $query),
@@ -190,7 +204,10 @@
     function gc($maxlifetime = 1)
     {
         /* Make sure we have a valid database connection. */
-        $this->_connect();
+        if (is_a(($result = $this->_connect()), 'PEAR_Error')) {
+            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+            return false;
+        }
 
         /* Build the SQL query. */
         $query = sprintf('DELETE FROM %s WHERE session_lastmodified < %s',
@@ -221,7 +238,10 @@
     function getSessionIDs()
     {
         /* Make sure we have a valid database connection. */
-        $this->_connect();
+        if (is_a(($result = $this->_connect()), 'PEAR_Error')) {
+            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+            return false;
+        }
 
         /* Session timeout, don't rely on garbage collection */
         $timeout = time() - ini_get('session.gc_maxlifetime');
@@ -269,7 +289,7 @@
     function _connect()
     {
         if ($this->_connected) {
-            return;
+            return true;
         }
 
         Horde::assertDriverConfig($this->_params, 'sessionhandler',
@@ -297,10 +317,11 @@
         if (!is_resource($this->_db = @$connect($this->_params['username'],
                                                 $this->_params['password'],
                                                 $this->_params['hostspec']))) {
-            Horde::fatal(PEAR::raiseError('Could not connect to database for SQL SessionHandler.'), __FILE__, __LINE__);
+            return PEAR::raiseError('Could not connect to database for SQL SessionHandler.');
         }
 
         $this->_connected = true;
+        return true;
     }
 
 }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/pgsql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/pgsql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/pgsql.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/pgsql.php	2007-03-14 20:59:23.000000000 +0100
@@ -2,7 +2,7 @@
 /**
  * PostgreSQL Session Handler for PHP (native).
  *
- * Copyright 2000-2006 Jon Parise <jon@csh.rit.edu>.  All rights reserved.
+ * Copyright 2000-2007 Jon Parise <jon@csh.rit.edu>.  All rights reserved.
  *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions
@@ -49,7 +49,7 @@
  *  pat@pcprogrammer.com    Perform update in a single transaction
  *  Jonathan Crompton       Lock row for life of session</pre>
  *
- * $Horde: framework/SessionHandler/SessionHandler/pgsql.php,v 1.12.10.15 2006/03/23 18:00:17 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/pgsql.php,v 1.12.10.16 2007/01/02 13:54:38 jan Exp $
  *
  * @author  Jon Parise <jon@csh.rit.edu>
  * @since   Horde 3.0
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/sapdb.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/sapdb.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/sapdb.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/sapdb.php	2007-03-14 20:59:23.000000000 +0100
@@ -26,9 +26,9 @@
  * The table structure for the SessionHandler can be found in
  * horde/scripts/sql/horde_sessionhandler.sapdb.sql.
  *
- * $Horde: framework/SessionHandler/SessionHandler/sapdb.php,v 1.13.12.8 2006/01/01 21:28:34 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/sapdb.php,v 1.13.12.9 2007/01/02 13:54:38 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/sql.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/sql.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler/sql.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler/sql.php	2007-03-14 20:59:23.000000000 +0100
@@ -23,9 +23,9 @@
  * The table structure for the SessionHandler can be found in
  * horde/scripts/sql/horde_sessionhandler.sql.
  *
- * $Horde: framework/SessionHandler/SessionHandler/sql.php,v 1.22.10.13 2006/01/01 21:28:34 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler/sql.php,v 1.22.10.14 2007/01/02 13:54:38 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionHandler.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionHandler.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,9 +3,9 @@
  * SessionHandler:: defines an API for implementing custom session
  * handlers for PHP.
  *
- * $Horde: framework/SessionHandler/SessionHandler.php,v 1.13.10.11 2006/07/14 08:54:59 jan Exp $
+ * $Horde: framework/SessionHandler/SessionHandler.php,v 1.13.10.12 2007/01/02 13:54:37 jan Exp $
  *
- * Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>
+ * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionObjects.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionObjects.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SessionObjects.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SessionObjects.php	2007-03-14 20:59:23.000000000 +0100
@@ -4,9 +4,9 @@
  * (usually, but not necessarily, objects) in the current user's
  * session.
  *
- * $Horde: framework/SessionObjects/SessionObjects.php,v 1.6.12.8 2006/01/01 21:28:35 jan Exp $
+ * $Horde: framework/SessionObjects/SessionObjects.php,v 1.6.12.9 2007/01/02 13:54:38 jan Exp $
  *
- * Copyright 2003-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2003-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If youq
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Share.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Share.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Share.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Share.php	2007-03-14 20:59:23.000000000 +0100
@@ -7,11 +7,11 @@
  * methods take care of any site-specific restrictions configured in in the
  * application's prefs.php and conf.php files.
  *
- * $Horde: framework/Share/Share.php,v 1.111.2.20 2006/05/04 13:25:29 jan Exp $
+ * $Horde: framework/Share/Share.php,v 1.111.2.23 2007/01/14 17:04:56 jan Exp $
  *
- * Copyright 2002-2006 Joel Vandal <jvandal@infoteck.qc.ca>
- * Copyright 2002-2006 Infoteck Internet <webmaster@infoteck.qc.ca>
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Joel Vandal <jvandal@infoteck.qc.ca>
+ * Copyright 2002-2007 Infoteck Internet <webmaster@infoteck.qc.ca>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -533,7 +533,7 @@
             require_once 'Horde/Group.php';
             $group = &Group::singleton();
             $groups = $group->getGroupMemberships($userid, true);
-            if (!is_a($groups, 'PEAR_Error') && count($groups)) {
+            if (is_array($groups) && $groups) {
                 // (name == perm_groups and key in ($groups) and val & $perm)
                 $criteria['OR'][] = array(
                     'AND' => array(
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SQL/Attributes.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SQL/Attributes.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SQL/Attributes.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SQL/Attributes.php	1970-01-01 01:00:00.000000000 +0100
@@ -1,347 +0,0 @@
-<?php
-/**
- * This class provides attributes methods for any existing SQL class.
- *
- * $Horde: framework/SQL/SQL/Attributes.php,v 1.14.10.9 2006/01/01 21:28:33 jan Exp $
- *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- *
- * See the enclosed file COPYING for license information (LGPL).  If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Horde 2.2
- * @package Horde_SQL
- */
-class Horde_SQL_Attributes {
-
-    /**
-     * The PEAR::DB object to run queries with.
-     *
-     * @var DB
-     */
-    var $_db;
-
-    /**
-     * Parameters to use when generating queries:
-     *   id_column       - The primary id column to use in joins.
-     *   primary_table   - The main table name.
-     *   attribute_table - The table that the attributes are stored in.
-     *
-     * @var array
-     */
-    var $_params = array();
-
-    /**
-     * The number of copies of the attributes table that we need to join on in
-     * the current query.
-     *
-     * @var integer
-     */
-    var $_table_count = 1;
-
-    /**
-     * Constructor.
-     *
-     * @param DB $dbh        A PEAR::DB object.
-     * @param array $params  The id column, table names, etc.
-     */
-    function Horde_SQL_Attributes($dbh, $params)
-    {
-        $this->_db = $dbh;
-        $this->_params = $params;
-    }
-
-    /**
-     * Returns all attributes for a given id or multiple ids.
-     *
-     * @param integer | array $id  The id to fetch or an array of ids.
-     *
-     * @return array  A hash of attributes, or a multi-level hash
-     *                of ids => their attributes.
-     */
-    function getAttributes($id)
-    {
-        if (is_array($id)) {
-            $query = sprintf('SELECT %1$s, attribute_name as name, attribute_key as "key", attribute_value as value FROM %2$s WHERE %1$s IN (%3$s)',
-                             $this->_params['id_column'],
-                             $this->_params['attribute_table'],
-                             implode(', ', $id));
-
-            Horde::logMessage('SQL Query by Horde_SQL_Attributes::getAttributes(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-            $rows = $this->_db->getAll($query, DB_FETCHMODE_ASSOC);
-            if (is_a($rows, 'PEAR_Error')) {
-                return $rows;
-            }
-
-            $id_column = $this->_params['id_column'];
-            $data = array();
-            foreach ($rows as $row) {
-                if (empty($data[$row[$id_column]])) {
-                    $data[$row[$id_column]] = array();
-                }
-                $data[$row[$id_column]][] = array('name'  => $row['name'],
-                                               'key'   => $row['key'],
-                                               'value' => $row['value']);
-            }
-            return $data;
-        } else {
-            $query = sprintf('SELECT %1$s, attribute_name as name, attribute_key as "key", attribute_value as value FROM %2$s WHERE %1$s = %3$s',
-                             $this->_params['id_column'],
-                             $this->_params['attribute_table'],
-                             (int)$id);
-            Horde::logMessage('SQL Query by Horde_SQL_Attributes::getAttributes(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-            return $this->_db->getAll($query, DB_FETCHMODE_ASSOC);
-        }
-    }
-
-    /**
-     * Return a set of ids based on a set of attribute criteria.
-     *
-     * @param array $criteria  The array of criteria. Example:
-     *                         $criteria['OR'] = array(
-     *                                      array('field' => 'name',
-     *                                            'op'    => '=',
-     *                                            'test'  => 'foo'),
-     *                                      array('field' => 'name',
-     *                                            'op'    => '=',
-     *                                            'test'  => 'bar'));
-     *                          This would return all ids for which the field
-     *                          attribute_name is either 'foo' or 'bar'.
-     */
-    function getByAttributes($criteria)
-    {
-        if (!count($criteria)) {
-            return array();
-        }
-
-        /* Build the query. */
-        $this->_table_count = 1;
-        $query = '';
-        foreach ($criteria as $key => $vals) {
-            if ($key == 'OR' || $key == 'AND') {
-                if (!empty($query)) {
-                    $query .= ' ' . $key . ' ';
-                }
-                $query .= '(' . $this->_buildAttributeQuery($key, $vals) . ')';
-            }
-        }
-
-        /* Build the FROM/JOIN clauses. */
-        $joins = array();
-        $pairs = array();
-        for ($i = 1; $i <= $this->_table_count; $i++) {
-            $joins[] = sprintf('LEFT JOIN %1$s a%2$s ON a%2$s.%3$s = m.%3$s',
-                               $this->_params['attribute_table'],
-                               $i,
-                               $this->_params['id_column']);
-
-            $pairs[] = 'AND a1.attribute_name = a' . $i . '.attribute_name';
-        }
-        $joins = implode(' ', $joins);
-        $pairs = implode(' ', $pairs);
-
-        $query = sprintf('SELECT DISTINCT a1.%s FROM %s m %s WHERE %s %s',
-                         $this->_params['id_column'],
-                         $this->_params['primary_table'],
-                         $joins,
-                         $query,
-                         $pairs);
-
-        Horde::logMessage('SQL Query by Horde_SQL_Attributes::getByAttributes(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-
-        return $this->_db->getCol($query);
-    }
-
-    /**
-     * Given a new attribute set and an id, insert each into the DB. If
-     * anything fails in here, rollback the transaction, return the relevant
-     * error and bail out.
-     *
-     * @param integer $id        The id of the record for which attributes are
-     *                           being inserted.
-     * @param array $attributes  An hash containing the attributes.
-     */
-    function insertAttributes($id, $attributes)
-    {
-        foreach ($attributes as $attr) {
-            $query = 'INSERT INTO ' . $this->_params['attribute_table'] .
-                     ' (' . $this->_params['id_column'] . ', attribute_name,' .
-                     ' attribute_key, attribute_value) VALUES (?, ?, ?, ?)';
-            $values = array((int)$id,
-                            $attr['name'],
-                            $attr['key'],
-                            $attr['value']);
-
-            Horde::logMessage('SQL Query by Horde_SQL_Attributes::insertAttributes(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-
-            $result = $this->_db->query($query, $values);
-            if (is_a($result, 'PEAR_Error')) {
-                $this->_db->rollback();
-                $this->_db->autoCommit(true);
-                return $result;
-            }
-        }
-
-        /* Commit the transaction, and turn autocommit back on. */
-        $result = $this->_db->commit();
-        $this->_db->autoCommit(true);
-    }
-
-    /**
-     * Given an id, delete all attributes for that id from the
-     * attributes table.
-     *
-     * @param integer $id  The id of the record for which attributes are being
-     *                     deleted.
-     */
-    function deleteAttributes($id)
-    {
-        /* Delete attributes. */
-        $query = sprintf('DELETE FROM %s WHERE %s = %s',
-                         $this->_params['attribute_table'],
-                         $this->_params['id_column'],
-                         (int)$id);
-
-        Horde::logMessage('SQL Query by Horde_SQL_Attributes::deleteAttributes(): ' . $query, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-        $result = $this->_db->query($query);
-        if (is_a($result, 'PEAR_Error')) {
-            return $result;
-        }
-
-        return true;
-    }
-
-    /**
-     * Given an id, update all attributes for that id in the attributes table
-     * with the new attributes.
-     *
-     * @param integer $id        The id of the record for which attributes are
-     *                           being deleted.
-     * @param array $attributes  An hash containing the attributes.
-     */
-    function updateAttributes($id, $attributes)
-    {
-        /* Delete the old attributes. */
-        $result = $this->deleteAttributes($id);
-        if (is_a($result, 'PEAR_Error')) {
-            return $result;
-        }
-
-        /* Insert the new attribute set. */
-        $result = $this->insertAttributes($id, $attributes);
-        return $result;
-    }
-
-    /**
-     * Build a piece of an attribute query.
-     *
-     * @param string $glue     The glue to join the criteria (OR/AND).
-     * @param array $criteria  The array of criteria.
-     * @param boolean $join    Should we join on a clean attributes table?
-     *
-     * @return string  An SQL fragment.
-     */
-    function _buildAttributeQuery($glue, $criteria, $join = false)
-    {
-        require_once 'Horde/SQL.php';
-
-        /* Initialize the clause that we're building. */
-        $clause = '';
-
-        /* Get the table alias to use for this set of criteria. */
-        if ($join) {
-            $alias = $this->_getAlias(true);
-        } else {
-            $alias = $this->_getAlias();
-        }
-
-        foreach ($criteria as $key => $vals) {
-            if (!empty($vals['OR']) || !empty($vals['AND'])) {
-                if (!empty($clause)) {
-                    $clause .= ' ' . $glue . ' ';
-                }
-                $clause .= '(' . $this->_buildAttributeQuery($glue, $vals) . ')';
-            } elseif (!empty($vals['JOIN'])) {
-                if (!empty($clause)) {
-                    $clause .= ' ' . $glue . ' ';
-                }
-                $clause .= $this->_buildAttributeQuery($glue, $vals['JOIN'], true);
-            } else {
-                if (isset($vals['field'])) {
-                    if (!empty($clause)) {
-                        $clause .= ' ' . $glue . ' ';
-                    }
-                    $clause .= Horde_SQL::buildClause($this->_db, $alias . '.attribute_' . $vals['field'], $vals['op'], $vals['test']);
-                } else {
-                    foreach ($vals as $test) {
-                        if (!empty($clause)) {
-                            $clause .= ' ' . $key . ' ';
-                        }
-                        $clause .= Horde_SQL::buildClause($this->_db, $alias . '.attribute_' . $test['field'], $test['op'], $test['test']);
-                    }
-                }
-            }
-        }
-
-        return $clause;
-    }
-
-    /**
-     * Get an alias to an attributes table, incrementing it if
-     * necessary.
-     *
-     * @param boolean $increment  Increment the alias count? Defaults to false.
-     */
-    function _getAlias($increment = false)
-    {
-        static $seen  = array();
-
-        if ($increment && !empty($seen[$this->_table_count])) {
-            $this->_table_count++;
-        }
-
-        $seen[$this->_table_count] = true;
-        return 'a' . $this->_table_count;
-    }
-
-    /**
-     * Attempts to return a reference to a concrete SQL Attributes
-     * instance based on parameters passed. It will only create a new
-     * instance if no Attributes instance with the same parameters
-     * currently exists.
-     *
-     * This should be used if multiple SQL attribute tables are
-     * required.
-     *
-     * This method must be invoked as: $var =
-     * &Horde_SQL_Attributes::singleton()
-     *
-     * @param DB $dbh        An object pointing to a SQL database handle.
-     *
-     * @param array $params  Parameters for the attributes table, consisting
-     *                       of the following keys:
-     *                       'primary_table'   - the main SQL table
-     *                       'attribute_table' - the second table containing
-     *                                           the attributes to the main
-     *                                           table.
-     *                       'id_column'       - the name of the column with
-     *                                           the ID or key field.
-     */
-    function &singleton($dbh, $params)
-    {
-        static $instances;
-
-        if (!isset($instances)) {
-            $instances = array();
-        }
-
-        $signature = serialize($params);
-        if (!isset($instances[$signature])) {
-            $instances[$signature] = &new Horde_SQL_Attributes($dbh, $params);
-        }
-
-        return $instances[$signature];
-    }
-
-}
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SQL/Keywords.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SQL/Keywords.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SQL/Keywords.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SQL/Keywords.php	2007-03-14 20:59:19.000000000 +0100
@@ -3,9 +3,9 @@
  * This class provides a parser which can construct an SQL WHERE
  * clause from a Google-like search expression.
  *
- * $Horde: framework/SQL/SQL/Keywords.php,v 1.2.10.4 2006/01/01 21:28:33 jan Exp $
+ * $Horde: framework/SQL/SQL/Keywords.php,v 1.2.10.6 2007/01/02 13:54:37 jan Exp $
  *
- * Copyright 2004-2006 Cronosys, LLC <http://www.cronosys.com/>
+ * Copyright 2004-2007 Cronosys, LLC <http://www.cronosys.com/>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -94,7 +94,7 @@
                 $token = '=' . $matches[0];
                 $expr = substr($expr,strlen($token)-1);
             } else {
-                return PEAR::raiseError(_("Syntax error in search terms"));
+                return PEAR::raiseError('Syntax error in search terms');
             }
             if ($token == '!AND') {
                 /* !AND is implied by concatenation. */
@@ -110,7 +110,7 @@
     function _parseKeywords1($column, &$tokens)
     {
         if (count($tokens) == 0) {
-            return PEAR::raiseError(_("Empty search terms"));
+            return PEAR::raiseError('Empty search terms');
         }
         $lhs = Horde_SQL_Keywords::_parseKeywords2($column, $tokens);
         if (is_a($lhs, 'PEAR_Error')) {
@@ -124,7 +124,7 @@
         if (is_a($rhs, 'PEAR_Error')) {
             return $rhs;
         }
-        return "( $lhs OR $rhs )";
+        return "($lhs OR $rhs)";
     }
 
     function _parseKeywords2($column, &$tokens)
@@ -140,7 +140,7 @@
         if (is_a($rhs, 'PEAR_Error')) {
             return $rhs;
         }
-        return "( $lhs AND $rhs )";
+        return "($lhs AND $rhs)";
     }
 
     function _parseKeywords3($column, &$tokens)
@@ -151,32 +151,35 @@
             if (is_a($lhs, 'PEAR_Error')) {
                 return $lhs;
             }
-            return "( NOT $lhs )";
+            return "(NOT $lhs)";
         }
         return Horde_SQL_Keywords::_parseKeywords4($column, $tokens);
     }
 
     function _parseKeywords4($column, &$tokens)
     {
-        if ( $tokens[0] == '!(' ) {
+        if ($tokens[0] == '!(') {
             array_shift($tokens);
             $lhs = Horde_SQL_Keywords::_parseKeywords1($column, $tokens);
             if (is_a($lhs, 'PEAR_Error')) {
                 return $lhs;
             }
             if (sizeof($tokens) == 0 || $tokens[0] != '!)') {
-                return PEAR::raiseError(_("Expected ')'"));
+                return PEAR::raiseError('Expected ")"');
             }
             array_shift($tokens);
             return $lhs;
         }
+
         if (substr($tokens[0], 0, 1) != '=' &&
             substr($tokens[0], 0, 2) != '=.') {
-            return PEAR::raiseError(_("Expected bare word or quoted search term"));
+            return PEAR::raiseError('Expected bare word or quoted search term');
         }
+
         $val = strtolower(substr(array_shift($tokens), 1));
         $val = addslashes(ereg_replace("([\\%])", "\\\\1", $val));
-        return "( LOWER($column) LIKE '%$val%' )";
+
+        return "(LOWER($column) LIKE '%$val%')";
     }
 
 }
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SQL.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SQL.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/SQL.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/SQL.php	2007-03-14 20:59:19.000000000 +0100
@@ -2,10 +2,10 @@
 /**
  * This is a utility class, every method is static.
  *
- * $Horde: framework/SQL/SQL.php,v 1.30.2.17 2006/04/19 03:49:49 ben Exp $
+ * $Horde: framework/SQL/SQL.php,v 1.30.2.18 2007/01/02 13:54:36 jan Exp $
  *
- * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
- * Copyright 2005-2006 Jan Schneider <jan@horde.org>
+ * Copyright 1999-2007 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2005-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL).  If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/String.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/String.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/String.php	2006-08-17 15:27:44.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/String.php	2007-03-14 20:59:19.000000000 +0100
@@ -6,9 +6,9 @@
  * The String:: class provides static methods for charset and locale safe
  * string manipulation.
  *
- * $Horde: framework/Util/String.php,v 1.43.6.13 2006/03/13 09:46:07 jan Exp $
+ * $Horde: framework/Util/String.php,v 1.43.6.14 2007/01/02 13:54:47 jan Exp $
  *
- * Copyright 2003-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Template.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Template.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Template.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Template.php	2007-03-14 20:59:23.000000000 +0100
@@ -3,9 +3,9 @@
  * Horde Template system. Adapted from bTemplate by Brian Lozier
  * <brian@massassi.net>.
  *
- * $Horde: framework/Template/Template.php,v 1.38.10.10 2006/06/13 03:54:03 chuck Exp $
+ * $Horde: framework/Template/Template.php,v 1.38.10.11 2007/01/02 13:54:43 jan Exp $
  *
- * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
+ * Copyright 2002-2007 Chuck Hagenbuch <chuck@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/bbcode.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/bbcode.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/bbcode.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/bbcode.php	2007-03-14 20:59:23.000000000 +0100
@@ -49,9 +49,9 @@
  *         and the text is "Mail to Carlos".
  * </pre>
  *
- * $Horde: framework/Text_Filter/Filter/bbcode.php,v 1.8.10.5 2006/01/01 21:28:38 jan Exp $
+ * $Horde: framework/Text_Filter/Filter/bbcode.php,v 1.8.10.6 2007/01/02 13:54:43 jan Exp $
  *
- * Copyright 2003-2006 Carlos Pedrinaci <cpedrinaci@yahoo.es>
+ * Copyright 2003-2007 Carlos Pedrinaci <cpedrinaci@yahoo.es>
  *
  * Email validation based on Chuck Hagenbuch's
  * Mail_RFC822::isValidInetAddress.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/cleanascii.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/cleanascii.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/cleanascii.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/cleanascii.php	2007-03-14 20:59:23.000000000 +0100
@@ -8,9 +8,9 @@
  * US-ASCII (7-bit) text which you suspect (or know) may have invalid or
  * non-printing characters in it.
  *
- * $Horde: framework/Text_Filter/Filter/cleanascii.php,v 1.3.2.4 2006/01/01 21:28:38 jan Exp $
+ * $Horde: framework/Text_Filter/Filter/cleanascii.php,v 1.3.2.5 2007/01/02 13:54:43 jan Exp $
  *
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/dimsignature.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/dimsignature.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/dimsignature.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/dimsignature.php	2007-03-14 20:59:23.000000000 +0100
@@ -4,9 +4,9 @@
  * CSS class "signature". Class names inside the signature are
  * prefixed with "signature-".
  *
- * $Horde: framework/Text_Filter/Filter/dimsignature.php,v 1.2.10.6 2006/08/17 12:29:55 jan Exp $
+ * $Horde: framework/Text_Filter/Filter/dimsignature.php,v 1.2.10.8 2007/01/02 13:54:43 jan Exp $
  *
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did
  * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -27,11 +27,12 @@
      */
     function postProcess($text)
     {
-        $parts = preg_split('|(\n--\s*(<br />)?\r?\n)|', $text, 2, PREG_SPLIT_DELIM_CAPTURE);
-        if (count($parts) > 3) {
-            $text = array_shift($parts);
-            $text .= '<span class="signature">' . $parts[0];
-            $text .= preg_replace('|class="([^"]+)"|', 'class="signature-\1"', $parts[2]);
+        $parts = preg_split('|(\n--\s*(?:<br />)?\r?\n)|', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+        $num_parts = count($parts);
+        if ($num_parts > 2) {
+            $text = implode('', array_slice($parts, 0, -2));
+            $text .= '<span class="signature">' . $parts[$num_parts - 2];
+            $text .= preg_replace('|class="([^"]+)"|', 'class="signature-\1"', $parts[$num_parts - 1]);
             $text .= '</span>';
         }
 
diff -Nru /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/emails.php /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/emails.php
--- /tmp/3MTByFMvwV/horde3-3.1.3/lib/Horde/Text/Filter/emails.php	2006-08-17 15:27:43.000000000 +0200
+++ /tmp/aodTV4Q0QM/horde3-3.1.4/lib/Horde/Text/Filter/emails.php	2007-03-14 20:59:23.000000000 +0100
@@ -10,10 +10,10 @@
  * class         -- CSS class of the generated <a> tag.  Defaults to none.
  * </pre>
  *
- * $Horde: framework/Text_Filter/Filter/emails.php,v 1.15.10.8 2006/02/17 20:05:49 chuck Exp $
+ * $Horde: framework/Text_Filter/Filter/emails.php,v 1.15.10.14 2007/03/01 07:10:31 slusarz Exp $
  *
- * Copyright 2003-2006 Tyler Colbert <tyler-hordeml@colberts.us>
- * Copyright 2004-2006 Jan Schneider <jan@horde.org>
+ * Copyright 2003-2007 Tyler Colbert <tyler-hordeml@colberts.us>
+ * Copyright 2004-2007 Jan Schneider <jan@horde.org>
  *
  * See the enclosed file COPYING for license information (LGPL). If you did not
  * receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -60,9 +60,9 @@
             ((?(1)\s*\]))
 
             |
-            # Version 2 Pattern 8: simple email addresses.
-            (\b[\w-+.=]+@[-A-Z0-9.]*[A-Z0-9])
-            # Pattern 9 to 11: Optional parameters
+            # Version 2 Pattern 8 and 9: simple email addresses.
+            (^|\s|&lt;)([\w-+.=]+@[-A-Z0-9.]*[A-Z0-9])
+            # Pattern 10 to 12: Optional parameters
             ((\?)([^\s"<]*[\w+#?\/&=]))?
 
             /eix
@@ -73,7 +73,7 @@
             !$this->_params['always_mailto']) {
             /* If we have a mail/compose registry method, use it. */
             $replacement = 'Text_Filter_emails::callback(\'' . $tag .
-                '\', \'' . $class . '\', \'$1\', \'$2\', \'$3\', \'$4\', \'$6\', \'$7\', \'$8\', \'$9\', \'$11\')';
+                '\', \'' . $class . '\', \'$1\', \'$2\', \'$3\', \'$4\', \'$6\', \'$7\', \'$8\', \'$9\', \'$10\', \'$12\')';
         } else {
             /* Otherwise, generate a standard mailto: and let the
              * browser handle it. */
@@ -83,8 +83,8 @@
                 '$1$2<$tag$class href="mailto:$3$4" title="' . sprintf(_("New Message to %s"), htmlspecialchars('$3')) .
                 '">$3$4</$tag>$7' :
 
-                '<$tag$class href="mailto:$8$9" title="' . sprintf(_("New Message to %s"), htmlspecialchars('$8')) .
-                '">$8$9</$tag>'
+                '$8<$tag$class href="mailto:$9$10" title="' . sprintf(_("New Message to %s"), htmlspecialchars('$9')) .
+                '">$9$10</$tag>'
 EOP;
         }
 
@@ -92,14 +92,15 @@
     }
 
     function callback($tag, $class, $bracket1, $protocol, $email, $args_long,
-                      $args, $bracket2, $email2, $args_long2, $args2)
+                      $args, $bracket2, $prefix, $email2, $args_long2, $args2)
     {
         if (!empty($email2)) {
             $args = $args2;
             $email = $email2;
             $args_long = $args_long2;
         }
-        $extra = call_user_func(create_function('$a', '$p=array();foreach($a as $b){$b=explode("=",$b,2);$p[$b[0]]=@$b[1];}return $p;'), explode('&', $args));
+
+        parse_str($args, $extra);
         $url = $GLOBALS['registry']->call('mail/compose',
                                           array(array('to' => $email),
                                           $extra));
@@ -112,7 +113,7 @@
             $onclick = '';
         }
 
-        return $bracket1 . $protocol . '<' . $tag . $class . ' href="' .
+        return $bracket1 . $prot