Visman 8 gadi atpakaļ
vecāks
revīzija
daf1803346

+ 1 - 1
app/Models/Pages/Admin/Index.php

@@ -24,7 +24,7 @@ class Index extends Admin
     {
     {
         $this->c->Lang->load('admin_index');
         $this->c->Lang->load('admin_index');
         $this->data = [
         $this->data = [
-            'version' => $this->config['s_fork_version'] . '.' . $this->config['i_fork_revision'],
+            'revision' => $this->config['i_fork_revision'],
             'linkStat' => $this->c->Router->link('AdminStatistics'),
             'linkStat' => $this->c->Router->link('AdminStatistics'),
         ];
         ];
         $this->titles[] = __('Admin index');
         $this->titles[] = __('Admin index');

+ 157 - 73
app/Models/Pages/Install.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Container;
 use ForkBB\Models\Validator;
 use ForkBB\Models\Validator;
 use PDO;
 use PDO;
 use PDOException;
 use PDOException;
+use RuntimeException;
 
 
 class Install extends Page
 class Install extends Page
 {
 {
@@ -154,6 +155,12 @@ class Install extends Page
             $this->iswev['e'][] = __('No DB extensions');
             $this->iswev['e'][] = __('No DB extensions');
         }
         }
         unset($args['dbtype']);
         unset($args['dbtype']);
+        // доступность шаблона конфигурации
+        $config = file_get_contents($this->c->DIR_CONFIG . '/main.dist.php');
+        if (false === $config) {
+            $this->iswev['e'][] = __('No access to main.dist.php');
+        }
+        unset($config);
 
 
         $this->data = $args + [
         $this->data = $args + [
             'rev' => $this->c->FORK_REVISION,
             'rev' => $this->c->FORK_REVISION,
@@ -328,8 +335,11 @@ class Install extends Page
      */
      */
     protected function installEnd(Validator $v)
     protected function installEnd(Validator $v)
     {
     {
-        $this->c->DB->beginTransaction();
+        @set_time_limit(0);
+        $this->c->Cache->clear();
 
 
+        $this->c->DB->beginTransaction();
+        // bans
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'          => ['SERIAL', false],
                 'id'          => ['SERIAL', false],
@@ -347,7 +357,7 @@ class Install extends Page
             'ENGINE' => $this->DBEngine,
             'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('bans', $schema);
         $this->c->DB->createTable('bans', $schema);
-
+        // categories
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'            => ['SERIAL', false],
                 'id'            => ['SERIAL', false],
@@ -355,9 +365,10 @@ class Install extends Page
                 'disp_position' => ['INT(10)', false, 0],
                 'disp_position' => ['INT(10)', false, 0],
             ],
             ],
             'PRIMARY KEY' => ['id'],
             'PRIMARY KEY' => ['id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('categories', $schema);
         $this->c->DB->createTable('categories', $schema);
-
+        // censoring
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'           => ['SERIAL', false],
                 'id'           => ['SERIAL', false],
@@ -365,18 +376,20 @@ class Install extends Page
                 'replace_with' => ['VARCHAR(60)', false, ''],
                 'replace_with' => ['VARCHAR(60)', false, ''],
             ],
             ],
             'PRIMARY KEY' => ['id'],
             'PRIMARY KEY' => ['id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('censoring', $schema);
         $this->c->DB->createTable('censoring', $schema);
-
+        // config
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'conf_name'  => ['VARCHAR(255)', false, ''],
                 'conf_name'  => ['VARCHAR(255)', false, ''],
                 'conf_value' => ['TEXT', true],
                 'conf_value' => ['TEXT', true],
             ],
             ],
             'PRIMARY KEY' => ['conf_name'],
             'PRIMARY KEY' => ['conf_name'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('config', $schema);
         $this->c->DB->createTable('config', $schema);
-
+        // forum_perms
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'group_id'     => ['INT(10)', false, 0],
                 'group_id'     => ['INT(10)', false, 0],
@@ -386,9 +399,10 @@ class Install extends Page
                 'post_topics'  => ['TINYINT(1)', false, 1],
                 'post_topics'  => ['TINYINT(1)', false, 1],
             ],
             ],
             'PRIMARY KEY' => array('group_id', 'forum_id'),
             'PRIMARY KEY' => array('group_id', 'forum_id'),
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('forum_perms', $schema);
         $this->c->DB->createTable('forum_perms', $schema);
-
+        // forums
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'              => ['SERIAL', false],
                 'id'              => ['SERIAL', false],
@@ -409,9 +423,10 @@ class Install extends Page
                 'parent_forum_id' => ['INT(10) UNSIGNED', false, 0],
                 'parent_forum_id' => ['INT(10) UNSIGNED', false, 0],
             ],
             ],
             'PRIMARY KEY' => ['id'],
             'PRIMARY KEY' => ['id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('forums', $schema);
         $this->c->DB->createTable('forums', $schema);
-
+        // groups
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'g_id'                   => ['SERIAL', false],
                 'g_id'                   => ['SERIAL', false],
@@ -446,9 +461,10 @@ class Install extends Page
                 'g_pm_limit'             => ['INT(10) UNSIGNED', false, 100],
                 'g_pm_limit'             => ['INT(10) UNSIGNED', false, 100],
             ],
             ],
             'PRIMARY KEY' => ['g_id'],
             'PRIMARY KEY' => ['g_id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('groups', $schema);
         $this->c->DB->createTable('groups', $schema);
-
+        // online
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'user_id'     => ['INT(10) UNSIGNED', false, 1],
                 'user_id'     => ['INT(10) UNSIGNED', false, 1],
@@ -469,9 +485,10 @@ class Install extends Page
                 'logged_idx'     => ['logged'],
                 'logged_idx'     => ['logged'],
                 'o_position_idx' => ['o_position'],
                 'o_position_idx' => ['o_position'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('online', $schema);
         $this->c->DB->createTable('online', $schema);
-
+        // posts
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'           => ['SERIAL', false],
                 'id'           => ['SERIAL', false],
@@ -493,9 +510,10 @@ class Install extends Page
                 'topic_id_idx' => ['topic_id'],
                 'topic_id_idx' => ['topic_id'],
                 'multi_idx'    => ['poster_id', 'topic_id'],
                 'multi_idx'    => ['poster_id', 'topic_id'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('posts', $schema);
         $this->c->DB->createTable('posts', $schema);
-
+        // reports
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'          => ['SERIAL', false],
                 'id'          => ['SERIAL', false],
@@ -512,9 +530,10 @@ class Install extends Page
             'INDEXES' => [
             'INDEXES' => [
                 'zapped_idx' => ['zapped'],
                 'zapped_idx' => ['zapped'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('reports', $schema);
         $this->c->DB->createTable('reports', $schema);
-
+        // search_cache
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'          => ['INT(10) UNSIGNED', false, 0],
                 'id'          => ['INT(10) UNSIGNED', false, 0],
@@ -525,9 +544,10 @@ class Install extends Page
             'INDEXES' => [
             'INDEXES' => [
                 'ident_idx' => ['ident(8)'], //????
                 'ident_idx' => ['ident(8)'], //????
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('search_cache', $schema);
         $this->c->DB->createTable('search_cache', $schema);
-
+        // search_matches
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'post_id'       => ['INT(10) UNSIGNED', false, 0],
                 'post_id'       => ['INT(10) UNSIGNED', false, 0],
@@ -538,9 +558,10 @@ class Install extends Page
                 'word_id_idx' => ['word_id'],
                 'word_id_idx' => ['word_id'],
                 'post_id_idx' => ['post_id'],
                 'post_id_idx' => ['post_id'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('search_matches', $schema);
         $this->c->DB->createTable('search_matches', $schema);
-
+        // search_words
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'   => ['SERIAL', false],
                 'id'   => ['SERIAL', false],
@@ -550,31 +571,34 @@ class Install extends Page
             'INDEXES' => [
             'INDEXES' => [
                 'id_idx' => ['id'],
                 'id_idx' => ['id'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         if ($v->dbtype == 'sqlite') { //????
         if ($v->dbtype == 'sqlite') { //????
             $schema['PRIMARY KEY'] = ['id'];
             $schema['PRIMARY KEY'] = ['id'];
             $schema['UNIQUE KEYS'] = ['word_idx' => ['word']];
             $schema['UNIQUE KEYS'] = ['word_idx' => ['word']];
         }
         }
         $this->c->DB->createTable('search_words', $schema);
         $this->c->DB->createTable('search_words', $schema);
-
+        // topic_subscriptions
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'user_id'  => ['INT(10) UNSIGNED', false, 0],
                 'user_id'  => ['INT(10) UNSIGNED', false, 0],
                 'topic_id' => ['INT(10) UNSIGNED', false, 0],
                 'topic_id' => ['INT(10) UNSIGNED', false, 0],
             ],
             ],
             'PRIMARY KEY' => ['user_id', 'topic_id'],
             'PRIMARY KEY' => ['user_id', 'topic_id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('topic_subscriptions', $schema);
         $this->c->DB->createTable('topic_subscriptions', $schema);
-
+        // forum_subscriptions
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'user_id'  => ['INT(10) UNSIGNED', false, 0],
                 'user_id'  => ['INT(10) UNSIGNED', false, 0],
                 'forum_id' => ['INT(10) UNSIGNED', false, 0],
                 'forum_id' => ['INT(10) UNSIGNED', false, 0],
             ],
             ],
             'PRIMARY KEY' => ['user_id', 'forum_id'],
             'PRIMARY KEY' => ['user_id', 'forum_id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('forum_subscriptions', $schema);
         $this->c->DB->createTable('forum_subscriptions', $schema);
-
+        // topics
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'            => ['SERIAL', false],
                 'id'            => ['SERIAL', false],
@@ -604,9 +628,10 @@ class Install extends Page
                 'last_post_idx'     => ['last_post'],
                 'last_post_idx'     => ['last_post'],
                 'first_post_id_idx' => ['first_post_id'],
                 'first_post_id_idx' => ['first_post_id'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('topics', $schema);
         $this->c->DB->createTable('topics', $schema);
-
+        // pms_new_block
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'bl_id'      => ['INT(10) UNSIGNED', false, 0],
                 'bl_id'      => ['INT(10) UNSIGNED', false, 0],
@@ -616,9 +641,10 @@ class Install extends Page
                 'bl_id_idx'      => ['bl_id'],
                 'bl_id_idx'      => ['bl_id'],
                 'bl_user_id_idx' => ['bl_user_id']
                 'bl_user_id_idx' => ['bl_user_id']
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('pms_new_block', $schema);
         $this->c->DB->createTable('pms_new_block', $schema);
-
+        // pms_new_posts
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'           => ['SERIAL', false],
                 'id'           => ['SERIAL', false],
@@ -638,9 +664,10 @@ class Install extends Page
                 'topic_id_idx' => ['topic_id'],
                 'topic_id_idx' => ['topic_id'],
                 'multi_idx'    => ['poster_id', 'topic_id'],
                 'multi_idx'    => ['poster_id', 'topic_id'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('pms_new_posts', $schema);
         $this->c->DB->createTable('pms_new_posts', $schema);
-
+        // pms_new_topics
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'          => ['SERIAL', false],
                 'id'          => ['SERIAL', false],
@@ -662,13 +689,14 @@ class Install extends Page
                 'multi_idx_st' => ['starter_id', 'topic_st'],
                 'multi_idx_st' => ['starter_id', 'topic_st'],
                 'multi_idx_to' => ['to_id', 'topic_to'],
                 'multi_idx_to' => ['to_id', 'topic_to'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('pms_new_topics', $schema);
         $this->c->DB->createTable('pms_new_topics', $schema);
-
+        // users
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'               => ['SERIAL', false],
                 'id'               => ['SERIAL', false],
-                'group_id'         => ['INT(10) UNSIGNED', false, 3], //????
+                'group_id'         => ['INT(10) UNSIGNED', false, $this->c->GROUP_UNVERIFIED],
                 'username'         => ['VARCHAR(200)', false, ''],
                 'username'         => ['VARCHAR(200)', false, ''],
                 'password'         => ['VARCHAR(255)', false, ''],
                 'password'         => ['VARCHAR(255)', false, ''],
                 'email'            => ['VARCHAR(80)', false, ''],
                 'email'            => ['VARCHAR(80)', false, ''],
@@ -709,7 +737,7 @@ class Install extends Page
                 'last_visit'       => ['INT(10) UNSIGNED', false, 0],
                 'last_visit'       => ['INT(10) UNSIGNED', false, 0],
                 'admin_note'       => ['VARCHAR(30)', true],
                 'admin_note'       => ['VARCHAR(30)', true],
                 'activate_string'  => ['VARCHAR(80)', true],
                 'activate_string'  => ['VARCHAR(80)', true],
-                'activate_key'     => ['VARCHAR(8)', true],
+                'activate_key'     => ['VARCHAR(8)', true],    //????
                 'messages_enable'  => ['TINYINT(1)', false, 1],
                 'messages_enable'  => ['TINYINT(1)', false, 1],
                 'messages_email'   => ['TINYINT(1)', false, 0],
                 'messages_email'   => ['TINYINT(1)', false, 0],
                 'messages_flag'    => ['TINYINT(1)', false, 0],
                 'messages_flag'    => ['TINYINT(1)', false, 0],
@@ -728,9 +756,10 @@ class Install extends Page
             'INDEXES' => [
             'INDEXES' => [
                 'registered_idx' => ['registered'],
                 'registered_idx' => ['registered'],
             ],
             ],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('users', $schema);
         $this->c->DB->createTable('users', $schema);
-
+        // smilies
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'            => ['SERIAL', false],
                 'id'            => ['SERIAL', false],
@@ -739,34 +768,10 @@ class Install extends Page
                 'disp_position' => ['TINYINT(4) UNSIGNED', false, 0],
                 'disp_position' => ['TINYINT(4) UNSIGNED', false, 0],
             ],
             ],
             'PRIMARY KEY' => ['id'],
             'PRIMARY KEY' => ['id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('smilies', $schema);
         $this->c->DB->createTable('smilies', $schema);
-
-        $smilies = [
-            ':)'         => 'smile.png',
-            '=)'         => 'smile.png',
-            ':|'         => 'neutral.png',
-            '=|'         => 'neutral.png',
-            ':('         => 'sad.png',
-            '=('         => 'sad.png',
-            ':D'         => 'big_smile.png',
-            '=D'         => 'big_smile.png',
-            ':o'         => 'yikes.png',
-            ':O'         => 'yikes.png',
-            ';)'         => 'wink.png',
-            ':/'         => 'hmm.png',
-            ':P'         => 'tongue.png',
-            ':p'         => 'tongue.png',
-            ':lol:'      => 'lol.png',
-            ':mad:'      => 'mad.png',
-            ':rolleyes:' => 'roll.png',
-            ':cool:'     => 'cool.png',
-        ];
-        $i = 0;
-        foreach ($smilies as $text => $img) {
-            $this->c->DB->exec('INSERT INTO ::smilies (image, text, disp_position) VALUES(?s, ?s, ?i)', [$img, $text, $i++]); //????
-        }
-
+        // warnings
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'id'        => ['SERIAL', false],
                 'id'        => ['SERIAL', false],
@@ -776,9 +781,10 @@ class Install extends Page
                 'message'   => ['TEXT', true],
                 'message'   => ['TEXT', true],
             ],
             ],
             'PRIMARY KEY' => ['id'],
             'PRIMARY KEY' => ['id'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('warnings', $schema);
         $this->c->DB->createTable('warnings', $schema);
-
+        // poll
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'tid'      => ['INT(10) UNSIGNED', false, 0],
                 'tid'      => ['INT(10) UNSIGNED', false, 0],
@@ -788,9 +794,10 @@ class Install extends Page
                 'votes'    => ['INT(10) UNSIGNED', false, 0],
                 'votes'    => ['INT(10) UNSIGNED', false, 0],
             ],
             ],
             'PRIMARY KEY' => ['tid', 'question', 'field'],
             'PRIMARY KEY' => ['tid', 'question', 'field'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('poll', $schema);
         $this->c->DB->createTable('poll', $schema);
-
+        // poll_voted
         $schema = [
         $schema = [
             'FIELDS' => [
             'FIELDS' => [
                 'tid' => ['INT(10) UNSIGNED', false],
                 'tid' => ['INT(10) UNSIGNED', false],
@@ -798,26 +805,64 @@ class Install extends Page
                 'rez' => ['TEXT', true],
                 'rez' => ['TEXT', true],
             ],
             ],
             'PRIMARY KEY' => ['tid', 'uid'],
             'PRIMARY KEY' => ['tid', 'uid'],
+            'ENGINE' => $this->DBEngine,
         ];
         ];
         $this->c->DB->createTable('poll_voted', $schema) ;
         $this->c->DB->createTable('poll_voted', $schema) ;
+        // mark_of_forum
+        $schema = [
+            'FIELDS' => [
+                'uid'      => ['INT(10) UNSIGNED', true],
+                'fid'      => ['INT(10) UNSIGNED', true],
+                'mf_upper' => ['INT(10) UNSIGNED', true],
+                'mf_lower' => ['INT(10) UNSIGNED', true],
+            ],
+            'UNIQUE KEYS' => [
+                'uid_fid_idx' => ['uid', 'fid'],
+            ],
+            'INDEXES' => [
+                'mf_upper_idx' => ['mf_upper'],
+                'mf_lower_idx' => ['mf_lower'],
+            ],
+            'ENGINE' => $this->DBEngine,
+        ];
+        $this->c->DB->createTable('mark_of_forum', $schema);
+        // mark_of_topic
+        $schema = [
+            'FIELDS' => [
+                'uid'      => ['INT(10) UNSIGNED', true],
+                'fid'      => ['INT(10) UNSIGNED', true], //????
+                'tid'      => ['INT(10) UNSIGNED', true],
+                'mt_upper' => ['INT(10) UNSIGNED', true],
+                'mt_lower' => ['INT(10) UNSIGNED', true],
+            ],
+            'UNIQUE KEYS' => [
+                'uid_fid_tid_idx' => ['uid', 'fid', 'tid'],
+            ],
+            'INDEXES' => [
+                'mt_upper_idx' => ['mt_upper'],
+                'mt_lower_idx' => ['mt_lower'],
+            ],
+            'ENGINE' => $this->DBEngine,
+        ];
+        $this->c->DB->createTable('mark_of_topic', $schema);
 
 
         $now = time();
         $now = time();
 
 
         $groups = [
         $groups = [
-        // g_id, g_title,             g_user_title,        g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood
-            [1, __('Administrators'), __('Administrator'), 0,           0,                0,                  0,                      0,               1,                   1,            1,            1,              1,             1,            1,              1,               1,           1,        1,              1,            0,            0,              0,             0],
-            [2, __('Moderators'),     __('Moderator'),     1,           1,                1,                  1,                      1,               1,                   1,            1,            1,              1,             1,            1,              1,               1,           1,        1,              1,            0,            0,              0,             0],
-            [3, __('Guests'),         NULL,                0,           0,                0,                  0,                      0,               0,                   1,            1,            0,              0,             0,            0,              0,               0,           1,        1,              0,            120,          60,             0,             0],
-            [4, __('Members'),        NULL,                0,           0,                0,                  0,                      0,               0,                   1,            1,            1,              1,             1,            1,              1,               0,           1,        1,              1,            30,           30,             60,            60],
+        //    g_id,                  g_title,              g_user_title,        g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood
+            [$this->c->GROUP_ADMIN,  __('Administrators'), __('Administrator'), 0,           0,                0,                  0,                      0,               1,                   1,            1,            1,              1,             1,            1,              1,               1,           1,        1,              1,            0,            0,              0,             0],
+            [$this->c->GROUP_MOD,    __('Moderators'),     __('Moderator'),     1,           1,                1,                  1,                      1,               1,                   1,            1,            1,              1,             1,            1,              1,               1,           1,        1,              1,            0,            0,              0,             0],
+            [$this->c->GROUP_GUEST,  __('Guests'),         NULL,                0,           0,                0,                  0,                      0,               0,                   1,            1,            0,              0,             0,            0,              0,               0,           1,        1,              0,            120,          60,             0,             0],
+            [$this->c->GROUP_MEMBER, __('Members'),        NULL,                0,           0,                0,                  0,                      0,               0,                   1,            1,            1,              1,             1,            1,              1,               0,           1,        1,              1,            30,           30,             60,            60],
         ];
         ];
         foreach ($groups as $group) { //???? $db_type != 'pgsql'
         foreach ($groups as $group) { //???? $db_type != 'pgsql'
             $this->c->DB->exec('INSERT INTO ::groups (g_id, g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES (?i, ?s, ?s, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i)', $group) ;
             $this->c->DB->exec('INSERT INTO ::groups (g_id, g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES (?i, ?s, ?s, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i)', $group) ;
         }
         }
-        $this->c->DB->exec('UPDATE ::groups SET g_pm_limit=0 WHERE g_id=1') ;
+        $this->c->DB->exec('UPDATE ::groups SET g_pm_limit=0 WHERE g_id=?i', [$this->c->GROUP_ADMIN]);
 
 
         $ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP) ?: 'unknow';
         $ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP) ?: 'unknow';
-        $this->c->DB->exec('INSERT INTO ::users (group_id, username, password, email) VALUES (?i, ?s, ?s, ?s)', [3, __('Guest'), __('Guest'), __('Guest')]);
-        $this->c->DB->exec('INSERT INTO ::users (group_id, username, password, email, language, style, num_posts, last_post, registered, registration_ip, last_visit) VALUES (?i, ?s, ?s, ?s, ?s, ?s, ?i, ?i, ?i, ?s, ?i)', [1, $v->username, password_hash($v->password, PASSWORD_DEFAULT), $v->email, $v->defaultlang, $v->defaultstyle, 1, $now, $now, $ip, $now]);
+        $this->c->DB->exec('INSERT INTO ::users (group_id, username, password, email) VALUES (?i, ?s, ?s, ?s)', [$this->c->GROUP_GUEST, __('Guest'), __('Guest'), __('Guest')]);
+        $this->c->DB->exec('INSERT INTO ::users (group_id, username, password, email, language, style, num_posts, last_post, registered, registration_ip, last_visit) VALUES (?i, ?s, ?s, ?s, ?s, ?s, ?i, ?i, ?i, ?s, ?i)', [$this->c->GROUP_ADMIN, $v->username, password_hash($v->password, PASSWORD_DEFAULT), $v->email, $v->defaultlang, $v->defaultstyle, 1, $now, $now, $ip, $now]);
 
 
         $pun_config = [
         $pun_config = [
             'i_fork_revision' => $this->c->FORK_REVISION,
             'i_fork_revision' => $this->c->FORK_REVISION,
@@ -838,7 +883,7 @@ class Install extends Page
             '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' => 4,
+            'o_default_user_group' => $this->c->GROUP_MEMBER,
             'o_topic_review' => 15,
             'o_topic_review' => 15,
             'o_disp_topics_default' => 30,
             'o_disp_topics_default' => 30,
             'o_disp_posts_default' => 25,
             'o_disp_posts_default' => 25,
@@ -857,7 +902,7 @@ class Install extends Page
             'o_default_email_setting' => 1,
             'o_default_email_setting' => 1,
             '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' => '/avatar/',
             'o_avatars_width' => 60,
             'o_avatars_width' => 60,
             'o_avatars_height' => 60,
             'o_avatars_height' => 60,
             'o_avatars_size' => 10240,
             'o_avatars_size' => 10240,
@@ -871,7 +916,7 @@ class Install extends Page
             'o_smtp_pass' => NULL,
             'o_smtp_pass' => NULL,
             'o_smtp_ssl' => 0,
             'o_smtp_ssl' => 0,
             'o_regs_allow' => 1,
             'o_regs_allow' => 1,
-            'o_regs_verify' => 0,
+            'o_regs_verify' => 1,
             'o_announcement' => 0,
             'o_announcement' => 0,
             'o_announcement_message' => __('Announcement'),
             'o_announcement_message' => __('Announcement'),
             'o_rules' => 0,
             'o_rules' => 0,
@@ -890,7 +935,7 @@ class Install extends Page
             'p_sig_img_tag' => 0,
             'p_sig_img_tag' => 0,
             'p_sig_length' => 400,
             'p_sig_length' => 400,
             'p_sig_lines' => 4,
             'p_sig_lines' => 4,
-            'p_allow_banned_email' => 1,
+            'p_allow_banned_email' => 0,
             'p_allow_dupe_email' => 0,
             'p_allow_dupe_email' => 0,
             'p_force_guest_email' => 1,
             'p_force_guest_email' => 1,
             'o_pms_enabled' => 1,                    // New PMS - Visman
             'o_pms_enabled' => 1,                    // New PMS - Visman
@@ -915,25 +960,64 @@ class Install extends Page
             'st_max_users' => 1,    // статистика по максимуму юзеров - Visman
             'st_max_users' => 1,    // статистика по максимуму юзеров - Visman
             'st_max_users_time' => time(),
             'st_max_users_time' => time(),
         ];
         ];
-
         foreach ($pun_config as $conf_name => $conf_value) {
         foreach ($pun_config as $conf_name => $conf_value) {
             $this->c->DB->exec('INSERT INTO ::config (conf_name, conf_value) VALUES (?s, ?s)', [$conf_name, $conf_value]);
             $this->c->DB->exec('INSERT INTO ::config (conf_name, conf_value) VALUES (?s, ?s)', [$conf_name, $conf_value]);
         }
         }
 
 
-        // Insert some other default data
-        $subject = __('Test post');
-        $message = __('Test message');
-
         $this->c->DB->exec('INSERT INTO ::categories (cat_name, disp_position) VALUES (?s, ?i)', [__('Test category'), 1]);
         $this->c->DB->exec('INSERT INTO ::categories (cat_name, disp_position) VALUES (?s, ?i)', [__('Test category'), 1]);
+        $this->c->DB->exec('INSERT INTO ::forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, last_topic, disp_position, cat_id) VALUES (?s, ?s, ?i, ?i, ?i, ?i, ?s, ?s, ?i, ?i)', [__('Test forum'), __('This is just a test forum'), 1, 1, $now, 1, $v->username, __('Test post'), 1, 1]);
+        $this->c->DB->exec('INSERT INTO ::topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, forum_id) VALUES(?s, ?s, ?i, ?i, ?i, ?i, ?s, ?i)', [$v->username, __('Test post'), $now, 1, $now, 1, $v->username, 1]);
+        $this->c->DB->exec('INSERT INTO ::posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES(?s, ?i, ?s, ?s, ?i, ?i)', [$v->username, 2, $ip, __('Test message'), $now, 1]);
 
 
-        $this->c->DB->exec('INSERT INTO ::forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, last_topic, disp_position, cat_id) VALUES (?s, ?s, ?i, ?i, ?i, ?i, ?s, ?s, ?i, ?i)', [__('Test forum'), __('This is just a test forum'), 1, 1, $now, 1, $v->username, $subject, 1, 1]);
+        $smilies = [
+            ':)'         => 'smile.png',
+            '=)'         => 'smile.png',
+            ':|'         => 'neutral.png',
+            '=|'         => 'neutral.png',
+            ':('         => 'sad.png',
+            '=('         => 'sad.png',
+            ':D'         => 'big_smile.png',
+            '=D'         => 'big_smile.png',
+            ':o'         => 'yikes.png',
+            ':O'         => 'yikes.png',
+            ';)'         => 'wink.png',
+            ':/'         => 'hmm.png',
+            ':P'         => 'tongue.png',
+            ':p'         => 'tongue.png',
+            ':lol:'      => 'lol.png',
+            ':mad:'      => 'mad.png',
+            ':rolleyes:' => 'roll.png',
+            ':cool:'     => 'cool.png',
+        ];
+        $i = 0;
+        foreach ($smilies as $text => $img) {
+            $this->c->DB->exec('INSERT INTO ::smilies (image, text, disp_position) VALUES(?s, ?s, ?i)', [$img, $text, $i++]); //????
+        }
 
 
-        $this->c->DB->exec('INSERT INTO ::topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, forum_id) VALUES(?s, ?s, ?i, ?i, ?i, ?i, ?s, ?i)', [$v->username, $subject, $now, 1, $now, 1, $v->username, 1]);
+        $this->c->DB->commit();
 
 
-        $this->c->DB->exec('INSERT INTO ::posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES(?s, ?i, ?s, ?s, ?i, ?i)', [$v->username, 2, $ip, $message, $now, 1]);
+        $config = file_get_contents($this->c->DIR_CONFIG . '/main.dist.php');
+        if (false === $config) {
+            throw new RuntimeException('No access to main.dist.php.');
+        }
 
 
-        $this->c->DB->commit();
+        $repl = [
+            '_BASE_URL_'      => $v->baseurl,
+            '_DB_DSN_'        => $this->c->DB_DSN,
+            '_DB_USERNAME_'   => $this->c->DB_USERNAME,
+            '_DB_PASSWORD_'   => $this->c->DB_PASSWORD,
+            '_DB_PREFIX_'     => $this->c->DB_PREFIX,
+            '_SALT_FOR_HMAC_' => $this->c->Secury->randomPass(21),
+            '_COOKIE_PREFIX_' => 'fork' . $this->c->Secury->randomHash(7) . '_',
+        ];
+        foreach ($repl as $key => $val) {
+            $config = str_replace($key, addslashes($val), $config);
+        }
+        $result = file_put_contents($this->c->DIR_CONFIG . '/main.php', $config);
+        if (false === $result) {
+            throw new RuntimeException('No write to main.php.');
+        }
 
 
-        exit();
+        return $this->c->Redirect->toIndex();
     }
     }
 }
 }

+ 25 - 26
app/config/install.php

@@ -10,9 +10,8 @@ return [
     'GROUP_MEMBER'     => 4,
     'GROUP_MEMBER'     => 4,
     'EOL' => PHP_EOL,
     'EOL' => PHP_EOL,
 
 
-
     'HMAC' => [
     'HMAC' => [
-        'algo' => 'sha1',
+        'algo' => 'sha256',
         'salt' => '_SALT_FOR_HMAC_',
         'salt' => '_SALT_FOR_HMAC_',
     ],
     ],
 
 
@@ -26,18 +25,24 @@ return [
     ],
     ],
 
 
     'shared' => [
     'shared' => [
-        'Lang' => \ForkBB\Core\Lang::class,
-        'Router' => [
-            'class' => \ForkBB\Core\Router::class,
-            'base_url' => '%BASE_URL%',
-        ],
-        'View' => [
-            'class' => \ForkBB\Core\View::class,
+        'FileCache' => [
+            'class' => \ForkBB\Core\Cache\FileCache::class,
             'cache_dir' => '%DIR_CACHE%',
             'cache_dir' => '%DIR_CACHE%',
-            'views_dir' => '%DIR_VIEWS%',
+        ],
+        'Cache' => [
+            'class' => \ForkBB\Core\Cache::class,
+            'provider' => '@FileCache',
+        ],
+        'DB' => [
+            'class' => \ForkBB\Core\DB::class,
+            'dsn'      => '%DB_DSN%',
+            'username' => '%DB_USERNAME%',
+            'password' => '%DB_PASSWORD%',
+            'options'  => '%DB_OPTIONS%',
+            'prefix'   => '%DB_PREFIX%',
         ],
         ],
         'Func' => \ForkBB\Core\Func::class,
         'Func' => \ForkBB\Core\Func::class,
-        'Validator' => \ForkBB\Models\Validator::class,
+        'Lang' => \ForkBB\Core\Lang::class,
         'Mail' => [
         'Mail' => [
             'class' => \ForkBB\Core\Mail::class,
             'class' => \ForkBB\Core\Mail::class,
             'host' => '',
             'host' => '',
@@ -46,33 +51,27 @@ return [
             'ssl' => '',
             'ssl' => '',
             'eol' => '%EOL%',
             'eol' => '%EOL%',
         ],
         ],
-        'DB' => [
-            'class' => \ForkBB\Core\DB::class,
-            'dsn'      => '%DB_DSN%',
-            'username' => '%DB_USERNAME%',
-            'password' => '%DB_PASSWORD%',
-            'options'  => '%DB_OPTIONS%',
-            'prefix'   => '%DB_PREFIX%',
+        'Router' => [
+            'class' => \ForkBB\Core\Router::class,
+            'base_url' => '%BASE_URL%',
         ],
         ],
-
-
-
-
-        'Request' => [
-            'class' => \ForkBB\Core\Request::class,
-            'Secury' => '@Secury',
+        'View' => [
+            'class' => \ForkBB\Core\View::class,
+            'cache_dir' => '%DIR_CACHE%',
+            'views_dir' => '%DIR_VIEWS%',
         ],
         ],
         'Secury' => [
         'Secury' => [
             'class' => \ForkBB\Core\Secury::class,
             'class' => \ForkBB\Core\Secury::class,
             'hmac' => '%HMAC%',
             'hmac' => '%HMAC%',
         ],
         ],
+        'Validator' => \ForkBB\Models\Validator::class,
     ],
     ],
     'multiple'  => [
     'multiple'  => [
         'PrimaryController' => \ForkBB\Controllers\Install::class,
         'PrimaryController' => \ForkBB\Controllers\Install::class,
         'Primary' => '@PrimaryController:routing',
         'Primary' => '@PrimaryController:routing',
 
 
+        'Debug' => \ForkBB\Models\Pages\Debug::class,
         'Install' => \ForkBB\Models\Pages\Install::class,
         'Install' => \ForkBB\Models\Pages\Install::class,
         'Redirect' => \ForkBB\Models\Pages\Redirect::class,
         'Redirect' => \ForkBB\Models\Pages\Redirect::class,
-        'Debug' => \ForkBB\Models\Pages\Debug::class,
     ],
     ],
 ];
 ];

+ 173 - 30
app/config/main.dist.php

@@ -1,17 +1,14 @@
 <?php
 <?php
 
 
-define('PUN_DEBUG', 1);
-define('PUN_SHOW_QUERIES', 1);
-
 return [
 return [
     'BASE_URL'    => '_BASE_URL_',
     'BASE_URL'    => '_BASE_URL_',
-    'DB_TYPE'     => '_DB_TYPE_',
-    'DB_HOST'     => '_DB_HOST_',
+    // Define line breaks in mail headers; possible values can be PHP_EOL, "\r\n", "\n" or "\r"
+    'EOL'         => PHP_EOL,
+    'DB_DSN'      => '_DB_DSN_',
     'DB_USERNAME' => '_DB_USERNAME_',
     'DB_USERNAME' => '_DB_USERNAME_',
     'DB_PASSWORD' => '_DB_PASSWORD_',
     'DB_PASSWORD' => '_DB_PASSWORD_',
-    'DB_NAME'     => '_DB_NAME_',
+    'DB_OPTIONS'  => [],
     'DB_PREFIX'   => '_DB_PREFIX_',
     'DB_PREFIX'   => '_DB_PREFIX_',
-    'P_CONNECT'   => false,
     'TIME_REMEMBER' => 31536000,
     'TIME_REMEMBER' => 31536000,
     'COOKIE' => [
     'COOKIE' => [
         'prefix' => '_COOKIE_PREFIX_',
         'prefix' => '_COOKIE_PREFIX_',
@@ -20,46 +17,192 @@ return [
         'secure' => false,
         'secure' => false,
     ],
     ],
     'HMAC' => [
     'HMAC' => [
-        'algo' => 'sha1',
+        'algo' => 'sha256',
         'salt' => '_SALT_FOR_HMAC_',
         'salt' => '_SALT_FOR_HMAC_',
     ],
     ],
-    'SALT1'       => '', // For FluxBB by Visman 1.5.10.74 and above
+    // For FluxBB by Visman 1.5.10.74 and above
+    'SALT1' => '',
     'JQUERY_LINK' => '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js',
     'JQUERY_LINK' => '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js',
+    'DEBUG' => 1,
+    'MAINTENANCE_OFF' => false,
+    'GROUP_UNVERIFIED' => 0,
+    'GROUP_ADMIN' => 1,
+    'GROUP_MOD' => 2,
+    'GROUP_GUEST' => 3,
+    'GROUP_MEMBER' => 4,
+
     'shared' => [
     'shared' => [
         'Request' => [
         'Request' => [
             'class' => \ForkBB\Core\Request::class,
             'class' => \ForkBB\Core\Request::class,
             'Secury' => '@Secury',
             'Secury' => '@Secury',
         ],
         ],
-        'DBLoader' => [
-            'class' => \ForkBB\Core\DBLoader::class,
-            'db_host'     => '%DB_HOST%',
-            'db_username' => '%DB_USERNAME%',
-            'db_password' => '%DB_PASSWORD%',
-            'db_name'     => '%DB_NAME%',
-            'db_prefix'   => '%DB_PREFIX%',
-            'p_connect'   => '%P_CONNECT%',
-        ],
         'DB' => [
         'DB' => [
-            'factory method' => '@DBLoader:load',
-            'type' => '%DB_TYPE%',
+            'class' => \ForkBB\Core\DB::class,
+            'dsn'      => '%DB_DSN%',
+            'username' => '%DB_USERNAME%',
+            'password' => '%DB_PASSWORD%',
+            'options'  => '%DB_OPTIONS%',
+            'prefix'   => '%DB_PREFIX%',
         ],
         ],
         'Secury' => [
         'Secury' => [
             'class' => \ForkBB\Core\Secury::class,
             'class' => \ForkBB\Core\Secury::class,
             'hmac' => '%HMAC%',
             'hmac' => '%HMAC%',
         ],
         ],
-        'Cookie' => [
-            'class' => \ForkBB\Core\Cookie::class,
-            'Secury' => '@Secury',
-            'options' => '%COOKIE%'
+        'FileCache' => [
+            'class' => \ForkBB\Core\Cache\FileCache::class,
+            'cache_dir' => '%DIR_CACHE%',
+        ],
+        'Cache' => [
+            'class' => \ForkBB\Core\Cache::class,
+            'provider' => '@FileCache',
+        ],
+        'View' => [
+            'class' => \ForkBB\Core\View::class,
+            'cache_dir' => '%DIR_CACHE%',
+            'views_dir' => '%DIR_VIEWS%',
+        ],
+        'Router' => [
+            'class' => \ForkBB\Core\Router::class,
+            'base_url' => '%BASE_URL%',
+        ],
+        'Lang' => \ForkBB\Core\Lang::class,
+        'Mail' => [
+            'class' => \ForkBB\Core\Mail::class,
+            'host' => '%config.o_smtp_host%',
+            'user' => '%config.o_smtp_user%',
+            'pass' => '%config.o_smtp_pass%',
+            'ssl' => '%config.o_smtp_ssl%',
+            'eol' => '%EOL%',
+        ],
+        'Func' => \ForkBB\Core\Func::class,
+
+        'CacheLoader' => [
+            'class' => \ForkBB\Models\Actions\CacheLoader::class,
+            'Cache' => '@Cache',
+        ],
+        'CacheGenerator' => \ForkBB\Models\Actions\CacheGenerator::class,
+        'CacheStopwords' => [
+            'class' => \ForkBB\Models\Actions\CacheStopwords::class,
+            'Cache' => '@Cache',
         ],
         ],
+
+        'user' => '@LoadCurrentUser:load',
+        'config' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'config',
+        ],
+        'bans' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'bans',
+        ],
+        'censoring' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'censoring',
+        ],
+        'users_info' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'users_info',
+        ],
+        'admins' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'admins',
+        ],
+        'smilies' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'smilies',
+        ],
+        'stopwords' => '@CacheStopwords:load',
+        'forums' => '@CacheLoader:loadForums',
+
         'UserCookie' => [
         'UserCookie' => [
-            'class' => \ForkBB\Core\Cookie\UserCookie::class,
+            'class' => \ForkBB\Models\UserCookie::class,
+            'Secury' => '@Secury',
+            'options' => '%COOKIE%',
+            'min' => '%config.o_timeout_visit%',
+            'max' => '%TIME_REMEMBER%',
+        ],
+        'Csrf' => [
+            'class' => \ForkBB\Models\Csrf::class,
             'Secury' => '@Secury',
             'Secury' => '@Secury',
-            'Cookie' => '@Cookie',
-            'timeMin' => '@config[o_timeout_visit]',
-            'timeMax' => '%TIME_REMEMBER%',
+            'user' => '@user',
         ],
         ],
-        'firstAction' => \ForkBB\Core\Blank::class,
+        'Online' => \ForkBB\Models\Online::class,
+        'UserMapper' => \ForkBB\Models\UserMapper::class,
+        'Validator' => \ForkBB\Models\Validator::class,
+
+        'Message' => \ForkBB\Models\Pages\Message::class,
+    ],
+    'multiple'  => [
+        'PrimaryController' => \ForkBB\Controllers\Primary::class,
+        'Primary' => '@PrimaryController:check',
+
+        'RoutingController' => \ForkBB\Controllers\Routing::class,
+        'Routing' => '@RoutingController:routing',
+
+        'CheckBans' => \ForkBB\Models\Actions\CheckBans::class,
+        'LoadCurrentUser' => [
+            'class' => \ForkBB\Models\Actions\LoadUserFromCookie::class,
+            'mapper' => '@UserMapper',
+            'cookie' => '@UserCookie',
+            'config' => '@config',
+        ],
+
+        'config update' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'config',
+            'update' => true,
+        ],
+        'get config' => '@CacheGenerator:config',
+
+        'bans update' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'bans',
+            'update' => true,
+        ],
+        'get bans' => '@CacheGenerator:bans',
+
+        'censoring update' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'censoring',
+            'update' => true,
+        ],
+        'get censoring' => '@CacheGenerator:censoring',
+
+        'users_info update' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'users_info',
+            'update' => true,
+        ],
+        'get users_info' => '@CacheGenerator:usersInfo',
+
+        'admins update' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'admins',
+            'update' => true,
+        ],
+        'get admins' => '@CacheGenerator:admins',
+
+        'smilies update' => [
+            'factory method' => '@CacheLoader:load',
+            'key' => 'smilies',
+            'update' => true,
+        ],
+        'get smilies' => '@CacheGenerator:smilies',
+
+        'get forums' => [
+            'factory method' => '@CacheGenerator:forums',
+            'user' => '@user',
+        ],
+
+        'Index' => \ForkBB\Models\Pages\Index::class,
+        'Rules' => \ForkBB\Models\Pages\Rules::class,
+        'Auth' => \ForkBB\Models\Pages\Auth::class,
+        'Register' => \ForkBB\Models\Pages\Register::class,
+        'Redirect' => \ForkBB\Models\Pages\Redirect::class,
+        'Maintenance' => \ForkBB\Models\Pages\Maintenance::class,
+        'Ban' => \ForkBB\Models\Pages\Ban::class,
+        'Debug' => \ForkBB\Models\Pages\Debug::class,
+        'AdminIndex' => \ForkBB\Models\Pages\Admin\Index::class,
+        'AdminStatistics' => \ForkBB\Models\Pages\Admin\Statistics::class,
     ],
     ],
