Merge pull request #2252 from int2001/qrz_fix
Qrz failure fixing - Fixes https://github.com/magicbug/Cloudlog/issues/2198
这个提交包含在:
		
						当前提交
						23710ea70f
					
				
					共有  2 个文件被更改,包括 8 次插入 和 2 次删除
				
			
		| 
						 | 
					@ -71,9 +71,15 @@ class Qrz extends CI_Controller {
 | 
				
			||||||
                    $result = $this->logbook_model->push_qso_to_qrz($qrz_api_key, $adif);
 | 
					                    $result = $this->logbook_model->push_qso_to_qrz($qrz_api_key, $adif);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if ($result['status'] == 'OK') {
 | 
							if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') && ($result['message'] == 'STATUS=FAIL&REASON=Unable to add QSO to database: duplicate&EXTENDED=')) ){
 | 
				
			||||||
                    $this->markqso($qso->COL_PRIMARY_KEY);
 | 
					                    $this->markqso($qso->COL_PRIMARY_KEY);
 | 
				
			||||||
                    $i++;
 | 
					                    $i++;
 | 
				
			||||||
 | 
							} elseif ( ($result['status']=='error') && (substr($result['message'],0,11)  == 'STATUS=AUTH')) {
 | 
				
			||||||
 | 
					                    log_message('error', 'QRZ upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON);
 | 
				
			||||||
 | 
					                    log_message('error', 'QRZ upload failed with the following message: ' .$result['message']);
 | 
				
			||||||
 | 
					                    log_message('error', 'QRZ upload stopped for Station_ID: ' .$station_id);
 | 
				
			||||||
 | 
					                    $errormessages[] = $result['message'] . ' Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON;
 | 
				
			||||||
 | 
							    break; /* If key is invalid, immediate stop syncing for more QSOs of this station */
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    log_message('error', 'QRZ upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON);
 | 
					                    log_message('error', 'QRZ upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON);
 | 
				
			||||||
                    log_message('error', 'QRZ upload failed with the following message: ' .$result['message']);
 | 
					                    log_message('error', 'QRZ upload failed with the following message: ' .$result['message']);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -519,7 +519,7 @@ class Logbook_model extends CI_Model {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			$adif = $CI->adifhelper->getAdifLine($qso[0]);
 | 
								$adif = $CI->adifhelper->getAdifLine($qso[0]);
 | 
				
			||||||
			$result = $this->push_qso_to_qrz($result->qrzapikey, $adif);
 | 
								$result = $this->push_qso_to_qrz($result->qrzapikey, $adif);
 | 
				
			||||||
			if ($result['status'] == 'OK') {
 | 
								if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') && ($result['message'] == 'STATUS=FAIL&REASON=Unable to add QSO to database: duplicate&EXTENDED=')) ){
 | 
				
			||||||
				$this->mark_qrz_qsos_sent($last_id);
 | 
									$this->mark_qrz_qsos_sent($last_id);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		正在加载…
	
		在新工单中引用