[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare xmlhttp server * 4 * http://www.egroupware.org * 5 * This file written by Lars Kneschke <lkneschke@egroupware.org> * 6 * -------------------------------------------- * 7 * This program is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU General Public License as published by the * 9 * Free Software Foundation; either version 2 of the License. * 10 \**************************************************************************/ 11 12 /* $Id: xajax.php 22113 2006-07-14 18:11:02Z ralfbecker $ */ 13 14 require_once ('./phpgwapi/inc/xajax.inc.php'); 15 16 /** 17 * callback if the session-check fails, redirects via xajax to login.php 18 * 19 * @param array &$anon_account anon account_info with keys 'login', 'passwd' and optional 'passwd_type' 20 * @return boolean/string true if we allow anon access and anon_account is set, a sessionid or false otherwise 21 */ 22 function xajax_redirect(&$anon_account) 23 { 24 $response =& new xajaxResponse(); 25 $response->addScript("location.href='".$GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10'."';"); 26 27 header('Content-type: text/xml; charset='.$GLOBALS['egw']->translation->charset()); 28 echo $response->getXML(); 29 $GLOBALS['egw']->common->egw_exit(); 30 } 31 32 function doXMLHTTP() 33 { 34 $numargs = func_num_args(); 35 if($numargs < 1) 36 return false; 37 38 $argList = func_get_args(); 39 $arg0 = array_shift($argList); 40 41 list($appName, $className, $functionName) = explode('.',$arg0); 42 43 if(substr($className,0,4) != 'ajax') 44 { 45 // stopped for security reasons 46 error_log($_SERVER['PHP_SELF']. ' stopped for security reason. '.$arg0.' is not valid. class- or function-name must start with ajax!!!'); 47 exit; 48 } 49 50 $GLOBALS['egw_info'] = array( 51 'flags' => array( 52 'currentapp' => $appName, 53 'noheader' => True, 54 'disable_Template_class' => True, 55 'autocreate_session_callback' => 'xajax_redirect', 56 ) 57 ); 58 include('./header.inc.php'); 59 60 $ajaxClass =& CreateObject($appName.'.'.$className); 61 $argList = $GLOBALS['egw']->translation->convert($argList, 'utf-8'); 62 63 return call_user_func_array(array(&$ajaxClass, $functionName), $argList ); 64 } 65 66 $xajax = new xajax($_SERVER['PHP_SELF']); 67 $xajax->registerFunction('doXMLHTTP'); 68 $xajax->processRequests();
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |