Change o_regs_allow

This commit is contained in:
Visman 2021-12-19 13:34:23 +07:00
parent 75e4e11029
commit 89d823d508
6 changed files with 11 additions and 9 deletions

View file

@ -60,7 +60,7 @@ class Routing
);
// регистрация
if ('1' == $config->o_regs_allow) {
if (1 == $config->b_regs_allow) {
$r->add(
$r::GET,
'/registration',
@ -125,7 +125,7 @@ class Routing
'1' == $config->o_rules
&& (
! $user->isGuest
|| '1' == $config->o_regs_allow
|| 1 == $config->b_regs_allow
)
) {
$r->add(

View file

@ -137,7 +137,7 @@ abstract class Page extends Model
&& '1' == $this->user->g_read_board
&& (
! $this->user->isGuest
|| '1' == $this->c->config->o_regs_allow
|| 1 == $this->c->config->b_regs_allow
)
) {
$navGen[self::FI_RULES] = [
@ -194,7 +194,7 @@ abstract class Page extends Model
}
if ($this->user->isGuest) {
if ('1' == $this->c->config->o_regs_allow) {
if (1 == $this->c->config->b_regs_allow) {
$navUser[self::FI_REG] = [
$r->link('Register'),
'Register',

View file

@ -1243,7 +1243,7 @@ class Install extends Admin
'o_smtp_user' => NULL,
'o_smtp_pass' => NULL,
'b_smtp_ssl' => 0,
'o_regs_allow' => 1,
'b_regs_allow' => 1,
'o_regs_verify' => 1,
'o_announcement' => 0,
'o_announcement_message' => __('Announcement '),

View file

@ -76,7 +76,7 @@ class Options extends Admin
'o_smtp_pass' => 'string:trim|max:255',
'changeSmtpPassword' => 'checkbox',
'b_smtp_ssl' => 'required|integer|in:0,1',
'o_regs_allow' => 'required|integer|in:0,1',
'b_regs_allow' => 'required|integer|in:0,1',
'o_regs_verify' => 'required|integer|in:0,1',
'b_regs_report' => 'required|integer|in:0,1',
'o_rules' => 'required|integer|in:0,1|check_empty:o_rules_message',
@ -623,9 +623,9 @@ class Options extends Admin
$form['sets']['registration'] = [
'legend' => 'Registration subhead',
'fields' => [
'o_regs_allow' => [
'b_regs_allow' => [
'type' => 'radio',
'value' => $config->o_regs_allow,
'value' => $config->b_regs_allow,
'values' => $yn,
'caption' => 'Allow new label',
'help' => 'Allow new help',

View file

@ -518,7 +518,9 @@ class Update extends Admin
$config->b_forum_subscriptions = '1' == $config->o_forum_subscriptions ? 1 : 0;
$config->b_topic_subscriptions = '1' == $config->o_topic_subscriptions ? 1 : 0;
$config->b_smtp_ssl = '1' == $config->o_smtp_ssl ? 1 : 0;
$config->b_regs_allow = '1' == $config->o_regs_allow ? 1 : 0;
unset($config->o_regs_allow);
unset($config->o_smtp_ssl);
unset($config->o_topic_subscriptions);
unset($config->o_forum_subscriptions);

View file

@ -96,7 +96,7 @@ class Auth extends Page
$this->onlinePos = 'login';
$this->robots = 'noindex';
$this->titles = __('Login');
$this->regLink = '1' == $this->c->config->o_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;