summaryrefslogtreecommitdiff
path: root/lib/api/folder_auth.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/folder_auth.php')
-rw-r--r--lib/api/folder_auth.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/api/folder_auth.php b/lib/api/folder_auth.php
index 3304cbb..f6b564c 100644
--- a/lib/api/folder_auth.php
+++ b/lib/api/folder_auth.php
@@ -55,11 +55,24 @@ class file_api_folder_auth extends file_api_common
$data = array_merge($data, $this->args);
$data = $driver->driver_validate($data);
- // save changed data (except password)
- unset($data['password']);
+ // optionally store (encrypted) passwords
+ if (!empty($data['password']) && rcube_utils::get_boolean((string) $this->args['store_passwords'])) {
+ $data['password'] = $this->api->encrypt($data['password']);
+ }
+ else {
+ unset($data['password']);
+ }
+
+ // save changed data
foreach (array_keys($meta['form']) as $key) {
if ($meta['form_values'][$key] != $data[$key]) {
- // @TODO: save current driver config
+ // update driver config
+ $data['title'] = $driver_config['title'];
+ $data['driver'] = $driver_config['driver'];
+ $data['enabled'] = 1;
+
+ $backend = $this->api->get_backend();
+ $backend->driver_update($this->args['folder'], $data);
break;
}
}