From 29b3ba8fcbbd2395d5715789873a0c65904cb4e1 Mon Sep 17 00:00:00 2001 From: Braulio Ruiz Date: Fri, 20 Jun 2014 14:00:19 -0500 Subject: [PATCH] -Be able to use underscore on databes and user names -Be able to set Stronger db passwords (includes: *&.-_?!%) --- modules/mysql_databases/code/controller.ext.php | 2 +- modules/mysql_users/code/controller.ext.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mysql_databases/code/controller.ext.php b/modules/mysql_databases/code/controller.ext.php index a8c235beb..927e31281 100644 --- a/modules/mysql_databases/code/controller.ext.php +++ b/modules/mysql_databases/code/controller.ext.php @@ -187,7 +187,7 @@ static function ExecuteDeleteDatabase($my_id_pk) static function IsValidUserName($username) { - if (!preg_match('/^[a-z\d][a-z\d-]{0,62}$/i', $username) || preg_match('/-$/', $username)) { + if (!preg_match('/^[a-z\d][a-z\d-\_]{0,62}$/i', $username) || preg_match('/-$/', $username)) { return false; } return true; diff --git a/modules/mysql_users/code/controller.ext.php b/modules/mysql_users/code/controller.ext.php index 4f32bbede..ece76e65c 100644 --- a/modules/mysql_users/code/controller.ext.php +++ b/modules/mysql_users/code/controller.ext.php @@ -514,7 +514,7 @@ static function CheckPasswordForErrors($password) static function IsValidUserName($username) { - if (!preg_match('/^[a-z\d][a-z\d-]{0,62}$/i', $username) || preg_match('/-$/', $username)) { + if (!preg_match('/^[a-z\d][a-z\d-\_]{0,62}$/i', $username) || preg_match('/-$/', $username)) { return false; } else { if (strlen($username) < 17) { @@ -527,7 +527,7 @@ static function IsValidUserName($username) static function IsValidPassword($password) { - if (!ctype_alnum($password)) { + if (!preg_match('/^[a-zA-Z0-9\*\&\.\-\_\?\!\%]+$/',$password)) { return false; } return true;