Visman 7 tahun lalu
induk
melakukan
cda99fbe4b

+ 10 - 10
app/Core/View.php

@@ -26,15 +26,15 @@ class View extends Dirk
      * Compile Statements that start with "@"
      * Compile Statements that start with "@"
      *
      *
      * @param  string  $value
      * @param  string  $value
-     * 
+     *
      * @return mixed
      * @return mixed
      */
      */
     protected function compileStatements($value)
     protected function compileStatements($value)
     {
     {
-        return preg_replace_callback(
+        return \preg_replace_callback(
             '/[ \t]*+\B@(\w+)(?: [ \t]*( \( ( (?>[^()]+) | (?2) )* \) ) )?/x',
             '/[ \t]*+\B@(\w+)(?: [ \t]*( \( ( (?>[^()]+) | (?2) )* \) ) )?/x',
             function($match) {
             function($match) {
-                if (method_exists($this, $method = 'compile' . ucfirst($match[1]))) {
+                if (\method_exists($this, $method = 'compile' . \ucfirst($match[1]))) {
                     return isset($match[2]) ? $this->$method($match[2]) : $this->$method('');
                     return isset($match[2]) ? $this->$method($match[2]) : $this->$method('');
                 } else {
                 } else {
                     return $match[0];
                     return $match[0];
@@ -66,13 +66,13 @@ use function \ForkBB\size;
 ?>
 ?>
 EOD;
 EOD;
 
 
-        if (strpos($value, '<!-- inline -->') === false) {
+        if (\strpos($value, '<!-- inline -->') === false) {
             return $perfix . $value;
             return $perfix . $value;
         }
         }
-        return $perfix . preg_replace_callback(
+        return $perfix . \preg_replace_callback(
             '%<!-- inline -->([^<]*(?:<(?!!-- endinline -->)[^<]*)*+)(?:<!-- endinline -->)?%',
             '%<!-- inline -->([^<]*(?:<(?!!-- endinline -->)[^<]*)*+)(?:<!-- endinline -->)?%',
             function ($matches) {
             function ($matches) {
-                return preg_replace('%\h*\R\s*%', '', $matches[1]);
+                return \preg_replace('%\h*\R\s*%', '', $matches[1]);
             },
             },
             $value
             $value
         );
         );
@@ -88,7 +88,7 @@ EOD;
     public function rendering(Page $p)
     public function rendering(Page $p)
     {
     {
         foreach ($p->httpHeaders as $header) {
         foreach ($p->httpHeaders as $header) {
-            header($header);
+            \header($header);
         }
         }
 
 
         if (null === $p->nameTpl) {
         if (null === $p->nameTpl) {
@@ -98,12 +98,12 @@ EOD;
         $p->prepare();
         $p->prepare();
 
 
         $this->templates[] = $p->nameTpl;
         $this->templates[] = $p->nameTpl;
-        while ($_name = array_shift($this->templates)) {
+        while ($_name = \array_shift($this->templates)) {
             $this->beginBlock('content');
             $this->beginBlock('content');
             foreach ($this->composers as $_cname => $_cdata) {
             foreach ($this->composers as $_cname => $_cdata) {
-                if (preg_match($_cname, $_name)) {
+                if (\preg_match($_cname, $_name)) {
                     foreach ($_cdata as $_citem) {
                     foreach ($_cdata as $_citem) {
-                        extract((is_callable($_citem) ? $_citem($this) : $_citem) ?: []);
+                        \extract((\is_callable($_citem) ? $_citem($this) : $_citem) ?: []);
                     }
                     }
                 }
                 }
             }
             }

+ 23 - 21
app/Models/Page.php

@@ -37,6 +37,7 @@ class Page extends Model
         if ($container->config->o_announcement == '1') {
         if ($container->config->o_announcement == '1') {
             $this->fAnnounce = $container->config->o_announcement_message;
             $this->fAnnounce = $container->config->o_announcement_message;
         }
         }
+        $this->user         = $this->c->user; // передача текущего юзера в шаблон
     }
     }
 
 
     /**
     /**
@@ -55,40 +56,41 @@ class Page extends Model
      */
      */
     protected function fNavigation()
     protected function fNavigation()
     {
     {
-        $user = $this->c->user;
         $r = $this->c->Router;
         $r = $this->c->Router;
 
 
         $nav = [
         $nav = [
             'index' => [$r->link('Index'), \ForkBB\__('Index')]
             'index' => [$r->link('Index'), \ForkBB\__('Index')]
         ];
         ];
 
 
-        if ($user->g_read_board == '1' && $user->g_view_users == '1') {
+        if ($this->user->g_read_board == '1' && $this->user->viewUsers) {
             $nav['userlist'] = [$r->link('Userlist'), \ForkBB\__('User list')];
             $nav['userlist'] = [$r->link('Userlist'), \ForkBB\__('User list')];
         }
         }
 
 
-        if ($this->c->config->o_rules == '1' && (! $user->isGuest || $user->g_read_board == '1' || $this->c->config->o_regs_allow == '1')) {
+        if ($this->c->config->o_rules == '1'
+            && (! $this->user->isGuest || $this->user->g_read_board == '1' || $this->c->config->o_regs_allow == '1')
+        ) {
             $nav['rules'] = [$r->link('Rules'), \ForkBB\__('Rules')];
             $nav['rules'] = [$r->link('Rules'), \ForkBB\__('Rules')];
         }
         }
 
 
-        if ($user->g_read_board == '1' && $user->g_search == '1') {
+        if ($this->user->g_read_board == '1' && $this->user->g_search == '1') {
             $nav['search'] = [$r->link('Search'), \ForkBB\__('Search')];
             $nav['search'] = [$r->link('Search'), \ForkBB\__('Search')];
         }
         }
 
 
-        if ($user->isGuest) {
+        if ($this->user->isGuest) {
             $nav['register'] = [$r->link('Register'), \ForkBB\__('Register')];
             $nav['register'] = [$r->link('Register'), \ForkBB\__('Register')];
             $nav['login'] = [$r->link('Login'), \ForkBB\__('Login')];
             $nav['login'] = [$r->link('Login'), \ForkBB\__('Login')];
         } else {
         } else {
             $nav['profile'] = [$r->link('User', [
             $nav['profile'] = [$r->link('User', [
-                'id' => $user->id,
-                'name' => $user->username,
+                'id'   => $this->user->id,
+                'name' => $this->user->username,
             ]), \ForkBB\__('Profile')];
             ]), \ForkBB\__('Profile')];
             // New PMS
             // New PMS
-            if ($this->c->config->o_pms_enabled == '1' && ($user->isAdmin || $user->messages_new > 0)) { //????
+            if ($this->c->config->o_pms_enabled == '1' && ($this->user->isAdmin || $this->user->messages_new > 0)) { //????
                 $nav['pmsnew'] = ['pmsnew.php', \ForkBB\__('PM')]; //'<li id="nav"'.((PUN_ACTIVE_PAGE == 'pms_new' || $user['messages_new'] > 0) ? ' class="isactive"' : '').'><a href="pmsnew.php">'.\ForkBB\__('PM').(($user['messages_new'] > 0) ? ' (<span'.((empty($this->c->config->o_pms_flasher) || PUN_ACTIVE_PAGE == 'pms_new') ? '' : ' class="remflasher"' ).'>'.$user['messages_new'].'</span>)' : '').'</a></li>';
                 $nav['pmsnew'] = ['pmsnew.php', \ForkBB\__('PM')]; //'<li id="nav"'.((PUN_ACTIVE_PAGE == 'pms_new' || $user['messages_new'] > 0) ? ' class="isactive"' : '').'><a href="pmsnew.php">'.\ForkBB\__('PM').(($user['messages_new'] > 0) ? ' (<span'.((empty($this->c->config->o_pms_flasher) || PUN_ACTIVE_PAGE == 'pms_new') ? '' : ' class="remflasher"' ).'>'.$user['messages_new'].'</span>)' : '').'</a></li>';
             }
             }
             // New PMS
             // New PMS
 
 
-            if ($user->isAdmMod) {
+            if ($this->user->isAdmMod) {
                 $nav['admin'] = [$r->link('Admin'), \ForkBB\__('Admin')];
                 $nav['admin'] = [$r->link('Admin'), \ForkBB\__('Admin')];
             }
             }
 
 
@@ -97,10 +99,10 @@ class Page extends Model
             ]), \ForkBB\__('Logout')];
             ]), \ForkBB\__('Logout')];
         }
         }
 
 
-        if ($user->g_read_board == '1' && $this->c->config->o_additional_navlinks != '') {
+        if ($this->user->g_read_board == '1' && $this->c->config->o_additional_navlinks != '') {
             // position|name|link[|id]\n
             // position|name|link[|id]\n
-            if (preg_match_all('%^(\d+)\|([^\|\n\r]+)\|([^\|\n\r]+)(?:\|([^\|\n\r]+))?$%m', $this->c->config->o_additional_navlinks . "\n", $matches)) {
-               $k = count($matches[0]);
+            if (\preg_match_all('%^(\d+)\|([^\|\n\r]+)\|([^\|\n\r]+)(?:\|([^\|\n\r]+))?$%m', $this->c->config->o_additional_navlinks . "\n", $matches)) {
+               $k = \count($matches[0]);
                for ($i = 0; $i < $k; ++$i) {
                for ($i = 0; $i < $k; ++$i) {
                    if (empty($matches[4][$i])) {
                    if (empty($matches[4][$i])) {
                        $matches[4][$i] = 'extra' . $i;
                        $matches[4][$i] = 'extra' . $i;
@@ -108,10 +110,10 @@ class Page extends Model
                    if (isset($nav[$matches[4][$i]])) {
                    if (isset($nav[$matches[4][$i]])) {
                        $nav[$matches[4][$i]] = [$matches[3][$i], $matches[2][$i]];
                        $nav[$matches[4][$i]] = [$matches[3][$i], $matches[2][$i]];
                    } else {
                    } else {
-                       $nav = array_merge(
-                           array_slice($nav, 0, $matches[1][$i]),
+                       $nav = \array_merge(
+                           \array_slice($nav, 0, $matches[1][$i]),
                            [$matches[4][$i] => [$matches[3][$i], $matches[2][$i]]],
                            [$matches[4][$i] => [$matches[3][$i], $matches[2][$i]]],
-                           array_slice($nav, $matches[1][$i])
+                           \array_slice($nav, $matches[1][$i])
                        );
                        );
                    }
                    }
                }
                }
@@ -125,7 +127,7 @@ class Page extends Model
      */
      */
     protected function maintenance()
     protected function maintenance()
     {
     {
-        if ($this->c->config->o_maintenance == '1' && $this->c->user->isAdmin) {
+        if ($this->c->config->o_maintenance == '1' && $this->user->isAdmin) {
             $this->a['fIswev']['w']['maintenance'] = \ForkBB\__('Maintenance mode enabled', $this->c->Router->link('AdminMaintenance'));
             $this->a['fIswev']['w']['maintenance'] = \ForkBB\__('Maintenance mode enabled', $this->c->Router->link('AdminMaintenance'));
         }
         }
     }
     }
@@ -144,7 +146,7 @@ class Page extends Model
             $titles = $this->titles;
             $titles = $this->titles;
         }
         }
         $titles[] = $this->c->config->o_board_title;
         $titles[] = $this->c->config->o_board_title;
-        return implode(\ForkBB\__('Title separator'), $titles);
+        return \implode(\ForkBB\__('Title separator'), $titles);
     }
     }
 
 
     /**
     /**
@@ -155,7 +157,7 @@ class Page extends Model
      */
      */
     protected function getpageHeaders()
     protected function getpageHeaders()
     {
     {
-        $headers = [['link', 'rel="stylesheet" type="text/css" href="' . $this->c->PUBLIC_URL . '/style/' . $this->c->user->style . '/style.css' . '"']];
+        $headers = [['link', 'rel="stylesheet" type="text/css" href="' . $this->c->PUBLIC_URL . '/style/' . $this->user->style . '/style.css' . '"']];
         if ($this->canonical) {
         if ($this->canonical) {
             $headers[] = ['link', 'rel="canonical" href="' . $this->canonical . '"'];
             $headers[] = ['link', 'rel="canonical" href="' . $this->canonical . '"'];
         }
         }
@@ -219,7 +221,7 @@ class Page extends Model
             $status = 'HTTP/1.0 ';
             $status = 'HTTP/1.0 ';
 
 
             if (isset($_SERVER['SERVER_PROTOCOL'])
             if (isset($_SERVER['SERVER_PROTOCOL'])
-                && preg_match('%^HTTP/([12]\.[01])%', $_SERVER['SERVER_PROTOCOL'], $match)
+                && \preg_match('%^HTTP/([12]\.[01])%', $_SERVER['SERVER_PROTOCOL'], $match)
             ) {
             ) {
                 $status = 'HTTP/' . $match[1] . ' ';
                 $status = 'HTTP/' . $match[1] . ' ';
             }
             }
@@ -254,10 +256,10 @@ class Page extends Model
         if (empty($this->a['fIswev'])) {
         if (empty($this->a['fIswev'])) {
             $this->a['fIswev'] = [];
             $this->a['fIswev'] = [];
         }
         }
-        if (isset($val[0]) && isset($val[1]) && is_string($val[0]) && is_string($val[1])) {
+        if (isset($val[0]) && isset($val[1]) && \is_string($val[0]) && \is_string($val[1])) {
             $this->a['fIswev'][$val[0]][] = $val[1];
             $this->a['fIswev'][$val[0]][] = $val[1];
         } else {
         } else {
-            $this->a['fIswev'] = array_merge_recursive((array) $this->a['fIswev'], $val);
+            $this->a['fIswev'] = \array_merge_recursive((array) $this->a['fIswev'], $val);
         }
         }
     }
     }
 }
 }

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

@@ -40,7 +40,6 @@ class Admin extends Page
      */
      */
     protected function aNavigation()
     protected function aNavigation()
     {
     {
-        $user = $this->c->user;
         $r = $this->c->Router;
         $r = $this->c->Router;
 
 
         $nav = [
         $nav = [
@@ -49,14 +48,14 @@ class Admin extends Page
                 'users' => ['admin_users.php', \ForkBB\__('Users')],
                 'users' => ['admin_users.php', \ForkBB\__('Users')],
             ],
             ],
         ];
         ];
-        if ($user->isAdmin || $user->g_mod_ban_users == '1') {
+        if ($this->user->isAdmin || $this->user->g_mod_ban_users == '1') {
             $nav['Moderator menu']['bans'] = ['admin_bans.php', \ForkBB\__('Bans')];
             $nav['Moderator menu']['bans'] = ['admin_bans.php', \ForkBB\__('Bans')];
         }
         }
-        if ($user->isAdmin || $this->c->config->o_report_method == '0' || $this->c->config->o_report_method == '2') {
+        if ($this->user->isAdmin || $this->c->config->o_report_method == '0' || $this->c->config->o_report_method == '2') {
             $nav['Moderator menu']['reports'] = ['admin_reports.php', \ForkBB\__('Reports')];
             $nav['Moderator menu']['reports'] = ['admin_reports.php', \ForkBB\__('Reports')];
         }
         }
 
 
-        if ($user->isAdmin) {
+        if ($this->user->isAdmin) {
             $nav['Admin menu'] = [
             $nav['Admin menu'] = [
                 'options'     => [$r->link('AdminOptions'), \ForkBB\__('Admin options')],
                 'options'     => [$r->link('AdminOptions'), \ForkBB\__('Admin options')],
                 'permissions' => [$r->link('AdminPermissions'), \ForkBB\__('Permissions')],
                 'permissions' => [$r->link('AdminPermissions'), \ForkBB\__('Permissions')],

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

@@ -297,7 +297,7 @@ class Options extends Admin
             ],
             ],
         ];
         ];
 
 
-        $timestamp = time() + ($this->c->user->timezone + $this->c->user->dst) * 3600;
+        $timestamp = time() + ($this->user->timezone + $this->user->dst) * 3600;
         $time = \ForkBB\dt($timestamp, false, $config->o_date_format, $config->o_time_format, true, true);
         $time = \ForkBB\dt($timestamp, false, $config->o_date_format, $config->o_time_format, true, true);
         $date = \ForkBB\dt($timestamp, true, $config->o_date_format, $config->o_time_format, false, true);
         $date = \ForkBB\dt($timestamp, true, $config->o_date_format, $config->o_time_format, false, true);
 
 

+ 7 - 8
app/Models/Pages/Admin/Statistics.php

@@ -8,7 +8,7 @@ class Statistics extends Admin
 {
 {
     /**
     /**
      * phpinfo
      * phpinfo
-     * 
+     *
      * @return Page
      * @return Page
      */
      */
     public function info()
     public function info()
@@ -21,22 +21,22 @@ class Statistics extends Admin
         ob_start();
         ob_start();
         phpinfo();
         phpinfo();
         $page = ob_get_clean();
         $page = ob_get_clean();
-        
+
         if (preg_match('%<body[^>]*>(.*)</body[^>]*>%is', $page, $matches)) {
         if (preg_match('%<body[^>]*>(.*)</body[^>]*>%is', $page, $matches)) {
             $phpinfo = $matches[1];
             $phpinfo = $matches[1];
             if (preg_match('%<style[^>]*>(.*?)</style[^>]*>%is', $page, $matches)) {
             if (preg_match('%<style[^>]*>(.*?)</style[^>]*>%is', $page, $matches)) {
                 $style = preg_replace_callback(
                 $style = preg_replace_callback(
-                    '%(\S[^{]*)({[^}]+})%', 
+                    '%(\S[^{]*)({[^}]+})%',
                     function($match) {
                     function($match) {
                         $result = array_map(
                         $result = array_map(
                             function($val) {
                             function($val) {
                                 $val = str_replace('body', '.f-phpinfo-div', $val, $count);
                                 $val = str_replace('body', '.f-phpinfo-div', $val, $count);
                                 return $count ? $val : '.f-phpinfo-div ' . $val;
                                 return $count ? $val : '.f-phpinfo-div ' . $val;
-                            }, 
+                            },
                             explode(',', $match[1])
                             explode(',', $match[1])
                         );
                         );
                         return implode(', ', $result) . $match[2];
                         return implode(', ', $result) . $match[2];
-                    }, 
+                    },
                     $matches[1]
                     $matches[1]
                 );
                 );
                 $this->addStyle('phpinfo', $style);
                 $this->addStyle('phpinfo', $style);
@@ -48,13 +48,13 @@ class Statistics extends Admin
         $this->nameTpl = 'admin/phpinfo';
         $this->nameTpl = 'admin/phpinfo';
         $this->titles  = 'phpinfo()';
         $this->titles  = 'phpinfo()';
         $this->phpinfo = $phpinfo;
         $this->phpinfo = $phpinfo;
-        
+
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
      * Подготавливает данные для шаблона
      * Подготавливает данные для шаблона
-     * 
+     *
      * @return Page
      * @return Page
      */
      */
     public function statistics()
     public function statistics()
@@ -63,7 +63,6 @@ class Statistics extends Admin
 
 
         $this->nameTpl  = 'admin/statistics';
         $this->nameTpl  = 'admin/statistics';
         $this->titles   = \ForkBB\__('Server statistics');
         $this->titles   = \ForkBB\__('Server statistics');
-        $this->isAdmin  = $this->c->user->isAdmin;
         $this->linkInfo = $this->c->Router->link('AdminInfo');
         $this->linkInfo = $this->c->Router->link('AdminInfo');
 
 
         // Get the server load averages (if possible)
         // Get the server load averages (if possible)

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

@@ -29,8 +29,8 @@ class Auth extends Page
         }
         }
 
 
         $this->c->Cookie->deleteUser();
         $this->c->Cookie->deleteUser();
-        $this->c->Online->delete($this->c->user);
-        $this->c->users->updateLastVisit($this->c->user);
+        $this->c->Online->delete($this->user);
+        $this->c->users->updateLastVisit($this->user);
 
 
         $this->c->Lang->load('auth');
         $this->c->Lang->load('auth');
         return $this->c->Redirect->page('Index')->message('Logout redirect');
         return $this->c->Redirect->page('Index')->message('Logout redirect');
@@ -124,9 +124,9 @@ class Auth extends Page
                 // перезаписываем ip админа и модератора - Visman
                 // перезаписываем ip админа и модератора - Visman
                 if ($user->isAdmMod
                 if ($user->isAdmMod
                     && $this->c->config->o_check_ip
                     && $this->c->config->o_check_ip
-                    && $user->registration_ip != $this->c->user->ip
+                    && $user->registration_ip != $this->user->ip
                 ) {
                 ) {
-                    $user->registration_ip = $this->c->user->ip;
+                    $user->registration_ip = $this->user->ip;
                 }
                 }
                 // сбросить запрос на смену кодовой фразы
                 // сбросить запрос на смену кодовой фразы
                 if (! empty($user->activate_string) && 'p' === $user->activate_string{0}) {
                 if (! empty($user->activate_string) && 'p' === $user->activate_string{0}) {
@@ -135,7 +135,7 @@ class Auth extends Page
                 // изменения юзера в базе
                 // изменения юзера в базе
                 $this->c->users->update($user);
                 $this->c->users->update($user);
 
 
-                $this->c->Online->delete($this->c->user);
+                $this->c->Online->delete($this->user);
                 $this->c->Cookie->setUser($user, (bool) $v->save);
                 $this->c->Cookie->setUser($user, (bool) $v->save);
             }
             }
         }
         }

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

@@ -81,8 +81,7 @@ class Edit extends Page
         $this->c->DB->beginTransaction();
         $this->c->DB->beginTransaction();
 
 
         $now         = time();
         $now         = time();
-        $user        = $this->c->user;
-        $executive   = $user->isAdmin || $user->isModerator($post);
+        $executive   = $this->user->isAdmin || $this->user->isModerator($post);
         $topic       = $post->parent;
         $topic       = $post->parent;
         $editSubject = $post->id === $topic->first_post_id;
         $editSubject = $post->id === $topic->first_post_id;
         $calcPost    = false;
         $calcPost    = false;
@@ -93,7 +92,7 @@ class Edit extends Page
         if ($post->message !== $v->message) {
         if ($post->message !== $v->message) {
             $post->message       = $v->message;
             $post->message       = $v->message;
             $post->edited        = $now;
             $post->edited        = $now;
-            $post->edited_by     = $user->username;
+            $post->edited_by     = $this->user->username;
             $calcPost            = true;
             $calcPost            = true;
             if ($post->id === $topic->last_post_id) {
             if ($post->id === $topic->last_post_id) {
                 $calcTopic       = true;
                 $calcTopic       = true;
@@ -114,7 +113,7 @@ class Edit extends Page
             if ($topic->subject !== $v->subject) {
             if ($topic->subject !== $v->subject) {
                 $topic->subject  = $v->subject;
                 $topic->subject  = $v->subject;
                 $post->edited    = $now;
                 $post->edited    = $now;
-                $post->edited_by = $user->username;
+                $post->edited_by = $this->user->username;
                 $calcForum       = true;
                 $calcForum       = true;
             }
             }
             // выделение темы
             // выделение темы
@@ -144,8 +143,8 @@ class Edit extends Page
 
 
         // антифлуд
         // антифлуд
         if ($calcPost || $calcForum) {
         if ($calcPost || $calcForum) {
-            $user->last_post = $now; //????
-            $this->c->users->update($user);
+            $this->user->last_post = $now; //????
+            $this->c->users->update($this->user);
         }
         }
 
 
         $this->c->search->index($post, 'edit');
         $this->c->search->index($post, 'edit');

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

@@ -17,7 +17,7 @@ class Index extends Page
         $this->c->Lang->load('subforums');
         $this->c->Lang->load('subforums');
 
 
         // крайний пользователь // ???? может в stats переместить?
         // крайний пользователь // ???? может в stats переместить?
-        $this->c->stats->userLast = $this->c->user->g_view_users == '1'
+        $this->c->stats->userLast = $this->user->viewUsers
             ? [ $this->c->Router->link('User', [
             ? [ $this->c->Router->link('User', [
                     'id'   => $this->c->stats->userLast['id'],
                     'id'   => $this->c->stats->userLast['id'],
                     'name' => $this->c->stats->userLast['username'],
                     'name' => $this->c->stats->userLast['username'],

+ 6 - 6
app/Models/Pages/Install.php

@@ -75,8 +75,8 @@ class Install extends Page
                 ]);
                 ]);
 
 
             if ($v->validation($_POST)) {
             if ($v->validation($_POST)) {
-                $this->c->user->language = $v->installlang;
-                $changeLang              = (bool) $v->changelang;
+                $this->user->language = $v->installlang;
+                $changeLang           = (bool) $v->changelang;
             }
             }
         }
         }
         $v = null;
         $v = null;
@@ -184,7 +184,7 @@ class Install extends Page
                             'installlang' => [
                             'installlang' => [
                                 'type'    => 'select',
                                 'type'    => 'select',
                                 'options' => array_combine($langs, $langs),
                                 'options' => array_combine($langs, $langs),
-                                'value'   => $this->c->user->language,
+                                'value'   => $this->user->language,
                                 'title'   => \ForkBB\__('Install language'),
                                 'title'   => \ForkBB\__('Install language'),
                                 'info'    => \ForkBB\__('Choose install language info'),
                                 'info'    => \ForkBB\__('Choose install language info'),
                             ],
                             ],
@@ -204,7 +204,7 @@ class Install extends Page
             'action' => $this->c->Router->link('Install'),
             'action' => $this->c->Router->link('Install'),
             'hidden' => [
             'hidden' => [
                 'token'       => $this->c->Csrf->create('Install'),
                 'token'       => $this->c->Csrf->create('Install'),
-                'installlang' => $this->c->user->language,
+                'installlang' => $this->user->language,
             ],
             ],
             'sets'   => [
             'sets'   => [
                 [
                 [
@@ -346,14 +346,14 @@ class Install extends Page
                         'defaultlang' => [
                         'defaultlang' => [
                             'type'      => 'select',
                             'type'      => 'select',
                             'options'   => array_combine($langs, $langs),
                             'options'   => array_combine($langs, $langs),
-                            'value'     => $v ? $v->defaultlang : $this->c->user->language,
+                            'value'     => $v ? $v->defaultlang : $this->user->language,
                             'title'     => \ForkBB\__('Default language'),
                             'title'     => \ForkBB\__('Default language'),
                             'required'  => true,
                             'required'  => true,
                         ],
                         ],
                         'defaultstyle' => [
                         'defaultstyle' => [
                             'type'      => 'select',
                             'type'      => 'select',
                             'options'   => array_combine($styles, $styles),
                             'options'   => array_combine($styles, $styles),
-                            'value'     => $v ? $v->defaultstyle : $this->c->user->style,
+                            'value'     => $v ? $v->defaultstyle : $this->user->style,
                             'title'     => \ForkBB\__('Default style'),
                             'title'     => \ForkBB\__('Default style'),
                             'required'  => true,
                             'required'  => true,
                         ],
                         ],

+ 12 - 13
app/Models/Pages/Post.php

@@ -126,10 +126,9 @@ class Post extends Page
         $this->c->DB->beginTransaction();
         $this->c->DB->beginTransaction();
 
 
         $now       = time();
         $now       = time();
-        $user      = $this->c->user;
-        $username  = $user->isGuest ? $v->username : $user->username;
+        $username  = $this->user->isGuest ? $v->username : $this->user->username;
         $merge     = false;
         $merge     = false;
-        $executive = $user->isAdmin || $user->isModerator($model);
+        $executive = $this->user->isAdmin || $this->user->isModerator($model);
 
 
         // подготовка к объединению/сохранению сообщения
         // подготовка к объединению/сохранению сообщения
         if (null === $v->subject) {
         if (null === $v->subject) {
@@ -137,7 +136,7 @@ class Post extends Page
             $forum       = $model->parent;
             $forum       = $model->parent;
             $topic       = $model;
             $topic       = $model;
 
 
-            if (! $user->isGuest && $topic->last_poster === $username) {
+            if (! $this->user->isGuest && $topic->last_poster === $username) {
                 if ($executive) {
                 if ($executive) {
                     if ($v->merge_post) {
                     if ($v->merge_post) {
                         $merge = true;
                         $merge = true;
@@ -192,8 +191,8 @@ class Post extends Page
             $post = $this->c->posts->create();
             $post = $this->c->posts->create();
 
 
             $post->poster       = $username;
             $post->poster       = $username;
-            $post->poster_id    = $this->c->user->id;
-            $post->poster_ip    = $this->c->user->ip;
+            $post->poster_id    = $this->user->id;
+            $post->poster_ip    = $this->user->ip;
             $post->poster_email = $v->email;
             $post->poster_email = $v->email;
             $post->message      = $v->message; //?????
             $post->message      = $v->message; //?????
             $post->hide_smilies = $v->hide_smilies ? 1 : 0;
             $post->hide_smilies = $v->hide_smilies ? 1 : 0;
@@ -201,7 +200,7 @@ class Post extends Page
             $post->posted       = $now;
             $post->posted       = $now;
 #           $post->edited       =
 #           $post->edited       =
 #           $post->edited_by    =
 #           $post->edited_by    =
-            $post->user_agent   = $this->c->user->userAgent;
+            $post->user_agent   = $this->user->userAgent;
             $post->topic_id     = $topic->id;
             $post->topic_id     = $topic->id;
 
 
             $this->c->posts->insert($post);
             $this->c->posts->insert($post);
@@ -217,15 +216,15 @@ class Post extends Page
         $this->c->forums->update($forum->calcStat());
         $this->c->forums->update($forum->calcStat());
 
 
         // обновление данных текущего пользователя
         // обновление данных текущего пользователя
-        if (! $merge && ! $user->isGuest && $forum->no_sum_mess != '1') {
-            $user->num_posts = $user->num_posts + 1;
+        if (! $merge && ! $this->user->isGuest && $forum->no_sum_mess != '1') {
+            $this->user->num_posts = $this->user->num_posts + 1;
 
 
-            if ($user->g_promote_next_group != '0' && $user->num_posts >= $user->g_promote_min_posts) {
-                $user->group_id = $user->g_promote_next_group;
+            if ($this->user->g_promote_next_group != '0' && $this->user->num_posts >= $this->user->g_promote_min_posts) {
+                $this->user->group_id = $this->user->g_promote_next_group;
             }
             }
         }
         }
-        $user->last_post = $now;
-        $this->c->users->update($user);
+        $this->user->last_post = $now;
+        $this->c->users->update($this->user);
 
 
         if ($merge) {
         if ($merge) {
             $this->c->search->index($lastPost, 'merge');
             $this->c->search->index($lastPost, 'merge');

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

@@ -46,7 +46,7 @@ trait PostFormTrait
         ];
         ];
 
 
         $fieldset = [];
         $fieldset = [];
-        if ($this->c->user->isGuest) {
+        if ($this->user->isGuest) {
             $fieldset['username'] = [
             $fieldset['username'] = [
                 'dl'        => 'w1',
                 'dl'        => 'w1',
                 'type'      => 'text',
                 'type'      => 'text',
@@ -88,7 +88,7 @@ trait PostFormTrait
             'value'    => isset($vars['message']) ? $vars['message'] : null,
             'value'    => isset($vars['message']) ? $vars['message'] : null,
             'bb'       => [
             'bb'       => [
                 ['link', \ForkBB\__('BBCode'), \ForkBB\__($this->c->config->p_message_bbcode == '1' ? 'on' : 'off')],
                 ['link', \ForkBB\__('BBCode'), \ForkBB\__($this->c->config->p_message_bbcode == '1' ? 'on' : 'off')],
-                ['link', \ForkBB\__('url tag'), \ForkBB\__($this->c->config->p_message_bbcode == '1' && $this->c->user->g_post_links == '1' ? 'on' : 'off')],
+                ['link', \ForkBB\__('url tag'), \ForkBB\__($this->c->config->p_message_bbcode == '1' && $this->user->g_post_links == '1' ? 'on' : 'off')],
                 ['link', \ForkBB\__('img tag'), \ForkBB\__($this->c->config->p_message_bbcode == '1' && $this->c->config->p_message_img_tag == '1' ? 'on' : 'off')],
                 ['link', \ForkBB\__('img tag'), \ForkBB\__($this->c->config->p_message_bbcode == '1' && $this->c->config->p_message_img_tag == '1' ? 'on' : 'off')],
                 ['link', \ForkBB\__('Smilies'), \ForkBB\__($this->c->config->o_smilies == '1' ? 'on' : 'off')],
                 ['link', \ForkBB\__('Smilies'), \ForkBB\__($this->c->config->o_smilies == '1' ? 'on' : 'off')],
             ],
             ],
@@ -100,7 +100,7 @@ trait PostFormTrait
         $autofocus = null;
         $autofocus = null;
 
 
         $fieldset = [];
         $fieldset = [];
-        if ($this->c->user->isAdmin || $this->c->user->isModerator($model)) {
+        if ($this->user->isAdmin || $this->user->isModerator($model)) {
             if ($editSubject) {
             if ($editSubject) {
                 $fieldset['stick_topic'] = [
                 $fieldset['stick_topic'] = [
                     'type'    => 'checkbox',
                     'type'    => 'checkbox',

+ 21 - 22
app/Models/Pages/PostValidatorTrait.php

@@ -5,14 +5,14 @@ namespace ForkBB\Models\Pages;
 use ForkBB\Core\Validator;
 use ForkBB\Core\Validator;
 use ForkBB\Models\Model;
 use ForkBB\Models\Model;
 
 
-trait PostValidatorTrait 
+trait PostValidatorTrait
 {
 {
     /**
     /**
      * Дополнительная проверка email
      * Дополнительная проверка email
-     * 
+     *
      * @param Validator $v
      * @param Validator $v
      * @param string $email
      * @param string $email
-     * 
+     *
      * @return string
      * @return string
      */
      */
     public function vCheckEmail(Validator $v, $email)
     public function vCheckEmail(Validator $v, $email)
@@ -29,10 +29,10 @@ trait PostValidatorTrait
 
 
     /**
     /**
      * Дополнительная проверка username
      * Дополнительная проверка username
-     * 
+     *
      * @param Validator $v
      * @param Validator $v
      * @param string $username
      * @param string $username
-     * 
+     *
      * @return string
      * @return string
      */
      */
     public function vCheckUsername(Validator $v, $username)
     public function vCheckUsername(Validator $v, $username)
@@ -55,10 +55,10 @@ trait PostValidatorTrait
 
 
     /**
     /**
      * Дополнительная проверка subject
      * Дополнительная проверка subject
-     * 
+     *
      * @param Validator $v
      * @param Validator $v
      * @param string $subject
      * @param string $subject
-     * 
+     *
      * @return string
      * @return string
      */
      */
     public function vCheckSubject(Validator $v, $subject, $attr, $executive)
     public function vCheckSubject(Validator $v, $subject, $attr, $executive)
@@ -74,7 +74,7 @@ trait PostValidatorTrait
         ) {
         ) {
             $v->addError('All caps subject');
             $v->addError('All caps subject');
         } elseif (! $executive
         } elseif (! $executive
-            && $this->c->user->g_post_links != '1'
+            && $this->user->g_post_links != '1'
             && preg_match('%https?://|www\.%ui', $subject)
             && preg_match('%https?://|www\.%ui', $subject)
         ) {
         ) {
             $v->addError('You can not post links in subject');
             $v->addError('You can not post links in subject');
@@ -84,10 +84,10 @@ trait PostValidatorTrait
 
 
     /**
     /**
      * Дополнительная проверка message
      * Дополнительная проверка message
-     * 
+     *
      * @param Validator $v
      * @param Validator $v
      * @param string $message
      * @param string $message
-     * 
+     *
      * @return string
      * @return string
      */
      */
     public function vCheckMessage(Validator $v, $message, $attr, $executive)
     public function vCheckMessage(Validator $v, $message, $attr, $executive)
@@ -108,7 +108,7 @@ trait PostValidatorTrait
 
 
             foreach($this->c->Parser->getErrors() as $error) {
             foreach($this->c->Parser->getErrors() as $error) {
                 $v->addError($error);
                 $v->addError($error);
-            } 
+            }
         }
         }
 
 
         return $message;
         return $message;
@@ -116,10 +116,10 @@ trait PostValidatorTrait
 
 
     /**
     /**
      * Проверка времени ограничения флуда
      * Проверка времени ограничения флуда
-     * 
+     *
      * @param Validator $v
      * @param Validator $v
      * @param null|string $submit
      * @param null|string $submit
-     * 
+     *
      * @return null|string
      * @return null|string
      */
      */
     public function vCheckTimeout(Validator $v, $submit)
     public function vCheckTimeout(Validator $v, $submit)
@@ -128,11 +128,10 @@ trait PostValidatorTrait
             return null;
             return null;
         }
         }
 
 
-        $user = $this->c->user;
-        $time = time() - (int) $user->last_post;
+        $time = time() - (int) $this->user->last_post;
 
 
-        if ($time < $user->g_post_flood) {
-            $v->addError(\ForkBB\__('Flood start', $user->g_post_flood, $user->g_post_flood - $time), 'e');
+        if ($time < $this->user->g_post_flood) {
+            $v->addError(\ForkBB\__('Flood start', $this->user->g_post_flood, $this->user->g_post_flood - $time), 'e');
         }
         }
 
 
         return $submit;
         return $submit;
@@ -140,18 +139,18 @@ trait PostValidatorTrait
 
 
     /**
     /**
      * Подготовка валидатора к проверке данных из формы создания темы/сообщения
      * Подготовка валидатора к проверке данных из формы создания темы/сообщения
-     * 
+     *
      * @param Model $model
      * @param Model $model
      * @param string $marker
      * @param string $marker
      * @param array $args
      * @param array $args
      * @param bool $editPost
      * @param bool $editPost
      * @param bool $editSubject
      * @param bool $editSubject
-     * 
+     *
      * @return Validator
      * @return Validator
      */
      */
     protected function messageValidator(Model $model, $marker, array $args, $editPost = false, $editSubject = false)
     protected function messageValidator(Model $model, $marker, array $args, $editPost = false, $editSubject = false)
     {
     {
-        if ($this->c->user->isGuest) {
+        if ($this->user->isGuest) {
             $ruleEmail    = ('1' == $this->c->config->p_force_guest_email ? 'required|' : '') . 'string:trim,lower|email|check_email';
             $ruleEmail    = ('1' == $this->c->config->p_force_guest_email ? 'required|' : '') . 'string:trim,lower|email|check_email';
             $ruleUsername = 'required|string:trim,spaces|min:2|max:25|login|check_username';
             $ruleUsername = 'required|string:trim,spaces|min:2|max:25|login|check_username';
         } else {
         } else {
@@ -165,7 +164,7 @@ trait PostValidatorTrait
             $ruleSubject = 'absent';
             $ruleSubject = 'absent';
         }
         }
 
 
-        if ($this->c->user->isAdmin || $this->c->user->isModerator($model)) {
+        if ($this->user->isAdmin || $this->user->isModerator($model)) {
             if ($editSubject) {
             if ($editSubject) {
                 $ruleStickTopic = 'checkbox';
                 $ruleStickTopic = 'checkbox';
                 $ruleStickFP    = 'checkbox';
                 $ruleStickFP    = 'checkbox';
@@ -197,7 +196,7 @@ trait PostValidatorTrait
         } else {
         } else {
             $ruleHideSmilies = 'absent';
             $ruleHideSmilies = 'absent';
         }
         }
-            
+
         $v = $this->c->Validator->reset()
         $v = $this->c->Validator->reset()
             ->addValidators([
             ->addValidators([
                 'check_email'    => [$this, 'vCheckEmail'],
                 'check_email'    => [$this, 'vCheckEmail'],

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

@@ -147,7 +147,7 @@ class Register extends Page
         $user->language        = $user->language; //????
         $user->language        = $user->language; //????
         $user->style           = $user->style;    //????
         $user->style           = $user->style;    //????
         $user->registered      = time();
         $user->registered      = time();
-        $user->registration_ip = $this->c->user->ip;
+        $user->registration_ip = $this->user->ip;
 
 
         $newUserId = $this->c->users->insert($user);
         $newUserId = $this->c->users->insert($user);
 
 
@@ -198,7 +198,7 @@ class Register extends Page
                 $isSent = $this->c->Mail
                 $isSent = $this->c->Mail
                     ->reset()
                     ->reset()
                     ->setFolder($this->c->DIR_LANG)
                     ->setFolder($this->c->DIR_LANG)
-                    ->setLanguage($this->c->user->language)
+                    ->setLanguage($this->user->language)
                     ->setTo($v->email)
                     ->setTo($v->email)
                     ->setFrom($this->c->config->o_webmaster_email, \ForkBB\__('Mailer', $this->c->config->o_board_title))
                     ->setFrom($this->c->config->o_webmaster_email, \ForkBB\__('Mailer', $this->c->config->o_board_title))
                     ->setTpl('welcome.tpl', $tplData)
                     ->setTpl('welcome.tpl', $tplData)

+ 5 - 6
app/Models/Pages/Search.php

@@ -290,8 +290,7 @@ class Search extends Page
     public function vCheckQuery(Validator $v, $query, $method)
     public function vCheckQuery(Validator $v, $query, $method)
     {
     {
         if (empty($v->getErrors())) {
         if (empty($v->getErrors())) {
-            $user  = $this->c->user;
-            $flood = $user->last_search && time() - $user->last_search < $user->g_search_flood;
+            $flood = $this->user->last_search && time() - $this->user->last_search < $this->user->g_search_flood;
 
 
             if ('POST' !== $method || ! $flood) {
             if ('POST' !== $method || ! $flood) {
                 $search = $this->c->search;
                 $search = $this->c->search;
@@ -307,16 +306,16 @@ class Search extends Page
                             $v->addError('No hits', 'i');
                             $v->addError('No hits', 'i');
                         }
                         }
 
 
-                        if ($search->queryNoCache && $user->g_search_flood) {
-                            $user->last_search = time();
-                            $this->c->users->update($user); //?????
+                        if ($search->queryNoCache && $this->user->g_search_flood) {
+                            $this->user->last_search = time();
+                            $this->c->users->update($this->user); //?????
                         }
                         }
                     }
                     }
                 }
                 }
             }
             }
 
 
             if ($flood) {
             if ($flood) {
-                $v->addError(\ForkBB\__('Search flood', $user->g_search_flood, $user->g_search_flood - time() + $user->last_search));
+                $v->addError(\ForkBB\__('Search flood', $this->user->g_search_flood, $this->user->g_search_flood - time() + $this->user->last_search));
             }
             }
         }
         }
 
 

+ 0 - 1
app/Models/Pages/Userlist.php

@@ -52,7 +52,6 @@ class Userlist extends Page
 //        $this->form         = $form;
 //        $this->form         = $form;
         $this->crumbs       = $this->crumbs([$this->c->Router->link('Userlist'), \ForkBB\__('User_list')]);
         $this->crumbs       = $this->crumbs([$this->c->Router->link('Userlist'), \ForkBB\__('User_list')]);
         $this->pagination   = $this->c->Func->paginate($pages, $page, 'Userlist');
         $this->pagination   = $this->c->Func->paginate($pages, $page, 'Userlist');
-        $this->showUserLink = $this->c->config->o_show_user_info == '1';
 
 
         return $this;
         return $this;
     }
     }

+ 0 - 50
app/Models/Post/Model.php

@@ -56,56 +56,6 @@ class Model extends DataModel
         return $user;
         return $user;
     }
     }
 
 
-    /**
-     * Статус видимости ссылки на профиль пользователя
-     *
-     * @return bool
-     */
-    protected function getshowUserLink()
-    {
-        return $this->c->user->g_view_users == '1';
-    }
-
-    /**
-     * Статус показа аватаров
-     *
-     * @return bool
-     */
-    protected function getshowUserAvatar()
-    {
-        return $this->c->config->o_avatars == '1' && $this->c->user->show_avatars == '1';
-    }
-
-    /**
-     * Статус показа информации пользователя
-     *
-     * @return bool
-     */
-    protected function getshowUserInfo()
-    {
-        return $this->c->config->o_show_user_info == '1';
-    }
-
-    /**
-     * Статус показа подписи
-     *
-     * @return bool
-     */
-    protected function getshowSignature()
-    {
-        return $this->c->config->o_signatures == '1' && $this->c->user->show_sig == '1';
-    }
-
-    /**
-     * Статус показа количества сообщений
-     *
-     * @return bool
-     */
-    protected function getshowPostCount()
-    {
-        return $this->showUserInfo && $this->c->config->o_show_post_count == '1';
-    }
-
     protected function getcanReport()
     protected function getcanReport()
     {
     {
         return ! $this->c->user->isAdmin && ! $this->c->user->isGuest;
         return ! $this->c->user->isAdmin && ! $this->c->user->isGuest;

+ 2 - 2
app/Models/User/Manager.php

@@ -30,8 +30,8 @@ class Manager extends ManagerModel
      */
      */
     public function load($value, $field = 'id')
     public function load($value, $field = 'id')
     {
     {
-        if (is_array($value)) {
-            $result = [];
+        if (\is_array($value)) {
+            $result = \array_flip($value); // ???? а если пользователь не найдется?
             if ($field === 'id') {
             if ($field === 'id') {
                 $temp = [];
                 $temp = [];
                 foreach ($value as $id) {
                 foreach ($value as $id) {

+ 55 - 5
app/Models/User/Model.php

@@ -54,11 +54,11 @@ class Model extends DataModel
 
 
     /**
     /**
      * Статус модератора для указанной модели
      * Статус модератора для указанной модели
-     * 
+     *
      * @param BaseModel $model
      * @param BaseModel $model
-     * 
+     *
      * @throws RuntimeException
      * @throws RuntimeException
-     * 
+     *
      * @return bool
      * @return bool
      */
      */
     public function isModerator(BaseModel $model)
     public function isModerator(BaseModel $model)
@@ -66,7 +66,7 @@ class Model extends DataModel
         if ('1' != $this->g_moderator) {
         if ('1' != $this->g_moderator) {
             return false;
             return false;
         }
         }
-        
+
         while (! $model instanceof Forum) {
         while (! $model instanceof Forum) {
             $model = $model->parent;
             $model = $model->parent;
             if (! $model instanceof BaseModel) {
             if (! $model instanceof BaseModel) {
@@ -202,11 +202,61 @@ class Model extends DataModel
 
 
     /**
     /**
      * HTML код подписи
      * HTML код подписи
-     * 
+     *
      * @return string
      * @return string
      */
      */
     protected function gethtmlSign()
     protected function gethtmlSign()
     {
     {
         return $this->c->censorship->censor($this->c->Parser->parseSignature($this->signature));
         return $this->c->censorship->censor($this->c->Parser->parseSignature($this->signature));
     }
     }
+
+    /**
+     * Статус видимости профилей пользователей
+     *
+     * @return bool
+     */
+    protected function getviewUsers()
+    {
+        return $this->g_view_users == '1' || $this->isAdmin;
+    }
+
+    /**
+     * Статус показа аватаров
+     *
+     * @return bool
+     */
+    protected function getshowAvatar()
+    {
+        return $this->c->config->o_avatars == '1' && $this->show_avatars == '1';
+    }
+
+    /**
+     * Статус показа информации пользователя
+     *
+     * @return bool
+     */
+    protected function getshowUserInfo()
+    {
+        return $this->c->config->o_show_user_info == '1';
+    }
+
+    /**
+     * Статус показа подписи
+     *
+     * @return bool
+     */
+    protected function getshowSignature()
+    {
+        return $this->c->config->o_signatures == '1' && $this->show_sig == '1';
+    }
+
+    /**
+     * Статус показа количества сообщений
+     *
+     * @return bool
+     */
+    protected function getshowPostCount()
+    {
+        return $this->c->config->o_show_post_count == '1' || $this->isAdmMod;
+    }
 }
 }

+ 2 - 0
app/config/main.dist.php

@@ -128,6 +128,7 @@ return [
         'Delete'          => \ForkBB\Models\Pages\Delete::class,
         'Delete'          => \ForkBB\Models\Pages\Delete::class,
         'Rules'           => \ForkBB\Models\Pages\Rules::class,
         'Rules'           => \ForkBB\Models\Pages\Rules::class,
         'Auth'            => \ForkBB\Models\Pages\Auth::class,
         'Auth'            => \ForkBB\Models\Pages\Auth::class,
+        'Userlist'        => \ForkBB\Models\Pages\Userlist::class,
         'Search'          => \ForkBB\Models\Pages\Search::class,
         'Search'          => \ForkBB\Models\Pages\Search::class,
         'Register'        => \ForkBB\Models\Pages\Register::class,
         'Register'        => \ForkBB\Models\Pages\Register::class,
         'Redirect'        => \ForkBB\Models\Pages\Redirect::class,
         'Redirect'        => \ForkBB\Models\Pages\Redirect::class,
@@ -183,6 +184,7 @@ return [
         'UserManagerIsUniqueName'     => \ForkBB\Models\User\IsUniqueName::class,
         'UserManagerIsUniqueName'     => \ForkBB\Models\User\IsUniqueName::class,
         'UserManagerUsersNumber'      => \ForkBB\Models\User\UsersNumber::class,
         'UserManagerUsersNumber'      => \ForkBB\Models\User\UsersNumber::class,
         'UserManagerPromote'          => \ForkBB\Models\User\Promote::class,
         'UserManagerPromote'          => \ForkBB\Models\User\Promote::class,
+        'UserManagerFilter'           => \ForkBB\Models\User\Filter::class,
 
 
         'ForumModel'           => \ForkBB\Models\Forum\Model::class,
         'ForumModel'           => \ForkBB\Models\Forum\Model::class,
         'ForumModelCalcStat'   => \ForkBB\Models\Forum\CalcStat::class,
         'ForumModelCalcStat'   => \ForkBB\Models\Forum\CalcStat::class,

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

@@ -241,7 +241,7 @@ msgid "Post count label"
 msgstr "User post count"
 msgstr "User post count"
 
 
 msgid "Post count help"
 msgid "Post count help"
-msgstr "Show the number of posts a user has made (affects topic view, profile and user list)."
+msgstr "Show the number of posts a user has made (affects topic view, profile and user list). Does not affect administrators and moderators."
 
 
 msgid "Smilies label"
 msgid "Smilies label"
 msgstr "Smilies in posts"
 msgstr "Smilies in posts"

+ 6 - 6
app/lang/English/userlist.po

@@ -33,10 +33,10 @@ msgstr "All"
 msgid "User_list"
 msgid "User_list"
 msgstr "User list"
 msgstr "User list"
 
 
-msgid "%s<span> post,</span>"
-msgid_plural "%s<span> posts,</span>"
-msgstr[0] "%s<span> post,</span>"
-msgstr[1] "%s<span> posts,</span>"
+msgid "<b>%s</b><span> post,</span>"
+msgid_plural "<b>%s</b><span> posts,</span>"
+msgstr[0] "<b>%s</b><span> post,</span>"
+msgstr[1] "<b>%s</b><span> posts,</span>"
 
 
-msgid "<span>registered: </span>%s"
-msgstr "<span>registered: </span>%s"
+msgid "<span>registered: </span><b>%s</b>"
+msgstr "<span>registered: </span><b>%s</b>"

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

@@ -241,7 +241,7 @@ msgid "Post count label"
 msgstr "Счетчик сообщений"
 msgstr "Счетчик сообщений"
 
 
 msgid "Post count help"
 msgid "Post count help"
-msgstr "Показывать количество сообщений, отправленных пользователями (в темах, профиле и списке пользователей)."
+msgstr "Показывать количество сообщений, отправленных пользователями (в темах, профиле и списке пользователей). Не влияет на администраторов и модераторов."
 
 
 msgid "Smilies label"
 msgid "Smilies label"
 msgstr "Смайлы в сообщениях"
 msgstr "Смайлы в сообщениях"

+ 8 - 8
app/lang/Russian/userlist.po

@@ -33,11 +33,11 @@ msgstr "&lt;Все&gt;"
 msgid "User_list"
 msgid "User_list"
 msgstr "Список пользователей"
 msgstr "Список пользователей"
 
 
-msgid "%s<span> post,</span>"
-msgid_plural "%s<span> posts,</span>"
-msgstr[0] "%s<span> сообщение,</span>"
-msgstr[1] "%s<span> сообщения,</span>"
-msgstr[2] "%s<span> сообщений,</span>"
-
-msgid "<span>registered: </span>%s"
-msgstr "<span>дата регистрации: </span>%s"
+msgid "<b>%s</b><span> post,</span>"
+msgid_plural "<b>%s</b><span> posts,</span>"
+msgstr[0] "<b>%s</b><span> сообщение,</span>"
+msgstr[1] "<b>%s</b><span> сообщения,</span>"
+msgstr[2] "<b>%s</b><span> сообщений,</span>"
+
+msgid "<span>registered: </span><b>%s</b>"
+msgstr "<span>дата регистрации: </span><b>%s</b>"

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

@@ -7,7 +7,7 @@
               <dt>{!! __('Server load label') !!}</dt>
               <dt>{!! __('Server load label') !!}</dt>
               <dd>{!! __('Server load data', $p->serverLoad, $p->numOnline) !!}</dd>
               <dd>{!! __('Server load data', $p->serverLoad, $p->numOnline) !!}</dd>
             </dl>
             </dl>
-@if ($p->isAdmin)
+@if ($p->user->isAdmin)
             <dl>
             <dl>
               <dt>{!! __('Environment label') !!}</dt>
               <dt>{!! __('Environment label') !!}</dt>
               <dd>
               <dd>

+ 5 - 5
app/templates/topic.tpl

@@ -71,22 +71,22 @@
         <div class="f-post-body clearfix">
         <div class="f-post-body clearfix">
           <address class="f-post-left clearfix">
           <address class="f-post-left clearfix">
             <ul class="f-user-info">
             <ul class="f-user-info">
-    @if ($post->showUserLink && $post->user->link)
+    @if ($p->user->viewUsers && $post->user->link)
               <li class="f-username"><a href="{!! $post->user->link !!}">{{ $post->user->username }}</a></li>
               <li class="f-username"><a href="{!! $post->user->link !!}">{{ $post->user->username }}</a></li>
     @else
     @else
               <li class="f-username">{{ $post->user->username }}</li>
               <li class="f-username">{{ $post->user->username }}</li>
     @endif
     @endif
-    @if ($post->showUserAvatar && $post->user->avatar)
+    @if ($p->user->showAvatar && $post->user->avatar)
               <li class="f-avatar">
               <li class="f-avatar">
                 <img alt="{{ $post->user->username }}" src="{!! $post->user->avatar !!}">
                 <img alt="{{ $post->user->username }}" src="{!! $post->user->avatar !!}">
               </li>
               </li>
     @endif
     @endif
               <li class="f-usertitle">{{ $post->user->title() }}</li>
               <li class="f-usertitle">{{ $post->user->title() }}</li>
-    @if ($post->showPostCount && $post->user->num_posts)
+    @if ($p->user->showUserInfo && $p->user->showPostCount && $post->user->num_posts)
               <li class="f-postcount">{!! __('%s post', $post->user->num_posts, num($post->user->num_posts)) !!}</li>
               <li class="f-postcount">{!! __('%s post', $post->user->num_posts, num($post->user->num_posts)) !!}</li>
     @endif
     @endif
             </ul>
             </ul>
-    @if ($post->showUserInfo)
+    @if ($p->user->showUserInfo)
             <ul class="f-user-info-add">
             <ul class="f-user-info-add">
               <li>{!! __('Registered:') !!} {{ dt($post->user->registered, true) }}</li>
               <li>{!! __('Registered:') !!} {{ dt($post->user->registered, true) }}</li>
       @if ($post->user->location)
       @if ($post->user->location)
@@ -98,7 +98,7 @@
           <div class="f-post-right f-post-main">
           <div class="f-post-right f-post-main">
             {!! $post->html() !!}
             {!! $post->html() !!}
           </div>
           </div>
-    @if ($post->showSignature && $post->user->signature)
+    @if ($p->user->showSignature && $post->user->signature)
           <div class="f-post-right f-post-signature">
           <div class="f-post-right f-post-signature">
             <hr>
             <hr>
             {!! $post->user->htmlSign !!}
             {!! $post->user->htmlSign !!}

+ 1 - 1
app/templates/topic_in_search.tpl

@@ -59,7 +59,7 @@
         <div class="f-post-body clearfix">
         <div class="f-post-body clearfix">
           <address class="f-post-left clearfix">
           <address class="f-post-left clearfix">
             <ul class="f-user-info">
             <ul class="f-user-info">
-    @if ($post->showUserLink && $post->user->link)
+    @if ($p->user->viewUsers && $post->user->link)
               <li class="f-username"><a href="{!! $post->user->link !!}">{{ $post->user->username }}</a></li>
               <li class="f-username"><a href="{!! $post->user->link !!}">{{ $post->user->username }}</a></li>
     @else
     @else
               <li class="f-username">{{ $post->user->username }}</li>
               <li class="f-username">{{ $post->user->username }}</li>

+ 8 - 4
app/templates/userlist.tpl

@@ -57,19 +57,23 @@
           <li class="f-row f-thead" value="{{ $p->startNum }}">
           <li class="f-row f-thead" value="{{ $p->startNum }}">
             <span class="f-hcell f-cusername">{!! __('Username') !!}</span>
             <span class="f-hcell f-cusername">{!! __('Username') !!}</span>
             <span class="f-hcell f-ctitle">{!! __('Title') !!}</span>
             <span class="f-hcell f-ctitle">{!! __('Title') !!}</span>
+    @if ($p->user->showPostCount)
             <span class="f-hcell f-cnumposts">{!! __('Posts') !!}</span>
             <span class="f-hcell f-cnumposts">{!! __('Posts') !!}</span>
+    @endif
             <span class="f-hcell f-cdatereg">{!! __('Registered') !!}</span>
             <span class="f-hcell f-cdatereg">{!! __('Registered') !!}</span>
           </li>
           </li>
   @foreach ($p->userList as $user)
   @foreach ($p->userList as $user)
           <li class="f-row">
           <li class="f-row">
-    @if ($p->showUserLink && $user->link)
+    @if ($p->user->viewUsers && $user->link)
             <span class="f-cell f-cusername"><a href="{!! $user->link !!}">{{ $user->username }}</a></span>
             <span class="f-cell f-cusername"><a href="{!! $user->link !!}">{{ $user->username }}</a></span>
     @else
     @else
             <span class="f-cell f-cusername">{{ $user->username }}</span>
             <span class="f-cell f-cusername">{{ $user->username }}</span>
     @endif
     @endif
-            <span class="f-cell f-ctitle"><span>(</span>{{ $user->title() }}<span>),</span></span>
-            <span class="f-cell f-cnumposts">{!! __('%s<span> post,</span>', $user->num_posts, num($user->num_posts)) !!}</span>
-            <span class="f-cell f-cdatereg">{!! __('<span>registered: </span>%s', dt($user->registered, true)) !!}</span>
+            <span class="f-cell f-ctitle"><span>(</span><i>{{ $user->title() }}</i><span>),</span></span>
+    @if ($p->user->showPostCount)
+            <span class="f-cell f-cnumposts">{!! __('<b>%s</b><span> post,</span>', $user->num_posts, num($user->num_posts)) !!}</span>
+    @endif
+            <span class="f-cell f-cdatereg">{!! __('<span>registered: </span><b>%s</b>', dt($user->registered, true)) !!}</span>
           </li>
           </li>
   @endforeach
   @endforeach
         </ol>
         </ol>

+ 6 - 0
public/style/ForkBB/style.css

@@ -1946,6 +1946,12 @@ li + li .f-btn {
     display: none;
     display: none;
   }
   }
 
 
+  .f-ulist .f-cell > b,
+  .f-ulist .f-cell > i {
+    font-style: normal;
+    font-weight: normal;
+  }
+
   .f-ulist .f-cusername {
   .f-ulist .f-cusername {
     padding: 0.625rem 0 0.625rem 0.625rem;
     padding: 0.625rem 0 0.625rem 0.625rem;
     width: 50%;
     width: 50%;