// echo "<pre>".print_r($_REQUEST,true)."</pre>"; // echo "<pre>".print_r($_FILES,true)."</pre>"; // TODO v3.2x ext variables $file_name = $_FILES['file']['name']; $shortdescription = cleanvar($_REQUEST['shortdescription']); $longdescription = cleanvar($_REQUEST['longdescription']); $fileversion = cleanvar($_REQUEST['fileversion']); $expirytype = cleanvar($_REQUEST['expiry_none']); if ($expirytype == 'time') { $days = cleanvar($_REQUEST['expiry_days']); $hours = cleanvar($_REQUEST['expiry_hours']); $minutes = cleanva($_REQUEST['expiry_minutes']); if ($days < 1 && $hours < 1 && $minutes < 1) { $expirydate = 0; } else { $expirydate = calculate_time_of_next_action($days, $hours, $minutes); } } elseif ($expirytype == 'date') { $day = cleanvar($_REQUEST['day']); $month = cleanvar($_REQUEST['month']); $year = cleanvar($_REQUEST['year']); $date = explode("-", $date); $expirydate = mktime(0, 0, 0, $month, $day, $year); } else { $expirydate = 0; } // receive the uploaded file to a temp directory on the local server if ($_FILES['file']['error'] != '' and $_FILES['file']['error'] != UPLOAD_ERR_OK) { echo get_file_upload_error_message($_FILES['file']['error'], $_FILES['file']['name']); } else { $filepath = $CONFIG['attachment_fspath'] . $file_name;
$errors = 1; $error_string .= "{$strIncidentTypeWasBlank}"; } if ($type == 'free' and $servicelevel == '') { $errors++; $error_string .= "{$strYouMustSelectAserviceLevel}"; } if ($errors == 0) { // add incident (assigned to current user) // Calculate the time to next action switch ($timetonextaction_none) { case 'none': $timeofnextaction = 0; break; case 'time': $timeofnextaction = calculate_time_of_next_action($timetonextaction_days, $timetonextaction_hours, $timetonextaction_minutes); break; case 'date': // $now + ($days * 86400) + ($hours * 3600) + ($minutes * 60); $unixdate = mktime(9, 0, 0, $month, $day, $year); $now = time(); $timeofnextaction = $unixdate; if ($timeofnextaction < 0) { $timeofnextaction = 0; } break; default: $timeofnextaction = 0; break; } // Set the service level the contract
if (!$upload) { echo "{$strUploadFailed}<br />"; } else { echo sprintf($strUpdatedXToYAsZ, $source_file, $CONFIG['ftp_hostname'], $destination_filepath) . "<br />"; echo "<code>{$ftp_url}</code>"; journal(CFG_LOGGING_NORMAL, 'FTP File Published', "File {$destination_file_file} was published to {$CONFIG['ftp_hostname']}", CFG_JOURNAL_OTHER, 0); switch ($expiry_none) { case 'none': $expirydate = 0; break; case 'time': if ($expiry_days < 1 && $expiry_hours < 1 && $expiry_minutes < 1) { $expirydate = 0; } else { // uses calculate_time_of_next_action() because the function suits our purpose $expirydate = calculate_time_of_next_action($expiry_days, $expiry_hours, $expiry_minutes); } break; case 'date': // $now + ($days * 86400) + ($hours * 3600) + ($minutes * 60); $unixdate = mktime(9, 0, 0, $month, $day, $year); $expirydate = $unixdate; if ($expirydate < 0) { $expirydate = 0; } break; default: $expirydate = 0; break; } // store file details in database