Index: /trunk/services/class.mail.php
===================================================================
--- /trunk/services/class.mail.php	(revision 5130)
+++ /trunk/services/class.mail.php	(revision 5316)
@@ -31,6 +31,6 @@
 */
 
-require_once ( $_SESSION['rootPath'].'/library/mime/mimePart.php' );
-require_once ( $_SESSION['rootPath'].'/library/mime/mime.php' );
+require_once ( dirname(__FILE__).'/../library/mime/mimePart.php' );
+require_once ( dirname(__FILE__).'/../library/mime/mime.php' );
 
 
@@ -88,5 +88,5 @@
         $hdrs = $this->mail->headers($this->arrayFields);
 		
-        require_once ($_SESSION['rootPath'].'/library/Mail/Mail.php');
+        require_once (dirname(__FILE__).'/../library/Mail/Mail.php');
        
         $mail_object =& Mail::factory("smtp", self::$configuration);
@@ -129,5 +129,5 @@
     public function send()
     {
-        require_once ($_SESSION['rootPath'].'/library/Mail/Mail.php');
+        require_once (dirname(__FILE__).'/../library/Mail/Mail.php');
         $hdrs = $this->mail->headers($this->arrayFields);
         $mail_object =& Mail::factory("smtp", self::$configuration);
Index: /trunk/login.php
===================================================================
--- /trunk/login.php	(revision 5091)
+++ /trunk/login.php	(revision 5316)
@@ -124,6 +124,4 @@
 			session_start();
 	  	}
-
-		$_SESSION['rootPath'] = realpath( './' );
 	  	
 		include(personalize_include_path('phpgwapi','login'));
Index: /trunk/library/Mail/Mail/smtp.php
===================================================================
--- /trunk/library/Mail/Mail/smtp.php	(revision 5146)
+++ /trunk/library/Mail/Mail/smtp.php	(revision 5316)
@@ -346,5 +346,5 @@
         }
 
-        include_once $_SESSION['rootPath'].'/library/Net/SMTP.php';
+        include_once dirname(__FILE__).'/../../Net/SMTP.php';
         $this->_smtp = &new Net_SMTP($this->host,
                                      $this->port,
Index: /trunk/library/Mail/Mail.php
===================================================================
--- /trunk/library/Mail/Mail.php	(revision 5146)
+++ /trunk/library/Mail/Mail.php	(revision 5316)
@@ -44,5 +44,5 @@
  */
 
-require_once $_SESSION['rootPath'].'/library/PEAR/PEAR.php';
+require_once dirname(__FILE__).'/../PEAR/PEAR.php';
 
 /**
Index: /trunk/library/Net/SMTP.php
===================================================================
--- /trunk/library/Net/SMTP.php	(revision 5146)
+++ /trunk/library/Net/SMTP.php	(revision 5316)
@@ -21,6 +21,6 @@
 // $Id: SMTP.php 314875 2011-08-13 17:03:30Z jon $
 
-require_once $_SESSION['rootPath'].'/library/PEAR/PEAR.php';
-require_once $_SESSION['rootPath'].'/library/Net/Socket.php';
+require_once dirname(__FILE__).'/../PEAR/PEAR.php';
+require_once dirname(__FILE__).'/../Net/Socket.php';
 
 /**
Index: /trunk/library/Net/Socket.php
===================================================================
--- /trunk/library/Net/Socket.php	(revision 5146)
+++ /trunk/library/Net/Socket.php	(revision 5316)
@@ -28,5 +28,5 @@
  */
 
-require_once $_SESSION['rootPath'].'/library/PEAR/PEAR.php';
+require_once dirname(__FILE__).'/../PEAR/PEAR.php';
 
 define('NET_SOCKET_READ', 1);
Index: /trunk/library/mime/mime.php
===================================================================
--- /trunk/library/mime/mime.php	(revision 5158)
+++ /trunk/library/mime/mime.php	(revision 5316)
@@ -64,5 +64,5 @@
  * This package depends on PEAR to raise errors.
  */
-require_once $_SESSION['rootPath'].'/library/PEAR/PEAR.php';
+require_once dirname(__FILE__).'/../PEAR/PEAR.php';
 
 /**
Index: /trunk/library/iCalcreator/iCalcreator.class.php
===================================================================
--- /trunk/library/iCalcreator/iCalcreator.class.php	(revision 5146)
+++ /trunk/library/iCalcreator/iCalcreator.class.php	(revision 5316)
@@ -53,5 +53,5 @@
 /*********************************************************************************/
 /*         since 2.6.22 - 2010-09-25, do NOT remove!!                            */
-require_once ( $_SESSION['rootPath'].'/library/iCalcreator/iCalUtilityFunctions.class.php' );
+require_once ( dirname(__FILE__).'/iCalUtilityFunctions.class.php' );
 /*********************************************************************************/
 /*         version string, do NOT remove!!                                       */
Index: /trunk/API/class.servicelocator.php
===================================================================
--- /trunk/API/class.servicelocator.php	(revision 5158)
+++ /trunk/API/class.servicelocator.php	(revision 5316)
@@ -41,5 +41,5 @@
 }
 
