<?phprequire_once(dirname(__FILE__)."/config.php");session_set_cookie_params(0,WF_COOKIE_PATH);// include product's authentication
$product_auth_file=WP_HOME."/inc/product_auth.php";if(file_exists($product_auth_file)){require_once($product_auth_file);}// WidgetFramework session control
if(!isset($_SESSION)){session_start();}// create CSRF token in advance
WF::getSecurityFactory()->getHttpToken()->getGuardToken();if($GLOBALS['wfconf_prevent_csrf']==true){// To prevent proxy from being attacked by CSRF
require_once(dirname(__FILE__)."/class/proxy/ProxyCSRFTokenFilter.php");$proxyChecker=WF::getProxyFactory()->getProxyRequestChecker();$proxyChecker->add(newWFProxyCSRFTokenFilter());}
<?php////require(dirname(__FILE__).'/proxy_controller_mock.php');
if(!defined("IS_LOAD_TASK_CONTROLLER")){require_once(dirname(__FILE__)."/inc/session_auth.php");[1]// we don't have to update $_SESSION
ob_start();// we buffer everything, because we need to update $_SESSION anytime
session_write_close();}else{...}.../* check module */$server_module=$g_GetPost['module'];mydebug_log("[PROXY-REQUEST] module: ".$server_module);$isDirectoryTraversal=WF::getSecurityFactory()->getSanitize()->isDirectoryTraversal($server_module);if(true===$isDirectoryTraversal){mydebug_log("Bad guy come in!!");proxy_error(WF_PROXY_ERR_INIT_INVALID_MODULE,WF_PROXY_ERR_INIT_INVALID_MODULE_MSG);}$intUserGeneratedInfoOfWidget=(array_key_exists('userGenerated',$g_GetPost))?$g_GetPost['userGenerated']:0;if($intUserGeneratedInfoOfWidget==1){$strProxyDir=USER_GENERATED_PROXY_DIR;}else{$strProxyDir=PROXY_DIR;}$myproxy_file=$strProxyDir."/".$server_module."/Proxy.php";// does file exist?
if(file_exists($myproxy_file)){include($myproxy_file);[2]}else{proxy_error(WF_PROXY_ERR_INIT_INVALID_MODULE,WF_PROXY_ERR_INIT_INVALID_MODULE_MSG);}// does class exist?
if(!class_exists("WFProxy")){proxy_error(WF_PROXY_ERR_INIT_MODULE_ERROR,WF_PROXY_ERR_INIT_MODULE_ERROR_MSG);}$request=newWFProxy($g_GetPost,$wfconf_dbconfig);[3]...// proxy excutes tasks
mydebug_log("[PROXY-REQUEST] proxy exec.");$request->proxy_exec();[4]...?>
publicfunctionloaduser_byuid($uid){mydebug_log("[WFUSER] loaduser_byuid() ".$uid);// load user
$uinfolist=$this->userdb->get_users($uid);if($this->userdb->isFailed()){mydebug_log("[WFUSER] loaduser_byuid() : get_users failed");returnfalse;}// no exists
if(!isset($uinfolist[0])){mydebug_log("[WFUSER] loaduser_byuid() : get_users - no user");returnfalse;}// get userinfo
$this->userinfo=$uinfolist[0];mydebug_log("[WFUSER] loaduser_byuid() : ok mail = ".$this->userinfo['email']);returntrue;}