mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Do not work directly with session in "notify_operator_alive" func
Fixes #57
This commit is contained in:
parent
6cdfb4a7bc
commit
4ccd67e28a
@ -39,6 +39,8 @@ class UsersController extends AbstractController
|
||||
$status = $request->query->has('away') ? 1 : 0;
|
||||
|
||||
notify_operator_alive($operator['operatorid'], $status);
|
||||
$operator['istatus'] = $status;
|
||||
$this->getAuthenticationManager()->setOperator($operator);
|
||||
|
||||
$_SESSION[SESSION_PREFIX . "operatorgroups"] = get_operator_groups_list($operator['operatorid']);
|
||||
|
||||
|
@ -155,6 +155,9 @@ class UsersProcessor extends ClientSideProcessor implements AuthenticationManage
|
||||
{
|
||||
$operator = $this->checkOperator($args['agentId']);
|
||||
notify_operator_alive($operator['operatorid'], 1);
|
||||
// Update operator's data thus they will be sent with the response.
|
||||
$operator['istatus'] = 1;
|
||||
$this->getAuthenticationManager()->setOperator($operator);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,6 +171,9 @@ class UsersProcessor extends ClientSideProcessor implements AuthenticationManage
|
||||
{
|
||||
$operator = $this->checkOperator($args['agentId']);
|
||||
notify_operator_alive($operator['operatorid'], 0);
|
||||
// Update operator's data thus they will be sent with the response.
|
||||
$operator['istatus'] = 0;
|
||||
$this->getAuthenticationManager()->setOperator($operator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -435,7 +435,7 @@ function delete_operator($operator_id)
|
||||
/**
|
||||
* Set current status of the operator('available' or 'away')
|
||||
*
|
||||
* @param int $operatorid Id of the operator
|
||||
* @param int $operator_id Id of the operator
|
||||
* @param int $istatus Operator status: '0' means 'available' and '1' means
|
||||
* 'away'
|
||||
*/
|
||||
@ -451,11 +451,6 @@ function notify_operator_alive($operator_id, $istatus)
|
||||
':operatorid' => $operator_id,
|
||||
)
|
||||
);
|
||||
if (isset($_SESSION[SESSION_PREFIX . "operator"])) {
|
||||
if ($_SESSION[SESSION_PREFIX . "operator"]['operatorid'] == $operator_id) {
|
||||
$_SESSION[SESSION_PREFIX . "operator"]['istatus'] = $istatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user