From: cajus Date: Tue, 31 Jul 2007 08:54:04 +0000 (+0000) Subject: Added mailto changes from jan X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c2469b897b0c3d16b788193dba6d7e27236a517f;p=gosa.git Added mailto changes from jan git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6947 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions_debug.inc b/include/functions_debug.inc index 472ad7f7f..340dd9731 100644 --- a/include/functions_debug.inc +++ b/include/functions_debug.inc @@ -415,4 +415,69 @@ function pre($sql_string, $simple_mode = FALSE) { print '
'.$sql_string.'
'; } + +function print_array($array, $sort=true) { + $result= ""; + + if($array && is_array($array) && array_count_values($array) > 0) { + + if($sort) { + sort($array); + } + + $size= count($array); + + foreach($array as $value) { + $result.= $value; + + if($size > 1) { + $result.= ", "; + } + + $size--; + } + } + + return $result; +} + +/** + * parse php modules from phpinfo + * taken from user comments on php-net site + */ + +function parsePHPModules() { + ob_start(); + phpinfo(INFO_MODULES); + $s = ob_get_contents(); + ob_end_clean(); + + $s = strip_tags($s,'

'); + $s = preg_replace('/]*>([^<]+)<\/th>/',"\\1",$s); + $s = preg_replace('/]*>([^<]+)<\/td>/',"\\1",$s); + $vTmp = preg_split('/(

[^<]+<\/h2>)/',$s,-1,PREG_SPLIT_DELIM_CAPTURE); + $vModules = array(); + for ($i=1;$i([^<]+)<\/h2>/',$vTmp[$i],$vMat)) { + $vName = trim($vMat[1]); + $vTmp2 = explode("\n",$vTmp[$i+1]); + foreach ($vTmp2 AS $vOne) { + $vPat = '([^<]+)<\/info>'; + $vPat3 = "/$vPat\s*$vPat\s*$vPat/"; + $vPat2 = "/$vPat\s*$vPat/"; + if (preg_match($vPat3,$vOne,$vMat)) { // 3cols + $vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]),trim($vMat[3])); + } elseif (preg_match($vPat2,$vOne,$vMat)) { // 2cols + $vModules[$vName][trim($vMat[1])] = trim($vMat[2]); + } + } + } + } + return $vModules; +} + +function get_module_setting($pModuleName, $pSetting) { + $vModules= parsePHPModules(); + return $vModules[$pModuleName][$pSetting]; +} ?> diff --git a/include/php_setup.inc b/include/php_setup.inc index 321238ceb..7e7b3d573 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -65,7 +65,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) /* Create header as needed */ if ($error_collector == ""){ - + /* Mailto body header */ $error_collector_mailto .=prepare4mailbody( "Oups. Seems like you've catched some kind of bug inside GOsa/PHP. You may want to help ". @@ -75,10 +75,18 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) "\nGOsa Version: ".get_gosa_version(). "\nDate: ".date("d.m.Y"). "\nTime: ".date("H:i:s"). + "\nUser-Agent: ".$_SERVER['HTTP_USER_AGENT']." ". + "(Javascript is ".( (isset($_SESSION['js']) && $_SESSION['js']==FALSE) ? "inactive" : "active" ).")". "\n\n". "Please describe what you did to produce this error as detailed as possible. Can you ". "reproduce this bug using the demo on http://www.gosa-project.org ?". "\n\n". + "*** PHP runtime information ***". + "\nPHP Version: ".phpversion(). + "\nRunning on: ".php_uname(). + "\nLoaded Extensions: ".print_array(get_loaded_extensions()). + "\nLDAP Module Version: ".get_module_setting('ldap','RCS Version'). + "\n\n". "*** PHP error information ***\n\n"); if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){