Commit 3fcabfc18cf228744d5268a969f60624c2566e1c

Authored by Adriano Vieira
1 parent 12c8e1df
Exists in master and in 1 other branch 3.1

Gerente "trunk" atualizado

- instalador passa a verificar "short_open_tag" ativa
- correção de erro no cadastro de subrede (checagem de consistência de dados informados)
- correção de javascript para atender ao cadastro de subrede

git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@459 fecfc0c7-e812-0410-ae72-849f08638ee7
admin/redes/detalhes_rede.php
@@ -14,6 +14,14 @@ @@ -14,6 +14,14 @@
14 Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 */ 15 */
16 session_start(); 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!');
  22 +else { // Inserir regras para outras verificações (ex: permissões do usuário)!
  23 +}
  24 +
17 require_once('../../include/library.php'); 25 require_once('../../include/library.php');
18 26
19 AntiSpy(); 27 AntiSpy();
admin/redes/incluir_rede.php
@@ -14,6 +14,14 @@ @@ -14,6 +14,14 @@
14 Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 */ 15 */
16 session_start(); 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!');
  22 +else { // Inserir regras para outras verificações (ex: permissões do usuário)!
  23 +}
  24 +
17 include_once "../../include/library.php"; 25 include_once "../../include/library.php";
18 26
19 AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... 27 AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao...
@@ -200,7 +208,7 @@ function SetaServidorUpdates() @@ -200,7 +208,7 @@ function SetaServidorUpdates()
200 208
201 function valida_form(frmForm) 209 function valida_form(frmForm)
202 { 210 {
203 - VerRedeMascara(frmForm.name,true,false); 211 + //VerRedeMascara(frmForm.name,true,false);
204 if ( document.form.frm_nu_limite_ftp.value == "" ) 212 if ( document.form.frm_nu_limite_ftp.value == "" )
205 { 213 {
206 document.form.frm_nu_limite_ftp.value = "30"; 214 document.form.frm_nu_limite_ftp.value = "30";
@@ -212,7 +220,7 @@ function valida_form(frmForm) @@ -212,7 +220,7 @@ function valida_form(frmForm)
212 return false; 220 return false;
213 } 221 }
214 222
215 - /* 223 +
216 var ip = document.form.frm_id_ip_rede.value; 224 var ip = document.form.frm_id_ip_rede.value;
217 var ipSplit = ip.split(/\./); 225 var ipSplit = ip.split(/\./);
218 226
@@ -228,7 +236,7 @@ function valida_form(frmForm) @@ -228,7 +236,7 @@ function valida_form(frmForm)
228 document.form.frm_te_mascara_rede.focus(); 236 document.form.frm_te_mascara_rede.focus();
229 return false; 237 return false;
230 } 238 }
231 - */ 239 +
232 if ( document.form.frm_nm_rede.value == "" ) 240 if ( document.form.frm_nm_rede.value == "" )
233 { 241 {
234 alert("O nome da rede é obrigatório. Por favor, informe-o."); 242 alert("O nome da rede é obrigatório. Por favor, informe-o.");
@@ -253,12 +261,6 @@ function valida_form(frmForm) @@ -253,12 +261,6 @@ function valida_form(frmForm)
253 document.form.frm_nu_porta_serv_updates.focus(); 261 document.form.frm_nu_porta_serv_updates.focus();
254 return false; 262 return false;
255 } 263 }
256 - else if ( document.form.frm_te_path_serv_updates.value == "" )  
257 - {  
258 - alert("Digite o Path no Servidor de Updates");  
259 - document.form.frm_te_path_serv_updates.focus();  
260 - return false;  
261 - }  
262 else if ( document.form.frm_nm_usuario_login_serv_updates.value == "" ) 264 else if ( document.form.frm_nm_usuario_login_serv_updates.value == "" )
263 { 265 {
264 alert("Digite o Nome do Usuário para Login no Servidor de Updates pelo Módulo Agente"); 266 alert("Digite o Nome do Usuário para Login no Servidor de Updates pelo Módulo Agente");
@@ -283,6 +285,12 @@ function valida_form(frmForm) @@ -283,6 +285,12 @@ function valida_form(frmForm)
283 document.form.frm_te_senha_login_serv_updates_gerente.focus(); 285 document.form.frm_te_senha_login_serv_updates_gerente.focus();
284 return false; 286 return false;
285 } 287 }
  288 + else if ( document.form.frm_te_path_serv_updates.value == "" )
  289 + {
  290 + alert("Digite o Path no Servidor de Updates");
  291 + document.form.frm_te_path_serv_updates.focus();
  292 + return false;
  293 + }
286 return true; 294 return true;
287 } 295 }
288 </script> 296 </script>
include/cacic.js
@@ -118,7 +118,6 @@ function Trim(Dado) @@ -118,7 +118,6 @@ function Trim(Dado)
118 } 118 }
119 function VerRedeMascara(strFormName,boolPreencheIPs,boolConfirma) 119 function VerRedeMascara(strFormName,boolPreencheIPs,boolConfirma)
120 { 120 {
121 - alert('1');  
122 var frmForm = document.getElementById(strFormName); 121 var frmForm = document.getElementById(strFormName);
123 var arrIdIpRede = (frmForm.frm_id_ip_rede.value).split('.'); 122 var arrIdIpRede = (frmForm.frm_id_ip_rede.value).split('.');
124 var arrTeMascaraRede = (frmForm.frm_te_mascara_rede.value).split('.'); 123 var arrTeMascaraRede = (frmForm.frm_te_mascara_rede.value).split('.');
@@ -178,8 +177,7 @@ function VerRedeMascara(strFormName,boolPreencheIPs,boolConfirma) @@ -178,8 +177,7 @@ function VerRedeMascara(strFormName,boolPreencheIPs,boolConfirma)
178 177
179 function PreencheIPs(strFormName,strIPInicio,strIPFim) 178 function PreencheIPs(strFormName,strIPInicio,strIPFim)
180 { 179 {
181 - alert('Recebí "'+strFormName+'"');  
182 - var frmForm = document.getElementById(strFormName); 180 + var frmForm = document.getElementById(strFormName);
183 frmForm.frm_id_ip_inicio.value = strIPInicio; 181 frmForm.frm_id_ip_inicio.value = strIPInicio;
184 frmForm.frm_id_ip_fim.value = strIPFim; 182 frmForm.frm_id_ip_fim.value = strIPFim;
185 } 183 }
include/define.php
@@ -87,6 +87,14 @@ defined( &#39;CACIC&#39; ) or die( &#39;Acesso restrito (Restricted access)!&#39; ); @@ -87,6 +87,14 @@ defined( &#39;CACIC&#39; ) or die( &#39;Acesso restrito (Restricted access)!&#39; );
87 define( 'CACIC_PHPRG', 'on'); 87 define( 'CACIC_PHPRG', 'on');
88 88
89 /** 89 /**
  90 + * define a Short_open_tag para executar PHP para o CACIC
  91 + */
  92 + if(isset($cacic_short_open_tag))
  93 + define( 'CACIC_PHPSOT', $cacic_short_open_tag);
  94 + else
  95 + define( 'CACIC_PHPSOT', 'on');
  96 +
  97 +/**
90 * define a register_long_arrays para executar PHP para o CACIC 98 * define a register_long_arrays para executar PHP para o CACIC
91 */ 99 */
92 if(isset($cacic_register_long_arrays)) 100 if(isset($cacic_register_long_arrays))
instalador/classes/install.php
@@ -224,6 +224,26 @@ class Install { @@ -224,6 +224,26 @@ class Install {
224 $this->oTmpl->addVar('tmplNavBarCheckInstall', 'CFGFILE_HELP', $this->oLang->_('kciq_msg phpcfgfile_help')); 224 $this->oTmpl->addVar('tmplNavBarCheckInstall', 'CFGFILE_HELP', $this->oLang->_('kciq_msg phpcfgfile_help'));
225 $_SESSION['saveCfgFile'] = false; 225 $_SESSION['saveCfgFile'] = false;
226 } 226 }
  227 + echo "Short tags [".ini_get('short_open_tag') ."]";
  228 + /*
  229 + * verifica se short_open_tag está ativa
  230 + */
  231 + $phpShortOpenTag = ((strtoupper(ini_get('short_open_tag')) == 'ON') or (ini_get('short_open_tag') == 1)) ? "ON" : "OFF";
  232 + $cacicSOT = (strtoupper(CACIC_PHPSOT) == 'ON' or CACIC_PHPSOT == 1) ? "ON" : "OFF";
  233 +
  234 + if ($cacicSOT == $phpShortOpenTag) {
  235 + $this->oTmpl->addVar('tmplNavBarCheckInstall', 'CACIC_PHPSOT', $cacicSOT );
  236 + $this->oTmpl->addVar('tmplNavBarCheckInstall', 'PHPSOT_STATUS', $phpShortOpenTag);
  237 + $this->oTmpl->addVar('tmplNavBarCheckInstall', 'PHPSOT_CLASS', "SimImg");
  238 + }
  239 + else {
  240 + $this->oTmpl->addVar('tmplNavBarCheckInstall', 'CACIC_PHPSOT', $cacicSOT);
  241 + $this->oTmpl->addVar('tmplNavBarCheckInstall', 'PHPSOT_STATUS', $phpShortOpenTag);
  242 + $this->oTmpl->addVar('tmplNavBarCheckInstall', 'PHPSOT_CLASS', "NaoImg");
  243 + $this->oTmpl->addVar('tmplNavBarCheckInstall', 'PHPSOT_HELP', $this->oLang->_('kciq_msg php_flag_on'));
  244 + $lCouldContinue = false;
  245 + }
  246 +
227 247
228 /* 248 /*
229 * verifica se Register_globals está ativa 249 * verifica se Register_globals está ativa
instalador/templates/install_navbar.tmpl
@@ -196,6 +196,22 @@ @@ -196,6 +196,22 @@
196 </span> 196 </span>
197 </td> 197 </td>
198 </tr> 198 </tr>
  199 + <tr>
  200 + <td class="item">
  201 + Short Open Tags:
  202 + </td>
  203 + <td>
  204 + {CACIC_PHPSOT}
  205 + </td>
  206 + <td>
  207 + <span class="{PHPSOT_CLASS}">
  208 + {PHPSOT_STATUS}
  209 + </span>
  210 + <span class="small">
  211 + {PHPSOT_HELP}
  212 + </span>
  213 + </td>
  214 + </tr>
199 <tr> 215 <tr>
200 <td class="item"> 216 <td class="item">
201 Register Long Arrays: 217 Register Long Arrays: