phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc common_functions.inc.php,1.6,1.7


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc common_functions.inc.php,1.6,1.7
Date: Sun, 26 May 2002 04:50:42 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv6657/phpgwapi/inc

Modified Files:
        common_functions.inc.php 
Log Message:
added password validation routines, as well as general improvements on sanitize 
function

Index: common_functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/common_functions.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** common_functions.inc.php    26 May 2002 08:26:43 -0000      1.6
--- common_functions.inc.php    26 May 2002 08:50:40 -0000      1.7
***************
*** 255,258 ****
--- 255,267 ----
                                        $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)
***************
*** 279,292 ****
                                        {
                                                $cur_test_string = 
substr($string, $i, 1);
!                                               if (in_array($cur_test_string, 
$password_numbers))
                                                {
!                                                       $pass_verify_num = True;
!                                               }
!                                               elseif 
(in_array($cur_test_string, $password_special_chars))
!                                               {
!                                                       
$pass_verify_special_char = True;
                                                }
                                        }
                                
                                        if ($pass_verify_num == False)
                                        {
--- 288,310 ----
                                        {
                                                $cur_test_string = 
substr($string, $i, 1);
!                                               if (in_array($cur_test_string, 
$password_numbers) || in_array($cur_test_string, $password_special_chars))
                                                {
!                                                       $pass_verify_non_alpha 
= True;
!                                                       if 
(in_array($cur_test_string, $password_numbers))
!                                                       {
!                                                               
$pass_verify_num = 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)
                                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]