Index: /trunk/phpgwapi/inc/class.setup_process.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.setup_process.inc.php	(revision 1246)
+++ /trunk/phpgwapi/inc/class.setup_process.inc.php	(revision 1247)
@@ -634,12 +634,13 @@
 
 						/* $test array comes from update file.  It is a list of available upgrade functions */
-						@reset($test);
+						@reset($test);						
+						
 						while(list($x,$value) = @each($test))
 						{
-							$this->currentversion = $currentver = $setup_info[$key]['currentver'];
-
+								$this->currentversion = $currentver = $setup_info[$key]['currentver'];
+								 
 							/* build upgrade function name */
 							$function = $appname . '_upgrade' . str_replace(".", '_', $value);
-
+							
 							if($DEBUG)
 							{
@@ -754,6 +755,6 @@
 							}
 							else
-							{
-								break;
+							{								
+								continue;
 							}
 						}
Index: /trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.common.inc.php	(revision 1246)
+++ /trunk/phpgwapi/inc/class.common.inc.php	(revision 1247)
@@ -736,5 +736,5 @@
 			while ($entry=$d->read())
 			{
-				if ($entry != '.' && $entry != '..' && is_dir(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry) && file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/head.inc.php'))
+				if ($entry != '.' && $entry != '..' && is_dir(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry) && !is_link(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry) && file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/head.inc.php'))
 				{
 					$list[$entry]['title'] = $entry;
Index: /trunk/phpgwapi/templates/default/footer.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/footer.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/footer.tpl	(revision 1247)
@@ -1,14 +1,8 @@
-<!-- BEGIN footer -->
-</td></tr></table>
-<table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="{table_bg_color}">
-  <tr>
-    <td>&nbsp;{user_info}<br></td>
-    <td align="center">{current_users}<br></td>
-    <td align="right">{powered_by}&nbsp;<br></td>
-  </tr>
-</table>
-</body>
-</html>
-
-<!-- END footer -->
-
+		 							</td></tr></table>
+									</div>
+		  <!-- Applicationbox Column -->
+		  </td>
+		  </tr>
+  </table>
+</div>
+<!-- END footer.tpl -->
Index: /trunk/phpgwapi/templates/default/login.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/login.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/login.tpl	(revision 1247)
@@ -3,5 +3,4 @@
 <!-- BEGIN login_form -->
 <HEAD>
-
 <META http-equiv="Content-Type" content="text/html; charset={charset}">
 <META name="AUTHOR" content="dGroupWare http://www.eGroupWare.org">
@@ -9,59 +8,108 @@
 <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
 <META NAME="keywords" CONTENT="{website_title} login screen, eGroupWare, groupware, groupware suite">
+<link href="phpgwapi/templates/default/login.css" rel="stylesheet" type="text/css">
+<TITLE>{website_title} - {lang_login}</TITLE>
+<script language="Javascript">
+<!--
 
-<TITLE>{website_title} - {lang_login}</TITLE>
+	function setLogin(){
+		if( document.flogin.organization != null)
+			document.flogin.login.value = document.flogin.organization.value+'-'+document.flogin.user.value;
+		else
+			document.flogin.login.value = document.flogin.user.value;			
+	}
+	
+	function getLogin(){
+		var cookie = '{cookie}';
+		if( document.flogin.organization != null)
+			document.flogin.user.value= cookie.substring(cookie.indexOf('-')+1,cookie.length);
+		else	
+			document.flogin.user.value= cookie;
+
+		if(document.flogin.user.value == '') {
+			if(document.flogin.organization != null)
+				document.flogin.organization.focus();
+			else
+				document.flogin.user.focus();
+		}
+		else
+			document.flogin.passwd.focus();
+	}
+	
+ 	function openWindow(newWidth,newHeight,link) {					
+		newScreenX  = screen.width - newWidth;	
+		newScreenY  = 0;		
+		Window1=window.open(link,'',"width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");				
+	}	
+	-->
+</script>
 </HEAD>
+<body scroll="no"  style="overflow:hidden" onLoad="javascript:getLogin()" bgcolor="#ffffff">
+<div id="conteudo">
+<div style="position: absolute; top:0px; right: 10px;"><span class="login_label">{lang_language}&nbsp;&nbsp;</span>{select_language}</div>
+<div align="center">
+	<div id="conteudo_corpo">
+		<div id="superior">
+		<div id="login">
+      <div align="center">
+<form name="flogin" method="post" action="{login_url}" {autocomplete}>
+<input type="hidden" name="passwd_type" value="text">
+<input type="hidden" name="account type" value="u">
+<input type="hidden" name="login">
+<div id="caixa_login">
+          <div id="reflexo">
+           <div class="titulo_login">Expresso Livre</div>
+           <div id="mensagem" class="msgInicial" >{cd}<br>{lang_message}</div>
+	   {action}
+            <div id="conteudo_login" style="display:{show};">
+              <div class="login_label">
+                <label for="usuario">{lang_username}</label>
+                <br />
+                <input class="input" type="text" maxlength="50" size="20" name="user" id="user" value="">
+              </div>
 
-<body bgcolor="#{bg_color}">
-<a href="{logo_url}"><img src="{logo_file}" alt="{logo_title}" title="{logo_title}" border="0"></a>
-<p>&nbsp;</p>
-<center>{lang_message}</center>
-<p>&nbsp;</p>
-
-<TABLE bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="40%" align="center">
- <TR>
-  <TD>
-   <TABLE border="0" width="100%" bgcolor="#486591" cellpadding="2" cellspacing="1">
-    <TR bgcolor="#{bg_color_title}">
-     <TD align="LEFT" valign="MIDDLE">
-      <font color="#FEFEFE">&nbsp;{website_title}</font>
-     </TD>
-    </TR>
-    <TR bgcolor="#e6e6e6">
-     <TD valign="BASELINE">
-
-		<FORM name="login" method="post" action="{login_url}" {autocomplete}>
-		<input type="hidden" name="passwd_type" value="text">
-		<input type="hidden" name="account type" value="u">
-			<TABLE border="0" align="CENTER" bgcolor="#486591" width="100%" cellpadding="0" cellspacing="0">
-				<TR bgcolor="#e6e6e6">
-					<TD colspan="3" align="CENTER">{cd}</TD>
-				</TR>
-				<TR bgcolor="#e6e6e6">
-					<TD align="RIGHT"><font color="#000000">{lang_username}:&nbsp;</font></TD>
-					<TD><input name="login" value="{cookie}"></TD>
-					<TD>{select_domain}</TD>
-				</TR>
-				<TR bgcolor="#e6e6e6">
-					<TD align="RIGHT"><font color="#000000">{lang_password}:&nbsp;</font></TD>
-					<TD><input name="passwd" type="password"></TD>
-					<TD>&nbsp;</TD>
-				</TR>
-				<TR bgcolor="#e6e6e6">
-					<TD colspan="3" align="CENTER"><input type="submit" value="{lang_login}" name="submitit"></TD>
-				</TR>
-				<TR bgcolor="#e6e6e6">
-					<TD colspan="3" align="right"><font color="#000000" size="-1">eGroupWare {version}</font></TD>
-				</TR>       
-			</TABLE>
-		</FORM>
-     
-     </TD>
-    </TR>
-   </TABLE>
-  </TD>
- </TR>
-</TABLE>
-
-<!-- END login_form -->
-</HTML>
+              <div class="login_label">
+                <label for="senha">{lang_password}</label>
+                <br />
+                <input class="input" type="password" maxlength="50" size="20" name="passwd" id="passwd" value="">
+              </div>
+		{captcha}
+      
+              <input value="{lang_login}" name="submitit" class="button" onclick="javascript:setLogin()" type="submit" style="margin-top:10px"/>
+            </div> 
+<div style="margin-top:5px">
+ {link_alterna_login}
+</div>
+          </div>
+          <div id="rodape_login">
+	    <div class="ajuda"><a target="help" href="./phpgwapi/templates/{template}/help.php?lang={lang}">Ajuda</a></div>
+          </div>
+        </div>
+</form>
+</div>
+</div>
+</div>
+<div id="inferior"><br />
+<div id="rodape">
+<table align="center" cellspacing="0" cellpadding="0" border="0">
+	<tr>
+		<td>
+			<table border="0" cellpadding="0" cellspacing="0" width="300px">
+          		<tbody>
+          			<tr> 
+            			<td>{logo_config}
+				<br><a title="Projeto Expresso Livre" target="_blank" href="http://www.expressolivre.org/">Expresso Livre</a> {version}
+				<br><a title="eGroupWare" target="_blank" href="http://www.egroupware.org/"> Powered by eGroupWare </a></div></td>
+          			</tr>
+        		</tbody>
+        	</table>
+        </td>
+	</tr>
+</table>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div>{applet}</div>
+</body></html>
Index: /trunk/phpgwapi/templates/default/navbar_app.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/navbar_app.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/navbar_app.tpl	(revision 1247)
@@ -1,1 +1,3 @@
-<td align="{align}" valign="top" width="{width}">{value}</td>
+<!--	<TD width="10%" align=center><img src="{img_root}/admin.jpg" width="60" height="62"></TD>-->
+
+<!--<td align="center" width="{width}">{value}</td>-->
Index: /trunk/phpgwapi/templates/default/navbar.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/navbar.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/navbar.tpl	(revision 1247)
@@ -1,39 +1,190 @@
-<!-- BEGIN navbar -->
+<!-- BEGIN navbar_header -->
+<div align="center" id="hiddenButton" style="position:absolute">
+</div>
+<div align="center" id="extraButton" style="position:absolute">
+<table><tr>{app_extra_icons_icon}</tr></table>
+</div>
+{app_extra_icons_div}
+<script language="Javascript">	 
+	function showBar(){
+		bar = document.getElementById("toolbar");	
+		bar.style.visibility = "";
+		bar.style.position ="static";
+		but = document.getElementById("hiddenButton");		
+		but.style.visibility = "";
+		but.style.position = "absolute";		
+		but.style.top = "55px";		
+		but.style.left = "2px";		
+		title = "{hide_bar_txt}";
+		extra = document.getElementById("extraButton");
+		extra.style.visibility = "hidden";		
+		but.innerHTML="<a title='"+title+"' onClick='javascript:changeBar()'><img src='{img_root}/up.button.png'></a>";
+		var neverExpires = new Date("January 01, 2100 00:00:00");
+ 		document.cookie = "showHeader=true"+
+ 						  ";expires=" + neverExpires.toGMTString()+
+ 						  ";path=/";
+	}
+
+	function hideBar(){
+		bar = document.getElementById("toolbar");	
+		bar.style.position ="absolute";
+		bar.style.visibility = "hidden";
+		but = document.getElementById("hiddenButton");		
+		but.style.visibility = "hidden";
+		title = "{show_bar_txt}";
+		extra = document.getElementById("extraButton");
+		extra.style.visibility = ""
+		extra.style.top = "-11px";		
+		extra.style.left = "-10px";		
+		var neverExpires = new Date("January 01, 2100 00:00:00");
+ 		document.cookie = "showHeader=false"+
+ 						  ";expires=" + neverExpires.toGMTString()+
+ 						  ";path=/";
+	}
+	function changeBar(){
+		bar = document.getElementById("toolbar");			
+		if(bar.style.visibility == "hidden")
+			showBar();		
+		else
+			hideBar();
+	}
+	function initBar(val){
+
+		if(val == 'true')
+			showBar();		
+		else
+			hideBar();		
+	}
+var zoominTimer = new Array();
+var zoomoutTimer = new Array();
+function zoom_in(id)
+{
+	clearTimeout(zoomoutTimer[id]);
+	var elem = document.getElementById(id);
+	if (elem.height > 34)
+	{
+		clearTimeout(zoominTimer[id]);
+		return false;
+	}	
+	elem.height += 4;
+	elem.width += 4;
+	zoominTimer[id] = setTimeout('zoom_in("'+id+'");',30);
+}
+function zoom_out(id)
+{
+	clearTimeout(zoominTimer[id]);		
+	var elem = document.getElementById(id);
+	if (elem.height < 24)
+	{
+		clearTimeout(zoomoutTimer[id]);
+		return false;
+	}	
+	elem.height -= 2;
+	elem.width -= 2;
+	zoomoutTimer[id] = setTimeout('zoom_out("'+id+'");',30);
+}
+</script>
+
+<div class="toolbar" id="toolbar" style="visibility:hidden">
+<table border="0" height="50px" width="100%" cellpadding=0 cellspacing=0><tr>
+	<td class="logo_expresso">&nbsp;<br></td>
+	<td align="center">
+	<table width="auto" border="0" cellpadding="0" cellspacing="0">{app_icons}</table>
+	</td><td style="padding-left:0px;padding-right:25px" align="right" nowrap>
+</td></tr></table>
+<div id ="divStatusBar">
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr bgcolor="{navbar_color}">
-  <td align="left">&nbsp;</td>
- </tr>
  <tr>
-  <td>
-   <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="white">
-    <tr >
-	   {applications}  
-    </tr>
-   </table>
+  <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">
+  		<a href="{dir_root}/preferences" title="{title_my_preferences}" alt="{title_my_preferences}" onmouseover="javascript:self.status='{title_my_preferences}'" onmouseout="javascript:self.status=''"><img height="15px" src="{dir_root}/phpgwapi/templates/{template}/images/preferences.png"><font id="links_bar">{my_preferences}</font></a>
+  		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
+  		<a href="#" title="{title_suggestions}" alt="{title_suggestions}" onmouseover="javascript:self.status='{title_suggestions}'" onmouseout="javascript:self.status=''" onclick="javascript:openWindow(400,550,'{dir_root}/help/enviasugestao.php')"><img src="{dir_root}/phpgwapi/templates/{template}/images/critic.png"><font id="links_bar">{suggestions}</font></a>
+  		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+  		<a href="#" title="{title_help}" alt="{title_help}" onmouseover="javascript:self.status='{title_help}'" onmouseout="javascript:self.status=''" onclick="javascript:openWindow(480,510,'{dir_root}/help')"><img src="{dir_root}/phpgwapi/templates/{template}/images/help.png"><font id="links_bar">{help}</font></a>
   </td>
- </tr>  
- <tr bgcolor="{navbar_color}">
-  <td align="left">&nbsp;</td>
  </tr>
 </table>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
-  <td align="left">
-   {powered_by}
-  </td>
- </tr>
-<!-- <tr>
-  <td align="left" colspan="2">
-   {user_info}
-  </td>
-  <td align="right">
-   {current_users}
-  </td>
- </tr>-->
-</table>
-<table width="100%" cellspacing="5"><tr><td>
-<!-- BEGIN app_header -->
-<b>{current_app_header}</b><hr>
-<!-- END app_header -->
-{messages}<br>
-<!-- END navbar -->
+</div>
+</div>
+
+<script language="Javascript">
+ function openWindow(newWidth,newHeight,link)
+  {			
+		
+	newScreenX  = screen.width - newWidth;	
+	newScreenY  = 0;		
+	Window1=window.open(link,'',"width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");
+				
+  }	
+</script>
+<!-- END navbar_header -->
+<!-- BEGIN appbox -->	
+	<div id="divSubContainer">
+		<table width="100%" cellspacing="0" cellpadding="0" border="0">
+		<tr>
+		{sideboxcolstart}
+<!-- END appbox -->
+<!-- BEGIN sidebox_hide_header -->
+	<script language="javascript">
+		new ypSlideOutMenu("menu2", "right", 0, 165, 160, 200)
+	</script>
+
+	<div id="sideboxdragarea" style="position:absolute;left:0px;top:175px">
+	<a href="#" {show_menu_event}="ypSlideOutMenu.showMenu('menu2')" onmouseover="//ypSlideOutMenu.showMenu('menu2')" title="{lang_show_menu}"><img src="{img_root}/dragarea_right.png" /></a>
+	</div>
+	<div id="menu2Container">
+	<div id="menu2Content" style="position: relative; left: 0; text-align: left;">
+		<table cellspacing="0" cellpadding="0" border="0">
+		 <tr><td>
+		  
+		<div style="background-color:#ffffff;border: #9c9c9c 1px solid;padding:5px;">
+<!-- END sidebox_hide_header -->
+<!-- BEGIN sidebox_hide_footer -->
+</div>
+</td><td style="padding-top:10px" valign="top">
+<a href="#" onClick="ypSlideOutMenu.hide('menu2')" ><img src="{img_root}/dragarea_left.png" align="right" /></a>
+</td></tr></table>
+</div>
+</div>
+<script language="Javascript">
+	initBar(GetCookie("showHeader"));
+</script>
+<!-- END sidebox_hide_footer -->
+
+
+
+
+
+<!-- BEGIN navbar_footer -->	
+		{sideboxcolend}
+		<!-- End Sidebox Column -->
+		<!-- Applicationbox Column -->
+		<td id="tdAppbox" valign="top" {remove_padding}>
+		<div id="divAppboxHeader">{current_app_title}</div>
+		<div id="divAppbox" class="divAppbox">
+		<table id="tableDivAppbox" width="98%" cellpadding="0" cellspacing="0">
+		<tr><td>
+<!-- END navbar_footer -->
+<!-- BEGIN extra_blocks_header -->
+<div class="divSidebox">
+	<div class="divSideboxHeader"><span>{lang_title}</span></div>
+	<div>
+		<table width="100%" cellspacing="0" cellpadding="0" border=0>
+<!-- END extra_blocks_header -->
+<!-- BEGIN extra_blocks_footer -->
+	</table>	
+		</div>
+		</div>
+		<div class="sideboxSpace"></div>
+<!-- END extra_blocks_footer -->
+<!-- BEGIN extra_block_row -->
+<tr class="divSideboxEntry">
+<td width="15" align="center" valign="middle" class="textSidebox">{icon_or_star}</td><td class="textSidebox"><a class="textSidebox" href="{item_link}"{target}>{lang_item}</a></td></tr>
+<!-- END extra_block_row -->
+<!-- BEGIN extra_block_spacer -->
+<tr class="divSideboxEntry"> 
+	<td colspan="2" height="8" class="textSidebox">&nbsp;</td>
+</tr>
+<!-- END extra_block_spacer -->
Index: /trunk/phpgwapi/templates/default/login_denylogin.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/login_denylogin.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/login_denylogin.tpl	(revision 1247)
@@ -1,14 +1,14 @@
 
 <!-- BEGIN form -->
-<BODY bgcolor="#FFFFFF">
-<A href="http://www.eGroupWare.org"><img src="phpgwapi/templates/{template_set}/images/logo.gif" title="www.eGroupWare.org" border="0"></a>
+<body bgcolor="#ffffff">
+<a href="http://www.egroupware.org"><img src="phpgwapi/templates/celepar/images/logo.png" alt="eGroupWare" border="0"></a>
 
-<TABLE border="0" height="94%" width="100%">
- <TR>
-  <TD align="CENTER">
-    Opps! You caught us in the middle of a system upgrade.<br>Please, check back with us shortly.
-  </TD>
- </TR>
-</TABLE>
+<table border="0" width="100%">
+ <tr>
+  <td align="center">
+    {deny_msg}
+  </td>
+ </tr>
+</table>
 
 <!-- END form -->
Index: /trunk/phpgwapi/templates/default/css.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/css.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/css.tpl	(revision 1247)
@@ -1,13 +1,7 @@
 <style type="text/css">
 <!--
-	a { text-decoration:none; color: {link}; }
-	a:active{ text-decoration:none; color: {alink}; }
-	a:hover{ text-decoration:underline; color: {alink}; }
-	a:visted{ text-decoration:none; color: {link}; }
-	body { margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: {font}; }
 	.row_on { color: {row_text}; background-color: {row_on}; }
 	.row_off { color: {row_text}; background-color: {row_off}; }
 	.th { color: {th_text}; background-color: {th_bg}; }
-	.tablink { color: #000000; }
 	{app_css}
 -->
Index: /trunk/phpgwapi/templates/default/head.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/head.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/head.tpl	(revision 1247)
@@ -1,16 +1,26 @@
-<!-- BEGIN head --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML>
-<HEAD>
-<META http-equiv="Content-Type" content="text/html; charset={charset}">
-<META name="AUTHOR" content="eGroupWare http://www.egroupware.org">
-<META NAME="description" CONTENT="eGroupWare">
-<META NAME="keywords" CONTENT="eGroupWare">
-<meta name="robots" content="none">
-<LINK REL="ICON" href="{img_icon}" type="image/x-ico">
-<LINK REL="SHORTCUT ICON" href="{img_shortcut}">
-{css}
-<TITLE>{website_title}</TITLE>
-{java_script}
-</HEAD>
-<BODY {body_tags}>
+<!-- BEGIN head -->
+<html xml:lang="{lang_code}" xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>{website_title}</title>
+		<meta http-equiv="content-type" content="text/html; charset={charset}" />
+		<meta name="keywords" content="eGroupWare" />
+		<meta name="description" content="eGroupware" />
+		<meta name="keywords" content="eGroupWare" />
+		<meta name="copyright" content="eGroupWare http://www.egroupware.org (c) 2003" />
+		<meta name="language" content="{lang_code}" />
+		<meta name="author" content="eGroupWare http://www.egroupware.org" />
+		<meta name="robots" content="none" />
+		<link rel="icon" href="{img_icon}" type="image/x-ico" />
+		<link rel="shortcut icon" href="{img_shortcut}" />
+		<link href="{theme_css}" title="eGroupWareStyle" type="text/css" rel="StyleSheet"/>
+		<META http-equiv="Default-Style" content="eGroupWareStyle">
+		{slider_effects}
+		{simple_show_hide}
+		{pngfix}
+		{css}
+		{java_script}
+		{cookie_manager}
+	</head>
+	<!-- we don't need body tags anymore, do we?) we do!!! onload!! LK -->
+	<body {body_tags}>
 <!-- END head -->
Index: /trunk/phpgwapi/templates/default/portal.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/portal.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/portal.tpl	(revision 1247)
@@ -1,11 +1,11 @@
 <!-- BEGIN portal_box -->
-<p>
-<table border="{outer_border}" cellpadding="0" cellspacing="0" width="{outer_width}" bordercolor="{outer_bordercolor}" bgcolor="{outer_bgcolor}">
+<div style="border: 1px solid #adc9d8;border-top:0px">
+<table border="0" cellpadding="0" cellspacing="0" width="{outer_width}"  height="100%"> 
  <tr nowrap align="center">
-  <td align="center" background="{header_background_image}">{title}</td>{portal_controls}
+  <td style="height:19px;border-top:0px;border-bottom:1px solid #d6e2ee;padding:1px;vertical-align:top;background-repeat:repeat-x;background: #fff url(phpgwapi/templates/default/images/bgBlockTitle.png)" align="left" nowrap>&nbsp;<font size="2" color="#003366">{title}</font></td>
  </tr>
  <tr>
-  <td colspan="2">
-   <table border="1" cellpadding="0" cellspacing="0" width="{inner_width}" bgcolor="{inner_bgcolor}">
+  <td style='background: #f4f8fb;border-top:0px solid #adc9d8'>
+   <table border="0" cellpadding="0" height="100%" cellspacing="0" width="{inner_width}">
     {row}
    </table>
@@ -13,16 +13,17 @@
  </tr>
 </table>
-</p>
+</div>
 <!-- END portal_box -->
 <!-- BEGIN portal_row -->
     <tr>
-	  <td>
-{output}
+	  <td >
+		{output}
 	  </td>
     </tr>
 <!-- END portal_row -->
 <!-- BEGIN portal_listbox_header -->
-     <td>
-      <ul>
+	<tr>
+	 <td>
+	  <ul>
 <!-- END portal_listbox_header -->
 <!-- BEGIN portal_listbox_link -->
@@ -30,10 +31,10 @@
 <!-- END portal_listbox_link -->
 <!-- BEGIN portal_listbox_footer -->
-      </ul>
-     </td>
+	  </ul>
+	 </td>
+	</tr>
 <!-- END portal_listbox_footer -->
 <!-- BEGIN portal_control -->
-  <td valign="middle" align="right" nowrap background="{header_background_image}">{control_link}
-  </td>
+  <td valign="middle" align="right" nowrap="nowrap">{control_link}</td>
 <!-- END portal_control -->
 <!-- BEGIN link_field -->
Index: /trunk/phpgwapi/templates/default/login_default.php
===================================================================
--- /trunk/phpgwapi/templates/default/login_default.php	(revision 1246)
+++ /trunk/phpgwapi/templates/default/login_default.php	(revision 1247)
@@ -36,5 +36,7 @@
 			case 99:
 				return '<font color="FF0000">' . lang('Blocked, too many attempts') . '</font>';
-				
+			case 200:
+				return '<font color="FF0000">' . lang('Invalid code') . '</font>';
+			break;				
 			case 10:
 				$GLOBALS['phpgw']->session->phpgw_setcookie('sessionid');
@@ -105,4 +107,21 @@
 	if(isset($passwd_type) || $_POST['submitit_x'] || $_POST['submitit_y'] || $submit)
 	{
+
+	// Primeiro testa o captcha....se houver......
+	if( $GLOBALS['phpgw_info']['server']['captcha']==1)
+		{
+		if(isset($_POST['codigo']))
+			{
+			if ($_SESSION['CAPTCHAString'] != strtoupper($_POST['codigo']))
+				{
+					$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/login.php','cd=200'));
+				}
+			unset($_SESSION['CAPTCHAString']);
+			}
+		}
+	if($_POST['user'])
+		{
+			$_POST['login'] = $_POST['user'];
+		}
 ///// 	Início - Código temporário: Para renomeação de login com organização para sem. //////
 /*		$common = CreateObject('phpgwapi.common');
@@ -375,4 +394,123 @@
 	$tmpl->set_var('autocomplete', ($GLOBALS['phpgw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : ''));
 
+$aux_captcha = '';
+// soh mostra o captcha se for login sem certificado....
+if($GLOBALS['phpgw_info']['server']['captcha'] && $_GET['cd']!='300' )
+	{
+		if($valor_cookie > $GLOBALS['phpgw_info']['server']['num_badlogin'])
+			{
+				$aux_captcha = '<div class="login_label" >
+               <img src="./security/captcha.php" title="'.lang('Security code').'" alt="'.lang('Security code').'" style="width:60;">
+<br />
+                <input class="input" type="text" maxlength="50" size="20" name="codigo" id="codigo" value="" >
+              </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
+		$valor_cookie = 1;
+		setcookie("contador", 1,0);
+
+		$link_alterna_login = '<img border=0 style="padding: 0px 5px 0px 0px" src="phpgwapi/templates/default/images/warning.gif"/><a href="login.php" style="margin: 0px; padding: 0px; text-decoration:none;"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="1">' . lang('Access without Digital Certificate') . '</a>';
+		$tmpl->set_var('show','none');
+		$tmpl->set_var('action','<div id="action"><img style="border:0px;margin:31px 0px 58px 0px;" src="phpgwapi/templates/default/images/acao.gif" /></div>');
+		// gera parametro com tokens suportados ....
+		$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(!$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 =
+
+/*    // com debug ativado
+            '<script type="text/javascript">
+					if (navigator.userAgent.match(\'MSIE\')){
+						document.write(\'<object style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" \' +
+						\'classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"> \' +
+						\'<param name="type" value="application/x-java-applet;version=1.5"> \' +
+						\'<param name="code" value="LoginApplet.class"> \' +
+						\'<param name="locale" value="' . $lang . '"> \' +
+						\'<param name="mayscript" value="true"> \' + '
+						. $param1
+						. ' \'<param name="archive" value="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar"> \' +
+                        \'<param name="debug" value="true"> \' +
+						\'</object>\');
+					}
+					else {
+						document.write(\'<embed style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" code="LoginApplet.class" locale="' . $lang . '"\' +
+						\'archive="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar" \' + '
+						. $param2
+						. ' \'type="application/x-java-applet;version=1.5" debug= "true" mayscript > \' +
+						\'<noembed> \' +
+						\'No Java Support. \' +
+						\'</noembed> \' +
+						\'</embed> \');
+					}
+				</script>';
+*/
+            // sem debug ativado
+            '<script type="text/javascript">
+					if (navigator.userAgent.match(\'MSIE\')){
+						document.write(\'<object style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" \' +
+						\'classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"> \' +
+						\'<param name="type" value="application/x-java-applet;version=1.5"> \' + 
+                                                \'<param name="codebase" value="/security/">\' +
+						\'<param name="code" value="LoginApplet.class"> \' +
+						\'<param name="locale" value="' . $lang . '"> \' +
+						\'<param name="mayscript" value="true"> \' + ' 
+						. $param1 
+						. ' \'<param name="archive" value="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar"> \' +
+						\'</object>\');
+					}
+					else {
+						document.write(\'<embed style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" codebase="/security/" code="LoginApplet.class" locale="' . $lang . '"\' +
+						\'archive="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar" \' + '
+						. $param2  
+						. ' \'type="application/x-java-applet;version=1.5" mayscript > \' +
+						\'<noembed> \' +
+						\'No Java Support. \' +
+						\'</noembed> \' +
+						\'</embed> \');
+					}
+				</script>';
+
+
+	}
+
+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->pfp('loginout','login_form');
 ?>
+
Index: /trunk/phpgwapi/templates/default/navbar.inc.php
===================================================================
--- /trunk/phpgwapi/templates/default/navbar.inc.php	(revision 1246)
+++ /trunk/phpgwapi/templates/default/navbar.inc.php	(revision 1247)
@@ -1,172 +1,464 @@
 <?php
-  /**************************************************************************\
-  * phpGroupWare                                                             *
-  * http://www.phpgroupware.org                                              *
-  * --------------------------------------------                             *
-  *  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   *
-  *  Free Software Foundation; either version 2 of the License, or (at your  *
-  *  option) any later version.                                              *
-  \**************************************************************************/
+	/**************************************************************************\
+	* phpGroupWare                                                             *
+	* http://www.phpgroupware.org                                              *
+	* --------------------------------------------                             *
+	*  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   *
+	*  Free Software Foundation; either version 2 of the License, or (at your  *
+	*  option) any later version.                                              *
+	\**************************************************************************/
 
 
 	function parse_navbar($force = False)
 	{
-		$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-		$tpl->set_unknowns('remove');
-
-		$tpl->set_file(
+		$GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
+
+		$GLOBALS['celepar_tpl']->set_file(
 			array(
-				'navbar'     => 'navbar.tpl',
-				'navbar_app' => 'navbar_app.tpl'
+				'navbar' => 'navbar.tpl'
 			)
 		);
 
-		$var['navbar_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg'];
-
-		if ($GLOBALS['phpgw_info']['flags']['navbar_target'])
-		{
-			$target = ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
-		}
-
-		$i = 1;
+		$GLOBALS['celepar_tpl']->set_block('navbar','navbar_header','navbar_header');
+		$GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_header','extra_block_header');
+		$GLOBALS['celepar_tpl']->set_block('navbar','extra_block_row','extra_block_row');
+		$GLOBALS['celepar_tpl']->set_block('navbar','extra_block_spacer','extra_block_spacer');
+		$GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_footer','extra_blocks_footer');
+		$GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_header','sidebox_hide_header');
+		$GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_footer','sidebox_hide_footer');
+		$GLOBALS['celepar_tpl']->set_block('navbar','appbox','appbox');
+		$GLOBALS['celepar_tpl']->set_block('navbar','navbar_footer','navbar_footer');
+		
+	        $GLOBALS['celepar_tpl']->set_var('my_preferences', lang("My Preferences"));
+                $GLOBALS['celepar_tpl']->set_var('title_my_preferences', lang("Click here to change your Expresso password and other preferences"));
+                $GLOBALS['celepar_tpl']->set_var('title_suggestions', lang("Send your critics, doubts or suggestions"));
+                $GLOBALS['celepar_tpl']->set_var('suggestions', lang("Suggestions"));
+                $GLOBALS['celepar_tpl']->set_var('help', lang("Help"));
+		$GLOBALS['celepar_tpl']->set_var('title_help', lang("Click here for help"));
+		$GLOBALS['celepar_tpl']->set_var('template',$GLOBALS['phpgw_info']['server']['template_set']);
+
+		$var['img_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images';
+		$var['dir_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'];
+		$var['table_bg_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg'];
+
+		if($GLOBALS['phpgw_info']['user']['preferences']['common']['click_or_onmouseover']=='onmouseover')
+		{
+			$show_menu_event = 'onMouseOver';
+		}
+		else
+		{
+			$show_menu_event = 'onClick';
+		}
+
+
+		$applications = '';
+
+		//	== 'icons_and_text')
+
+		$max_icons=$GLOBALS['phpgw_info']['user']['preferences']['common']['max_icons'];
+		 
+		if(!$max_icons)
+		{
+			$max_icons=200;
+		}
+		
+		$i = 0;
 		foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
 		{
-			if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'text')
-			{
-				$tabs[$i]['label'] = $app_data['title'];
-				$tabs[$i]['link']  = $app_data['url'];
-				if (!empty($app_data['target']))
+			$current_app = False;
+				if($app != 'preferences' && $app != 'about' && $app != 'logout')
 				{
-					$tabs[$i]['target'] = $app_data['target'];
-				}
-				elseif (!empty($target))
+					$icon = '<a href="'.$app_data['url'].'">';
+					$title = $GLOBALS['phpgw_info']['apps'][$app]['title'];
+					if ($GLOBALS['phpgw_info']['flags']['currentapp'] == $app)
+					{
+						$icon .= '<img id="'.str_replace('_','',$app).'id" src="' . $app_data['icon'] . '" alt="' . $title . '" title="'. $title . '" border="0" width="35" height="35" nowrap="nowrap"/></a>';
+						$current_app = True;
+					}
+					else
+						$icon .= '<img id="'.str_replace('_','',$app).'id" src="' . $app_data['icon'] . '" alt="' . $title . '" title="'. $title . '" border="0" width="24" height="24" nowrap="nowrap"/></a>';
+
+					// 020204 ndee
+					if($app == 'home') $title = lang('Home');
+	
+					if($app=='home')
+					{
+						if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no')
+						{
+							continue;
+						}
+					}
+				
+					// Verifica qual o formato da Barra de navegação: 
+					// Icone ou Texto, ou Icone e Texto
+					
+
+					if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') {
+						$title_extra = $title;
+						$title = '';
+					}
+					else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){
+						$icon = '';
+					}
+
+					if($i< $max_icons) {
+
+						if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no')
+						{
+							$tdwidth = 100/($max_icons);
+						}
+						else
+						{
+							$tdwidth = 100/($max_icons+2);
+						}
+						
+						$app_icons .= '<td nowrap '.
+						'onmouseover="javascript:'.($current_app?'return true;':'').'this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id)" '.
+						'onmouseout="javascript:'.($current_app?'return true;':'').'this.className=\'navbar_but\'; '.($current_app?'':'zoom_out(this.firstChild.firstChild.id)').'" '.
+						'class="'.($current_app?'navbar_butOut':'navbar_but').'">';
+
+						if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
+						{
+							$app_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
+						}						
+						$app_icons .=  $icon;
+					}
+					
+										
+					$icon = '<img align="center" src="' . $app_data['icon'] . '" alt="' . $title . '" width="16" title="'. $title . '" border="0" />';
+				
+					$app_extra_icons .= '<tr>';
+
+					if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']!='text')
+					{
+						$app_extra_icons .= '<td class="extraIconsRow"><a href="' . $app_data['url'] . '"';
+
+						if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
+						{
+							$app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
+						}
+
+						$app_extra_icons .= ' >' . $icon . '</a></td>';
+					}
+
+
+						$app_extra_icons .= '<td align="left" class="extraIconsRow" style=""><a href="'.$app_data['url'] . '"';
+
+						if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
+						{
+							$app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
+						}
+
+						$app_extra_icons .= '>' . $title_extra . '</a></td></tr>';
+
+					unset($icon);
+					unset($title);
+					$i++;				
+				}
+			}
+			
+			if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']!='no')	
+			{
+			
+				$hint = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
+				$icon = '<img id="logout_id" width="24" height="24" src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'"  alt="'.$hint.'" title="'.$hint.'">';
+				
+				if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') {
+					
+						$title = '';
+				}
+				else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){
+					
+						$icon = '';
+				}			
+				$app_icons .= '<td nowrap '.
+				'onmouseover="javascript:this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id)" '.
+				'onmouseout="javascript:this.className=\'navbar_but\'; zoom_out(this.firstChild.firstChild.id)" '.
+				'class="navbar_but"><a onclick="location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\'">'.$icon.'</td>';
+			}			//			window.location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\'
+			
+			$var['app_icons'] = $app_icons;
+			
+			$hint = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
+			$icon = '<img src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'"  alt="'.$hint.'" title="'.$hint.'">';
+			$title = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
+			
+			$app_extra_icons .= '<td  class="extraIconsRow">
+				<a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$icon.'</a></td>';
+
+			$app_extra_icons .= '<td class="extraIconsRow">
+				<a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$title.'</a></td>';
+
+				
+				$app_extra_icons_div = '
+				<script language="javascript">
+				new ypSlideOutMenu("menu1", "down", 5, 24, 160, 200,\'left\')
+				</script>
+				<div id="menu1Container">
+				<div id="menu1Content" style="position: relative; left: 0; text-align: left;">
+
+				<div id="extraIcons">
+
+				<table cellspacing="0" cellpadding="0" border="0" width="100%">
+				<tr>
+				<td colspan="2" nowrap="nowrap" align="right" style="background-color:#dddddd;padding:1px;">
+				<a href="#" '.$show_menu_event.'="ypSlideOutMenu.hide(\'menu1\')" title="'.lang('close').'">
+				<img style="" border="0" src="'.$var['img_root'].'/close.png"/></a></span></td></tr>
+				<tr>
+				<td colspan="1" valign="top" nowrap="nowrap" align="left" style="background-color:#dddddd;padding:1px;">
+					<a href="#" onClick="javascript:ypSlideOutMenu.hide(\'menu1\');showBar()" title="'.lang('Expand Menu').'">
+					<img src = "'.$var['img_root'].'/down.button.png"></a>
+				</td>
+				<td colspan="1" valign="top" nowrap="nowrap" align="left" style="background-color:#dddddd;padding:1px;">
+					<a href="#" onClick="javascript:ypSlideOutMenu.hide(\'menu1\');showBar()" title="'.lang('Expand Menu').'">
+					<b>'.lang('Expand Menu').'</b></a></td></tr>				
+				'.$app_extra_icons.'</table>
+				</div>
+
+				</div>
+				</div>
+				';
+
+				$var['app_extra_icons_div']= $app_extra_icons_div;				
+				$var['app_extra_icons_icon']= '<td width="26" valign="top" align="right" style="zIndex:10000;padding-right:3px;padding-top:10px;"><a title="'.lang('show_more_apps').'" href="#"  '.$show_menu_event.'="ypSlideOutMenu.showMenu(\'menu1\')"><img src="'.$var['img_root'].'/extra_icons.png" border="0" /></a></td>';
+
+
+			if(isset($GLOBALS['phpgw_info']['flags']['app_header']))
+			{
+				$var['current_app_title'] = $GLOBALS['phpgw_info']['flags']['app_header'];
+			}
+			else
+			{
+				$var['current_app_title']=$GLOBALS['phpgw_info']['navbar'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title'];
+			}
+
+			if(isset($GLOBALS['phpgw_info']['navbar']['admin']) && $GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
+			{
+				$var['current_users'] = '<a href="'
+				. $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions') . '">'
+				. lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>';
+			}
+			$now = time();			
+			$var['user_info'] = '<b>'.$GLOBALS['phpgw']->common->display_fullname() .'</b>'. ' - '
+			. 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'];
+
+			/*
+			 *	Forçar termo de aceite por parte do usuário
+			 */
+
+			if(($GLOBALS['phpgw_info']['user']['agree_terms'] != 1) && ($GLOBALS['phpgw_info']['server']['use_agree_term']=='True')) //Ele deverá confirmar o termo de aceite.
+			{
+				$agreeterm_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/termo_aceite.php';
+				
+				if ($GLOBALS['phpgw_info']['server']['use_https'] == 2)
+					$agreeterm_url = 'https://' . $agreeterm_url;
+				else
+					$agreeterm_url = 'http://' . $agreeterm_url;
+				
+				echo '<script>' .
+						'if(location.href.indexOf("termo_aceite.php") == -1){' .
+							'location.href = "' . $agreeterm_url . '"' .
+						'}' .
+					 '</script>';
+			}
+			
+
+			if(($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == '0') && (($GLOBALS['phpgw_info']['user']['agree_terms'] == 1) || ($GLOBALS['phpgw_info']['server']['use_agree_term']!='True')))
+			{
+				$changepasswd_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/changepassword.php?cd=1';
+				
+				if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)
+					$changepasswd_url = 'https://' . $changepasswd_url;
+				else
+					$changepasswd_url = 'http://' . $changepasswd_url;
+				
+				echo '<script>' .
+						'if(location.href.indexOf("changepassword.php") == -1){' .
+							'location.href = "' . $changepasswd_url . '"' .
+						'}' .
+					 '</script>';
+				
+				/*
+				$api_messages = lang('You are required to change your password during your first login')
+				. '<br> Click this image on the navbar: <img src="'
+				. $GLOBALS['phpgw']->common->image('preferences','navbar.gif').'">';
+				*/
+			}
+			/*
+			elseif($GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - (86400*30))
+			{
+				$api_messages = lang('it has been more then %1 days since you changed your password',30);
+			}
+			*/
+			/*
+			// This is gonna change
+			if(isset($cd))
+			{
+				$var['messages'] = $api_messages . '<br>' . checkcode($cd);
+			}*/
+
+			$var['logo_file'] = $GLOBALS['phpgw']->common->image('phpgwapi',$GLOBALS['phpgw_info']['server']['login_logo_file']?$GLOBALS['phpgw_info']['server']['login_logo_file']:'logo');
+			$var['logo_url'] = $GLOBALS['phpgw_info']['server']['login_logo_url']?$GLOBALS['phpgw_info']['server']['login_logo_url']:'http://www.eGroupWare.org';
+			$var['logo_title'] = $GLOBALS['phpgw_info']['server']['login_logo_title']?$GLOBALS['phpgw_info']['server']['login_logo_title']:'www.eGroupWare.org';
+			$var['hide_bar_txt'] = lang("Hide header and toolbar");
+			$var['show_bar_txt'] = lang("Show header and toolbar");
+			$GLOBALS['celepar_tpl']->set_var($var);
+			$GLOBALS['celepar_tpl']->pfp('out','navbar_header');
+
+			/******************************************************\
+			* The sidebox menu's                                   *
+			\******************************************************/
+
+			$menu_title = lang('General Menu');
+
+			$file['Home'] = $GLOBALS['phpgw_info']['navbar']['home']['url'];
+			if($GLOBALS['phpgw_info']['user']['apps']['preferences'])
+			{
+				$file['Preferences'] = $GLOBALS['phpgw_info']['navbar']['preferences']['url'];
+			}
+			$file += array(
+				array(
+					'text'    => lang('About %1',$GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']),
+					'no_lang' => True,
+					'link'    => $GLOBALS['phpgw_info']['navbar']['about']['url']
+				),
+				'Logout'=>$GLOBALS['phpgw_info']['navbar']['logout']['url']
+			);
+
+			if($GLOBALS['phpgw_info']['user']['preferences']['common']['auto_hide_sidebox']==1)
+			{
+				$GLOBALS['celepar_tpl']->set_var('show_menu_event',$show_menu_event);
+				$GLOBALS['celepar_tpl']->set_var('lang_show_menu',lang('show menu'));
+				$GLOBALS['celepar_tpl']->pparse('out','sidebox_hide_header');
+
+				display_sidebox('',$menu_title,$file);
+				$GLOBALS['phpgw']->hooks->single('sidebox_menu',$GLOBALS['phpgw_info']['flags']['currentapp']);
+
+				$GLOBALS['celepar_tpl']->pparse('out','sidebox_hide_footer');
+
+				$var['sideboxcolstart']='';
+
+				$GLOBALS['celepar_tpl']->set_var($var);
+				$GLOBALS['celepar_tpl']->pparse('out','appbox');
+				$var['remove_padding'] = 'style="padding-left:0px;"';
+				$var['sideboxcolend'] = '';
+			}
+			else
+			{
+				$var['menu_link'] = '';
+				$var['sideboxcolstart'] = '<td id="tdSidebox" valign="top">';
+				$var['remove_padding'] = '';
+				$GLOBALS['celepar_tpl']->set_var($var);
+				$GLOBALS['celepar_tpl']->pparse('out','appbox');
+
+				display_sidebox('',$menu_title,$file);
+				$GLOBALS['phpgw']->hooks->single('sidebox_menu',$GLOBALS['phpgw_info']['flags']['currentapp']);
+
+				$var['sideboxcolend'] = '</td>';
+			}
+
+			$GLOBALS['celepar_tpl']->set_var($var);
+			$GLOBALS['celepar_tpl']->pparse('out','navbar_footer');
+
+			// If the application has a header include, we now include it
+			if(!@$GLOBALS['phpgw_info']['flags']['noappheader'] && @isset($_GET['menuaction']))
+			{
+				list($app,$class,$method) = explode('.',$_GET['menuaction']);
+				if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header'])
 				{
-					$tabs[$i]['target'] = $target;
-				}
-				if (ereg($GLOBALS['phpgw_info']['navbar'][$app],$_SERVER['PHP_SELF']))
+					$GLOBALS[$class]->header();
+				}
+			}
+			$GLOBALS['phpgw']->hooks->process('after_navbar');
+			return;
+		}
+
+		function display_sidebox($appname,$menu_title,$file)
+		{
+			if(!$appname || ($appname==$GLOBALS['phpgw_info']['flags']['currentapp'] && $file))
+			{
+				$var['lang_title']=$menu_title;//$appname.' '.lang('Menu');
+				$GLOBALS['celepar_tpl']->set_var($var);
+				$GLOBALS['celepar_tpl']->pfp('out','extra_blocks_header');
+
+				foreach($file as $text => $url)
 				{
-					$selected = $i;
-				}
-				$i++;
+					sidebox_menu_item($url,$text);
+				}
+
+				$GLOBALS['celepar_tpl']->pparse('out','extra_blocks_footer');
+			}
+		}
+
+		function sidebox_menu_item($item_link='',$item_text='')
+		{
+			if($item_text === '_NewLine_' || $item_link === '_NewLine_')
+			{
+				$GLOBALS['celepar_tpl']->pparse('out','extra_block_spacer');
 			}
 			else
 			{
-				$title = '<img src="' . $app_data['icon'] . '" alt="' . $app_data['title'] . '" title="'
-					. $app_data['title'] . '" border="0">';
-				if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'icons_and_text')
+				$var['icon_or_star']='<img src="'.$GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images'.'/orange-ball.png" width="9" height="9" alt="ball"/>';
+				$var['target'] = '';
+				if(is_array($item_link))
 				{
-					$title .= "<br>" . $app_data['title'];
-					$var['width'] = '7%';
+					if(isset($item_link['icon']))
+					{
+						$app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['phpgw_info']['flags']['currentapp'];
+						$var['icon_or_star'] = '<img src="'.$GLOBALS['phpgw']->common->image($app,$item_link['icon']).'"/>';
+					}
+					$var['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']);
+					$var['item_link'] = $item_link['link'];
+					if ($item_link['target'])
+					{
+						$var['target'] = ' target="' . $item_link['target'] . '"';
+					}
 				}
 				else
 				{
-					$var['width']  = '3%';
-				}
-
-				$var['value'] = '<a href="' . $app_data['url'] . '"' . ($app_data['target'] ? $app_data['target'] : $target) . '>' . $title . '</a>';
-				$var['align'] = 'center';
-				$tpl->set_var($var);
-				$tpl->parse('applications','navbar_app',True);
-			}
-		}
-		if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'text')
-		{
-			$var['navbar_color'] = $GLOBALS['phpgw_info']['theme']['bg_color'];
-			$var['align'] = 'right';
-			$var['value'] = $GLOBALS['phpgw']->common->create_tabs($tabs,$selected,-1);
-			$tpl->set_var($var);
-			$tpl->parse('applications','navbar_app',True);
-		}
-
-		if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'top')
-		{
-			$var['powered_by'] = lang('Powered by phpGroupWare version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
-		}
-		if (isset($GLOBALS['phpgw_info']['navbar']['admin']) && $GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
-		{
-			$var['current_users'] = '<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions')
-				. '">&nbsp;' . lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>';
-		}
-		$now = time();
-		$var['user_info'] = $GLOBALS['phpgw']->common->display_fullname() . ' - '
-				. lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
-				. $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-//				. lang($GLOBALS['phpgw']->common->show_date($now,'F')) . ' '
-//				. $GLOBALS['phpgw']->common->show_date($now,'d, Y');
-
-		// Maybe we should create a common function in the phpgw_accounts_shared.inc.php file
-		// to get rid of duplicate code.
-		if ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0)
-		{
-			$api_messages = lang('You are required to change your password during your first login')
-				. '<br> Click this image on the navbar: <img src="'
-				. $GLOBALS['phpgw']->common->image('preferences','navbar.gif').'">';
-		}
-		elseif ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - (86400*30))
-		{
-			$api_messages = lang('it has been more then %1 days since you changed your password',30);
-		}
- 
-		// This is gonna change
-		if (isset($cd))
-		{
-			$var['messages'] = $api_messages . '<br>' . checkcode($cd);
-		}
-
-		if (isset($GLOBALS['phpgw_info']['flags']['app_header']))
-		{
-			$var['current_app_header'] = $GLOBALS['phpgw_info']['flags']['app_header'];
-			$var['th_bg'] = $GLOBALS['phpgw_info']['theme']['th_bg'];
-		}
-		else
-		{
-			$tpl->set_block('navbar','app_header','app_header');
-			$var['app_header'] = '';
-		}
-
-		$tpl->set_var($var);
-		$tpl->pfp('out','navbar');
-		// If the application has a header include, we now include it
-		if (!@$GLOBALS['phpgw_info']['flags']['noappheader'] && @isset($_GET['menuaction']))
-		{
-			list($app,$class,$method) = explode('.',$_GET['menuaction']);
-			if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header'])
-			{
-				$GLOBALS[$class]->header();
-			}
-		}
-		$GLOBALS['phpgw']->hooks->process('after_navbar');
-		return;
-	}
-
-	function parse_navbar_end()
-	{
-		if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'bottom')
-		{
-			$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-			$tpl->set_unknowns('remove');
-   
-			$tpl->set_file(
+					$var['lang_item'] = lang($item_text);
+					$var['item_link'] = $item_link;
+				}
+				$GLOBALS['celepar_tpl']->set_var($var);
+				$GLOBALS['celepar_tpl']->pparse('out','extra_block_row');
+			}
+		}
+
+		function parse_navbar_end()
+		{
+			$GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
+
+			$GLOBALS['celepar_tpl']->set_file(
 				array(
 					'footer' => 'footer.tpl'
 				)
 			);
+			
 			$var = Array(
+				'img_root'       => $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images',
 				'table_bg_color' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
+				'version'        => $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']
 			);
+			$GLOBALS['phpgw']->hooks->process('navbar_end');
+			
+
+			if($GLOBALS['phpgw_info']['user']['preferences']['common']['show_generation_time'])
+			{
+				$mtime = microtime(); 
+				$mtime = explode(' ',$mtime); 
+				$mtime = $mtime[1] + $mtime[0]; 
+				$tend = $mtime; 
+				$totaltime = ($tend - $GLOBALS['page_start_time']); 
+
+				$var['page_generation_time'] = '<div id="divGenTime"><br/><span>'.lang('Page was generated in %1 seconds',$totaltime).'</span></div>';
+			}
+
 			$var['powered_by'] = lang('Powered by phpGroupWare version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
-			if (isset($GLOBALS['phpgw_info']['navbar']['admin']) && $GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
-			{
-				$var['current_users'] = '<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions')
-					. '">&nbsp;' . lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>';
-			}
-			$now = time();
-			$var['user_info'] = $GLOBALS['phpgw']->common->display_fullname() . ' - '
-				. lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
-				. $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-			$tpl->set_var($var);
-			$GLOBALS['phpgw']->hooks->process('navbar_end');
-			$tpl->pfp('out','footer');
-		}
-	}
+			$GLOBALS['celepar_tpl']->set_var($var);
+			$GLOBALS['celepar_tpl']->pfp('out','footer');
+		}
Index: /trunk/phpgwapi/templates/default/about.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/about.tpl	(revision 1246)
+++ /trunk/phpgwapi/templates/default/about.tpl	(revision 1247)
@@ -1,6 +1,6 @@
-<table border="0" width="100%">
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <!-- <tr>
   <td align="left">
