phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: preferences changepassword.php,1.36,1.37


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: preferences changepassword.php,1.36,1.37
Date: Sun, 26 May 2002 04:26:46 -0400

Update of /cvsroot/phpgroupware/preferences
In directory subversions:/tmp/cvs-serv6022/preferences

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

Index: changepassword.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/changepassword.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** changepassword.php  24 May 2002 10:38:03 -0000      1.36
--- changepassword.php  26 May 2002 08:26:44 -0000      1.37
***************
*** 49,83 ****
                if($n_passwd != $n_passwd_2)
                {
!                       $errors[] = lang('The two passwords are not the same');
                }
  
                if(! $n_passwd)
                {
!                       $errors[] = lang('You must enter a password');
                }
! 
!               if(is_array($errors))
                {
                        $GLOBALS['phpgw']->common->phpgw_header();
-                       
$GLOBALS['phpgw']->template->set_var('messages',$GLOBALS['phpgw']->common->error_list($errors));
                        $GLOBALS['phpgw']->template->pfp('out','form');
!                       $GLOBALS['phpgw']->common->phpgw_exit(True);
!               }
! 
!               $o_passwd = $GLOBALS['phpgw_info']['user']['passwd'];
!               $passwd_changed = 
$GLOBALS['phpgw']->auth->change_password($o_passwd, $n_passwd);
!               if(!$passwd_changed)
!               {
!                       // This need to be changed to show a different message 
based on the result
!                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php','cd=38'));
                }
                else
                {
!                       $GLOBALS['phpgw_info']['user']['passwd'] = 
$GLOBALS['phpgw']->auth->change_password($o_passwd, $n_passwd);
!                       $GLOBALS['hook_values']['account_id'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       $GLOBALS['hook_values']['old_passwd'] = $o_passwd;
!                       $GLOBALS['hook_values']['new_passwd'] = $n_passwd;
!                       $GLOBALS['phpgw']->hooks->process('changepassword');
!                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php','cd=18'));
                }
        }
--- 49,86 ----
                if($n_passwd != $n_passwd_2)
                {
!                       $GLOBALS['phpgw_info']['flags']['msgbox_data']['The two 
passwords are not the same']=False;
                }
  
                if(! $n_passwd)
                {
!                       $GLOBALS['phpgw_info']['flags']['msgbox_data']['You 
must enter a password']=False;
                }
!               sanitize($n_passwd,'password');
!               
!               if(@is_array($GLOBALS['phpgw_info']['flags']['msgbox_data']))
                {
                        $GLOBALS['phpgw']->common->phpgw_header();
                        $GLOBALS['phpgw']->template->pfp('out','form');
!                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
                else
                {
! 
!                       $o_passwd = $GLOBALS['phpgw_info']['user']['passwd'];
!                       $passwd_changed = 
$GLOBALS['phpgw']->auth->change_password($o_passwd, $n_passwd);
!                       if(!$passwd_changed)
!                       {
!                               // This need to be changed to show a different 
message based on the result
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php','cd=38'));
!                       }
!                       else
!                       {
!                               $GLOBALS['phpgw_info']['user']['passwd'] = 
$GLOBALS['phpgw']->auth->change_password($o_passwd, $n_passwd);
!                               $GLOBALS['hook_values']['account_id'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                               $GLOBALS['hook_values']['old_passwd'] = 
$o_passwd;
!                               $GLOBALS['hook_values']['new_passwd'] = 
$n_passwd;
!                               
$GLOBALS['phpgw']->hooks->process('changepassword');
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php','cd=18'));
!                       }
                }
        }
***************
*** 85,89 ****
        {
                $GLOBALS['phpgw']->common->phpgw_header();
- 
                $GLOBALS['phpgw']->template->pfp('out','form');
                $GLOBALS['phpgw']->common->phpgw_footer();
--- 88,91 ----




reply via email to

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