diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-06-09 17:43:02 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-06-09 17:43:02 +0200 |
commit | 897bfa8814eaebe6d0d44b8554b99725819214e7 (patch) | |
tree | fbac7af878018b6238a43e9af00dbccb72c7b781 /lib/updater.php | |
parent | d065b2d29edb4bb72492dde46293e77fa03b50d6 (diff) | |
download | nextcloud-server-897bfa8814eaebe6d0d44b8554b99725819214e7.tar.gz nextcloud-server-897bfa8814eaebe6d0d44b8554b99725819214e7.zip |
finally fix the updater. next is an automatic updater. but this is a bit more tricky.
Diffstat (limited to 'lib/updater.php')
-rw-r--r-- | lib/updater.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/updater.php b/lib/updater.php index bc5ee00b6a3..5d97178c30e 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,11 +58,15 @@ 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); } |