summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-10-17 12:32:29 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-10-17 12:32:29 (GMT)
commit4a35201c6e4b5d734cfb8e2e154762ff3934187d (patch)
tree407c1573af721259d43a8ab583c61ca0ccaf4380
parentbd666a86497606c2d018eced7aea29369f24e48c (diff)
downloadroundcubemail-plugins-kolab-4a35201c6e4b5d734cfb8e2e154762ff3934187d.tar.gz
Add "remember password" option
Conflicts: plugins/kolab_files/localization/en_US.inc plugins/kolab_files/skins/larry/templates/compose_plugin.html plugins/kolab_files/skins/larry/templates/files.html plugins/kolab_files/skins/larry/templates/message_plugin.html
-rw-r--r--plugins/kolab_files/kolab_files.js10
-rw-r--r--plugins/kolab_files/lib/kolab_files_engine.php20
-rw-r--r--plugins/kolab_files/localization/en_US.inc3
-rw-r--r--plugins/kolab_files/skins/larry/style.css16
-rw-r--r--plugins/kolab_files/skins/larry/templates/compose_plugin.html1
-rw-r--r--plugins/kolab_files/skins/larry/templates/files.html1
-rw-r--r--plugins/kolab_files/skins/larry/templates/message_plugin.html1
7 files changed, 47 insertions, 5 deletions
diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js
index 1699c5f..1e72311 100644
--- a/plugins/kolab_files/kolab_files.js
+++ b/plugins/kolab_files/kolab_files.js
@@ -340,6 +340,10 @@ function kolab_files_folder_mount_dialog()
}
});
+ $('.auth-options input', dialog).each(function() {
+ args[this.name] = this.type == 'checkbox' && !this.checked ? '' : this.value;
+ });
+
file_api.folder_mount(args);
kolab_dialog_close(this);
};
@@ -894,7 +898,7 @@ function kolab_files_ui()
elem.html('').append(list);
- this.env.folders = this.folder_list_parse(response.result ? response.result.list : []);
+ this.env.folders = this.folder_list_parse(response.result && response.result.list ? response.result.list : response.result);
$.each(this.env.folders, function(i, f) {
list.append(file_api.folder_list_row(i, f));
@@ -1698,13 +1702,13 @@ function kolab_files_ui()
content = this.folder_list_auth_form(driver);
dialog.find('table.propform').remove();
- dialog.append(content);
+ $('.options', dialog).before(content);
args.buttons[this.t('kolab_files.save')] = function() {
var data = {folder: label, list: 1};
$('input', dialog).each(function() {
- data[this.name] = this.value;
+ data[this.name] = this.type == 'checkbox' && !this.checked ? '' : this.value;
});
file_api.open_dialog = this;
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
index 81d0afc..b345207 100644
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -123,6 +123,7 @@ class kolab_files_engine
$this->rc->output->add_handlers(array(
'folder-create-form' => array($this, 'folder_create_form'),
'folder-mount-form' => array($this, 'folder_mount_form'),
+ 'folder-auth-options'=> array($this, 'folder_auth_options'),
'file-search-form' => array($this, 'file_search_form'),
'file-edit-form' => array($this, 'file_edit_form'),
'filelist' => array($this, 'file_list'),
@@ -243,7 +244,7 @@ class kolab_files_engine
$table->add(array('id' => $id, 'colspan' => 2, 'class' => 'source'), $row);
}
- $out = $table->show();
+ $out = $table->show() . $this->folder_auth_options(array('suffix' => '-form'));
// add form tag around text field
if (empty($attrib['form'])) {
@@ -259,6 +260,23 @@ class kolab_files_engine
}
/**
+ * Template object for folder authentication options
+ */
+ public function folder_auth_options($attrib)
+ {
+ $checkbox = new html_checkbox(array(
+ 'name' => 'store_passwords',
+ 'value' => '1',
+ 'id' => 'auth-pass-checkbox' . $attrib['suffix'],
+ ));
+
+ return html::div('auth-options', $checkbox->show(). '&nbsp;'
+ . html::label('auth-pass-checkbox' . $attrib['suffix'], $this->plugin->gettext('storepasswords'))
+ . html::span('description', $this->plugin->gettext('storepasswordsdesc'))
+ );
+ }
+
+ /**
* Template object for file_edit form
*/
public function file_edit_form($attrib)
diff --git a/plugins/kolab_files/localization/en_US.inc b/plugins/kolab_files/localization/en_US.inc
index 364566f..53d42d4 100644
--- a/plugins/kolab_files/localization/en_US.inc
+++ b/plugins/kolab_files/localization/en_US.inc
@@ -72,4 +72,7 @@ $labels['fileoverwrite'] = 'Overwrite';
$labels['fileoverwriteall'] = 'Overwrite all';
$labels['filemoveconfirm'] = 'This action is going to overwrite the destination file: <b>$file</b>.';
+$labels['storepasswords'] = 'remember password';
+$labels['storepasswordsdesc'] = 'Stored passwords will be encrypted. Enable this if you do not want to be asked for the password on every login or you want this storage to be available via WebDAV.';
+
?>
diff --git a/plugins/kolab_files/skins/larry/style.css b/plugins/kolab_files/skins/larry/style.css
index ed6691b..800534c 100644
--- a/plugins/kolab_files/skins/larry/style.css
+++ b/plugins/kolab_files/skins/larry/style.css
@@ -346,7 +346,6 @@ ul.toolbarmenu li span.saveas {
background: url(images/buttons.png) -5px -253px no-repeat;
}
-
table.propform td.source.selected {
background-color: #c7e3ef;
}
@@ -381,3 +380,18 @@ table.propform td.source table.propform td {
padding: 2px 10px;
background-color: inherit;
}
+
+.auth-options {
+ margin-top: 5px;
+}
+
+.auth-options .description {
+ color: #666;
+ display: block;
+ margin: 3px 0 0 25px;
+}
+
+.auth-options input,
+.auth-options label {
+ vertical-align: middle;
+}
diff --git a/plugins/kolab_files/skins/larry/templates/compose_plugin.html b/plugins/kolab_files/skins/larry/templates/compose_plugin.html
index d0ec432..75bd7d5 100644
--- a/plugins/kolab_files/skins/larry/templates/compose_plugin.html
+++ b/plugins/kolab_files/skins/larry/templates/compose_plugin.html
@@ -21,4 +21,5 @@
</div>
<div id="files-folder-auth-dialog">
+ <roundcube:object name="folder-auth-options" />
</div>
diff --git a/plugins/kolab_files/skins/larry/templates/files.html b/plugins/kolab_files/skins/larry/templates/files.html
index 24e84f8..7987260 100644
--- a/plugins/kolab_files/skins/larry/templates/files.html
+++ b/plugins/kolab_files/skins/larry/templates/files.html
@@ -69,6 +69,7 @@
<roundcube:object name="file-edit-form" />
</div>
<div id="files-folder-auth-dialog">
+ <roundcube:object name="folder-auth-options" />
</div>
<div id="listoptions" class="propform popupdialog">
diff --git a/plugins/kolab_files/skins/larry/templates/message_plugin.html b/plugins/kolab_files/skins/larry/templates/message_plugin.html
index dc84034..c0dbefb 100644
--- a/plugins/kolab_files/skins/larry/templates/message_plugin.html
+++ b/plugins/kolab_files/skins/larry/templates/message_plugin.html
@@ -15,6 +15,7 @@
</div>
<div id="files-folder-auth-dialog">
+ <roundcube:object name="folder-auth-options" />
</div>
<script src="plugins/kolab_files/skins/larry/ui.js" type="text/javascript"></script>