Commit 7466c363978884bc812e4f01e59ad1bfcb58767c
1 parent
40db4cd9
Exists in
master
and in
1 other branch
Implementacao de autenticacao e controles para uso do srCACIC - Suporte Remoto, pequenas correcoes.
git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@760 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
14 changed files
with
726 additions
and
163 deletions
Show diff stats
admin/dominios/detalhes_dominio.php
| ... | ... | @@ -38,14 +38,16 @@ if ($_POST['ExcluiDominio'] <> '' && $_SESSION['cs_nivel_administracao']==1) |
| 38 | 38 | else if ($_POST['GravaAlteracoes'] <> '' && $_SESSION['cs_nivel_administracao']==1) |
| 39 | 39 | { |
| 40 | 40 | $query = "UPDATE dominios |
| 41 | - SET nm_dominio = '".$_POST['frm_nm_dominio'] ."', | |
| 42 | - te_ip_dominio = '".$_POST['frm_te_ip_dominio'] ."', | |
| 43 | - id_tipo_protocolo = '".$_POST['frm_id_tipo_protocolo'] ."', | |
| 44 | - nu_versao_protocolo = '".$_POST['frm_nu_versao_protocolo']."', | |
| 45 | - te_string_DN = '".$_POST['frm_te_string_DN'] ."', | |
| 46 | - te_observacao = '".$_POST['frm_te_observacao'] ."' | |
| 47 | - WHERE id_dominio = ".$_POST['frm_id_dominio']; | |
| 48 | - | |
| 41 | + SET nm_dominio = '".$_POST['frm_nm_dominio'] ."', | |
| 42 | + te_ip_dominio = '".$_POST['frm_te_ip_dominio'] ."', | |
| 43 | + id_tipo_protocolo = '".$_POST['frm_id_tipo_protocolo'] ."', | |
| 44 | + nu_versao_protocolo = '".$_POST['frm_nu_versao_protocolo'] ."', | |
| 45 | + te_base_consulta_raiz = '".$_POST['frm_te_base_consulta_raiz'] ."', | |
| 46 | + te_base_consulta_folha = '".$_POST['frm_te_base_consulta_folha'] ."', | |
| 47 | + te_atributo_identificador = '".$_POST['frm_te_atributo_identificador']."', | |
| 48 | + te_atributo_retorna_nome = '".$_POST['frm_te_atributo_retorna_nome'] ."', | |
| 49 | + te_atributo_retorna_email = '".$_POST['frm_te_atributo_retorna_email']."', | |
| 50 | + te_observacao = '".$_POST['frm_te_observacao'] ."' WHERE id_dominio = ".$_POST['frm_id_dominio']; | |
| 49 | 51 | mysql_query($query) or die('Update falhou ou sua sessão expirou!'); |
| 50 | 52 | GravaLog('UPD',$_SERVER['SCRIPT_NAME'],'dominios'); |
| 51 | 53 | header ("Location: ../../include/operacao_ok.php?chamador=../admin/dominios/index.php&tempo=1"); |
| ... | ... | @@ -88,6 +90,36 @@ else |
| 88 | 90 | document.form.frm_id_tipo_protocolo.focus(); |
| 89 | 91 | return false; |
| 90 | 92 | } |
| 93 | + else if ( document.form.frm_te_base_consulta_raiz.value == "" ) | |
| 94 | + { | |
| 95 | + alert("A base para consulta em raiz é obrigatória."); | |
| 96 | + document.form.frm_te_base_consulta_raiz.focus(); | |
| 97 | + return false; | |
| 98 | + } | |
| 99 | + else if ( document.form.frm_te_base_consulta_folha.value == "" ) | |
| 100 | + { | |
| 101 | + alert("A base para consulta em folha é obrigatória."); | |
| 102 | + document.form.frm_te_base_consulta_folha.focus(); | |
| 103 | + return false; | |
| 104 | + } | |
| 105 | + else if ( document.form.frm_te_atributo_retorna_nome.value == "" ) | |
| 106 | + { | |
| 107 | + alert("O atributo para retorno de nome completo é obrigatório."); | |
| 108 | + document.form.frm_te_atributo_retorna_nome.focus(); | |
| 109 | + return false; | |
| 110 | + } | |
| 111 | + else if ( document.form.frm_te_atributo_retorna_email.value == "" ) | |
| 112 | + { | |
| 113 | + alert("O atributo para retorno de email é obrigatório."); | |
| 114 | + document.form.frm_te_atributo_retorna_email.focus(); | |
| 115 | + return false; | |
| 116 | + } | |
| 117 | + else if ( document.form.frm_te_atributo_identificador.value == "" ) | |
| 118 | + { | |
| 119 | + alert("O atributo identificador é obrigatório."); | |
| 120 | + document.form.frm_te_atributo_identificador.focus(); | |
| 121 | + return false; | |
| 122 | + } | |
| 91 | 123 | return true; |
| 92 | 124 | } |
| 93 | 125 | </script> |
| ... | ... | @@ -136,30 +168,72 @@ else |
| 136 | 168 | <option value="Open LDAP"<? if ($row['id_tipo_protocolo']=='Open LDAP') echo 'selected';?>>Open LDAP</option> |
| 137 | 169 | </select> |
| 138 | 170 | </label></td> |
| 139 | - <td class="label"><div align="left"><span class="label_peq_sem_fundo"> | |
| 140 | - <input name="frm_nu_versao_protocolo" type="text" size="30" maxlength="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_nu_versao_protocolo" value="<? echo $row['nu_versao_protocolo'];?>" > | |
| 171 | + <td class="label"><div align="left"><span class="label_peq_sem_fundo" id="frm_nu_versao_protocolo"> | |
| 172 | + <input name="frm_nu_versao_protocolo" type="text" size="60" maxlength="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_nu_versao_protocolo" value="<? echo $row['nu_versao_protocolo'];?>" > | |
| 141 | 173 | </span></div></td> |
| 142 | 174 | </tr> |
| 143 | 175 | <tr> |
| 144 | - <td class="label"><br> | |
| 145 | - String de Pesquisa: <span class="normal style2">(Ex.: o=dominio.com.br / DC=dominio, DC=com, DC=br)</span></td> | |
| 146 | - <td class="label"><div align="left"><br> | |
| 147 | - Observações:</div></td> | |
| 176 | + <td class="label"><p><br> | |
| 177 | + Base para Consulta em Raíz: <span class="normal style2">(Ex.: "dc=br, dc=com, dc=dominio"</span><span class="normal style2">)</span></p></td> | |
| 178 | + <td class="label"><p><br> | |
| 179 | + Base para Consulta em Folha: <span class="normal style2">(Ex.: "ou=pessoas, ou=usuarios"</span><span class="normal style2">)</span></p></td> | |
| 148 | 180 | </tr> |
| 149 | 181 | <tr> |
| 150 | 182 | <td height="1" bgcolor="#333333" colspan="3"></td> |
| 151 | 183 | </tr> |
| 152 | 184 | <tr> |
| 153 | 185 | <td><span class="label_peq_sem_fundo"> |
| 154 | - <input name="frm_te_string_DN" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_string_DN" value="<? echo $row['te_string_DN'];?>" > | |
| 186 | + <input name="frm_te_base_consulta_raiz" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_base_consulta_raiz" value="<? echo $row['te_base_consulta_raiz'];?>" > | |
| 155 | 187 | </span></td> |
| 156 | 188 | <td><span class="label_peq_sem_fundo"> |
| 157 | - <input name="frm_te_observacao" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_observacao" value="<? echo $row['te_observacao'];?>" > | |
| 189 | + <input name="frm_te_base_consulta_folha" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_base_consulta_folha" value="<? echo $row['te_base_consulta_folha'];?>" > | |
| 158 | 190 | </span></td> |
| 159 | 191 | </tr> |
| 192 | + <tr> | |
| 193 | + <td> </td> | |
| 194 | + <td> </td> | |
| 195 | + </tr> | |
| 196 | + <tr> | |
| 197 | + <td class="label"><p><br> | |
| 198 | + Atributo para Identificação: <span class="normal style2">(Ex.: "uniqueID"</span><span class="normal style2">)</span></p></td> | |
| 199 | + <td> </td> | |
| 200 | + </tr> | |
| 201 | + <tr> | |
| 202 | + <td><span class="label_peq_sem_fundo"> | |
| 203 | + <input name="frm_te_atributo_identificador" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_atributo_identificador" value="<? echo $row['te_atributo_identificador'];?>" > | |
| 204 | + </span></td> | |
| 205 | + <td> </td> | |
| 206 | + </tr> | |
| 160 | 207 | |
| 161 | - <tr> | |
| 162 | - <td colspan="3"> </td> | |
| 208 | + <tr> | |
| 209 | + <td class="label"><p><br> | |
| 210 | + Atributo para Retorno de Nome Completo: <span class="normal style2">(Ex.: "fullName"</span><span class="normal style2">)</span></p></td> | |
| 211 | + <td class="label"><p><br> | |
| 212 | + Atributo para Retorno de Email: <span class="normal style2">(Ex: "email"</span><span class="normal style2">)</span></p></td> | |
| 213 | + <td> </td> | |
| 214 | + </tr> | |
| 215 | + <tr> | |
| 216 | + <td><span class="label_peq_sem_fundo"> | |
| 217 | + <input name="frm_te_atributo_retorna_nome" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_atributo_retorna_nome" value="<? echo $row['te_atributo_retorna_nome'];?>" > | |
| 218 | + </span></td> | |
| 219 | + <td><span class="label_peq_sem_fundo"> | |
| 220 | + <input name="frm_te_atributo_retorna_email" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_atributo_retorna_email" value="<? echo $row['te_atributo_retorna_email'];?>" > | |
| 221 | + </span></td> | |
| 222 | + <td> </td> | |
| 223 | + </tr> | |
| 224 | + <tr> | |
| 225 | + <td colspan="3"> </td> | |
| 226 | + </tr> | |
| 227 | + <tr> | |
| 228 | + <td colspan="2" class="label"><div align="left"><br> | |
| 229 | + Observações:</div></td> | |
| 230 | + <td> </td> | |
| 231 | + </tr> | |
| 232 | + <tr> | |
| 233 | + <td colspan="2"><span class="label_peq_sem_fundo"> | |
| 234 | + <input name="frm_te_observacao" type="text" size="100" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_observacao" value="<? echo $row['te_observacao'];?>" > | |
| 235 | + </span></td> | |
| 236 | + <td> </td> | |
| 163 | 237 | </tr> |
| 164 | 238 | </table> |
| 165 | 239 | ... | ... |
admin/dominios/incluir_dominio.php
| ... | ... | @@ -41,13 +41,21 @@ if($_POST['submit']<>'' && $_SESSION['cs_nivel_administracao']==1) |
| 41 | 41 | te_ip_dominio, |
| 42 | 42 | id_tipo_protocolo, |
| 43 | 43 | nu_versao_protocolo, |
| 44 | - te_string_DN, | |
| 44 | + te_base_consulta_raiz, | |
| 45 | + te_base_consulta_folha, | |
| 46 | + te_atributo_identificador, | |
| 47 | + te_atributo_retorna_nome, | |
| 48 | + te_atributo_retorna_email, | |
| 45 | 49 | te_observacao) |
| 46 | 50 | VALUES ('".$_POST['frm_nm_dominio']."', |
| 47 | 51 | '".$_POST['frm_te_ip_dominio']."', |
| 48 | 52 | '".$_POST['frm_id_tipo_protocolo']."', |
| 49 | 53 | '".$_POST['frm_nu_versao_protocolo']."', |
| 50 | - '".$_POST['frm_te_string_DN']."', | |
| 54 | + '".$_POST['frm_te_base_consulta_raiz']."', | |
| 55 | + '".$_POST['frm_te_base_consulta_folha']."', | |
| 56 | + '".$_POST['frm_te_atributo_identificador']."', | |
| 57 | + '".$_POST['frm_te_atributo_retorna_nome']."', | |
| 58 | + '".$_POST['frm_te_atributo_retorna_email']."', | |
| 51 | 59 | '".$_POST['frm_te_observacao']."')"; |
| 52 | 60 | $result = mysql_query($query) or die ('2-Falha na Inserção em Dominios ou sua sessão expirou!'); |
| 53 | 61 | GravaLog('INS',$_SERVER['SCRIPT_NAME'],'dominios'); |
| ... | ... | @@ -87,8 +95,37 @@ else |
| 87 | 95 | document.form.frm_id_tipo_protocolo.focus(); |
| 88 | 96 | return false; |
| 89 | 97 | } |
| 90 | - | |
| 91 | - return true; | |
| 98 | + else if ( document.form.frm_te_base_consulta_raiz.value == "" ) | |
| 99 | + { | |
| 100 | + alert("A base para consulta em raiz é obrigatória."); | |
| 101 | + document.form.frm_te_base_consulta_raiz.focus(); | |
| 102 | + return false; | |
| 103 | + } | |
| 104 | + else if ( document.form.frm_te_base_consulta_folha.value == "" ) | |
| 105 | + { | |
| 106 | + alert("A base para consulta em folha é obrigatória."); | |
| 107 | + document.form.frm_te_base_consulta_folha.focus(); | |
| 108 | + return false; | |
| 109 | + } | |
| 110 | + else if ( document.form.frm_te_atributo_retorna_nome.value == "" ) | |
| 111 | + { | |
| 112 | + alert("O atributo para retorno de nome completo é obrigatório."); | |
| 113 | + document.form.frm_te_atributo_retorna_nome.focus(); | |
| 114 | + return false; | |
| 115 | + } | |
| 116 | + else if ( document.form.frm_te_atributo_retorna_email.value == "" ) | |
| 117 | + { | |
| 118 | + alert("O atributo para retorno de email é obrigatório."); | |
| 119 | + document.form.frm_te_atributo_retorna_email.focus(); | |
| 120 | + return false; | |
| 121 | + } | |
| 122 | + else if ( document.form.frm_te_atributo_identificador.value == "" ) | |
| 123 | + { | |
| 124 | + alert("O atributo identificador é obrigatório."); | |
| 125 | + document.form.frm_te_atributo_identificador.focus(); | |
| 126 | + return false; | |
| 127 | + } | |
| 128 | + return true; | |
| 92 | 129 | } |
| 93 | 130 | </script> |
| 94 | 131 | <script language="JavaScript" type="text/JavaScript"> |
| ... | ... | @@ -160,25 +197,68 @@ else |
| 160 | 197 | </span></div></td> |
| 161 | 198 | </tr> |
| 162 | 199 | <tr> |
| 163 | - <td class="label"><br> | |
| 164 | - String de Pesquisa: <span class="normal style2">(Ex.: o=dominio.com.br / DC=dominio, DC=com, DC=br)</span></td> | |
| 165 | - <td class="label"><div align="left"><br> | |
| 166 | - Observações:</div></td> | |
| 167 | - </tr> | |
| 168 | - <tr> | |
| 169 | - <td height="1" bgcolor="#333333" colspan="3"></td> | |
| 170 | - </tr> | |
| 171 | - <tr> | |
| 172 | - <td><span class="label_peq_sem_fundo"> | |
| 173 | - <input name="frm_te_string_DN" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_string_DN" > | |
| 174 | - </span></td> | |
| 175 | - <td><span class="label_peq_sem_fundo"> | |
| 176 | - <input name="frm_te_observacao" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_observacao" > | |
| 177 | - </span></td> | |
| 178 | - </tr> | |
| 179 | - <tr> | |
| 180 | - <td colspan="3"> </td> | |
| 181 | - </tr> | |
| 200 | + <td class="label"><p><br> | |
| 201 | + Base para Consulta em Raíz: <span class="normal style2">(Ex.: "dc=br, dc=com, dc=dominio"</span><span class="normal style2">)</span></p></td> | |
| 202 | + <td class="label"><p><br> | |
| 203 | + Base para Consulta em Folha: <span class="normal style2">(Ex.: "ou=pessoas, ou=usuarios"</span><span class="normal style2">)</span></p></td> | |
| 204 | + </tr> | |
| 205 | + <tr> | |
| 206 | + <td height="1" bgcolor="#333333" colspan="3"></td> | |
| 207 | + </tr> | |
| 208 | + <tr> | |
| 209 | + <td><span class="label_peq_sem_fundo"> | |
| 210 | + <input name="frm_te_base_consulta_raiz" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_base_consulta_raiz" > | |
| 211 | + </span></td> | |
| 212 | + <td><span class="label_peq_sem_fundo"> | |
| 213 | + <input name="frm_te_base_consulta_folha" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_base_consulta_folha" > | |
| 214 | + </span></td> | |
| 215 | + </tr> | |
| 216 | + <tr> | |
| 217 | + <td> </td> | |
| 218 | + <td> </td> | |
| 219 | + </tr> | |
| 220 | + <tr> | |
| 221 | + <td class="label"><p><br> | |
| 222 | + Atributo para Identificação: <span class="normal style2">(Ex.: "uniqueID"</span><span class="normal style2">)</span></p></td> | |
| 223 | + <td> </td> | |
| 224 | + </tr> | |
| 225 | + <tr> | |
| 226 | + <td><span class="label_peq_sem_fundo"> | |
| 227 | + <input name="frm_te_atributo_identificador" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_atributo_identificador" > | |
| 228 | + </span></td> | |
| 229 | + <td> </td> | |
| 230 | + </tr> | |
| 231 | + | |
| 232 | + <tr> | |
| 233 | + <td class="label"><p><br> | |
| 234 | + Atributo para Retorno de Nome Completo: <span class="normal style2">(Ex.: "fullName"</span><span class="normal style2">)</span></p></td> | |
| 235 | + <td class="label"><p><br> | |
| 236 | + Atributo para Retorno de Email: <span class="normal style2">(Ex: "email"</span><span class="normal style2">)</span></p></td> | |
| 237 | + <td> </td> | |
| 238 | + </tr> | |
| 239 | + <tr> | |
| 240 | + <td><span class="label_peq_sem_fundo"> | |
| 241 | + <input name="frm_te_atributo_retorna_nome" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_atributo_retorna_nome" > | |
| 242 | + </span></td> | |
| 243 | + <td><span class="label_peq_sem_fundo"> | |
| 244 | + <input name="frm_te_atributo_retorna_email" type="text" size="60" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_atributo_retorna_email" > | |
| 245 | + </span></td> | |
| 246 | + <td> </td> | |
| 247 | + </tr> | |
| 248 | + <tr> | |
| 249 | + <td colspan="3"> </td> | |
| 250 | + </tr> | |
| 251 | + <tr> | |
| 252 | + <td colspan="2" class="label"><div align="left"><br> | |
| 253 | + Observações:</div></td> | |
| 254 | + <td> </td> | |
| 255 | + </tr> | |
| 256 | + <tr> | |
| 257 | + <td colspan="2"><span class="label_peq_sem_fundo"> | |
| 258 | + <input name="frm_te_observacao" type="text" size="100" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" id="frm_te_observacao" > | |
| 259 | + </span></td> | |
| 260 | + <td> </td> | |
| 261 | + </tr> | |
| 182 | 262 | </table> |
| 183 | 263 | <p align="center"> |
| 184 | 264 | <input name="submit" type="submit" value=" Gravar Informações " onClick="return Confirma('Confirma Inclusão de Domínio?');"> | ... | ... |
| ... | ... | @@ -0,0 +1,325 @@ |
| 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 negado (Access denied)!'); | |
| 22 | +else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
| 23 | +} | |
| 24 | + | |
| 25 | +include_once "../include/library.php"; | |
| 26 | +AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... | |
| 27 | +// 1 - Administração | |
| 28 | +// 2 - Gestão Central | |
| 29 | +// 3 - Supervisão | |
| 30 | + | |
| 31 | +if (!$_REQUEST['date_input1']) | |
| 32 | + { | |
| 33 | + $from_usuarios = ''; | |
| 34 | + $where_usuarios = ''; | |
| 35 | + | |
| 36 | + if ($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2) | |
| 37 | + { | |
| 38 | + $from_usuarios = ', usuarios b'; | |
| 39 | + $where_usuarios = ' AND a.id_usuario = b.id_usuario AND b.id_local = '.$_SESSION['id_local']; | |
| 40 | + if ($_SESSION['te_locais_secundarios']) | |
| 41 | + { | |
| 42 | + $whereLocais = 'WHERE id_local = '.$_SESSION['id_local'].' OR id_local IN ('.$_SESSION['te_locais_secundarios'].') '; | |
| 43 | + } | |
| 44 | + } | |
| 45 | + | |
| 46 | + conecta_bd_cacic(); | |
| 47 | + $query_minmax = 'SELECT DATE_FORMAT(min(a.dt_hr_ultimo_contato), "%d-%m-%Y") as minima, | |
| 48 | + DATE_FORMAT(max(a.dt_hr_ultimo_contato), "%d-%m-%Y") as maxima | |
| 49 | + FROM srcacic_sessoes_logs a '. | |
| 50 | + $from_usuarios .' | |
| 51 | + WHERE '. | |
| 52 | + $where_usuarios; | |
| 53 | + $result_minmax = mysql_query($query_minmax); | |
| 54 | + $row_minmax = mysql_fetch_array($result_minmax); | |
| 55 | + $date_input1 = date('d/m/Y'); | |
| 56 | + $date_input2 = date('d/m/Y'); | |
| 57 | + } | |
| 58 | +else | |
| 59 | + { | |
| 60 | + $date_input1 = $_REQUEST['date_input1']; | |
| 61 | + $date_input2 = $_REQUEST['date_input2']; | |
| 62 | + } | |
| 63 | +?> | |
| 64 | + | |
| 65 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| 66 | +<html> | |
| 67 | +<head> | |
| 68 | +<link rel="stylesheet" type="text/css" href="../include/cacic.css"> | |
| 69 | +<title><?=$oTranslator->_('Log de Suporte Remoto');?></title> | |
| 70 | +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
| 71 | +<? | |
| 72 | +// JavaScripts para fazer a selecao entre os listbox, movendo itens entre eles. | |
| 73 | +require_once('../include/selecao_listbox.js'); | |
| 74 | +?> | |
| 75 | + | |
| 76 | +<style type="text/css"> | |
| 77 | +<!-- | |
| 78 | +.style2 {font-size: large} | |
| 79 | +--> | |
| 80 | +</style> | |
| 81 | +</head> | |
| 82 | + | |
| 83 | +<body background="../imgs/linha_v.gif"> | |
| 84 | +<script language="JavaScript" type="text/javascript" src="../include/cacic.js"></script> | |
| 85 | + | |
| 86 | +<form name="form1" method="post" action=""> | |
| 87 | +<table width="90%" border="0" align="center"> | |
| 88 | + <tr> | |
| 89 | + <td class="cabecalho"><div align="left"><?=$oTranslator->_('Log de Suporte Remoto');?></div></td> | |
| 90 | + </tr> | |
| 91 | + <tr> | |
| 92 | + <td class="descricao"><?=$oTranslator->_('kciq_msg Log de suporte remoto help');?></td> | |
| 93 | + </tr> | |
| 94 | +</table> | |
| 95 | + <p><br></p> | |
| 96 | + | |
| 97 | + <table width="90%" border="0" cellpadding="0" cellspacing="1" align="center"> | |
| 98 | + <tr> | |
| 99 | + <td class="label" colspan="3"><?=$oTranslator->_('Selecione o periodo no qual devera ser realizada a consulta');?>:</td> | |
| 100 | + </tr> | |
| 101 | + <tr> | |
| 102 | + <td height="1" bgcolor="#333333" colspan="2"></td> | |
| 103 | + </tr> | |
| 104 | + <tr valign="middle"> | |
| 105 | + <td width="33%" height="1" nowrap valign="middle"> | |
| 106 | + <input name="whereLocais" type="hidden" value="<? echo $whereLocais;?>"> | |
| 107 | +<input name="date_input1" type="text" size="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" value="<? echo $date_input1;?>"> | |
| 108 | +<? /* | |
| 109 | + <script type="text/javascript" language="JavaScript"> | |
| 110 | + <!-- | |
| 111 | + function calendar1Callback(date, month, year) | |
| 112 | + { | |
| 113 | + document.forms['form1'].date_input1.value = date + '/' + month + '/' + year; | |
| 114 | + } | |
| 115 | + calendar1 = new dynCalendar('calendar1', 'calendar1Callback'); | |
| 116 | + //--> | |
| 117 | + </script>*/?> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">a</font> | |
| 118 | + <input name="date_input2" type="text" size="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" value="<? echo $date_input2;?>"> | |
| 119 | +<? /* <script type="text/javascript" language="JavaScript"> | |
| 120 | + <!-- | |
| 121 | + function calendar2Callback(date, month, year) | |
| 122 | + { | |
| 123 | + document.forms['form1'].date_input2.value = date + '/' + month + '/' + year; | |
| 124 | + } | |
| 125 | + calendar2 = new dynCalendar('calendar2', 'calendar2Callback'); | |
| 126 | + //--> | |
| 127 | + </script>*/?> </td> | |
| 128 | + <td align="left" class="descricao">(<?=$oTranslator->_('Formato da data');?> <?=$oTranslator->_('dd/mm/aaaa');?>)</td> | |
| 129 | + <td rowspan="4" align="left" valign="middle" class="descricao"><div align="center"> | |
| 130 | + <input name="consultar" type="submit" value=" Filtrar " onClick="SelectAll(this.form.elements['list12[]'])"> | |
| 131 | + </div></td> | |
| 132 | + </tr> | |
| 133 | + | |
| 134 | + <? | |
| 135 | + if ($_SESSION['cs_nivel_administracao'] == 1 || $_SESSION['cs_nivel_administracao'] == 2 || ($_SESSION['cs_nivel_administracao'] == 3 && $_SESSION['te_locais_secundarios']<>'')) | |
| 136 | + { | |
| 137 | + ?> | |
| 138 | + <TR><td height="20"></td></TR> | |
| 139 | + <tr valign="middle"> | |
| 140 | + <td height="1" colspan="2" valign="middle" nowrap><div align="left"> | |
| 141 | + <? | |
| 142 | + include_once "../include/selecao_locais_inc.php"; | |
| 143 | + ?> | |
| 144 | + </div></td></tr> | |
| 145 | + <? | |
| 146 | + } | |
| 147 | + ?> | |
| 148 | + <tr> | |
| 149 | + <td height="1" bgcolor="#333333" colspan="2"></td> | |
| 150 | + </tr> | |
| 151 | + | |
| 152 | + </table> | |
| 153 | + <? | |
| 154 | + if ($_REQUEST['date_input1']) | |
| 155 | + { | |
| 156 | + $msg = '<div align="center"> | |
| 157 | + <font color="red" size="1" face="Verdana, Arial, Helvetica, sans-serif">'. | |
| 158 | + $oTranslator->_('Nenhum suporte remoto realizado no periodo informado').'.</font><br><br></div>'; | |
| 159 | + | |
| 160 | + $where = ($_REQUEST['nm_chamador']<>''?' AND b.id_usuario = '.$_REQUEST['id_usuario']:''); | |
| 161 | + | |
| 162 | + $OrderBy = ($_GET['OrderBy']<>''?$_GET['OrderBy']:'1'); | |
| 163 | + $OrderBy = ($OrderBy=='1'?$OrderBy . ' DESC ':$OrderBy); | |
| 164 | + | |
| 165 | + $where_usuarios = ''; | |
| 166 | + | |
| 167 | + if ($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2) | |
| 168 | + { | |
| 169 | + $where_usuarios = ' AND b.id_local = '.$_SESSION['id_local']; | |
| 170 | + } | |
| 171 | + else | |
| 172 | + { | |
| 173 | + $itens_locais = ''; | |
| 174 | + for ($i =0; $i < count($_POST['list12']);$i++) | |
| 175 | + { | |
| 176 | + if ($itens_locais) | |
| 177 | + $itens_locais .= ','; | |
| 178 | + $itens_locais .= $_POST['list12'][$i]; | |
| 179 | + } | |
| 180 | + $where_usuarios = ' AND b.id_local IN ('.$itens_locais.')'; | |
| 181 | + if (count($_POST['list12'])==0) | |
| 182 | + $msg = '<div align="center"> | |
| 183 | + <font color="red" size="1" face="Verdana, Arial, Helvetica, sans-serif"> | |
| 184 | + Nenhum suporte remoto realizado no <u>período informado</u> ou nenhum <u>local selecionado</u>.</font><br><br></div>'; | |
| 185 | + | |
| 186 | + } | |
| 187 | + | |
| 188 | + conecta_bd_cacic(); | |
| 189 | + $query = 'SELECT DATE_FORMAT(a.dt_hr_ultimo_contato, "%y-%m-%d %H:%i") as dt_hr_ultimo_contato, | |
| 190 | + DATE_FORMAT(a.dt_hr_conexao, "%y-%m-%d %H:%i") as dt_hr_conexao, | |
| 191 | + a.te_motivo_conexao, | |
| 192 | + DATE_FORMAT(aa.dt_hr_inicio_sessao, "%y-%m-%d %H:%i") as dt_hr_inicio_sessao, | |
| 193 | + aa.nm_nome_completo_visitado, | |
| 194 | + d.te_ip te_ip_visitado, | |
| 195 | + d.te_nome_computador te_nome_computador_visitado, | |
| 196 | + dd.te_ip te_ip_visitante, | |
| 197 | + dd.te_nome_computador te_nome_computador_visitante, | |
| 198 | + b.nm_usuario_completo, | |
| 199 | + b.nm_usuario_acesso, | |
| 200 | + b.id_usuario, | |
| 201 | + c.sg_local | |
| 202 | + FROM srcacic_sessoes_logs a, | |
| 203 | + srcacic_sessoes aa, | |
| 204 | + usuarios b, | |
| 205 | + locais c, | |
| 206 | + computadores d, | |
| 207 | + computadores dd | |
| 208 | + WHERE aa.id_sessao = a.id_sessao AND | |
| 209 | + a.id_usuario_visitante = b.id_usuario AND | |
| 210 | + b.id_local = c.id_local AND | |
| 211 | + 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" '. | |
| 212 | + $where . | |
| 213 | + $where_usuarios . ' AND | |
| 214 | + d.te_node_address = aa.te_node_address_visitado AND | |
| 215 | + d.id_so = aa.id_so_visitado AND | |
| 216 | + dd.te_node_address = a.te_node_address_visitante AND | |
| 217 | + dd.id_so = a.id_so_visitante | |
| 218 | + ORDER BY '.$OrderBy; | |
| 219 | +//echo $query . '<br>'; | |
| 220 | + $result = mysql_query($query); | |
| 221 | + $NumRegistro = mysql_num_rows($result); | |
| 222 | + if ($NumRegistro) | |
| 223 | + { | |
| 224 | + ?> | |
| 225 | + <p></p> | |
| 226 | + <table width="90%" border="0" align="center" cellpadding="0" cellspacing="1"> | |
| 227 | + <tr> | |
| 228 | + <td height="10" colspan="3" bgcolor="#CCCCCC" class="destaque"><div align="center" class="style2"><?=$oTranslator->_('Resultado da consulta');?></div></td> | |
| 229 | + </tr> | |
| 230 | + <tr> | |
| 231 | + <td height="10" colspan="3"></td> | |
| 232 | + </tr> | |
| 233 | + <tr> | |
| 234 | + <td height="1" colspan="3" bgcolor="#333333"></td> | |
| 235 | + </tr> | |
| 236 | + <tr> | |
| 237 | + <td colspan="3"> | |
| 238 | + <table width="90%" border="0" cellpadding="2" cellspacing="0" bordercolor="#333333" align="center"> | |
| 239 | + <tr bgcolor="#E1E1E1"> | |
| 240 | + <td colspan="3"></td> | |
| 241 | + <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> | |
| 242 | + <td></td> | |
| 243 | + <td nowrap class="cabecalho_tabela"><div align="left"><a href="log_suporte_remoto.php?OrderBy=2&date_input1=<? echo $date_input1;?>&date_input2=<? echo $date_input2;?>"><?=$oTranslator->_('Estação Origem');?></a></div></td> | |
| 244 | + <td></td> | |
| 245 | + <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->_('Usuário Origem');?></a></div></td> | |
| 246 | + <td></td> | |
| 247 | + <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> | |
| 248 | + <td></td> | |
| 249 | + <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> | |
| 250 | + <td></td> | |
| 251 | + <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> | |
| 252 | + <td></td> | |
| 253 | + </tr> | |
| 254 | + <tr> | |
| 255 | + <td height="1" colspan="15" bgcolor="#333333"></td> | |
| 256 | + </tr> | |
| 257 | + <? | |
| 258 | + $Cor = 0; | |
| 259 | + $NumRegistro = mysql_num_rows($result); | |
| 260 | + $msg = ($NumRegistro > 1?'':$msg); | |
| 261 | + while($row = mysql_fetch_array($result)) | |
| 262 | + { | |
| 263 | + list($year_inicio_sessao, $month_inicio_sessao, $day_inicio_sessao) = explode("-", $row['dt_hr_inicio_sessao']); | |
| 264 | + list($day_inicio_sessao,$hour_inicio_sessao) = explode(" ",$day_inicio_sessao); | |
| 265 | + | |
| 266 | + list($year_ultimo_contato, $month_ultimo_contato, $day_ultimo_contato) = explode("-", $row['dt_hr_ultimo_contato']); | |
| 267 | + list($day_ultimo_contato,$hour_ultimo_contato) = explode(" ",$day_ultimo_contato); | |
| 268 | + | |
| 269 | + list($year_conexao, $month_conexao, $day_conexao) = explode("-", $row['dt_hr_conexao']); | |
| 270 | + list($day_conexao,$hour_conexao) = explode(" ",$day_conexao); | |
| 271 | + | |
| 272 | + ?> | |
| 273 | + <tr <? if ($Cor) { echo 'bgcolor="#E1E1E1"'; } ?>> | |
| 274 | + <td nowrap></td> | |
| 275 | + <td align="left" nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $NumRegistro; ?></td> | |
| 276 | + <td nowrap></td> | |
| 277 | + <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> | |
| 278 | + <td nowrap></td> | |
| 279 | + <td nowrap class="opcao_tabela_destaque" title="<? echo $row['te_motivo_conexao'];?>"><? echo $row['te_ip_visitante'].'/'.$row['te_nome_computador_visitante'];?></td> | |
| 280 | + <td nowrap></td> | |
| 281 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $row['nm_usuario_acesso'].'/'.$row['nm_usuario_completo'];?></td> | |
| 282 | + <td nowrap></td> | |
| 283 | + <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> | |
| 284 | + <td nowrap></td> | |
| 285 | + <td nowrap class="opcao_tabela" title="<? echo $row['te_motivo_conexao'];?>"><? echo $row['nm_nome_completo_visitado'];?></td> | |
| 286 | + <td nowrap></td> | |
| 287 | + <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> | |
| 288 | + <td nowrap></td> | |
| 289 | + <? | |
| 290 | + $Cor=!$Cor; | |
| 291 | + $NumRegistro--; | |
| 292 | + } | |
| 293 | + ?> | |
| 294 | + </table></td> | |
| 295 | + </tr> | |
| 296 | + | |
| 297 | + <? | |
| 298 | + $msg = ''; | |
| 299 | + } | |
| 300 | + ?> | |
| 301 | + <tr> | |
| 302 | + <td height="10" colspan="3"><? echo $msg;?></td> | |
| 303 | + </tr> | |
| 304 | + <? | |
| 305 | + } | |
| 306 | + ?> | |
| 307 | + <tr> | |
| 308 | + <td colspan="3" height="3" align="center"> | |
| 309 | + <? | |
| 310 | + if ($_REQUEST['nm_chamador']) | |
| 311 | + { | |
| 312 | + ?> | |
| 313 | + <input name="Retorna" type="button" value=" <?=$oTranslator->_('Retorna para');?> <? echo str_replace("_"," ",$_REQUEST['nm_chamador']);?> " onClick="history.back()"> | |
| 314 | + <? | |
| 315 | + } | |
| 316 | + ?> | |
| 317 | + | |
| 318 | + </td> | |
| 319 | + </tr> | |
| 320 | + </table> | |
| 321 | + <br> | |
| 322 | +</form> | |
| 323 | +<p> </p> | |
| 324 | +</body> | |
| 325 | +</html> | ... | ... |
language/en_US/menu_adm.txt
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | ...Acessos|admin/log_acessos.php|mainFrame||Visualização do Log de Acessos ocorridos no Sistema |
| 11 | 11 | ...Atividades|admin/log_atividades.php|mainFrame||Visualização do Log de Atividades(INS/UPD/DEL) do Sistema |
| 12 | 12 | ...Insucessos Instalação|admin/log_insucessos.php|mainFrame||Visualização do Log de Insucessoes nas Instalações |
| 13 | +...Suporte Remoto Seguro|admin/log_suporte_remoto.php|mainFrame||Visualização do Log de Suporte Remoto Seguro | |
| 13 | 14 | ..<b>Cadastros</b>||mainFrame|imgs/config_gerais.gif |
| 14 | 15 | ...Aquisições|admin/gerencia_licencas/arquivo/aquisicoes.php|mainFrame|| |
| 15 | 16 | ...Locais|admin/locais/index.php|mainFrame||Cadastro de Locais para Controle Centralizado | ... | ... |
language/en_US/menu_sup.txt
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | ...Log de Acessos|admin/log_acessos.php|mainFrame||Visualização do Log de Acessos ocorridos no Sistema |
| 8 | 8 | ...Log de Atividades|admin/log_atividades.php|mainFrame||Visualização do Log de Atividades(INS/UPD/DEL) do Sistema |
| 9 | 9 | ...Insucessos Instalação|admin/log_insucessos.php|mainFrame||Visualização do Log de Insucessoes nas Instalações |
| 10 | +...Suporte Remoto Seguro|admin/log_suporte_remoto.php|mainFrame||Visualização do Log de Suporte Remoto Seguro | |
| 10 | 11 | ..<b>Cadastros</b>||mainFrame|imgs/config_gerais.gif |
| 11 | 12 | ...Locais|admin/locais/index.php|mainFrame||Cadastro de Locais para Controle Centralizado |
| 12 | 13 | ...SubRedes|admin/redes/index.php|mainFrame||Cadastro de SubRedes | ... | ... |
language/es_UR/menu_adm.txt
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | ...Accesos|admin/log_acessos.php|mainFrame||Visualização do Log de Acessos ocorridos no Sistema |
| 11 | 11 | ...Actividades|admin/log_atividades.php|mainFrame||Visualização do Log de Atividades(INS/UPD/DEL) do Sistema |
| 12 | 12 | ...Insucessos Instalação|admin/log_insucessos.php|mainFrame||Visualização do Log de Insucessoes nas Instalações |
| 13 | +...Suporte Remoto Seguro|admin/log_suporte_remoto.php|mainFrame||Visualização do Log de Suporte Remoto Seguro | |
| 13 | 14 | ..<b>Registros</b>||mainFrame|imgs/config_gerais.gif |
| 14 | 15 | ...Aquisiciones|admin/gerencia_licencas/arquivo/aquisicoes.php|mainFrame|| |
| 15 | 16 | ...Locales|admin/locais/index.php|mainFrame||Cadastro de Locais para Controle Centralizado | ... | ... |
language/es_UR/menu_sup.txt
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | ...Log de Accesos|admin/log_acessos.php|mainFrame||Visualização do Log de Acessos ocorridos no Sistema |
| 8 | 8 | ...Log de Actividades|admin/log_atividades.php|mainFrame||Visualização do Log de Atividades(INS/UPD/DEL) do Sistema |
| 9 | 9 | ...Insucessos Instalação|admin/log_insucessos.php|mainFrame||Visualização do Log de Insucessoes nas Instalações |
| 10 | +...Suporte Remoto Seguro|admin/log_suporte_remoto.php|mainFrame||Visualização do Log de Suporte Remoto Seguro | |
| 10 | 11 | ..<b>Registros</b>||mainFrame|imgs/config_gerais.gif |
| 11 | 12 | ...Locales|admin/locais/index.php|mainFrame||Cadastro de Locais para Controle Centralizado |
| 12 | 13 | ...SubRedes|admin/redes/index.php|mainFrame||Cadastro de SubRedes | ... | ... |
language/pt_BR/menu_adm.txt
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | ...Acessos|admin/log_acessos.php|mainFrame||Visualização do Log de Acessos ocorridos no Sistema |
| 11 | 11 | ...Atividades|admin/log_atividades.php|mainFrame||Visualização do Log de Atividades(INS/UPD/DEL) do Sistema |
| 12 | 12 | ...Insucessos Instalação|admin/log_insucessos.php|mainFrame||Visualização do Log de Insucessoes nas Instalações |
| 13 | +...Suporte Remoto Seguro|admin/log_suporte_remoto.php|mainFrame||Visualização do Log de Suporte Remoto Seguro | |
| 13 | 14 | ..<b>Cadastros</b>||mainFrame|imgs/config_gerais.gif |
| 14 | 15 | ...Aquisições|admin/gerencia_licencas/arquivo/aquisicoes.php|mainFrame|| |
| 15 | 16 | ...Locais|admin/locais/index.php|mainFrame||Cadastro de Locais para Controle Centralizado | ... | ... |
language/pt_BR/menu_sup.txt
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | ...Log de Acessos|admin/log_acessos.php|mainFrame||Visualização do Log de Acessos ocorridos no Sistema |
| 8 | 8 | ...Log de Atividades|admin/log_atividades.php|mainFrame||Visualização do Log de Atividades(INS/UPD/DEL) do Sistema |
| 9 | 9 | ...Insucessos Instalação|admin/log_insucessos.php|mainFrame||Visualização do Log de Insucessoes nas Instalações |
| 10 | +...Suporte Remoto Seguro|admin/log_suporte_remoto.php|mainFrame||Visualização do Log de Suporte Remoto Seguro | |
| 10 | 11 | ..<b>Cadastros</b>||mainFrame|imgs/config_gerais.gif |
| 11 | 12 | ...Locais|admin/locais/index.php|mainFrame||Cadastro de Locais para Controle Centralizado |
| 12 | 13 | ...SubRedes|admin/redes/index.php|mainFrame||Cadastro de SubRedes | ... | ... |
repositorio_install.php
| ... | ... | @@ -14,6 +14,7 @@ |
| 14 | 14 | Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 15 | 15 | */ |
| 16 | 16 | session_start(); |
| 17 | +require_once('include/config.php'); | |
| 17 | 18 | ?> |
| 18 | 19 | <html> |
| 19 | 20 | <head> |
| ... | ... | @@ -63,17 +64,34 @@ require_once('include/selecao_listbox.js'); |
| 63 | 64 | <td height="1" bgcolor="#333333"></td> |
| 64 | 65 | </tr> |
| 65 | 66 | <? |
| 66 | - if(file_exists('repositorio/versoes_agentes.ini') and is_readable('repositorio/versoes_agentes.ini')) | |
| 67 | - $v_array_versoes_agentes = parse_ini_file('repositorio/versoes_agentes.ini'); | |
| 67 | + if(file_exists($path_relativo_repositorio_instalacao.'/versoes_agentes.ini') and is_readable($path_relativo_repositorio_instalacao.'/versoes_agentes.ini')) | |
| 68 | + $v_array_versoes_agentes = parse_ini_file($path_relativo_repositorio_instalacao.'/versoes_agentes.ini'); | |
| 68 | 69 | else { |
| 69 | 70 | $v_array_versoes_agentes['chkcacic.exe'] = '???'; |
| 70 | 71 | $v_array_versoes_agentes['mapacacic.exe'] = '???'; |
| 72 | + $v_array_versoes_agentes['srcaciccli.exe'] = '???'; | |
| 71 | 73 | } |
| 72 | 74 | ?> |
| 73 | 75 | <tr> |
| 74 | 76 | <td class="label"> |
| 75 | 77 | <br> |
| 76 | - <a href="repositorio/chkcacic.exe">ChkCACIC - Verificador/Instalador/Atualizador do Sistema CACIC <span class="style2"><span class="style6">(versão <? echo $v_array_versoes_agentes['chkcacic.exe'];?> ~ 260K)</span></span></a></td> | |
| 78 | + <a href="<? echo $path_relativo_repositorio_instalacao;?>/chkcacic.exe">ChkCACIC - Verificador/Instalador/Atualizador do Sistema CACIC <span class="style2"><span class="style6">(versão <? echo $v_array_versoes_agentes['chkcacic.exe'];?> ~ 260K)</span></span></a></td> | |
| 79 | + </tr> | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + <tr> | |
| 84 | + <td height="17"> </td> | |
| 85 | + </tr> | |
| 86 | + | |
| 87 | + <tr> | |
| 88 | + <td height="1" bgcolor="#333333"></td> | |
| 89 | + </tr> | |
| 90 | + | |
| 91 | + <tr> | |
| 92 | + <td class="label"> | |
| 93 | + <br> | |
| 94 | + <a href="<? echo $path_relativo_repositorio_instalacao;?>/srcaciccli.exe">srCACICcli - Cliente para Suporte Remoto Seguro do Sistema CACIC <span class="style2"><span class="style6">(versão <? echo $v_array_versoes_agentes['srcaciccli.exe'];?> ~ 258K)</span></span></a></td> | |
| 77 | 95 | </tr> |
| 78 | 96 | |
| 79 | 97 | |
| ... | ... | @@ -92,7 +110,7 @@ require_once('include/selecao_listbox.js'); |
| 92 | 110 | <tr> |
| 93 | 111 | <td><table width="100%" border="0" cellpadding="0" cellspacing="1"> |
| 94 | 112 | <tr> |
| 95 | - <td class="label"><a href="repositorio/install/mapacacic.exe">MapaCACIC - Módulo Avulso para Coleta de Informações Patrimoniais <span class="style2"><span class="style6">(versão <? echo $v_array_versoes_agentes['mapacacic.exe'];?> ~ 248K)</span></span></a> </td> | |
| 113 | + <td class="label"><a href="<? echo $path_relativo_repositorio_instalacao;?>/mapacacic.exe">MapaCACIC - Módulo Avulso para Coleta de Informações Patrimoniais <span class="style2"><span class="style6">(versão <? echo $v_array_versoes_agentes['mapacacic.exe'];?> ~ 248K)</span></span></a> </td> | |
| 96 | 114 | </tr> |
| 97 | 115 | <tr> |
| 98 | 116 | <td> </td> | ... | ... |
ws/get_config.php
| ... | ... | @@ -77,10 +77,12 @@ if (trim(DeCrypt($key,$iv,$_POST['in_chkcacic'],$v_cs_cipher,$v_cs_compress,$str |
| 77 | 77 | } |
| 78 | 78 | else |
| 79 | 79 | { |
| 80 | - $retorno_xml_values .= '<CACIC2>' . EnCrypt($key,$iv,$v_array_versoes_agentes['cacic2.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CACIC2>'; | |
| 81 | - $retorno_xml_values .= '<GER_COLS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['ger_cols.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/GER_COLS>'; | |
| 82 | - $retorno_xml_values .= '<CHKSIS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['chksis.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CHKSIS>'; | |
| 83 | - $retorno_xml_values .= '<SRCACICSRV>' . EnCrypt($key,$iv,$v_array_versoes_agentes['srcacicsrv.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/SRCACICSRV>'; | |
| 80 | + $retorno_xml_values .= '<CACIC2>' . EnCrypt($key,$iv,$v_array_versoes_agentes['cacic2.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CACIC2>'; | |
| 81 | + $retorno_xml_values .= '<CACIC2_HASH>' . EnCrypt($key,$iv,$v_array_versoes_agentes['cacic2.exe_HASH'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CACIC2_HASH>'; | |
| 82 | + $retorno_xml_values .= '<GER_COLS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['ger_cols.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/GER_COLS>'; | |
| 83 | + $retorno_xml_values .= '<GER_COLS_HASH>' . EnCrypt($key,$iv,$v_array_versoes_agentes['ger_cols.exe_HASH'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/GER_COLS_HASH>'; | |
| 84 | + $retorno_xml_values .= '<CHKSIS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['chksis.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CHKSIS>'; | |
| 85 | + $retorno_xml_values .= '<CHKSIS_HASH>' . EnCrypt($key,$iv,$v_array_versoes_agentes['chksis.exe_HASH'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CHKSIS_HASH>'; | |
| 84 | 86 | } |
| 85 | 87 | } |
| 86 | 88 | } | ... | ... |
ws/srcacic_auth_client.php
| ... | ... | @@ -49,7 +49,8 @@ $strPaddingKey = ''; |
| 49 | 49 | // Autenticação da Estação Visitada |
| 50 | 50 | $te_node_address = DeCrypt($key,$iv,$_POST['te_node_address'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 51 | 51 | $te_so = DeCrypt($key,$iv,$_POST['te_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 52 | -$te_palavra_chave = DeCrypt($key,$iv,$_POST['te_palavra_chave'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 52 | +$te_palavra_chave = DeCrypt($key,$iv,urldecode($_POST['te_palavra_chave']) ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 53 | + | |
| 53 | 54 | |
| 54 | 55 | // ATENÇÃO: Apenas retornará um ARRAY contendo "id_so" e "te_so". |
| 55 | 56 | $arrSO = inclui_computador_caso_nao_exista( $te_node_address, |
| ... | ... | @@ -81,52 +82,67 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 81 | 82 | GravaTESTES('AuthClient: te_senha_visitante => '.$te_senha_visitante); |
| 82 | 83 | |
| 83 | 84 | // Autentico o usuário técnico, verificando nome, senha e local |
| 84 | - $query_AUTENTICA = "SELECT id_usuario, | |
| 85 | - nm_usuario_completo, | |
| 86 | - id_local, | |
| 87 | - te_locais_secundarios, | |
| 88 | - te_emails_contato | |
| 89 | - FROM usuarios | |
| 90 | - WHERE nm_usuario_acesso = '".$nm_usuario_visitante."' AND | |
| 91 | - te_senha = PASSWORD('".$te_senha_visitante."')"; | |
| 92 | - $result_AUTENTICA = mysql_query($query_AUTENTICA); | |
| 93 | - $row = mysql_fetch_array($result_AUTENTICA); | |
| 94 | - if ($row['id_usuario']<>'') | |
| 85 | + $arrUsuarios = getValores('usuarios','id_usuario, | |
| 86 | + nm_usuario_completo, | |
| 87 | + id_local, | |
| 88 | + te_locais_secundarios, | |
| 89 | + te_emails_contato','nm_usuario_acesso = "'.$nm_usuario_visitante.'" AND | |
| 90 | + te_senha = PASSWORD("'.$te_senha_visitante.'")'); | |
| 91 | + if ($arrUsuarios['id_usuario']<>'') | |
| 95 | 92 | { |
| 96 | - $boolIdLocal = stripos2($row['te_locais_secundarios'],$arrComputadores['id_local'],false); | |
| 97 | - GravaTESTES('AuthClient: boolIdLocal => '.$boolIdLocal); | |
| 98 | - GravaTESTES('AuthClient: arrComputadores[id_local] => '.$arrComputadores['id_local']); | |
| 99 | - GravaTESTES('AuthClient: row[id_local] => '.$row['id_local']); | |
| 100 | - if ($row['id_local'] == $arrComputadores['id_local'] || $boolIdLocal) | |
| 101 | - { | |
| 93 | + $boolIdLocal = stripos2($arrUsuarios['te_locais_secundarios'],$arrComputadores['id_local'],false); | |
| 94 | + //GravaTESTES('AuthClient: boolIdLocal => '.$boolIdLocal); | |
| 95 | + //GravaTESTES('AuthClient: arrComputadores[id_local] => '.$arrComputadores['id_local']); | |
| 96 | + //GravaTESTES('AuthClient: arrUsuarios[id_local] => '.$arrUsuarios['id_local']); | |
| 97 | + if ($arrUsuarios['id_local'] == $arrComputadores['id_local'] || $boolIdLocal) | |
| 98 | + { | |
| 102 | 99 | $id_sessao = DeCrypt($key,$iv,$_POST['id_sessao'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 103 | - $id_usuario_visitante = $row['id_usuario']; | |
| 100 | + $id_usuario_visitante = $arrUsuarios['id_usuario']; | |
| 104 | 101 | $te_node_address_visitante = DeCrypt($key,$iv,$_POST['te_node_address_visitante'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 102 | + $te_so_visitante = DeCrypt($key,$iv,$_POST['te_so_visitante'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 103 | + //GravaTESTES('AuthClient: te_node_address_visitante => '.$te_node_address_visitante); | |
| 104 | + //GravaTESTES('AuthClient: te_so_visitante => '.$te_so_visitante); | |
| 105 | + $te_motivo_conexao = DeCrypt($key,$iv,$_POST['te_motivo_conexao'],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 105 | 106 | $dt_hr_autenticacao = date('Y-m-d H:i:s'); |
| 106 | - | |
| 107 | + | |
| 108 | + // ATENÇÃO: Apenas retornará um ARRAY contendo "id_so" e "te_so". | |
| 109 | + $arrSO_visitante = inclui_computador_caso_nao_exista($te_node_address_visitante, | |
| 110 | + '', | |
| 111 | + $te_so_visitante, | |
| 112 | + '', | |
| 113 | + '', | |
| 114 | + '', | |
| 115 | + ''); | |
| 116 | + | |
| 107 | 117 | $query_SESSAO = "INSERT INTO srcacic_sessoes_logs |
| 108 | 118 | (id_sessao, |
| 109 | 119 | id_usuario_visitante, |
| 110 | 120 | te_node_address_visitante, |
| 111 | - dt_hr_ultimo_contato) | |
| 121 | + id_so_visitante, | |
| 122 | + te_motivo_conexao, | |
| 123 | + dt_hr_ultimo_contato, | |
| 124 | + dt_hr_conexao) | |
| 112 | 125 | VALUES (" . $id_sessao . ", |
| 113 | 126 | " . $id_usuario_visitante . ", |
| 114 | 127 | '" . $te_node_address_visitante . "', |
| 115 | - '" . $dt_hr_autenticacao . "')"; | |
| 128 | + " . $arrSO_visitante['id_so'] . ", | |
| 129 | + '" . $te_motivo_conexao . "', | |
| 130 | + '" . $dt_hr_autenticacao . "', | |
| 131 | + '" . $dt_hr_autenticacao . "')"; | |
| 116 | 132 | $result_SESSAO = mysql_query($query_SESSAO); |
| 117 | 133 | |
| 118 | - GravaTESTES('AuthClient: query_SESSAO => '.$query_SESSAO); | |
| 134 | + // GravaTESTES('AuthClient: query_SESSAO => '.$query_SESSAO); | |
| 119 | 135 | |
| 120 | 136 | $retorno_xml_values = '<STATUS>'.EnCrypt($key,$iv,'OK',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</STATUS>'.$retorno_xml_values; |
| 121 | - $retorno_xml_values .= '<ID_USUARIO_VISITANTE>'.EnCrypt($key,$iv,$row['id_usuario'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</ID_USUARIO_VISITANTE>'; | |
| 122 | - $retorno_xml_values .= '<NM_USUARIO_COMPLETO>'.EnCrypt($key,$iv,$row['nm_usuario_completo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</NM_USUARIO_COMPLETO>'; | |
| 123 | - if ($row['te_emails_contato'] <> '') | |
| 137 | + $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>'; | |
| 138 | + $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>'; | |
| 139 | + if ($arrUsuarios['te_emails_contato'] <> '') | |
| 124 | 140 | { |
| 125 | 141 | $strTeNomeComputador = $arrComputadores['te_nome_computador']; |
| 126 | 142 | $strTeIp = $arrComputadores['te_ip']; |
| 127 | 143 | |
| 128 | 144 | // Envio e-mail informando da abertura de sessão |
| 129 | - $corpo_mail = "Prezado usuário(a) ".$row['nm_usuario_completo'].",\n\n | |
| 145 | + $corpo_mail = "Prezado usuário(a) ".$arrUsuarios['nm_usuario_completo'].",\n\n | |
| 130 | 146 | 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 |
| 131 | 147 | _______________________________________________________________________ |
| 132 | 148 | CACIC - Configurador Automático e Coletor de Informações Computacionais\n |
| ... | ... | @@ -134,7 +150,7 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 134 | 150 | Desenvolvido pela Dataprev - Unidade Regional Espírito Santo"; |
| 135 | 151 | |
| 136 | 152 | // Manda mail para os administradores. |
| 137 | - mail($row['te_emails_contato'], "Sistema CACIC - Módulo srCACIC - Autenticação para Suporte Remoto Seguro", "$corpo_mail", "From: cacic@{$_SERVER['SERVER_NAME']}"); | |
| 153 | + //mail($arrUsuarios['te_emails_contato'], "Sistema CACIC - Módulo srCACIC - Autenticação para Suporte Remoto Seguro", "$corpo_mail", "From: cacic@{$_SERVER['SERVER_NAME']}"); | |
| 138 | 154 | } |
| 139 | 155 | } |
| 140 | 156 | else | ... | ... |
ws/srcacic_get_config.php
| ... | ... | @@ -67,9 +67,10 @@ $arrSO = inclui_computador_caso_nao_exista( $te_node_address, |
| 67 | 67 | '', |
| 68 | 68 | '', |
| 69 | 69 | '', |
| 70 | - ''); | |
| 70 | + ''); | |
| 71 | + | |
| 72 | +$arrComputadores = getValores('computadores', 'te_palavra_chave,id_ip_rede' , 'te_node_address = "'.$te_node_address.'" and id_so = '.$arrSO['id_so']); | |
| 71 | 73 | |
| 72 | -$arrComputadores = getValores('computadores', 'te_palavra_chave,id_ip_rede' , 'te_node_address = "'.$te_node_address.'" and id_so = '.$arrSO['id_so']);; | |
| 73 | 74 | $strTePalavraChave = $arrComputadores['te_palavra_chave']; |
| 74 | 75 | $strIdIpRede = $arrComputadores['id_ip_rede']; |
| 75 | 76 | ... | ... |
ws/srcacic_set_session.php
| ... | ... | @@ -35,12 +35,13 @@ $v_cs_compress = (trim($_POST['cs_compress']) <> ''?trim($_POST['cs_compress']) |
| 35 | 35 | |
| 36 | 36 | $v_cs_cipher = '1'; |
| 37 | 37 | |
| 38 | +// Algumas estações enviarão uma string para extensão de bloco | |
| 38 | 39 | $strPaddingKey = ''; |
| 39 | 40 | |
| 40 | 41 | // Autenticação da Estação Visitada |
| 41 | 42 | $te_node_address = DeCrypt($key,$iv,$_POST['te_node_address'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 42 | 43 | $te_so = DeCrypt($key,$iv,$_POST['te_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| 43 | -$te_palavra_chave = DeCrypt($key,$iv,$_POST['te_palavra_chave'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 44 | +$te_palavra_chave = DeCrypt($key,$iv,urldecode($_POST['te_palavra_chave']) ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 44 | 45 | |
| 45 | 46 | // ATENÇÃO: Apenas retornará um ARRAY contendo "id_so" e "te_so". |
| 46 | 47 | $arrSO = inclui_computador_caso_nao_exista( $te_node_address, |
| ... | ... | @@ -51,9 +52,12 @@ $arrSO = inclui_computador_caso_nao_exista( $te_node_address, |
| 51 | 52 | '', |
| 52 | 53 | ''); |
| 53 | 54 | |
| 54 | -$arrComputadores = getValores('computadores', 'te_palavra_chave' , 'te_node_address = "'.$te_node_address.'" and id_so = '.$arrSO['id_so']); | |
| 55 | +$arrComputadores = getValores('computadores', 'te_palavra_chave,id_ip_rede' , 'te_node_address = "'.$te_node_address.'" and id_so = '.$arrSO['id_so']); | |
| 56 | +$arrRedes = getValores('redes' , 'id_local' , 'id_ip_rede= "'.$arrComputadores['id_ip_rede'].'"'); | |
| 55 | 57 | $strTePalavraChave = $arrComputadores['te_palavra_chave']; |
| 56 | 58 | |
| 59 | +//LimpaTESTES(); | |
| 60 | + | |
| 57 | 61 | // Valido a Palavra-Chave e monto a tripa com os nomes e ids dos domínios |
| 58 | 62 | if ($te_palavra_chave == $strTePalavraChave) |
| 59 | 63 | { |
| ... | ... | @@ -71,61 +75,126 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 71 | 75 | te_ip_dominio, |
| 72 | 76 | id_tipo_protocolo, |
| 73 | 77 | nu_versao_protocolo, |
| 74 | - te_string_DN' , 'id_dominio = '.$id_dominio.' AND in_ativo="S"'); | |
| 78 | + te_base_consulta_raiz, | |
| 79 | + te_base_consulta_folha, | |
| 80 | + te_atributo_identificador, | |
| 81 | + te_atributo_retorna_nome, | |
| 82 | + te_atributo_retorna_email' , 'id_dominio = '.$id_dominio.' AND in_ativo="S"'); | |
| 83 | + | |
| 75 | 84 | |
| 85 | + GravaTESTES('SetSession: Valores:'); | |
| 86 | + GravaTESTES('SetSession: nm_nome_acesso_dominio: '.$nm_nome_acesso_dominio); | |
| 87 | + GravaTESTES('SetSession: te_senha_acesso_dominio: '.$te_senha_acesso_dominio); | |
| 88 | + GravaTESTES('SetSession: arrDominios[nm_dominio]: '.$arrDominios['nm_dominio']); | |
| 89 | + GravaTESTES('SetSession: arrDominios[te_ip_dominio]: '.$arrDominios['te_ip_dominio']); | |
| 90 | + GravaTESTES('SetSession: arrDominios[id_tipo_protocolo]: '.$arrDominios['id_tipo_protocolo']); | |
| 91 | + GravaTESTES('SetSession: arrDominios[nu_versao_protocolo]: '.$arrDominios['nu_versao_protocolo']); | |
| 92 | + GravaTESTES('SetSession: arrDominios[te_base_consulta_raiz]: '.$arrDominios['te_base_consulta_raiz']); | |
| 93 | + GravaTESTES('SetSession: arrDominios[te_base_consulta_folha]: '.$arrDominios['te_base_consulta_folha']); | |
| 94 | + GravaTESTES('SetSession: arrDominios[te_atributo_identificador]: '.$arrDominios['te_atributo_identificador']); | |
| 95 | + GravaTESTES('SetSession: arrDominios[te_atributo_retorna_nome]: '.$arrDominios['te_atributo_retorna_nome']); | |
| 96 | + GravaTESTES('SetSession: arrDominios[te_atributo_retorna_email]: '.$arrDominios['te_atributo_retorna_email']); | |
| 97 | + | |
| 76 | 98 | // Comunicação com o servidor de Domínio, para autenticação |
| 77 | - $ldap = ldap_connect($arrDominios['te_ip_dominio']); | |
| 78 | - if (ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $arrDominios['nu_versao_protocolo'])) | |
| 99 | + | |
| 100 | + $te_atributo_retorna_nome = $arrDominios['te_atributo_retorna_nome']; | |
| 101 | + $te_atributo_retorna_email = $arrDominios['te_atributo_retorna_email']; | |
| 102 | + $te_host = $arrDominios['nm_dominio']; | |
| 103 | + | |
| 104 | + $ldap = ldap_connect($te_host,389); | |
| 105 | + | |
| 106 | + GravaTESTES('SetSession: Após CONNECT em "'.$te_host.'" => '.ldap_error($ldap)); | |
| 107 | + | |
| 108 | + ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $arrDominios['nu_versao_protocolo']); | |
| 109 | + GravaTESTES('SetSession: Após SET_OPTION => '.ldap_error($ldap)); | |
| 110 | + | |
| 111 | + //ldap_start_tls($ldap); | |
| 112 | + | |
| 113 | + if (ldap_errno($ldap) == 0) | |
| 79 | 114 | { |
| 80 | - ldap_bind($ldap); | |
| 81 | - if (ldap_errno($ldap) == 0) | |
| 115 | + GravaTESTES('SetSession: Tentando BIND Identificado com "'.$nm_nome_acesso_dominio.' / **********"'); | |
| 116 | + | |
| 117 | + $bindTesteAnonimo=ldap_bind($ldap); // this is an "anonymous" bind, typically | |
| 118 | + // read-only access | |
| 119 | + GravaTESTES("Bind Anônimo retornou " . $bindTesteAnonimo); | |
| 120 | + | |
| 121 | + //ob_start(); | |
| 122 | + $strBind = $arrDominios['te_atributo_identificador'].'='.$nm_nome_acesso_dominio.','.$arrDominios['te_base_consulta_folha'].','.$arrDominios['te_base_consulta_raiz']; | |
| 123 | + $bind = ldap_bind($ldap, "$strBind", $te_senha_acesso_dominio); | |
| 124 | + //ob_end_flush(); | |
| 125 | + | |
| 126 | + if (ldap_errno($ldap) == 0) | |
| 82 | 127 | { |
| 83 | - ldap_bind($ldap, $arrDominios['nm_dominio']."\\".$nm_nome_acesso_dominio,$te_senha_acesso_dominio); | |
| 84 | - if (ldap_errno($ldap) == 0) | |
| 128 | + $strRootDN = $arrDominios['te_base_consulta_raiz']; | |
| 129 | + $strNodeDN = $arrDominios['te_base_consulta_folha']; | |
| 130 | + GravaTESTES('SetSession: Preparando Search : '.'"'.$strNodeDN.','.$strRootDN.'" / '.'"'.$arrDominios['te_atributo_identificador'].'='.$nm_nome_acesso_dominio.'"'); | |
| 131 | + $searchResults = ldap_search($ldap, "$strNodeDN,$strRootDN",$arrDominios['te_atributo_identificador'].'='.$nm_nome_acesso_dominio); | |
| 132 | + | |
| 133 | + GravaTESTES('SetSession: Após SEARCH => '.ldap_error($ldap)); | |
| 134 | + // OK! Dados encontrados! | |
| 135 | + if (!$searchResults === false) | |
| 85 | 136 | { |
| 86 | - $searchResults = ldap_search($ldap, $arrDominios['te_string_DN'], 'cn=*'.$nm_nome_acesso_dominio.'*'); | |
| 87 | - | |
| 88 | - // OK! Dados encontrados! | |
| 89 | - if (!$searchResults === false) | |
| 137 | + $arrLDAPdata = array(); | |
| 138 | + $ldapResults = ldap_get_entries($ldap, $searchResults); | |
| 139 | + for ($item = 0; $item < $ldapResults['count']; $item++) | |
| 140 | + { | |
| 141 | + for ($attribute = 0; $attribute < $ldapResults[$item]['count']; $attribute++) | |
| 142 | + { | |
| 143 | + $data = $ldapResults[$item][$attribute]; | |
| 144 | + $arrLDAPdata[$data]=$ldapResults[$item][$data][0]; | |
| 145 | + } | |
| 146 | + } | |
| 147 | + | |
| 148 | + GravaTESTES('SetSession: Após GET_ENTRIES => '.ldap_error($ldap)); | |
| 149 | + $nm_nome_completo = $arrLDAPdata[strtolower($arrDominios['te_atributo_retorna_nome'])]; | |
| 150 | + $te_email = $arrLDAPdata[strtolower($arrDominios['te_atributo_retorna_email'])]; | |
| 151 | + GravaTESTES('SetSession: Após GET_ENTRIES => nm_nome_completo: '.$nm_nome_completo); | |
| 152 | + GravaTESTES('SetSession: Após GET_ENTRIES => te_email: '.$te_email); | |
| 153 | + | |
| 154 | + if ($nm_nome_completo <> '') | |
| 90 | 155 | { |
| 91 | - $result = @ldap_get_entries($ldap, $searchResults); | |
| 92 | - $nm_nome_completo = getBindedValue($result,'name'); | |
| 93 | - $te_email = getBindedValue($result,'mail'); | |
| 94 | - $dt_hr_inicio_sessao = date('Y-m-d H:i:s'); | |
| 95 | - | |
| 156 | + $dt_hr_inicio_sessao = date('Y-m-d H:i:s'); | |
| 157 | + | |
| 96 | 158 | if ($te_email <> '') |
| 97 | 159 | { |
| 98 | 160 | // Envio e-mail informando da abertura de sessão |
| 99 | 161 | $corpo_mail = "Prezado usuário(a) ".$nm_nome_completo.",\n\n |
| 100 | 162 | informamos que foi iniciada uma sessão para Suporte Remoto Seguro através do Sistema CACIC em ".$dt_hr_inicio_sessao . "\n\n\n\n |
| 101 | - _______________________________________________________________________ | |
| 102 | - CACIC - Configurador Automático e Coletor de Informações Computacionais\n | |
| 103 | - srCACIC - Módulo para Suporte Remoto Seguro do Sistema CACIC\n | |
| 104 | - Desenvolvido pela Dataprev - Unidade Regional Espírito Santo"; | |
| 105 | - | |
| 163 | + _______________________________________________________________________ | |
| 164 | + CACIC - Configurador Automático e Coletor de Informações Computacionais\n | |
| 165 | + srCACIC - Módulo para Suporte Remoto Seguro do Sistema CACIC\n | |
| 166 | + Desenvolvido pela Dataprev - Unidade Regional Espírito Santo"; | |
| 167 | + | |
| 168 | + GravaTESTES('SetSession: Enviando Email...'); | |
| 106 | 169 | // Manda mail para os administradores. |
| 107 | - mail("$te_email", "Sistema CACIC - Módulo srCACIC - Abertura de Sessão para Suporte Remoto Seguro", "$corpo_mail", "From: cacic@{$_SERVER['SERVER_NAME']}"); | |
| 170 | + //mail("$te_email", "Sistema CACIC - Módulo srCACIC - Abertura de Sessão para Suporte Remoto Seguro", "$corpo_mail", "From: cacic@{$_SERVER['SERVER_NAME']}"); | |
| 108 | 171 | } |
| 109 | 172 | $query_SESSAO = "INSERT INTO srcacic_sessoes |
| 110 | 173 | (dt_hr_inicio_sessao, |
| 111 | - nm_nome_acesso_visitado, | |
| 112 | - nm_nome_completo_visitado, | |
| 174 | + nm_acesso_usuario_visitado, | |
| 175 | + nm_completo_usuario_visitado, | |
| 176 | + te_email_usuario_visitado, | |
| 113 | 177 | te_node_address_visitado, |
| 114 | 178 | id_so_visitado, |
| 115 | 179 | dt_hr_ultimo_contato) |
| 116 | 180 | VALUES ('" . $dt_hr_inicio_sessao . "', |
| 117 | 181 | '" . $nm_nome_acesso_dominio . "', |
| 118 | - '" . $nm_nome_completo . "', | |
| 182 | + '" . $nm_nome_completo . "', | |
| 183 | + '" . $te_email . "', | |
| 119 | 184 | '" . $te_node_address . "', |
| 120 | 185 | '" . $arrSO['id_so'] . "', |
| 121 | 186 | '" . $dt_hr_inicio_sessao . "')"; |
| 187 | + GravaTESTES('SetSession: query_SESSAO: '.$query_SESSAO); | |
| 122 | 188 | $result_SESSAO = mysql_query($query_SESSAO); |
| 123 | 189 | $arrSessoes = getValores('srcacic_sessoes','id_sessao','dt_hr_inicio_sessao="'.$dt_hr_inicio_sessao.'" AND |
| 124 | 190 | te_node_address_visitado="'.$te_node_address.'" AND |
| 125 | 191 | id_so_visitado = "'.$arrSO['id_so'].'"'); |
| 126 | 192 | |
| 193 | + $arrConfiguracoesLocais = getValores('configuracoes_locais','nu_timeout_srcacic','id_local = '.$arrRedes['id_local']); | |
| 194 | + | |
| 127 | 195 | $retorno_xml_values .= '<NM_COMPLETO>'.EnCrypt($key,$iv,$nm_nome_completo,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</NM_COMPLETO>'; |
| 128 | 196 | $retorno_xml_values .= '<ID_SESSAO>'.EnCrypt($key,$iv,$arrSessoes['id_sessao'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</ID_SESSAO>'; |
| 197 | + $retorno_xml_values .= '<NU_TIMEOUT_SRCACIC>'.EnCrypt($key,$iv,$arrConfiguracoesLocais['nu_timeout_srcacic'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</NU_TIMEOUT_SRCACIC>'; | |
| 129 | 198 | } |
| 130 | 199 | } |
| 131 | 200 | } |
| ... | ... | @@ -140,43 +209,38 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 140 | 209 | WHERE id_sessao = ".$id_sessao; |
| 141 | 210 | $result_SESSAO = mysql_query($query_SESSAO); |
| 142 | 211 | |
| 143 | - if ($_POST['te_log'] == '') | |
| 144 | - { | |
| 145 | - $arr_id_usuario_visitante = explode('<REG>',$_POST['id_usuario_visitante']); | |
| 146 | - $arr_te_node_address_visitante = explode('<REG>',$_POST['te_node_address_visitante']); | |
| 147 | - | |
| 148 | - for ($i=0; $i < count($arr_id_usuario_visitante); $i++) | |
| 149 | - { | |
| 150 | - $id_usuario_visitante = DeCrypt($key,$iv,$arr_id_usuario_visitante[$i],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 151 | - $te_node_address_visitante = DeCrypt($key,$iv,$arr_te_node_address_visitante[$i],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 152 | - | |
| 153 | - $query_SESSAO = "UPDATE srcacic_sessoes_logs | |
| 154 | - SET dt_hr_ultimo_contato = '".date('Y-m-d H:i:s')."' | |
| 155 | - WHERE id_sessao = ".$id_sessao." and | |
| 156 | - id_usuario_visitante = ".$id_usuario_visitante; | |
| 157 | - | |
| 158 | - GravaTESTES('SetSession: POST[id_sessao] => '.$_POST['id_sessao']); | |
| 159 | - GravaTESTES('SetSession: id_sessao => '.$id_sessao); | |
| 160 | - GravaTESTES('SetSession: query_SESSAO => '.$query_SESSAO); | |
| 161 | - | |
| 162 | - $result_SESSAO = mysql_query($query_SESSAO); | |
| 163 | - | |
| 164 | - } | |
| 165 | - } | |
| 166 | - else | |
| 212 | + $arr_id_usuario_visitante = explode('<REG>',$_POST['id_usuario_visitante']); | |
| 213 | + $arr_te_node_address_visitante = explode('<REG>',$_POST['te_node_address_visitante']); | |
| 214 | + $arr_te_so_visitante = explode('<REG>',$_POST['te_so_visitante']); | |
| 215 | + | |
| 216 | + for ($i=0; $i < count($arr_id_usuario_visitante); $i++) | |
| 167 | 217 | { |
| 168 | - $te_log = DeCrypt($key,$iv,$_POST['te_log'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 169 | - | |
| 170 | - $query_SESSAO = "UPDATE srcacic_sessoes | |
| 171 | - SET te_log = '".$te_log."' | |
| 172 | - WHERE id_sessao = ".$id_sessao; | |
| 173 | - | |
| 218 | + $id_usuario_visitante = DeCrypt($key,$iv,$arr_id_usuario_visitante[$i],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 219 | + $te_node_address_visitante = DeCrypt($key,$iv,$arr_te_node_address_visitante[$i],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 220 | + $te_so_visitante = DeCrypt($key,$iv,$arr_te_so_visitante[$i],$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 221 | + | |
| 222 | + // ATENÇÃO: Apenas retornará um ARRAY contendo "id_so" e "te_so". | |
| 223 | + $arrSO_visitante = inclui_computador_caso_nao_exista($te_node_address_visitante, | |
| 224 | + '', | |
| 225 | + $te_so_visitante, | |
| 226 | + '', | |
| 227 | + '', | |
| 228 | + '', | |
| 229 | + ''); | |
| 230 | + | |
| 231 | + $query_SESSAO = "UPDATE srcacic_sessoes_logs | |
| 232 | + SET dt_hr_ultimo_contato = '".date('Y-m-d H:i:s')."' | |
| 233 | + WHERE id_sessao = ".$id_sessao." and | |
| 234 | + id_usuario_visitante = ".$id_usuario_visitante." and | |
| 235 | + te_node_address_visitante = '".$te_node_address_visitante."' and | |
| 236 | + id_so_visitante = ".$arrSO_visitante['id_so']; | |
| 237 | + | |
| 174 | 238 | GravaTESTES('SetSession: POST[id_sessao] => '.$_POST['id_sessao']); |
| 175 | 239 | GravaTESTES('SetSession: id_sessao => '.$id_sessao); |
| 176 | 240 | GravaTESTES('SetSession: query_SESSAO => '.$query_SESSAO); |
| 177 | - | |
| 241 | + | |
| 178 | 242 | $result_SESSAO = mysql_query($query_SESSAO); |
| 179 | - | |
| 243 | + | |
| 180 | 244 | } |
| 181 | 245 | |
| 182 | 246 | $retorno_xml_values .= '<OK>'.EnCrypt($key,$iv,'OK',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</OK>'; |
| ... | ... | @@ -186,33 +250,10 @@ if ($te_palavra_chave == $strTePalavraChave) |
| 186 | 250 | if ($retorno_xml_values <> '') |
| 187 | 251 | $retorno_xml_values = '<STATUS>'.EnCrypt($key,$iv,'OK',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</STATUS>'.$retorno_xml_values; |
| 188 | 252 | else |
| 189 | - $retorno_xml_values = '<STATUS>'.EnCrypt($key,$iv,'SetSession ERRO!',$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</STATUS>'; | |
| 253 | + $retorno_xml_values = '<STATUS>'.EnCrypt($key,$iv,'SetSession ERRO! '.ldap_error($ldap),$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</STATUS>'; | |
| 190 | 254 | |
| 191 | 255 | $retorno_xml = $retorno_xml_header . $retorno_xml_values; |
| 192 | 256 | |
| 193 | 257 | echo $retorno_xml; |
| 194 | - | |
| 195 | -// Função para resgatar valores contidos no BIND retornado na autenticação no domínio | |
| 196 | -function getBindedValue($arrBINDED,$strValue) | |
| 197 | - { | |
| 198 | - global $getBindedValue; | |
| 199 | - for ($intVetor=0; $intVetor < count($arrBINDED);$intVetor++) | |
| 200 | - { | |
| 201 | - if (strtolower(gettype(current($arrBINDED)))=='array') | |
| 202 | - getBindedValue(current($arrBINDED),$strValue); | |
| 203 | - else | |
| 204 | - { | |
| 205 | - if (current($arrBINDED) == $strValue) | |
| 206 | - { | |
| 207 | - $getBindedValue = $arrBINDED[current($arrBINDED)][0]; | |
| 208 | - break; | |
| 209 | - } | |
| 210 | - } | |
| 211 | - next($arrBINDED); | |
| 212 | - } | |
| 213 | - return $getBindedValue; | |
| 214 | - } | |
| 215 | - | |
| 216 | -// | |
| 217 | 258 | ?> |
| 218 | - | |
| 219 | 259 | \ No newline at end of file |
| 260 | + | ... | ... |