-define_once( 'ROOT', $_SESSION['rootPath'].'/' );
+define_once( 'ROOT', dirname(__FILE__).'/../' );
 
 define_once( 'SERVICES', ROOT.'/services/' );
Index: /trunk/.htaccess
===================================================================
--- /trunk/.htaccess	(revision 5313)
+++ /trunk/.htaccess	(revision 5316)
@@ -16,5 +16,5 @@
 php_value url_rewriter.tags "a=href,area=href,frame=src,input=src,form=,fieldset="
 
-php_value session.auto_start 1
+#php_value session.auto_start 1
 php_value session.use_cookies 1
 # Uses dir as a session handler
Index: /trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php
===================================================================
--- /trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php	(revision 5131)
+++ /trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php	(revision 5316)
@@ -220,5 +220,5 @@
 		{
 
-                    require_once $_SESSION['rootPath'].'/API/class.servicelocator.php';
+                    require_once dirname(__FILE__).'/../../API/class.servicelocator.php';
                     $ldapService = ServiceLocator::getService('ldap');
 
Index: /trunk/calendar/inc/class.bocalendar.inc.php
===================================================================
--- /trunk/calendar/inc/class.bocalendar.inc.php	(revision 5281)
+++ /trunk/calendar/inc/class.bocalendar.inc.php	(revision 5316)
@@ -974,5 +974,5 @@
 			$l_participants = (@$params['participants']?$params['participants']:$_POST['participants']);
 
-                        require_once($_SESSION['rootPath'].'/calendar/inc/class.ex_participants.inc.php');
+                        require_once(dirname(__FILE__).'/class.ex_participants.inc.php');
                         $this->ex_participants = new exParticipants();
                         $this->ex_participants->setParticipantsByString(@$params['ex_participants']?$params['ex_participants']:$_POST['ex_participants']);
@@ -3253,6 +3253,6 @@
                 function getLdap()
                 {
-                    require_once($_SESSION['rootPath'].'/header.inc.php');
-                    require_once($_SESSION['rootPath'].'/phpgwapi/inc/class.common.inc.php');
+                    require_once(dirname(__FILE__).'/../../header.inc.php');
+                    require_once(dirname(__FILE__).'/../../phpgwapi/inc/class.common.inc.php');
    
                     $common = new common();
@@ -3769,5 +3769,5 @@
                         if(!is_object($this->ex_participants))
                         {
-                            include_once($_SESSION['rootPath'].'/calendar/inc/class.ex_participants.inc.php');
+                            include_once(dirname(__FILE__).'/class.ex_participants.inc.php');
                             $objexP = new exParticipants();
                             $objexP->setParticipantsBySerializable($this->ex_participants);
@@ -3825,5 +3825,5 @@
                                  * Cria Arqvuio ICS
                                  */
-                                require_once $_SESSION['rootPath'].'/API/class.servicelocator.php';
+                                require_once dirname(__FILE__).'/../../API/class.servicelocator.php';
                                 $icalService = ServiceLocator::getService('ical');
 
@@ -3991,5 +3991,5 @@
                      }
                      
-                    require_once $_SESSION['rootPath'] . '/API/class.servicelocator.php';
+                    require_once dirname(__FILE__) . '/../../API/class.servicelocator.php';
                     $icalService = ServiceLocator::getService('ical');
                     $dia_inicio = $array_data_inicio[0];
@@ -4157,5 +4157,5 @@
 			}
                          //Verificando alterações em usuarios externos
-                         include_once($_SESSION['rootPath'].'/calendar/inc/class.ex_participants.inc.php');
+                         include_once(dirname(__FILE__).'/class.ex_participants.inc.php');
                          $extOld = new exParticipants();
                          $extNew = new exParticipants();
Index: /trunk/calendar/inc/class.boicalendar.inc.php
===================================================================
--- /trunk/calendar/inc/class.boicalendar.inc.php	(revision 5132)
+++ /trunk/calendar/inc/class.boicalendar.inc.php	(revision 5316)
@@ -2785,5 +2785,5 @@
 	/*-------------------------------------------------------------*/
 
-	require_once ($_SESSION['rootPath'] . '/calendar/inc/class.ex_participants.inc.php');
+	require_once (dirname(__FILE__) . '/class.ex_participants.inc.php');
 
 	$c_events = count($ical['event']);
@@ -3058,5 +3058,5 @@
 
 		if (!isset ($this->bo)) {
-			require_once ($_SESSION['rootPath'] . '/calendar/inc/class.bocalendar.inc.php');
+			require_once (dirname(__FILE__) . '/class.bocalendar.inc.php');
 			$this->bo = new bocalendar();
 		}
@@ -3415,5 +3415,5 @@
 		return false;
 
-	include_once ($_SESSION['rootPath'] . '/calendar/inc/class.ex_participants.inc.php');
+	include_once (dirname(__FILE__) . '/class.ex_participants.inc.php');
 	$exParticipants = new exParticipants();
 	$exParticipants->setParticipantsBySerializable($row['ex_participants']);
Index: /trunk/calendar/inc/class.socalendar_sql.inc.php
===================================================================
--- /trunk/calendar/inc/class.socalendar_sql.inc.php	(revision 5281)
+++ /trunk/calendar/inc/class.socalendar_sql.inc.php	(revision 5316)
@@ -13,14 +13,9 @@
   *  option) any later version.                                              *
   \**************************************************************************/
