Merge pull request #2806 from phl0/fixLotwDownloadFilePermissions
Check file/dir permissions prior to LoTW download
这个提交包含在:
		
						当前提交
						3825e6e72e
					
				
					共有  2 个文件被更改,包括 25 次插入 和 4 次删除
				
			
		|  | @ -746,10 +746,24 @@ class Lotw extends CI_Controller { | ||||||
| 				$lotw_url .= "&qso_owncall=".$this->input->post('callsign'); | 				$lotw_url .= "&qso_owncall=".$this->input->post('callsign'); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | 			if (is_writable(dirname($file)) && (!file_exists($file) || is_writable($file))) { | ||||||
| 				file_put_contents($file, file_get_contents($lotw_url)); | 				file_put_contents($file, file_get_contents($lotw_url)); | ||||||
| 
 | 
 | ||||||
| 				ini_set('memory_limit', '-1'); | 				ini_set('memory_limit', '-1'); | ||||||
| 				$this->loadFromFile($file); | 				$this->loadFromFile($file); | ||||||
|  | 			} else { | ||||||
|  | 				if (!is_writable(dirname($file))) { | ||||||
|  | 					$data['errormsg'] = 'Directory '.dirname($file).' is not writable!'; | ||||||
|  | 				} else if (!is_writable($file)) { | ||||||
|  | 					$data['errormsg'] = 'File '.$file.' is not writable!'; | ||||||
|  | 				} | ||||||
|  | 				$this->load->model('Stations'); | ||||||
|  | 				$data['callsigns'] = $this->Stations->callsigns_of_user($this->session->userdata('user_id')); | ||||||
|  | 
 | ||||||
|  | 				$this->load->view('interface_assets/header', $data); | ||||||
|  | 				$this->load->view('lotw/import', $data); | ||||||
|  | 				$this->load->view('interface_assets/footer'); | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 		else | 		else | ||||||
| 		{ | 		{ | ||||||
|  |  | ||||||
|  | @ -2,10 +2,17 @@ | ||||||
| 
 | 
 | ||||||
|   <h2><?php echo lang('lotw_title'); ?> - <?php echo lang('lotw_title_adif_import'); ?></h2>
 |   <h2><?php echo lang('lotw_title'); ?> - <?php echo lang('lotw_title_adif_import'); ?></h2>
 | ||||||
| 
 | 
 | ||||||
|  |   <?php if (isset($errormsg)) { ?>
 | ||||||
|  |     <div class="alert alert-danger" role="alert"> | ||||||
|  |     <?php echo $errormsg; ?>
 | ||||||
|  |     </div> | ||||||
|  |   <?php } ?>
 | ||||||
|  | 
 | ||||||
|   <div class="card"> |   <div class="card"> | ||||||
|     <div class="card-header"><?php echo lang('lotw_title_adif_import_options'); ?></div>
 |     <div class="card-header"><?php echo lang('lotw_title_adif_import_options'); ?></div>
 | ||||||
|     <div class="card-body"> |     <div class="card-body"> | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|       <?php $this->load->view('layout/messages'); ?>
 |       <?php $this->load->view('layout/messages'); ?>
 | ||||||
| 
 | 
 | ||||||
|       <?php echo form_open_multipart('lotw/import'); ?>
 |       <?php echo form_open_multipart('lotw/import'); ?>
 | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用