Skip to content

Commit

Permalink
Merge pull request #3400 from NamelessMC/release/2.1.1
Browse files Browse the repository at this point in the history
Release/2.1.1
  • Loading branch information
samerton authored Jun 18, 2023
2 parents f5e1a2e + 7ff744d commit 333726f
Show file tree
Hide file tree
Showing 82 changed files with 836 additions and 310 deletions.
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
# NamelessMC v2 Changelog

## [Unreleased](https://github.com/NamelessMC/Nameless/compare/v2.1.0...v2)
## [Unreleased](https://github.com/NamelessMC/Nameless/compare/v2.1.1...v2)
> [Milestone](https://github.com/NamelessMC/Nameless/milestone/21)
## [2.1.1](https://github.com/NamelessMC/Nameless/compare/v2.1.0...v2.1.1) - 2023-06-18
### Added
- Add Russian translation for Members module [#3352](https://github.com/NamelessMC/Nameless/pull/3352)

### Changed
- Add all missing languages to the Members module [#3350](https://github.com/NamelessMC/Nameless/pull/3350)
- Remove unable to update groups catch [#3360](https://github.com/NamelessMC/Nameless/pull/3360)
- Call compileQueries only when needed [#3386](https://github.com/NamelessMC/Nameless/pull/3386)
- Remove Discord discriminator requirement [#3374](https://github.com/NamelessMC/Nameless/pull/3374)
- Require module autoload file before module init [#3397](https://github.com/NamelessMC/Nameless/pull/3397)

### Fixed
- Fix AuthMe enabled value [#3349](https://github.com/NamelessMC/Nameless/pull/3349)
- Ensure Minecraft integration is enabled [#3356](https://github.com/NamelessMC/Nameless/pull/3356)
- Include .htaccess file in release zip [#3362](https://github.com/NamelessMC/Nameless/pull/3362)
- Fix missing cache settings [#3361](https://github.com/NamelessMC/Nameless/pull/3361)
- Fix user group issue [#3365](https://github.com/NamelessMC/Nameless/pull/3365)
- Fix forum title/description encoding on edit [#3359](https://github.com/NamelessMC/Nameless/pull/3359)
- Remove placeholder from singular message [#3369](https://github.com/NamelessMC/Nameless/pull/3369)
- Fix not being able to see Members page in Navigation settings [#3372](https://github.com/NamelessMC/Nameless/pull/3372)
- Fix multi query [#3383](https://github.com/NamelessMC/Nameless/pull/3383)
- Fix icon not being properly shown [#3377](https://github.com/NamelessMC/Nameless/pull/3377)
- Fix ghost player on status page [#3351](https://github.com/NamelessMC/Nameless/pull/3351)
- Fix outdated event [#3394](https://github.com/NamelessMC/Nameless/pull/3394)
- Fix OAuth linking for forced integrations [#3395](https://github.com/NamelessMC/Nameless/pull/3395)

## [2.1.0](https://github.com/NamelessMC/Nameless/compare/v2.0.3...v2.1.0) - 2023-05-01
### Added
- Add dark mode toggle switch [#2877](https://github.com/NamelessMC/Nameless/pull/2877)
Expand Down
5 changes: 3 additions & 2 deletions core/classes/Core/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Samerton
* @author Partydragen
* @author Aberdeener
* @version 2.0.2
* @version 2.1.1
* @license MIT
*/
class User {
Expand Down Expand Up @@ -130,7 +130,7 @@ private function find(string $value, string $field = 'id'): bool {
* @return bool True on success, false if they already have it.
*/
public function addGroup(int $group_id, int $expire = 0): bool {
if (array_key_exists($group_id, $this->_groups ?? [])) {
if (array_key_exists($group_id, $this->getGroups())) {
return false;
}

Expand Down Expand Up @@ -545,6 +545,7 @@ public function getGroups(): array {
$default_group = Group::find(1, 'default_group');
$default_group_id = $default_group->id ?? 1;

$this->_groups = [];
$this->addGroup($default_group_id);
}

Expand Down
4 changes: 2 additions & 2 deletions core/classes/Database/DatabaseInitialiser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class DatabaseInitialiser {

private function __construct() {
$this->_db = DB::getInstance();
$this->_cache = new Cache();
$this->_cache = new Cache(['name' => 'nameless', 'extension' => '.cache', 'path' => ROOT_PATH . '/cache/']);
}

public static function runPreUser() {
Expand Down Expand Up @@ -183,7 +183,7 @@ private function initialiseSettings(): void {
Util::setSetting('recaptcha_type', 'Recaptcha3');
Util::setSetting('recaptcha_login', '0');
Util::setSetting('email_verification', '1');
Util::setSetting('nameless_version', '2.1.0');
Util::setSetting('nameless_version', '2.1.1');
Util::setSetting('version_checked', date('U'));
Util::setSetting('phpmailer', '0');
Util::setSetting('user_avatars', '0');
Expand Down
15 changes: 13 additions & 2 deletions core/classes/Database/QueryRecorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ class QueryRecorder extends Instanceable {
* @return array SQL queries
*/
public function getSqlStack(): array {
return array_reverse($this->_query_stack);
$stack = array_reverse($this->_query_stack);

// Compile queries - replace bound parameters with their values and syntax highlight
foreach ($stack as &$query) {
$query['sql_query'] = $this->compileQuery(
$query['sql_string'],
$query['sql_params']
);
}

return $stack;
}

/**
Expand All @@ -38,7 +48,8 @@ public function pushQuery(string $sql, array $params): void {
$this->_query_stack[] = [
'number' => $this->_query_stack_num,
'frame' => ErrorHandler::parseFrame(null, $backtrace['file'], $backtrace['line'], $this->_query_stack_num),
'sql_query' => $this->compileQuery($sql, $params)
'sql_string' => $sql,
'sql_params' => $params,
];

$this->_query_stack_num++;
Expand Down
9 changes: 5 additions & 4 deletions core/classes/Minecraft/PluginQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,18 @@ public static function multiQuery(array $servers, Language $language, bool $accu
$cache->setCache('latest_query');

foreach ($servers as $server) {
$server_id = $server->id;
$data = $cache->retrieve($server_id);
$server_id = $server['id'];

if (!$cache->isCached($server_id) && $accumulate === true) {
$to_return[] = [
'name' => Output::getClean($data['name']),
'name' => Output::getClean($server['name']),
'status_value' => 0,
'status' => $language->get('general', 'offline'),
'server_offline' => $language->get('general', 'server_offline')
];
} else {
// Server is online
$data = $cache->retrieve($server_id);
if ($accumulate === false) {
$to_return[] = [
'name' => Output::getClean($server['name']),
Expand Down Expand Up @@ -107,4 +108,4 @@ public static function multiQuery(array $servers, Language $language, bool $accu

return $to_return;
}
}
}
1 change: 1 addition & 0 deletions core/classes/Misc/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public static function catchException(?Throwable $exception, ?string $error_stri
'PRISM_CSS' => $path . 'plugins/prism/prism_light_atom.css',
'PRISM_JS' => $path . 'plugins/prism/prism.js',
'DETAILED_ERROR' => Debugging::canViewDetailedError(),
'LOGO' => $path . 'img/namelessmc_logo.png',
'FATAL_ERROR_TITLE' => $language->get('errors', 'fatal_error_title'),
'FATAL_ERROR_MESSAGE_ADMIN' => $language->get('errors', 'fatal_error_message_admin'),
'FATAL_ERROR_MESSAGE_USER' => $language->get('errors', 'fatal_error_message_user'),
Expand Down
2 changes: 1 addition & 1 deletion core/includes/error.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{if $DETAILED_ERROR}
<div class="ui inverted borderless menu" style="border-radius: 0;">
<span class="item">
<img style="width: 30px; height: 30px;" src="core/assets/img/namelessmc_logo.png" alt="Logo">&nbsp;
<img style="width: 30px; height: 30px;" src="{$LOGO}" alt="Logo">&nbsp;
</span>
<div class="right menu">
<a class="item" target="_blank" href="https://discord.gg/nameless">
Expand Down
24 changes: 0 additions & 24 deletions core/includes/updates/202.php

This file was deleted.

43 changes: 0 additions & 43 deletions core/includes/updates/203.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php

return new class extends UpgradeScript {

public function run(): void {
$this->runMigrations();

$this->setVersion('2.0.2');
$this->setVersion('2.1.1');
}
};
12 changes: 10 additions & 2 deletions core/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.2
* NamelessMC version 2.1.1
*
* License: MIT
*
Expand Down Expand Up @@ -454,9 +454,17 @@
return $a['priority'] - $b['priority'];
});

// Load module dependencies
foreach ($enabled_modules as $module) {
if (file_exists(ROOT_PATH . '/modules/' . $module['name'] . '/autoload.php')) {
require_once ROOT_PATH . '/modules/' . $module['name'] . '/autoload.php';
}
}

// Load modules
foreach ($enabled_modules as $module) {
if (file_exists(ROOT_PATH . '/modules/' . $module['name'] . '/init.php')) {
require(ROOT_PATH . '/modules/' . $module['name'] . '/init.php');
require_once ROOT_PATH . '/modules/' . $module['name'] . '/init.php';
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/templates/frontend_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.3
* NamelessMC version 2.1.1
*
* License: MIT
*
Expand Down Expand Up @@ -33,7 +33,7 @@
}

// Check if any integrations is required before user can continue
if ($user->isLoggedIn() && defined('PAGE') && PAGE != 'cc_connections') {
if ($user->isLoggedIn() && defined('PAGE') && PAGE != 'cc_connections' && PAGE != 'oauth') {
foreach (Integrations::getInstance()->getEnabledIntegrations() as $integration) {
if ($integration->data()->required && $integration->allowLinking()) {
$integrationUser = $user->getIntegration($integration->getName());
Expand Down
2 changes: 1 addition & 1 deletion custom/languages/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@
"time/less_than_a_minute": "před méně než minutou",
"time/over_x_years": "před {{count}} lety",
"user/1_new_alert": "Máte 1 nové upozornění",
"user/1_new_message": "Máte {{count}} novou zprávu",
"user/1_new_message": "Máte 1 novou zprávu",
"user/1_reaction": "1 reakce",
"user/1_reply": "1 odpověď",
"user/about": "O uživateli",
Expand Down
Loading

0 comments on commit 333726f

Please sign in to comment.