[20984] Improvement: Full path to files on errors if you are admin

Sigurd Nes <[email protected]> Tue, 26 Jan 2010 13:20:44 +0000
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 20984
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20984
Author:   sigurdne
Date:     2010-01-26 13:20:44 +0000 (Tue, 26 Jan 2010)
Log Message:
-----------
Improvement: Full path to files on errors if you are admin

Modified Paths:
--------------
    people/sigurdne/modules/phpgwapi/trunk/inc/functions.inc.php

Modified: people/sigurdne/modules/phpgwapi/trunk/inc/functions.inc.php
===================================================================
--- people/sigurdne/modules/phpgwapi/trunk/inc/functions.inc.php	2010-01-26 13:12:16 UTC (rev 20983)
+++ people/sigurdne/modules/phpgwapi/trunk/inc/functions.inc.php	2010-01-26 13:20:44 UTC (rev 20984)
@@ -145,7 +145,14 @@
 			$file = 'unknown';
 			if ( isset($entry['file']) )
 			{
-				$file = '/path/to/phpgroupware' . substr($entry['file'], strlen(PHPGW_SERVER_ROOT) );
+				if ( !isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+				{
+					$file = '/path/to/phpgroupware' . substr($entry['file'], strlen(PHPGW_SERVER_ROOT) );
+				}
+				else
+				{
+					$file = $entry['file'];
+				}
 			}
 
 			if ( isset($entry['line']) )
@@ -232,7 +239,10 @@
 		}
 		$log =& $GLOBALS['phpgw']->log;
 
-		$error_file = str_replace(PHPGW_SERVER_ROOT, '/path/to/phpgroupware', $error_file);
+		if ( !isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+		{
+			$error_file = str_replace(PHPGW_SERVER_ROOT, '/path/to/phpgroupware', $error_file);
+		}
 
 		$bt = debug_backtrace();