From bc4970fbe400266ba12fb54f84c5a544ecad9bf0 Mon Sep 17 00:00:00 2001 From: Corby Krick Date: Sat, 17 Aug 2013 09:08:26 -0500 Subject: [PATCH] Adding support for editing the eQSL credentials --- application/controllers/user.php | 12 ++++++++++++ application/models/user_model.php | 8 +++++++- application/views/user/edit.php | 15 +++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/application/controllers/user.php b/application/controllers/user.php index 3bbe33c7..fc720cd9 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -202,6 +202,18 @@ class User extends CI_Controller { $data['user_lotw_password'] = $q->user_lotw_password; } + if($this->input->post('user_eqsl_name')) { + $data['user_eqsl_name'] = $this->input->post('user_eqsl_name'); + } else { + $data['user_eqsl_name'] = $q->user_eqsl_name; + } + + if($this->input->post('user_eqsl_password')) { + $data['user_eqsl_password'] = $this->input->post('user_eqsl_password'); + } else { + $data['user_eqsl_password'] = $q->user_eqsl_password; + } + $this->load->view('user/edit', $data); $this->load->view('layout/footer'); } diff --git a/application/models/user_model.php b/application/models/user_model.php index 0e2eb503..5d697f01 100644 --- a/application/models/user_model.php +++ b/application/models/user_model.php @@ -122,7 +122,8 @@ class User_Model extends CI_Model { 'user_firstname' => $fields['user_firstname'], 'user_lastname' => $fields['user_lastname'], 'user_timezone' => $fields['user_timezone'], - 'user_lotw_name' => $fields['user_lotw_name'] + 'user_lotw_name' => $fields['user_lotw_name'], + 'user_eqsl_name' => $fields['user_eqsl_name'] ); // Check to see if the user is allowed to change user levels @@ -153,6 +154,11 @@ class User_Model extends CI_Model { $data['user_lotw_password'] = $fields['user_lotw_password']; } + if($fields['user_eqsl_password'] != NULL) + { + $data['user_eqsl_password'] = $fields['user_eqsl_password']; + } + // Update the user $this->db->where('user_id', $fields['id']); $this->db->update($this->config->item('auth_table'), $data); diff --git a/application/views/user/edit.php b/application/views/user/edit.php index 0efff654..f55a3ef2 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -100,6 +100,21 @@ $this->load->helper('form'); + + eQSL.cc Username + + ".$usereqslname_error.""; } ?> + + + + + eQSL.cc Password + + ".$eqslpassword_error.""; } else { ?> +
Leave blank to keep existing password
+ + +