-   <a href="http://www.eGroupWare.org" target="_new"><img src="{phpgw_logo}" border="0" alt="logo"></a>
+   <a href="http://www.eGroupWare.org" target="_new"><img src="{phpgw_logo}" border="0" alt="eGroupWare"></a>
   </td>
  </tr>
@@ -9,14 +9,21 @@
  </tr>
  <tr>
-  <td align="center">{phpgw_version}</td>
+  <td align="left">{phpgw_version}</td>
  </tr>
  <tr>
-  <td align="center">{phpgw_message}</td>
+  <td align="left">{phpgw_message}</td>
  </tr>
  <tr>
-  <td><hr></td>
- </tr>-->
+ <td  height="3"><img src="phpgwapi/templates/default/images/spacer.gif" alt="spacer" height="3" /></td>
+</tr>
+<tr>
+  <td align="center"><div class="greyLine"></div></td>
+ </tr>
+ -->
  <tr>
-  <td align="center">
+ <td  height="3"><img src="phpgwapi/templates/default/images/spacer.gif" alt="spacer" height="3" /></td>
+</tr>
+ <tr>
+  <td align="left">
 
 {phpgw_app_about}
Index: /trunk/expressoMail1_2/index.php
===================================================================
--- /trunk/expressoMail1_2/index.php	(revision 1246)
+++ /trunk/expressoMail1_2/index.php	(revision 1247)
@@ -78,5 +78,4 @@
     $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['num_max_certs_to_cipher'] = $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] ?  $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] : "10";
     $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] : "0";
