Strict type checking
This commit is contained in:
parent
968e7dbbac
commit
7fa59c4023
29 changed files with 91 additions and 91 deletions
|
@ -34,7 +34,7 @@ class Primary
|
|||
public function check(): ?Page
|
||||
{
|
||||
if (
|
||||
1 == $this->c->config->b_maintenance
|
||||
1 === $this->c->config->b_maintenance
|
||||
&& ! $this->c->MAINTENANCE_OFF
|
||||
) {
|
||||
if (
|
||||
|
|
|
@ -60,7 +60,7 @@ class Routing
|
|||
);
|
||||
|
||||
// регистрация
|
||||
if (1 == $config->b_regs_allow) {
|
||||
if (1 === $config->b_regs_allow) {
|
||||
$r->add(
|
||||
$r::GET,
|
||||
'/registration',
|
||||
|
@ -102,7 +102,7 @@ class Routing
|
|||
);
|
||||
}
|
||||
// просмотр разрешен
|
||||
if ('1' == $user->g_read_board) {
|
||||
if (1 === $user->g_read_board) {
|
||||
// главная
|
||||
$r->add(
|
||||
$r::GET,
|
||||
|
@ -122,10 +122,10 @@ class Routing
|
|||
);
|
||||
// правила
|
||||
if (
|
||||
1 == $config->b_rules
|
||||
1 === $config->b_rules
|
||||
&& (
|
||||
! $user->isGuest
|
||||
|| 1 == $config->b_regs_allow
|
||||
|| 1 === $config->b_regs_allow
|
||||
)
|
||||
) {
|
||||
$r->add(
|
||||
|
@ -136,7 +136,7 @@ class Routing
|
|||
);
|
||||
}
|
||||
// поиск
|
||||
if ('1' == $user->g_search) {
|
||||
if (1 === $user->g_search) {
|
||||
$r->add(
|
||||
$r::GET,
|
||||
'/search[/simple/{keywords}[/{page|i:[1-9]\d*}]]',
|
||||
|
@ -354,7 +354,7 @@ class Routing
|
|||
// отправка email
|
||||
if (
|
||||
! $user->isGuest
|
||||
&& '1' == $user->g_send_email
|
||||
&& 1 === $user->g_send_email
|
||||
) {
|
||||
$r->add(
|
||||
$r::DUO,
|
||||
|
|
|
@ -34,17 +34,17 @@ class Parser extends Parserus
|
|||
protected function init(): void
|
||||
{
|
||||
if (
|
||||
1 == $this->c->config->b_message_bbcode
|
||||
|| 1 == $this->c->config->b_sig_bbcode
|
||||
1 === $this->c->config->b_message_bbcode
|
||||
|| 1 === $this->c->config->b_sig_bbcode
|
||||
) {
|
||||
$this->setBBCodes($this->c->bbcode->list);
|
||||
}
|
||||
|
||||
if (
|
||||
'1' == $this->c->user->show_smilies
|
||||
1 === $this->c->user->show_smilies
|
||||
&& (
|
||||
1 == $this->c->config->b_smilies_sig
|
||||
|| 1 == $this->c->config->b_smilies
|
||||
1 === $this->c->config->b_smilies_sig
|
||||
|| 1 === $this->c->config->b_smilies
|
||||
)
|
||||
) {
|
||||
$smilies = [];
|
||||
|
@ -71,7 +71,7 @@ class Parser extends Parserus
|
|||
public function prepare(string $text, bool $isSignature = false): string
|
||||
{
|
||||
if ($isSignature) {
|
||||
$whiteList = 1 == $this->c->config->b_sig_bbcode
|
||||
$whiteList = 1 === $this->c->config->b_sig_bbcode
|
||||
? (empty($this->c->config->a_bb_white_sig) && empty($this->c->config->a_bb_black_sig)
|
||||
? null
|
||||
: $this->c->config->a_bb_white_sig
|
||||
|
@ -79,7 +79,7 @@ class Parser extends Parserus
|
|||
: [];
|
||||
$blackList = null;
|
||||
} else {
|
||||
$whiteList = 1 == $this->c->config->b_message_bbcode
|
||||
$whiteList = 1 === $this->c->config->b_message_bbcode
|
||||
? (empty($this->c->config->a_bb_white_mes) && empty($this->c->config->a_bb_black_mes)
|
||||
? null
|
||||
: $this->c->config->a_bb_white_mes
|
||||
|
@ -94,7 +94,7 @@ class Parser extends Parserus
|
|||
->parse($text, ['strict' => true])
|
||||
->stripEmptyTags(" \n\t\r\v", true);
|
||||
|
||||
if (1 == $this->c->config->b_make_links) {
|
||||
if (1 === $this->c->config->b_make_links) {
|
||||
$this->detectUrls();
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class Parser extends Parserus
|
|||
{
|
||||
// при null предполагается брать данные после prepare()
|
||||
if (null !== $text) {
|
||||
$whiteList = 1 == $this->c->config->b_message_bbcode ? null : [];
|
||||
$whiteList = 1 === $this->c->config->b_message_bbcode ? null : [];
|
||||
$blackList = $this->c->config->a_bb_black_mes;
|
||||
|
||||
$this->setAttr('isSign', false)
|
||||
|
@ -119,7 +119,7 @@ class Parser extends Parserus
|
|||
|
||||
if (
|
||||
! $hideSmilies
|
||||
&& 1 == $this->c->config->b_smilies
|
||||
&& 1 === $this->c->config->b_smilies
|
||||
) {
|
||||
$this->detectSmilies();
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ class Parser extends Parserus
|
|||
{
|
||||
// при null предполагается брать данные после prepare()
|
||||
if (null !== $text) {
|
||||
$whiteList = 1 == $this->c->config->b_sig_bbcode ? null : [];
|
||||
$whiteList = 1 === $this->c->config->b_sig_bbcode ? null : [];
|
||||
$blackList = $this->c->config->a_bb_black_sig;
|
||||
|
||||
$this->setAttr('isSign', true)
|
||||
|
@ -143,7 +143,7 @@ class Parser extends Parserus
|
|||
->parse($text);
|
||||
}
|
||||
|
||||
if (1 == $this->c->config->b_smilies_sig) {
|
||||
if (1 === $this->c->config->b_smilies_sig) {
|
||||
$this->detectSmilies();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class Censorship extends Model
|
|||
*/
|
||||
public function init(): Censorship
|
||||
{
|
||||
if (1 == $this->c->config->b_censoring) {
|
||||
if (1 === $this->c->config->b_censoring) {
|
||||
$list = $this->c->Cache->get('censorship');
|
||||
|
||||
if (! isset($list['searchList'], $list['replaceList'])) {
|
||||
|
@ -50,7 +50,7 @@ class Censorship extends Model
|
|||
*/
|
||||
public function censor(string $str): string
|
||||
{
|
||||
if (1 == $this->c->config->b_censoring) {
|
||||
if (1 === $this->c->config->b_censoring) {
|
||||
return (string) \preg_replace($this->searchList, $this->replaceList, $str);
|
||||
} else {
|
||||
return $str;
|
||||
|
|
|
@ -57,7 +57,7 @@ class Forum extends DataModel
|
|||
return 1 == $this->post_topics
|
||||
|| (
|
||||
null === $this->post_topics
|
||||
&& 1 == $user->g_post_topics
|
||||
&& 1 === $user->g_post_topics
|
||||
)
|
||||
|| $user->isAdmin
|
||||
|| $user->isModerator($this);
|
||||
|
@ -76,7 +76,7 @@ class Forum extends DataModel
|
|||
*/
|
||||
protected function getcanSubscription(): bool
|
||||
{
|
||||
return 1 == $this->c->config->b_forum_subscriptions
|
||||
return 1 === $this->c->config->b_forum_subscriptions
|
||||
&& $this->id > 0
|
||||
&& ! $this->c->user->isGuest
|
||||
&& ! $this->c->user->isUnverified;
|
||||
|
|
|
@ -63,7 +63,7 @@ class LoadTree extends Action
|
|||
f.last_post, f.last_post_id, f.last_poster, f.last_topic
|
||||
FROM ::forums AS f
|
||||
WHERE id IN (?ai:forums)';
|
||||
} elseif (1 == $this->c->config->b_forum_subscriptions) {
|
||||
} elseif (1 === $this->c->config->b_forum_subscriptions) {
|
||||
$query = 'SELECT f.id, f.forum_desc, f.num_topics, f.sort_by, f.num_posts,
|
||||
f.last_post, f.last_post_id, f.last_poster, f.last_topic,
|
||||
mof.mf_mark_all_read, s.user_id AS is_subscribed
|
||||
|
|
|
@ -35,7 +35,7 @@ class Refresh extends Action
|
|||
|
||||
$this->list = [];
|
||||
|
||||
if ('1' == $read) {
|
||||
if (1 === $read) {
|
||||
$list = [];
|
||||
$vars = [
|
||||
':gid' => $gid,
|
||||
|
|
|
@ -57,7 +57,7 @@ class Online extends Model
|
|||
if (null === $position) {
|
||||
return $this;
|
||||
}
|
||||
$detail = $page->onlineDetail && 1 == $this->c->config->b_users_online;
|
||||
$detail = $page->onlineDetail && 1 === $this->c->config->b_users_online;
|
||||
$filter = $page->onlineFilter;
|
||||
|
||||
$this->updateUser($position);
|
||||
|
|
|
@ -71,7 +71,7 @@ abstract class Page extends Model
|
|||
$this->fTitle = $container->config->o_board_title;
|
||||
$this->fDescription = $container->config->o_board_desc;
|
||||
$this->fRootLink = $container->Router->link('Index');
|
||||
if (1 == $container->config->b_announcement) {
|
||||
if (1 === $container->config->b_announcement) {
|
||||
$this->fAnnounce = $container->config->o_announcement_message;
|
||||
}
|
||||
$this->user = $this->c->user; // передача текущего юзера в шаблон
|
||||
|
@ -122,7 +122,7 @@ abstract class Page extends Model
|
|||
];
|
||||
|
||||
if (
|
||||
'1' == $this->user->g_read_board
|
||||
1 === $this->user->g_read_board
|
||||
&& $this->user->viewUsers
|
||||
) {
|
||||
$navGen[self::FI_USERS] = [
|
||||
|
@ -133,11 +133,11 @@ abstract class Page extends Model
|
|||
}
|
||||
|
||||
if (
|
||||
1 == $this->c->config->b_rules
|
||||
&& '1' == $this->user->g_read_board
|
||||
1 === $this->c->config->b_rules
|
||||
&& 1 === $this->user->g_read_board
|
||||
&& (
|
||||
! $this->user->isGuest
|
||||
|| 1 == $this->c->config->b_regs_allow
|
||||
|| 1 === $this->c->config->b_regs_allow
|
||||
)
|
||||
) {
|
||||
$navGen[self::FI_RULES] = [
|
||||
|
@ -148,8 +148,8 @@ abstract class Page extends Model
|
|||
}
|
||||
|
||||
if (
|
||||
'1' == $this->user->g_read_board
|
||||
&& '1' == $this->user->g_search
|
||||
1 === $this->user->g_read_board
|
||||
&& 1 === $this->user->g_search
|
||||
) {
|
||||
$sub = [];
|
||||
$sub['latest'] = [
|
||||
|
@ -194,7 +194,7 @@ abstract class Page extends Model
|
|||
}
|
||||
|
||||
if ($this->user->isGuest) {
|
||||
if (1 == $this->c->config->b_regs_allow) {
|
||||
if (1 === $this->c->config->b_regs_allow) {
|
||||
$navUser[self::FI_REG] = [
|
||||
$r->link('Register'),
|
||||
'Register',
|
||||
|
@ -248,7 +248,7 @@ abstract class Page extends Model
|
|||
}
|
||||
|
||||
if (
|
||||
'1' == $this->user->g_read_board
|
||||
1 === $this->user->g_read_board
|
||||
&& '' != $this->c->config->o_additional_navlinks
|
||||
) {
|
||||
// position|name|link[|id]\n
|
||||
|
@ -281,7 +281,7 @@ abstract class Page extends Model
|
|||
protected function iswevMessages(): void
|
||||
{
|
||||
if (
|
||||
1 == $this->c->config->b_maintenance
|
||||
1 === $this->c->config->b_maintenance
|
||||
&& $this->user->isAdmin
|
||||
) {
|
||||
$this->fIswev = ['w', ['Maintenance mode enabled', $this->c->Router->link('AdminMaintenance')]];
|
||||
|
|
|
@ -463,7 +463,7 @@ class Bans extends Admin
|
|||
];
|
||||
$fields["l{$number}-creator"] = [
|
||||
'class' => ['result', 'creator'],
|
||||
'type' => '1' == $this->user->g_view_users && $ban['id_creator'] > 1 ? 'link' : 'str',
|
||||
'type' => 1 === $this->user->g_view_users && $ban['id_creator'] > 1 ? 'link' : 'str',
|
||||
'caption' => 'Results banned by head',
|
||||
'value' => $ban['name_creator'],
|
||||
'href' => $this->c->Router->link(
|
||||
|
|
|
@ -40,7 +40,7 @@ class Groups extends Admin
|
|||
}
|
||||
if (
|
||||
! \in_array($group->g_id, $notForDefault, true)
|
||||
&& 0 == $group->g_moderator
|
||||
&& 0 === $group->g_moderator
|
||||
) {
|
||||
$groupsDefault[$key] = $group->g_title;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class Auth extends Page
|
|||
$this->onlinePos = 'login';
|
||||
$this->robots = 'noindex';
|
||||
$this->titles = __('Login');
|
||||
$this->regLink = 1 == $this->c->config->b_regs_allow ? $this->c->Router->link('Register') : null;
|
||||
$this->regLink = 1 === $this->c->config->b_regs_allow ? $this->c->Router->link('Register') : null;
|
||||
|
||||
$username = $v ? $v->username : $username;
|
||||
$save = $v ? $v->save : 1;
|
||||
|
|
|
@ -162,7 +162,7 @@ class Edit extends Page
|
|||
}
|
||||
// показ смайлов
|
||||
if (
|
||||
1 == $this->c->config->b_smilies
|
||||
1 === $this->c->config->b_smilies
|
||||
&& (bool) $post->hide_smilies !== (bool) $v->hide_smilies
|
||||
) {
|
||||
$post->hide_smilies = $v->hide_smilies ? 1 : 0;
|
||||
|
|
|
@ -140,7 +140,7 @@ class PMEdit extends AbstractPM
|
|||
}
|
||||
// показ смайлов
|
||||
if (
|
||||
1 == $this->c->config->b_smilies
|
||||
1 === $this->c->config->b_smilies
|
||||
&& (bool) $post->hide_smilies !== (bool) $v->hide_smilies
|
||||
) {
|
||||
$post->hide_smilies = $v->hide_smilies ? 1 : 0;
|
||||
|
|
|
@ -213,7 +213,7 @@ class PMTopic extends AbstractPM
|
|||
|
||||
if (
|
||||
$this->model->canReply
|
||||
&& 1 == $this->c->config->b_quickpost
|
||||
&& 1 === $this->c->config->b_quickpost
|
||||
) {
|
||||
$form = $this->messageForm(null, 'PMAction', $this->model->dataReply, false, false, true);
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ class Post extends Page
|
|||
$this->user->last_post = $now;
|
||||
$this->c->users->update($this->user);
|
||||
|
||||
if (1 == $this->c->config->b_topic_subscriptions) { // ????
|
||||
if (1 === $this->c->config->b_topic_subscriptions) { // ????
|
||||
if (
|
||||
$v->subscribe
|
||||
&& ! $topic->is_subscribed
|
||||
|
@ -324,11 +324,11 @@ class Post extends Page
|
|||
$this->c->search->index($post);
|
||||
|
||||
if ($createTopic) {
|
||||
if (1 == $this->c->config->b_forum_subscriptions) { // ????
|
||||
if (1 === $this->c->config->b_forum_subscriptions) { // ????
|
||||
$this->c->subscriptions->send($post, $topic);
|
||||
}
|
||||
} else {
|
||||
if (1 == $this->c->config->b_topic_subscriptions) { // ????
|
||||
if (1 === $this->c->config->b_topic_subscriptions) { // ????
|
||||
$this->c->subscriptions->send($post);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ trait PostFormTrait
|
|||
'type' => 'text',
|
||||
'maxlength' => '80',
|
||||
'caption' => 'Email',
|
||||
'required' => 1 == $this->c->config->b_force_guest_email,
|
||||
'required' => 1 === $this->c->config->b_force_guest_email,
|
||||
'pattern' => '.+@.+',
|
||||
'value' => $vars['email'] ?? null,
|
||||
];
|
||||
|
@ -137,7 +137,7 @@ trait PostFormTrait
|
|||
|
||||
if (
|
||||
! $edit
|
||||
&& 1 == $this->c->config->b_topic_subscriptions
|
||||
&& 1 === $this->c->config->b_topic_subscriptions
|
||||
&& $this->user->email_confirmed
|
||||
) {
|
||||
$subscribed = ! $first && $model->is_subscribed;
|
||||
|
@ -161,7 +161,7 @@ trait PostFormTrait
|
|||
|
||||
if (
|
||||
! $quick
|
||||
&& 1 == $this->c->config->b_smilies
|
||||
&& 1 === $this->c->config->b_smilies
|
||||
) {
|
||||
$fieldset['hide_smilies'] = [
|
||||
'type' => 'checkbox',
|
||||
|
|
|
@ -106,7 +106,7 @@ trait PostValidatorTrait
|
|||
$notPM = $this->fIndex !== self::FI_PM;
|
||||
|
||||
if ($this->user->isGuest) {
|
||||
$ruleEmail = (1 == $this->c->config->b_force_guest_email ? 'required|' : '') . 'string:trim|email:noban';
|
||||
$ruleEmail = (1 === $this->c->config->b_force_guest_email ? 'required|' : '') . 'string:trim|email:noban';
|
||||
$ruleUsername = 'required|string:trim|username';
|
||||
} else {
|
||||
$ruleEmail = 'absent';
|
||||
|
@ -162,7 +162,7 @@ trait PostValidatorTrait
|
|||
if (
|
||||
! $edit
|
||||
&& $notPM
|
||||
&& 1 == $this->c->config->b_topic_subscriptions
|
||||
&& 1 === $this->c->config->b_topic_subscriptions
|
||||
&& $this->user->email_confirmed
|
||||
) {
|
||||
$ruleSubscribe = 'checkbox';
|
||||
|
@ -170,7 +170,7 @@ trait PostValidatorTrait
|
|||
$ruleSubscribe = 'absent';
|
||||
}
|
||||
|
||||
if (1 == $this->c->config->b_smilies) {
|
||||
if (1 === $this->c->config->b_smilies) {
|
||||
$ruleHideSmilies = 'checkbox';
|
||||
} else {
|
||||
$ruleHideSmilies = 'absent';
|
||||
|
|
|
@ -242,7 +242,7 @@ class View extends Profile
|
|||
'caption' => 'Last post info',
|
||||
];
|
||||
if ($this->curUser->last_post > 0) {
|
||||
if ('1' == $this->user->g_search) {
|
||||
if (1 === $this->user->g_search) {
|
||||
$fields['posts'] = [
|
||||
'class' => ['pline'],
|
||||
'type' => 'link',
|
||||
|
@ -289,7 +289,7 @@ class View extends Profile
|
|||
if ($this->rules->viewSubscription) {
|
||||
$subscr = $this->c->subscriptions;
|
||||
$subscrInfo = $subscr->info($this->curUser);
|
||||
$isLink = '1' == $this->user->g_search;
|
||||
$isLink = 1 === $this->user->g_search;
|
||||
if (! empty($subscrInfo[$subscr::FORUMS_DATA])) {
|
||||
$fields['forums_subscr'] = [
|
||||
'class' => ['pline'],
|
||||
|
|
|
@ -49,7 +49,7 @@ class Redirect extends Page
|
|||
public function message(/* string|array */ $message): Page
|
||||
{
|
||||
// переадресация без вывода сообщения
|
||||
if (0 == $this->c->config->i_redirect_delay) {
|
||||
if ($this->c->config->i_redirect_delay < 1) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ class Redirect extends Page
|
|||
protected function getHttpHeaders(): array
|
||||
{
|
||||
if (
|
||||
0 == $this->c->config->i_redirect_delay
|
||||
$this->c->config->i_redirect_delay < 1
|
||||
|| null === $this->nameTpl
|
||||
) {
|
||||
$this->httpStatus = 302;
|
||||
|
|
|
@ -149,7 +149,7 @@ class Register extends Page
|
|||
*/
|
||||
protected function regEnd(Validator $v): Page
|
||||
{
|
||||
if (1 == $this->c->config->b_regs_verify) {
|
||||
if (1 === $this->c->config->b_regs_verify) {
|
||||
$groupId = FORK_GROUP_UNVERIFIED;
|
||||
$key = $this->c->Secury->randomPass(31);
|
||||
} else {
|
||||
|
@ -185,7 +185,7 @@ class Register extends Page
|
|||
|
||||
// уведомление о регистрации
|
||||
if (
|
||||
1 == $this->c->config->b_regs_report
|
||||
1 === $this->c->config->b_regs_report
|
||||
&& '' != $this->c->config->o_mailing_list
|
||||
) {
|
||||
$this->c->Lang->load('common', $this->c->config->o_default_lang);
|
||||
|
@ -225,7 +225,7 @@ class Register extends Page
|
|||
$this->c->Lang->load('register');
|
||||
|
||||
// отправка письма активации аккаунта
|
||||
if (1 == $this->c->config->b_regs_verify) {
|
||||
if (1 === $this->c->config->b_regs_verify) {
|
||||
$this->c->Csrf->setHashExpiration(259200); // ???? хэш действует 72 часа
|
||||
|
||||
$link = $this->c->Router->link(
|
||||
|
@ -293,7 +293,7 @@ class Register extends Page
|
|||
|
||||
// уведомление о дубликате email
|
||||
if (
|
||||
1 == $this->c->config->b_regs_report
|
||||
1 === $this->c->config->b_regs_report
|
||||
&& '' != $this->c->config->o_mailing_list
|
||||
) {
|
||||
$this->c->Lang->load('common', $this->c->config->o_default_lang);
|
||||
|
@ -328,7 +328,7 @@ class Register extends Page
|
|||
$this->c->Lang->load('register');
|
||||
|
||||
// фейк отправки письма активации аккаунта
|
||||
if (1 == $this->c->config->b_regs_verify) {
|
||||
if (1 === $this->c->config->b_regs_verify) {
|
||||
$isSent = true;
|
||||
|
||||
// письмо активации аккаунта отправлено
|
||||
|
|
|
@ -53,7 +53,7 @@ class Rules extends Page
|
|||
__('Register'),
|
||||
]
|
||||
);
|
||||
$this->rules = 1 == $this->c->config->b_rules ? $this->c->config->o_rules_message : __('If no rules');
|
||||
$this->rules = 1 === $this->c->config->b_rules ? $this->c->config->o_rules_message : __('If no rules');
|
||||
$this->form = $this->formAgree();
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -146,7 +146,7 @@ class Topic extends Page
|
|||
|
||||
if (
|
||||
$topic->canReply
|
||||
&& 1 == $this->c->config->b_quickpost
|
||||
&& 1 === $this->c->config->b_quickpost
|
||||
) {
|
||||
$this->form = $this->messageForm($topic, 'NewReply', ['id' => $topic->id], false, false, true);
|
||||
}
|
||||
|
|
|
@ -124,11 +124,11 @@ class Post extends DataModel
|
|||
&& (
|
||||
(
|
||||
$this->id == $this->parent->first_post_id
|
||||
&& '1' == $this->c->user->g_delete_topics
|
||||
&& 1 === $this->c->user->g_delete_topics
|
||||
)
|
||||
|| (
|
||||
$this->id != $this->parent->first_post_id
|
||||
&& '1' == $this->c->user->g_delete_posts
|
||||
&& 1 === $this->c->user->g_delete_posts
|
||||
)
|
||||
)
|
||||
&& (
|
||||
|
@ -170,7 +170,7 @@ class Post extends DataModel
|
|||
}
|
||||
|
||||
return $this->user->id === $this->c->user->id
|
||||
&& '1' == $this->c->user->g_edit_posts
|
||||
&& 1 === $this->c->user->g_edit_posts
|
||||
&& (
|
||||
'0' == $this->c->user->g_deledit_interval
|
||||
|| '1' == $this->edit_post
|
||||
|
|
|
@ -33,8 +33,8 @@ class Profile extends Rules
|
|||
$this->my = ! $curUser->isGuest && $curUser->id === $this->user->id;
|
||||
$this->admin = $this->user->isAdmin && ($this->my || ! $curUser->isAdmin);
|
||||
$this->moderator = $this->user->isAdmMod && ($this->my || ! $curUser->isAdmMod);
|
||||
$this->editProfile = $this->my || $this->admin || ($this->moderator && '1' == $this->user->g_mod_edit_users);
|
||||
$this->editConfig = $this->my || $this->admin || ($this->moderator && '1' == $this->user->g_mod_edit_users); // ????
|
||||
$this->editProfile = $this->my || $this->admin || ($this->moderator && 1 === $this->user->g_mod_edit_users);
|
||||
$this->editConfig = $this->my || $this->admin || ($this->moderator && 1 === $this->user->g_mod_edit_users); // ????
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -44,18 +44,18 @@ class Profile extends Rules
|
|||
return ! $this->curUser->isBanByName
|
||||
&& (
|
||||
$this->admin
|
||||
|| ($this->moderator && '1' == $this->user->g_mod_rename_users)
|
||||
|| ($this->moderator && 1 === $this->user->g_mod_rename_users)
|
||||
);
|
||||
}
|
||||
|
||||
protected function geteditPass(): bool
|
||||
{
|
||||
return $this->my || $this->admin || ($this->moderator && '1' == $this->user->g_mod_change_passwords);
|
||||
return $this->my || $this->admin || ($this->moderator && 1 === $this->user->g_mod_change_passwords);
|
||||
}
|
||||
|
||||
protected function getsetTitle(): bool
|
||||
{
|
||||
return $this->admin || $this->moderator || '1' == $this->user->g_set_title;
|
||||
return $this->admin || $this->moderator || 1 === $this->user->g_set_title;
|
||||
}
|
||||
|
||||
protected function getviewOEmail(): bool
|
||||
|
@ -71,7 +71,7 @@ class Profile extends Rules
|
|||
|| (
|
||||
! $this->user->isGuest
|
||||
&& ! $this->user->isAdmMod
|
||||
&& '1' == $this->user->g_send_email
|
||||
&& 1 === $this->user->g_send_email
|
||||
&& $this->curUser->email_setting < 2
|
||||
)
|
||||
);
|
||||
|
@ -122,7 +122,7 @@ class Profile extends Rules
|
|||
protected function getbanUser(): bool
|
||||
{
|
||||
return ! $this->my
|
||||
&& ($this->admin || ($this->moderator && '1' == $this->user->g_mod_ban_users))
|
||||
&& ($this->admin || ($this->moderator && 1 === $this->user->g_mod_ban_users))
|
||||
&& ! $this->curUser->isAdmMod
|
||||
&& ! $this->curUser->isGuest;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ class Profile extends Rules
|
|||
|
||||
protected function getuseAvatar(): bool
|
||||
{
|
||||
return 1 == $this->c->config->b_avatars;
|
||||
return 1 === $this->c->config->b_avatars;
|
||||
}
|
||||
|
||||
protected function getuseSignature(): bool
|
||||
|
@ -152,12 +152,12 @@ class Profile extends Rules
|
|||
|
||||
protected function getviewWebsite(): bool
|
||||
{
|
||||
return $this->user->isAdmMod || '1' == $this->curUser->g_post_links;
|
||||
return $this->user->isAdmMod || 1 === $this->curUser->g_post_links;
|
||||
}
|
||||
|
||||
protected function geteditWebsite(): bool
|
||||
{
|
||||
return $this->admin || (($this->moderator || $this->my) && '1' == $this->user->g_post_links); //????
|
||||
return $this->admin || (($this->moderator || $this->my) && 1 === $this->user->g_post_links); //????
|
||||
}
|
||||
|
||||
protected function getchangeGroup(): bool
|
||||
|
@ -182,8 +182,8 @@ class Profile extends Rules
|
|||
|| $this->admin
|
||||
)
|
||||
&& (
|
||||
1 == $this->c->config->b_forum_subscriptions
|
||||
|| 1 == $this->c->config->b_topic_subscriptions
|
||||
1 === $this->c->config->b_forum_subscriptions
|
||||
|| 1 === $this->c->config->b_topic_subscriptions
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class Users extends Rules
|
|||
|
||||
protected function getbanUsers(): bool
|
||||
{
|
||||
return $this->user->isAdmin || ($this->user->isAdmMod && '1' == $this->user->g_mod_ban_users);
|
||||
return $this->user->isAdmin || ($this->user->isAdmMod && 1 === $this->user->g_mod_ban_users);
|
||||
}
|
||||
|
||||
protected function getchangeGroup(): bool
|
||||
|
|
|
@ -72,7 +72,7 @@ class Topic extends DataModel
|
|||
'1' == $this->parent->post_replies
|
||||
|| (
|
||||
null === $this->parent->post_replies
|
||||
&& '1' == $this->c->user->g_post_replies
|
||||
&& 1 === $this->c->user->g_post_replies
|
||||
)
|
||||
|| $this->c->user->isModerator($this)
|
||||
) {
|
||||
|
@ -87,7 +87,7 @@ class Topic extends DataModel
|
|||
*/
|
||||
protected function getcanSubscription(): bool
|
||||
{
|
||||
return 1 == $this->c->config->b_topic_subscriptions
|
||||
return 1 === $this->c->config->b_topic_subscriptions
|
||||
&& $this->id > 0
|
||||
&& ! $this->c->user->isGuest
|
||||
&& ! $this->c->user->isUnverified;
|
||||
|
@ -434,7 +434,7 @@ class Topic extends DataModel
|
|||
*/
|
||||
protected function getshowViews(): bool
|
||||
{
|
||||
return 1 == $this->c->config->b_topic_views;
|
||||
return 1 === $this->c->config->b_topic_views;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,7 @@ class View extends Action
|
|||
|
||||
if (
|
||||
! $this->c->user->isGuest
|
||||
&& 1 == $this->c->config->b_show_dot
|
||||
&& 1 === $this->c->config->b_show_dot
|
||||
) {
|
||||
$vars = [
|
||||
':uid' => $this->c->user->id,
|
||||
|
|
|
@ -74,7 +74,7 @@ class User extends DataModel
|
|||
*/
|
||||
protected function getisAdmMod(): bool
|
||||
{
|
||||
return $this->isAdmin || 1 == $this->g_moderator;
|
||||
return $this->isAdmin || 1 === $this->g_moderator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -266,7 +266,7 @@ class User extends DataModel
|
|||
*/
|
||||
protected function getviewUsers(): bool
|
||||
{
|
||||
return 1 == $this->g_view_users || $this->isAdmin;
|
||||
return 1 === $this->g_view_users || $this->isAdmin;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -274,7 +274,7 @@ class User extends DataModel
|
|||
*/
|
||||
protected function getsearchUsers(): bool
|
||||
{
|
||||
return 1 == $this->g_search_users || $this->isAdmin;
|
||||
return 1 === $this->g_search_users || $this->isAdmin;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -282,7 +282,7 @@ class User extends DataModel
|
|||
*/
|
||||
protected function getshowAvatar(): bool
|
||||
{
|
||||
return 1 == $this->c->config->b_avatars && 1 == $this->show_avatars;
|
||||
return 1 === $this->c->config->b_avatars && 1 === $this->show_avatars;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -290,7 +290,7 @@ class User extends DataModel
|
|||
*/
|
||||
protected function getshowUserInfo(): bool
|
||||
{
|
||||
return 1 == $this->c->config->b_show_user_info;
|
||||
return 1 === $this->c->config->b_show_user_info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -298,7 +298,7 @@ class User extends DataModel
|
|||
*/
|
||||
protected function getshowSignature(): bool
|
||||
{
|
||||
return 1 == $this->show_sig;
|
||||
return 1 === $this->show_sig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -306,7 +306,7 @@ class User extends DataModel
|
|||
*/
|
||||
protected function getshowPostCount(): bool
|
||||
{
|
||||
return 1 == $this->c->config->b_show_post_count || $this->isAdmMod;
|
||||
return 1 === $this->c->config->b_show_post_count || $this->isAdmMod;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -347,7 +347,7 @@ class User extends DataModel
|
|||
$this->isAdmin
|
||||
|| (
|
||||
$this->isAdmMod
|
||||
&& 1 == $this->g_mod_promote_users
|
||||
&& 1 === $this->g_mod_promote_users
|
||||
)
|
||||
)
|
||||
&& $this->id !== $post->user->id //????
|
||||
|
@ -416,7 +416,7 @@ class User extends DataModel
|
|||
{
|
||||
return 1 === $this->c->config->b_pm
|
||||
&& (
|
||||
1 == $this->g_pm
|
||||
1 === $this->g_pm
|
||||
|| $this->isAdmin
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue