ソースを参照

rev.23 Update config

Change data type for some settings.
Visman 4 年 前
コミット
0fdeb3aa19

+ 2 - 2
app/Controllers/Routing.php

@@ -490,8 +490,8 @@ class Routing
 
 
             if (
             if (
                 $user->isAdmin
                 $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->add(
                     $r::GET,
                     $r::GET,

+ 1 - 1
app/Models/Group/Model.php

@@ -33,7 +33,7 @@ class Model extends DataModel
             $this->c->GROUP_MEMBER
             $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;
     }
     }
 
 
     /**
     /**

+ 2 - 2
app/Models/Online/Info.php

@@ -18,8 +18,8 @@ class Info extends Method
             return null;
             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 = [];
         $info = [];
         if ('1' == $this->c->user->g_view_users) {
         if ('1' == $this->c->user->g_view_users) {

+ 5 - 3
app/Models/Online/Model.php

@@ -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();
             $this->c->config->save();
         }
         }
 
 

+ 2 - 2
app/Models/Pages/Admin.php

@@ -54,8 +54,8 @@ class Admin extends Page
         }
         }
         if (
         if (
             $this->user->isAdmin
             $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')];
             $nav['reports'] = [$r->link('AdminReports'), __('Reports')];
         }
         }

+ 3 - 3
app/Models/Pages/Admin/Bans.php

@@ -373,14 +373,14 @@ class Bans extends Admin
         }
         }
 
 
         $page  = isset($args['page']) ? (int) $args['page'] : 1;
         $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) {
         if ($page > $pages) {
             return $this->c->Message->message('Bad request');
             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);
         $banList  = $this->c->bans->getList($idsN);
 
 
         $this->nameTpl    = 'admin/bans_result';
         $this->nameTpl    = 'admin/bans_result';

+ 6 - 6
app/Models/Pages/Admin/Groups.php

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

+ 14 - 26
app/Models/Pages/Admin/Install.php

@@ -1068,7 +1068,6 @@ class Install extends Admin
             'o_timeout_visit'         => 3600,
             'o_timeout_visit'         => 3600,
             'o_timeout_online'        => 900,
             'o_timeout_online'        => 900,
             'o_redirect_delay'        => 1,
             'o_redirect_delay'        => 1,
-            'o_show_version'          => 0,
             'o_show_user_info'        => 1,
             'o_show_user_info'        => 1,
             'o_show_post_count'       => 1,
             'o_show_post_count'       => 1,
             'o_smilies'               => 1,
             'o_smilies'               => 1,
@@ -1076,11 +1075,11 @@ class Install extends Admin
             'o_make_links'            => 1,
             'o_make_links'            => 1,
             'o_default_lang'          => $v->defaultlang,
             'o_default_lang'          => $v->defaultlang,
             'o_default_style'         => $v->defaultstyle,
             '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_quickpost'             => 1,
             'o_users_online'          => 1,
             'o_users_online'          => 1,
             'o_censoring'             => 0,
             'o_censoring'             => 0,
@@ -1088,15 +1087,15 @@ class Install extends Admin
             'o_topic_views'           => 1,
             'o_topic_views'           => 1,
             'o_quickjump'             => 1,
             'o_quickjump'             => 1,
             'o_additional_navlinks'   => '',
             'o_additional_navlinks'   => '',
-            'o_report_method'         => 0,
+            'i_report_method'         => 0,
             'o_regs_report'           => 0,
             'o_regs_report'           => 0,
-            'o_default_email_setting' => 2,
+            'i_default_email_setting' => 2,
             'o_mailing_list'          => $v->email,
             'o_mailing_list'          => $v->email,
             'o_avatars'               => \in_array(\strtolower(@\ini_get('file_uploads')), ['on', 'true', '1']) ? 1 : 0,
             'o_avatars'               => \in_array(\strtolower(@\ini_get('file_uploads')), ['on', 'true', '1']) ? 1 : 0,
             'o_avatars_dir'           => '/img/avatars',
             '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_search_all_forums'     => 1,
             'o_admin_email'           => $v->email,
             'o_admin_email'           => $v->email,
             'o_webmaster_email'       => $v->email,
             'o_webmaster_email'       => $v->email,
@@ -1116,8 +1115,8 @@ class Install extends Admin
             'o_maintenance'           => 0,
             'o_maintenance'           => 0,
             'o_maintenance_message'   => __('Maintenance message '),
             'o_maintenance_message'   => __('Maintenance message '),
             'o_default_dst'           => 0,
             '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_bbcode'        => 1,
             'p_message_all_caps'      => 1,
             'p_message_all_caps'      => 1,
             'p_subject_all_caps'      => 1,
             'p_subject_all_caps'      => 1,
@@ -1126,25 +1125,14 @@ class Install extends Admin
             'p_force_guest_email'     => 1,
             'p_force_guest_email'     => 1,
             'o_pms_enabled'           => 1,                    // New PMS - Visman
             'o_pms_enabled'           => 1,                    // New PMS - Visman
             'o_pms_min_kolvo'         => 0,
             '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_enabled'          => 0,    // опросы - Visman
             'o_poll_max_ques'         => 3,
             'o_poll_max_ques'         => 3,
             'o_poll_max_field'        => 20,
             'o_poll_max_field'        => 20,
             'o_poll_time'             => 60,
             'o_poll_time'             => 60,
             'o_poll_term'             => 3,
             'o_poll_term'             => 3,
             'o_poll_guest'            => 0,
             '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_mes'          => \json_encode([], self::JSON_OPTIONS),
             'a_bb_white_sig'          => \json_encode(['b', 'i', 'u', 'color', 'colour', 'email', 'url'], 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),
             'a_bb_black_mes'          => \json_encode([], self::JSON_OPTIONS),

+ 33 - 33
app/Models/Pages/Admin/Options.php

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

+ 53 - 0
app/Models/Pages/Admin/Update.php

@@ -944,4 +944,57 @@ class Update extends Admin
 
 
         return null;
         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;
+    }
 }
 }

+ 1 - 1
app/Models/Pages/Admin/Users/Action.php

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

+ 2 - 2
app/Models/Pages/Admin/Users/NewUser.php

@@ -43,12 +43,12 @@ class NewUser extends Users
 
 
                     $user->username        = $v->username;
                     $user->username        = $v->username;
                     $user->password        = \password_hash($v->password, PASSWORD_DEFAULT);
                     $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           = $v->email;
                     $user->email_confirmed = 0;
                     $user->email_confirmed = 0;
                     $user->activate_string = '';
                     $user->activate_string = '';
                     $user->u_mark_all_read = \time();
                     $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->timezone        = $this->c->config->o_default_timezone;
                     $user->dst             = $this->c->config->o_default_dst;
                     $user->dst             = $this->c->config->o_default_dst;
                     $user->language        = $this->c->config->o_default_lang;
                     $user->language        = $this->c->config->o_default_lang;

+ 3 - 3
app/Models/Pages/Admin/Users/Result.php

@@ -43,7 +43,7 @@ class Result extends Users
         }
         }
 
 
         $page  = isset($args['page']) ? (int) $args['page'] : 1;
         $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) {
         if ($page > $pages) {
             return $this->c->Message->message('Bad request');
             return $this->c->Message->message('Bad request');
@@ -106,8 +106,8 @@ class Result extends Users
             $this->fIswev = $v->getErrors();
             $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      = [];
         $ids      = [];
         $userList = [];
         $userList = [];
 
 

+ 3 - 3
app/Models/Pages/Admin/Users/Stat.php

@@ -20,14 +20,14 @@ class Stat extends Users
         $number = \count($stat);
         $number = \count($stat);
 
 
         $page  = isset($args['page']) ? (int) $args['page'] : 1;
         $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) {
         if ($page > $pages) {
             return $this->c->Message->message('Bad request');
             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']);
         $user = $this->c->users->load((int) $args['id']);
 
 

+ 1 - 1
app/Models/Pages/Auth.php

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

+ 3 - 3
app/Models/Pages/Feed.php

@@ -39,7 +39,7 @@ class Feed extends Page
     {
     {
         $this->c->DEBUG = 0;
         $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');
             return $this->exit('Bad request');
         }
         }
 
 
@@ -83,7 +83,7 @@ class Feed extends Page
                 }
                 }
             }
             }
         } else {
         } 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}");
                 $cacheId = 'feed' . \sha1("{$this->user->group_id}|{$this->user->language}|{$fid}");
             } else {
             } else {
                 $cacheId = null;
                 $cacheId = null;
@@ -133,7 +133,7 @@ class Feed extends Page
 
 
 
 
                 if (null !== $cacheId) {
                 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');
                         throw new RuntimeException('Unable to write value to cache - feed');
                     }
                     }
                 }
                 }

+ 2 - 2
app/Models/Pages/Forum.php

@@ -60,8 +60,8 @@ class Forum extends Page
             $this->formMod   = $this->formMod($forum);
             $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', [
             $this->pageHeader('feed', 'link', [
                 'rel'  => 'alternate',
                 'rel'  => 'alternate',
                 'type' => "application/{$feedType}+xml",
                 'type' => "application/{$feedType}+xml",

+ 2 - 2
app/Models/Pages/Index.php

@@ -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', [
             $this->pageHeader('feed', 'link', [
                 'rel'  => 'alternate',
                 'rel'  => 'alternate',
                 'type' => "application/{$feedType}+xml",
                 'type' => "application/{$feedType}+xml",

+ 5 - 5
app/Models/Pages/Profile/Edit.php

@@ -127,7 +127,7 @@ class Edit extends Profile
                     $result = $v->upload_avatar
                     $result = $v->upload_avatar
                         ->rename(true)
                         ->rename(true)
                         ->rewrite(false)
                         ->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);
                         ->toFile($path);
 
 
                     if (true === $result) {
                     if (true === $result) {
@@ -347,10 +347,10 @@ class Edit extends Profile
                 'type'      => 'file',
                 'type'      => 'file',
                 'caption'   => __('New avatar'),
                 'caption'   => __('New avatar'),
                 'info'      => __('New avatar info',
                 '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,
                 'accept'  => $this->accept,
             ];
             ];

+ 3 - 3
app/Models/Pages/Register.php

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

+ 4 - 4
app/Models/Pages/Report.php

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

+ 2 - 2
app/Models/Pages/Topic.php

@@ -158,8 +158,8 @@ class Topic extends Page
         }
         }
         $topic->updateVisits();
         $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', [
             $this->pageHeader('feed', 'link', [
                 'rel'  => 'alternate',
                 'rel'  => 'alternate',
                 'type' => "application/{$feedType}+xml",
                 'type' => "application/{$feedType}+xml",

+ 3 - 3
app/Models/Pages/Userlist.php

@@ -83,15 +83,15 @@ class Userlist extends Page
         $ids    = $this->c->users->filter($filters, $order);
         $ids    = $this->c->users->filter($filters, $order);
         $number = \count($ids);
         $number = \count($ids);
         $page   = isset($args['page']) ? (int) $args['page'] : 1;
         $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) {
         if ($page > $pages) {
             return $this->c->Message->message('Bad request');
             return $this->c->Message->message('Bad request');
         }
         }
 
 
         if ($number) {
         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);
             $this->userList = $this->c->users->loadByIds($ids);
 
 
             $links = [];
             $links = [];

+ 2 - 2
app/Models/Topic/Model.php

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

+ 6 - 6
app/Models/User/Model.php

@@ -290,11 +290,11 @@ class Model extends DataModel
     {
     {
         $attr = $this->getAttr('disp_topics');
         $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');
         $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;
     }
     }
 
 
     /**
     /**

+ 1 - 1
app/bootstrap.php

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