public static function ShowUpdatingHint() { if (OC_Config::getValue('updatechecker', true) == true) { $data = OC_Updater::check(); if (isset($data['version']) and $data['version'] != '') { $txt = '<span style="color:#AA0000; font-weight:bold;">' . $data['versionstring'] . ' is available. Get <a href="' . $data['web'] . '">more information</a></span>'; } else { $txt = 'up to date'; } } else { $txt = 'updates check is disabled'; } return $txt; }
* ownCloud - Updater plugin * * @author Victor Dubiniuk * @copyright 2012 Victor Dubiniuk victor.dubiniuk@gmail.com * * This file is licensed under the Affero General Public License version 3 or * later. */ namespace OCA_Updater; \OCP\JSON::checkAdminUser(); // Url to download package e.g. http://download.owncloud.org/releases/owncloud-4.0.5.tar.bz2 $packageUrl = 'http://owncloud.org/releases/owncloud-latest.zip'; //Package version e.g. 4.0.4 $packageVersion = ''; $updateData = \OC_Updater::check(); if (isset($updateData['version'])) { $packageVersion = $updateData['version']; } if (isset($updateData['url']) && extension_loaded('bz2')) { $packageUrl = $updateData['url']; } if (!$packageVersion) { \OCP\JSON::error(array('msg' => 'Version not found')); exit; } $sourcePath = Downloader::getPackage($packageUrl, $packageVersion); if (!$sourcePath) { \OCP\JSON::error(array('msg' => 'Unable to fetch package')); exit; }
* @copyright 2012 Victor Dubiniuk victor.dubiniuk@gmail.com * * This file is licensed under the Affero General Public License version 3 or * later. */ ?> <fieldset class="personalblock"> <strong>Updater</strong> <br /> <?php echo OC_Updater::ShowUpdatingHint(); ?> <br /> <?php $data = OC_Updater::check(); if (isset($data['version']) && !empty($data['version'])) { ?> <button id="updater_backup"><?php echo $l->t('Update'); ?> </button> <?php } ?> </fieldset> <script type="text/javascript"> $(document).ready(function() { $('#updater_backup').click(function() { $('#updater_backup').attr('disabled', 'disabled');
?> </code><br /> <em><?php echo $l->t('use this address to connect to your ownCloud in your file manager'); ?> </em> </p> <?php foreach ($_['forms'] as $form) { echo $form; } ?> <p class="personalblock"> <strong>ownCloud</strong> <?php echo OC_Util::getVersionString(); ?> <?php echo OC_Util::getEditionString(); ?> (<?php echo OC_Updater::ShowUpdatingHint(); ?> )<br /> Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="http://gitorious.org/owncloud" target="_blank">source code</a> is freely licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>. </p>
/** * @param string $renderas * @param string $appid application id */ public function __construct($renderas, $appid = '') { // Decide which page we show if ($renderas == 'user') { parent::__construct('core', 'layout.user'); if (in_array(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) { $this->assign('bodyid', 'body-settings'); } else { $this->assign('bodyid', 'body-user'); } // Update notification if (OC_Config::getValue('updatechecker', true) === true) { $data = OC_Updater::check(); if (isset($data['version']) && $data['version'] != '' and $data['version'] !== array() && OC_User::isAdminUser(OC_User::getUser())) { $this->assign('updateAvailable', true); $this->assign('updateVersion', $data['versionstring']); $this->assign('updateLink', $data['web']); } else { $this->assign('updateAvailable', false); // No update available or not an admin user } } else { $this->assign('updateAvailable', false); // Update check is disabled } // Add navigation entry $this->assign('application', '', false); $this->assign('appid', $appid); $navigation = OC_App::getNavigation(); $this->assign('navigation', $navigation); $this->assign('settingsnavigation', OC_App::getSettingsNavigation()); foreach ($navigation as $entry) { if ($entry['active']) { $this->assign('application', $entry['name']); break; } } $user_displayname = OC_User::getDisplayName(); $this->assign('user_displayname', $user_displayname); $this->assign('user_uid', OC_User::getUser()); $this->assign('appsmanagement_active', strpos(OC_Request::requestUri(), OC_Helper::linkToRoute('settings_apps')) === 0); $this->assign('enableAvatars', \OC_Config::getValue('enable_avatars', true)); } else { if ($renderas == 'error') { parent::__construct('core', 'layout.guest', '', false); } else { if ($renderas == 'guest') { parent::__construct('core', 'layout.guest'); } else { parent::__construct('core', 'layout.base'); } } } $versionParameter = '?v=' . md5(implode(OC_Util::getVersion())); $useAssetPipeline = $this->isAssetPipelineEnabled(); if ($useAssetPipeline) { $this->append('jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter); $this->generateAssets(); } else { // Add the js files $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if (OC_Config::getValue('installed', false) && $renderas != 'error') { $this->append('jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter); } foreach ($jsfiles as $info) { $web = $info[1]; $file = $info[2]; $this->append('jsfiles', $web . '/' . $file . $versionParameter); } // Add the css files $cssfiles = self::findStylesheetFiles(OC_Util::$styles); $this->assign('cssfiles', array()); foreach ($cssfiles as $info) { $web = $info[1]; $file = $info[2]; $this->append('cssfiles', $web . '/' . $file . $versionParameter); } } }
</fieldset> <fieldset class="personalblock"> <legend><strong><?php p($l->t('Version')); ?> </strong></legend> <strong><?php p($defaults->getName()); ?> </strong> <?php p(OC_Util::getVersionString()); if (OC_Util::getEditionString() === '') { ?> (<?php print_unescaped(OC_Updater::ShowUpdatingHint()); ?> )<br/> <?php print_unescaped($l->t('Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="https://github.com/owncloud" target="_blank">source code</a> is licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>.')); } ?> </fieldset> <fieldset class="personalblock credits-footer"> <p> <?php print_unescaped($defaults->getShortFooter()); ?> </p> </fieldset>
<?php /** * ownCloud - Updater plugin * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * * This file is licensed under the Affero General Public License version 3 or * later. */ ?> <?php $data = OC_Updater::check(); ?> <?php $isNewVersionAvailable = isset($data['version']) && $data['version'] != '' && $data['version'] !== Array() ?> <div id="updater-content" ng-app="updater" ng-init="navigation='backup'"> <ul ng-model="navigation"> <li ng-click="navigation='backup'" ng-class="{current : navigation=='backup'}"><?php p($l->t('Backup Management')) ?></li> <li ng-click="navigation='update'" ng-class="{current : navigation=='update'}"><?php p($l->t('Update')) ?></li> </ul> <fieldset ng-controller="backupCtrl" ng-show="navigation=='backup'"> <label for="backupbase"><?php p($l->t('Backup directory')) ?></label> <input readonly="readonly" type="text" id="backupbase" value="<?php p(\OCA\Updater\App::getBackupBase()); ?>" /> <table ng-controller="backupCtrl"> <thead ng-hide="!entries.length"> <tr> <th><?php p($l->t('Backup')) ?></th> <th><?php p($l->t('Done on')) ?></th> <th> </th> </tr> </thead>