From 27178d86c62f90b2a1e843a113071207034593b5 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 24 Feb 2025 12:28:37 +0100 Subject: [PATCH] More space fixes --- application/controllers/Widgets.php | 2 +- .../237_user_callsign_public_slug.php | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/application/controllers/Widgets.php b/application/controllers/Widgets.php index 53c6e16d5..9fb31301f 100644 --- a/application/controllers/Widgets.php +++ b/application/controllers/Widgets.php @@ -289,7 +289,7 @@ class Widgets extends CI_Controller { private function prepare_last_seen_text($last_seen_days_ago) { if ($last_seen_days_ago === 0) { return "Last seen less than a day ago"; - } + } if ($last_seen_days_ago === 1) { return "Last seen yesterday"; } diff --git a/application/migrations/237_user_callsign_public_slug.php b/application/migrations/237_user_callsign_public_slug.php index d74d03174..74f3a9bfa 100644 --- a/application/migrations/237_user_callsign_public_slug.php +++ b/application/migrations/237_user_callsign_public_slug.php @@ -2,11 +2,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); -/** +/** * Create URL "slug" for each user that serves as an alias for a user_id. - * The purpose is to have user identifier for use in public URLs (i.e. for widget purposes) - * that is bound to one concrete user, as the widgets might contain privacy-sensitive data. - * This slug is to "mask" the user_id in lieu of avoiding brute-force iteration over + * The purpose is to have user identifier for use in public URLs (i.e. for widget purposes) + * that is bound to one concrete user, as the widgets might contain privacy-sensitive data. + * This slug is to "mask" the user_id in lieu of avoiding brute-force iteration over * user_ids in URL that might be available in particular Wavelog instance. */ class Migration_user_callsign_public_slug extends CI_Migration { @@ -15,25 +15,25 @@ class Migration_user_callsign_public_slug extends CI_Migration { { // Step 1: Add user slug column if (!$this->db->field_exists('slug', 'users')) { - $fields = array( - 'slug varchar(50) DEFAULT NULL' - ); - $this->dbforge->add_column('users', $fields); - } + $fields = array( + 'slug varchar(50) DEFAULT NULL' + ); + $this->dbforge->add_column('users', $fields); + } // Step 2: Create public user-slug for each user if (!$this->load->is_loaded('encryption')) { $this->load->library('encryption'); } - $fetch_result = $this->db->get($this->config->item('auth_table')); + $fetch_result = $this->db->get($this->config->item('auth_table')); if ($fetch_result && $fetch_result->num_rows() > 0) { foreach ($fetch_result->result_array() as $user_row) { if ($user_row["slug"] === null) { $user_name = $user_row["user_name"]; $user_slug_base = md5($this->encryption->encrypt($user_name)); $url_slug = substr($user_slug_base, 0, USER_SLUG_LENGTH); - + // update the slug only in case the slug does not exist yet $user_id = $user_row["user_id"]; $this->db->where('user_id', $user_id); @@ -50,7 +50,7 @@ class Migration_user_callsign_public_slug extends CI_Migration { public function down() { if ($this->db->field_exists('slug', 'users')) { - $this->dbforge->drop_column('users', 'slug'); - } + $this->dbforge->drop_column('users', 'slug'); + } } }