Delete canViewIP from User\Model

This commit is contained in:
Visman 2020-06-18 17:03:55 +07:00
parent 2c7ef0dab5
commit b4ba1eed6e
5 changed files with 6 additions and 17 deletions

View file

@ -135,7 +135,7 @@ class Routing
$r->add(self::GET, '/admin/', 'AdminIndex:index', 'Admin');
$r->add(self::GET, '/admin/statistics', 'AdminStatistics:statistics', 'AdminStatistics');
if ($user->canViewIP) {
if ($this->c->userRules->viewIP) {
$r->add(self::GET, '/admin/get/host/{ip:[0-9a-fA-F:.]+}', 'AdminHost:view', 'AdminHost');
$r->add(self::GET, '/admin/users/user/{id:[2-9]|[1-9]\d+}[/{page:[1-9]\d*}]', 'AdminUsersStat:view', 'AdminUserStat');
}

View file

@ -92,7 +92,7 @@ class Profile extends Rules
protected function getviewIP(): bool
{
return $this->user->canViewIP;
return $this->user->isAdmin;;
}
protected function getuseAvatar(): bool

View file

@ -27,7 +27,7 @@ class Users extends Rules
protected function getviewIP(): bool
{
return $this->user->canViewIP;
return $this->user->isAdmin;
}
protected function getdeleteUsers(): bool

View file

@ -27,7 +27,7 @@ class Model extends DataModel
parent::__construct($container);
$this->zDepend = [
'group_id' => ['isUnverified', 'isGuest', 'isAdmin', 'isAdmMod', 'link', 'viewUsers', 'canViewIP', 'showPostCount', 'searchUsers'],
'group_id' => ['isUnverified', 'isGuest', 'isAdmin', 'isAdmMod', 'link', 'viewUsers', 'showPostCount', 'searchUsers'],
'id' => ['isGuest', 'link', 'avatar', 'online'],
'logged' => ['isLogged'],
'show_sig' => ['showSignature'],
@ -351,16 +351,6 @@ class Model extends DataModel
return (int) $attr;
}
/**
* Статус показа ip пользователей
*
* @return bool
*/
protected function getcanViewIP(): bool
{
return $this->isAdmin;
}
/**
* Ссылка для продвижения пользователя из указанного сообщения
*

View file

@ -132,6 +132,8 @@ return [
'VLusername' => \ForkBB\Models\Validators\Username::class,
'VLemail' => \ForkBB\Models\Validators\Email::class,
'ProfileRules' => \ForkBB\Models\Rules\Profile::class,
'UsersRules' => \ForkBB\Models\Rules\Users::class,
],
'multiple' => [
'CtrlPrimary' => \ForkBB\Controllers\Primary::class,
@ -276,8 +278,5 @@ return [
'SearchModelTruncateIndex' => \ForkBB\Models\Search\TruncateIndex::class,
'SearchModelPrepare' => \ForkBB\Models\Search\Prepare::class,
'SearchModelExecute' => \ForkBB\Models\Search\Execute::class,
'ProfileRules' => \ForkBB\Models\Rules\Profile::class,
'UsersRules' => \ForkBB\Models\Rules\Users::class,
],
];