Changeset 3999


Ignore:
Timestamp:
04/13/11 09:21:36 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #1739 - Login com certificado em atributo customizável

Location:
branches/2.2.0.1/phpgwapi/templates/default
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.0.1/phpgwapi/templates/default/login.tpl

    r3624 r3999  
    141141                <div id="login"> 
    142142      <div align="center"> 
     143<input type="hidden" name="certificado" value=""> 
    143144<input type="hidden" name="passwd_type" value="text"> 
    144145<input type="hidden" name="account type" value="u"> 
  • branches/2.2.0.1/phpgwapi/templates/default/login_default.php

    r3624 r3999  
    5757                } 
    5858        } 
     59function troca_espaco_por_mais($pem_data) 
     60        { 
     61            $begin = "CERTIFICATE-----"; 
     62            $end   = "-----END"; 
     63            $aux = substr($pem_data, strpos($pem_data, $begin)+strlen($begin)); 
     64            $aux = substr($aux, 0, strpos($aux, $end)); 
     65            $aux = strtr($aux,' ','+'); 
     66            $aux = '-----BEGIN CERTIFICATE-----'.$aux.'-----END CERTIFICATE-----'; 
     67            return $aux; 
     68        } 
     69        /* Program starts here */ 
    5970         
    60         /* Program starts here */ 
    61  
    6271        if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) 
    6372        { 
     
    198207                                list($forward,$extra_vars) = explode('?',$forward,2); 
    199208                        } 
     209                        if(isset($_POST['certificado']) && $_POST['certificado']) 
     210                        { 
     211                            //$xcert = str_replace(chr(0x0A).chr(0x0A),chr(0x0A),$_POST['certificado']); 
     212                            $GLOBALS['phpgw_info']['user']['login_certificado'] = troca_espaco_por_mais(str_replace(chr(0x0A).chr(0x0A),chr(0x0A),$_POST['certificado'])); 
     213                        } 
    200214                if ($GLOBALS['phpgw_info']['server']['use_https'] != 2) 
    201215                        { 
Note: See TracChangeset for help on using the changeset viewer.