Revert "Datastore improvements"

This commit is contained in:
Roman Kelesidis 2024-12-08 22:29:55 +07:00
commit 27be6863fc
19 changed files with 50 additions and 67 deletions

View file

@ -294,7 +294,7 @@ function auth($type, $forum_id, $ug_data, array $f_access = [], $group_perm = UG
// If f_access has been passed, or auth is needed to return an array of forums
// then we need to pull the auth information on the given forum (or all forums)
if (empty($f_access)) {
if (!$forums = $datastore->get('cat_forums') and !$datastore->has('cat_forums')) {
if (!$forums = $datastore->get('cat_forums')) {
$datastore->update('cat_forums');
$forums = $datastore->get('cat_forums');
}
@ -987,7 +987,7 @@ function make_jumpbox(): void
return;
}
if (!$jumpbox = $datastore->get('jumpbox') and !$datastore->has('jumpbox')) {
if (!$jumpbox = $datastore->get('jumpbox')) {
$datastore->update('jumpbox');
$jumpbox = $datastore->get('jumpbox');
}
@ -1008,7 +1008,7 @@ function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = n
$max_length = HTML_SELECT_MAX_LENGTH;
}
$select = null === $all_forums_option ? [] : [$lang['ALL_AVAILABLE'] => $all_forums_option];
if (!$forums = $datastore->get('cat_forums') and !$datastore->has('cat_forums')) {
if (!$forums = $datastore->get('cat_forums')) {
$datastore->update('cat_forums');
$forums = $datastore->get('cat_forums');
}
@ -1895,7 +1895,7 @@ function profile_url(array $data, bool $target_blank = false, bool $no_link = fa
{
global $bb_cfg, $lang, $datastore;
if (!$ranks = $datastore->get('ranks') and !$datastore->has('ranks')) {
if (!$ranks = $datastore->get('ranks')) {
$datastore->update('ranks');
$ranks = $datastore->get('ranks');
}
@ -2131,7 +2131,7 @@ function getBanInfo(int $userId = null): ?array
global $datastore;
// Get bans info from datastore
if (!$bans = $datastore->get('ban_list') and !$datastore->has('ban_list')) {
if (!$bans = $datastore->get('ban_list')) {
$datastore->update('ban_list');
$bans = $datastore->get('ban_list');
}