Index: /branches/2.2/phpgwapi/templates/default/login_default.php
===================================================================
--- /branches/2.2/phpgwapi/templates/default/login_default.php	(revision 3503)
+++ /branches/2.2/phpgwapi/templates/default/login_default.php	(revision 3550)
@@ -434,21 +434,23 @@
 
 	$tmpl->set_var('autocomplete', ($GLOBALS['phpgw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : ''));
-// soh mostra o captcha se for login sem certificado....
-if($GLOBALS['phpgw_info']['server']['captcha'] && $_GET['cd']!='300' )
-    {
-        $aux_captcha = '<input type="hidden" name="' . session_name() . '"  value="' . session_id() . '" >';
-//        setcookie(session_name(),base64_encode(session_convert($key_convert . session_id(),$key_convert)),0);
-        if($valor_contador > $GLOBALS['phpgw_info']['server']['num_badlogin'])
-            {
-                $aux_captcha = '<div class="login_label" >
-                   <img id="id_captcha" src="./security/captcha.php?' . session_name() . '=' . session_id() . '" title="'.lang('Security code').'" alt="'.lang('Security code').'" style="position:static;">
-                   <input class="input" type="text" maxlength="50" size="20" name="codigo" id="codigo" value="" >
-                   <input type="hidden" name="' . session_name() . '"  value="' . session_id() . '" >
-                   </div>';
-            }
-    }
-    $tmpl->set_var('captcha',$aux_captcha);
-// Testa se deve incluir applet para login com certificado......
-if ($_GET['cd']=='300' && $GLOBALS['phpgw_info']['server']['certificado']==1)
+
+	// soh mostra o captcha se for login sem certificado....
+	if($GLOBALS['phpgw_info']['server']['captcha'] && $_GET['cd']!='300' )
+	{
+		$aux_captcha = '<input type="hidden" name="' . session_name() . '"  value="' . session_id() . '" >';
+	//        setcookie(session_name(),base64_encode(session_convert($key_convert . session_id(),$key_convert)),0);
+		if($valor_contador > $GLOBALS['phpgw_info']['server']['num_badlogin'])
+		{
+			$aux_captcha = '<div class="login_label" >
+			   <img id="id_captcha" src="./security/captcha.php?' . session_name() . '=' . session_id() . '" title="'.lang('Security code').'" alt="'.lang('Security code').'" style="position:static;">
+			   <input class="input" type="text" maxlength="50" size="20" name="codigo" id="codigo" value="" >
+			   <input type="hidden" name="' . session_name() . '"  value="' . session_id() . '" >
+			   </div>';
+		}
+	}
+	$tmpl->set_var('captcha',$aux_captcha);
+
+	// Testa se deve incluir applet para login com certificado......
+	if ($_GET['cd']=='300' && $GLOBALS['phpgw_info']['server']['certificado']==1)
 	{
 		//Zera o Cookie contador, responsavel pelo captcha
@@ -461,21 +463,21 @@
 		$var_tokens = '';
 		for($ii = 1; $ii < 11; $ii++)
-			{
-				if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'])
-					$var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ',';
-			}
+		{
+			if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'])
+				$var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ',';
+		}
 
 		if(!$var_tokens)
-			{
-				$var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll';
-			}
-			$param1 = "
-                                                '<param name=\"token\" value=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\"> ' + 
-                                               "; 
-			$param2 = "
-                                                'token=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\" ' + 
-                                               "; 
-				
-			$cod_applet =
+		{
+			$var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll';
+		}
+		$param1 = "
+											'<param name=\"token\" value=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\"> ' +
+										   ";
+		$param2 = "
+											'token=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\" ' +
+										   ";
+
+		$cod_applet =
 
 /*    // com debug ativado
@@ -534,26 +536,28 @@
 	}
 
-else
+	else
 	{
 		if($GLOBALS['phpgw_info']['server']['certificado']==1)
-			{
-				$tmpl->set_var('show','yes');
-				$link_alterna_login = '<img border=0 style="padding: 0px" src="phpgwapi/templates/default/images/lock1_icon.gif"/><a title="' . lang('Link to use digital certificate') . '" href="login.php?cd=300" style="margin: 0px; padding: 0px; text-decoration:none;"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>' . lang('Logon with my digital certificate') . '</b></font></a>';
-			}
-			$tmpl->set_var('lang_username',lang('username'));
-			$tmpl->set_var('action','');
-			$cod_applet = '';
-
-		}
-
-		$tmpl->set_var('applet',$cod_applet);
-		$tmpl->set_var('link_alterna_login',$link_alterna_login);
-		
-
-        $tmpl->set_var('dir_root', 'http://' . nearest_to_me() . '/');
-        if(is_file(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php'))
-        include_once(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php');
-        if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao);
+		{
+			$tmpl->set_var('show','yes');
+			$link_alterna_login = '<img border=0 style="padding: 0px" src="phpgwapi/templates/default/images/lock1_icon.gif"/><a title="' . lang('Link to use digital certificate') . '" href="login.php?cd=300" style="margin: 0px; padding: 0px; text-decoration:none;"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>' . lang('Logon with my digital certificate') . '</b></font></a>';
+		}
+		$tmpl->set_var('lang_username',lang('username'));
+		$tmpl->set_var('action','');
+		$cod_applet = '';
+
+	}
+
+	$tmpl->set_var('applet',$cod_applet);
+	$tmpl->set_var('link_alterna_login',$link_alterna_login);
+
+
+	$tmpl->set_var('dir_root', 'http://' . nearest_to_me() . '/');
+	if(is_file(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php'))
+	include_once(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php');
+	if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao);
+
 	$tmpl->pfp('loginout','login_form');
+
 ?>
 
