mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-04-10 17:18:19 +02:00
added password validation routines, as well as general improvements on sanitize function
This commit is contained in:
parent
2d37f41455
commit
d2f00f43ce
@ -677,6 +677,20 @@
|
|||||||
$error[$totalerrors] = lang('The two passwords are not the same');
|
$error[$totalerrors] = lang('The two passwords are not the same');
|
||||||
$totalerrors++;
|
$totalerrors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$temp_msgbox_data = $GLOBALS['phpgw_info']['flags']['msgbox_data'];
|
||||||
|
unset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
|
||||||
|
if(!sanitize($_userData['account_passwd'],'password'))
|
||||||
|
{
|
||||||
|
reset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
|
||||||
|
while(list($key) = each($GLOBALS['phpgw_info']['flags']['msgbox_data']))
|
||||||
|
{
|
||||||
|
$error[$totalerrors] = lang($key);
|
||||||
|
$totalerrors++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$GLOBALS['phpgw_info']['flags']['msgbox_data'] = $temp_msgbox_data;
|
||||||
|
unset($temp_msgbox_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!count($_userData['account_permissions']) && !count($_userData['account_groups']))
|
if (!count($_userData['account_permissions']) && !count($_userData['account_groups']))
|
||||||
|
@ -254,6 +254,15 @@
|
|||||||
{
|
{
|
||||||
$min_length = 1;
|
$min_length = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(@isset($GLOBALS['phpgw_info']['server']['passwd_rules']['require_non_alpha']) && $GLOBALS['phpgw_info']['server']['passwd_rules']['require_non_alpha'] == True)
|
||||||
|
{
|
||||||
|
$pass_verify_non_alpha = False;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pass_verify_non_alpha = True;
|
||||||
|
}
|
||||||
|
|
||||||
if(@isset($GLOBALS['phpgw_info']['server']['passwd_rules']['require_numbers']) && $GLOBALS['phpgw_info']['server']['passwd_rules']['require_numbers'] == True)
|
if(@isset($GLOBALS['phpgw_info']['server']['passwd_rules']['require_numbers']) && $GLOBALS['phpgw_info']['server']['passwd_rules']['require_numbers'] == True)
|
||||||
{
|
{
|
||||||
@ -278,16 +287,25 @@
|
|||||||
for ($i=0; $i != $password_length; $i++)
|
for ($i=0; $i != $password_length; $i++)
|
||||||
{
|
{
|
||||||
$cur_test_string = substr($string, $i, 1);
|
$cur_test_string = substr($string, $i, 1);
|
||||||
if (in_array($cur_test_string, $password_numbers))
|
if (in_array($cur_test_string, $password_numbers) || in_array($cur_test_string, $password_special_chars))
|
||||||
{
|
{
|
||||||
$pass_verify_num = True;
|
$pass_verify_non_alpha = True;
|
||||||
}
|
if (in_array($cur_test_string, $password_numbers))
|
||||||
elseif (in_array($cur_test_string, $password_special_chars))
|
{
|
||||||
{
|
$pass_verify_num = True;
|
||||||
$pass_verify_special_char = True;
|
}
|
||||||
|
elseif (in_array($cur_test_string, $password_special_chars))
|
||||||
|
{
|
||||||
|
$pass_verify_special_char = True;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($pass_verify_num == False)
|
||||||
|
{
|
||||||
|
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Password requires at least one non-alpha character']=False;
|
||||||
|
}
|
||||||
|
|
||||||
if ($pass_verify_num == False)
|
if ($pass_verify_num == False)
|
||||||
{
|
{
|
||||||
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Password requires at least one numeric character']=False;
|
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Password requires at least one numeric character']=False;
|
||||||
|
Loading…
Reference in New Issue
Block a user