X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FUpdater.php;h=dece2c020d297fdf13bf8773b76cb37895328025;hb=4ff3ed1c47365d5b28f70cb2921b0ac0075612c3;hp=8d2bd577d1a27c3f60588f9949f4ab5a311da433;hpb=d449f79a0d7ca808b891baf73b9e25ce7f7e48fe;p=github%2Fshaarli%2FShaarli.git diff --git a/application/Updater.php b/application/Updater.php index 8d2bd577..dece2c02 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -445,6 +445,44 @@ class Updater $this->linkDB->save($this->conf->get('resource.page_cache')); return true; } + + /** + * Change privateonly session key to visibility. + */ + public function updateMethodVisibilitySession() + { + if (isset($_SESSION['privateonly'])) { + unset($_SESSION['privateonly']); + $_SESSION['visibility'] = 'private'; + } + return true; + } + + /** + * Add download size and timeout to the configuration file + * + * @return bool true if the update is successful, false otherwise. + */ + public function updateMethodDownloadSizeAndTimeoutConf() + { + if ($this->conf->exists('general.download_max_size') + && $this->conf->exists('general.download_timeout') + ) { + return true; + } + + if (! $this->conf->exists('general.download_max_size')) { + $this->conf->set('general.download_max_size', 1024*1024*4); + } + + if (! $this->conf->exists('general.download_timeout')) { + $this->conf->set('general.download_timeout', 30); + } + + $this->conf->write($this->isLoggedIn); + + return true; + } } /**