X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fphp_setup.inc;h=e83379c9826cdd039a758e2d177d6658e75e8a22;hb=075b806cd405200df8712134e09f803eb9c5fe02;hp=4fdccbc2dd28c65241ca6144f84f4b6db37793d8;hpb=23c6115c65a63970b01c54675c20afc99e8110a0;p=gosa.git
diff --git a/include/php_setup.inc b/include/php_setup.inc
index 4fdccbc2d..e83379c98 100644
--- a/include/php_setup.inc
+++ b/include/php_setup.inc
@@ -18,16 +18,158 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+function gosaRaiseError($errno, $errstr, $errfile, $errline)
+{
+ global $error_collector,$config;
+
+ /* Return if error reporting is set to zero */
+ if (error_reporting() == 0){
+ return;
+ }
+
+ /* Workaround for buggy imap_open error outputs */
+ if (preg_match('/imap_open/', $errstr)){
+ return;
+ }
+
+ /* FIXME: Workaround for PHP5 error message flooding. The new OOM
+ code want's us to use public/protected/private instead of flat
+ var declarations. For now I can't workaround this - let's ignore
+ the messages till the next major release which may drop support
+ for PHP4. */
+ if (preg_match('/var: Deprecated./', $errstr)){
+ return;
+ }
+
+ /* FIXME: Same as above. Compatibility does error flooding.*/
+ if (preg_match('/zend.ze1_compatibility_mode/', $errstr)){
+ return;
+ }
+
+ /* Hide ldap size limit messages */
+ if (preg_match('/ldap_error/', $errstr)){
+ if (preg_match('/sizelimit/', $errstr)){
+ return;
+ }
+ }
+
+ if((isset($config->data))){
+ if((isset($config->data['MAIN']['DISPLAYERRORS']))&&(!preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS']))){
+
+ /* Write to syslog */
+ gosa_log ("PHP error: $errstr ($errfile, line $errline)");
+ return;
+ }
+ }
+
+
+ /* Create header as needed */
+ if ($error_collector == ""){
+ if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){
+ $error_collector= "
";
+ } else {
+ $error_collector= "
"._("Generating this page caused the PHP interpreter to raise some errors!")."