From 89311a8e7fae62537facedc461803ea18c9b9faa Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 14 Jan 2010 22:35:13 +0000 Subject: [PATCH] printOutput need no echoing and no headers, does it by itself --- xajax.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/xajax.php b/xajax.php index 159d28d366..09ace44179 100644 --- a/xajax.php +++ b/xajax.php @@ -26,10 +26,9 @@ function xajax_redirect(&$anon_account) define('XAJAX_DEFAULT_CHAR_ENCODING',translation::charset()); $response = new xajaxResponse(); - $response->addScript("location.href='".$GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10'."';"); + $response->redirect($GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10'); + $response->printOutput(); - header('Content-type: text/xml; charset='.translation::charset()); - echo $response->printOutput; common::egw_exit(); } @@ -44,8 +43,8 @@ function ajax_exception_handler(Exception $e) { $response = new xajaxResponse(); $response->addAlert($e->getMessage()."\n\n".$e->getTraceAsString()); - header('Content-type: text/xml; charset='.(is_object($GLOBALS['egw'])?translation::charset():'utf-8')); - echo $response->printOutput(); + $response->printOutput(); + if (is_object($GLOBALS['egw'])) { common::egw_exit(); @@ -126,7 +125,7 @@ function doXMLHTTP() $argList[0], 'xajaxResponse', ); - error_log("xajax_doXMLHTTP() /etemplate/process_exec handler: arg0='$arg0', menuaction='$_GET[menuaction]'"); + //error_log("xajax_doXMLHTTP() /etemplate/process_exec handler: arg0='$arg0', menuaction='$_GET[menuaction]'"); break; case 'etemplate': // eg. ajax code in an eTemplate widget $arg0 = ($appName = 'etemplate').'.'.$className.'.'.$functionName; @@ -143,7 +142,7 @@ function doXMLHTTP() exit; } $ajaxClass =& CreateObject($appName.'.'.$className); - $argList = $GLOBALS['egw']->translation->convert($argList, 'utf-8'); + $argList = translation::convert($argList, 'utf-8'); return call_user_func_array(array(&$ajaxClass, $functionName), (array)$argList ); }