From dfa4d5337602a1de5910a95cf0cda85292049a11 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Fri, 13 Jan 2017 15:39:12 +0100 Subject: [PATCH] [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 --- index.php | 56 +++++++++++++++++++++++++---------------- lib/config.original.php | 4 +++ script.php | 2 +- 3 files changed, 40 insertions(+), 22 deletions(-) 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 -- 2.34.1