/**
  * @param string $action
  * @param string $request
  * @param array $arg
  */
 function UseMethod($action, $request, &$arg)
 {
     $log =& CLog::CreateInstance();
     $c =& CProcessingSwitch::_createInstance();
     $name = $c->_prepareMethodName($action, $request);
     if ($c->_methodExist($name)) {
         $c->InitArgs($arg);
         $c->InitLog($log);
         /* custom class */
         wm_Custom::StaticUseMethod('ProcessingBeforeCallFunction', array($name, &$arg));
         $log->WriteLine('Do: CProcessingSwitch->' . $name);
         call_user_func(array(&$c, $name));
         /* custom class */
         wm_Custom::StaticUseMethod('ProcessingAfterCallFunction', array($name, &$arg));
         return true;
     } else {
         $log->WriteLine('Error: CProcessingSwitch->' . $name . ' not exist!', LOG_LEVEL_ERROR);
         return false;
     }
 }
示例#2
0
$_request = $_xmlRequest->GetParamValueByName('request');
$BackgroundXmlParam = (int) $_xmlRequest->GetParamValueByName('background');
if (!isset($_SESSION[ACCOUNT_ID]) && $_action != 'login' && $_action != 'registration' && $_action != 'resetpassword') {
    $_xmlResponse->XmlRoot->AppendChild(new XmlDomNode('session_error'));
    _localPrintXML($_xmlResponse, $_startTime);
}
$_accountId = isset($_SESSION[ACCOUNT_ID]) ? $_SESSION[ACCOUNT_ID] : null;
if (!$_settings->IncludeLang()) {
    _localPrintErrorAndExit('', $_xmlResponse, 6);
}
$_dbStorage =& DbStorageCreator::CreateDatabaseStorage($_null);
if (!$_dbStorage || !$_dbStorage->Connect()) {
    _localPrintErrorAndExit(getGlobalError(), $_xmlResponse);
}
$_args = array('_dbStorage' => &$_dbStorage, '_settings' => &$_settings, '_xmlRequest' => &$_xmlRequest, '_xmlResponse' => &$_xmlResponse, '_accountId' => $_accountId);
if (CProcessingSwitch::UseMethod($_action, $_request, $_args)) {
    _localPrintXML($_xmlResponse, $_startTime);
} else {
    _localPrintErrorAndExit(WebMailException, $_xmlResponse);
}
function _localPrintErrorAndExit($_errorString, &$_xmlObj, $_code = null)
{
    CXmlProcessing::PrintErrorAndExit($_errorString, $_xmlObj, $_code);
}
function _localPrintXML(&$_xmlRes, $_startTime)
{
    CXmlProcessing::PrintXML($_xmlRes, $_startTime);
}
function NumOLCallBackFunction(&$_settings, &$_dbStorage, &$errorString)
{
    $_bResult = true;