-    'multiple'  => [],
 ];
 ];

+ 1 - 1
app/lang/English/admin_index.po

@@ -58,7 +58,7 @@ msgid "ForkBB version label"
 msgstr "ForkBB version"
 msgstr "ForkBB version"
 
 
 msgid "ForkBB version data"
 msgid "ForkBB version data"
-msgstr "v %s"
+msgstr "rev.%s"
 
 
 msgid "Server statistics label"
 msgid "Server statistics label"
 msgstr "Server statistics"
 msgstr "Server statistics"

+ 3 - 0
app/lang/English/install.po

@@ -132,6 +132,9 @@ msgstr "No styles."
 msgid "No DB extensions"
 msgid "No DB extensions"
 msgstr "This PHP environment does not have support for any of the databases that ForkBB supports. PDO must be enabled."
 msgstr "This PHP environment does not have support for any of the databases that ForkBB supports. PDO must be enabled."
 
 
+msgid "No access to main.dist.php"
+msgstr "No access to main.dist.php."
+
 msgid "My ForkBB Forum"
 msgid "My ForkBB Forum"
 msgstr "My ForkBB Forum"
 msgstr "My ForkBB Forum"
 
 

+ 1 - 1
app/lang/Russian/admin_index.po

@@ -58,7 +58,7 @@ msgid "ForkBB version label"
 msgstr "Версия ForkBB"
 msgstr "Версия ForkBB"
 
 
 msgid "ForkBB version data"
 msgid "ForkBB version data"
