R22559 - /trunk/egroupware/xajax.php

Author: ralfbecker
New Revision: 22559

URL: http://www.egroupware.org/viewvc?rev=3D22559&view=3Drev
Log:
handler for ajax requests

Modified:
trunk/egroupware/xajax.php

Modified: trunk/egroupware/xajax.php
URL: http://www.egroupware.org/viewvc/trunk/egroupware/xajax.php?rev=3D2255=
9&r1=3D22558&r2=3D22559&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/egroupware/xajax.php (original)
+++ trunk/egroupware/xajax.php Mon Oct 2 07:13:19 2006
@@ -41,7 +41,7 @@

	$argList	=3D func_get_args();
	$arg0		=3D array_shift($argList);
  •   	=
    
  • =

    if(get_magic_quotes_gpc()) {
    	foreach($argList as $key =3D> $value) {
    		if(is_array($value)) {
    

@@ -53,15 +53,10 @@
}
}
}

  •   //error_log("xajax_doXMLHTTP('$arg0',...)");
    

=

  •   list($appName, $className, $functionName) =3D explode('.',$arg0);
    
  •   @list($appName, $className, $functionName, $handler) =3D explode('.',$ar=
    

g0);
=

  •   if(substr($className,0,4) !=3D 'ajax' && $arg0 !=3D 'etemplate.etemplate=
    

.process_exec’ && substr($functionName,0,4) !=3D ‘ajax’)

  •   {
    
  •   	// stopped for security reasons
    
  •   	error_log($_SERVER['PHP_SELF']. ' stopped for security reason. '.$arg0.=
    

’ is not valid. class- or function-name must start with ajax!!!’);

  •   	exit;
    
  •   }
      $GLOBALS['egw_info'] =3D array(
      	'flags' =3D> array(
      		'currentapp'			=3D> $appName,
    

@@ -76,12 +71,38 @@
$GLOBALS[‘xajax’]->setCharEncoding($GLOBALS[‘egw’]->translation->charset=
());
define(‘XAJAX_DEFAULT_CHAR_ENCODING’,$GLOBALS[‘egw’]->translation->chars=
et());

  •   // now the header is included, we can set the charset
    
  •   $GLOBALS['xajax']->setCharEncoding($GLOBALS['egw']->translation->charset=
    

());
+

  •   switch($handler)
    
  •   {
    
  •   	case '/etemplate/process_exec':
    
  •   		$_GET['menuaction'] =3D $appName.'.'.$className.'.'.$functionName;
    
  •   		$appName =3D $className =3D 'etemplate';
    
  •   		$functionName =3D 'process_exec';
    
  •   		$arg0 =3D 'etemplate.etemplate.process_exec';
    
  •   		$argList =3D array(
    
  •   			$argList[0]['etemplate_exec_id'],
    
  •   			$argList[0]['submit_button'],
    
  •   			$argList[0],
    
  •   			'xajaxResponse',
    
  •   		);
    
  •   		error_log("xajax_doXMLHTTP() /etemplate/process_exec handler: arg0=3D'=
    

$arg0’, menuaction=3D’$_GET[menuaction]’");

  •   		break;
    
  •   }
    
  •   if(substr($className,0,4) !=3D 'ajax' && $arg0 !=3D 'etemplate.etemplate=
    

.process_exec’ && substr($functionName,0,4) !=3D ‘ajax’)

  •   {
    
  •   	// stopped for security reasons
    
  •   	error_log($_SERVER['PHP_SELF']. ' stopped for security reason. '.$arg0.=
    

’ is not valid. class- or function-name must start with ajax!!!’);

  •   	exit;
    
  •   }
      $ajaxClass =3D& CreateObject($appName.'.'.$className);
      $argList =3D $GLOBALS['egw']->translation->convert($argList, 'utf-8');
    

=

  •   return call_user_func_array(array(&$ajaxClass, $functionName), $argList =
    

); =

  •   return call_user_func_array(array(&$ajaxClass, $functionName), $argList =
    

);
}

  • =
  • $xajax =3D new xajax($_SERVER[‘PHP_SELF’]);
    $xajax->registerFunction(‘doXMLHTTP’); =

    $xajax->processRequests();


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys – and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs