aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-06-21 13:55:07 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-21 14:16:45 +0200
commit6affbdc6e7f57d52d63080d5fa0d7e332770831b (patch)
tree771dba148ded3d080d4611fcff066d78777f2e90 /apps/files_external/js
parent097cba8b38331b578895cacb8cce9d2458a765cd (diff)
downloadnextcloud-server-6affbdc6e7f57d52d63080d5fa0d7e332770831b.tar.gz
nextcloud-server-6affbdc6e7f57d52d63080d5fa0d7e332770831b.zip
Add "Global Auth" option to external storage
This adds the "Global Auth" option to the external storage implementation, it is basically done by reverting c2c6caee93c491de9fa9a2e7c2eea036f4974e61 from https://github.com/owncloud/core/pull/22468. This was taken from owncloud/core which is AGPL licensed. Commited with "icewind@owncloud.com" to keep the license header signature in sync. ![2016-06-21_14-01-06](https://cloud.githubusercontent.com/assets/878997/16228662/9c243136-37b8-11e6-9700-c1076ddb3d17.png)
Diffstat (limited to 'apps/files_external/js')
-rw-r--r--apps/files_external/js/settings.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index d210c158ec1..921bf92e775 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -1347,6 +1347,33 @@ $(document).ready(function() {
}
});
+ $('#global_credentials').on('submit', function() {
+ var $form = $(this);
+ var uid = $form.find('[name=uid]').val();
+ var user = $form.find('[name=username]').val();
+ var password = $form.find('[name=password]').val();
+ var $submit = $form.find('[type=submit]');
+ $submit.val(t('files_external', 'Saving...'));
+ $.ajax({
+ type: 'POST',
+ contentType: 'application/json',
+ data: JSON.stringify({
+ uid: uid,
+ user: user,
+ password: password
+ }),
+ url: OC.generateUrl('apps/files_external/globalcredentials'),
+ dataType: 'json',
+ success: function() {
+ $submit.val(t('files_external', 'Saved'));
+ setTimeout(function(){
+ $submit.val(t('files_external', 'Save'));
+ }, 2500);
+ }
+ });
+ return false;
+ });
+
// global instance
OCA.External.Settings.mountConfig = mountConfigListView;