Skip to content

Commit 243ab40

Browse files
committed
Convert high level config to low level config
min_password_length is a low level config item that should rarely need to be customized since it is a common security standard
1 parent 0b6688e commit 243ab40

File tree

6 files changed

+2
-18
lines changed

6 files changed

+2
-18
lines changed

lang/de/lang.php

-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@
9898
'notifications_tab' => 'Benachrichtigungen',
9999
'allow_registration' => 'Benutzerregistrierung erlauben',
100100
'allow_registration_comment' => 'Falls dies deaktivert ist, können Benutzer nur von Administratoren erstellt werden.',
101-
'min_password_length' => 'Minimale Passwortlänge',
102-
'min_password_length_comment' => 'Die minimale Passwortlänge für Benutzerpasswörter.',
103101
'activate_mode' => 'Aktivierungsmodus',
104102
'activate_mode_comment' => 'Wählen Sie aus, wie ein Benutzer aktiviert werden soll.',
105103
'activate_mode_auto' => 'Automatisch',

lang/en/lang.php

-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@
7575
'notifications_tab' => 'Notifications',
7676
'allow_registration' => 'Allow user registration',
7777
'allow_registration_comment' => 'If this is disabled users can only be created by administrators.',
78-
'min_password_length' => 'Minimum password length',
79-
'min_password_length_comment' => 'The minimum length of characters required for user passwords.',
8078
'activate_mode' => 'Activation mode',
8179
'activate_mode_comment' => 'Select how a user account should be activated.',
8280
'activate_mode_auto' => 'Automatic',

lang/ru/lang.php

-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@
7979
'notifications_tab' => 'Оповещения',
8080
'allow_registration' => 'Разрешить регистрацию',
8181
'allow_registration_comment' => 'Если эта опция выключена, только администраторы смогут регистрировать пользователей.',
82-
'min_password_length' => 'Минимальная длина пароля',
83-
'min_password_length_comment' => 'Минимальное количество символов для пароля пользователя.',
8482
'activate_mode' => 'Активация',
8583
'activate_mode_comment' => 'Активация пользователя.',
8684
'activate_mode_auto' => 'Автоматическая',

models/Settings.php

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class Settings extends Model
2525
const REMEMBER_ALWAYS = 'always';
2626
const REMEMBER_NEVER = 'never';
2727
const REMEMBER_ASK = 'ask';
28-
const MIN_PASSWORD_LENGTH_DEFAULT = 8;
2928

3029
public function initSettingsData()
3130
{
@@ -37,7 +36,6 @@ public function initSettingsData()
3736
$this->login_attribute = self::LOGIN_EMAIL;
3837
$this->update_requires_password = false;
3938
$this->remember_login = self::REMEMBER_ALWAYS;
40-
$this->min_password_length = self::MIN_PASSWORD_LENGTH_DEFAULT;
4139
$this->use_register_throttle = true;
4240
}
4341

models/User.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Auth;
55
use Mail;
66
use Event;
7+
use Config;
78
use Carbon\Carbon;
89
use October\Rain\Auth\Models\User as UserBase;
910
use RainLab\User\Models\Settings as UserSettings;
@@ -201,7 +202,7 @@ public function getLoginName()
201202
*/
202203
public static function getMinPasswordLength()
203204
{
204-
return (int) UserSettings::get('min_password_length', UserSettings::MIN_PASSWORD_LENGTH_DEFAULT);
205+
return Config::get('min_password_length', 8);
205206
}
206207

207208
//

models/settings/fields.yaml

-9
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,6 @@ tabs:
5252
type: switch
5353
tab: rainlab.user::lang.settings.registration_tab
5454

55-
# Minimum password length
56-
min_password_length:
57-
span: left
58-
commentAbove: rainlab.user::lang.settings.min_password_length_comment
59-
label: rainlab.user::lang.settings.min_password_length
60-
type: number
61-
tab: rainlab.user::lang.settings.registration_tab
62-
min: 1
63-
6455
# Require Activation
6556
require_activation:
6657
span: left

0 commit comments

Comments
 (0)