HOR-3996
Since the web entry is assigned to guest, it was not able to load the user information through the PMfunctions because it is validated to not return guest information. Now it will load directly from Users table.
This commit is contained in:
@@ -8,33 +8,33 @@ global $RBAC;
|
||||
G::LoadClass('pmFunctions');
|
||||
try {
|
||||
if (empty($_REQUEST['we_uid'])) {
|
||||
throw new \Exception('Missing required field "we_uid"');
|
||||
throw new Exception('Missing required field "we_uid"');
|
||||
}
|
||||
|
||||
$weUid = $_REQUEST['we_uid'];
|
||||
|
||||
$webEntry = \WebEntryPeer::retrieveByPK($weUid);
|
||||
$webEntry = WebEntryPeer::retrieveByPK($weUid);
|
||||
if (empty($webEntry)) {
|
||||
throw new \Exception('Undefined WebEntry');
|
||||
throw new Exception('Undefined WebEntry');
|
||||
}
|
||||
|
||||
$userUid = $webEntry->getUsrUid();
|
||||
$userInfo = PMFInformationUser($userUid);
|
||||
$userInfo = UsersPeer::retrieveByPK($userUid);
|
||||
if (empty($userInfo)) {
|
||||
throw new \Exception('WebEntry User not found');
|
||||
throw new Exception('WebEntry User not found');
|
||||
}
|
||||
|
||||
initUserSession($userUid, $userInfo['username']);
|
||||
initUserSession($userUid, $userInfo->getUsrUsername());
|
||||
|
||||
$result = [
|
||||
'user_logged' => $userUid,
|
||||
'userName' => $userInfo['username'],
|
||||
'firstName' => $userInfo['firstname'],
|
||||
'lastName' => $userInfo['lastname'],
|
||||
'mail' => $userInfo['mail'],
|
||||
'user_logged' => $userUid,
|
||||
'userName' => $userInfo->getUsrUsername(),
|
||||
'firstName' => $userInfo->getUsrFirstName(),
|
||||
'lastName' => $userInfo->getUsrLastName(),
|
||||
'mail' => $userInfo->getUsrEmail(),
|
||||
'image' => '../users/users_ViewPhoto?t='.microtime(true),
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$result = [
|
||||
'error' => $e->getMessage(),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user