migrate share helper method to IConfig

This commit is contained in:
Morris Jobke 2015-03-18 13:07:39 +01:00
parent f4b6f3cfd1
commit 378eef7eb4
1 changed files with 5 additions and 3 deletions

View File

@ -164,14 +164,16 @@ class Helper extends \OC\Share\Constants {
*/ */
public static function getDefaultExpireSetting() { public static function getDefaultExpireSetting() {
$config = \OC::$server->getConfig();
$defaultExpireSettings = array('defaultExpireDateSet' => false); $defaultExpireSettings = array('defaultExpireDateSet' => false);
// get default expire settings // get default expire settings
$defaultExpireDate = \OC_Appconfig::getValue('core', 'shareapi_default_expire_date', 'no'); $defaultExpireDate = $config->getAppValue('core', 'shareapi_default_expire_date', 'no');
if ($defaultExpireDate === 'yes') { if ($defaultExpireDate === 'yes') {
$enforceExpireDate = \OC_Appconfig::getValue('core', 'shareapi_enforce_expire_date', 'no'); $enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
$defaultExpireSettings['defaultExpireDateSet'] = true; $defaultExpireSettings['defaultExpireDateSet'] = true;
$defaultExpireSettings['expireAfterDays'] = (int)\OC_Appconfig::getValue('core', 'shareapi_expire_after_n_days', '7'); $defaultExpireSettings['expireAfterDays'] = (int)($config->getAppValue('core', 'shareapi_expire_after_n_days', '7'));
$defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes' ? true : false; $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes' ? true : false;
} }