diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-06-09 17:56:23 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-06-09 17:56:23 +0200 |
commit | 061938cbb52215bca59b90350fdecc4cecf07a3c (patch) | |
tree | 10f2c722c3e678cb8b521a710ab67ff4f4fc92c6 | |
parent | 642e7ce110cb8c320072532c29abe003385d50f5 (diff) | |
download | nextcloud-server-061938cbb52215bca59b90350fdecc4cecf07a3c.tar.gz nextcloud-server-061938cbb52215bca59b90350fdecc4cecf07a3c.zip |
finally fix the updater. next is an automatic updater. but this is a bit more tricky.
-rw-r--r-- | config/config.sample.php | 1 | ||||
-rw-r--r-- | lib/updater.php | 18 |
2 files changed, 13 insertions, 6 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 3648bdebda5..2205ee1b47b 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -30,6 +30,7 @@ $CONFIG = array( "logfile" => "", "loglevel" => "", "passwordsalt" => "", +"updatechecker" => true, // "datadirectory" => "" ); ?> diff --git a/lib/updater.php b/lib/updater.php index deb0f05945e..07904ef5f13 100644 --- a/lib/updater.php +++ b/lib/updater.php @@ -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 */ |