-    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size'] = $current_config['expressoMail_Max_attachment_size'] ? $current_config['expressoMail_Max_attachment_size'] : ini_get('upload_max_filesize');
 
 	$template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
Index: /trunk/expressoMail1_2/templates/default/config.tpl
===================================================================
--- /trunk/expressoMail1_2/templates/default/config.tpl	(revision 1246)
+++ /trunk/expressoMail1_2/templates/default/config.tpl	(revision 1247)
@@ -99,10 +99,4 @@
     </td>
     </tr>
-    <tr bgcolor="{row_off}">
-    <td>{lang_Max_attachment_size}</td>
-    <td>
-    <input size="1" name="newsettings[expressoMail_Max_attachment_size]" value="{value_expressoMail_Max_attachment_size}">
-    </td>
-    </tr>
 <!-- END body -->
 <!-- BEGIN footer -->
Index: /trunk/expressoMail1_2/setup/tables_update.inc.php
===================================================================
--- /trunk/expressoMail1_2/setup/tables_update.inc.php	(revision 1246)
+++ /trunk/expressoMail1_2/setup/tables_update.inc.php	(revision 1247)
@@ -9,50 +9,29 @@
 	* option) any later version.                                               *
 	\**************************************************************************/
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.234'){
-		$test[] = '1.234';
-		function expressoMail1_2_upgrade1_234() {
-            $oProc = $GLOBALS['phpgw_setup']->oProc;            
-            $oProc->CreateTable('phpgw_certificados',array(
-				'fd' => array(
-					'email' => array( 'type' => 'varchar', 'precision' => 60, 'nullable' => false),
-					'chave_publica' => array( 'type' => 'text'),
-					'expirado' => array('type' => 'bool', 'default' => 'false'),
-					'revogado' => array('type' => 'bool', 'default' => 'false'),
-					'serialnumber' => array('type' => 'int', 'precision' => 8, 'nullable' => false),
-					'authoritykeyidentifier' => array( 'type' => 'text', 'nullable' => false),
-				),
-				'pk' => array('email','serialnumber','authoritykeyidentifier'),
-				'fk' => array(),
-				'ix' => array(),
-				'uc' => array()
-				)
-			);
-
-            $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.235';
-            return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
-		}
-	}
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.233'){
-		$test[] = '1.233';													
-		function expressoMail1_2_upgrade1_233() {
-			$setup_info['expressoMail1_2']['currentver'] = '1.234';
-			return $setup_info['expressoMail1_2']['currentver'];
-		}
-	}	
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.232'){
-		$test[] = '1.232';													
-		function expressoMail1_2_upgrade1_232() {
-			$setup_info['expressoMail1_2']['currentver'] = '1.233';
-			return $setup_info['expressoMail1_2']['currentver'];
-		}
-	}	
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.231'){
-		$test[] = '1.231';													
-		function expressoMail1_2_upgrade1_231() {
-			$setup_info['expressoMail1_2']['currentver'] = '1.232';
-			return $setup_info['expressoMail1_2']['currentver'];
-		}
+	$test[] = '1.2031';
+	function expressoMail1_2_upgrade1_2031() {
+		$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.2201';
+		return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
 	}
 	
