Index: /trunk/expressoMail1_2/controller.php
===================================================================
--- /trunk/expressoMail1_2/controller.php	(revision 1036)
+++ /trunk/expressoMail1_2/controller.php	(revision 1037)
@@ -1,11 +1,3 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
-
 	//	Explode action from cExecuteForm function
 	$cExecuteFormReturn = false;
Index: /trunk/expressoMail1_2/inc/hook_preferences.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/hook_preferences.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/hook_preferences.inc.php	(revision 1037)
@@ -1,11 +1,12 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
-{
 	$title = $appname;
 	$file = array(
@@ -14,4 +15,3 @@
 	//Do not modify below this line
 	display_section($appname,$title,$file);
-}
 ?>
Index: /trunk/expressoMail1_2/inc/class.db_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+	if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,7 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../header.inc.php';
+	}
+
 define('PHPGW_INCLUDE_ROOT','../');	
 define('PHPGW_API_INC','../phpgwapi/inc');	
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,6 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../header.inc.php';
+}
 include_once("class.functions.inc.php");
 include_once("class.ldap_functions.inc.php");
Index: /trunk/expressoMail1_2/inc/class.user.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.user.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.user.inc.php	(revision 1037)
@@ -1,11 +1,12 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
-	class user{
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
+class user{
 		
 		function get_user(){
Index: /trunk/expressoMail1_2/inc/class.exporteml.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,6 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../header.inc.php';
+}
 /***************************************************************************************\
 * Export EML Format Message Mail														*
Index: /trunk/expressoMail1_2/inc/gotodownload.php
===================================================================
--- /trunk/expressoMail1_2/inc/gotodownload.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/gotodownload.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,6 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../header.inc.php';
+}
 
 	$msg_number = $_GET['msg_number'];
Index: /trunk/expressoMail1_2/inc/show_thumbs.php
===================================================================
--- /trunk/expressoMail1_2/inc/show_thumbs.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/show_thumbs.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,6 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../header.inc.php';
+}
 	$username = $_SESSION['phpgw_info']['expressomail']['user']['userid'];
 	$password = $_SESSION['phpgw_info']['expressomail']['user']['passwd'];
Index: /trunk/expressoMail1_2/inc/class.ScriptS.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.ScriptS.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.ScriptS.inc.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 
 //Inclui o arquivo contendo a classe SieveS;
Index: /trunk/expressoMail1_2/inc/class.message_components.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,7 +6,6 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
-
+	require_once '../header.inc.php';
+}
     class message_components {
 
Index: /trunk/expressoMail1_2/inc/class.SieveS.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.SieveS.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.SieveS.inc.php	(revision 1037)
@@ -1,10 +1,12 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
+
 //Conecta com o Servidor e o serviço Sieve;
 class SieveS{
Index: /trunk/expressoMail1_2/inc/class.imap_attachment.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_attachment.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.imap_attachment.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,6 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../header.inc.php';
+}
 class imap_attachment
 {
Index: /trunk/expressoMail1_2/inc/fckeditor.php
===================================================================
--- /trunk/expressoMail1_2/inc/fckeditor.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/fckeditor.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 /*
  * FCKeditor - The text editor for internet
Index: /trunk/expressoMail1_2/inc/show_img.php
===================================================================
--- /trunk/expressoMail1_2/inc/show_img.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/show_img.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 	header("Content-Type: image/jpeg");
 	if($_GET['msg_num'] && $_GET['msg_part'] && $_GET['msg_folder']) {
Index: /trunk/expressoMail1_2/inc/show_embedded_attach.php
===================================================================
--- /trunk/expressoMail1_2/inc/show_embedded_attach.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/show_embedded_attach.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 	$username = $_SESSION['phpgw_info']['expressomail']['user']['userid'];
 	$password = $_SESSION['phpgw_info']['expressomail']['user']['passwd'];
Index: /trunk/expressoMail1_2/inc/hook_admin.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/hook_admin.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/hook_admin.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,7 @@
 		'noheader'   => true
 	);
+	require_once '../header.inc.php';
+}
 
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
 	/**************************************************************************\
 	* eGroupWare                                                               *
Index: /trunk/expressoMail1_2/inc/hook_home.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/hook_home.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/hook_home.inc.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 	
 	$current_app = 'expressoMail1_2';
Index: /trunk/expressoMail1_2/inc/load_lang.php
===================================================================
--- /trunk/expressoMail1_2/inc/load_lang.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/load_lang.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 // Load the lang of the module.
 	if(!$_SESSION['phpgw_info']['expressomail']['lang']) 
Index: /trunk/expressoMail1_2/inc/gd_functions.php
===================================================================
--- /trunk/expressoMail1_2/inc/gd_functions.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/gd_functions.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 *Author:
 *    JPEXS  from http://www.hotscripts.com* ImageCreateFromBmp
Index: /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,6 @@
 		'noheader'   => true
 	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../header.inc.php';
+}
 include_once("class.imap_functions.inc.php");
 include_once("class.functions.inc.php");
Index: /trunk/expressoMail1_2/inc/class.functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,7 @@
 		'noheader'   => true
 	);
+	require_once '../header.inc.php';
+}
 
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
 	class Functions{
 		
Index: /trunk/expressoMail1_2/inc/class.phpmailer.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 ////////////////////////////////////////////////////
 // PHPMailer - PHP email class
Index: /trunk/expressoMail1_2/inc/class.smtp.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.smtp.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/class.smtp.php	(revision 1037)
@@ -1,10 +1,11 @@
 <?php
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'expressoMail1_2',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+if(!isset($GLOBALS['phpgw_info'])){
+        $GLOBALS['phpgw_info']['flags'] = array(
+                'currentapp' => 'expressoMail1_2',
+                'nonavbar'   => true,
+                'noheader'   => true
+        );
+        require_once '../header.inc.php';
+}
 ////////////////////////////////////////////////////
 // SMTP - PHP SMTP class
Index: /trunk/expressoMail1_2/inc/show_user_photo.php
===================================================================
--- /trunk/expressoMail1_2/inc/show_user_photo.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/show_user_photo.php	(revision 1037)
@@ -1,3 +1,4 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -5,6 +6,7 @@
 		'noheader'   => true
 	);
+	require_once '../header.inc.php';
+}
 
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
 	function ldapRebind($ldap_connection, $ldap_url)
 	{
Index: /trunk/expressoMail1_2/inc/hook_settings.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/hook_settings.inc.php	(revision 1036)
+++ /trunk/expressoMail1_2/inc/hook_settings.inc.php	(revision 1037)
@@ -1,3 +1,12 @@
 <?php
+if(!isset($GLOBALS['phpgw_info'])){
+	$GLOBALS['phpgw_info']['flags'] = array(
+		'currentapp' => 'expressoMail1_2',
+		'nonavbar'   => true,
+		'noheader'   => true
+	);
+	require_once '../header.inc.php';
+}
+
 	$GLOBALS['phpgw_info']['flags'] = array(
 		'currentapp' => 'expressoMail1_2',
@@ -6,5 +15,5 @@
 	);
 
-	require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php';
+	require_once '../../header.inc.php';
 	/**************************************************************************\
 	* eGroupWare - ExpressoMail Preferences                                    *
