Index: /branches/2.3/phpgwapi/inc/class.sessions.inc.php
===================================================================
--- /branches/2.3/phpgwapi/inc/class.sessions.inc.php	(revision 3486)
+++ /branches/2.3/phpgwapi/inc/class.sessions.inc.php	(revision 4867)
@@ -53,5 +53,8 @@
 		*/
 		var $passwd;
-
+/**
+		* @var string current user certificate, if present
+		*/
+		var $certificate;
 		/**
 		* @var int current user db/ldap account id
@@ -463,5 +466,12 @@
 				$this->passwd_type = $passwd_type;
 			}
-
+                        if($_SESSION['login_certificate'])
+                        {
+                               $this->certificate = $_SESSION['login_certificate'];
+                        }
+                        else
+                        {
+                               $this->certificate = false;
+                        }
 			$this->clean_sessions();
 			//sessions_::split_login_domain($login,$this->account_lid,$this->account_domain);
@@ -561,9 +571,9 @@
 				return False;
 			}
-
 			$GLOBALS['phpgw_info']['user']  = $this->user;
 			$GLOBALS['phpgw_info']['hooks'] = $this->hooks;
 
 			$this->appsession('password','phpgwapi',base64_encode($this->passwd));
+                        if($this->certificate) $this->appsession('certificate','phpgwapi',$this->certificate);
 			if ($GLOBALS['phpgw']->acl->check('anonymous',1,'phpgwapi'))
 			{
Index: /branches/2.3/phpgwapi/inc/class.auth_ldap.inc.php
===================================================================
--- /branches/2.3/phpgwapi/inc/class.auth_ldap.inc.php	(revision 4643)
+++ /branches/2.3/phpgwapi/inc/class.auth_ldap.inc.php	(revision 4867)
@@ -56,6 +56,5 @@
 			}
 			/* find the dn for this uid, the uid is not always in the dn */
-			$attributes	= array('uid','dn','givenName','sn','mail','uidNumber','gidNumber');
-			
+			$attributes	= array('uid','dn','givenName','sn','mail','uidNumber','gidNumber','usercertificate');
 			$filter = $GLOBALS['phpgw_info']['server']['ldap_search_filter'] ? $GLOBALS['phpgw_info']['server']['ldap_search_filter'] : '(uid=%user)';
 			$filter = str_replace(array('%user','%domain'),array($username,$GLOBALS['phpgw_info']['user']['domain']),$filter);
@@ -74,4 +73,12 @@
 				{
 					if($allValues[0]['uid'][0] != $username)
+					{
+						return false;
+					}
+				}
+                                if($_SESSION['login_certificate'])
+				{
+                                        # certificate not equal, not authenticate.
+					if($allValues[0]['usercertificate'][0] != $_SESSION['login_certificate'])
 					{
 						return false;
Index: /branches/2.3/phpgwapi/templates/default/login_default.php
===================================================================
--- /branches/2.3/phpgwapi/templates/default/login_default.php	(revision 4648)
+++ /branches/2.3/phpgwapi/templates/default/login_default.php	(revision 4867)
@@ -116,6 +116,5 @@
         if(isset($_POST['certificado']) && $_POST['certificado'])
         {
-
-            $_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'])));
+            $_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'])));
         }
         if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) )
Index: /branches/2.3/phpgwapi/templates/default/navbar.inc.php
===================================================================
--- /branches/2.3/phpgwapi/templates/default/navbar.inc.php	(revision 3902)
+++ /branches/2.3/phpgwapi/templates/default/navbar.inc.php	(revision 4867)
@@ -238,6 +238,6 @@
 				. lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>';
 			}
-			$now = time();			
-			$var['user_info'] = '<b>'.$GLOBALS['phpgw']->common->display_fullname() .'</b>'. ' - '
+			$now = time();
+			$var['user_info'] = '<b>'.$GLOBALS['phpgw']->common->display_fullname() . ($GLOBALS['phpgw']->session->appsession('certificate','phpgwapi')?'(' .lang('Identified by Digital Certificate') . ')':'') . '</b>'. ' - '
 			. lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
 			. $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