+	$test[] = '1.2201';
+	function expressoMail1_2_upgrade1_2201() {
+		$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.2211';
+		return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];		
+	}
+	
+	$test[] = '1.2211';
+	function expressoMail1_2_upgrade1_2211() {
+		$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.222';
+		return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
+	}
+
+	$test[] = '1.222';
+	function expressoMail1_2_upgrade1_222() {
+		$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.230';
+		return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
+	}
+	
+	$test[] = '1.230';
 	function expressoMail1_2_upgrade1_230() {
 		$oProc = $GLOBALS['phpgw_setup']->oProc;
@@ -70,106 +49,42 @@
 		return $setup_info['expressoMail1_2']['currentver'];
 	}		
-				
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.230'){
-		$test[] = '1.230';													
-		return expressoMail1_2_upgrade1_230();
-	}
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.222'){
-		$test[] = '1.222';
-		function expressoMail1_2_upgrade1_222() {
-			$oProc = $GLOBALS['phpgw_setup']->oProc;
-			$oProc->CreateTable('phpgw_expressomail_contacts',array(
-				'fd' => array(
-					'id_owner' => array( 'type' => 'int', 'precision' => 8, 'nullable' => false),
-					'data' => array( 'type' => 'text')
-				),
-				'pk' => array('id_owner'),
-				'fk' => array(),
-				'ix' => array(),
-				'uc' => array()
-				)
-			);
-			$oProc->CreateTable('phpgw_certificados',array(
-				'fd' => array(
-					'email' => array( 'type' => 'varchar', 'precision' => 60, 'nullable' => false),
-					'chave_publica' => array( 'type' => 'text'),
-					'expirado' => array('type' => 'bool', 'default' => 'false')
-				),
-				'pk' => array('email'),
-				'fk' => array(),
-				'ix' => array(),
-				'uc' => array()
-				)
-			);
-			$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.223';
-			return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
-        }
-	}
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.2211'){
-		$test[] = '1.2211';
-		function expressoMail1_2_upgrade1_2211() {
-			$oProc = $GLOBALS['phpgw_setup']->oProc;
-			$oProc->CreateTable('phpgw_expressomail_contacts',array(
-				'fd' => array(
-					'id_owner' => array( 'type' => 'int', 'precision' => 8, 'nullable' => false),
-					'data' => array( 'type' => 'text')
-				),
-				'pk' => array('id_owner'),
-				'fk' => array(),
-				'ix' => array(),
-				'uc' => array()
-				)
-			);
-			$oProc->CreateTable('phpgw_certificados',array(
-				'fd' => array(
-					'email' => array( 'type' => 'varchar', 'precision' => 60, 'nullable' => false),
-					'chave_publica' => array( 'type' => 'text'),
-					'expirado' => array('type' => 'bool', 'default' => 'false')
-				),
-				'pk' => array('email'),
-				'fk' => array(),
-				'ix' => array(),
-				'uc' => array()
-				)
-			);
-			$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.223';
-			return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
-        }
-	}
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.2201'){
-		$test[] = '1.2201';
-		function expressoMail1_2_upgrade1_2201() {return expressoMail1_2_upgrade1_230();}
+	$test[] = '1.231';													
+	function expressoMail1_2_upgrade1_231() {
+		$setup_info['expressoMail1_2']['currentver'] = '1.232';
+		return $setup_info['expressoMail1_2']['currentver'];
 	}
 	
