From 69618a3fde4d1de6b08c1925c5b051ecddf72c5f Mon Sep 17 00:00:00 2001 From: Spuds Date: Sun, 31 Mar 2024 14:49:31 -0500 Subject: [PATCH 1/3] ! fix #3778 plus add another global option --- sources/ElkArte/Languages/Profile/English.php | 1 + sources/ElkArte/Profile/ProfileHistory.php | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sources/ElkArte/Languages/Profile/English.php b/sources/ElkArte/Languages/Profile/English.php index dde4600614..3eaeb83707 100644 --- a/sources/ElkArte/Languages/Profile/English.php +++ b/sources/ElkArte/Languages/Profile/English.php @@ -333,6 +333,7 @@ $txt['whois_arin'] = 'ARIN (North America, a portion of the Caribbean and sub-Saharan Africa)'; $txt['whois_lacnic'] = 'LACNIC (Latin American and Caribbean region)'; $txt['whois_ripe'] = 'RIPE (Europe, the Middle East and parts of Africa and Asia)'; +$txt['whois_iplocation'] = 'IPLOCATION (Worldwide)'; $txt['moderator_why_missing'] = 'why isn\'t moderator here?'; $txt['username_change'] = 'change'; diff --git a/sources/ElkArte/Profile/ProfileHistory.php b/sources/ElkArte/Profile/ProfileHistory.php index 9dd06da526..e6cb6f4b20 100644 --- a/sources/ElkArte/Profile/ProfileHistory.php +++ b/sources/ElkArte/Profile/ProfileHistory.php @@ -20,6 +20,7 @@ use ElkArte\Action; use ElkArte\Exceptions\Exception; use ElkArte\Languages\Txt; +use ElkArte\Member; use ElkArte\MembersList; /** @@ -30,7 +31,7 @@ class ProfileHistory extends AbstractController /** @var int Member id for the history being viewed */ private $_memID = 0; - /** @var \ElkArte\Member The \ElkArte\Member object is stored here to avoid some global */ + /** @var Member The \ElkArte\Member object is stored here to avoid some global */ private $_profile; /** @@ -483,26 +484,26 @@ public function action_trackip() if ($context['single_ip']) { $context['whois_servers'] = [ - 'afrinic' => [ - 'name' => $txt['whois_afrinic'], - 'url' => 'http://www.afrinic.net/whois?searchtext=' . $context['ip'], - ], 'apnic' => [ 'name' => $txt['whois_apnic'], - 'url' => 'http://wq.apnic.net/apnic-bin/whois.pl?searchtext=' . $context['ip'], + 'url' => 'https://wq.apnic.net/apnic-bin/whois.pl?searchtext=' . $context['ip'], ], 'arin' => [ 'name' => $txt['whois_arin'], - 'url' => 'http://whois.arin.net/rest/ip/' . $context['ip'], + 'url' => 'https://whois.arin.net/rest/ip/' . $context['ip'], ], 'lacnic' => [ 'name' => $txt['whois_lacnic'], - 'url' => 'http://lacnic.net/cgi-bin/lacnic/whois?query=' . $context['ip'], + 'url' => 'https://query.milacnic.lacnic.net/search?id=' . $context['ip'], ], 'ripe' => [ 'name' => $txt['whois_ripe'], - 'url' => 'https://apps.db.ripe.net/search/query.html?searchtext=' . $context['ip'], + 'url' => 'https://apps.db.ripe.net/db-web-ui/query?searchtext=' . $context['ip'], ], + 'iplocation' => [ + 'name' => $txt['whois_iplocation'], + 'url' => 'https://www.iplocation.net/?query=' . $context['ip'], + ] ]; // Let integration add whois servers easily From 29de37ad4da3422da60c6bb9f168aa7f07db44e3 Mon Sep 17 00:00:00 2001 From: Spuds Date: Sun, 31 Mar 2024 14:50:06 -0500 Subject: [PATCH 2/3] ! install tweaks for hide email --- install/Install_Controller.php | 2 +- install/install_2-0.php | 1 - install/upgrade_2-0.php | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/install/Install_Controller.php b/install/Install_Controller.php index 435019c3a6..934a8bc1ef 100644 --- a/install/Install_Controller.php +++ b/install/Install_Controller.php @@ -1231,7 +1231,7 @@ private function action_adminAccount() $db_prefix . 'members', [ 'member_name' => 'string-25', 'real_name' => 'string-25', 'passwd' => 'string', 'email_address' => 'string', - 'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'hide_email' => 'int', + 'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'password_salt' => 'string', 'lngfile' => 'string', 'avatar' => 'string', 'member_ip' => 'string', 'member_ip2' => 'string', 'buddy_list' => 'string', 'pm_ignore_list' => 'string', 'message_labels' => 'string', 'website_title' => 'string', 'website_url' => 'string', diff --git a/install/install_2-0.php b/install/install_2-0.php index d79acbdbc3..3edbb10fb2 100644 --- a/install/install_2-0.php +++ b/install/install_2-0.php @@ -1814,7 +1814,6 @@ public function table_members() array('name' => 'birthdate', 'type' => 'date', 'default' => '0001-01-01'), array('name' => 'website_title', 'type' => 'varchar', 'size' => 255, 'default' => ''), array('name' => 'website_url', 'type' => 'varchar', 'size' => 255, 'default' => ''), - array('name' => 'hide_email', 'type' => 'tinyint', 'size' => 4, 'default' => 0), array('name' => 'show_online', 'type' => 'tinyint', 'size' => 4, 'default' => 1), array('name' => 'time_format', 'type' => 'varchar', 'size' => 80, 'default' => ''), array('name' => 'signature', 'type' => 'text'), diff --git a/install/upgrade_2-0.php b/install/upgrade_2-0.php index fa713c1696..80c26d1acd 100644 --- a/install/upgrade_2-0.php +++ b/install/upgrade_2-0.php @@ -746,4 +746,24 @@ public function remove_sendtopic() ) ); } + + public function preparing_hideemail_title() + { + return 'Removing hide email option (always on now)...'; + } + + public function preparing_hideemail() + { + return array( + array( + 'debug_title' => 'Dropping column hide_email...', + 'function' => function () { + if ($this->table->column_exists('{db_prefix}members', 'hide_email') !== false) + { + $this->table->remove_column('{db_prefix}members', 'hide_email'); + } + } + ) + ); + } } From b1411ecf3e054598e12d90524fbce36e1808687a Mon Sep 17 00:00:00 2001 From: Spuds Date: Sun, 31 Mar 2024 15:38:45 -0500 Subject: [PATCH 3/3] ! missed one in test setup --- .github/SetupDbUtil.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/SetupDbUtil.php b/.github/SetupDbUtil.php index eb5b647ef6..54b8ee7533 100644 --- a/.github/SetupDbUtil.php +++ b/.github/SetupDbUtil.php @@ -272,7 +272,7 @@ public function update() {db_prefix}members', [ 'member_name' => 'string-25', 'real_name' => 'string-25', 'passwd' => 'string', 'email_address' => 'string', - 'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'hide_email' => 'int', + 'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'password_salt' => 'string', 'lngfile' => 'string', 'avatar' => 'string', 'member_ip' => 'string', 'member_ip2' => 'string', 'buddy_list' => 'string', 'pm_ignore_list' => 'string', 'message_labels' => 'string', 'website_title' => 'string', 'website_url' => 'string', @@ -281,7 +281,7 @@ public function update() ], [ 'test_admin', 'test_admin', $passwd, 'email@testadmin.tld', - 1, 0, time(), 0, + 1, 0, time(), substr(md5(mt_rand()), 0, 4), '', '', '123.123.123.123', '123.123.123.123', '', '', '', '', '',