From 061938cbb52215bca59b90350fdecc4cecf07a3c Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sat, 9 Jun 2012 17:56:23 +0200 Subject: finally fix the updater. next is an automatic updater. but this is a bit more tricky. --- lib/updater.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/updater.php') 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=''.$data['versionstring'].' is available. Get more information'; + if(OC_Config::getValue('updatechecker', true)==true){ + $data=OC_Updater::check(); + if(isset($data['version']) and $data['version']<>'') { + $txt=''.$data['versionstring'].' is available. Get more information'; + }else{ + $txt='up to date'; + } }else{ - $txt='up to date'; + $txt='updates check is disabled'; } return($txt); } + /** * do ownCloud update */ -- cgit v1.2.3