Merged in release/3.3.2 (pull request #6749)
Release/3.3.2 Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
@@ -3512,12 +3512,13 @@ class Cases
|
||||
|
||||
$fieldsTrigger = [];
|
||||
foreach ($triggersList as $trigger) {
|
||||
//Scan the code
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$disabledCode = $this->codeScannerReview($cs, $trigger["TRI_WEBBOT"], $trigger["TRI_TITLE"]);
|
||||
if (!empty($disabledCode)) {
|
||||
$foundDisabledCode .= $disabledCode;
|
||||
continue;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$execute = true;
|
||||
//Check if the trigger has conditions for the execution
|
||||
|
||||
@@ -1333,6 +1333,8 @@ class WsBase
|
||||
$result = new WsResponse(-1, G::LoadTranslation("ID_INVALID_DATA") . " $status");
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
$status == 'INACTIVE' ? $RBAC->destroySessionUser($userUid) : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,5 +130,43 @@ class LoginLog extends BaseLoginLog
|
||||
}
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last session id of a user
|
||||
* @param string $userUid User uid
|
||||
* @return array All session id of php
|
||||
* @throws PropelException
|
||||
* @throws SQLException
|
||||
*/
|
||||
public function getSessionsIdByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('LOG_SID');
|
||||
$criteria->add(LoginLogPeer::USR_UID, $userUid);
|
||||
$criteria->add(LoginLogPeer::LOG_STATUS, 'ACTIVE');
|
||||
$criteria->setDistinct();
|
||||
$criteria->addDescendingOrderByColumn(LoginLogPeer::LOG_INIT_DATE);
|
||||
$resultSet = LoginLogPeer::doSelectRS($criteria);
|
||||
$resultSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$row = [];
|
||||
while($resultSet->next()) {
|
||||
$row[] = $resultSet->getRow();
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all records related to a user uid
|
||||
* @param string $userUid User uid
|
||||
* @return int
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function removeByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(LoginLogPeer::USR_UID, $userUid);
|
||||
$resultSet = LoginLogPeer::doDelete($criteria);
|
||||
return $resultSet;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,20 @@ class OauthAccessTokens extends BaseOauthAccessTokens
|
||||
|
||||
return array("numRecTotal" => $numRecTotal, "data" => $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all records related to a user uid
|
||||
* @param string $userUid User uid
|
||||
* @return int
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function removeByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(OauthAccessTokensPeer::USER_ID, $userUid);
|
||||
$resultSet = OauthAccessTokensPeer::doDelete($criteria);
|
||||
return $resultSet;
|
||||
}
|
||||
}
|
||||
|
||||
// OauthAccessTokens
|
||||
|
||||
@@ -14,6 +14,19 @@ require_once 'classes/model/om/BaseOauthAuthorizationCodes.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class OauthAuthorizationCodes extends BaseOauthAuthorizationCodes {
|
||||
|
||||
class OauthAuthorizationCodes extends BaseOauthAuthorizationCodes
|
||||
{
|
||||
/**
|
||||
* Delete all records related to a user uid
|
||||
* @param string $userUid User uid
|
||||
* @return int
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function removeByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(OauthAuthorizationCodesPeer::USER_ID, $userUid);
|
||||
$resultSet = OauthAuthorizationCodesPeer::doDelete($criteria);
|
||||
return $resultSet;
|
||||
}
|
||||
} // OauthAuthorizationCodes
|
||||
|
||||
@@ -209,6 +209,19 @@ class OauthClients extends BaseOauthClients
|
||||
return array("numRecTotal" => $numRecTotal, "data" => $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all records related to a user uid
|
||||
* @param string $userUid User uid
|
||||
* @return int
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function removeByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(OauthClientsPeer::USR_UID, $userUid);
|
||||
$resultSet = OauthClientsPeer::doDelete($criteria);
|
||||
return $resultSet;
|
||||
}
|
||||
}
|
||||
|
||||
// OauthClients
|
||||
|
||||
@@ -14,6 +14,19 @@ require_once 'classes/model/om/BaseOauthRefreshTokens.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class OauthRefreshTokens extends BaseOauthRefreshTokens {
|
||||
|
||||
class OauthRefreshTokens extends BaseOauthRefreshTokens
|
||||
{
|
||||
/**
|
||||
* Delete all records related to a user uid
|
||||
* @param string $userUid User uid
|
||||
* @return int
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function removeByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(OauthRefreshTokensPeer::USER_ID, $userUid);
|
||||
$resultSet = OauthRefreshTokensPeer::doDelete($criteria);
|
||||
return $resultSet;
|
||||
}
|
||||
} // OauthRefreshTokens
|
||||
|
||||
@@ -29,4 +29,20 @@ class PmoauthUserAccessTokens extends BasePmoauthUserAccessTokens
|
||||
|
||||
return (is_array($result) && empty($result)) ? false : $result[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all records related to a user uid
|
||||
*
|
||||
* @param string $userUid User uid
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function removeByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(PmoauthUserAccessTokensPeer::USER_ID, $userUid);
|
||||
$resultSet = PmoauthUserAccessTokensPeer::doDelete($criteria);
|
||||
|
||||
return $resultSet;
|
||||
}
|
||||
} // PmoauthUserAccessTokens
|
||||
|
||||
@@ -20,5 +20,18 @@ require_once 'classes/model/om/BaseSession.php';
|
||||
*/
|
||||
class Session extends BaseSession
|
||||
{
|
||||
/**
|
||||
* Delete all records related to a user uid
|
||||
* @param string $userUid User uid
|
||||
* @return int
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function removeByUser($userUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(SessionPeer::USR_UID, $userUid);
|
||||
$resultSet = SessionPeer::doDelete($criteria);
|
||||
return $resultSet;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user