diff --git a/application/config/migration.php b/application/config/migration.php index ceb663f7..b5509fd4 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 125; +$config['migration_version'] = 126; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/User.php b/application/controllers/User.php index 2d89e0ad..f29bb11d 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -84,6 +84,7 @@ class User extends CI_Controller { $data['user_show_profile_image'] = $this->input->post('user_show_profile_image'); $data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type'); $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload'); + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $this->load->view('user/add', $data); } else { $this->load->view('user/add', $data); @@ -116,7 +117,8 @@ class User extends CI_Controller { $this->input->post('user_column5'), $this->input->post('user_show_profile_image'), $this->input->post('user_previous_qsl_type'), - $this->input->post('user_amsat_status_upload'))) { + $this->input->post('user_amsat_status_upload'), + $this->input->post('user_mastodon_url'))) { // Check for errors case EUSERNAMEEXISTS: $data['username_error'] = 'Username '.$this->input->post('user_name').' already in use!'; @@ -159,6 +161,7 @@ class User extends CI_Controller { $data['user_show_profile_image'] = $this->input->post('user_show_profile_image'); $data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type'); $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload'); + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $this->load->view('user/add', $data); $this->load->view('interface_assets/footer'); } @@ -366,6 +369,12 @@ class User extends CI_Controller { $data['user_amsat_status_upload'] = $q->user_amsat_status_upload; } + if($this->input->post('user_mastodon_url')) { + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url', false); + } else { + $data['user_mastodon_url'] = $q->user_mastodon_url; + } + if($this->input->post('user_column1')) { $data['user_column1'] = $this->input->post('user_column1', true); } else { @@ -451,6 +460,7 @@ class User extends CI_Controller { $data['user_show_profile_image'] = $this->input->post('user_show_profile_image'); $data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type'); $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload'); + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $this->load->view('user/edit'); $this->load->view('interface_assets/footer'); } diff --git a/application/language/english/account_lang.php b/application/language/english/account_lang.php index a5172c94..99a7ac1a 100644 --- a/application/language/english/account_lang.php +++ b/application/language/english/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Forgot your password?'; $lang['account_login_to_cloudlog'] = 'Login to Cloudlog'; $lang['account_login'] = 'Login'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL of Mastodonserver'; diff --git a/application/language/finnish/account_lang.php b/application/language/finnish/account_lang.php index 5adf7910..183fc453 100644 --- a/application/language/finnish/account_lang.php +++ b/application/language/finnish/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Salasana unohtunut?'; $lang['account_login_to_cloudlog'] = 'Kirjaudu Cloudlogiin'; $lang['account_login'] = 'Kirjaudu'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL of Mastodonserver'; diff --git a/application/language/german/account_lang.php b/application/language/german/account_lang.php index d0400d8e..e1fa729d 100644 --- a/application/language/german/account_lang.php +++ b/application/language/german/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Passwort vergessen?'; $lang['account_login_to_cloudlog'] = 'Anmeldung bei Cloudlog'; $lang['account_login'] = 'Anmeldung'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL des Mastodonservers'; diff --git a/application/language/russian/account_lang.php b/application/language/russian/account_lang.php index c4e676a4..b2841b1c 100644 --- a/application/language/russian/account_lang.php +++ b/application/language/russian/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Забыли пароль?'; $lang['account_login_to_cloudlog'] = 'Вход в Cloudlog'; $lang['account_login'] = 'Вход'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL of Mastodonserver'; diff --git a/application/migrations/126_mastodon_url.php b/application/migrations/126_mastodon_url.php new file mode 100644 index 00000000..0e938588 --- /dev/null +++ b/application/migrations/126_mastodon_url.php @@ -0,0 +1,31 @@ +db->field_exists('user_mastodon_url', 'users')) { + $fields = array( + 'user_mastodon_url varchar(32) default NULL', + ); + $this->dbforge->add_column('users', $fields, 'user_column5'); + } + } + + public function down() + { + $this->dbforge->drop_column('users', 'user_mastodon_url'); + } +} + + + diff --git a/application/models/User_model.php b/application/models/User_model.php index d58cf883..8234f9b2 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -123,7 +123,7 @@ class User_Model extends CI_Model { function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone, $measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup, $user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5, - $user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload) { + $user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -152,6 +152,7 @@ class User_Model extends CI_Model { 'user_show_profile_image' => xss_clean($user_show_profile_image), 'user_previous_qsl_type' => xss_clean($user_previous_qsl_type), 'user_amsat_status_upload' => xss_clean($user_amsat_status_upload), + 'user_mastodon_url' => xss_clean($user_mastodon_url), ); // Check the password is valid @@ -208,6 +209,7 @@ class User_Model extends CI_Model { 'user_show_profile_image' => xss_clean($fields['user_show_profile_image']), 'user_previous_qsl_type' => xss_clean($fields['user_previous_qsl_type']), 'user_amsat_status_upload' => xss_clean($fields['user_amsat_status_upload']), + 'user_mastodon_url' => xss_clean($fields['user_mastodon_url']), ); // Check to see if the user is allowed to change user levels @@ -328,6 +330,7 @@ class User_Model extends CI_Model { 'user_column5' => isset($u->row()->user_column5) ? $u->row()->user_column5: 'Country', 'user_previous_qsl_type' => isset($u->row()->user_previous_qsl_type) ? $u->row()->user_previous_qsl_type: 0, 'user_amsat_status_upload' => isset($u->row()->user_amsat_status_upload) ? $u->row()->user_amsat_status_upload: 0, + 'user_mastodon_url' => $u->row()->user_mastodon_url, 'active_station_logbook' => $u->row()->active_station_logbook, ); diff --git a/application/views/user/add.php b/application/views/user/add.php index d3a0492e..0d50db0e 100644 --- a/application/views/user/add.php +++ b/application/views/user/add.php @@ -514,6 +514,20 @@ +