From 5b24c3a7fb5eaef0c6a1374eff1435322097f0b9 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sat, 8 Apr 2006 18:34:13 +0000 Subject: Check the password set in the install against the default rules git-svn-id: file:///svn/phpbb/trunk@5776 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_install.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index fe058b5e56..997c9ccf57 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -524,15 +524,28 @@ class install_install extends module { $error[] = $lang['INST_ERR_MISSING_DATA']; } + if ($admin_pass1 != $admin_pass2 && $admin_pass1 != '') { $error[] = $lang['INST_ERR_PASSWORD_MISMATCH']; } + // Test against the default password rules + if ($admin_pass1 != '' && strlen($admin_pass1) < 6) + { + $error[] = $lang['INST_ERR_PASSWORD_TOO_SHORT']; + } + + if ($admin_pass1 != '' && strlen($admin_pass1) > 30) + { + $error[] = $lang['INST_ERR_PASSWORD_TOO_LONG']; + } + if ($board_email1 != $board_email2 && $board_email1 != '') { $error[] = $lang['INST_ERR_EMAIL_MISMATCH']; } + if ($board_email1 != '' && !preg_match('#^[a-z0-9\.\-_\+]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $board_email1)) { $error[] = $lang['INST_ERR_EMAIL_INVALID']; @@ -1297,7 +1310,7 @@ class install_install extends module 'legend1' => 'ADMIN_CONFIG', 'language' => array('lang' => 'DEFAULT_LANG', 'type' => 'select', 'options' => '$this->module->inst_language_select(\'{VALUE}\')', 'explain' => false), 'admin_name' => array('lang' => 'ADMIN_USERNAME', 'type' => 'text:25:100', 'explain' => false), - 'admin_pass1' => array('lang' => 'ADMIN_PASSWORD', 'type' => 'password:25:100', 'explain' => false), + 'admin_pass1' => array('lang' => 'ADMIN_PASSWORD', 'type' => 'password:25:100', 'explain' => true), 'admin_pass2' => array('lang' => 'ADMIN_PASSWORD_CONFIRM', 'type' => 'password:25:100', 'explain' => false), 'board_email1' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => false), 'board_email2' => array('lang' => 'CONTACT_EMAIL_CONFIRM', 'type' => 'text:25:100', 'explain' => false), -- cgit v1.2.1