[903] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * phpGroupWare - preferences * |
---|
| 4 | * http://www.phpgroupware.org * |
---|
| 5 | * Written by Joseph Engo <jengo@phpgroupware.org> * |
---|
| 6 | * -------------------------------------------- * |
---|
| 7 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 8 | * under the terms of the GNU General Public License as published by the * |
---|
| 9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 10 | * option) any later version. * |
---|
| 11 | \**************************************************************************/
|
---|
| 12 |
|
---|
| 13 | $mapa = array('Propriedade de'=>'NOME',
|
---|
| 14 | 'Data de nascimento'=>'NASCIMENTO',
|
---|
| 15 | 'Cpf'=>'CPF',
|
---|
| 16 | 'e-mail'=>'EMAIL',
|
---|
| 17 | 'Identidade(RG)'=>'RG',
|
---|
| 18 | 'Orgão expedidor'=>'ORGAOUF',
|
---|
| 19 | 'PIS/PASEP (NIS)'=>'NIS',
|
---|
| 20 | 'Título de Eleitor'=>'TITULO',
|
---|
| 21 | 'Zona'=>'ZONA',
|
---|
| 22 | 'Seção'=>'SECAO',
|
---|
| 23 | 'Cidade/UF'=>'TITULO_CIDADE_UF',
|
---|
| 24 | 'Cadastro INSS'=>'CADINSS',
|
---|
| 25 | 'Início Validade'=>'INICIO_VALIDADE',
|
---|
| 26 | 'Término Validade'=>'FIM_VALIDADE',
|
---|
| 27 | 'Outros dados'=>'SUBJECT');
|
---|
| 28 | |
---|
| 29 | $GLOBALS['phpgw_info']['flags'] = array( |
---|
| 30 | 'noheader' => True, |
---|
| 31 | 'nonavbar' => True, |
---|
| 32 | 'currentapp' => 'preferences' |
---|
| 33 | ); |
---|
| 34 | |
---|
| 35 | include('../header.inc.php');
|
---|
| 36 |
|
---|
| 37 | if(!isset($_SERVER['HTTPS']))
|
---|
| 38 | {
|
---|
| 39 | $GLOBALS['phpgw']->redirect_link('../preferences');
|
---|
| 40 | }
|
---|
| 41 | if(!$GLOBALS['phpgw_info']['server']['certificado']==1)
|
---|
| 42 | {
|
---|
| 43 | $GLOBALS['phpgw']->redirect_link('../preferences');
|
---|
| 44 | }
|
---|
| 45 | |
---|
| 46 | require_once('../seguranca/certificado.php');
|
---|
| 47 |
|
---|
| 48 | $cert = new certificado;
|
---|
| 49 |
|
---|
| 50 | if(!$cert->apresentado)
|
---|
| 51 | {
|
---|
| 52 | $GLOBALS['phpgw']->redirect_link('../preferences');
|
---|
| 53 | }
|
---|
| 54 | /*
|
---|
| 55 | if(!$cert->dados['CPF'])
|
---|
| 56 | {
|
---|
| 57 | $GLOBALS['phpgw']->redirect_link('../preferences');
|
---|
| 58 | } |
---|
| 59 | */ |
---|
| 60 | $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Dados do Certificado Digital'); |
---|
| 61 | $GLOBALS['phpgw']->common->phpgw_header(); |
---|
| 62 | echo parse_navbar(); |
---|
| 63 |
|
---|
| 64 | if($cert-apresentado)
|
---|
| 65 | {
|
---|
| 66 | echo '<br/><div align="center"><table border="1" witdh="100%">
|
---|
| 67 | <tr bgcolor="#D3DCE3">
|
---|
| 68 | <td><font color="#000066">Item:</font></td><td><font color="#000066">Conteúdo:</font></td></tr>';
|
---|
| 69 | $L=0;
|
---|
| 70 | foreach($mapa as $item => $valor)
|
---|
| 71 | {
|
---|
| 72 | $val = $cert->dados[$valor];
|
---|
| 73 | if ($valor == 'ORGAOUF' || $valor =='TITULO_CIDADE_UF')
|
---|
| 74 | {
|
---|
| 75 | $aux1 = substr($cert->dados[$valor],strlen($cert->dados[$valor])-2,2);
|
---|
| 76 | $aux2 = substr($cert->dados[$valor],0,strlen($cert->dados[$valor])-2);
|
---|
| 77 | $val=$aux2.'/'.$aux1;
|
---|
| 78 | }
|
---|
| 79 | if($valor== 'SUBJECT' )
|
---|
| 80 | {
|
---|
| 81 | $aux1 = explode('subject= ',$cert->dados[$valor]);
|
---|
| 82 | $aux1 = explode('/',$aux1[1]);
|
---|
| 83 | array_shift ($aux1);
|
---|
| 84 | $val = implode('<br>',$aux1);
|
---|
| 85 | }
|
---|
| 86 | echo '<tr bgcolor="'.((++$L % 2) ? '#DDDDDD' : '#EEEEEE').'"><td valign="top">'.$item.' </td><td valign="top"> '.$val.'</td></tr>';
|
---|
| 87 | }
|
---|
| 88 | echo '</table><br/><br/><a href="../preferences"><b>Voltar</b></a></div><br/><br/>';
|
---|
| 89 | }
|
---|
| 90 | else
|
---|
| 91 | {
|
---|
| 92 | $GLOBALS['phpgw']->redirect_link('../preferences');
|
---|
| 93 | } |
---|
| 94 | $GLOBALS['phpgw']->common->phpgw_footer(); |
---|
| 95 |
|
---|
| 96 | unset($cert); |
---|
| 97 | ?> |
---|