rev.23 Update config

Change data type for some settings.
This commit is contained in:
Visman 2020-10-30 21:26:21 +07:00
parent f6cef733d9
commit 0fdeb3aa19
26 changed files with 164 additions and 121 deletions

View file

@ -490,8 +490,8 @@ class Routing
if (
$user->isAdmin
|| '0' == $config->o_report_method
|| '2' == $config->o_report_method
|| 0 === $config->i_report_method
|| 2 === $config->i_report_method
) {
$r->add(
$r::GET,

View file

@ -33,7 +33,7 @@ class Model extends DataModel
$this->c->GROUP_MEMBER
];
return ! \in_array($this->g_id, $notDeleted) && $this->g_id != $this->c->config->o_default_user_group;
return ! \in_array($this->g_id, $notDeleted) && $this->g_id !== $this->c->config->i_default_user_group;
}
/**

View file

@ -18,8 +18,8 @@ class Info extends Method
return null;
}
$this->model->maxNum = (int) $this->c->config->st_max_users;
$this->model->maxTime = (int) $this->c->config->st_max_users_time;
$this->model->maxNum = $this->c->config->a_max_users['number'];
$this->model->maxTime = $this->c->config->a_max_users['time'];
$info = [];
if ('1' == $this->c->user->g_view_users) {

View file

@ -135,9 +135,11 @@ class Model extends ParentModel
}
// обновление максимального значение посетителей онлайн
if ($this->c->config->st_max_users < $all) {
$this->c->config->st_max_users = $all;
$this->c->config->st_max_users_time = $now;
if ($this->c->config->a_max_users['number'] < $all) {
$this->c->config->a_max_users = [
'number' => $all,
'time' => $now,
];
$this->c->config->save();
}

View file

@ -54,8 +54,8 @@ class Admin extends Page
}
if (
$this->user->isAdmin
|| '0' == $this->c->config->o_report_method
|| '2' == $this->c->config->o_report_method
|| 0 === $this->c->config->i_report_method
|| 2 === $this->c->config->i_report_method
) {
$nav['reports'] = [$r->link('AdminReports'), __('Reports')];
}

View file

@ -373,14 +373,14 @@ class Bans extends Admin
}
$page = isset($args['page']) ? (int) $args['page'] : 1;
$pages = (int) \ceil(($number ?: 1) / $this->c->config->o_disp_users);
$pages = (int) \ceil(($number ?: 1) / $this->c->config->i_disp_users);
if ($page > $pages) {
return $this->c->Message->message('Bad request');
}
$startNum = ($page - 1) * $this->c->config->o_disp_users;
$idsN = \array_slice($idsN, $startNum, (int) $this->c->config->o_disp_users);
$startNum = ($page - 1) * $this->c->config->i_disp_users;
$idsN = \array_slice($idsN, $startNum, $this->c->config->i_disp_users);
$banList = $this->c->bans->getList($idsN);
$this->nameTpl = 'admin/bans_result';

View file

@ -74,7 +74,7 @@ class Groups extends Admin
'basegroup' => [
'type' => 'select',
'options' => $this->groupsNew,
'value' => $this->c->config->o_default_user_group,
'value' => $this->c->config->i_default_user_group,
'caption' => __('New group label'),
'info' => __('New group help'),
# 'autofocus' => true,
@ -109,7 +109,7 @@ class Groups extends Admin
'defaultgroup' => [
'type' => 'select',
'options' => $this->groupsDefault,
'value' => $this->c->config->o_default_user_group,
'value' => $this->c->config->i_default_user_group,
'caption' => __('Default group label'),
'info' => __('Default group help'),
],
@ -145,7 +145,7 @@ class Groups extends Admin
return $this->view();
}
$this->c->config->o_default_user_group = $v->defaultgroup;
$this->c->config->i_default_user_group = $v->defaultgroup;
$this->c->config->save();
return $this->c->Redirect->page('AdminGroups')->message('Default group redirect');
@ -268,7 +268,7 @@ class Groups extends Admin
if (
! $group->groupGuest
&& ! $group->groupMember
&& $group->g_id != $this->c->config->o_default_user_group
&& $group->g_id !== $this->c->config->i_default_user_group
) {
$v->addRules([
'g_moderator' => 'integer|in:0,1',
@ -446,7 +446,7 @@ class Groups extends Admin
if (
! $group->groupGuest
&& ! $group->groupMember
&& $group->g_id != $this->c->config->o_default_user_group
&& $group->g_id !== $this->c->config->i_default_user_group
) {
$fieldset['g_moderator'] = [
'type' => 'radio',
@ -786,7 +786,7 @@ class Groups extends Admin
'movegroup' => [
'type' => 'select',
'options' => $groups,
'value' => $this->c->config->o_default_user_group,
'value' => $this->c->config->i_default_user_group,
'caption' => __('Move users label'),
'info' => __('Move users info', $group->g_title, $count),
],

View file

@ -1068,7 +1068,6 @@ class Install extends Admin
'o_timeout_visit' => 3600,
'o_timeout_online' => 900,
'o_redirect_delay' => 1,
'o_show_version' => 0,
'o_show_user_info' => 1,
'o_show_post_count' => 1,
'o_smilies' => 1,
@ -1076,11 +1075,11 @@ class Install extends Admin
'o_make_links' => 1,
'o_default_lang' => $v->defaultlang,
'o_default_style' => $v->defaultstyle,
'o_default_user_group' => $this->c->GROUP_NEW_MEMBER,
'o_topic_review' => 15,
'o_disp_topics_default' => 30,
'o_disp_posts_default' => 25,
'o_disp_users' => 50,
'i_default_user_group' => $this->c->GROUP_NEW_MEMBER,
'i_topic_review' => 15,
'i_disp_topics_default' => 30,
'i_disp_posts_default' => 25,
'i_disp_users' => 50,
'o_quickpost' => 1,
'o_users_online' => 1,
'o_censoring' => 0,
@ -1088,15 +1087,15 @@ class Install extends Admin
'o_topic_views' => 1,
'o_quickjump' => 1,
'o_additional_navlinks' => '',
'o_report_method' => 0,
'i_report_method' => 0,
'o_regs_report' => 0,
'o_default_email_setting' => 2,
'i_default_email_setting' => 2,
'o_mailing_list' => $v->email,
'o_avatars' => \in_array(\strtolower(@\ini_get('file_uploads')), ['on', 'true', '1']) ? 1 : 0,
'o_avatars_dir' => '/img/avatars',
'o_avatars_width' => 60,
'o_avatars_height' => 60,
'o_avatars_size' => 10240,
'i_avatars_width' => 60,
'i_avatars_height' => 60,
'i_avatars_size' => 10240, // ???? сейчас не используется
'o_search_all_forums' => 1,
'o_admin_email' => $v->email,
'o_webmaster_email' => $v->email,
@ -1116,8 +1115,8 @@ class Install extends Admin
'o_maintenance' => 0,
'o_maintenance_message' => __('Maintenance message '),
'o_default_dst' => 0,
'o_feed_type' => 2,
'o_feed_ttl' => 0,
'i_feed_type' => 2,
'i_feed_ttl' => 0,
'p_message_bbcode' => 1,
'p_message_all_caps' => 1,
'p_subject_all_caps' => 1,
@ -1126,25 +1125,14 @@ class Install extends Admin
'p_force_guest_email' => 1,
'o_pms_enabled' => 1, // New PMS - Visman
'o_pms_min_kolvo' => 0,
'o_merge_timeout' => 86400, // merge post - Visman
'o_board_redirect' => '', // для редиректа - Visman
'o_board_redirectg' => 0,
'o_merge_timeout' => 86400, // ???? сейчас нет настройки в админке
'o_poll_enabled' => 0, // опросы - Visman
'o_poll_max_ques' => 3,
'o_poll_max_field' => 20,
'o_poll_time' => 60,
'o_poll_term' => 3,
'o_poll_guest' => 0,
'o_fbox_guest' => 0, // Fancybox - Visman
'o_fbox_files' => 'viewtopic.php,search.php,pmsnew.php',
'o_coding_forms' => 1, // кодирование форм - Visman
'o_check_ip' => 0, // проверка ip администрации - Visman
'o_crypto_enable' => 1, // случайные имена полей форм - Visman
'o_crypto_pas' => $this->c->Secury->randomPass(25),
'o_crypto_salt' => $this->c->Secury->randomPass(13),
'o_enable_acaptcha' => 1, // математическая каптча
'st_max_users' => 1, // статистика по максимуму юзеров - Visman
'st_max_users_time' => \time(),
'a_max_users' => \json_encode(['number' => 1, 'time' => \time()], self::JSON_OPTIONS),
'a_bb_white_mes' => \json_encode([], self::JSON_OPTIONS),
'a_bb_white_sig' => \json_encode(['b', 'i', 'u', 'color', 'colour', 'email', 'url'], self::JSON_OPTIONS),
'a_bb_black_mes' => \json_encode([], self::JSON_OPTIONS),

View file

@ -42,10 +42,10 @@ class Options extends Admin
'o_redirect_delay' => 'required|integer|min:0|max:99999',
'o_show_user_info' => 'required|integer|in:0,1',
'o_show_post_count' => 'required|integer|in:0,1',
'o_topic_review' => 'required|integer|min:0|max:50',
'o_disp_topics_default' => 'required|integer|min:10|max:50',
'o_disp_posts_default' => 'required|integer|min:10|max:50',
'o_disp_users' => 'required|integer|min:10|max:50',
'i_topic_review' => 'required|integer|min:0|max:50',
'i_disp_topics_default' => 'required|integer|min:10|max:50',
'i_disp_posts_default' => 'required|integer|min:10|max:50',
'i_disp_users' => 'required|integer|min:10|max:50',
'o_quickpost' => 'required|integer|in:0,1',
'o_users_online' => 'required|integer|in:0,1',
'o_show_dot' => 'required|integer|in:0,1',
@ -53,15 +53,15 @@ class Options extends Admin
'o_quickjump' => 'required|integer|in:0,1',
'o_search_all_forums' => 'required|integer|in:0,1',
'o_additional_navlinks' => 'string:trim|max:65000 bytes',
'o_feed_type' => 'required|integer|in:0,1,2',
'o_feed_ttl' => 'required|integer|in:0,5,15,30,60',
'o_report_method' => 'required|integer|in:0,1,2',
'i_feed_type' => 'required|integer|in:0,1,2',
'i_feed_ttl' => 'required|integer|in:0,5,15,30,60',
'i_report_method' => 'required|integer|in:0,1,2',
'o_mailing_list' => 'string:trim|max:65000 bytes', // ???? проверка списка email
'o_avatars' => 'required|integer|in:0,1',
'o_avatars_dir' => 'required|string:trim|max:255|check_dir',
'o_avatars_width' => 'required|integer|min:50|max:999',
'o_avatars_height' => 'required|integer|min:50|max:999',
'o_avatars_size' => 'required|integer|min:0|max:9999999',
'i_avatars_width' => 'required|integer|min:50|max:999',
'i_avatars_height' => 'required|integer|min:50|max:999',
'i_avatars_size' => 'required|integer|min:0|max:9999999',
'o_admin_email' => 'required|string:trim|email',
'o_webmaster_email' => 'required|string:trim|email',
'o_forum_subscriptions' => 'required|integer|in:0,1',
@ -77,7 +77,7 @@ class Options extends Admin
'o_regs_report' => 'required|integer|in:0,1',
'o_rules' => 'required|integer|in:0,1|check_empty:o_rules_message',
'o_rules_message' => 'string:trim|max:65000 bytes',
'o_default_email_setting' => 'required|integer|in:0,1,2',
'i_default_email_setting' => 'required|integer|in:0,1,2',
'o_announcement' => 'required|integer|in:0,1|check_empty:o_announcement_message',
'o_announcement_message' => 'string:trim|max:65000 bytes',
'p_message_all_caps' => 'required|integer|in:0,1',
@ -322,35 +322,35 @@ class Options extends Admin
'caption' => __('Post count label'),
'info' => __('Post count help'),
],
'o_disp_topics_default' => [
'i_disp_topics_default' => [
'type' => 'number',
'min' => '10',
'max' => '50',
'value' => $config->o_disp_topics_default,
'value' => $config->i_disp_topics_default,
'caption' => __('Topics per page label'),
'info' => __('Topics per page help'),
],
'o_disp_posts_default' => [
'i_disp_posts_default' => [
'type' => 'number',
'min' => '10',
'max' => '50',
'value' => $config->o_disp_posts_default,
'value' => $config->i_disp_posts_default,
'caption' => __('Posts per page label'),
'info' => __('Posts per page help'),
],
'o_disp_users' => [
'i_disp_users' => [
'type' => 'number',
'min' => '10',
'max' => '50',
'value' => $config->o_disp_users,
'value' => $config->i_disp_users,
'caption' => __('Users per page label'),
'info' => __('Users per page help'),
],
'o_topic_review' => [
'i_topic_review' => [
'type' => 'number',
'min' => '0',
'max' => '50',
'value' => $config->o_topic_review,
'value' => $config->i_topic_review,
'caption' => __('Topic review label'),
'info' => __('Topic review help'),
],
@ -443,9 +443,9 @@ class Options extends Admin
$form['sets']['feed'] = [
'legend' => __('Feed subhead'),
'fields' => [
'o_feed_type' => [
'i_feed_type' => [
'type' => 'radio',
'value' => $config->o_feed_type,
'value' => $config->i_feed_type,
'values' => [
0 => __('No feeds'),
1 => __('RSS'),
@ -454,7 +454,7 @@ class Options extends Admin
'caption' => __('Default feed label'),
'info' => __('Default feed help'),
],
'o_feed_ttl' => [
'i_feed_ttl' => [
'type' => 'select',
'options' => [
0 => __('No cache'),
@ -463,7 +463,7 @@ class Options extends Admin
30 => __('%d Minutes', 30),
60 => __('%d Minutes', 60),
],
'value' => $config->o_feed_ttl,
'value' => $config->i_feed_ttl,
'caption' => __('Feed TTL label'),
'info' => __('Feed TTL help'),
],
@ -474,9 +474,9 @@ class Options extends Admin
$form['sets']['reports'] = [
'legend' => __('Reports subhead'),
'fields' => [
'o_report_method' => [
'i_report_method' => [
'type' => 'radio',
'value' => $config->o_report_method,
'value' => $config->i_report_method,
'values' => [
0 => __('Internal'),
1 => __('By e-mail'),
@ -512,27 +512,27 @@ class Options extends Admin
'info' => __('Upload directory help'),
'required' => true,
],
'o_avatars_width' => [
'i_avatars_width' => [
'type' => 'number',
'min' => '50',
'max' => '999',
'value' => $config->o_avatars_width,
'value' => $config->i_avatars_width,
'caption' => __('Max width label'),
'info' => __('Max width help'),
],
'o_avatars_height' => [
'i_avatars_height' => [
'type' => 'number',
'min' => '50',
'max' => '999',
'value' => $config->o_avatars_height,
'value' => $config->i_avatars_height,
'caption' => __('Max height label'),
'info' => __('Max height help'),
],
'o_avatars_size' => [
'i_avatars_size' => [
'type' => 'number',
'min' => '0',
'max' => '9999999',
'value' => $config->o_avatars_size,
'value' => $config->i_avatars_size,
'caption' => __('Max size label'),
'info' => __('Max size help'),
],
@ -656,10 +656,10 @@ class Options extends Admin
'caption' => __('Rules label'),
'info' => __('Rules help'),
],
'o_default_email_setting' => [
'i_default_email_setting' => [
'class' => 'block',
'type' => 'radio',
'value' => $config->o_default_email_setting,
'value' => $config->i_default_email_setting,
'values' => [
0 => __('Display e-mail label'),
1 => __('Hide allow form label'),

View file

@ -944,4 +944,57 @@ class Update extends Admin
return null;
}
/**
* rev.22 to rev.23
*/
protected function stageNumber22(array $args): ?int
{
$this->c->config->i_topic_review = $this->c->config->o_topic_review ?? 15;
$this->c->config->i_disp_topics_default = $this->c->config->o_disp_topics_default ?? 30;
$this->c->config->i_disp_posts_default = $this->c->config->o_disp_posts_default ?? 25;
$this->c->config->i_disp_users = $this->c->config->o_disp_users ?? 50;
$this->c->config->i_default_email_setting = $this->c->config->o_default_email_setting ?? 2;
$this->c->config->i_avatars_width = $this->c->config->o_avatars_width ?? 60;
$this->c->config->i_avatars_height = $this->c->config->o_avatars_height ?? 60;
$this->c->config->i_avatars_size = $this->c->config->o_avatars_size ?? 10240;
$this->c->config->i_feed_type = $this->c->config->o_feed_type ?? 2;
$this->c->config->i_feed_ttl = $this->c->config->o_feed_ttl ?? 0;
$this->c->config->i_report_method = $this->c->config->o_report_method ?? 0;
$this->c->config->i_default_user_group = $this->c->config->o_default_user_group ?? $this->c->GROUP_MEMBER;
$this->c->config->a_max_users = [
'number' => (int) $this->c->config->st_max_users ?? 1,
'time' => (int) $this->c->config->st_max_users_time ?? \time(),
];
unset($this->c->config->o_enable_acaptcha);
unset($this->c->config->o_crypto_salt);
unset($this->c->config->o_crypto_pas);
unset($this->c->config->o_crypto_enable);
unset($this->c->config->o_check_ip);
unset($this->c->config->o_coding_forms);
unset($this->c->config->o_fbox_files);
unset($this->c->config->o_fbox_guest);
unset($this->c->config->o_show_version);
unset($this->c->config->o_topic_review);
unset($this->c->config->o_disp_topics_default);
unset($this->c->config->o_disp_posts_default);
unset($this->c->config->o_disp_users);
unset($this->c->config->o_default_email_setting);
unset($this->c->config->o_avatars_width);
unset($this->c->config->o_avatars_height);
unset($this->c->config->o_avatars_size);
unset($this->c->config->o_feed_type);
unset($this->c->config->o_feed_ttl);
unset($this->c->config->o_report_method);
unset($this->c->config->o_board_redirect);
unset($this->c->config->o_board_redirectg);
unset($this->c->config->o_default_user_group);
unset($this->c->config->st_max_users);
unset($this->c->config->st_max_users_time);
$this->c->config->save();
return null;
}
}

