- $type = '';
- if (isset ($_POST['type']))
- $type = $_POST['type'];
-
- $key = '';
- if (isset ($_POST['key']))
- $key = $_POST['key'];
-
- $time = time ();
- if (!isset ($_POST['time']) || !$cfg['availabilities'][$_POST['time']])
- {
- echo 'Error 22';
- exit;
- }
- else
- switch ($_POST['time'])
- {
- case 'minute':
- $time += JIRAFEAU_MINUTE;
- break;
- case 'hour':
- $time += JIRAFEAU_HOUR;
- break;
- case 'day':
- $time += JIRAFEAU_DAY;
- break;
- case 'week':
- $time += JIRAFEAU_WEEK;
- break;
- case 'month':
- $time += JIRAFEAU_MONTH;
- break;
- case 'year':
- $time += JIRAFEAU_YEAR;
- break;
- default:
- $time = JIRAFEAU_INFINITY;
- break;
- }
- echo jirafeau_async_init ($_POST['filename'],
- $type,
- isset ($_POST['one_time_download']),
- $key,
- $time,
- get_ip_address($cfg));
+ echo jirafeau_async_init(
+ $_POST['filename'],
+ $type,
+ isset($_POST['one_time_download']),
+ $key,
+ $time,
+ $ip
+ );