-if($_SESSION['isCrun']){
+require_once dirname(__FILE__).'/../../API/class.servicelocator.php';
+
+if(isset($_SESSION['isCrun']))
 	$_SESSION['isCrun'] = false;
-	$_SESSION['rootPath'] = PHPGW_INCLUDE_ROOT;
-	require_once $_SESSION['rootPath'].'/API/class.servicelocator.php';
-}else if($_SESSION['rootPath']){
-	require_once $_SESSION['rootPath'].'/API/class.servicelocator.php';
-}else{
-	require_once PHPGW_INCLUDE_ROOT.'/API/class.servicelocator.php';
-}
-
+    
 	if (@$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar_'])
 	{
Index: /trunk/calendar/inc/class.uicalendar.inc.php
===================================================================
--- /trunk/calendar/inc/class.uicalendar.inc.php	(revision 5269)
+++ /trunk/calendar/inc/class.uicalendar.inc.php	(revision 5316)
@@ -95,5 +95,5 @@
 			$GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
                         $GLOBALS['phpgw_info']['flags']['currentapp'] = 'calendar';
-                        include_once( $_SESSION['rootPath'].'/header.inc.php' );
+                        include_once( dirname(__FILE__).'/../../header.inc.php' );
 
 			$GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
@@ -1028,5 +1028,5 @@
 		    );
 
-                   include_once($_SESSION['rootPath'].'/calendar/inc/class.ex_participants.inc.php');
+                   include_once(dirname(__FILE__).'/class.ex_participants.inc.php');
                    $exParticipants = new exParticipants();
                    $exParticipants->setParticipantsBySerializable($event['ex_participants']);
@@ -3899,5 +3899,5 @@
 			$porig = $GLOBALS['phpgw']->template;
 
-			$GLOBALS['phpgw']->template->root = $_SESSION['rootPath'].'/calendar/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/';
+			$GLOBALS['phpgw']->template->root = dirname(__FILE__).'/../templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/';
 
 			$p = $GLOBALS['phpgw']->template;
@@ -4576,5 +4576,5 @@
 			$p->set_block('view','hr','hr');
 
-                        include_once($_SESSION['rootPath'].'/calendar/inc/class.ex_participants.inc.php');
+                        include_once(dirname(__FILE__).'/class.ex_participants.inc.php');
                         $langp = array();
                         $langp['ACCEPTED'] = lang('Accepted');
@@ -5054,5 +5054,5 @@
 			}
 			