View file

@ -352,7 +352,7 @@ class Action extends Users
'new_group' => [
'type' => 'select',
'options' => $this->groupListForChange($profile),
'value' => $this->c->config->o_default_user_group,
'value' => $this->c->config->i_default_user_group,
'caption' => __('New group label'),
'info' => __('New group help', $names),
],

View file

@ -43,12 +43,12 @@ class NewUser extends Users
$user->username = $v->username;
$user->password = \password_hash($v->password, PASSWORD_DEFAULT);
$user->group_id = $this->c->config->o_default_user_group;
$user->group_id = $this->c->config->i_default_user_group;
$user->email = $v->email;
$user->email_confirmed = 0;
$user->activate_string = '';
$user->u_mark_all_read = \time();
$user->email_setting = $this->c->config->o_default_email_setting;
$user->email_setting = $this->c->config->i_default_email_setting;
$user->timezone = $this->c->config->o_default_timezone;
$user->dst = $this->c->config->o_default_dst;
$user->language = $this->c->config->o_default_lang;

View file

@ -43,7 +43,7 @@ class Result extends Users
}
$page = isset($args['page']) ? (int) $args['page'] : 1;
$pages = (int) \ceil(($number ?: 1) / $this->c->config->o_disp_users);
$pages = (int) \ceil(($number ?: 1) / $this->c->config->i_disp_users);
if ($page > $pages) {
return $this->c->Message->message('Bad request');
@ -106,8 +106,8 @@ class Result extends Users
$this->fIswev = $v->getErrors();
}
$startNum = ($page - 1) * $this->c->config->o_disp_users;
$idsN = \array_slice($idsN, $startNum, (int) $this->c->config->o_disp_users);
$startNum = ($page - 1) * $this->c->config->i_disp_users;
$idsN = \array_slice($idsN, $startNum, $this->c->config->i_disp_users);
$ids = [];
$userList = [];

