You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if (SessionExpire() || ((isset($_GET["idProg"])) && ($_GET["idProg"] == '-1'))) {
|
|
|
|
|
RegistraSaida();
|
|
|
|
|
$_GET["idProg"] = GetStartPage();
|
|
|
|
|
$_SESSION = array();
|
|
|
|
|
@session_destroy();
|
|
|
|
|
$idProg = GetStartPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetCookieApl(RAMAL_MONITOR_AUDIO);
|
|
|
|
|
GetCookieApl(CANAL_MONITOR_AUDIO);
|
|
|
|
|
GetCookieApl(RAMAL_MONITOR_SUPERVISOR);
|
|
|
|
|
GetCookieApl(CANAL_MONITOR_SUPERVISOR);
|
|
|
|
|
GetCookieApl(RAMAL_MONITOR_AGENTE);
|
|
|
|
|
GetCookieApl(CANAL_MONITOR_AGENTE);
|
|
|
|
|
|
|
|
|
|
function GetStartPage() {
|
|
|
|
|
//if(GetPerfil() == PERFIL_GRAVADOR){ return PAGINA_GRAVADOR_PAINEL; }
|
|
|
|
|
return PAGINA_SUPERVISOR; //Supervisor.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function RegistraSaida() {
|
|
|
|
|
try {
|
|
|
|
|
GravaFull('-1', '', 'Logoff do sistema', GetLogin());
|
|
|
|
|
$query = "update pbx_controle_acesso set acs_data_fim = now() where acs_sessao = '%s' and acs_login = '%s' and acs_data_fim is null";
|
|
|
|
|
$query = sprintf($query, (session_id()), (GetLogin()));
|
|
|
|
|
$result = pg_query($query);
|
|
|
|
|
if (!$result) {
|
|
|
|
|
throw new Exception("Erro ao registrar sa<EFBFBD>da ao sistema!");
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
} catch (Exception $ex) {
|
|
|
|
|
GravaLogForms($ex->getMessage(), "RegistraSaida");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|