-	if ($GLOBALS['setup_info']['expressoMail1_2']['currentver'] == '1.2031'){
-		$test[] = '1.2031';
-		function expressoMail1_2_upgrade1_2031() {
-			$oProc = $GLOBALS['phpgw_setup']->oProc;
-			$oProc->CreateTable('phpgw_expressomail_contacts',array(
-				'fd' => array(
-					'id_owner' => array( 'type' => 'int', 'precision' => 8, 'nullable' => false),
-					'data' => array( 'type' => 'text')
-				),
-				'pk' => array('id_owner'),
-				'fk' => array(),
-				'ix' => array(),
-				'uc' => array()
-				)
-			);
-			$oProc->CreateTable('phpgw_certificados',array(
-				'fd' => array(
-					'email' => array( 'type' => 'varchar', 'precision' => 60, 'nullable' => false),
-					'chave_publica' => array( 'type' => 'text'),
-					'expirado' => array('type' => 'bool', 'default' => 'false')
-				),
-				'pk' => array('email'),
-				'fk' => array(),
-				'ix' => array(),
-				'uc' => array()
-				)
-			);
-			$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.223';
-			return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
-        }
+	$test[] = '1.232';
+	function expressoMail1_2_upgrade1_232() {
+		$setup_info['expressoMail1_2']['currentver'] = '1.233';
+		return $setup_info['expressoMail1_2']['currentver'];
+	}
+	
+	$test[] = '1.233';
+	function expressoMail1_2_upgrade1_233() {
+		$setup_info['expressoMail1_2']['currentver'] = '1.234';
+		return $setup_info['expressoMail1_2']['currentver'];
+	}
+	
+	$test[] = '1.234';
+	function expressoMail1_2_upgrade1_234() {
+    	$oProc = $GLOBALS['phpgw_setup']->oProc;            
+            $oProc->CreateTable('phpgw_certificados',array(
+			'fd' => array(
+				'email' => array( 'type' => 'varchar', 'precision' => 60, 'nullable' => false),
+				'chave_publica' => array( 'type' => 'text'),
+				'expirado' => array('type' => 'bool', 'default' => 'false'),
+				'revogado' => array('type' => 'bool', 'default' => 'false'),
+				'serialnumber' => array('type' => 'int', 'precision' => 8, 'nullable' => false),
+				'authoritykeyidentifier' => array( 'type' => 'text', 'nullable' => false),
+			),
+			'pk' => array('email','serialnumber','authoritykeyidentifier'),
+			'fk' => array(),
+			'ix' => array(),
+			'uc' => array()
+			)
+		);
+		$GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.235';
+        return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
 	}	
 ?>
Index: /trunk/expressoMail1_2/setup/setup.inc.php
===================================================================
--- /trunk/expressoMail1_2/setup/setup.inc.php	(revision 1246)
+++ /trunk/expressoMail1_2/setup/setup.inc.php	(revision 1247)
@@ -37,5 +37,5 @@
 	$setup_info['expressoMail1_2']['depends'][] = array(
 		'appname' => 'phpgwapi',
-		'versions' => Array('0.9.14','0.9.15','1.0.0')
+		'versions' => Array('0.9.14','0.9.15','2.0.0')
 	);
 ?>
Index: /trunk/expressoMail1_2/controller.php
===================================================================
--- /trunk/expressoMail1_2/controller.php	(revision 1246)
+++ /trunk/expressoMail1_2/controller.php	(revision 1247)
@@ -7,5 +7,5 @@
         );
 }
