diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-02-09 19:58:29 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-02-09 20:28:30 +0100 |
commit | b9e3ed14680bea2626d90c5dfc48d7f61d7e437f (patch) | |
tree | c3c73f2aa403c5a0b1ece641ee9000e78af1d70b /apps/updatenotification/js | |
parent | a39c7591d6b0bfcb323cd14a5c1164576eaf7559 (diff) | |
download | nextcloud-server-b9e3ed14680bea2626d90c5dfc48d7f61d7e437f.tar.gz nextcloud-server-b9e3ed14680bea2626d90c5dfc48d7f61d7e437f.zip |
Add SSO for updater application
Allows logging-in into the updater application by visiting the admin panel and pressing "Open updater".
Diffstat (limited to 'apps/updatenotification/js')
-rw-r--r-- | apps/updatenotification/js/admin.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/apps/updatenotification/js/admin.js b/apps/updatenotification/js/admin.js new file mode 100644 index 00000000000..df021fe2e97 --- /dev/null +++ b/apps/updatenotification/js/admin.js @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2016 ownCloud Inc + * + * @author Lukas Reschke <lukas@owncloud.com> + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/** + * Creates a new authentication token and loads the updater URL + */ +var loginToken = ''; +$(document).ready(function(){ + $('#oca_updatenotification').click(function() { + // Load the new token + $.ajax({ + url: OC.generateUrl('/apps/updatenotification/credentials') + }).success(function(data) { + loginToken = data; + $.ajax({ + url: OC.webroot+'/updater/', + headers: { + 'Authorization': loginToken + }, + method: 'POST', + success: function(data){ + if(data !== 'false') { + var body = $('body'); + $('head').remove(); + body.html(data); + body.removeAttr('id'); + body.attr('id', 'body-settings'); + } + } + }); + }); + }); +}); |