mirror of
https://gitlab.com/mojo42/Jirafeau.git
synced 2025-04-22 12:36:17 +02:00
[FEATURE] Add »quarter« expiration time
Add »quarter« (3 x 1 Month = 90 days) as available expiration time. This option is disabled by default. Refs #87
This commit is contained in:
parent
dfa4d53376
commit
28606cf6b8
@ -78,13 +78,16 @@ $cfg['admin_http_auth_user'] = '';
|
||||
* 'year': file available for one year
|
||||
* 'none': unlimited availability
|
||||
*/
|
||||
$cfg['availabilities'] = array ('minute' => true,
|
||||
'hour' => true,
|
||||
'day' => true,
|
||||
'week' => true,
|
||||
'month' => true,
|
||||
'year' => false,
|
||||
'none' => false);
|
||||
$cfg['availabilities'] = array (
|
||||
'minute' => true,
|
||||
'hour' => true,
|
||||
'day' => true,
|
||||
'week' => true,
|
||||
'month' => true,
|
||||
'quarter' => false,
|
||||
'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«)
|
||||
*/
|
||||
|
@ -232,6 +232,11 @@ function add_time_string_to_date(d, time)
|
||||
d.setSeconds (d.getSeconds() + 2419200);
|
||||
return true;
|
||||
}
|
||||
if (time == 'quarter')
|
||||
{
|
||||
d.setSeconds (d.getSeconds() + 7257600);
|
||||
return true;
|
||||
}
|
||||
if (time == 'year')
|
||||
{
|
||||
d.setSeconds (d.getSeconds() + 29030400);
|
||||
|
@ -14,6 +14,7 @@
|
||||
"One day": "",
|
||||
"One week": "",
|
||||
"One month": "",
|
||||
"One quarter": "",
|
||||
"One year": "",
|
||||
"None": "",
|
||||
"Upload password": "",
|
||||
|
@ -37,6 +37,7 @@ define ('JIRAFEAU_HOUR', 3600); // JIRAFEAU_MINUTE * 60
|
||||
define ('JIRAFEAU_DAY', 86400); // JIRAFEAU_HOUR * 24
|
||||
define ('JIRAFEAU_WEEK', 604800); // JIRAFEAU_DAY * 7
|
||||
define ('JIRAFEAU_MONTH', 2419200); // JIRAFEAU_WEEK * 4
|
||||
define ('JIRAFEAU_QUARTER', 7257600); // JIRAFEAU_MONTH * 3
|
||||
define ('JIRAFEAU_YEAR', 29030400); // JIRAFEAU_MONTH * 12
|
||||
|
||||
?>
|
||||
|
@ -119,6 +119,9 @@ if (isset ($_FILES['file']) && is_writable (VAR_FILES)
|
||||
case 'month':
|
||||
$time += JIRAFEAU_MONTH;
|
||||
break;
|
||||
case 'quarter':
|
||||
$time += JIRAFEAU_QUARTER;
|
||||
break;
|
||||
case 'year':
|
||||
$time += JIRAFEAU_YEAR;
|
||||
break;
|
||||
@ -504,6 +507,9 @@ elseif (isset ($_GET['init_async']))
|
||||
case 'month':
|
||||
$time += JIRAFEAU_MONTH;
|
||||
break;
|
||||
case 'quarter':
|
||||
$time += JIRAFEAU_QUARTER;
|
||||
break;
|
||||
case 'year':
|
||||
$time += JIRAFEAU_YEAR;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user