]> source.dussan.org Git - nextcloud-server.git/commitdiff
finally fix the updater. next is an automatic updater. but this is a bit more tricky.
authorFrank Karlitschek <frank@owncloud.org>
Sat, 9 Jun 2012 15:56:23 +0000 (17:56 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Sat, 9 Jun 2012 15:56:23 +0000 (17:56 +0200)
config/config.sample.php
lib/updater.php

index 3648bdebda55665defc500de0edc09ad9b6f0d70..2205ee1b47b1db0c02eeed08acd2223e3ef1d158 100644 (file)
@@ -30,6 +30,7 @@ $CONFIG = array(
 "logfile" => "",
 "loglevel" => "",
 "passwordsalt" => "",
+"updatechecker" => true,
 // "datadirectory" => ""
 );
 ?>
index deb0f05945e88beb3503a228d9a1b59f04c797fb..07904ef5f130735f69656ecc393e344683240439 100644 (file)
@@ -30,11 +30,12 @@ class OC_Updater{
         */
        public static function check(){
                OC_Appconfig::setValue('core', 'lastupdatedat',microtime(true));
+               if(OC_Appconfig::getValue('core', 'installedat','')=='') OC_Appconfig::setValue('core', 'installedat',microtime(true));
 
                $updaterurl='http://apps.owncloud.com/updater.php';
                $version=OC_Util::getVersion();
-               $version['installed']=OC_Config::getValue('installedat');
-               $version['updated']=OC_Appconfig::getValue('core', 'lastupdatedat', OC_Config::getValue( 'lastupdatedat'));
+               $version['installed']=OC_Appconfig::getValue('core', 'installedat');
+               $version['updated']=OC_Appconfig::getValue('core', 'lastupdatedat');
                $version['updatechannel']='stable';
                $version['edition']=OC_Util::getEditionString();
                $versionstring=implode('x',$version);
@@ -57,15 +58,20 @@ class OC_Updater{
        }
 
        public static function ShowUpdatingHint(){
-               $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>';
+               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='up to date';
+                       $txt='updates check is disabled';
                }
                return($txt);
        }
 
+
        /**
         * do ownCloud update
         */