BUG-14775 In the source code /workflow/engine/classes/model/UsersProperties.php line 153-160 variable $iLength is obtained by calculating the number of characters in the password, if the password is valid variable $aErrors no longer sets the corresponding flag to activate the validators in the Windows password change. IMPROVEMENT.

This commit is contained in:
Roly Rudy Gutierrez Pinto
2014-06-12 16:02:32 -04:00
parent e00933ab63
commit cd92610a59
2 changed files with 6 additions and 5 deletions

View File

@@ -123,8 +123,9 @@ class UsersProperties extends BaseUsersProperties
return $aUserProperty; return $aUserProperty;
} }
public function validatePassword ($sPassword, $sLastUpdate, $iChangePasswordNextTime) public function validatePassword ($sPassword, $sLastUpdate, $iChangePasswordNextTime, $nowLogin = false)
{ {
error_log(PPP_MINIMUM_LENGTH);
if (! defined( 'PPP_MINIMUM_LENGTH' )) { if (! defined( 'PPP_MINIMUM_LENGTH' )) {
define( 'PPP_MINIMUM_LENGTH', 5 ); define( 'PPP_MINIMUM_LENGTH', 5 );
} }
@@ -149,10 +150,10 @@ class UsersProperties extends BaseUsersProperties
$iLength = strlen( $sPassword ); $iLength = strlen( $sPassword );
} }
$aErrors = array (); $aErrors = array ();
if ($iLength < PPP_MINIMUM_LENGTH) { if ($iLength < PPP_MINIMUM_LENGTH || $nowLogin) {
$aErrors[] = 'ID_PPP_MINIMUM_LENGTH'; $aErrors[] = 'ID_PPP_MINIMUM_LENGTH';
} }
if ($iLength > PPP_MAXIMUM_LENGTH) { if ($iLength > PPP_MAXIMUM_LENGTH || $nowLogin) {
$aErrors[] = 'ID_PPP_MAXIMUM_LENGTH'; $aErrors[] = 'ID_PPP_MAXIMUM_LENGTH';
} }
if (PPP_NUMERICAL_CHARACTER_REQUIRED == 1) { if (PPP_NUMERICAL_CHARACTER_REQUIRED == 1) {
@@ -180,7 +181,7 @@ class UsersProperties extends BaseUsersProperties
} }
$fDays = $oCalendar->calculateDuration( date( 'Y-m-d H:i:s' ), $sLastUpdate ); $fDays = $oCalendar->calculateDuration( date( 'Y-m-d H:i:s' ), $sLastUpdate );
if ($fDays > (PPP_EXPIRATION_IN * 24)) { if ($fDays > (PPP_EXPIRATION_IN * 24) || $nowLogin) {
$aErrors[] = 'ID_PPP_EXPIRATION_IN'; $aErrors[] = 'ID_PPP_EXPIRATION_IN';
} }
} }

View File

@@ -262,7 +262,7 @@ try {
} }
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_SESSION['USER_LOGGED'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($pwd))))); $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_SESSION['USER_LOGGED'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($pwd)))));
$aErrors = $oUserProperty->validatePassword($_POST['form']['USR_PASSWORD'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME']); $aErrors = $oUserProperty->validatePassword($_POST['form']['USR_PASSWORD'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME'], true);
if (!empty($aErrors)) { if (!empty($aErrors)) {
if (!defined('NO_DISPLAY_USERNAME')) { if (!defined('NO_DISPLAY_USERNAME')) {