agent login issue : GWM
This commit is contained in:
parent
0b626d6297
commit
8586d6555a
@ -131,24 +131,41 @@ class AuthController extends ResourceController
|
|||||||
? null
|
? null
|
||||||
: date('d, M-Y h:iA', strtotime($lastLoginBeforeUpdate));
|
: date('d, M-Y h:iA', strtotime($lastLoginBeforeUpdate));
|
||||||
|
|
||||||
|
if($user['role_id'] != 5)
|
||||||
|
|
||||||
//get service for the organization
|
|
||||||
$orgService = $this->organizationModel->find($user['org_id']);
|
|
||||||
$user['service'] = json_decode($orgService['services_ids'],true);
|
|
||||||
foreach ($user['service'] as $key => $value)
|
|
||||||
{
|
{
|
||||||
$serviceData = $this->serviceModel->find($value['service_id']);
|
|
||||||
$user['service'][$key]['name'] = $serviceData['name'];
|
//get service for the organization
|
||||||
$user['service'][$key]['icon'] = $serviceData['icon'];
|
$orgService = $this->organizationModel->find($user['org_id']);
|
||||||
$user['service'][$key]['order'] = $serviceData['order'];
|
$user['service'] = json_decode($orgService['services_ids'],true);
|
||||||
|
foreach ($user['service'] as $key => $value)
|
||||||
|
{
|
||||||
|
$serviceData = $this->serviceModel->find($value['service_id']);
|
||||||
|
$user['service'][$key]['name'] = $serviceData['name'];
|
||||||
|
$user['service'][$key]['icon'] = $serviceData['icon'];
|
||||||
|
$user['service'][$key]['order'] = $serviceData['order'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//get role
|
||||||
|
$user['role'] = $this->userModel->getRole($user['role_id']);
|
||||||
|
|
||||||
|
//find user has the all access
|
||||||
|
$user['plan_action'] = getUserPlanCreationRestrictionStatus($user);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
$user['service'] = json_decode($user['agent_supported_service_ids'],true);
|
||||||
|
foreach ($user['service'] as $key => $value)
|
||||||
|
{
|
||||||
|
$serviceData = $this->serviceModel->find($value['service_id']);
|
||||||
|
$user['service'][$key]['name'] = $serviceData['name'];
|
||||||
|
$user['service'][$key]['icon'] = $serviceData['icon'];
|
||||||
|
$user['service'][$key]['order'] = $serviceData['order'];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//get role
|
|
||||||
$user['role'] = $this->userModel->getRole($user['role_id']);
|
|
||||||
|
|
||||||
//find user has the all access
|
|
||||||
$user['plan_action'] = getUserPlanCreationRestrictionStatus($user);
|
|
||||||
|
|
||||||
// Generate JWT Token
|
// Generate JWT Token
|
||||||
$token = generateJWT($user);
|
$token = generateJWT($user);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user