Changeset 72 for trunk/preferences


Ignore:
Timestamp:
09/24/07 10:22:29 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

Location:
trunk/preferences
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/preferences/changepassword.php

    r35 r72  
    2626        if(!$GLOBALS['phpgw']->acl->check('changepassword', 1) || $_POST['cancel']) 
    2727        { 
     28                if(($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == '0') && (!$_POST['cancel'])) 
     29                        $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/login.php','cd=6')); 
     30                 
    2831                if ($GLOBALS['phpgw_info']['server']['use_https'] == 1) 
    2932                        Header('Location: http://' . $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/index.php'); 
     
    4346        $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel')); 
    4447        $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/preferences/changepassword.php')); 
     48 
     49        if ($_GET['cd'] == 1) 
     50        { 
     51                $lang1 = lang('Your password has expired'); 
     52                $lang2 = lang('You must register a new password'); 
     53                $GLOBALS['phpgw']->template->set_var('messages',"<font color=red><h1>$lang1.<br>$lang2.</h1></font>"); 
     54        } 
    4555 
    4656        if ($GLOBALS['phpgw_info']['server']['auth_type'] != 'ldap') 
     
    6676                        $errors[] = lang('The two passwords are not the same'); 
    6777                } 
     78                else if ($a_passwd == $n_passwd) 
     79                { 
     80                        $errors[] = lang('Your old password and your new password are the same. Choose a different new password'); 
     81                } 
    6882                else if (! $n_passwd) 
    6983                { 
     
    7589                }                
    7690                # password that start with a-Z or 0-9 and contain _.-!@#$%&*+=| will be accepted. 
    77                 else if (! ereg ("(^[a-zA-Z0-9_.\-\!@#$%&*+=|]*)$", $n_passwd ) ) 
     91                //else if (! ereg ("(^[a-zA-Z0-9_.\-\!@#$%&*+=|]*)$", $n_passwd ) ) 
     92                //else if (! ereg ("(^[a-zA-Z0-9_.\-\!@#$%&*+=|\(\)\^\~\}\{\[\]\/\\\"\'\:\;\?]*)$", $n_passwd ) ) 
     93                else if (! ereg ("([]^[a-zA-Z0-9\_\.\-\!\@\#\$\%\&\*\+\=\|\(\)\^\~\}\{\/\\\"\'\:\;\?]*)$", $n_passwd ) ) 
    7894                {                        
    7995                        $errors[] = lang('Your password contains characters not allowed'); 
    8096                }                
    8197                # password must contain 2 special letters, numbers or special characters 
    82                 else if ($GLOBALS['phpgw_info']['server']['num_special_letters_userpass'] && ! ereg ("([0-9_.\-!@#$%&*+=|]){".$GLOBALS['phpgw_info']['server']['num_special_letters_userpass'].",}", $n_passwd ) ) 
     98                //else if ($GLOBALS['phpgw_info']['server']['num_special_letters_userpass'] && ! ereg ("([0-9_.\-!@#$%&*+=|]){".$GLOBALS['phpgw_info']['server']['num_special_letters_userpass'].",}", $n_passwd ) ) 
     99                //else if ($GLOBALS['phpgw_info']['server']['num_special_letters_userpass'] && ! ereg ("([0-9_.\-!@#$%&*+=|\(\)\^\~\}\{\[\]\/\\\"\'\:\;\?]){".$GLOBALS['phpgw_info']['server']['num_special_letters_userpass']."}", $n_passwd ) ) 
     100                else if ($GLOBALS['phpgw_info']['server']['num_special_letters_userpass'] && ! ereg ("([][0-9\_\.\-\!\@\#\$\%\&\*\+\=\|\(\)\^\~\}\{\/\\\"\'\:\;\?]){".$GLOBALS['phpgw_info']['server']['num_special_letters_userpass']."}", $n_passwd ) ) 
    83101                { 
    84102                        $errors[] = lang('Your password must contain at least %1 numbers or characters special', $GLOBALS['phpgw_info']['server']['num_special_letters_userpass']); 
Note: See TracChangeset for help on using the changeset viewer.