-msgstr "v %s"
+msgstr "rev.%s"
 
 
 msgid "Server statistics label"
 msgid "Server statistics label"
 msgstr "Статистика сервера"
 msgstr "Статистика сервера"

+ 3 - 0
app/lang/Russian/install.po

@@ -132,6 +132,9 @@ msgstr "Нет стилей."
 msgid "No DB extensions"
 msgid "No DB extensions"
 msgstr "Ваш PHP не поддерживает ни одного типа БД поддерживаемого ForkBB. PDO должен быть включен."
 msgstr "Ваш PHP не поддерживает ни одного типа БД поддерживаемого ForkBB. PDO должен быть включен."
 
 
+msgid "No access to main.dist.php"
+msgstr "Нет доступа к файлу конфигурации main.dist.php."
+
 msgid "My ForkBB Forum"
 msgid "My ForkBB Forum"
 msgstr "Мой ForkBB форум"
 msgstr "Мой ForkBB форум"
 
 

+ 1 - 1
app/templates/admin/index.tpl

@@ -19,7 +19,7 @@
         <div>
         <div>
           <dl>
           <dl>
             <dt>{!! __('ForkBB version label') !!}</dt>
             <dt>{!! __('ForkBB version label') !!}</dt>
-            <dd>{!! __('ForkBB version data', $version) !!}</dd>
+            <dd>{!! __('ForkBB version data', $revision) !!}</dd>
             <dt>{!! __('Server statistics label') !!}</dt>
             <dt>{!! __('Server statistics label') !!}</dt>
             <dd><a href="{!! $linkStat !!}">{!! __('View server statistics') !!}</a></dd>
             <dd><a href="{!! $linkStat !!}">{!! __('View server statistics') !!}</a></dd>
             <dt>{!! __('Support label') !!}</dt>
             <dt>{!! __('Support label') !!}</dt>