kopia lustrzana https://github.com/magicbug/Cloudlog
				
				
				
			If Clublog returns 403 disable upload
							rodzic
							
								
									54fae037a8
								
							
						
					
					
						commit
						0292ba56f7
					
				|  | @ -107,6 +107,14 @@ class Clublog extends CI_Controller { | |||
| 							} else { | ||||
| 								echo "Error ".$response; | ||||
| 								log_message('error', 'Clublog upload for '.$station_row->station_callsign.' failed reason '.$response); | ||||
| 
 | ||||
| 								// If Clublog responds with a 403
 | ||||
| 								if ($info['http_code'] == 403) { | ||||
| 									$this->load->model('clublog_model'); | ||||
| 									echo "Clublog API access denied for ".$station_row->station_callsign."<br>"; | ||||
| 									log_message('error', 'Clublog API access denied for '.$station_row->station_callsign); | ||||
| 									$this->clublog_model->reset_clublog_user_fields($station_row->user_id); | ||||
| 								} | ||||
| 							} | ||||
| 
 | ||||
| 							// Delete the ADIF file used for clublog
 | ||||
|  |  | |||
|  | @ -17,6 +17,17 @@ class Clublog_model extends CI_Model { | |||
| 		return $row = $query->row_array(); | ||||
| 	} | ||||
| 
 | ||||
| 	// function to reset clublog fields for the user in the auth table
 | ||||
| 	function reset_clublog_user_fields($user_id) { | ||||
| 		$data = array( | ||||
| 			'user_clublog_name' => null, | ||||
| 			'user_clublog_password' => null, | ||||
| 		); | ||||
| 
 | ||||
| 		$this->db->where('user_id', $user_id); | ||||
| 		$this->db->update($this->config->item('auth_table'), $data); | ||||
| 	} | ||||
| 
 | ||||
| 	function mark_qsos_sent($station_id) { | ||||
| 		$data = array( | ||||
| 	        'COL_CLUBLOG_QSO_UPLOAD_DATE' => date('Y-m-d'), | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Peter Goodhall
						Peter Goodhall