Index: /trunk/phpgwapi/templates/celepar/login.tpl
===================================================================
--- /trunk/phpgwapi/templates/celepar/login.tpl	(revision 17)
+++ /trunk/phpgwapi/templates/celepar/login.tpl	(revision 25)
@@ -12,31 +12,27 @@
 <script language="Javascript">
 <!--
-	function submitIt(event){
-		/*if(event.keyCode == 13)
-			document.login.submit();*/		
-	}
 
 	function setLogin(){
-		if( document.login.organization != null)
-			document.login.login.value = document.login.organization.value+'-'+document.login.user.value;
+		if( document.form_login.organization != null)
+			document.form_login.login.value = document.form_login.organization.value+'-'+document.form_login.user.value;
 		else
-			document.login.login.value = document.login.user.value;			
+			document.form_login.login.value = document.form_login.user.value;			
 	}
 	
 	function getLogin(){
 		var cookie = '{cookie}';
-		if( document.login.organization != null)
-			document.login.user.value= cookie.substring(cookie.indexOf('-')+1,cookie.length);
+		if( document.form_login.organization != null)
+			document.form_login.user.value= cookie.substring(cookie.indexOf('-')+1,cookie.length);
 		else	
-			document.login.user.value= cookie;
+			document.form_login.user.value= cookie;
 
-		if(document.login.user.value == '') {
-			if(document.login.organization != null)
-				document.login.organization.focus();
+		if(document.form_login.user.value == '') {
+			if(document.form_login.organization != null)
+				document.form_login.organization.focus();
 			else
-				document.login.user.focus();
+				document.form_login.user.focus();
 		}
 		else
-			document.login.passwd.focus();
+			document.form_login.passwd.focus();
 	}
 	
@@ -59,25 +55,24 @@
     <td bgcolor="#e8eef7"  height="100%">
     <table cellpadding="0" height="100%" cellspacing="0" width="100%" border="0"><tr><td width="60%">&nbsp;</td><td>
-	<div align="center" class="msgInicial">{cd}<br>{lang_message}<br>{website_title} - 01<br><br></div>
+	<div align="center" class="msgInicial">{cd}<br>{lang_message}<br>{website_title}{frontend_name}<br><br></div>
         <table border="0" bordercolor="#cfcfcf" cellpadding="0" cellspacing="0" width="300">
           <tbody><tr>
-				<FORM name="login" method="post" action="{login_url}" {autocomplete}>
+				<FORM name="form_login" method="post" action="{login_url}" {autocomplete}>
 				<input type="hidden" name="passwd_type" value="text">
-				<input type="hidden" name="login"><tr><td width="60%">&nbsp;</td><td>
-				<input type="hidden" name="account type" value="u">          
+				<input type="hidden" name="account type" value="u">
+				<input type="hidden" name="login">
+				<tr><td width="60%">&nbsp;</td><td>				          
             	<td bgcolor="#f7f7f7" style="border:1px solid black">
-					<table  border="0" cellpadding="0" cellspacing="0" class="tableLogin">
-						<tr><td height="2px">&nbsp;</td></tr>
+					<table border="0" cellpadding="0" cellspacing="0" class="tableLogin">
+						<tr><td width="96" colspan="3">&nbsp;</td></tr>												
 						{select_organization}
-					  <tr>
-						<td width="96" class="loginLabel">{lang_username}:&nbsp;</td>
-						<td width="105"><input name="user" size="15"></td>
-						<td>{select_domain}</td>
-						<td width="43" rowspan="3"><img src="phpgwapi/templates/celepar/images/icon_login.gif" width="43" height="64"></td>
+					    <tr><td width="96" class="loginLabel" align="right">{lang_username}:&nbsp;</td>
+						<td width="96"><input name="user" size="15"></td>
+						<td width="43" rowspan="3" colspan=2><img src="phpgwapi/templates/celepar/images/icon_login.gif" width="43" height="64"></td>
 					  </tr>
 					  <tr>
-						<td width="66" class="loginLabel">{lang_password}:&nbsp;</td>
-						<td width="135"><input name="passwd" type="password" size="15" onKeyDown="javascript:submitIt(event)"></td>
-						<td>&nbsp;</td>		
+						<td width="96" class="loginLabel"  align="right">{lang_password}:&nbsp;</td>
+						<td width="135"><input name="passwd" type="password" size="15"></td>
+
 					  </tr>
 					  <tr>
Index: /trunk/phpgwapi/templates/celepar/navbar.inc.php
===================================================================
--- /trunk/phpgwapi/templates/celepar/navbar.inc.php	(revision 2)
+++ /trunk/phpgwapi/templates/celepar/navbar.inc.php	(revision 25)
@@ -225,4 +225,7 @@
 			. lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
 			. $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+			
+			if($GLOBALS['phpgw_info']['server']['use_frontend_name'])
+				$var['frontend_name'] = " - ".$GLOBALS['phpgw_info']['server']['use_frontend_name'];
 
 			if($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0)
Index: /trunk/phpgwapi/templates/celepar/navbar.tpl
===================================================================
--- /trunk/phpgwapi/templates/celepar/navbar.tpl	(revision 2)
+++ /trunk/phpgwapi/templates/celepar/navbar.tpl	(revision 25)
@@ -70,5 +70,5 @@
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
-  <td width="30%" align="left" id="user_info" nowrap>{user_info} - 01</td>
+  <td width="30%" align="left" id="user_info" nowrap>{user_info}{frontend_name}</td>
   <td width="30%" id="admin_info" nowrap>{current_users}</td>
   <td style="padding-right:10px" width="*" align="right" valign="center" nowrap="true">
Index: /trunk/login.php
===================================================================
--- /trunk/login.php	(revision 16)
+++ /trunk/login.php	(revision 25)
@@ -5,5 +5,5 @@
 	* Originaly written by Dan Kuykendall <seek3r@phpgroupware.org>            *
 	*                      Joseph Engo    <jengo@phpgroupware.org>             *
-	* --------------------------------------------                             *
+	* Updated by Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br>      *
 	*  This program is free software; you can redistribute it and/or modify it *
 	*  under the terms of the GNU General Public License as published by the   *
@@ -80,28 +80,10 @@
 	// whoooo scaring
 
-	if($GLOBALS['phpgw_info']['server']['usecookies'] == True)
-	{
-		$GLOBALS['phpgw']->session->phpgw_setcookie('serverID', '1024');
-		//GLOBALS['phpgw']->session->phpgw_setcookie('eGroupWareLoginTime', time());
-	}
-
-/*
-	if($_GET['cd'] != 10 && $GLOBALS['phpgw_info']['server']['usecookies'] == False)
-	{
-		$GLOBALS['phpgw']->session->setcookie('sessionid');
-		$GLOBALS['phpgw']->session->setcookie('kp3');
-		$GLOBALS['phpgw']->session->setcookie('domain');
-	}
-*/
-
-/* This is not working yet because I need to figure out a way to clear the $cd =1
-	if(isset($_SERVER['PHP_AUTH_USER']) && $_GET['cd'] == '1')
-	{
-		Header('HTTP/1.0 401 Unauthorized');
-		Header('WWW-Authenticate: Basic realm="phpGroupWare"'); 
-		echo 'You have to re-authentificate yourself'; 
-		exit;
-	}
-*/
+	// ServerID => Identify the Apache Frontend.
+	if($GLOBALS['phpgw_info']['server']['usecookies'] == True && $GLOBALS['phpgw_info']['server']['use_frontend_id'])
+	{
+		$GLOBALS['phpgw']->session->phpgw_setcookie('serverID', $GLOBALS['phpgw_info']['server']['use_frontend_id']);
+	}
+
 
 	function check_logoutcode($code)
@@ -111,20 +93,20 @@
 			case 1:
 				return lang('You have been successfully logged out');
-				break;
+				
 			case 2:
 				return lang('Sorry, your login has expired');
-				break;
+				
 			case 4:
 				return lang('Cookies are required to login to this site.');
-				break;
+				
 			case 5:
 				return '<font color="FF0000">' . lang('Bad login or password') . '</font>';
-				break;
+				
 			case 98:
 				return '<font color="FF0000">' . lang('Account is expired') . '</font>';
-				break;
+				
 			case 99:
 				return '<font color="FF0000">' . lang('Blocked, too many attempts') . '</font>';
-				break;
+				
 			case 10:
 				$GLOBALS['phpgw']->session->phpgw_setcookie('sessionid');
@@ -139,5 +121,5 @@
 
 				return '<font color="#FF0000">' . lang('Your session could not be verified.') . '</font>';
-				break;
+				
 			default:
 				return '&nbsp;';
@@ -195,6 +177,6 @@
 	if(isset($passwd_type) || $_POST['submitit_x'] || $_POST['submitit_y'] || $submit)
 	{
-		// TEMPORÁRIO, Login com ou sem organização ////////////////////////////////////////////////////
-		/*$common = CreateObject('phpgwapi.common');
+///// 	Início - Código temporário: Para renomeação de login com organização para sem. //////
+/*		$common = CreateObject('phpgwapi.common');
 		$ldap_conn = $common->ldapConnect();
 		$justthese = array("uid");
@@ -202,12 +184,10 @@
 		$ldap_search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
 		$ldap_info 	 = ldap_get_entries($ldap_conn, $ldap_search);
-		if ($ldap_info['count'] != 0) //Usuário SEM ORG EXISTE.
+		if ($ldap_info['count'] != 0) // Verifica se o login existe sem organização.
 		{
 			$_POST['login'] = $_POST['user'];
 		}
-		ldap_close($ldap_conn);
-		*/
-		// TEMPORÁRIO, Login com ou sem organização ////////////////////////////////////////////////////
-
+		ldap_close($ldap_conn);*/
+/// 	Fim - Código temporário: Para renomeação de login com organização para sem. //////
 		if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' &&
 			!isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['SSL_CLIENT_S_DN']))
