mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Get rid of config directory for clublog uploads
This commit is contained in:
@@ -51,29 +51,23 @@ class Clublog_model extends CI_Model
|
||||
$return = 'Unable to write the file - Make the folder Upload folder has write permissions.';
|
||||
} else {
|
||||
|
||||
$file_info = get_file_info('uploads/clublog' . $ranid . $station_row->station_id . '.adi');
|
||||
|
||||
// initialise the curl request
|
||||
$request = curl_init('https://clublog.org/putlogs.php');
|
||||
|
||||
if ($this->config->item('directory') != "") {
|
||||
$filepath = $_SERVER['DOCUMENT_ROOT'] . "/" . $this->config->item('directory') . "/" . $file_info['server_path'];
|
||||
} else {
|
||||
$filepath = $_SERVER['DOCUMENT_ROOT'] . "/" . $file_info['server_path'];
|
||||
}
|
||||
$filepath = realpath('uploads/clublog' . $ranid . $station_row->station_id . '.adi');
|
||||
|
||||
// Check if the file actually exists
|
||||
if (!file_exists($filepath)) {
|
||||
$return .= " Clublog upload for " . $station_row->station_callsign . ' failed. Upload file could not be created.';
|
||||
log_message('info', $return);
|
||||
log_message('error', $return);
|
||||
return $return . "\n";
|
||||
}
|
||||
|
||||
if (function_exists('curl_file_create')) { // php 5.5+
|
||||
$cFile = curl_file_create($filepath);
|
||||
} else { //
|
||||
$cFile = '@' . realpath($filepath);
|
||||
} else {
|
||||
$cFile = '@' . $filepath;
|
||||
}
|
||||
$cFile->setPostFilename(basename($filepath));
|
||||
|
||||
// send a file
|
||||
curl_setopt($request, CURLOPT_POST, true);
|
||||
@@ -100,7 +94,6 @@ class Clublog_model extends CI_Model
|
||||
}
|
||||
curl_close($request);
|
||||
|
||||
|
||||
// If Clublog Accepts mark the QSOs
|
||||
if (($httpcode == 200) || (preg_match('/\baccepted\b/', $response))) {
|
||||
$return = "QSOs uploaded and Logbook QSOs marked as sent to Clublog.";
|
||||
|
||||
Reference in New Issue
Block a user