summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
00b364b)
- Add 'year' in list of possible durations
- By default, 'year' and 'none' durations are disabled
<tr>
<td><label for="select_time"><?php echo t('Time limit') . ':'; ?></label></td>
<td><select name="time" id="select_time">
<tr>
<td><label for="select_time"><?php echo t('Time limit') . ':'; ?></label></td>
<td><select name="time" id="select_time">
- <option value="none"><?php echo t('None'); ?></option>
+ <?php if ($cfg['availabilities']['minute']) { ?>
<option value = "minute"><?php echo t('One minute'); ?></option>
<option value = "minute"><?php echo t('One minute'); ?></option>
+ <?php } ?>
+ <?php if ($cfg['availabilities']['hour']) { ?>
<option value = "hour"><?php echo t('One hour'); ?></option>
<option value = "hour"><?php echo t('One hour'); ?></option>
+ <?php } ?>
+ <?php if ($cfg['availabilities']['day']) { ?>
<option value = "day"><?php echo t('One day'); ?></option>
<option value = "day"><?php echo t('One day'); ?></option>
+ <?php } ?>
+ <?php if ($cfg['availabilities']['week']) { ?>
<option value = "week"><?php echo t('One week'); ?></option>
<option value = "week"><?php echo t('One week'); ?></option>
+ <?php } ?>
+ <?php if ($cfg['availabilities']['month']) { ?>
<option value = "month"><?php echo t('One month');?></option>
<option value = "month"><?php echo t('One month');?></option>
+ <?php } ?>
+ <?php if ($cfg['availabilities']['year']) { ?>
+ <option value = "year"><?php echo t('One year');?></option>
+ <?php } ?>
+ <?php if ($cfg['availabilities']['none']) { ?>
+ <option value="none"><?php echo t('None'); ?></option>
+ <?php } ?>
</select></td>
</tr>
<p id="max_file_size" class="config"></p>
</select></td>
</tr>
<p id="max_file_size" class="config"></p>
* If admin_password parameter is also set, admin_password is ignored.
*/
$cfg['admin_http_auth_user'] = '';
* If admin_password parameter is also set, admin_password is ignored.
*/
$cfg['admin_http_auth_user'] = '';
+/* Select different options for availability of uploaded files.
+ * Possible values in array:
+ * 'minute': file is available for one minute
+ * 'hour': file available for one hour
+ * 'day': file available for one day
+ * 'week': file available for one week
+ * 'month': file is available for one month
+ * '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);
/* Installation is done ? */
$cfg['installation_done'] = false;
/* Installation is done ? */
$cfg['installation_done'] = false;
d.setSeconds (d.getSeconds() + 604800);
else if (time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
d.setSeconds (d.getSeconds() + 604800);
else if (time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
+ else if (time == 'year')
+ d.setSeconds (d.getSeconds() + 29030400);
else
return;
show_link (url, res[0], res[1], res[2], d.toString());
else
return;
show_link (url, res[0], res[1], res[2], d.toString());
d.setSeconds (d.getSeconds() + 604800);
else if (async_global_time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
d.setSeconds (d.getSeconds() + 604800);
else if (async_global_time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
+ else if (async_global_time == 'year')
+ d.setSeconds (d.getSeconds() + 29030400);
else
return;
show_link (async_global_url, res[0], res[1], res[2], d.toString());
else
return;
show_link (async_global_url, res[0], res[1], res[2], d.toString());
'Maximum file size' => 'Taille maximale',
'powered by Open-Source project Jirafeau' => 'Propulsé par le projet Open-Source Jirafeau',
'Jirafeau Project' => 'Projet Jirafeau',
'Maximum file size' => 'Taille maximale',
'powered by Open-Source project Jirafeau' => 'Propulsé par le projet Open-Source Jirafeau',
'Jirafeau Project' => 'Projet Jirafeau',
'One minute' => 'Une minute',
'One hour' => 'Une heure',
'One day' => 'Une journée',
'One week' => 'Une semaine',
'One month' => 'Un mois',
'One minute' => 'Une minute',
'One hour' => 'Une heure',
'One day' => 'Une journée',
'One week' => 'Une semaine',
'One month' => 'Un mois',
+ 'One year' => 'Une année',
+ 'None' => 'Aucune',
'Upload password' => 'Mot de passe',
'The file directory is not writable' => 'Le dossier \'file\' ne peut être écrit.',
'The link directory is not writable' => 'Le dossier \'link\' ne peut être écrit.',
'Upload password' => 'Mot de passe',
'The file directory is not writable' => 'Le dossier \'file\' ne peut être écrit.',
'The link directory is not writable' => 'Le dossier \'link\' ne peut être écrit.',
define ('JIRAFEAU_DAY', 86400); // JIRAFEAU_HOUR * 24
define ('JIRAFEAU_WEEK', 604800); // JIRAFEAU_DAY * 7
define ('JIRAFEAU_MONTH', 2419200); // JIRAFEAU_WEEK * 4
define ('JIRAFEAU_DAY', 86400); // JIRAFEAU_HOUR * 24
define ('JIRAFEAU_WEEK', 604800); // JIRAFEAU_DAY * 7
define ('JIRAFEAU_MONTH', 2419200); // JIRAFEAU_WEEK * 4
+define ('JIRAFEAU_MONTH', 29030400); // JIRAFEAU_MONTH * 12
echo '<br />';
echo t('Parameters') . ':<br />';
echo "<b>file=</b>C:\\your\\file\\path<i> (" . t('Required') . ")</i> <br />";
echo '<br />';
echo t('Parameters') . ':<br />';
echo "<b>file=</b>C:\\your\\file\\path<i> (" . t('Required') . ")</i> <br />";
- echo "<b>time=</b>[minute|hour|day|week|month|none]<i> (" . t('Optional') . ', '. t('default: none') . ")</i> <br />";
+ echo "<b>time=</b>[minute|hour|day|week|month|year|none]<i> (" . t('Optional') . ', '. t('default: none') . ")</i> <br />";
echo "<b>password=</b>your_password<i> (" . t('Optional') . ")</i> <br />";
echo "<b>one_time_download=</b>1<i> (" . t('Optional') . ")</i> <br />";
echo "<b>upload_password=</b>your_upload_password<i> (" . t('Optional') . ")</i> <br />";
echo "<b>password=</b>your_password<i> (" . t('Optional') . ")</i> <br />";
echo "<b>one_time_download=</b>1<i> (" . t('Optional') . ")</i> <br />";
echo "<b>upload_password=</b>your_upload_password<i> (" . t('Optional') . ")</i> <br />";
echo t('Parameters') . ':<br />';
echo "<b>filename=</b>file_name.ext<i> (" . t('Required') . ")</i> <br />";
echo "<b>type=</b>MIME_TYPE<i> (" . t('Optional') . ")</i> <br />";
echo t('Parameters') . ':<br />';
echo "<b>filename=</b>file_name.ext<i> (" . t('Required') . ")</i> <br />";
echo "<b>type=</b>MIME_TYPE<i> (" . t('Optional') . ")</i> <br />";
- echo "<b>time=</b>[minute|hour|day|week|month|none]<i> (" . t('Optional') . ', '. t('default: none') . ")</i> <br />";
+ echo "<b>time=</b>[minute|hour|day|week|month|year|none]<i> (" . t('Optional') . ', '. t('default: none') . ")</i> <br />";
echo "<b>password=</b>your_password<i> (" . t('Optional') . ")</i> <br />";
echo "<b>one_time_download=</b>1<i> (" . t('Optional') . ")</i> <br />";
echo "<b>upload_password=</b>your_upload_password<i> (" . t('Optional') . ")</i> <br />";
echo "<b>password=</b>your_password<i> (" . t('Optional') . ")</i> <br />";
echo "<b>one_time_download=</b>1<i> (" . t('Optional') . ")</i> <br />";
echo "<b>upload_password=</b>your_upload_password<i> (" . t('Optional') . ")</i> <br />";
$key = $_POST['key'];
$time = time ();
$key = $_POST['key'];
$time = time ();
- if (!isset ($_POST['time']))
- $time = JIRAFEAU_INFINITY;
+ if (!isset ($_POST['time']) || !$cfg['availabilities'][$_POST['time']])
+ {
+ echo "Error";
+ exit;
+ }
else
switch ($_POST['time'])
{
else
switch ($_POST['time'])
{
case 'month':
$time += JIRAFEAU_MONTH;
break;
case 'month':
$time += JIRAFEAU_MONTH;
break;
+ case 'year':
+ $time += JIRAFEAU_YEAR;
+ break;
+ default:
$time = JIRAFEAU_INFINITY;
break;
}
$time = JIRAFEAU_INFINITY;
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'
# 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='none' # minute, hour, day, week, month or none. Or set JIRAFEAU_TIME.
+time='none' # 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
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 "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, month or none"
+ echo " JIRAFEAU_TIME : minute, hour, day, week, year, month or none"
echo " JIRAFEAU_ONE_TIME : set anything or set empty"
echo " JIRAFEAU_CURL : path to your curl binary"
echo " JIRAFEAU_ONE_TIME : set anything or set empty"
echo " JIRAFEAU_CURL : path to your curl binary"
$key = $_POST['key'];
$time = time ();
$key = $_POST['key'];
$time = time ();
- if (!isset ($_POST['time']))
- $time = JIRAFEAU_INFINITY;
+ if (!isset ($_POST['time']) || !$cfg['availabilities'][$_POST['time']])
+ {
+ echo "Error";
+ exit;
+ }
else
switch ($_POST['time'])
{
else
switch ($_POST['time'])
{
case 'month':
$time += JIRAFEAU_MONTH;
break;
case 'month':
$time += JIRAFEAU_MONTH;
break;
+ case 'year':
+ $time += JIRAFEAU_YEAR;
+ break;
default:
$time = JIRAFEAU_INFINITY;
break;
default:
$time = JIRAFEAU_INFINITY;
break;