Changeset 4886


Ignore:
Timestamp:
08/02/11 09:44:07 (13 years ago)
Author:
roberto.santosjunior
Message:

Ticket #1820 - Disponibilizar certificado na sessão do usuário.4867

Location:
trunk/phpgwapi
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.auth_ldap.inc.php

    r4791 r4886  
    5656                        } 
    5757                        /* find the dn for this uid, the uid is not always in the dn */ 
    58                         $attributes     = array('uid','dn','givenName','sn','mail','uidNumber','gidNumber'); 
    59                          
     58                        $attributes     = array('uid','dn','givenName','sn','mail','uidNumber','gidNumber','usercertificate'); 
    6059                        $filter = $GLOBALS['phpgw_info']['server']['ldap_search_filter'] ? $GLOBALS['phpgw_info']['server']['ldap_search_filter'] : '(uid=%user)'; 
    6160                        $filter = str_replace(array('%user','%domain'),array($username,$GLOBALS['phpgw_info']['user']['domain']),$filter); 
     
    7473                                { 
    7574                                        if($allValues[0]['uid'][0] != $username) 
     75                                        { 
     76                                                return false; 
     77                                        } 
     78                                } 
     79                                if($_SESSION['login_certificate']) 
     80                                { 
     81                                        # certificate not equal, not authenticate. 
     82                                        if($allValues[0]['usercertificate'][0] != $_SESSION['login_certificate']) 
    7683                                        { 
    7784                                                return false; 
  • trunk/phpgwapi/inc/class.sessions.inc.php

    r3486 r4886  
    5353                */ 
    5454                var $passwd; 
    55  
     55/** 
     56                * @var string current user certificate, if present 
     57                */ 
     58                var $certificate; 
    5659                /** 
    5760                * @var int current user db/ldap account id 
     
    463466                                $this->passwd_type = $passwd_type; 
    464467                        } 
    465  
     468                        if($_SESSION['login_certificate']) 
     469                        { 
     470                               $this->certificate = $_SESSION['login_certificate']; 
     471                        } 
     472                        else 
     473                        { 
     474                               $this->certificate = false; 
     475                        } 
    466476                        $this->clean_sessions(); 
    467477                        //sessions_::split_login_domain($login,$this->account_lid,$this->account_domain); 
     
    561571                                return False; 
    562572                        } 
    563  
    564573                        $GLOBALS['phpgw_info']['user']  = $this->user; 
    565574                        $GLOBALS['phpgw_info']['hooks'] = $this->hooks; 
    566575 
    567576                        $this->appsession('password','phpgwapi',base64_encode($this->passwd)); 
     577                        if($this->certificate) $this->appsession('certificate','phpgwapi',$this->certificate); 
    568578                        if ($GLOBALS['phpgw']->acl->check('anonymous',1,'phpgwapi')) 
    569579                        { 
  • trunk/phpgwapi/templates/default/login_default.php

    r4794 r4886  
    116116        if(isset($_POST['certificado']) && $_POST['certificado']) 
    117117        { 
    118  
    119             $_SESSION['login_certificado'] = troca_espaco_por_mais(str_replace(chr(0x0D).chr(0x0A),chr(0x0A),str_replace(chr(0x0A).chr(0x0A),chr(0x0A),$_POST['certificado']))); 
     118            $_SESSION['login_certificate'] = troca_espaco_por_mais(str_replace(chr(0x0D).chr(0x0A),chr(0x0A),str_replace(chr(0x0A).chr(0x0A),chr(0x0A),$_POST['certificado']))); 
    120119        } 
    121120        if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) ) 
  • trunk/phpgwapi/templates/default/navbar.inc.php

    r3902 r4886  
    238238                                . lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>'; 
    239239                        } 
    240                         $now = time();                   
    241                         $var['user_info'] = '<b>'.$GLOBALS['phpgw']->common->display_fullname() .'</b>'. ' - ' 
     240                        $now = time(); 
     241                        $var['user_info'] = '<b>'.$GLOBALS['phpgw']->common->display_fullname() . ($GLOBALS['phpgw']->session->appsession('certificate','phpgwapi')?'(' .lang('Identified by Digital Certificate') . ')':'') . '</b>'. ' - ' 
    242242                        . lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' ' 
    243243                        . $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']); 
Note: See TracChangeset for help on using the changeset viewer.