From: Dan Untenzu Date: Fri, 13 Jan 2017 14:39:12 +0000 (+0100) Subject: [FEATURE] Set default expiration time in config X-Git-Tag: 1.2.0~8 X-Git-Url: https://git.p6c8.net/jirafeau.git/commitdiff_plain/dfa4d5337602a1de5910a95cf0cda85292049a11?ds=sidebyside;hp=--cc [FEATURE] Set default expiration time in config Enable the admin to set a default expiration time in the configuration time. This way the upload form may offer "hour", "day", "month" as available expiration times and "day" is preselected. Default in the original configuration is "month". Refs #57 --- dfa4d5337602a1de5910a95cf0cda85292049a11 diff --git a/index.php b/index.php index ca67e7f..4b50ec1 100644 --- a/index.php +++ b/index.php @@ -171,27 +171,41 @@ if (jirafeau_has_upload_password ($cfg)) diff --git a/lib/config.original.php b/lib/config.original.php index 8f55113..b07f0e2 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -85,6 +85,10 @@ $cfg['availabilities'] = array ('minute' => true, 'month' => true, 'year' => false, 'none' => false); +/* Set a default value for the expiration time. + * The value has to equal one of the enabled options in »availabilities«, e.g. »month«) + */ +$cfg['availability_default'] = 'month'; /* Set maximal upload size expressed in MB. * 0 mean unlimited upload size. */ diff --git a/script.php b/script.php index cae34a9..b455003 100644 --- a/script.php +++ b/script.php @@ -246,7 +246,7 @@ elseif (isset ($_GET['lang'])) # Config proxy='' # ex: proxy='proxysever.test.com:3128' or set JIRAFEAU_PROXY global variable url='' # or set JIRAFEAU_URL ex: url='http://mysite/jirafeau/script.php' -time='month' # minute, hour, day, week, month, year or none. Or set JIRAFEAU_TIME. +time='' # minute, hour, day, week, month, year or none. Or set JIRAFEAU_TIME. one_time='' # ex: one_time="1" or set JIRAFEAU_ONE_TIME. curl='' # curl path to download or set JIRAFEAU_CURL_PATH. # End of config