mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Import LoTW cert serial into db
This commit is contained in:
@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
||||
|
|
||||
*/
|
||||
|
||||
$config['migration_version'] = 265;
|
||||
$config['migration_version'] = 266;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -144,14 +144,14 @@ class Lotw extends CI_Controller {
|
||||
// New Certificate Store in Database
|
||||
|
||||
// Store Certificate Data into MySQL
|
||||
$this->Lotw_model->store_certificate($this->session->userdata('user_id'), $info['issued_callsign'], $info['dxcc-id'], $info['validFrom'], $info['validTo_Date'], $info['qso-first-date'], $info['qso-end-date'], $info['pem_key'], $info['general_cert']);
|
||||
$this->Lotw_model->store_certificate($this->session->userdata('user_id'), $info['issued_callsign'], $info['dxcc-id'], $info['validFrom'], $info['validTo_Date'], $info['qso-first-date'], $info['qso-end-date'], $info['pem_key'], $info['general_cert'], $info['serialNumber']);
|
||||
|
||||
// Cert success flash message
|
||||
$this->session->set_flashdata('success', $info['issued_callsign'] . ' ' . __("Certificate Imported."));
|
||||
} else {
|
||||
// Certificate is in the system time to update
|
||||
|
||||
$this->Lotw_model->update_certificate($this->session->userdata('user_id'), $info['issued_callsign'], $info['dxcc-id'], $info['validFrom'], $info['validTo_Date'], $info['qso-first-date'], $info['qso-end-date'], $info['pem_key'], $info['general_cert']);
|
||||
$this->Lotw_model->update_certificate($this->session->userdata('user_id'), $info['issued_callsign'], $info['dxcc-id'], $info['validFrom'], $info['validTo_Date'], $info['qso-first-date'], $info['qso-end-date'], $info['pem_key'], $info['general_cert'], $info['serialNumber']);
|
||||
|
||||
// Cert success flash message
|
||||
$this->session->set_flashdata('success', $info['issued_callsign'] . ' ' . __("Certificate Updated."));
|
||||
@@ -462,6 +462,7 @@ class Lotw extends CI_Controller {
|
||||
$certdata= openssl_x509_parse($results['cert'],0);
|
||||
|
||||
// Store Variables
|
||||
$data['serialNumber'] = $certdata['serialNumber'];
|
||||
$data['issued_callsign'] = $certdata['subject']['undefined'];
|
||||
$data['issued_name'] = $certdata['subject']['commonName'];
|
||||
$data['validFrom'] = date('Y-m-d H:i:s', $certdata['validFrom_time_t']);
|
||||
|
||||
@@ -39,8 +39,9 @@ class Lotw_model extends CI_Model {
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
||||
function store_certificate($user_id, $callsign, $dxcc, $date_created, $date_expires, $qso_start_date, $qso_end_date, $cert_key, $general_cert) {
|
||||
function store_certificate($user_id, $callsign, $dxcc, $date_created, $date_expires, $qso_start_date, $qso_end_date, $cert_key, $general_cert, $serial) {
|
||||
$data = array(
|
||||
'serial' => $serial,
|
||||
'user_id' => $user_id,
|
||||
'callsign' => $callsign,
|
||||
'cert_dxcc_id' => $dxcc,
|
||||
@@ -55,8 +56,9 @@ class Lotw_model extends CI_Model {
|
||||
$this->db->insert('lotw_certs', $data);
|
||||
}
|
||||
|
||||
function update_certificate($user_id, $callsign, $dxcc, $date_created, $date_expires, $qso_start_date, $qso_end_date, $cert_key, $general_cert) {
|
||||
function update_certificate($user_id, $callsign, $dxcc, $date_created, $date_expires, $qso_start_date, $qso_end_date, $cert_key, $general_cert, $serial) {
|
||||
$data = array(
|
||||
'serial' => $serial,
|
||||
'cert_dxcc_id' => $dxcc,
|
||||
'date_created' => $date_created,
|
||||
'date_expires' => $date_expires,
|
||||
|
||||
Reference in New Issue
Block a user