diff --git a/apps/updatenotification/controller/admincontroller.php b/apps/updatenotification/controller/admincontroller.php index 55ef26c59a73e..eddedb6c1b107 100644 --- a/apps/updatenotification/controller/admincontroller.php +++ b/apps/updatenotification/controller/admincontroller.php @@ -80,33 +80,6 @@ public function __construct($appName, $this->dateTimeFormatter = $dateTimeFormatter; } - /** - * Whether the instance is compatible with the updater - * - * @return bool - */ - protected function isCompatibleWithUpdater() { - $updaterCompatible = true; - if(!function_exists('proc_open') || !function_exists('shell_exec')) { - $updaterCompatible = false; - } else { - $whichUnzip = shell_exec('command -v unzip'); - if(!class_exists('ZipArchive') && empty($whichUnzip)) { - $updaterCompatible = false; - } - - $whichPhp = shell_exec('command -v php'); - if(empty($whichPhp)) { - $updaterCompatible = false; - } - } - if(!function_exists('curl_exec')) { - $updaterCompatible = false; - } - - return $updaterCompatible; - } - /** * @return TemplateResponse */ @@ -122,6 +95,7 @@ public function displayPanel() { 'production', ]; $currentChannel = \OCP\Util::getChannel(); + // Remove the currently used channel from the channels list if(($key = array_search($currentChannel, $channels)) !== false) { unset($channels[$key]); @@ -133,8 +107,6 @@ public function displayPanel() { 'currentChannel' => $currentChannel, 'channels' => $channels, 'newVersionString' => ($updateState === []) ? '' : $updateState['updateVersion'], - 'updaterRequirementsFulfilled' => $this->isCompatibleWithUpdater(), - 'downloadLink' => (empty($updateState['downloadLink'])) ? '' : $updateState['downloadLink'], ]; return new TemplateResponse($this->appName, 'admin', $params, ''); diff --git a/apps/updatenotification/js/admin.js b/apps/updatenotification/js/admin.js index 4332df7890954..3bc5dd21527e7 100644 --- a/apps/updatenotification/js/admin.js +++ b/apps/updatenotification/js/admin.js @@ -13,7 +13,32 @@ /** * 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(); $.post( diff --git a/apps/updatenotification/lib/updatechecker.php b/apps/updatenotification/lib/updatechecker.php index 153a6ae4aa38f..32eab405a62f7 100644 --- a/apps/updatenotification/lib/updatechecker.php +++ b/apps/updatenotification/lib/updatechecker.php @@ -48,9 +48,6 @@ public function getUpdateState() { if(substr($data['web'], 0, 8) === 'https://') { $result['updateLink'] = $data['web']; } - if(substr($data['url'], 0, 8) === 'https://') { - $result['downloadLink'] = $data['url']; - } return $result; } diff --git a/apps/updatenotification/templates/admin.php b/apps/updatenotification/templates/admin.php index 32ad7ffd1ad57..534a3032d99f5 100644 --- a/apps/updatenotification/templates/admin.php +++ b/apps/updatenotification/templates/admin.php @@ -12,17 +12,13 @@ $channels = $_['channels']; /** @var string $currentChannel */ $currentChannel = $_['currentChannel']; - /** @var bool $updaterRequirementsFulfilled */ - $updaterRequirementsFulfilled = $_['updaterRequirementsFulfilled']; ?>