HOR:3929 Changes for the import process with Web Entry

This commit is contained in:
Paula Quispe
2017-10-02 11:36:32 -04:00
committed by davidcallizaya
parent 8ef2eb692d
commit 961bc072f2
2 changed files with 8 additions and 4 deletions

View File

@@ -110,7 +110,7 @@ class User
'PREF_DEFAULT_CASES_MENUSELECTED' => 'PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS'
);
private $guestUser = '00000000000000000000000000000002';
private $guestUser = RBAC::GUEST_USER_UID;
/**
* Constructor of the class

View File

@@ -709,7 +709,8 @@ class WebEntryEvent
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
//Define if the webEntry need to use the guest user
$weUserUid = isset($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : '';
$arrayData["USR_UID"] = $this->getWebEntryUser($arrayData["WE_AUTHENTICATION"], $weUserUid);
$weAuthentication = isset($arrayData["WE_AUTHENTICATION"]) ? $arrayData["WE_AUTHENTICATION"] : '';
$arrayData["USR_UID"] = $this->getWebEntryUser($weAuthentication, $weUserUid);
//Verify data with the required fields
$this->throwExceptionIfDataIsInvalid("", $projectUid, $arrayData);
@@ -824,7 +825,8 @@ class WebEntryEvent
$this->arrayFieldNameForException["webEntryEventUid"]);
//Define if the webEntry need to use the guest user
$weUserUid = isset($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : '';
$arrayData["USR_UID"] = $this->getWebEntryUser($arrayData["WE_AUTHENTICATION"], $weUserUid);
$weAuthentication = isset($arrayData["WE_AUTHENTICATION"]) ? $arrayData["WE_AUTHENTICATION"] : '';
$arrayData["USR_UID"] = $this->getWebEntryUser($weAuthentication, $weUserUid);
//Verify data with the required fields
$this->throwExceptionIfDataIsInvalid($webEntryEventUid, $arrayWebEntryEventData["PRJ_UID"], $arrayData);
@@ -1392,7 +1394,9 @@ class WebEntryEvent
*/
public function getWebEntryUser($authentication = 'ANONYMOUS', $usrUid = '')
{
if ($authentication === 'ANONYMOUS') {
//The webEntry old does not have type of authentication defined
//The webEntry2.0 can be has values ANONYMOUS or LOGIN_REQUIRED
if ($authentication === 'ANONYMOUS' || empty($authentication)) {
$user = new User();
return $user->getGuestUser();
} else {