From 6764d07d21f87358921342062f9b96546af366c7 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 1 May 2010 10:43:55 -0400 Subject: [PATCH] Fix SyncML prefs. These types of links do not work with the new Prefs ui stuff. ui->vars will only contain the variables from the *submitted* form, and these types of links do not submit the form. Also, destructive actions should always be done via POST and not GET requests. --- horde/lib/Prefs/Ui.php | 11 +++++------ horde/templates/prefs/syncml.html | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/horde/lib/Prefs/Ui.php b/horde/lib/Prefs/Ui.php index 52075ad95..b0d62d3ce 100644 --- a/horde/lib/Prefs/Ui.php +++ b/horde/lib/Prefs/Ui.php @@ -362,6 +362,7 @@ class Horde_Prefs_Ui */ protected function _syncmlManagement($ui) { + Horde::addScriptFile('syncmlprefs.js', 'horde'); $devices = SyncML_Backend::factory('Horde')->getUserAnchors(Horde_Auth::getAuth()); $t = $GLOBALS['injector']->createInstance('Horde_Template'); @@ -375,10 +376,8 @@ class Horde_Prefs_Ui $partners[] = array( 'anchor' => htmlspecialchars($anchor['syncml_clientanchor']), 'db' => htmlspecialchars($anchor['syncml_db']), - 'delete' => $selfurl->copy()->add(array( - 'db' => $anchor['syncml_db'], - 'deviceid' => $device - )), + 'deviceid' => $device, + 'rawdb' => $anchor ['syncml_db'], 'device' => htmlspecialchars($device), 'time' => strftime($GLOBALS['prefs']->getValue('date_format') . ' %H:%M', $anchor['syncml_serveranchor']) ); @@ -550,8 +549,8 @@ class Horde_Prefs_Ui { $backend = SyncML_Backend::factory('Horde'); - if ($ui->vars->deleteanchor) { - $res = $backend->removeAnchor(Horde_Auth::getAuth(), $ui->vars->deviceid, $ui->vars->db); + if ($ui->vars->removedb && $ui->vars->removedevice) { + $res = $backend->removeAnchor(Horde_Auth::getAuth(), $ui->vars->removedevice, $ui->vars->removedb); if ($res instanceof PEAR_Error) { $GLOBALS['notification']->push(_("Error deleting synchronization session:") . ' ' . $res->getMessage(), 'horde.error'); } else { diff --git a/horde/templates/prefs/syncml.html b/horde/templates/prefs/syncml.html index 474d2318b..3a9888a0e 100644 --- a/horde/templates/prefs/syncml.html +++ b/horde/templates/prefs/syncml.html @@ -3,6 +3,8 @@ + + @@ -18,7 +20,7 @@ -- 2.11.0
Device - Delete +