PABX da Simples IP
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.
 
 
 
 
 
 

82 lines
2.7 KiB

<?php
//fecha janela de agente se a sessao for encerrada com a janela aberta
if ((IsAjax()) && (!isset($_SESSION["SSlogin"]) || !$_SESSION["SSlogin"])) {
echo "close@#@";
exit;
}
/*
* verifica se sessao corrente esta válida
*/
if (!isset($_SESSION["SSinSession"]) || ($_SESSION["SSinSession"] != "ok")) {
$_SESSION["SSinSession"] = "ok";
$_SESSION["SSlogin"] = null;
$_SESSION["SSaut"] = "er";
$_SESSION["SSsuper"] = null;
$_SESSION["SSadmin"] = null;
$_SESSION["SSagente"] = null;
$_SESSION[AGT_TP_ATEND] = -1; //modu de atendimento do agente
$loginOn = 0; //imprime o login nos templates provisoriamente
$_SESSION[SS_SENHA_DEF] = 0;
$_SESSION["primAcesso"] = 0;
$_SESSION[HOSTS_INFO] = null; //pbx_sites
$_SESSION["SSagentePenalidade"] = null;
$_SESSION["SSUsoServico"] = 0;
GetParametrosLicensa();
}
/**
* Direciona o usuário para autenticação
* caso esta ainda não a tenha efetuada
*/
if (($_SESSION["SSaut"] === "er") || (!$_SESSION["SSaut"])) {
include('login.php');
//if($siteError)$siteError->GetPhpError('include(\'login.php\')', "", "Erro ao carregar Login");
}
if (isset($_GET['action']) && ($_GET['action'] == 'recovery_password')) {
include("recuperarsenha.php");
} else if (isset($_GET['action']) && ($_GET['action'] == 'change_password')) {
include("alterarsenha.php");
}
if (strtoupper($_SESSION["SSaut"]) == "OK" && !$_SESSION["SSTermoUsoPrivacidade"]) {
include('termoUsoPrivacidade.php');
} else if (strtoupper($_SESSION["SSaut"]) == "OK" && !$_SESSION['SSEmpresaPadrao']) {
include('selecionaEmpresa.php');
} else if (strtoupper($_SESSION["SSaut"]) == "OK") {
$tpLayout = 0;
if (IsUserConnect() && strtoupper(GetLogin()) == 'ADMIN' & !$_SESSION["primAcesso"]) {
VerificaCadastroMenu($dbcon);
$_SESSION["primAcesso"]++;
}
$idProg = IsAdmin() || IsSuper() ? $idProg : ($idProg == PAGINA_SUPERVISOR ? PAGINA_AGENTE_INI : $idProg);
/*
* libera variaveis de sessao usadas nos relatorios
*/
if (isset($_GET["idProg"]))
LimpaVarRelatorio();
if ((strtoupper($_SESSION["SSaut"]) == "OK") && $_SESSION[SS_SENHA_DEF]) {
if (!$_SESSION["SS_OLD_ID"])
$_SESSION["SS_OLD_ID"] = $idProg;
$idProg = 16;
$vAlineMaster = "middle";
$wAlineMaster = "center";
} else {
$vAlineMaster = "top";
}
$arFullExcept = array(6, 14, 307, 10034);
$atualizaStatus = (array_search($idProg, $arFullExcept) !== false) && IsAjax();
if (!$atualizaStatus) {
RegistraAcessoItem($idProg);
GravaFull();
}
//menu sistema
include("menuUser.php");
}