From 38cf151563563dd8f5fe8b5dbcda1d800997d9f6 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 10 Oct 2010 17:18:16 +0000 Subject: using config variable for minimum password length git-svn-id: http://code.elgg.org/elgg/trunk@7047 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 4 +++- engine/settings.example.php | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/lib/users.php b/engine/lib/users.php index c9add2541..45499b27d 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -953,7 +953,9 @@ function validate_username($username) { * @throws RegistrationException on invalid */ function validate_password($password) { - if (strlen($password) < 6) { + global $CONFIG; + + if (strlen($password) < $CONFIG->min_password_length) { throw new RegistrationException(elgg_echo('registration:passwordtooshort')); } diff --git a/engine/settings.example.php b/engine/settings.example.php index e6857e4c4..c503f0162 100644 --- a/engine/settings.example.php +++ b/engine/settings.example.php @@ -110,4 +110,13 @@ $CONFIG->broken_mta = FALSE; * * @global bool $CONFIG->db_disable_query_cache */ -$CONFIG->db_disable_query_cache = FALSE; \ No newline at end of file +$CONFIG->db_disable_query_cache = FALSE; + +/** + * Minimum password length + * + * This value is used when validating a user's password during registration. + * + * @global int $CONFIG->min_password_length + */ +$CONFIG->min_password_length = 6; \ No newline at end of file -- cgit v1.2.3