-			include_once($_SESSION['rootPath'].'/calendar/inc/class.ex_participants.inc.php');
+			include_once(dirname(__FILE__).'/class.ex_participants.inc.php');
                         $langp = array();
                         $langp['ACCEPTED'] = lang('Accepted');
Index: /trunk/expressoMail1_2/index.php
===================================================================
--- /trunk/expressoMail1_2/index.php	(revision 5295)
+++ /trunk/expressoMail1_2/index.php	(revision 5316)
@@ -169,6 +169,6 @@
 	$template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']);
 	$template->set_var("user_email",$_SESSION['phpgw_info']['expressomail']['user']['email']);
-	include_once $_SESSION['rootPath'] . '/header.inc.php';
-	require_once $_SESSION['rootPath'] . '/API/class.servicelocator.php';
+	include_once dirname(__FILE__) . '/../header.inc.php';
+	require_once dirname(__FILE__) . '/../API/class.servicelocator.php';
 	$alternativeMailService = ServiceLocator::getService('ldap');
 	$AlternateEmailExpresso = Array();
Index: /trunk/expressoMail1_2/inc/class.db_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 5134)
+++ /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 5316)
@@ -369,5 +369,5 @@
             if($msg_number != null && $msg_part != null && $msg_folder != null && (intval($idx_file == '0' ? '1' : $idx_file)))
             {
-                require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+                require_once dirname(__FILE__).'/class.attachment.inc.php';
                 $attachmentObj = new attachment();
                 $attachmentObj->setStructureFromMail($msg_folder,$msg_number);
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5309)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5316)
@@ -274,5 +274,5 @@
 		$to = $header->to;
 		$head_array['to'] = array();
