fix code review
o
This commit is contained in:
@@ -2592,11 +2592,11 @@ class Bootstrap
|
||||
$hashTypePrevious = $passwordHashConfig['previous'];
|
||||
$acceptance = false;
|
||||
|
||||
if ($RBAC->getStatusLoginHash()) {
|
||||
if ($RBAC->loginWithHash()) {
|
||||
//To enable compatibility with soap login
|
||||
if ($pass === $hashTypeCurrent . ':' . $userPass) {
|
||||
if ((Bootstrap::hashPassword($pass, $hashTypeCurrent) == $userPass) || ($pass === $hashTypeCurrent . ':' . $userPass)) {
|
||||
$acceptance = true;
|
||||
} else if ($pass === $hashTypePrevious . ':' . $userPass) {
|
||||
} else if ((Bootstrap::hashPassword($pass, $hashTypePrevious) == $userPass) || ($pass === $hashTypePrevious . ':' . $userPass)) {
|
||||
$acceptance = true;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1580,27 +1580,27 @@ class RBAC
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable compatibility with soap login
|
||||
* Enable compatibility with hash login
|
||||
*/
|
||||
public function enableLoginSoapWithHash()
|
||||
public function enableLoginWithHash()
|
||||
{
|
||||
$this->enableLoginHash = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable compatibility with soap login
|
||||
* Disable compatibility with hash login
|
||||
*/
|
||||
public function disableLoginSoapWithHash ()
|
||||
public function disableLoginWithHash()
|
||||
{
|
||||
$this->enableLoginHash = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return status login with soap
|
||||
* Return status login with hash
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getStatusLoginHash ()
|
||||
public function loginWithHash()
|
||||
{
|
||||
return $this->enableLoginHash;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,12 @@ class wsBase
|
||||
global $RBAC;
|
||||
|
||||
try {
|
||||
//To enable compatibility with soap login, method Enable.
|
||||
$RBAC->enableLoginSoapWithHash();
|
||||
//To enable compatibility with hash login, method Enable.
|
||||
//It's necessary to enable the hash start session because there are use cases in both,
|
||||
//the web entry and in the case planner, where the password is still used in the hash
|
||||
//format so that is possible to start a session. Thiw way we will mantain the
|
||||
//compatibility with this type of loggin.
|
||||
$RBAC->enableLoginWithHash();
|
||||
$uid = $RBAC->VerifyLogin( $userid, $password );
|
||||
|
||||
switch ($uid) {
|
||||
@@ -119,8 +123,8 @@ class wsBase
|
||||
$wsResponse = unserialize( $e->getMessage() );
|
||||
}
|
||||
|
||||
//To enable compatibility with soap login, method disable.
|
||||
$RBAC->disableLoginSoapWithHash();
|
||||
//To enable compatibility with hash login, method disable.
|
||||
$RBAC->disableLoginWithHash();
|
||||
return $wsResponse;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user