-require_once '../header.inc.php';
+require_once '../header.session.inc.php';
 
 	//	Explode action from cExecuteForm function
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 1246)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 1247)
@@ -60,5 +60,5 @@
 		// This error is returned from Postfix.
 		elseif(strstr($error,'message file too big')) {
-			return str_replace("%1", $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size']."M",$this->functions->getLang('The size of this message has exceeded  the limit (%1B).'));
+			return str_replace("%1", ini_get('upload_max_filesize'),$this->functions->getLang('The size of this message has exceeded  the limit (%1B).'));			
 		}
 		elseif(strstr($error,'virus')) {
@@ -210,5 +210,4 @@
 			return $this->htmlspecialchars_encode($string);
 	}
-
 	/**
 	* Função que importa arquivos .eml exportados pelo expresso para a caixa do usuário. Testado apenas
@@ -1630,4 +1629,5 @@
             $body = $params['body'];
         }
+		//echo "<script language=\"javascript\">javascript:alert('".$body."');</script>";
 		$attachments = $params['FILES'];
 		$forwarding_attachments = $params['forwarding_attachments'];
@@ -1803,5 +1803,5 @@
 				}
 				$tempDir = ini_get("session.save_path");
-				$file = "cidimage_".$GLOBALS['phpgw']->session->sessionid.".dat";					
+				$file = "cidimage_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].$cid_imgs[6][$j].".dat";	
 				$f = fopen($tempDir.'/'.$file,"w");
 				fputs($f,$fileContent);
@@ -1818,5 +1818,5 @@
 		{
 			$total_uploaded_size = 0;
-			$upload_max_filesize = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size'];
+			$upload_max_filesize = str_replace("M","",ini_get('upload_max_filesize')) * 1024 * 1024;
 			foreach ($attachments as $attach)
 			{
@@ -1824,5 +1824,5 @@
 				$total_uploaded_size = $total_uploaded_size + $attach['size'];
 			}
-			if( $total_uploaded_size > $upload_max_filesize) 
+			if( $total_uploaded_size > $upload_max_filesize)
 				return $this->parse_error("message file too big");			
 		}
@@ -2315,5 +2315,5 @@
 				}
 				$tempDir = ini_get("session.save_path");
-				$file = "cidimage_".$GLOBALS['phpgw']->session->sessionid.".dat";					
+				$file = "cidimage_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].$cid_imgs[6][$j].".dat";					
 				$f = fopen($tempDir.'/'.$file,"w");
 				fputs($f,$fileContent);
@@ -2366,5 +2366,5 @@
 					case 3: $image_big = imagecreatefrompng($attach['tmp_name']); break;
 					case 6:
-						include_once("gd_functions.php");
+						require_once("gd_functions.php");
 						$image_big = imagecreatefrombmp($attach['tmp_name']); break;
 					default:
@@ -2390,5 +2390,5 @@
 					imagecopyresampled($image_new, $image_big, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
 					$tmpDir = ini_get("session.save_path");
-					$_file = "cidimage_".$GLOBALS['phpgw']->session->sessionid.".dat"; 
+					$_file = "cidimage_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].".dat"; 
 					imagejpeg($image_new,$tmpDir.$_file, 85);
 					$mail->AddAttachment($tmpDir.$_file, $attach['name'], "base64", $this->get_file_type($tmpDir.$_file));
@@ -3263,5 +3263,5 @@
         if($timestamp){
             $tempDir = ini_get("session.save_path");
-            $file = $tempDir."imap_".$GLOBALS['phpgw']->session->sessionid;
+            $file = $tempDir."imap_".$_SESSION[ 'phpgw_session' ][ 'session_id' ];
     		$f = fopen($file,"w");
         	fputs($f,base64_encode($source));
Index: /trunk/expressoMail1_2/inc/class.exporteml.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 1246)
+++ /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 1247)
@@ -75,5 +75,5 @@
 				$file = $subject."_".$i.".eml";
 			} else{
-				$file = "email_".$GLOBALS['phpgw']->session->sessionid.".eml";
+				$file = "email_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].".eml";
         }    
         }
@@ -90,5 +90,5 @@
 
 	function createFileZip($files, $tempDir){		
-		$tmp_zip_filename = "email_".$GLOBALS['phpgw']->session->sessionid.".zip";
+		$tmp_zip_filename = "email_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].".zip";
 		$command = "cd " . escapeshellarg($tempDir) . " && nice zip -m9 " . escapeshellarg($tmp_zip_filename) . " " .  escapeshellcmd($files);
 		if(!exec($command)) {
@@ -235,5 +235,5 @@
 		$body		= $this-> getBody($id_number);
 		
-		$file = "source_".$GLOBALS['phpgw']->session->sessionid.".txt";
+		$file = "source_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].".txt";
 		$f = fopen($tempDir.'/'.$file,"w");
 		fputs($f,$header ."\r\n\r\n". $body);
@@ -273,5 +273,5 @@
 		$body		= $this-> getBody($id_msg);
 		
-		$file = "source_".$GLOBALS['phpgw']->session->sessionid.".php";
+		$file = "source_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].".php";
 		$f = fopen($tempDir.'/'.$file,"w");
 		fputs($f,$phpheader.$header ."\r\n\r\n". $body);
Index: /trunk/expressoMail1_2/inc/gotodownload.php
===================================================================
--- /trunk/expressoMail1_2/inc/gotodownload.php	(revision 1246)
+++ /trunk/expressoMail1_2/inc/gotodownload.php	(revision 1247)
@@ -167,5 +167,5 @@
 		}
 		else
-			if (preg_match("#^".ini_get('session.save_path')."/[A-z]+_".$GLOBALS['phpgw']->session->sessionid."(\.[A-z]{3,4})?$#",$strFileName))
+			if (preg_match("#^".ini_get('session.save_path')."/[A-z]+_".$GLOBALS['phpgw']->session->sessionid."[A-z0-9]*(\.[A-z]{3,4})?$#",$strFileName))
 			{
 				readfile($strFileName);
Index: /trunk/expressoMail1_2/inc/class.phpmailer.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 1246)
+++ /trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 1247)
@@ -626,5 +626,5 @@
             if($pos_MIME_Version >= $pos_content_type)
             {
-		// nao deve enviar a msg..... O header MIME-Version com posicao invalida ......
+                // nao deve enviar a msg..... O header MIME-Version com posicao invalida ......
                 $this->SetError('Formato dos headers da msg estao invalidos.(CD-17) - A');
                 $this->smtp->Reset();
@@ -670,14 +670,14 @@
         }
         else
-	{
-		$smtpSent = $this->smtp->Data($header . $body);
-	}
+		{
+			$smtpSent = $this->smtp->Data($header . $body);
+		}
 
         if(!$smtpSent)
-	{
+        {
             $this->SetError($this->Lang("data_not_accepted") .' '. $this->smtp->error['error'] .','. $this->smtp->error['smtp_code'].','. $this->smtp->error['smtp_msg']);
             $this->smtp->Reset();
             return false;
-	}
+        }
         if($this->SMTPKeepAlive == true)
             $this->smtp->Reset();
Index: /trunk/expressoMail1_2/js/abas.js
===================================================================
--- /trunk/expressoMail1_2/js/abas.js	(revision 1246)
+++ /trunk/expressoMail1_2/js/abas.js	(revision 1247)
@@ -121,9 +121,8 @@
 	td.onclick = function(){alternate_border(ID);};
 	td.setAttribute("noWrap","true");
-
+        td.alt = borderTitle;
+        td.title = borderTitle;
 	borderTitle = borderTitle ?  borderTitle : id_value ? get_lang("No Subject") : "&nbsp;"	;
 	td.value = borderTitle;
-	td.alt = borderTitle;
-	td.title = borderTitle;
 	if (borderTitle.length > 21)
 		borderTitle = borderTitle.substring(0,21) + "...";
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 1246)
+++ /trunk/expressoMail1_2/js/main.js	(revision 1247)
@@ -1567,4 +1567,5 @@
 		return;
 	}
+	
 	if (expresso_offline) {		
 		stringEmail = Element("to_"+ID).value;
@@ -2212,5 +2213,5 @@
 	document.form_import.appendChild(folder);
 	write_msg(get_lang('You must wait while the messages will be imported...'));
-
+	
 	cExecuteForm('$this.imap_functions.import_msgs', document.form_import, handler);
 }
@@ -2253,5 +2254,5 @@
 	//Begin: Verify if the file extension is allowed.
 	var imgExtensions = new Array("eml","zip");
-	var inputFile = document.form_import.file_1;
+	var inputFile = document.form_import.file_1;	
 	if(!inputFile.value){
 		alert(get_lang('File extension forbidden or invalid file') + '.');
Index: /trunk/expressoMail1_2/js/connector.js
===================================================================
--- /trunk/expressoMail1_2/js/connector.js	(revision 1246)
+++ /trunk/expressoMail1_2/js/connector.js	(revision 1247)
@@ -620,5 +620,5 @@
 		divUpload.innerHTML= "<iframe onload=\"cExecute('$this.functions.getReturnExecuteForm',"+handler+");\"  style='display:"+(debug_controller ? "" : "none")+";width:"+(debug_controller ? 400 : 0)+";height:"+(debug_controller ? 400 : 0)+";' name='uploadFile'></iframe>";
 		form.action ="controller.php";
-		form.target ="uploadFile";	
+		form.target ="uploadFile";		
 		form.submit();
 	}	
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 1246)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 1247)
@@ -408,4 +408,5 @@
 		span_paging = document.createElement("DIV");
 		span_paging.id = "span_paging";
+		span_paging.className = "boxHeaderText";
 		span_paging.align="right";
 		document.getElementById("div_menu_c3").appendChild(span_paging);	
@@ -867,23 +868,21 @@
 		}
 		else{
-			td_element3.onmouseover = function (event) {try {InfoContact.begin(this,headers_msgs.from.email)} catch(e){};};
-			td_element3.onmouseout = function (){ try {clearTimeout(InfoContact.timeout);} catch(e){}};
 			if (headers_msgs.Draft == 'X'){
 				td_element3.innerHTML = "<span style=\"color:red\">("+get_lang("Draft")+") </span>";
 			}
-			else{
-				if (headers_msgs.from.name != null)
-					td_element3.innerHTML += headers_msgs.from.name;
-				else
-					td_element3.innerHTML += headers_msgs.from.email;
-			}
-		}	
-		if (td_element3.innerHTML.indexOf(" ") == '-1' && td_element3.innerHTML.length > 25){
-			td_element3.innerHTML = td_element3.innerHTML.substring(0,25) + "...";
-		}
-		else if (td_element3.innerHTML.length > 40 ){
-			td_element3.innerHTML = td_element3.innerHTML.substring(0,40) + "...";
-		}
-		
+			else{				
+				var spanSender = document.createElement("SPAN");
+				spanSender.onmouseover = function (event) {this.style.textDecoration = "underline";try {InfoContact.begin(this,headers_msgs.from.email)} catch(e){};};
+				spanSender.onmouseout = function (){ try {this.style.textDecoration = "none"; clearTimeout(InfoContact.timeout);} catch(e){}};
+				spanSender.innerHTML =  headers_msgs.from.name != null ? headers_msgs.from.name : headers_msgs.from.email;
+				if (spanSender.innerHTML.indexOf(" ") == '-1' && spanSender.innerHTML.length > 25){
+					spanSender.innerHTML = spanSender.innerHTML.substring(0,25) + "...";
+				}
+				else if (spanSender.innerHTML.length > 40 ){
+					spanSender.innerHTML = spanSender.innerHTML.substring(0,40) + "...";
+				}				
+				td_element3.appendChild(spanSender);				
+			}
+		}			
 		td_element4 = document.createElement("TD");
 		td_element4.className = "td_msg";
@@ -2520,5 +2519,5 @@
 	td11.align="center";
 	td11.setAttribute("noWrap","true");
-	td11.innerHTML += '&nbsp;' + value+"% ("+q_used+"M/"+q_limit+"M)";
+	td11.innerHTML += '&nbsp;<span class="boxHeaderText">' + value+"% ("+q_used+"M/"+q_limit+"M)</span>";
 	//tr1.appendChild(td11);
 	