-		if(isset($to[1]) && $to[1]->host == ".SYNTAX-ERROR.") { //E-mails que não possuem o campo "para", vêm com o recipiente preenchido, porém com um recipiente a mais alegando erro de sintaxe.
+		if(isset($to[1]) && isset($to[1]->host) && $to[1]->host == ".SYNTAX-ERROR.") { //E-mails que não possuem o campo "para", vêm com o recipiente preenchido, porém com um recipiente a mais alegando erro de sintaxe.
 			$head_array['to']['name'] = $head_array['to']['email'] = NULL;
 		}
@@ -935,5 +935,5 @@
     {
         $return = array();
-        require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+        require_once dirname(__FILE__).'/class.attachment.inc.php';
 	
         $atObj = new attachment();
@@ -1322,7 +1322,7 @@
              * Requires of librarys
              */
-            require_once $_SESSION['rootPath'].'/library/mime/mimePart.php';
-            require_once $_SESSION['rootPath'].'/library/mime/mimeDecode.php';
-            require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+            require_once dirname(__FILE__).'/../../library/mime/mimePart.php';
+            require_once dirname(__FILE__).'/../../library/mime/mimeDecode.php';
+            require_once dirname(__FILE__).'/class.attachment.inc.php';
             //include_once("class.message_components.inc.php");
             //--------------------------------------------------------------------//
@@ -1533,6 +1533,6 @@
 
                     case 'REPLY':
-                          include_once($_SESSION['rootPath'].'/header.inc.php');
-                          include_once($_SESSION['rootPath'].'/calendar/inc/class.boicalendar.inc.php');
+                          include_once(dirname(__FILE__).'/../../header.inc.php');
+                          include_once(dirname(__FILE__).'/../../calendar/inc/class.boicalendar.inc.php');
                           $boicalendar = new boicalendar();
 
@@ -2064,8 +2064,8 @@
 		if (!count($images)) return '';
                
-		foreach ($images as $key => $value) { 
+		foreach ($images as $key => $value) {                    
 			$images[$key]['width']  = 160; 
 			$images[$key]['height'] = 120; 
-			$images[$key]['url']    = "inc/get_archive.php?msgFolder=".$msg_folder."&msgNumber=".$msg_number."&indexPart=".$image['pid']."&image=true"; 
+			$images[$key]['url']    = "inc/get_archive.php?msgFolder=".$msg_folder."&msgNumber=".$msg_number."&indexPart=".$value['pid']."&image=true"; 
     		}
 
@@ -2570,5 +2570,5 @@
 	function send_mail($params)
 	{
-		require_once $_SESSION['rootPath'] . '/API/class.servicelocator.php';
+		require_once dirname(__FILE__) . '/../../API/class.servicelocator.php';
 		$mailService = ServiceLocator::getService('mail');
 
@@ -3299,5 +3299,5 @@
 	function get_forwarding_attachment($msg_folder, $msg_number, $msg_part, $encoding)
 	{
-            include_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+            include_once dirname(__FILE__).'/class.attachment.inc.php';
             $attachment = new attachment();
 			$attachment->decodeConf['rfc_822bodies'] = true; //Forçar a não decodificação de mensagens em anexo.
@@ -3308,5 +3308,5 @@
         function get_forwarding_attachment2($msg_folder, $msg_number, $msg_part, $encoding)
 	{
-            include_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+            include_once dirname(__FILE__).'/class.attachment.inc.php';
             $attachment = new attachment();
             $attachment->setStructureFromMail($msg_folder, $msg_number);
@@ -3663,5 +3663,5 @@
 	{
 	
-		require_once $_SESSION['rootPath'] . '/API/class.servicelocator.php';
+		require_oncedirname(__FILE__) . '/../../API/class.servicelocator.php';
 		$mailService = ServiceLocator::getService('mail');
 
@@ -4959,5 +4959,5 @@
         	fputs($f,base64_encode($source));
             fclose($f);
-            $command = "python ".$_SESSION['rootPath']."/expressoMail1_2/imap.py \"$imap_server\" \"$imap_port\" \"$username\" \"$password\" \"$timestamp\" \"$folder\" \"$file\"";
+            $command = "python ".dirname(__FILE__)."/../imap.py \"$imap_server\" \"$imap_port\" \"$username\" \"$password\" \"$timestamp\" \"$folder\" \"$file\"";
             $return['command']= exec($command);
         }else{
@@ -5129,5 +5129,5 @@
  		                "$msg_user</body><br><br><hr>"; 
  		             
- 		require_once $_SESSION['rootPath'] . '/API/class.servicelocator.php';
+ 		require_once dirname(__FILE__) . '/../../API/class.servicelocator.php';
  		$mailService = ServiceLocator::getService('mail');      
  		$mailService->addStringAttachment($mail_content, 'report.eml', 'application/text'); 
Index: /trunk/expressoMail1_2/inc/class.exporteml.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 5181)
+++ /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 5316)
@@ -664,5 +664,5 @@
 	function download_all_attachments($params) {
 		
-		require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+		require_once dirname(__FILE__).'/class.attachment.inc.php';
 		$atObj = new attachment();
 		$atObj->setStructureFromMail($params['folder'],$params['num_msg']);
Index: /trunk/expressoMail1_2/inc/show_thumbs.php
===================================================================
--- /trunk/expressoMail1_2/inc/show_thumbs.php	(revision 4416)
+++ /trunk/expressoMail1_2/inc/show_thumbs.php	(revision 5316)
@@ -4,5 +4,5 @@
  */
  require_once '../../header.session.inc.php';
- require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+ require_once dirname(__FILE__).'/class.attachment.inc.php';
  //------------------------//
 
Index: /trunk/expressoMail1_2/inc/class.ScriptS.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.ScriptS.inc.php	(revision 5294)
+++ /trunk/expressoMail1_2/inc/class.ScriptS.inc.php	(revision 5316)
@@ -50,6 +50,6 @@
         $this->EmailExpresso = trim($_SESSION['phpgw_info']['expressomail']['user']['email']);
 		
-		include_once $_SESSION['rootPath'] . '/header.inc.php'; 
-		require_once $_SESSION['rootPath'] . '/API/class.servicelocator.php';
+		include_once dirname(__FILE__).'/../../header.inc.php'; 
+		require_once dirname(__FILE__).'/../../API/class.servicelocator.php';
  		$alternativeMailService = ServiceLocator::getService('ldap');
 		$this->AlternateEmailExpresso = $alternativeMailService->getMailAlternateByUidNumber($_SESSION['phpgw_info']['expressomail']['user']['account_id']);
Index: /trunk/expressoMail1_2/inc/class.attachment.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.attachment.inc.php	(revision 5172)
+++ /trunk/expressoMail1_2/inc/class.attachment.inc.php	(revision 5316)
@@ -37,6 +37,6 @@
          * Requires
          */
-            require_once $_SESSION['rootPath'].'/library/mime/mimePart.php';
-            require_once $_SESSION['rootPath'].'/library/mime/mimeDecode.php';
+            require_once dirname(__FILE__).'/../../library/mime/mimePart.php';
+            require_once dirname(__FILE__).'/../../library/mime/mimeDecode.php';
         //----------------------------------------------------------//
 
Index: /trunk/expressoMail1_2/inc/show_img.php
===================================================================
--- /trunk/expressoMail1_2/inc/show_img.php	(revision 4416)
+++ /trunk/expressoMail1_2/inc/show_img.php	(revision 5316)
@@ -4,5 +4,5 @@
  */
  require_once '../../header.session.inc.php';
- require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+ require_oncedirname(__FILE__).'/class.attachment.inc.php';
  //------------------------//
 
Index: /trunk/expressoMail1_2/inc/show_embedded_attach.php
===================================================================
--- /trunk/expressoMail1_2/inc/show_embedded_attach.php	(revision 4416)
+++ /trunk/expressoMail1_2/inc/show_embedded_attach.php	(revision 5316)
@@ -4,5 +4,5 @@
  */
  require_once '../../header.session.inc.php';
- require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+ require_once dirname(__FILE__).'/class.attachment.inc.php';
  //------------------------//
 
Index: /trunk/expressoMail1_2/inc/get_archive.php
===================================================================
--- /trunk/expressoMail1_2/inc/get_archive.php	(revision 5272)
+++ /trunk/expressoMail1_2/inc/get_archive.php	(revision 5316)
@@ -92,5 +92,5 @@
 if($msgNumber != 'null' && $indexPart !== null && $msgFolder)
 {
-    require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php';
+    require_once dirname(__FILE__).'/class.attachment.inc.php';
 
     $attachment = new attachment();
Index: /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 5245)
+++ /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 5316)
@@ -1,5 +1,5 @@
 <?php
 
-require_once(($_SESSION['rootPath'] ? $_SESSION['rootPath'] : PHPGW_INCLUDE_ROOT).'/API/class.servicelocator.php');
+require_once(dirname(__FILE__).'/../../API/class.servicelocator.php');
 include_once("class.imap_functions.inc.php");
 include_once("class.functions.inc.php");
@@ -277,5 +277,5 @@
                 $modal = true;
              
-            include_once $_SESSION['rootPath']. '/header.inc.php';
+            include_once dirname(__FILE__). '/../../header.inc.php';
             
             if($modal)
@@ -387,5 +387,5 @@
         function quickSearchGlobal($params, $all=false) 
         {              
-            include_once $_SESSION['rootPath']. '/header.inc.php';
+            include_once dirname(__FILE__). '/../../header.inc.php';
             $c = CreateObject('phpgwapi.config','contactcenter');
             $all_data = $c->read_repository();