@@ -215,8 +195,4 @@
 			$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/login.php','cd=5'));
 		}
-		#if(!isset($_COOKIE['eGroupWareLoginTime']))
-		#{
-		#	$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/login.php','cd=4'));
-		#}
 		
 		// don't get login data again when $submit is true
@@ -320,4 +296,8 @@
 	if($GLOBALS['phpgw_info']['server']['use_prefix_organization'])
 	{
+//		Início - Temporário: Para período de adaptação dos usuários, usando sem organização.
+//		$organization_select = 	"<tr><td width='96' class='loginLabel' align='right'>".lang("organization").":&nbsp;</td>".
+//		$organization_select .= "<td align='left' style='font-weight:bold' class='loginLabel' colspan=2><a style='font-weight:normal;font-decoration:none;text-decoration:none' href='javascript:void(0)' onclick='alert(\"Não é preciso mais selecionar a Organização.\\r\\n Digite apenas o usuário e a senha!\")' onmouseover='this.style.cursor=\"help\"'> automático</a></td></tr>";
+//		Fim - Temporário: Para período de adaptação dos usuários, usando sem organização.		
 		$organization_select = "<tr><td width=\"66\" class=\"loginLabel\">";
 		$organization_select .= lang("organization").":</td>";
@@ -351,5 +331,5 @@
 		$tmpl->set_var('select_organization',$organization_select);
 	}
