Changeset 4123 for branches/2.2.0.1/preferences/handlecertificate.php
- Timestamp:
- 04/25/11 09:43:20 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.0.1/preferences/handlecertificate.php
r3991 r4123 16 16 if($_POST['certificado']) 17 17 { 18 $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Digital Certificate Registration'); 19 $GLOBALS['phpgw']->common->phpgw_header(); 20 echo parse_navbar(); 21 echo '<form id="answerForm" name="answerForm" method="POST" action="index.php" >'; 22 echo '<BR/><BR/><BR/>'; 23 18 24 require_once('../security/classes/CertificadoB.php'); 19 25 require_once('../security/classes/Verifica_Certificado.php'); … … 25 31 if (!$c->apresentado) 26 32 { 27 echo '2'.chr(0x0D).chr(0x0A).lang('Fail to get certificate');28 exit();33 echo '<div align="center"><h2>'.lang('Fail to get certificate').'</h2>'; 34 exit(); 29 35 } 30 36 $b = new Verifica_Certificado($c->dados,$cert); … … 37 43 $msg .= "\n" . $linha; 38 44 } 39 echo $msg;45 echo '<div align="center"><h2>'.$msg.'</h2>'; 40 46 exit(); 41 47 } … … 54 60 if (!$ds) 55 61 { 56 echo '4'.chr(0x0D).chr(0x0A).lang('Failure when get user data to login');62 echo '<div align="center"><h2>'.lang('Failure when get user data to login').'</h2>'; 57 63 exit(); 58 64 } … … 77 83 if($info["count"]!=1) 78 84 { 79 echo ' 5'.chr(0x0D).chr(0x0A).lang('Invalid data from users directory').'('.$cert_atrib_cpf.' = ' . $c->dados['2.16.76.1.3.1']['CPF'] . ')';85 echo '<div align="center"><h2>'.lang('Invalid data from users directory').'('.$cert_atrib_cpf.' = ' . $c->dados['2.16.76.1.3.1']['CPF'] . ')'.'</h2>'; 80 86 ldap_close($ds); 81 87 exit(); 82 88 } 83 if($info[0]["userCertificate"][0] && $cert == $info[0]["userCertificate"][0] ) 89 if($info[0]["uid"][0] != $GLOBALS['phpgw_info']['user']['userid']) 90 { 91 echo '<div align="center"><h2>'.lang('Invalid data from users directory').'('.$cert_atrib_cpf.' = ' . $c->dados['2.16.76.1.3.1']['CPF'] . ' - ' . $info[0]["uid"][0] . ' - ' . $GLOBALS['phpgw_info']['user']['userid'] . ')'.'</h2>'; 92 ldap_close($ds); 93 exit(); 94 } 95 if($info[0]["userCertificate"][0] && $cert == $info[0]["userCertificate"][0] ) 84 96 { 85 97 //echo '0'.chr(0x0D).chr(0x0A).$info[0]["uid"][0].chr(0x0D).chr(0x0A).$info[0]["cryptpassword"][0]; 86 echo ' 6'.chr(0x0D).chr(0x0A).lang('Certificate already registered');98 echo '<div align="center"><h2>'.lang('Certificate already registered').'</h2>'; 87 99 ldap_close($ds); 88 100 exit(); … … 108 120 if(!ldap_modify($ds,$aux1,$user_info)) 109 121 { 110 echo '7'.chr(0x0D).chr(0x0A).lang('Error in Certificate registration'). ' - ' . $aux1; 111 } 112 else 113 { 114 echo '0'.chr(0x0D).chr(0x0A).lang('To conclude your Certificate registration change your password'); 115 } 122 echo '<div align="center"><h2>'.lang('Error in Certificate registration'). ' - ' . $aux1.'</h2>'; 123 } 124 else 125 { 126 echo '<div align="center"><h2>'.lang('To conclude your Certificate registration change your password').'</h2>'; 127 } 128 129 echo '<h2><img style="border:0px;margin:31px 0px 58px 0px;" src="../phpgwapi/templates/default/images/acao.gif" /></h2>'; 130 echo '<input type="submit" name="ok" value="' . lang('ok') . '" ></div></form>'; 131 $GLOBALS['phpgw']->common->phpgw_footer(); 116 132 ldap_close($ds); 117 133 exit(); … … 193 209 </script>'; 194 210 echo $cod_applet; 195 echo '<form method="POST" action="preferences" >';211 echo '<form id="certificateForm" name="certificateForm" method="POST" action="handlecertificate.php" >'; 196 212 echo '<BR/><BR/><BR/>'; 197 213 echo '<div align="center"><h2>'.lang('Getting your Certificate').'</h2>'; 198 214 echo '<h2><img style="border:0px;margin:31px 0px 58px 0px;" src="../phpgwapi/templates/default/images/acao.gif" /></h2>'; 199 echo '<input type="submit" name="cancel" value="' . lang('cancel') . '" ></div>'; 215 echo '<input type="hidden" name="certificado" value="" />'; 216 echo '<input type="submit" name="cancel" value="' . lang('cancel') . '" ></div></form>'; 200 217 $GLOBALS['phpgw']->common->phpgw_footer(); 201 218 }
Note: See TracChangeset
for help on using the changeset viewer.