Once again fix parameter names for remote calendars.
authorJan Schneider <jan@horde.org>
Mon, 9 Aug 2010 13:07:23 +0000 (15:07 +0200)
committerJan Schneider <jan@horde.org>
Mon, 9 Aug 2010 13:30:53 +0000 (15:30 +0200)
kronolith/js/kronolith.js
kronolith/lib/Ajax/Application.php
kronolith/lib/Kronolith.php

index fd2a9f4..e296e81 100644 (file)
@@ -4482,7 +4482,7 @@ KronolithCore = {
                     }
                     if (i == 2) {
                         if ($F('kronolithCalendarremoteUsername')) {
-                            params.username = $F('kronolithCalendarremoteUsername');
+                            params.user = $F('kronolithCalendarremoteUsername');
                             params.password =  $F('kronolithCalendarremotePassword');
                         }
                         this.doAction('getRemoteInfo',
index 68885da..6956c69 100644 (file)
@@ -812,7 +812,7 @@ class Kronolith_Ajax_Application extends Horde_Core_Ajax_Application
     public function getRemoteInfo()
     {
         $params = array('timeout' => 15);
-        if ($user = $this->_vars->username) {
+        if ($user = $this->_vars->user) {
             $params['user'] = $user;
             $params['password'] = $this->_vars->password;
         }
index e4218ea..4505792 100644 (file)
@@ -1946,11 +1946,11 @@ class Kronolith
             throw new Kronolith_Exception(_("You must specify a name and a URL."));
         }
 
-        if (!empty($info['username']) || !empty($info['password'])) {
+        if (!empty($info['user']) || !empty($info['password'])) {
             $key = $GLOBALS['registry']->getAuthCredential('password');
             if ($key) {
                 $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
-                $info['username'] = base64_encode($secret->write($key, $info['username']));
+                $info['user'] = base64_encode($secret->write($key, $info['user']));
                 $info['password'] = base64_encode($secret->write($key, $info['password']));
             }
         }
@@ -2722,6 +2722,7 @@ class Kronolith
                 $key = $GLOBALS['registry']->getAuthCredential('password');
                 if ($key && $password) {
                     $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
+                    $user = $secret->read($key, base64_decode($user));
                     $password = $secret->read($key, base64_decode($password));
                 }
                 if (!empty($user)) {