-
+		
 	$domain_select = '&nbsp;';
 	$last_loginid = $_COOKIE['last_loginid'];
@@ -427,4 +407,7 @@
 	$tmpl->set_var('bg_color_title',($GLOBALS['phpgw_info']['server']['login_bg_color_title']?$GLOBALS['phpgw_info']['server']['login_bg_color_title']:'486591'));
 
+	if($GLOBALS['phpgw_info']['server']['use_frontend_name'])
+		$tmpl->set_var('frontend_name', " - ".$GLOBALS['phpgw_info']['server']['use_frontend_name']);
+
 	if (substr($GLOBALS['phpgw_info']['server']['login_logo_file'],0,4) == 'http')
 	{
Index: /trunk/expressoMail1_2/docs/change_log.txt
===================================================================
--- /trunk/expressoMail1_2/docs/change_log.txt	(revision 24)
+++ /trunk/expressoMail1_2/docs/change_log.txt	(revision 25)
@@ -70,2 +70,5 @@
 - Alterado nome do link "Mais opções" para "Opções", no menu de mensagem aberta;
 - Colocado link "Imprimir" entre os links "Opções" e "Encaminhar", no menu de mensagem aberta;
+
+10/05/2007 - [1.2031]
+- Mensagens plain com subtype = "mixed", com anexo, estavam sendo abertas no corpo da mensagem.
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 13)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 25)
@@ -450,6 +450,6 @@
 				if(strtolower($msg->structure[$msg_number]->subtype) == "mixed" &&  $msg_part == 1)
 					$content .= nl2br(imap_base64(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID)));
-				else
-					$content .= nl2br(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID));
+				else if(!strtolower($msg->structure[$msg_number]->subtype) == "mixed")
+					$content .= nl2br(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID));				
 			}
 		} 