View file

@ -20,14 +20,14 @@ class Stat extends Users
$number = \count($stat);
$page = isset($args['page']) ? (int) $args['page'] : 1;
$pages = (int) \ceil(($number ?: 1) / $this->c->config->o_disp_users);
$pages = (int) \ceil(($number ?: 1) / $this->c->config->i_disp_users);
if ($page > $pages) {
return $this->c->Message->message('Bad request');
}
$startNum = ($page - 1) * $this->c->config->o_disp_users;
$stat = \array_slice($stat, $startNum, (int) $this->c->config->o_disp_users);
$startNum = ($page - 1) * $this->c->config->i_disp_users;
$stat = \array_slice($stat, $startNum, $this->c->config->i_disp_users);
$user = $this->c->users->load((int) $args['id']);

View file

@ -341,7 +341,7 @@ class Auth extends Page
}
// активация аккаунта (письмо активации не дошло, заказали восстановление)
if ($user->isUnverified) {
$user->group_id = $this->c->config->o_default_user_group;
$user->group_id = $this->c->config->i_default_user_group;
$user->email_confirmed = 1;
$this->c->users->update($user);

View file

@ -39,7 +39,7 @@ class Feed extends Page
{
$this->c->DEBUG = 0;
if ('0' == $this->c->config->o_feed_type) {
if ($this->c->config->i_feed_type < 1) {
return $this->exit('Bad request');
}
@ -83,7 +83,7 @@ class Feed extends Page
}
}
} else {
if ($this->c->config->o_feed_ttl > 0) {
if ($this->c->config->i_feed_ttl > 0) {
$cacheId = 'feed' . \sha1("{$this->user->group_id}|{$this->user->language}|{$fid}");
} else {
$cacheId = null;
@ -133,7 +133,7 @@ class Feed extends Page
if (null !== $cacheId) {
if (true !== $this->c->Cache->set($cacheId, $feed, 60 * $this->c->config->o_feed_ttl)) {
if (true !== $this->c->Cache->set($cacheId, $feed, 60 * $this->c->config->i_feed_ttl)) {
throw new RuntimeException('Unable to write value to cache - feed');
}
}

View file

@ -60,8 +60,8 @@ class Forum extends Page
$this->formMod = $this->formMod($forum);
}
if ($this->c->config->o_feed_type > 0) {
$feedType = '2' == $this->c->config->o_feed_type ? 'atom' : 'rss';
if ($this->c->config->i_feed_type > 0) {
$feedType = 2 === $this->c->config->i_feed_type ? 'atom' : 'rss';
$this->pageHeader('feed', 'link', [
'rel' => 'alternate',
'type' => "application/{$feedType}+xml",

View file

@ -61,8 +61,8 @@ class Index extends Page
);
}
if ($this->c->config->o_feed_type > 0) {
$feedType = '2' == $this->c->config->o_feed_type ? 'atom' : 'rss';
if ($this->c->config->i_feed_type > 0) {
$feedType = 2 === $this->c->config->i_feed_type ? 'atom' : 'rss';
$this->pageHeader('feed', 'link', [
'rel' => 'alternate',
'type' => "application/{$feedType}+xml",

View file

@ -127,7 +127,7 @@ class Edit extends Profile
$result = $v->upload_avatar
->rename(true)
->rewrite(false)
->resize((int) $this->c->config->o_avatars_width, (int) $this->c->config->o_avatars_height)
->resize($this->c->config->i_avatars_width, $this->c->config->i_avatars_height)
->toFile($path);
if (true === $result) {
@ -347,10 +347,10 @@ class Edit extends Profile
'type' => 'file',
'caption' => __('New avatar'),
'info' => __('New avatar info',
\ForkBB\num($this->c->config->o_avatars_width),
\ForkBB\num($this->c->config->o_avatars_height),
\ForkBB\num($this->c->config->o_avatars_size),
\ForkBB\size((int) $this->c->config->o_avatars_size)
\ForkBB\num($this->c->config->i_avatars_width),
\ForkBB\num($this->c->config->i_avatars_height),
\ForkBB\num($this->c->config->i_avatars_size),
\ForkBB\size($this->c->config->i_avatars_size)
),
'accept' => $this->accept,
];

View file

@ -134,7 +134,7 @@ class Register extends Page
$groupId = 0;
$key = $this->c->Secury->randomPass(31);
} else {
$groupId = $this->c->config->o_default_user_group;
$groupId = $this->c->config->i_default_user_group;
$key = '';
}
@ -147,7 +147,7 @@ class Register extends Page
$user->email_confirmed = 0;
$user->activate_string = $key;
$user->u_mark_all_read = \time();
$user->email_setting = $this->c->config->o_default_email_setting;
$user->email_setting = $this->c->config->i_default_email_setting;
$user->timezone = $this->c->config->o_default_timezone;
$user->dst = $this->c->config->o_default_dst;
$user->language = $this->user->language;
@ -264,7 +264,7 @@ class Register extends Page
return $this->c->Message->message('Bad request', false);
}
$user->group_id = $this->c->config->o_default_user_group;
$user->group_id = $this->c->config->i_default_user_group;
$user->email_confirmed = 1;
$user->activate_string = '';

View file

@ -62,10 +62,10 @@ class Report extends Page
$result = true;
switch ($this->c->config->o_report_method) {
case '2':
switch ($this->c->config->i_report_method) {
case 2:
$this->c->reports->insert($report);
case '1':
case 1:
try {
$result = $this->sendReport($report);
} catch (MailException $e) {
@ -82,7 +82,7 @@ class Report extends Page
$this->c->users->update($this->user);
}
if (false === $result && '1' == $this->c->config->o_report_method) {
if (false === $result && 1 === $this->c->config->i_report_method) {
$this->fIswev = ['e', __('Error mail', $this->c->config->o_admin_email)];
} else {
return $this->c->Redirect->page('ViewPost', ['id' => $post->id])->message('Report redirect');

View file

@ -158,8 +158,8 @@ class Topic extends Page
}
$topic->updateVisits();
if ($this->c->config->o_feed_type > 0) {
$feedType = '2' == $this->c->config->o_feed_type ? 'atom' : 'rss';
if ($this->c->config->i_feed_type > 0) {
$feedType = 2 === $this->c->config->i_feed_type ? 'atom' : 'rss';
$this->pageHeader('feed', 'link', [
'rel' => 'alternate',
'type' => "application/{$feedType}+xml",

View file

@ -83,15 +83,15 @@ class Userlist extends Page
$ids = $this->c->users->filter($filters, $order);
$number = \count($ids);
$page = isset($args['page']) ? (int) $args['page'] : 1;
$pages = (int) \ceil(($number ?: 1) / $this->c->config->o_disp_users);
$pages = (int) \ceil(($number ?: 1) / $this->c->config->i_disp_users);
if ($page > $pages) {
return $this->c->Message->message('Bad request');
}
if ($number) {
$this->startNum = ($page - 1) * $this->c->config->o_disp_users;
$ids = \array_slice($ids, $this->startNum, (int) $this->c->config->o_disp_users);
$this->startNum = ($page - 1) * $this->c->config->i_disp_users;
$ids = \array_slice($ids, $this->startNum, $this->c->config->i_disp_users);
$this->userList = $this->c->users->loadByIds($ids);
$links = [];

View file

@ -354,7 +354,7 @@ class Model extends DataModel
*/
public function review(): array
{
if ($this->c->config->o_topic_review < 1) {
if ($this->c->config->i_topic_review < 1) {
return [];
}
@ -362,7 +362,7 @@ class Model extends DataModel
$vars = [
':tid' => $this->id,
':rows' => $this->c->config->o_topic_review,
':rows' => $this->c->config->i_topic_review,
];
$query = 'SELECT p.id
FROM ::posts AS p

View file

@ -290,11 +290,11 @@ class Model extends DataModel
{
$attr = $this->getAttr('disp_topics');
if (empty($attr)) {
$attr = $this->c->config->o_disp_topics_default;
if ($attr < 10) {
$attr = $this->c->config->i_disp_topics_default;
}
return (int) $attr;
return $attr;
}
/**
@ -304,11 +304,11 @@ class Model extends DataModel
{
$attr = $this->getAttr('disp_topics');
if (empty($attr)) {
$attr = $this->c->config->o_disp_posts_default;
if ($attr < 10) {
$attr = $this->c->config->i_disp_posts_default;
}
return (int) $attr;
return $attr;
}
/**

View file

@ -44,7 +44,7 @@ if (
}
$c->PUBLIC_URL = $c->BASE_URL . $forkPublicPrefix;
$c->FORK_REVISION = 22;
$c->FORK_REVISION = 23;
$c->START = $forkStart;
$c->DIR_APP = __DIR__;
$c->DIR_PUBLIC = $forkPublic;