Commit 322781bb017607d0c9b91f991791ffa6df0a3512
1 parent
f01cf654
Exists in
master
Adicionado links, para alterar senha e email a página do usuário
Showing
1 changed file
with
17 additions
and
21 deletions
Show diff stats
ieducar/intranet/meusdados.php
@@ -93,11 +93,11 @@ class indice extends clsCadastro | @@ -93,11 +93,11 @@ class indice extends clsCadastro | ||
93 | $this->p_cod_pessoa_fj = $_SESSION['id_pessoa']; | 93 | $this->p_cod_pessoa_fj = $_SESSION['id_pessoa']; |
94 | $objPessoa = new clsPessoaFj(); | 94 | $objPessoa = new clsPessoaFj(); |
95 | $db = new clsBanco(); | 95 | $db = new clsBanco(); |
96 | - $db->Consulta("SELECT f.matricula, f.senha, f.ativo, f.ramal, f.ref_cod_setor, f.ref_cod_funcionario_vinculo, f.ref_cod_setor_new FROM funcionario f WHERE f.ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}"); | 96 | + $db->Consulta("SELECT f.matricula, f.senha, f.ativo, f.ramal, f.ref_cod_setor, f.ref_cod_funcionario_vinculo, f.ref_cod_setor_new, email FROM funcionario f WHERE f.ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}"); |
97 | 97 | ||
98 | if ($db->ProximoRegistro()) { | 98 | if ($db->ProximoRegistro()) { |
99 | list($this->f_matricula, $this->f_senha, $this->f_ativo, $this->f_ramal, | 99 | list($this->f_matricula, $this->f_senha, $this->f_ativo, $this->f_ramal, |
100 | - $this->f_ref_setor, $this->ref_cod_funcionario_vinculo, $this->ref_cod_setor) = $db->Tupla(); | 100 | + $this->f_ref_setor, $this->ref_cod_funcionario_vinculo, $this->ref_cod_setor, $this->email) = $db->Tupla(); |
101 | 101 | ||
102 | list($this->p_nm_pessoa, $this->p_id_federal, $this->p_endereco, $this->p_cep, | 102 | list($this->p_nm_pessoa, $this->p_id_federal, $this->p_endereco, $this->p_cep, |
103 | $this->p_ref_bairro, $this->p_ddd_telefone_1, $this->p_telefone_1, | 103 | $this->p_ref_bairro, $this->p_ddd_telefone_1, $this->p_telefone_1, |
@@ -302,7 +302,15 @@ class indice extends clsCadastro | @@ -302,7 +302,15 @@ class indice extends clsCadastro | ||
302 | 302 | ||
303 | $this->campoTexto("p_http", "Site", $this->p_http, "50", "255", FALSE); | 303 | $this->campoTexto("p_http", "Site", $this->p_http, "50", "255", FALSE); |
304 | 304 | ||
305 | - $this->campoTexto("p_email", "E-mail", $this->p_email, "50", "255", FALSE); | 305 | + // exibe o email definido pelo usuário ($this->email) no lugar do email da pessoa ($this->p_email) |
306 | + $this->campoRotulo('email', 'E-mail', $this->email . " <a href='/module/Usuario/AlterarEmail' class='decorated'>alterar e-mail</a>"); | ||
307 | + | ||
308 | + if (empty($_SESSION['convidado'])) { | ||
309 | + $this->campoRotulo('senha', 'Senha', '********' . " <a href='/module/Usuario/AlterarSenha' class='decorated'>alterar senha</a>"); | ||
310 | + | ||
311 | + //$this->campoSenha("f_senha", "Senha", $this->f_senha, FALSE); | ||
312 | + //$this->campoOculto("confere_senha", $this->f_senha); | ||
313 | + } | ||
306 | 314 | ||
307 | $lista_sexos = array(); | 315 | $lista_sexos = array(); |
308 | $lista_sexos[''] = 'Escolha uma opção...'; | 316 | $lista_sexos[''] = 'Escolha uma opção...'; |
@@ -310,11 +318,6 @@ class indice extends clsCadastro | @@ -310,11 +318,6 @@ class indice extends clsCadastro | ||
310 | $lista_sexos['F'] = 'Feminino'; | 318 | $lista_sexos['F'] = 'Feminino'; |
311 | $this->campoLista("p_sexo", "Sexo", $lista_sexos, $this->p_sexo); | 319 | $this->campoLista("p_sexo", "Sexo", $lista_sexos, $this->p_sexo); |
312 | 320 | ||
313 | - if (empty($_SESSION['convidado'])) { | ||
314 | - $this->campoSenha("f_senha", "Senha", $this->f_senha, FALSE); | ||
315 | - $this->campoOculto("confere_senha", $this->f_senha); | ||
316 | - } | ||
317 | - | ||
318 | $dba = new clsBanco(); | 321 | $dba = new clsBanco(); |
319 | $opcoes = array(); | 322 | $opcoes = array(); |
320 | $dba->Consulta("SELECT cod_funcionario_vinculo, nm_vinculo FROM funcionario_vinculo ORDER BY nm_vinculo ASC"); | 323 | $dba->Consulta("SELECT cod_funcionario_vinculo, nm_vinculo FROM funcionario_vinculo ORDER BY nm_vinculo ASC"); |
@@ -334,6 +337,7 @@ class indice extends clsCadastro | @@ -334,6 +337,7 @@ class indice extends clsCadastro | ||
334 | 337 | ||
335 | public function Editar() | 338 | public function Editar() |
336 | { | 339 | { |
340 | + | ||
337 | session_start(); | 341 | session_start(); |
338 | $pessoaFj = $_SESSION['id_pessoa']; | 342 | $pessoaFj = $_SESSION['id_pessoa']; |
339 | session_write_close(); | 343 | session_write_close(); |
@@ -405,17 +409,10 @@ class indice extends clsCadastro | @@ -405,17 +409,10 @@ class indice extends clsCadastro | ||
405 | $sql = " ref_cod_setor_new = '{$setor}', "; | 409 | $sql = " ref_cod_setor_new = '{$setor}', "; |
406 | } | 410 | } |
407 | 411 | ||
408 | - if ($this->f_senha != $this->confere_senha) { | ||
409 | - $sql_funcionario = "UPDATE funcionario SET senha=md5('{$this->f_senha}'), data_troca_senha = NOW(), ref_cod_funcionario_vinculo='{$this->ref_cod_funcionario_vinculo}', $sql ramal='{$this->f_ramal}', ref_ref_cod_pessoa_fj='{$pessoaFj}', tempo_expira_senha = 30 WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}"; | ||
410 | - } | ||
411 | - else { | ||
412 | - if (empty($_SESSION['convidado'])) { | ||
413 | - $sql_funcionario = "UPDATE funcionario SET $sql ramal='{$this->f_ramal}', ref_cod_funcionario_vinculo='{$this->ref_cod_funcionario_vinculo}', ref_ref_cod_pessoa_fj='{$pessoaFj}' WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}"; | ||
414 | - } | ||
415 | - else { | ||
416 | - $sql_funcionario = "UPDATE funcionario SET $sql ramal='{$this->f_ramal}', ref_ref_cod_pessoa_fj='{$pessoaFj}' WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}"; | ||
417 | - } | ||
418 | - } | 412 | + if (empty($_SESSION['convidado'])) |
413 | + $sql_funcionario = "UPDATE funcionario SET $sql ramal='{$this->f_ramal}', ref_cod_funcionario_vinculo='{$this->ref_cod_funcionario_vinculo}', ref_ref_cod_pessoa_fj='{$pessoaFj}' WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}"; | ||
414 | + else | ||
415 | + $sql_funcionario = "UPDATE funcionario SET $sql ramal='{$this->f_ramal}', ref_ref_cod_pessoa_fj='{$pessoaFj}' WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}"; | ||
419 | 416 | ||
420 | $db = new clsBanco(); | 417 | $db = new clsBanco(); |
421 | 418 | ||
@@ -435,7 +432,6 @@ class indice extends clsCadastro | @@ -435,7 +432,6 @@ class indice extends clsCadastro | ||
435 | } | 432 | } |
436 | 433 | ||
437 | header('Location: index.php'); | 434 | header('Location: index.php'); |
438 | - return TRUE; | ||
439 | } | 435 | } |
440 | } | 436 | } |
441 | 437 | ||
@@ -450,4 +446,4 @@ $miolo = new indice(); | @@ -450,4 +446,4 @@ $miolo = new indice(); | ||
450 | $pagina->addForm($miolo); | 446 | $pagina->addForm($miolo); |
451 | 447 | ||
452 | // Gera o código HTML | 448 | // Gera o código HTML |
453 | -$pagina->MakeAll(); | ||
454 | \ No newline at end of file | 449 | \ No newline at end of file |
450 | +$pagina->MakeAll(); |