Commit b10ec84d6f407cd15ef0a341b7e25423103983af
1 parent
7f11a2f4
Exists in
master
and in
1 other branch
Correcao na visao para geracao de relatorios multi-locais; ajustes nas comunicac…
…oes de suporte remoto; captura de chat realizado entre as pontas do suporte remoto; melhorias na opcao de log de suporte remoto. git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@799 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
16 changed files
with
653 additions
and
317 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,239 @@ |
| 1 | +<? | |
| 2 | + /* | |
| 3 | + Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil | |
| 4 | + | |
| 5 | + Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais | |
| 6 | + | |
| 7 | + O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como | |
| 8 | + publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opnião) qualquer versão. | |
| 9 | + | |
| 10 | + Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer | |
| 11 | + MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. | |
| 12 | + | |
| 13 | + Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software | |
| 14 | + Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 15 | + */ | |
| 16 | +session_start(); | |
| 17 | +/* | |
| 18 | + * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! | |
| 19 | + */ | |
| 20 | +if(!isset($_SESSION['id_usuario'])) | |
| 21 | + die('Acesso restrito (Restricted access)!'); | |
| 22 | +else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
| 23 | +} | |
| 24 | + | |
| 25 | +if ($_REQUEST['Fechar']) | |
| 26 | + header ("Location: log_suporte_remoto.php"); | |
| 27 | + | |
| 28 | +include_once "../include/library.php"; | |
| 29 | +Conecta_bd_cacic(); | |
| 30 | + | |
| 31 | +$query = 'SELECT DATE_FORMAT(aa.dt_hr_inicio_conexao, "%y-%m-%d %H:%i") as dt_hr_inicio_conexao, | |
| 32 | + DATE_FORMAT(aa.dt_hr_ultimo_contato, "%y-%m-%d %H:%i") as dt_hr_ultimo_contato, | |
| 33 | + DATE_FORMAT(a.dt_hr_inicio_sessao, "%y-%m-%d %H:%i") as dt_hr_inicio_sessao, | |
| 34 | + aa.te_documento_referencial, | |
| 35 | + aa.te_motivo_conexao, | |
| 36 | + a.nm_completo_usuario_srv, | |
| 37 | + aaa.dt_hr_mensagem, | |
| 38 | + aaa.te_mensagem, | |
| 39 | + aaa.cs_origem, | |
| 40 | + d.te_ip te_ip_srv, | |
| 41 | + d.te_nome_computador te_nome_computador_srv, | |
| 42 | + b.nm_usuario_completo, | |
| 43 | + b.nm_usuario_acesso, | |
| 44 | + b.id_usuario, | |
| 45 | + c.sg_local, | |
| 46 | + e.te_desc_so te_desc_so_cli, | |
| 47 | + e.te_so te_so_cli, | |
| 48 | + f.te_desc_so te_desc_so_srv, | |
| 49 | + f.te_so te_so_srv, | |
| 50 | + a.id_sessao, | |
| 51 | + aa.id_conexao | |
| 52 | + FROM srcacic_conexoes aa | |
| 53 | + LEFT JOIN srcacic_chats aaa ON (aaa.id_conexao = aa.id_conexao), | |
| 54 | + srcacic_sessoes a, | |
| 55 | + usuarios b, | |
| 56 | + locais c, | |
| 57 | + computadores d, | |
| 58 | + so e, | |
| 59 | + so f | |
| 60 | + WHERE aa.id_conexao = ' .$_GET['id_conexao'].' AND | |
| 61 | + a.id_sessao = aa.id_sessao AND | |
| 62 | + aa.id_usuario_cli = b.id_usuario AND | |
| 63 | + b.id_local = c.id_local AND | |
| 64 | + d.te_node_address = a.te_node_address_srv AND | |
| 65 | + d.id_so = a.id_so_srv AND | |
| 66 | + e.id_so = aa.id_so_cli AND | |
| 67 | + f.id_so = a.id_so_srv | |
| 68 | + ORDER BY aaa.dt_hr_mensagem DESC'; | |
| 69 | + | |
| 70 | +$result = mysql_query($query); | |
| 71 | +$row = mysql_fetch_array($result); | |
| 72 | + | |
| 73 | +list($year_inicio_sessao, $month_inicio_sessao, $day_inicio_sessao) = explode("-", $row['dt_hr_inicio_sessao']); | |
| 74 | +list($day_inicio_sessao,$hour_inicio_sessao) = explode(" ",$day_inicio_sessao); | |
| 75 | + | |
| 76 | +list($year_ultimo_contato, $month_ultimo_contato, $day_ultimo_contato) = explode("-", $row['dt_hr_ultimo_contato']); | |
| 77 | +list($day_ultimo_contato,$hour_ultimo_contato) = explode(" ",$day_ultimo_contato); | |
| 78 | + | |
| 79 | +list($year_conexao, $month_conexao, $day_conexao) = explode("-", $row['dt_hr_inicio_conexao']); | |
| 80 | +list($day_conexao,$hour_conexao) = explode(" ",$day_conexao); | |
| 81 | + | |
| 82 | +$strCorSrv = '#CCCCCC'; | |
| 83 | +$strCorCli = '#FFFFCC'; | |
| 84 | +?> | |
| 85 | + | |
| 86 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| 87 | +<html> | |
| 88 | +<head> | |
| 89 | +<link rel="stylesheet" type="text/css" href="../include/cacic.css"> | |
| 90 | +<title>Lista Chats Realizados nas Conexões srCACIC</title> | |
| 91 | +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
| 92 | +</head> | |
| 93 | + | |
| 94 | +<body background="../imgs/linha_v.gif"> | |
| 95 | +<script language="JavaScript" type="text/javascript" src="../include/cacic.js"></script> | |
| 96 | + | |
| 97 | +<form name="form1" method="post" action=""> | |
| 98 | +<table width="90%" border="0" align="center"> | |
| 99 | + <tr> | |
| 100 | + <td colspan="2" class="cabecalho">Detalhamento de conexão para Suporte Remoto</td> | |
| 101 | + </tr> | |
| 102 | + <tr> | |
| 103 | + <td nowrap class="destaque"> </td> | |
| 104 | + <td class="normal"> </td> | |
| 105 | + </tr> | |
| 106 | + | |
| 107 | + <tr> | |
| 108 | + <td height="1" colspan="2" bgcolor="#333333"></td> | |
| 109 | + </tr> | |
| 110 | + | |
| 111 | + <tr> | |
| 112 | + <td bgcolor="<? echo $strCorSrv; ?>" colspan="2" class="cabecalho_secao" align="left">Estação Local</td> | |
| 113 | + </tr> | |
| 114 | + <tr> | |
| 115 | + <td nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Usuário:</div></td> | |
| 116 | + <td bgcolor="<? echo $strCorSrv; ?>" class="normal"><? echo $row['nm_completo_usuario_srv']; ?></td> | |
| 117 | + </tr> | |
| 118 | + <tr> | |
| 119 | + <td nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Sistema Operacional:</div></td> | |
| 120 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_desc_so_srv'].' ('.$row['te_so_srv'].')';?></td> | |
| 121 | + </tr> | |
| 122 | + <tr> | |
| 123 | + <td width="16%" nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Início de Sessão:</div></td> | |
| 124 | + <td width="83%" bgcolor="<? echo $strCorSrv; ?>" class="normal"><? echo $day_inicio_sessao.'/'.$month_inicio_sessao.'/'.$year_inicio_sessao. ' '. substr($hour_inicio_sessao,0,5).'h'; ?></td> | |
| 125 | + </tr> | |
| 126 | + <tr> | |
| 127 | + <td nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Identificação da Estação</div></td> | |
| 128 | + <td bgcolor="<? echo $strCorSrv; ?>" class="normal"><? echo $row['te_ip_srv'].' / '.$row['te_nome_computador_srv'].' ('.$row['sg_local'].')'; ?></td> | |
| 129 | + </tr> | |
| 130 | + <tr> | |
| 131 | + <td height="1" colspan="2" bgcolor="#FFFFFF"><BR></td> | |
| 132 | + </tr> | |
| 133 | + | |
| 134 | + <tr> | |
| 135 | + <td bgcolor="<? echo $strCorCli; ?>" colspan="2" class="cabecalho_secao" align="left">Estação Remota</td> | |
| 136 | + </tr> | |
| 137 | + | |
| 138 | + <tr> | |
| 139 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Usuário:</div></td> | |
| 140 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['nm_usuario_acesso'].' / '.$row['nm_usuario_completo']; ?></td> | |
| 141 | + </tr> | |
| 142 | + <tr> | |
| 143 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Sistema Operacional:</div></td> | |
| 144 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_desc_so_cli'].' ('.$row['te_so_cli'].')';?></td> | |
| 145 | + </tr> | |
| 146 | + <tr> | |
| 147 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Documento Referencial:</div></td> | |
| 148 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_documento_referencial']; ?></td> | |
| 149 | + </tr> | |
| 150 | + <tr> | |
| 151 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Descritivo do Atendimento:</div></td> | |
| 152 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_motivo_conexao'];?></td> | |
| 153 | + </tr> | |
| 154 | + <tr> | |
| 155 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Conexão - Data/Hora Último Contato:</div></td> | |
| 156 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $day_ultimo_contato.'/'.$month_ultimo_contato.'/'.$year_ultimo_contato. ' '. substr($hour_ultimo_contato,0,5).'h'; ?></td> | |
| 157 | + </tr> | |
| 158 | + <tr> | |
| 159 | + <td height="1" colspan="2" bgcolor="#333333"></td> | |
| 160 | + </tr> | |
| 161 | +</table> | |
| 162 | +<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1"> | |
| 163 | +<BR> | |
| 164 | + <tr> | |
| 165 | + <td colspan="2" class="destaque_chat"><div align="center" class="destaque_chat">Chat</div></td> | |
| 166 | + </tr> | |
| 167 | + <tr> | |
| 168 | + <td height="1" colspan="2" bgcolor="#333333"></td> | |
| 169 | + </tr> | |
| 170 | + | |
| 171 | + <tr> | |
| 172 | + <td colspan="3"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" bordercolor="#333333"> | |
| 173 | + <tr bgcolor="#E1E1E1"> | |
| 174 | + <td align="center" nowrap> </td> | |
| 175 | + <td align="center" nowrap> </td> | |
| 176 | + <td align="center" nowrap class="cabecalho_tabela"><div align="center">Data/Hora</div></td> | |
| 177 | + <td nowrap class="cabecalho_tabela">Origem/Mensagem</td> | |
| 178 | + </tr> | |
| 179 | + <tr> | |
| 180 | + <td height="1" colspan="9" bgcolor="#333333"></td> | |
| 181 | + </tr> | |
| 182 | + | |
| 183 | +<? | |
| 184 | +if(mysql_num_rows($result)==0) | |
| 185 | + { | |
| 186 | + $msg = '<div align="center"> | |
| 187 | + <font color="red" size="1" face="Verdana, Arial, Helvetica, sans-serif"> | |
| 188 | + Nenhum diálogo realizado</font><br><br></div>'; | |
| 189 | + } | |
| 190 | +else | |
| 191 | + { | |
| 192 | + $Cor = 0; | |
| 193 | + $NumRegistro = 1; | |
| 194 | + mysql_data_seek($result,0); | |
| 195 | + while($row = mysql_fetch_array($result)) | |
| 196 | + { | |
| 197 | + if (trim($row['dt_hr_mensagem']) <> '') | |
| 198 | + { | |
| 199 | + list($year_mensagem, $month_mensagem, $day_mensagem) = explode("-", $row['dt_hr_mensagem']); | |
| 200 | + list($day_mensagem,$hour_mensagem) = explode(" ",$day_mensagem); | |
| 201 | + ?> | |
| 202 | + <tr bgcolor="<? echo ($row['cs_origem']=='srv'?$strCorSrv:$strCorCli);?>"> | |
| 203 | + <td><a name="<? echo $NumRegistro?>"></a></td> | |
| 204 | + <td class="opcao_tabela"><div align="left"><? echo $NumRegistro; ?></div></td> | |
| 205 | + <td class="opcao_tabela"><div align="center"><? echo $day_mensagem.'/'.$month_mensagem.'/'.$year_mensagem. ' '. $hour_mensagem . 'h'; ?></div></td> | |
| 206 | + <td class="opcao_tabela"><div align="left"><? echo ($row['cs_origem']=='srv'?$row['nm_completo_usuario_srv']:$row['nm_usuario_completo']) .': '. $row['te_mensagem']; ?> </div></td> | |
| 207 | + <? | |
| 208 | + $Cor=!$Cor; | |
| 209 | + $NumRegistro++; | |
| 210 | + } | |
| 211 | + } | |
| 212 | + if ($NumRegistro == 1) | |
| 213 | + { | |
| 214 | + ?> | |
| 215 | + <tr align="center"> | |
| 216 | + <td colspan="4" class="Aviso">Não Houve Chat Durante a Conexão</td> | |
| 217 | + </tr> | |
| 218 | + <? | |
| 219 | + } | |
| 220 | + } | |
| 221 | + | |
| 222 | +?> | |
| 223 | + </table></td> | |
| 224 | + </tr> | |
| 225 | + <tr> | |
| 226 | + <td height="1" colspan="3" bgcolor="#333333"></td> | |
| 227 | + </tr> | |
| 228 | + <tr> | |
| 229 | + <td height="10" colspan="3"> </td> | |
| 230 | + </tr> | |
| 231 | + <tr> | |
| 232 | + <td height="10" colspan="3"><? echo $msg;?></td> | |
| 233 | + </tr> | |
| 234 | + | |
| 235 | +</table> | |
| 236 | +</form> | |
| 237 | +<p> </p> | |
| 238 | +</body> | |
| 239 | +</html> | ... | ... |
admin/locais/detalhes_local.php
| ... | ... | @@ -335,15 +335,17 @@ $_SESSION['etiqueta2'] = mysql_result($resultCONFIG,2,'te_etiqueta'); |
| 335 | 335 | |
| 336 | 336 | <table width="90%" border="0" align="center" cellpadding="0" cellspacing="1"> |
| 337 | 337 | <tr> |
| 338 | - <td colspan="7" class="label"><?=$oTranslator->_('Usuarios Associados ao Local');?></td> | |
| 338 | + <td colspan="9" class="label"><?=$oTranslator->_('Usuarios Associados ao Local');?></td> | |
| 339 | 339 | </tr> |
| 340 | 340 | <tr> |
| 341 | - <td height="1" bgcolor="#333333" colspan="9"></td> | |
| 341 | + <td height="1" bgcolor="#333333" colspan="11"></td> | |
| 342 | 342 | </tr> |
| 343 | 343 | <tr> |
| 344 | 344 | <td class="cabecalho_tabela"> </td> |
| 345 | 345 | <td class="cabecalho_tabela"> </td> |
| 346 | - <td align="left" nowrap class="cabecalho_tabela"><?=$oTranslator->_('Nome');?></td> | |
| 346 | + <td align="left" nowrap class="cabecalho_tabela"><?=$oTranslator->_('Nome para Acesso');?></td> | |
| 347 | + <td class="cabecalho_tabela"> </td> | |
| 348 | + <td align="left" nowrap class="cabecalho_tabela"><?=$oTranslator->_('Nome Completo');?></td> | |
| 347 | 349 | <td align="left" class="cabecalho_tabela"> </td> |
| 348 | 350 | <td align="left" nowrap class="cabecalho_tabela"><div align="center"><?=$oTranslator->_('Nivel de Acesso');?></div></td> |
| 349 | 351 | <td align="left" class="cabecalho_tabela"> </td> |
| ... | ... | @@ -352,11 +354,12 @@ $_SESSION['etiqueta2'] = mysql_result($resultCONFIG,2,'te_etiqueta'); |
| 352 | 354 | <td align="left" class="cabecalho_tabela"><?=$oTranslator->_('Endereco eletronico');?></td> |
| 353 | 355 | </tr> |
| 354 | 356 | <tr> |
| 355 | - <td height="1" bgcolor="#333333" colspan="9"></td> | |
| 357 | + <td height="1" bgcolor="#333333" colspan="11"></td> | |
| 356 | 358 | </tr> |
| 357 | 359 | <? |
| 358 | 360 | $query = "SELECT a.id_usuario, |
| 359 | - a.nm_usuario_completo, | |
| 361 | + a.nm_usuario_acesso, | |
| 362 | + a.nm_usuario_completo, | |
| 360 | 363 | a.id_local, |
| 361 | 364 | a.te_locais_secundarios, |
| 362 | 365 | a.te_emails_contato, |
| ... | ... | @@ -381,6 +384,9 @@ $_SESSION['etiqueta2'] = mysql_result($resultCONFIG,2,'te_etiqueta'); |
| 381 | 384 | <tr <? if ($Cor) echo 'bgcolor="#E1E1E1"'; ?>> |
| 382 | 385 | <td width="2%" align="center" nowrap class="opcao_tabela"><a href="../usuarios/detalhes_usuario.php?id_usuario=<? echo $row['id_usuario'];?>&id_local=<? echo $row['id_local'];?>&nm_chamador=Locais"><? echo $seq; ?></a></td> |
| 383 | 386 | <td width="1%" align="left" nowrap class="opcao_tabela"> </td> |
| 387 | + <td width="3%" align="left" nowrap class="opcao_tabela"><a href="../usuarios/detalhes_usuario.php?id_usuario=<? echo $row['id_usuario'];?>&id_local=<? echo $row['id_local'];?>&nm_chamador=Locais"><? echo $row['nm_usuario_acesso']; | |
| 388 | + ?></a></td> | |
| 389 | + <td width="1%" align="left" nowrap class="opcao_tabela"> </td> | |
| 384 | 390 | <td width="3%" align="left" nowrap class="opcao_tabela"><a href="../usuarios/detalhes_usuario.php?id_usuario=<? echo $row['id_usuario'];?>&id_local=<? echo $row['id_local'];?>&nm_chamador=Locais"><? echo $row['nm_usuario_completo']; |
| 385 | 391 | if ($row['te_locais_secundarios']<>'' && $row['id_local'] <> $_GET['id_local']) |
| 386 | 392 | { |
| ... | ... | @@ -409,7 +415,7 @@ $_SESSION['etiqueta2'] = mysql_result($resultCONFIG,2,'te_etiqueta'); |
| 409 | 415 | echo '<tr><td colspan="3" class="label_vermelho">'.$oTranslator->_('Ainda nao existem usuarios associados ao local!').'</td></tr>'; |
| 410 | 416 | ?> |
| 411 | 417 | <tr> |
| 412 | - <td height="1" bgcolor="#333333" colspan="9"></td> | |
| 418 | + <td height="1" bgcolor="#333333" colspan="11"></td> | |
| 413 | 419 | </tr> |
| 414 | 420 | </table> |
| 415 | 421 | <p align="center"> <br> | ... | ... |
admin/log_suporte_remoto.php
| ... | ... | @@ -49,7 +49,7 @@ if (!$_REQUEST['date_input1']) |
| 49 | 49 | conecta_bd_cacic(); |
| 50 | 50 | $query_minmax = 'SELECT DATE_FORMAT(min(a.dt_hr_ultimo_contato), "%d-%m-%Y") as minima, |
| 51 | 51 | DATE_FORMAT(max(a.dt_hr_ultimo_contato), "%d-%m-%Y") as maxima |
| 52 | - FROM srcacic_sessoes_logs a '. | |
| 52 | + FROM srcacic_conexoes a '. | |
| 53 | 53 | $from_usuarios .' |
| 54 | 54 | WHERE '. |
| 55 | 55 | $where_usuarios; |
| ... | ... | @@ -164,7 +164,7 @@ require_once('../include/selecao_listbox.js'); |
| 164 | 164 | $where = ($_REQUEST['nm_chamador']<>''?' AND b.id_usuario = '.$_REQUEST['id_usuario']:''); |
| 165 | 165 | |
| 166 | 166 | $OrderBy = ($_GET['OrderBy']<>''?$_GET['OrderBy']:'1'); |
| 167 | - $OrderBy = ($OrderBy=='1'?$OrderBy . ' DESC ':$OrderBy); | |
| 167 | + $OrderBy = ($OrderBy=='1' || $OrderBy=='3'?$OrderBy . ' DESC ':$OrderBy); | |
| 168 | 168 | |
| 169 | 169 | //$where_usuarios = ''; |
| 170 | 170 | $itens_locais = ''; |
| ... | ... | @@ -188,40 +188,46 @@ require_once('../include/selecao_listbox.js'); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | conecta_bd_cacic(); |
| 191 | - $query = 'SELECT DATE_FORMAT(a.dt_hr_ultimo_contato, "%y-%m-%d %H:%i") as dt_hr_ultimo_contato, | |
| 192 | - DATE_FORMAT(a.dt_hr_conexao, "%y-%m-%d %H:%i") as dt_hr_conexao, | |
| 193 | - a.te_documento_referencial, | |
| 194 | - a.te_motivo_conexao, | |
| 195 | - DATE_FORMAT(aa.dt_hr_inicio_sessao, "%y-%m-%d %H:%i") as dt_hr_inicio_sessao, | |
| 196 | - aa.nm_completo_usuario_visitado, | |
| 197 | - d.te_ip te_ip_visitado, | |
| 198 | - d.te_nome_computador te_nome_computador_visitado, | |
| 191 | + $query = 'SELECT DATE_FORMAT(aa.dt_hr_inicio_conexao, "%y-%m-%d %H:%i") as dt_hr_inicio_conexao, | |
| 192 | + DATE_FORMAT(aa.dt_hr_ultimo_contato, "%y-%m-%d %H:%i") as dt_hr_ultimo_contato, | |
| 193 | + DATE_FORMAT(a.dt_hr_inicio_sessao, "%y-%m-%d %H:%i") as dt_hr_inicio_sessao, | |
| 194 | + aa.te_documento_referencial, | |
| 195 | + aa.te_motivo_conexao, | |
| 196 | + a.nm_completo_usuario_srv, | |
| 197 | + aaa.dt_hr_mensagem, | |
| 198 | + aaa.te_mensagem, | |
| 199 | + aaa.cs_origem, | |
| 200 | + d.te_ip te_ip_srv, | |
| 201 | + d.te_nome_computador te_nome_computador_srv, | |
| 199 | 202 | b.nm_usuario_completo, |
| 200 | 203 | b.nm_usuario_acesso, |
| 201 | 204 | b.id_usuario, |
| 202 | 205 | c.sg_local, |
| 203 | - e.sg_so | |
| 204 | - FROM srcacic_sessoes_logs a, | |
| 205 | - srcacic_sessoes aa, | |
| 206 | + e.sg_so, | |
| 207 | + a.id_sessao, | |
| 208 | + aa.id_conexao | |
| 209 | + FROM srcacic_conexoes aa | |
| 210 | + LEFT JOIN srcacic_chats aaa ON (aaa.id_conexao = aa.id_conexao) | |
| 211 | + LEFT JOIN srcacic_sessoes a ON (a.id_sessao = aa.id_sessao) , | |
| 206 | 212 | usuarios b, |
| 207 | 213 | locais c, |
| 208 | 214 | computadores d, |
| 209 | 215 | so e |
| 210 | - WHERE aa.id_sessao = a.id_sessao AND | |
| 211 | - a.id_usuario_visitante = b.id_usuario AND | |
| 216 | + WHERE a.id_sessao = aa.id_sessao AND | |
| 217 | + aa.id_usuario_cli = b.id_usuario AND | |
| 212 | 218 | b.id_local = c.id_local AND |
| 213 | - a.dt_hr_ultimo_contato between "' . substr($_REQUEST['date_input1'],-4)."-".substr($_REQUEST['date_input1'],3,2)."-".substr($_REQUEST['date_input1'],0,2).' 00:00" AND "' . substr($_REQUEST['date_input2'],-4)."-".substr($_REQUEST['date_input2'],3,2)."-".substr($_REQUEST['date_input2'],0,2). ' 23:59" '. | |
| 219 | + aa.dt_hr_ultimo_contato between "' . substr($_REQUEST['date_input1'],-4)."-".substr($_REQUEST['date_input1'],3,2)."-".substr($_REQUEST['date_input1'],0,2).' 00:00" AND "' . substr($_REQUEST['date_input2'],-4)."-".substr($_REQUEST['date_input2'],3,2)."-".substr($_REQUEST['date_input2'],0,2). ' 23:59" '. | |
| 214 | 220 | $where . |
| 215 | 221 | $where_locais . ' AND |
| 216 | - d.te_node_address = aa.te_node_address_visitado AND | |
| 217 | - d.id_so = aa.id_so_visitado AND | |
| 218 | - e.id_so = a.id_so_visitante | |
| 222 | + d.te_node_address = a.te_node_address_srv AND | |
| 223 | + d.id_so = a.id_so_srv AND | |
| 224 | + e.id_so = aa.id_so_cli | |
| 219 | 225 | ORDER BY '.$OrderBy; |
| 220 | 226 | /* |
| 221 | -... SELECT ... dd.te_nome_computador te_nome_computador_visitante,a.te_ip te_ip_visitante, | |
| 227 | +... SELECT ... dd.te_nome_computador te_nome_computador_cli,a.te_ip te_ip_cli, | |
| 222 | 228 | ... FROM ... computadores dd |
| 223 | -... WHERE ... dd.te_node_address = a.te_node_address_visitante AND | |
| 224 | - dd.id_so = a.id_so_visitante | |
| 229 | +... WHERE ... dd.te_node_address = a.te_node_address_cli AND | |
| 230 | + dd.id_so = a.id_so_cli | |
| 225 | 231 | */ |
| 226 | 232 | //echo $query . '<br>'; |
| 227 | 233 | $result = mysql_query($query); |
| ... | ... | @@ -241,61 +247,95 @@ require_once('../include/selecao_listbox.js'); |
| 241 | 247 | <td height="1" colspan="3" bgcolor="#333333"></td> |
| 242 | 248 | </tr> |
| 243 | 249 | <tr> |
| 244 | - <td colspan="3"> | |
| 250 | + <td colspan="5"> | |
| 245 | 251 | <table width="90%" border="0" cellpadding="2" cellspacing="0" bordercolor="#333333" align="center"> |
| 246 | 252 | <tr bgcolor="#E1E1E1"> |
| 247 | 253 | <td colspan="3"></td> |
| 248 | - <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=1&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Início de Sessão');?></a></div></td> | |
| 254 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=3&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Início de Sessão');?></a></div></td> | |
| 249 | 255 | <td></td> |
| 250 | - <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=3&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Usuario Tecnico');?></a></div></td> | |
| 256 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=7&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Estação Local');?></a></div></td> | |
| 251 | 257 | <td></td> |
| 252 | - <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=3&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('S.O. do Tecnico');?></a></div></td> | |
| 258 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=6&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Usuário Local');?></a></div></td> | |
| 253 | 259 | <td></td> |
| 254 | - <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=4&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Estação Destino');?></a></div></td> | |
| 260 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=10&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Usuário Remoto');?></a></div></td> | |
| 255 | 261 | <td></td> |
| 256 | - <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=5&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Usuário Destino');?></a></div></td> | |
| 262 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=13&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Sigla S.O. Remoto');?></a></div></td> | |
| 257 | 263 | <td></td> |
| 258 | - <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=6&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Conexão - Último Contato');?></a></div></td> | |
| 264 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=1&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Conexão - Último Contato');?></a></div></td> | |
| 259 | 265 | <td></td> |
| 266 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php#"><?=$oTranslator->_('Chat');?></a></div></td> | |
| 267 | + <td></td> | |
| 260 | 268 | </tr> |
| 261 | 269 | <tr> |
| 262 | - <td height="1" colspan="15" bgcolor="#333333"></td> | |
| 270 | + <td height="1" colspan="17" bgcolor="#333333"></td> | |
| 263 | 271 | </tr> |
| 264 | 272 | <? |
| 265 | 273 | $Cor = 0; |
| 266 | - $NumRegistro = mysql_num_rows($result); | |
| 274 | + $NumRegistro = 0; | |
| 267 | 275 | $msg = ($NumRegistro > 1?'':$msg); |
| 276 | + | |
| 277 | + $strRegistroAnterior = ''; | |
| 278 | + while($row = mysql_fetch_array($result)) | |
| 279 | + { | |
| 280 | + $strRegistroAtual = $row['id_sessao'] . $row['id_conexao']; | |
| 281 | + if ($strRegistroAnterior <> $strRegistroAtual) | |
| 282 | + { | |
| 283 | + $strRegistroAnterior = $strRegistroAtual; | |
| 284 | + $NumRegistro ++; | |
| 285 | + } | |
| 286 | + } | |
| 287 | + | |
| 288 | + mysql_data_seek($result,0); | |
| 289 | + | |
| 290 | + $strRegistroAnterior = ''; | |
| 268 | 291 | while($row = mysql_fetch_array($result)) |
| 269 | 292 | { |
| 270 | - list($year_inicio_sessao, $month_inicio_sessao, $day_inicio_sessao) = explode("-", $row['dt_hr_inicio_sessao']); | |
| 271 | - list($day_inicio_sessao,$hour_inicio_sessao) = explode(" ",$day_inicio_sessao); | |
| 293 | + $strRegistroAtual = $row['id_sessao'] . $row['id_conexao']; | |
| 294 | + if ($strRegistroAnterior <> $strRegistroAtual) | |
| 295 | + { | |
| 296 | + $strRegistroAnterior = $strRegistroAtual; | |
| 297 | + | |
| 298 | + list($year_inicio_sessao, $month_inicio_sessao, $day_inicio_sessao) = explode("-", $row['dt_hr_inicio_sessao']); | |
| 299 | + list($day_inicio_sessao,$hour_inicio_sessao) = explode(" ",$day_inicio_sessao); | |
| 272 | 300 | |
| 273 | - list($year_ultimo_contato, $month_ultimo_contato, $day_ultimo_contato) = explode("-", $row['dt_hr_ultimo_contato']); | |
| 274 | - list($day_ultimo_contato,$hour_ultimo_contato) = explode(" ",$day_ultimo_contato); | |
| 301 | + list($year_ultimo_contato, $month_ultimo_contato, $day_ultimo_contato) = explode("-", $row['dt_hr_ultimo_contato']); | |
| 302 | + list($day_ultimo_contato,$hour_ultimo_contato) = explode(" ",$day_ultimo_contato); | |
| 275 | 303 | |
| 276 | - list($year_conexao, $month_conexao, $day_conexao) = explode("-", $row['dt_hr_conexao']); | |
| 277 | - list($day_conexao,$hour_conexao) = explode(" ",$day_conexao); | |
| 304 | + list($year_conexao, $month_conexao, $day_conexao) = explode("-", $row['dt_hr_inicio_conexao']); | |
| 305 | + list($day_conexao,$hour_conexao) = explode(" ",$day_conexao); | |
| 278 | 306 | |
| 279 | - ?> | |
| 280 | - <tr <? if ($Cor) { echo 'bgcolor="#E1E1E1"'; } ?>> | |
| 281 | - <td nowrap></td> | |
| 282 | - <td align="left" nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $NumRegistro; ?></td> | |
| 283 | - <td nowrap></td> | |
| 284 | - <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $day_inicio_sessao.'/'.$month_inicio_sessao.'/'.$year_inicio_sessao. ' '. substr($hour_inicio_sessao,0,5);?>h</td> | |
| 285 | - <td nowrap></td> | |
| 286 | - <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $row['nm_usuario_acesso'].'/'.$row['nm_usuario_completo'];?></td> | |
| 287 | - <td nowrap></td> | |
| 288 | - <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $row['sg_so'];?></td> | |
| 289 | - <td nowrap></td> | |
| 290 | - <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $row['te_ip_visitado'].'/'.$row['te_nome_computador_visitado'].' - '.$row['sg_local'];?></td> | |
| 291 | - <td nowrap></td> | |
| 292 | - <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $row['nm_completo_usuario_visitado'];?></td> | |
| 293 | - <td nowrap></td> | |
| 294 | - <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $day_conexao.'/'.$month_conexao.'/'.$year_conexao. ' '. substr($hour_conexao,0,5) . 'h - '.$day_ultimo_contato.'/'.$month_ultimo_contato.'/'.$year_ultimo_contato. ' '. substr($hour_ultimo_contato,0,5);?>h</td> | |
| 295 | - <td nowrap></td> | |
| 296 | - <? | |
| 297 | - $Cor=!$Cor; | |
| 298 | - $NumRegistro--; | |
| 307 | + ?> | |
| 308 | + <tr <? if ($Cor) { echo 'bgcolor="#E1E1E1"'; } ?>> | |
| 309 | + <td nowrap></td> | |
| 310 | + <td align="left" nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $NumRegistro; ?></td> | |
| 311 | + <td nowrap></td> | |
| 312 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><a href="lista_chats.php?id_conexao=<? echo $row['id_conexao'];?>"><? echo $day_inicio_sessao.'/'.$month_inicio_sessao.'/'.$year_inicio_sessao. ' '. substr($hour_inicio_sessao,0,5).'h';?></a></td> | |
| 313 | + <td nowrap></td> | |
| 314 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><a href="lista_chats.php?id_conexao=<? echo $row['id_conexao'];?>"><? echo $row['te_ip_srv'].'/'.$row['te_nome_computador_srv'].' ('.$row['sg_local'].')';?></a></td> | |
| 315 | + <td nowrap></td> | |
| 316 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><a href="lista_chats.php?id_conexao=<? echo $row['id_conexao'];?>"><? echo $row['nm_completo_usuario_srv'];?></a></td> | |
| 317 | + <td nowrap></td> | |
| 318 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><a href="lista_chats.php?id_conexao=<? echo $row['id_conexao'];?>"><? echo $row['nm_usuario_acesso'].'/'.$row['nm_usuario_completo'];?></a></td> | |
| 319 | + <td nowrap></td> | |
| 320 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><a href="lista_chats.php?id_conexao=<? echo $row['id_conexao'];?>"><? echo $row['sg_so'];?></a></td> | |
| 321 | + <td nowrap></td> | |
| 322 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><a href="lista_chats.php?id_conexao=<? echo $row['id_conexao'];?>"><? echo $day_conexao.'/'.$month_conexao.'/'.$year_conexao. ' '. substr($hour_conexao,0,5) . 'h - '.$day_ultimo_contato.'/'.$month_ultimo_contato.'/'.$year_ultimo_contato. ' '. substr($hour_ultimo_contato,0,5).'h';?></a></td> | |
| 323 | + <td nowrap></td> | |
| 324 | + <td nowrap class="opcao_tabela"> | |
| 325 | + <? | |
| 326 | + if ($row['te_mensagem']<>'') | |
| 327 | + { | |
| 328 | + ?> | |
| 329 | + <a href="lista_chats.php?id_conexao=<? echo $row['id_conexao'];?>"><img src="../imgs/chat.png" border="0" height="20" width="20"></a> | |
| 330 | + <? | |
| 331 | + } | |
| 332 | + ?> | |
| 333 | + </td> | |
| 334 | + <td nowrap></td> | |
| 335 | + <? | |
| 336 | + $Cor=!$Cor; | |
| 337 | + $NumRegistro--; | |
| 338 | + } | |
| 299 | 339 | } |
| 300 | 340 | ?> |
| 301 | 341 | </table></td> | ... | ... |
1.09 KB
3.96 KB
include/cacic.css
| ... | ... | @@ -69,6 +69,7 @@ td.dado {font-weight: bold; font-size: 11px; color: black; font-family: Verdana, |
| 69 | 69 | td.opcao {background-color: #FFFFFF; font-weight: normal; font-size: 11px; color: black; font-family: Verdana, Arial, sans;} |
| 70 | 70 | td.destaque {font-weight: bold; font-size: 10px; color: black; font-family: Verdana, Arial, sans;} |
| 71 | 71 | td.destaque_laranja {font-weight: bold; font-size: 10px; color: orange; font-family: Verdana, Arial, sans;} |
| 72 | +td.destaque_chat {font-weight: bold; font-size: 20px; color: orange; font-family: Verdana, Arial, sans;} | |
| 72 | 73 | td.cabecalho_secao {background-color: #FFFFFF; font-weight: bold; font-size: 17px; color: black; font-family: Verdana, Arial, sans;} |
| 73 | 74 | td.ajuda {background-color: #FFFFFF; font-weight: normal; font-size: 10px; color: black; font-family: Verdana, Arial, sans;} |
| 74 | 75 | |
| ... | ... | @@ -137,12 +138,12 @@ a.dcontexto:hover span |
| 137 | 138 | color: red; |
| 138 | 139 | font-size: 10px; |
| 139 | 140 | } |
| 140 | - | |
| 141 | -/* | |
| 142 | - * Redefinicao de CSS para futura criacao de "temas" | |
| 143 | - */ | |
| 144 | -.frameprincipal { | |
| 145 | - background: url('../imgs/linha_v.gif'); | |
| 141 | + | |
| 142 | +/* | |
| 143 | + * Redefinicao de CSS para futura criacao de "temas" | |
| 144 | + */ | |
| 145 | +.frameprincipal { | |
| 146 | + background: url('../imgs/linha_v.gif'); | |
| 146 | 147 | } |
| 147 | 148 | |
| 148 | 149 | .frameprincipal .cabecalho { |
| ... | ... | @@ -153,16 +154,16 @@ a.dcontexto:hover span |
| 153 | 154 | font-family: Verdana, Arial, sans; |
| 154 | 155 | } |
| 155 | 156 | |
| 156 | -.frameprincipal .cabecalho table { | |
| 157 | - text-align: justify; | |
| 158 | - color: black; | |
| 159 | - width: 98%; | |
| 160 | - margin-left: auto; | |
| 161 | - margin-right: auto; | |
| 162 | - border: 0; | |
| 157 | +.frameprincipal .cabecalho table { | |
| 158 | + text-align: justify; | |
| 159 | + color: black; | |
| 160 | + width: 98%; | |
| 161 | + margin-left: auto; | |
| 162 | + margin-right: auto; | |
| 163 | + border: 0; | |
| 163 | 164 | padding: 0; |
| 164 | 165 | } |
| 165 | - | |
| 166 | + | |
| 166 | 167 | .frameprincipal .cabecalho img { |
| 167 | 168 | /*opacity:0.65; |
| 168 | 169 | //-moz-opacity: 0.65; |
| ... | ... | @@ -181,7 +182,7 @@ a.dcontexto:hover span |
| 181 | 182 | color: black; |
| 182 | 183 | font-family: Verdana, Arial, sans; |
| 183 | 184 | } |
| 184 | - | |
| 185 | + | |
| 185 | 186 | .frameprincipal .corpo table { |
| 186 | 187 | text-align: justify; |
| 187 | 188 | color: black; |
| ... | ... | @@ -192,61 +193,61 @@ a.dcontexto:hover span |
| 192 | 193 | padding: 0; |
| 193 | 194 | } |
| 194 | 195 | |
| 195 | -.frameprincipal .header { | |
| 196 | - background: #CFCFCD; | |
| 197 | - text-align: center; | |
| 196 | +.frameprincipal .header { | |
| 197 | + background: #CFCFCD; | |
| 198 | + text-align: center; | |
| 198 | 199 | font-size: 12px; |
| 199 | -} | |
| 200 | - | |
| 201 | -.frameprincipal .help { | |
| 202 | - /*background: url('../imgs/help.png') no-repeat;*/ | |
| 203 | - text-align: center; | |
| 204 | - /*cursor: pointer;*/ | |
| 205 | - font-size: 10px; | |
| 206 | - font-style: italic; | |
| 207 | - padding: 2; | |
| 208 | - color: green; | |
| 209 | -} | |
| 210 | - | |
| 211 | -.frameprincipal .buildingAjax { | |
| 212 | - background: url('../imgs/carregando.gif') no-repeat; | |
| 213 | - padding: 0px 0px 0px 20px; | |
| 214 | - height: 16px; | |
| 215 | - width: 16px; | |
| 216 | -} | |
| 217 | - | |
| 218 | -.frameprincipal .btnForm { | |
| 219 | - background: #CCCCCC; | |
| 220 | -} | |
| 221 | - | |
| 200 | +} | |
| 201 | + | |
| 202 | +.frameprincipal .help { | |
| 203 | + /*background: url('../imgs/help.png') no-repeat;*/ | |
| 204 | + text-align: center; | |
| 205 | + /*cursor: pointer;*/ | |
| 206 | + font-size: 10px; | |
| 207 | + font-style: italic; | |
| 208 | + padding: 2; | |
| 209 | + color: green; | |
| 210 | +} | |
| 211 | + | |
| 212 | +.frameprincipal .buildingAjax { | |
| 213 | + background: url('../imgs/carregando.gif') no-repeat; | |
| 214 | + padding: 0px 0px 0px 20px; | |
| 215 | + height: 16px; | |
| 216 | + width: 16px; | |
| 217 | +} | |
| 218 | + | |
| 219 | +.frameprincipal .btnForm { | |
| 220 | + background: #CCCCCC; | |
| 221 | +} | |
| 222 | + | |
| 222 | 223 | .frameprincipal input, textarea { |
| 223 | 224 | text-align: left; |
| 224 | 225 | vertical-align: top; |
| 225 | 226 | } |
| 226 | 227 | |
| 227 | -.frameprincipal .inputFocus { | |
| 228 | - text-align: left; | |
| 229 | - vertical-align: top; | |
| 230 | - background-color: yellow; | |
| 231 | -} | |
| 232 | - | |
| 228 | +.frameprincipal .inputFocus { | |
| 229 | + text-align: left; | |
| 230 | + vertical-align: top; | |
| 231 | + background-color: yellow; | |
| 232 | +} | |
| 233 | + | |
| 233 | 234 | .frameprincipal .inputError { |
| 234 | 235 | text-align: left; |
| 235 | 236 | vertical-align: top; |
| 236 | 237 | border-color: red red red red; |
| 237 | 238 | } |
| 238 | 239 | |
| 239 | -.frameprincipal .hidden { | |
| 240 | - display: none; | |
| 240 | +.frameprincipal .hidden { | |
| 241 | + display: none; | |
| 241 | 242 | } |
| 242 | - | |
| 243 | + | |
| 243 | 244 | .frameprincipal .odd { |
| 244 | 245 | background: #CCCCCC; |
| 245 | 246 | vertical-align: top; |
| 246 | 247 | } |
| 247 | 248 | |
| 248 | -.frameprincipal .even { | |
| 249 | - background: #DBDBDB; | |
| 249 | +.frameprincipal .even { | |
| 250 | + background: #DBDBDB; | |
| 250 | 251 | vertical-align: top; |
| 251 | 252 | } |
| 252 | 253 | |
| ... | ... | @@ -304,6 +305,21 @@ a.dcontexto:hover span |
| 304 | 305 | color: red; |
| 305 | 306 | } |
| 306 | 307 | |
| 308 | +.Chat { | |
| 309 | + padding: 05 22px 10 0px; | |
| 310 | + font-weight: bold; | |
| 311 | + font-size: 12px; | |
| 312 | + color: blue; | |
| 313 | +} | |
| 314 | + | |
| 315 | +.ChatImg{ | |
| 316 | + background: url('../imgs/chat.png') 100% 0 no-repeat; | |
| 317 | + padding: 05 22px 10 0px; | |
| 318 | + font-weight: bold; | |
| 319 | + font-size: 12px; | |
| 320 | + color: blue; | |
| 321 | +} | |
| 322 | + | |
| 307 | 323 | .NoJavaScript { |
| 308 | 324 | font-size: 14px; |
| 309 | 325 | text-align: center; |
| ... | ... | @@ -332,38 +348,38 @@ a.dcontexto:hover span |
| 332 | 348 | font-size: 10px; |
| 333 | 349 | } |
| 334 | 350 | |
| 335 | -.next { | |
| 336 | - background: url('../imgs/next.png') 100% 0 no-repeat; | |
| 337 | - height: 24; | |
| 338 | - width: 20; | |
| 339 | - text-decoration: none; | |
| 340 | -} | |
| 341 | - | |
| 342 | -.prev { | |
| 343 | - background: url('../imgs/prev.png') 100% 0 no-repeat; | |
| 344 | - height: 24; | |
| 345 | - width: 20; | |
| 346 | - text-decoration: none; | |
| 347 | -} | |
| 348 | - | |
| 349 | -.last { | |
| 350 | - background: url('../imgs/last.png') 100% 0 no-repeat; | |
| 351 | - height: 24; | |
| 352 | - width: 20; | |
| 353 | - text-decoration: none; | |
| 354 | -} | |
| 355 | - | |
| 356 | -.first { | |
| 357 | - background: url('../imgs/first.png') 100% 0 no-repeat; | |
| 358 | - height: 24; | |
| 359 | - width: 20; | |
| 360 | - text-decoration: none; | |
| 361 | -} | |
| 362 | -.menu a { | |
| 363 | - font-family: Verdana, Arial, Helvetica, sans-serif; | |
| 364 | - font-style: normal; | |
| 351 | +.next { | |
| 352 | + background: url('../imgs/next.png') 100% 0 no-repeat; | |
| 353 | + height: 24; | |
| 354 | + width: 20; | |
| 355 | + text-decoration: none; | |
| 356 | +} | |
| 357 | + | |
| 358 | +.prev { | |
| 359 | + background: url('../imgs/prev.png') 100% 0 no-repeat; | |
| 360 | + height: 24; | |
| 361 | + width: 20; | |
| 362 | + text-decoration: none; | |
| 363 | +} | |
| 364 | + | |
| 365 | +.last { | |
| 366 | + background: url('../imgs/last.png') 100% 0 no-repeat; | |
| 367 | + height: 24; | |
| 368 | + width: 20; | |
| 369 | + text-decoration: none; | |
| 370 | +} | |
| 371 | + | |
| 372 | +.first { | |
| 373 | + background: url('../imgs/first.png') 100% 0 no-repeat; | |
| 374 | + height: 24; | |
| 375 | + width: 20; | |
| 376 | + text-decoration: none; | |
| 377 | +} | |
| 378 | +.menu a { | |
| 379 | + font-family: Verdana, Arial, Helvetica, sans-serif; | |
| 380 | + font-style: normal; | |
| 365 | 381 | font-weight: normal; |
| 366 | - color: #000000; | |
| 367 | - text-decoration: none; | |
| 368 | - z-index:2; | |
| 369 | -} | |
| 382 | + color: #000000; | |
| 383 | + text-decoration: none; | |
| 384 | + z-index:2; | |
| 385 | +} | ... | ... |
relatorios/antivirus/index.php
| ... | ... | @@ -341,7 +341,9 @@ echo $itens_combo_servidores; ?> |
| 341 | 341 | </tr> |
| 342 | 342 | <tr> |
| 343 | 343 | <td valign="top"> |
| 344 | - <? $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 344 | + <? | |
| 345 | + $cs_situacao = 'T'; | |
| 346 | + $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 345 | 347 | require_once($v_require); |
| 346 | 348 | ?> </td> |
| 347 | 349 | </tr> | ... | ... |
relatorios/compartilhamentos/index.php
| ... | ... | @@ -39,7 +39,8 @@ Com o objetivo de desenvolver um relatorio de pastas compartilhadas. |
| 39 | 39 | <table width="90%" border="0" align="center" cellpadding="5" cellspacing="1"> |
| 40 | 40 | <tr> |
| 41 | 41 | <td valign="top"> |
| 42 | - <? /* require_once($_SERVER['DOCUMENT_ROOT'] . '/cacic2/include/selecao_redes_inc.php'); */ | |
| 42 | + <? /* require_once($_SERVER['DOCUMENT_ROOT'] . '/cacic2/include/selecao_redes_inc.php'); */ | |
| 43 | + $cs_situacao = 'T'; | |
| 43 | 44 | $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); |
| 44 | 45 | require_once($v_require); |
| 45 | 46 | ?> | ... | ... |
relatorios/computador/computador.php
relatorios/hardware/index.php
| ... | ... | @@ -241,7 +241,9 @@ |
| 241 | 241 | ?> |
| 242 | 242 | <tr> |
| 243 | 243 | <td valign="top"> |
| 244 | - <? $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 244 | + <? | |
| 245 | + $cs_situacao = 'T'; | |
| 246 | + $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 245 | 247 | require_once($v_require); |
| 246 | 248 | ?> |
| 247 | 249 | ... | ... |
relatorios/inventario_softwares/index.php
| ... | ... | @@ -211,7 +211,9 @@ require_once('../../include/inicio_relatorios_inc.php'); |
| 211 | 211 | </tr> |
| 212 | 212 | <tr> |
| 213 | 213 | <td valign="top"> |
| 214 | - <? $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 214 | + <? | |
| 215 | + $cs_situacao = 'T'; | |
| 216 | + $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 215 | 217 | require_once($v_require); |
| 216 | 218 | ?> </td> |
| 217 | 219 | </tr> | ... | ... |
relatorios/navegacao.php
| ... | ... | @@ -98,7 +98,7 @@ if ($_REQUEST['p']=='' && $_REQUEST['consultar'] == '') |
| 98 | 98 | |
| 99 | 99 | $query_sel = "SELECT IF(TRIM(redes.nm_rede)='' OR redes.nm_rede is null,'Rede Desconhecida', redes.nm_rede) as nm_rede, |
| 100 | 100 | IF(TRIM(computadores.te_nome_computador)='' OR computadores.te_nome_computador is null,'Computador Desconhecido',computadores.te_nome_computador) as te_nome_computador, |
| 101 | - IF(TRIM(computadores.te_workgroup)='' OR computadores.te_workgroup is null,'Grupo de Trabalho Desconhecido',LOWER(computadores.te_workgroup)) as te_workgroup, | |
| 101 | + IF(TRIM(SUBSTRING_INDEX(computadores.te_workgroup, '@', -1))='' OR computadores.te_workgroup is null,'Grupo de Trabalho Desconhecido',LOWER(SUBSTRING_INDEX(computadores.te_workgroup, '@', -1))) as te_workgroup, | |
| 102 | 102 | computadores.id_ip_rede, |
| 103 | 103 | computadores.te_ip, |
| 104 | 104 | computadores.dt_hr_ult_acesso, |
| ... | ... | @@ -109,12 +109,12 @@ if ($_REQUEST['p']=='' && $_REQUEST['consultar'] == '') |
| 109 | 109 | redes.id_local, |
| 110 | 110 | sg_local, |
| 111 | 111 | nm_local, |
| 112 | - dominios.nm_dominio | |
| 112 | + servidores_autenticacao.nm_servidor_autenticacao | |
| 113 | 113 | FROM computadores |
| 114 | 114 | LEFT JOIN redes ON (computadores.id_ip_rede = redes.id_ip_rede) |
| 115 | 115 | LEFT JOIN compartilhamentos ON (computadores.id_so=compartilhamentos.id_so and computadores.te_node_address=compartilhamentos.te_node_address and compartilhamentos.cs_tipo_compart='I') |
| 116 | 116 | LEFT JOIN locais ON (redes.id_local = locais.id_local) |
| 117 | - LEFT JOIN dominios ON (redes.id_dominio = dominios.id_dominio) | |
| 117 | + LEFT JOIN servidores_autenticacao ON (redes.id_servidor_autenticacao = servidores_autenticacao.id_servidor_autenticacao) | |
| 118 | 118 | WHERE ".$where.$where1." |
| 119 | 119 | GROUP BY sg_local, |
| 120 | 120 | computadores.id_ip_rede, |
| ... | ... | @@ -161,7 +161,7 @@ if ($_REQUEST['p']=='' && $_REQUEST['consultar'] == '') |
| 161 | 161 | $nm_rede = 'SubRede Não Cadastrada'; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - $_SESSION['Tripa'] .= '..' . $row["id_ip_rede"] . ' (' . $nm_rede . ')|'.$row["sg_local"] . ' (' . $row['nm_local'] . ')|'.$row["nm_dominio"].'#'; | |
| 164 | + $_SESSION['Tripa'] .= '..' . $row["id_ip_rede"] . ' (' . $nm_rede . ')|'.$row["sg_local"] . ' (' . $row['nm_local'] . ')|'.$row["nm_servidor_autenticacao"].'#'; | |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | $RedeAnt = $row["id_ip_rede"]; |
| ... | ... | @@ -252,7 +252,7 @@ if ($_REQUEST['p']=='' && $_REQUEST['consultar'] == '') |
| 252 | 252 | $img_totals = $generic_imgs_path . "totals.gif"; |
| 253 | 253 | $img_details = $generic_imgs_path . "details.gif"; |
| 254 | 254 | $img_compart_print = $generic_imgs_path . "compart_print.gif"; |
| 255 | - $img_domain = $generic_imgs_path . "domain.gif"; | |
| 255 | + $img_authentication_server = $generic_imgs_path . "authentication_server.gif"; | |
| 256 | 256 | |
| 257 | 257 | $img_os_win95 = "<B>95</B>"; |
| 258 | 258 | $img_os_win95_osr2 = "<B>95 OSR2</B>"; |
| ... | ... | @@ -343,7 +343,7 @@ if ($_REQUEST['p']=='' && $_REQUEST['consultar'] == '') |
| 343 | 343 | $tree[$cnt][18] = '' ; // Localization name to general use |
| 344 | 344 | $tree[$cnt][19] = '' ; // SubNet name to general use |
| 345 | 345 | $tree[$cnt][20] = '' ; // WorkGroup name to general use |
| 346 | - $tree[$cnt][21] = '' ; // Domain Name | |
| 346 | + $tree[$cnt][21] = '' ; // Authentication Server Name | |
| 347 | 347 | |
| 348 | 348 | |
| 349 | 349 | if ($tree[$cnt][0] > $maxlevel) $maxlevel=$tree[$cnt][0]; |
| ... | ... | @@ -727,13 +727,13 @@ if ($_REQUEST['p']=='' && $_REQUEST['consultar'] == '') |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | // Atenção: foi necessário usar a condição "id_grupo_usuarios" abaixo devido ao "cs_nivel_administracao" == 0 |
| 730 | - if ($tree[$cnt][0]==2) | |
| 730 | + if ($tree[$cnt][0]==2 && ($_SESSION["cs_nivel_administracao"] <> 0 || $_SESSION["id_grupo_usuarios"] == 7)) | |
| 731 | 731 | { |
| 732 | 732 | if ($_SESSION["cs_nivel_administracao"] <> 0 || $_SESSION["id_grupo_usuarios"] == 7) |
| 733 | 733 | echo "<a href=../admin/redes/detalhes_rede.php?id_ip_rede=".$tree[$cnt][6]."&id_local=".$tree[$cnt][17]." target='_blank'><img src=\"".$img_details."\" border=no width=16 height=16 Title='Detalhes da SubRede'></a>"; |
| 734 | 734 | |
| 735 | 735 | if ($tree[$cnt][21]) |
| 736 | - echo "<img src=\"".$img_domain."\" border=no width=16 height=16 Title='Sub-Rede Associada ao Domínio \"".$tree[$cnt][21]."\"'>"; | |
| 736 | + echo "<img src=\"".$img_authentication_server."\" border=no width=16 height=16 Title='Sub-Rede Associada ao Servidor de Autenticação \"".$tree[$cnt][21]."\"'>"; | |
| 737 | 737 | } |
| 738 | 738 | |
| 739 | 739 | } | ... | ... |
relatorios/software/index.php
| ... | ... | @@ -236,7 +236,9 @@ require_once('../../include/inicio_relatorios_inc.php'); |
| 236 | 236 | */?> |
| 237 | 237 | <tr> |
| 238 | 238 | <td valign="top"> |
| 239 | - <? $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 239 | + <? | |
| 240 | + $cs_situacao = 'T'; | |
| 241 | + $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 240 | 242 | require_once($v_require); |
| 241 | 243 | ?> |
| 242 | 244 | ... | ... |
relatorios/variaveis_ambiente/index.php
| ... | ... | @@ -211,7 +211,9 @@ else { // Inserir regras para outras verificações (ex: permissões do usuário)! |
| 211 | 211 | </tr> |
| 212 | 212 | <tr> |
| 213 | 213 | <td valign="top"> |
| 214 | - <? $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 214 | + <? | |
| 215 | + $cs_situacao = 'T'; | |
| 216 | + $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); | |
| 215 | 217 | require_once($v_require); |
| 216 | 218 | ?> |
| 217 | 219 | ... | ... |
ws/srcacic_auth_client.php
| ... | ... | @@ -20,6 +20,26 @@ |
| 20 | 20 | */ |
| 21 | 21 | require_once('../include/library.php'); |
| 22 | 22 | |
| 23 | +function insereNovoSO($te_so_new) | |
| 24 | + { | |
| 25 | + conecta_bd_cacic(); | |
| 26 | + | |
| 27 | + // Busco o último valor do Identificador Externo caso não tenha recebido valor para o ID Externo | |
| 28 | + $querySEL = 'SELECT max(id_so) as MaxIdSo | |
| 29 | + FROM so'; | |
| 30 | + $resultSEL = mysql_query($querySEL); | |
| 31 | + $rowSEL = mysql_fetch_array($resultSEL); | |
| 32 | + $id_so = ($rowSEL['MaxIdSo']+1); | |
| 33 | + | |
| 34 | + // Insiro a informação na tabela de Sistemas Operacionais incrementando o Identificador Externo | |
| 35 | + $queryINS = 'INSERT | |
| 36 | + INTO so(id_so,te_desc_so,sg_so,te_so) | |
| 37 | + VALUES ('.$id_so.',"S.O. a Cadastrar","Sigla a Cadastrar","'.$te_so_new.'")'; | |
| 38 | + | |
| 39 | + $resultINS = mysql_query($queryINS); | |
| 40 | + return $id_so; | |
| 41 | + } | |
| 42 | + | |
| 23 | 43 | // Definição do nível de compressão (Default = 9 => máximo) |
| 24 | 44 | //$v_compress_level = 9; |
| 25 | 45 | $v_compress_level = 0; // Mantido em 0(zero) para desabilitar a Compressão/Decompressão |
| ... | ... | @@ -36,7 +56,6 @@ $v_cs_cipher = '1'; |
| 36 | 56 | $strPaddingKey = ''; |
| 37 | 57 | |
| 38 | 58 | |
| 39 | -GravaTESTES('AuthClient: Valores Recebidos:'); | |
| 40 | 59 | foreach($HTTP_POST_VARS as $i => $v) |
| 41 | 60 | GravaTESTES('AuthClient: POST => '.$i.' => '.$v.' => '.DeCrypt($key,$iv,$v,$v_cs_cipher,$v_cs_compress,$strPaddingKey)); |
| 42 | 61 | |
| ... | ... | @@ -50,17 +69,11 @@ GravaTESTES(''); |
| 50 | 69 | $te_node_address = DeCrypt($key,$iv,$_POST['te_node_address'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 51 | 70 | $te_so = DeCrypt($key,$iv,$_POST['te_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 52 | 71 | |
| 53 | -//$te_node_address_visitante = DeCrypt($key,$iv,$_POST['te_node_address_visitante'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 54 | -$te_so_visitante = DeCrypt($key,$iv,$_POST['te_so_visitante'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 72 | +//$te_node_address_cli = DeCrypt($key,$iv,$_POST['te_node_address_cli'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 73 | +$te_so_cli = DeCrypt($key,$iv,$_POST['te_so_cli'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 55 | 74 | $te_palavra_chave = DeCrypt($key,$iv,urldecode($_POST['te_palavra_chave']) ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 56 | 75 | |
| 57 | 76 | |
| 58 | -/* | |
| 59 | -GravaTESTES('AuthClient: te_node_address => '.$te_node_address); | |
| 60 | -GravaTESTES('AuthClient: te_so => '.$te_so); | |
| 61 | -GravaTESTES('AuthClient: te_node_address_visitante => '.$te_node_address_visitante); | |
| 62 | -GravaTESTES('AuthClient: te_so_visitante => '.$te_so_visitante); | |
| 63 | -*/ | |
| 64 | 77 | |
| 65 | 78 | // ATENÇÃO: Apenas retornará um ARRAY contendo "id_so" e "te_so". |
| 66 | 79 | $arrSO = inclui_computador_caso_nao_exista( $te_node_address, |
| ... | ... | @@ -84,68 +97,76 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 84 | 97 | // GravaTESTES('AuthClient: Palavra-Chave OK!'); |
| 85 | 98 | conecta_bd_cacic(); |
| 86 | 99 | |
| 87 | - if ($_POST['nm_usuario_visitante'] && $_POST['te_senha_visitante']) | |
| 100 | + if ($_POST['nm_usuario_cli'] && $_POST['te_senha_cli']) | |
| 88 | 101 | { |
| 89 | - $nm_usuario_visitante = DeCrypt($key,$iv,$_POST['nm_usuario_visitante'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 90 | - $te_senha_visitante = DeCrypt($key,$iv,$_POST['te_senha_visitante'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 91 | - /* | |
| 92 | - GravaTESTES('AuthClient: nm_usuario_visitante => '.$nm_usuario_visitante); | |
| 93 | - GravaTESTES('AuthClient: te_senha_visitante => '.$te_senha_visitante); | |
| 94 | - */ | |
| 102 | + $nm_usuario_cli = DeCrypt($key,$iv,$_POST['nm_usuario_cli'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 103 | + $te_senha_cli = DeCrypt($key,$iv,$_POST['te_senha_cli'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 95 | 104 | |
| 96 | 105 | // Autentico o usuário técnico, verificando nome, senha e local |
| 97 | 106 | $arrUsuarios = getValores('usuarios','id_usuario, |
| 98 | 107 | nm_usuario_completo, |
| 99 | 108 | id_local, |
| 100 | 109 | te_locais_secundarios, |
| 101 | - te_emails_contato','nm_usuario_acesso = "'.$nm_usuario_visitante.'" AND | |
| 102 | - te_senha = PASSWORD("'.$te_senha_visitante.'")'); | |
| 110 | + te_emails_contato','nm_usuario_acesso = "'.$nm_usuario_cli.'" AND | |
| 111 | + te_senha = PASSWORD("'.$te_senha_cli.'")'); | |
| 103 | 112 | if ($arrUsuarios['id_usuario']<>'') |
| 104 | 113 | { |
| 105 | - $boolIdLocal = stripos2($arrUsuarios['te_locais_secundarios'],$arrComputadores['id_local'],false); | |
| 106 | - /* | |
| 107 | - GravaTESTES('AuthClient: boolIdLocal => '.$boolIdLocal); | |
| 108 | - GravaTESTES('AuthClient: arrComputadores[id_local] => '.$arrComputadores['id_local']); GravaTESTES('AuthClient: arrUsuarios[id_local] => '.$arrUsuarios['id_local']); */ | |
| 114 | + $boolIdLocal = stripos2(trim($arrUsuarios['te_locais_secundarios']),$arrComputadores['id_local'],false); | |
| 115 | + | |
| 109 | 116 | if ($arrUsuarios['id_local'] == $arrComputadores['id_local'] || $boolIdLocal) |
| 110 | 117 | { |
| 111 | 118 | $id_sessao = DeCrypt($key,$iv,$_POST['id_sessao'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 112 | - $id_usuario_visitante = $arrUsuarios['id_usuario']; | |
| 119 | + $id_usuario_cli = $arrUsuarios['id_usuario']; | |
| 113 | 120 | $te_motivo_conexao = DeCrypt($key,$iv,$_POST['te_motivo_conexao'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 114 | - $te_documento_referencial = DeCrypt($key,$iv,$_POST['te_documento_referencial'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 115 | - | |
| 116 | - $dt_hr_autenticacao = date('Y-m-d H:i:s'); | |
| 121 | + $te_documento_referencial = DeCrypt($key,$iv,$_POST['te_documento_referencial'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 117 | 122 | |
| 123 | + $dt_hr_autenticacao = date('Y-m-d H:i:s'); | |
| 124 | + GravaTESTES('AuthClient: dt_hr_autenticacao => '.$dt_hr_autenticacao); | |
| 125 | + $dt_hr_inicio_sessao = date('d-m-Y') . ' às ' . date('H:i') . 'h'; | |
| 126 | + GravaTESTES('AuthClient: dt_hr_inicio_sessao => '.$dt_hr_inicio_sessao); | |
| 118 | 127 | // Identifico o SO da máquina visitante |
| 119 | - $arrIdSO = getValores('so','id_so','trim(te_so) = "'.trim($te_so_visitante).'"'); | |
| 128 | + $arrIdSO = getValores('so','id_so','trim(te_so) = "'.trim($te_so_cli).'"'); | |
| 120 | 129 | |
| 121 | - $id_so_visitante = $arrIdSO['id_so']; | |
| 122 | - GravaTESTES('AuthClient: id_so_visitante => '.$id_so_visitante); | |
| 130 | + $id_so_cli = $arrIdSO['id_so']; | |
| 131 | + GravaTESTES('AuthClient: id_so_cli => '.$id_so_cli); | |
| 123 | 132 | |
| 124 | - if ($id_so_visitante == '') | |
| 125 | - $id_so_visitante = insereNovoSO($te_so_visitante); | |
| 133 | + if ($id_so_cli == '') | |
| 134 | + $id_so_cli = insereNovoSO($te_so_cli); | |
| 126 | 135 | |
| 127 | - $query_SESSAO = "INSERT INTO srcacic_sessoes_logs | |
| 136 | + $query_SESSAO = "INSERT INTO srcacic_conexoes | |
| 128 | 137 | (id_sessao, |
| 129 | - id_usuario_visitante, | |
| 138 | + id_usuario_cli, | |
| 130 | 139 | te_documento_referencial, |
| 131 | 140 | te_motivo_conexao, |
| 132 | 141 | dt_hr_ultimo_contato, |
| 133 | - dt_hr_conexao, | |
| 134 | - id_so_visitante) | |
| 142 | + dt_hr_inicio_conexao, | |
| 143 | + id_so_cli) | |
| 135 | 144 | VALUES (" . $id_sessao . ", |
| 136 | - " . $id_usuario_visitante . ", | |
| 145 | + " . $id_usuario_cli . ", | |
| 137 | 146 | '" . $te_documento_referencial . "', |
| 138 | 147 | '" . $te_motivo_conexao . "', |
| 139 | 148 | '" . $dt_hr_autenticacao . "', |
| 140 | 149 | '" . $dt_hr_autenticacao . "', |
| 141 | - " . $id_so_visitante .")"; | |
| 142 | - $result_SESSAO = mysql_query($query_SESSAO); | |
| 150 | + " . $id_so_cli .")"; | |
| 151 | + $result_SESSAO = mysql_query($query_SESSAO); | |
| 152 | + | |
| 153 | + $query_CONEXAO = "SELECT id_conexao | |
| 154 | + FROM srcacic_conexoes | |
| 155 | + WHERE id_sessao = ". $id_sessao . " AND | |
| 156 | + id_usuario_cli = ".$id_usuario_cli . " AND | |
| 157 | + dt_hr_inicio_conexao = '".$dt_hr_autenticacao . "'"; | |
| 158 | + $result_CONEXAO = mysql_query($query_CONEXAO); | |
| 159 | + $row_CONEXAO = mysql_fetch_array($result_CONEXAO); | |
| 160 | + | |
| 143 | 161 | |
| 144 | 162 | GravaTESTES('AuthClient: query_SESSAO => '.$query_SESSAO); |
| 145 | 163 | |
| 146 | - $retorno_xml_values = '<STATUS>'.EnCrypt($key,$iv,'OK',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</STATUS>'.$retorno_xml_values; | |
| 147 | - $retorno_xml_values .= '<ID_USUARIO_VISITANTE>'.str_ireplace('+','<MAIS>',EnCrypt($key,$iv,$arrUsuarios['id_usuario'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey),$countMAIS).'</ID_USUARIO_VISITANTE>'; | |
| 148 | - $retorno_xml_values .= '<NM_USUARIO_COMPLETO>'.EnCrypt($key,$iv,$arrUsuarios['nm_usuario_completo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</NM_USUARIO_COMPLETO>'; | |
| 164 | + $retorno_xml_values = '<STATUS>' .EnCrypt($key,$iv,'OK',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) .'</STATUS>'; | |
| 165 | + $retorno_xml_values .= '<ID_USUARIO_CLI>' .EnCrypt($key,$iv,trim($arrUsuarios['id_usuario']),$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) .'</ID_USUARIO_CLI>'; | |
| 166 | + $retorno_xml_values .= '<NM_USUARIO_COMPLETO>' .EnCrypt($key,$iv,trim($arrUsuarios['nm_usuario_completo']),$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) .'</NM_USUARIO_COMPLETO>'; | |
| 167 | + $retorno_xml_values .= '<DT_HR_INICIO_SESSAO>' .EnCrypt($key,$iv,$dt_hr_inicio_sessao ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) .'</DT_HR_INICIO_SESSAO>'; | |
| 168 | + $retorno_xml_values .= '<ID_CONEXAO>' .EnCrypt($key,$iv,$row_CONEXAO['id_conexao'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) .'</ID_CONEXAO>'; | |
| 169 | + | |
| 149 | 170 | if ($arrUsuarios['te_emails_contato'] <> '') |
| 150 | 171 | { |
| 151 | 172 | $strTeNomeComputador = $arrComputadores['te_nome_computador']; |
| ... | ... | @@ -153,7 +174,7 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 153 | 174 | |
| 154 | 175 | // Envio e-mail informando da abertura de sessão |
| 155 | 176 | $corpo_mail = "Prezado usuário(a) ".$arrUsuarios['nm_usuario_completo'].",\n\n |
| 156 | - informamos que foi realizada autenticação de acesso para Suporte Remoto Seguro à estação '".$strTeNomeComputador."' (IP: ".$strTeIp.") através do Sistema CACIC em ".$dt_hr_inicio_sessao . " a partir de seu usuário '".$nm_usuario_visitante.", cadastrado no www-cacic.'\n\n\n\n | |
| 177 | + informamos que foi realizada autenticação de acesso para Suporte Remoto Seguro à estação '".$strTeNomeComputador."' (IP: ".$strTeIp.") através do Sistema CACIC em ".$dt_hr_inicio_sessao . " a partir de seu usuário '".$nm_usuario_cli.", cadastrado no www-cacic.'\n\n\n\n | |
| 157 | 178 | _______________________________________________________________________ |
| 158 | 179 | CACIC - Configurador Automático e Coletor de Informações Computacionais\n |
| 159 | 180 | srCACIC - Módulo para Suporte Remoto Seguro do Sistema CACIC\n |
| ... | ... | @@ -172,27 +193,6 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 172 | 193 | } |
| 173 | 194 | |
| 174 | 195 | $retorno_xml = $retorno_xml_header . $retorno_xml_values; |
| 175 | -GravaTESTES('AuthClient XML: '.$retorno_xml); | |
| 176 | -echo $retorno_xml; | |
| 177 | - | |
| 178 | -function insereNovoSO($te_so_new) | |
| 179 | - { | |
| 180 | - conecta_bd_cacic(); | |
| 181 | - | |
| 182 | - // Busco o último valor do Identificador Externo caso não tenha recebido valor para o ID Externo | |
| 183 | - $querySEL = 'SELECT max(id_so) as MaxIdSo | |
| 184 | - FROM so'; | |
| 185 | - $resultSEL = mysql_query($querySEL); | |
| 186 | - $rowSEL = mysql_fetch_array($resultSEL); | |
| 187 | - $id_so = ($rowSEL['MaxIdSo']+1); | |
| 188 | - | |
| 189 | - // Insiro a informação na tabela de Sistemas Operacionais incrementando o Identificador Externo | |
| 190 | - $queryINS = 'INSERT | |
| 191 | - INTO so(id_so,te_desc_so,sg_so,te_so) | |
| 192 | - VALUES ('.$id_so.',"S.O. a Cadastrar","Sigla a Cadastrar","'.$te_so_new.'")'; | |
| 193 | - | |
| 194 | - $resultINS = mysql_query($queryINS); | |
| 195 | - return $id_so; | |
| 196 | - } | |
| 197 | 196 | |
| 197 | +echo $retorno_xml; | |
| 198 | 198 | ?> | ... | ... |
ws/srcacic_set_session.php
| ... | ... | @@ -18,9 +18,51 @@ |
| 18 | 18 | Esse script tem como objetivo enviar ao servidor de suporte remoto na estação as configurações (em XML) que são específicas para a |
| 19 | 19 | estação em questão. São levados em consideração a rede do agente, sistema operacional e Mac-Address. |
| 20 | 20 | */ |
| 21 | - | |
| 22 | 21 | require_once('../include/library.php'); |
| 23 | 22 | |
| 23 | +function criaSessao($p_dt_hr_inicio_sessao, | |
| 24 | + $p_nm_nome_acesso_autenticacao, | |
| 25 | + $p_nm_nome_completo, | |
| 26 | + $p_te_email, | |
| 27 | + $p_te_node_address, | |
| 28 | + $p_id_so) | |
| 29 | + { | |
| 30 | + if ($p_te_email <> '') | |
| 31 | + { | |
| 32 | + // Envio e-mail informando da abertura de sessão | |
| 33 | + $corpo_mail = "Prezado usuário(a) ".$p_nm_nome_completo.",\n\n | |
| 34 | + informamos que foi iniciada uma sessão para Suporte Remoto Seguro através do Sistema CACIC em ".$p_dt_hr_inicio_sessao . "\n\n\n\n | |
| 35 | + _______________________________________________________________________ | |
| 36 | + CACIC - Configurador Automático e Coletor de Informações Computacionais\n | |
| 37 | + srCACIC - Módulo para Suporte Remoto Seguro do Sistema CACIC\n | |
| 38 | + Desenvolvido pela Dataprev - Unidade Regional Espírito Santo"; | |
| 39 | + | |
| 40 | + //GravaTESTES('SetSession: Enviando Email...'); | |
| 41 | + // Manda mail para os administradores. | |
| 42 | + //mail("$p_te_email", "Sistema CACIC - Módulo srCACIC - Abertura de Sessão para Suporte Remoto Seguro", "$corpo_mail", "From: cacic@{$_SERVER['SERVER_NAME']}"); | |
| 43 | + } | |
| 44 | + | |
| 45 | + conecta_bd_cacic(); | |
| 46 | + | |
| 47 | + $query_SESSAO = "INSERT INTO srcacic_sessoes | |
| 48 | + ( dt_hr_inicio_sessao, | |
| 49 | + nm_acesso_usuario_srv, | |
| 50 | + nm_completo_usuario_srv, | |
| 51 | + te_email_usuario_srv, | |
| 52 | + te_node_address_srv, | |
| 53 | + id_so_srv, | |
| 54 | + dt_hr_ultimo_contato) | |
| 55 | + VALUES ('" . $p_dt_hr_inicio_sessao . "', | |
| 56 | + '" . $p_nm_nome_acesso_autenticacao . "', | |
| 57 | + '" . $p_nm_nome_completo . "', | |
| 58 | + '" . $p_te_email . "', | |
| 59 | + '" . $p_te_node_address . "', | |
| 60 | + '" . $p_id_so . "', | |
| 61 | + '" . $p_dt_hr_inicio_sessao . "')"; | |
| 62 | + GravaTESTES('SetSession: query_SESSAO: '.$query_SESSAO); | |
| 63 | + $result_SESSAO = mysql_query($query_SESSAO); | |
| 64 | + } | |
| 65 | + | |
| 24 | 66 | // Definição do nível de compressão (Default = 9 => máximo) |
| 25 | 67 | //$v_compress_level = 9; |
| 26 | 68 | $v_compress_level = 0; // Mantido em 0(zero) para desabilitar a Compressão/Decompressão |
| ... | ... | @@ -39,7 +81,7 @@ $v_cs_cipher = '1'; |
| 39 | 81 | $strPaddingKey = ''; |
| 40 | 82 | |
| 41 | 83 | //LimpaTESTES(); |
| 42 | -GravaTESTES('SetSession: Valores Recebidos:'); | |
| 84 | +GravaTESTES('***** setSession *****'); | |
| 43 | 85 | foreach($HTTP_POST_VARS as $i => $v) |
| 44 | 86 | GravaTESTES('SetSession: POST => '.$i.' => '.$v.' => '.DeCrypt($key,$iv,$v,$v_cs_cipher,$v_cs_compress,$strPaddingKey)); |
| 45 | 87 | |
| ... | ... | @@ -48,9 +90,10 @@ foreach($HTTP_GET_VARS as $i => $v) |
| 48 | 90 | |
| 49 | 91 | GravaTESTES(''); |
| 50 | 92 | // Autenticação da Estação Visitada |
| 51 | -$te_node_address = DeCrypt($key,$iv,$_POST['te_node_address'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 52 | -$te_so = DeCrypt($key,$iv,$_POST['te_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 93 | +$te_node_address = DeCrypt($key,$iv,$_POST['te_node_address'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 94 | +$te_so = DeCrypt($key,$iv,$_POST['te_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 53 | 95 | $te_palavra_chave = DeCrypt($key,$iv,urldecode($_POST['te_palavra_chave']) ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 96 | +$id_sessao = DeCrypt($key,$iv,$_POST['id_sessao'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 54 | 97 | |
| 55 | 98 | // ATENÇÃO: Apenas retornará um ARRAY contendo "id_so" e "te_so". |
| 56 | 99 | $arrSO = inclui_computador_caso_nao_exista( $te_node_address, |
| ... | ... | @@ -73,7 +116,7 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 73 | 116 | //GravaTESTES('SetSession: Palavra-Chave OK!'); |
| 74 | 117 | conecta_bd_cacic(); |
| 75 | 118 | |
| 76 | - if (!$_POST['id_sessao']) | |
| 119 | + if (!$id_sessao) | |
| 77 | 120 | { |
| 78 | 121 | // Identificador para Autenticação no Servidor de Autenticação |
| 79 | 122 | $id_servidor_autenticacao = DeCrypt($key,$iv,$_POST['id_servidor_autenticacao'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| ... | ... | @@ -127,20 +170,21 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 127 | 170 | $ldap = ldap_connect($te_host,389); |
| 128 | 171 | |
| 129 | 172 | ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $arrServidores['nu_versao_protocolo']); |
| 130 | - //GravaTESTES('SetSession: Após SET_OPTION => '.ldap_error($ldap)); | |
| 173 | + GravaTESTES('SetSession: Após SET_OPTION => '.ldap_error($ldap)); | |
| 131 | 174 | |
| 132 | 175 | //ldap_start_tls($ldap); |
| 133 | 176 | |
| 134 | 177 | if (ldap_errno($ldap) == 0) |
| 135 | 178 | { |
| 136 | - //GravaTESTES('SetSession: Tentando BIND Identificado com "'.$nm_nome_acesso_autenticacao.' / **********"'); | |
| 179 | + GravaTESTES('SetSession: Tentando BIND Identificado com "'.$nm_nome_acesso_autenticacao.' / **********"'); | |
| 137 | 180 | |
| 138 | 181 | $bindTesteAnonimo=ldap_bind($ldap); // this is an "anonymous" bind, typically |
| 139 | 182 | // read-only access |
| 140 | - //GravaTESTES("Bind Anônimo retornou " . $bindTesteAnonimo); | |
| 183 | + GravaTESTES("Bind Anônimo retornou " . $bindTesteAnonimo); | |
| 141 | 184 | |
| 142 | 185 | //ob_start(); |
| 143 | 186 | $strBind = $arrServidores['te_atributo_identificador'].'='.$nm_nome_acesso_autenticacao.','.$arrServidores['te_base_consulta_folha'].','.$arrServidores['te_base_consulta_raiz']; |
| 187 | + GravaTESTES('SetSession: strBind => "'.$strBind); | |
| 144 | 188 | $bind = ldap_bind($ldap, "$strBind", $te_senha_acesso_autenticacao); |
| 145 | 189 | //ob_end_flush(); |
| 146 | 190 | |
| ... | ... | @@ -148,10 +192,10 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 148 | 192 | { |
| 149 | 193 | $strRootDN = $arrServidores['te_base_consulta_raiz']; |
| 150 | 194 | $strNodeDN = $arrServidores['te_base_consulta_folha']; |
| 151 | - //GravaTESTES('SetSession: Preparando Search : '.'"'.$strNodeDN.','.$strRootDN.'" / '.'"'.$arrDominios['te_atributo_identificador'].'='.$nm_nome_acesso_dominio.'"'); | |
| 195 | + GravaTESTES('SetSession: Preparando Search : '.'"'.$strNodeDN.','.$strRootDN.'" / '.'"'.$arrDominios['te_atributo_identificador'].'='.$nm_nome_acesso_dominio.'"'); | |
| 152 | 196 | $searchResults = ldap_search($ldap, "$strNodeDN,$strRootDN",$arrServidores['te_atributo_identificador'].'='.$nm_nome_acesso_autenticacao); |
| 153 | 197 | |
| 154 | - //GravaTESTES('SetSession: Após SEARCH => '.ldap_error($ldap)); | |
| 198 | + GravaTESTES('SetSession: Após SEARCH => '.ldap_error($ldap)); | |
| 155 | 199 | // OK! Dados encontrados! |
| 156 | 200 | if (!$searchResults === false) |
| 157 | 201 | { |
| ... | ... | @@ -166,11 +210,11 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 166 | 210 | } |
| 167 | 211 | } |
| 168 | 212 | |
| 169 | - //GravaTESTES('SetSession: Após GET_ENTRIES => '.ldap_error($ldap)); | |
| 213 | + GravaTESTES('SetSession: Após GET_ENTRIES => '.ldap_error($ldap)); | |
| 170 | 214 | $nm_nome_completo = $arrLDAPdata[strtolower($arrServidores['te_atributo_retorna_nome'])]; |
| 171 | 215 | $te_email = $arrLDAPdata[strtolower($arrServidores['te_atributo_retorna_email'])]; |
| 172 | - //GravaTESTES('SetSession: Após GET_ENTRIES => nm_nome_completo: '.$nm_nome_completo); | |
| 173 | - //GravaTESTES('SetSession: Após GET_ENTRIES => te_email: '.$te_email); | |
| 216 | + GravaTESTES('SetSession: Após GET_ENTRIES => nm_nome_completo: '.$nm_nome_completo); | |
| 217 | + GravaTESTES('SetSession: Após GET_ENTRIES => te_email: '.$te_email); | |
| 174 | 218 | |
| 175 | 219 | if ($nm_nome_completo <> '') |
| 176 | 220 | criaSessao($dt_hr_inicio_sessao, |
| ... | ... | @@ -187,8 +231,8 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 187 | 231 | if ($nm_nome_completo <> '') |
| 188 | 232 | { |
| 189 | 233 | $arrSessoes = getValores('srcacic_sessoes','id_sessao','dt_hr_inicio_sessao="'.$dt_hr_inicio_sessao.'" AND |
| 190 | - te_node_address_visitado="'.$te_node_address.'" AND | |
| 191 | - id_so_visitado = "'.$arrSO['id_so'].'"'); | |
| 234 | + te_node_address_srv="'.$te_node_address.'" AND | |
| 235 | + id_so_srv = "'.$arrSO['id_so'].'"'); | |
| 192 | 236 | |
| 193 | 237 | $arrConfiguracoesLocais = getValores('configuracoes_locais','nu_timeout_srcacic','id_local = '.$arrRedes['id_local']); |
| 194 | 238 | |
| ... | ... | @@ -199,44 +243,61 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 199 | 243 | } |
| 200 | 244 | else |
| 201 | 245 | { |
| 202 | - $id_sessao = DeCrypt($key,$iv,$_POST['id_sessao'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 203 | - | |
| 204 | 246 | $query_SESSAO = "UPDATE srcacic_sessoes |
| 205 | 247 | SET dt_hr_ultimo_contato = '".date('Y-m-d H:i:s')."' |
| 206 | 248 | WHERE id_sessao = ".$id_sessao; |
| 207 | 249 | $result_SESSAO = mysql_query($query_SESSAO); |
| 208 | 250 | |
| 209 | - $arr_id_usuario_visitante = explode('<REG>',DeCrypt($key,$iv,$_POST['id_usuario_visitante'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)); | |
| 210 | - $arr_te_so_visitante = explode('<REG>',DeCrypt($key,$iv,$_POST['te_so_visitante'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey)); | |
| 211 | - | |
| 212 | - GravaTESTES('POST_id_usuario_visitante: '.DeCrypt($key,$iv,$_POST['id_usuario_visitante'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)); | |
| 213 | - GravaTESTES('Tamanho de arr_id_usuario_visitante: '.count($arr_id_usuario_visitante)); | |
| 214 | - | |
| 215 | - for ($i=0; $i < count($arr_id_usuario_visitante); $i++) | |
| 251 | + GravaTESTES('SetSession: POST_te_mensagem: '.$_POST['te_mensagem']); | |
| 252 | + if ($_POST['te_mensagem']<>'') | |
| 216 | 253 | { |
| 217 | - $te_so_visitante = $arr_te_so_visitante[$i]; | |
| 218 | - $arr_id_so_visitante = getValores('so','id_so','trim(te_so)="'.trim($te_so_visitante).'"'); | |
| 219 | - | |
| 220 | - /* | |
| 221 | - E se o tecnico utilizar um notebook externo ao parque computacional da corporacao? | |
| 222 | - Nao insiro a maquina do visitante... | |
| 223 | - */ | |
| 254 | + $id_conexao = DeCrypt($key,$iv,$_POST['id_conexao'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 255 | + $te_mensagem = DeCrypt($key,$iv,$_POST['te_mensagem'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 256 | + $cs_origem = DeCrypt($key,$iv,$_POST['cs_origem'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 224 | 257 | |
| 225 | - $query_SESSAO = "UPDATE srcacic_sessoes_logs | |
| 226 | - SET dt_hr_ultimo_contato = '".date('Y-m-d H:i:s')."' | |
| 227 | - WHERE id_sessao = ".$id_sessao." and | |
| 228 | - id_usuario_visitante = ".$arr_id_usuario_visitante[$i]." AND | |
| 229 | - id_so_visitante = ".$arr_id_so_visitante['id_so'] ; | |
| 230 | -/*." and | |
| 231 | - te_node_address_visitante = '".$te_node_address_visitante."' and | |
| 232 | - id_so_visitante = ".$arrSO_visitante['id_so']; */ | |
| 258 | + $query_CHAT = "INSERT INTO srcacic_chats(id_conexao,dt_hr_mensagem,te_mensagem,cs_origem) | |
| 259 | + VALUES (".$id_conexao.",'".date('Y-m-d H:i:s')."','".$te_mensagem."','".$cs_origem."')"; | |
| 260 | + GravaTESTES('SetSession: Gravando CHAT: '.$query_CHAT); | |
| 261 | + $result_CHAT = mysql_query($query_CHAT); | |
| 262 | + | |
| 263 | + } | |
| 264 | + else | |
| 265 | + { | |
| 233 | 266 | |
| 234 | - GravaTESTES('SetSession: POST[id_sessao] => '.$_POST['id_sessao']); | |
| 235 | - GravaTESTES('SetSession: id_sessao => '.$id_sessao); | |
| 236 | - GravaTESTES('SetSession: query_SESSAO => '.$query_SESSAO); | |
| 267 | + $arr_id_usuario_cli = explode('<REG>',DeCrypt($key,$iv,$_POST['id_usuario_cli'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey)); | |
| 268 | + $arr_id_conexao = explode('<REG>',DeCrypt($key,$iv,$_POST['id_conexao'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey)); | |
| 269 | + $arr_te_so_cli = explode('<REG>',DeCrypt($key,$iv,$_POST['te_so_cli'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey)); | |
| 237 | 270 | |
| 238 | - $result_SESSAO = mysql_query($query_SESSAO); | |
| 271 | + GravaTESTES('SetSession: POST_id_usuario_cli: '.DeCrypt($key,$iv,$_POST['id_usuario_cli'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)); | |
| 272 | + GravaTESTES('SetSession: Tamanho de arr_id_usuario_cli: '.count($arr_id_usuario_cli)); | |
| 239 | 273 | |
| 274 | + for ($i=0; $i < count($arr_id_usuario_cli); $i++) | |
| 275 | + { | |
| 276 | + $te_so_cli = $arr_te_so_cli[$i]; | |
| 277 | + $id_conexao = $arr_id_conexao[$i]; | |
| 278 | + $arr_id_so_cli = getValores('so','id_so','trim(te_so)="'.trim($te_so_cli).'"'); | |
| 279 | + | |
| 280 | + /* | |
| 281 | + E se o tecnico utilizar um notebook externo ao parque computacional da corporacao? | |
| 282 | + Nao insiro a maquina do visitante... | |
| 283 | + */ | |
| 284 | + | |
| 285 | + $query_SESSAO = "UPDATE srcacic_conexoes | |
| 286 | + SET dt_hr_ultimo_contato = '".date('Y-m-d H:i:s')."' | |
| 287 | + WHERE id_sessao = ".$id_sessao ." and | |
| 288 | + id_conexao = ".$id_conexao; | |
| 289 | + /*." and | |
| 290 | + te_node_address_cli = '".$te_node_address_cli."' and | |
| 291 | + id_so_cli = ".$arrSO_cli['id_so']; */ | |
| 292 | + | |
| 293 | + GravaTESTES('SetSession: POST[id_sessao] => '.$_POST['id_sessao']); | |
| 294 | + GravaTESTES('SetSession: POST[id_conexao] => '.$_POST['id_conexao']); | |
| 295 | + GravaTESTES('SetSession: id_sessao => '.$id_sessao); | |
| 296 | + GravaTESTES('SetSession: id_conexao => '.$id_conexao); | |
| 297 | + GravaTESTES('SetSession: query_SESSAO => '.$query_SESSAO); | |
| 298 | + | |
| 299 | + $result_SESSAO = mysql_query($query_SESSAO); | |
| 300 | + } | |
| 240 | 301 | } |
| 241 | 302 | |
| 242 | 303 | $retorno_xml_values .= '<OK>'.EnCrypt($key,$iv,'OK',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</OK>'; |
| ... | ... | @@ -247,52 +308,8 @@ if ($retorno_xml_values <> '') |
| 247 | 308 | $retorno_xml_values = '<STATUS>'.EnCrypt($key,$iv,'OK',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</STATUS>'.$retorno_xml_values; |
| 248 | 309 | else |
| 249 | 310 | $retorno_xml_values = '<STATUS>'.EnCrypt($key,$iv,'SetSession ERRO! '.ldap_error($ldap),$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</STATUS>'; |
| 250 | -//GravaTESTES($retorno_xml_values); | |
| 251 | -$retorno_xml = $retorno_xml_header . $retorno_xml_values; | |
| 252 | 311 | |
| 312 | +$retorno_xml = $retorno_xml_header . $retorno_xml_values; | |
| 313 | +GravaTESTES('Retorno setSession: '.$retorno_xml); | |
| 253 | 314 | echo $retorno_xml; |
| 254 | - | |
| 255 | -function criaSessao($p_dt_hr_inicio_sessao, | |
| 256 | - $p_nm_nome_acesso_autenticacao, | |
| 257 | - $p_nm_nome_completo, | |
| 258 | - $p_te_email, | |
| 259 | - $p_te_node_address, | |
| 260 | - $p_id_so) | |
| 261 | - { | |
| 262 | - if ($p_te_email <> '') | |
| 263 | - { | |
| 264 | - // Envio e-mail informando da abertura de sessão | |
| 265 | - $corpo_mail = "Prezado usuário(a) ".$p_nm_nome_completo.",\n\n | |
| 266 | - informamos que foi iniciada uma sessão para Suporte Remoto Seguro através do Sistema CACIC em ".$p_dt_hr_inicio_sessao . "\n\n\n\n | |
| 267 | - _______________________________________________________________________ | |
| 268 | - CACIC - Configurador Automático e Coletor de Informações Computacionais\n | |
| 269 | - srCACIC - Módulo para Suporte Remoto Seguro do Sistema CACIC\n | |
| 270 | - Desenvolvido pela Dataprev - Unidade Regional Espírito Santo"; | |
| 271 | - | |
| 272 | - //GravaTESTES('SetSession: Enviando Email...'); | |
| 273 | - // Manda mail para os administradores. | |
| 274 | - //mail("$p_te_email", "Sistema CACIC - Módulo srCACIC - Abertura de Sessão para Suporte Remoto Seguro", "$corpo_mail", "From: cacic@{$_SERVER['SERVER_NAME']}"); | |
| 275 | - } | |
| 276 | - | |
| 277 | - conecta_bd_cacic(); | |
| 278 | - | |
| 279 | - $query_SESSAO = "INSERT INTO srcacic_sessoes | |
| 280 | - ( dt_hr_inicio_sessao, | |
| 281 | - nm_acesso_usuario_visitado, | |
| 282 | - nm_completo_usuario_visitado, | |
| 283 | - te_email_usuario_visitado, | |
| 284 | - te_node_address_visitado, | |
| 285 | - id_so_visitado, | |
| 286 | - dt_hr_ultimo_contato) | |
| 287 | - VALUES ('" . $p_dt_hr_inicio_sessao . "', | |
| 288 | - '" . $p_nm_nome_acesso_autenticacao . "', | |
| 289 | - '" . $p_nm_nome_completo . "', | |
| 290 | - '" . $p_te_email . "', | |
| 291 | - '" . $p_te_node_address . "', | |
| 292 | - '" . $p_id_so . "', | |
| 293 | - '" . $p_dt_hr_inicio_sessao . "')"; | |
| 294 | - GravaTESTES('SetSession: query_SESSAO: '.$query_SESSAO); | |
| 295 | - $result_SESSAO = mysql_query($query_SESSAO); | |
| 296 | - } | |
| 297 | -?> | |
| 298 | - | |
| 315 | +?> | |
| 299 | 316 | \ No newline at end of file | ... | ... |