]> source.dussan.org Git - nextcloud-server.git/commitdiff
Revert "Show an update button instead of the updater"
authorMorris Jobke <hey@morrisjobke.de>
Fri, 23 Sep 2016 11:08:18 +0000 (13:08 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 23 Sep 2016 11:49:15 +0000 (13:49 +0200)
This reverts commit 202ae42506e9bbb167889735b2c56ccebace594b.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
apps/updatenotification/js/admin.js
apps/updatenotification/lib/Controller/AdminController.php
apps/updatenotification/lib/UpdateChecker.php
apps/updatenotification/templates/admin.php

index e60e77ab89adf578babfbd4adcd90ae5f7708ef1..3ca45a191d4cc949dadecee15b98cf066ec13732 100644 (file)
 /**
  * Creates a new authentication token and loads the updater URL
  */
+var loginToken = '';
 $(document).ready(function(){
+       $('#oca_updatenotification_button').click(function() {
+               // Load the new token
+               $.ajax({
+                       url: OC.generateUrl('/apps/updatenotification/credentials')
+               }).success(function(data) {
+                       loginToken = data;
+                       $.ajax({
+                               url: OC.webroot+'/updater/',
+                               headers: {
+                                       'X-Updater-Auth': 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');
+                                       }
+                               }
+                       });
+               });
+       });
+
        $('#release-channel').change(function() {
                var newChannel = $('#release-channel').find(":selected").val();
 
index 16ae8144b169a71b7bbfcfa4b7fbce68a8b10120..9f10f1b32f287cec89ba9a9abca366d1dcf6532f 100644 (file)
@@ -112,7 +112,6 @@ class AdminController extends Controller implements ISettings {
                        'currentChannel' => $currentChannel,
                        'channels' => $channels,
                        'newVersionString' => ($updateState === []) ? '' : $updateState['updateVersion'],
-                       'downloadLink' => (empty($updateState['downloadLink'])) ? '' : $updateState['downloadLink'],
 
                        'notify_groups' => implode('|', $notifyGroups),
                ];
index 5f759b7c8432461e9520d1d667ed2c0108d51d6e..dd51831007c995c7abc0650b16f74a585eb4ddba 100644 (file)
@@ -49,9 +49,6 @@ class UpdateChecker {
                        if(substr($data['web'], 0, 8) === 'https://') {
                                $result['updateLink'] = $data['web'];
                        }
-                       if(substr($data['url'], 0, 8) === 'https://') {
-                               $result['downloadLink'] = $data['url'];
-                       }
 
                        return $result;
                }
index 0dd8aec4a04d40ec82b5d93654bc99b591f46fdf..68ef1d423b4de8f8874c6c83184eecbf546d624f 100644 (file)
@@ -16,9 +16,7 @@
 <form id="oca_updatenotification_section" class="followupsection">
        <?php if($isNewVersionAvailable === true): ?>
                <strong><?php p($l->t('A new version is available: %s', [$newVersionString])); ?></strong>
-               <?php if ($_['downloadLink']): ?>
-                       <a href="<?php p($_['downloadLink']); ?>" class="button"><?php p($l->t('Download now')) ?></a>
-               <?php endif; ?>
+               <input type="button" id="oca_updatenotification_button" value="<?php p($l->t('Open updater')) ?>">
        <?php else: ?>
                <strong><?php print_unescaped($l->t('Your version is up to date.')); ?></strong>
                <span class="icon-info svg" title="<?php p($l->t('Checked on %s', [$lastCheckedDate])) ?>"></span>