'value' => 'day',
'label' => 'One day'
),
+ array(
+ 'value' => 'week',
+ 'label' => 'One week'
+ ),
array(
'value' => 'month',
'label' => 'One month'
),
+ array(
+ 'value' => 'quarter',
+ 'label' => 'One quarter'
+ ),
array(
'value' => 'year',
'label' => 'One year'
*/
$cfg['upload_ip'] = array();
/* An empty admin password will disable the classic admin password
- * authentication.
+ * authentication. Note that admin password is a sha256 hash of the original
+ * version.
*/
$cfg['admin_password'] = '';
/* If set, let's the user to be authenticated as administrator.
* '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«)
*/
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);
$handle = fopen ($link_tmp_name, 'w');
fwrite ($handle,
$name . NL. $mime_type . NL. $size . NL. $password . NL. $time .
- NL . $md5. NL . ($one_time_download ? 'O' : 'R') . NL . date ('U') .
+ NL . $md5. NL . ($one_time_download ? 'O' : 'R') . NL . time () .
NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C' : 'O'));
fclose ($handle);
$md5_link = substr(base_16_to_64 (md5_file ($link_tmp_name)), 0, $link_name_length);
if (!count ($a))
continue;
/* Delete transferts older than 1 hour. */
- if (date ('U') - $a['last_edited'] > 3600)
+ if (time () - $a['last_edited'] > 3600)
{
jirafeau_async_delete (basename ($node));
$count++;
str_replace (NL, '', trim ($filename)) . NL .
str_replace (NL, '', trim ($type)) . NL . $password . NL .
$time . NL . ($one_time ? 'O' : 'R') . NL . $ip . NL .
- date ('U') . NL . $code . NL);
+ time () . NL . $code . NL);
fclose ($handle);
return $ref . NL . $code ;
fwrite ($handle,
$a['file_name'] . NL. $a['mime_type'] . NL. $a['key'] . NL .
$a['time'] . NL . $a['onetime'] . NL . $a['ip'] . NL .
- date ('U') . NL . $code . NL);
+ time () . NL . $code . NL);
fclose ($handle);
return $code;
}
fwrite ($handle,
$a['file_name'] . NL . $a['mime_type'] . NL . $size . NL .
$a['key'] . NL . $a['time'] . NL . $md5 . NL . $a['onetime'] . NL .
- date ('U') . NL . $a['ip'] . NL . $delete_link_code . NL . ($crypted ? 'C' : 'O'));
+ time () . NL . $a['ip'] . NL . $delete_link_code . NL . ($crypted ? 'C' : 'O'));
fclose ($handle);
$md5_link = substr(base_16_to_64 (md5_file ($link_tmp_name)), 0, $link_name_length);
$l = s2p ("$md5_link");
fwrite ($handle,
$md5_password . NL .
$ip . NL .
- date ('U') . NL .
+ time () . NL .
$destination . NL);
fclose ($handle);
fwrite ($handle,
$p . NL .
$ip . NL .
- date ('U') . NL .
+ time () . NL .
$destination . NL);
fclose ($handle);
return 'Ok';
"One hour": "Eine Stunde",
"One minute": "Eine Minute",
"One month": "Ein Monat",
+ "One quarter": "Drei Monate",
"One time download": "Einmaliger Download",
"One week": "Eine Woche",
"One year": "Ein Jahr",
"One day": "Une journée",
"One hour": "Une heure",
"One minute": "Une minute",
- "One month": "Un mois",
+ "One month": "Un mois",
+ "One quarter": "Trois mois",
"One time download": "Téléchargement unique",
"One week": "Une semaine",
"One year": "Une année",
"One day": "",
"One week": "",
"One month": "",
+ "One quarter": "",
"One year": "",
"None": "",
"Upload password": "",
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
?>
case 'month':
$time += JIRAFEAU_MONTH;
break;
+ case 'quarter':
+ $time += JIRAFEAU_QUARTER;
+ break;
case 'year':
$time += JIRAFEAU_YEAR;
break;
# Config
proxy='' # ex: proxy='proxysever.test.com:3128' or set JIRAFEAU_PROXY global variable
url='<?php echo $cfg['web_root'] . 'script.php'; ?>' # or set JIRAFEAU_URL ex: url='http://mysite/jirafeau/script.php'
-time='<?php echo $cfg['availability_default']; ?>' # minute, hour, day, week, month, year or none. Or set JIRAFEAU_TIME.
+time='<?php echo $cfg['availability_default']; ?>' # minute, hour, day, week, month, quarted, 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
echo "Global variables to export:"
echo " JIRAFEAU_PROXY : example: proxysever.test.com:3128"
echo " JIRAFEAU_URL : example: http://mysite/jirafeau/script.php"
- echo " JIRAFEAU_TIME : minute, hour, day, week, year, month or none"
+ echo " JIRAFEAU_TIME : minute, hour, day, week, quarter, year, month or none"
echo " JIRAFEAU_ONE_TIME : set anything or set empty"
echo " JIRAFEAU_CURL : path to your curl binary"
case 'month':
$time += JIRAFEAU_MONTH;
break;
+ case 'quarter':
+ $time += JIRAFEAU_QUARTER;
+ break;
case 'year':
$time += JIRAFEAU_YEAR;
break;