|
@@ -33,34 +33,36 @@ class Config extends Profile
|
|
|
->addValidators([
|
|
|
'to_zero' => [$this, 'vToZero'],
|
|
|
])->addRules([
|
|
|
- 'token' => 'token:EditUserBoardConfig',
|
|
|
- 'language' => 'required|string:trim|in:' . \implode(',', $this->c->Func->getLangs()),
|
|
|
- 'style' => 'required|string:trim|in:' . \implode(',', $this->c->Func->getStyles()),
|
|
|
- 'timezone' => 'required|numeric|in:-12,-11,-10,-9.5,-9,-8.5,-8,-7,-6,-5,-4,-3.5,-3,-2,-1,0,1,2,3,3.5,4,4.5,5,5.5,5.75,6,6.5,7,8,8.75,9,9.5,10,10.5,11,11.5,12,12.75,13,14',
|
|
|
- 'dst' => 'required|integer|in:0,1',
|
|
|
- 'time_format' => 'required|integer|in:' . \implode(',', \array_keys($this->c->TIME_FORMATS)),
|
|
|
- 'date_format' => 'required|integer|in:' . \implode(',', \array_keys($this->c->DATE_FORMATS)),
|
|
|
- 'show_smilies' => 'required|integer|in:0,1',
|
|
|
- 'show_sig' => 'required|integer|in:0,1',
|
|
|
- 'show_avatars' => 'required|integer|in:0,1',
|
|
|
- 'show_img' => 'required|integer|in:0,1',
|
|
|
- 'show_img_sig' => 'required|integer|in:0,1',
|
|
|
- 'disp_topics' => 'integer|min:0|max:50|to_zero',
|
|
|
- 'disp_posts' => 'integer|min:0|max:50|to_zero',
|
|
|
+ 'token' => 'token:EditUserBoardConfig',
|
|
|
+ 'language' => 'required|string:trim|in:' . \implode(',', $this->c->Func->getLangs()),
|
|
|
+ 'style' => 'required|string:trim|in:' . \implode(',', $this->c->Func->getStyles()),
|
|
|
+ 'timezone' => 'required|numeric|in:-12,-11,-10,-9.5,-9,-8.5,-8,-7,-6,-5,-4,-3.5,-3,-2,-1,0,1,2,3,3.5,4,4.5,5,5.5,5.75,6,6.5,7,8,8.75,9,9.5,10,10.5,11,11.5,12,12.75,13,14',
|
|
|
+ 'dst' => 'required|integer|in:0,1',
|
|
|
+ 'time_format' => 'required|integer|in:' . \implode(',', \array_keys($this->c->TIME_FORMATS)),
|
|
|
+ 'date_format' => 'required|integer|in:' . \implode(',', \array_keys($this->c->DATE_FORMATS)),
|
|
|
+ 'show_smilies' => 'required|integer|in:0,1',
|
|
|
+ 'show_sig' => 'required|integer|in:0,1',
|
|
|
+ 'show_avatars' => 'required|integer|in:0,1',
|
|
|
+ 'show_img' => 'required|integer|in:0,1',
|
|
|
+ 'show_img_sig' => 'required|integer|in:0,1',
|
|
|
+ 'disp_topics' => 'integer|min:0|max:50|to_zero',
|
|
|
+ 'disp_posts' => 'integer|min:0|max:50|to_zero',
|
|
|
+ 'ip_check_type' => 'required|integer|in:0,1,2',
|
|
|
])->addAliases([
|
|
|
- 'language' => 'Language',
|
|
|
- 'style' => 'Style',
|
|
|
- 'timezone' => 'Time zone',
|
|
|
- 'dst' => 'DST label',
|
|
|
- 'time_format' => 'Time format',
|
|
|
- 'date_format' => 'Date format',
|
|
|
- 'show_smilies' => 'Smilies label',
|
|
|
- 'show_sig' => 'Sigs label',
|
|
|
- 'show_avatars' => 'Avatars label',
|
|
|
- 'show_img' => 'Images label',
|
|
|
- 'show_img_sig' => 'Images sigs label',
|
|
|
- 'disp_topics' => 'Topics per page label',
|
|
|
- 'disp_posts' => 'Posts per page label',
|
|
|
+ 'language' => 'Language',
|
|
|
+ 'style' => 'Style',
|
|
|
+ 'timezone' => 'Time zone',
|
|
|
+ 'dst' => 'DST label',
|
|
|
+ 'time_format' => 'Time format',
|
|
|
+ 'date_format' => 'Date format',
|
|
|
+ 'show_smilies' => 'Smilies label',
|
|
|
+ 'show_sig' => 'Sigs label',
|
|
|
+ 'show_avatars' => 'Avatars label',
|
|
|
+ 'show_img' => 'Images label',
|
|
|
+ 'show_img_sig' => 'Images sigs label',
|
|
|
+ 'disp_topics' => 'Topics per page label',
|
|
|
+ 'disp_posts' => 'Posts per page label',
|
|
|
+ 'ip_check_type' => 'IP check',
|
|
|
])->addArguments([
|
|
|
'token' => ['id' => $this->curUser->id],
|
|
|
])->addMessages([
|
|
@@ -302,6 +304,23 @@ class Config extends Profile
|
|
|
],
|
|
|
],
|
|
|
];
|
|
|
+ $form['sets']['security'] = [
|
|
|
+ 'legend' => __('Security'),
|
|
|
+ 'class' => 'data-edit',
|
|
|
+ 'fields' => [
|
|
|
+ 'ip_check_type' => [
|
|
|
+ 'type' => 'select',
|
|
|
+ 'options' => [
|
|
|
+ '0' => __('Disable check'),
|
|
|
+ '1' => __('Not strict check'),
|
|
|
+ '2' => __('Strict check'),
|
|
|
+ ],
|
|
|
+ 'value' => $this->curUser->ip_check_type,
|
|
|
+ 'caption' => __('IP check'),
|
|
|
+ 'info' => __('IP check info'),
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ];
|
|
|
|
|
|
return $form;
|
|
|
}
|