diff --git a/xcrm/vtiger/trunk/vtigerservice.php b/xcrm/vtiger/trunk/vtigerservice.php new file mode 100644 index 00000000..070cdae0 --- /dev/null +++ b/xcrm/vtiger/trunk/vtigerservice.php @@ -0,0 +1,54 @@ +vtigerCRM Soap Services"; + echo "
  • vtigerCRM Outlook Plugin EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM Word Plugin EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM ThunderBird Extenstion EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM Customer Portal EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM WebForm EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM FireFox Extension EndPoint URL -- Click here
  • "; +} + + +?> diff --git a/xcrm/vtiger/trunk/vtigerversion.php b/xcrm/vtiger/trunk/vtigerversion.php new file mode 100644 index 00000000..0750aac4 --- /dev/null +++ b/xcrm/vtiger/trunk/vtigerversion.php @@ -0,0 +1,14 @@ + diff --git a/xcrm/vtiger/trunk/webservice.php b/xcrm/vtiger/trunk/webservice.php new file mode 100644 index 00000000..89203f2f --- /dev/null +++ b/xcrm/vtiger/trunk/webservice.php @@ -0,0 +1,115 @@ +success = false; + $state->error = $error; + unset($state->result); + $output = $operationManager->encode($state); + echo $output; + + } + + function writeOutput($operationManager, $data){ + + $state = new State(); + $state->success = true; + $state->result = $data; + unset($state->error); + $output = $operationManager->encode($state); + echo $output; + + } + + $operation = vtws_getParameter($_REQUEST, "operation"); + $operation = strtolower($operation); + $format = vtws_getParameter($_REQUEST, "format","json"); + $sessionId = vtws_getParameter($_REQUEST,"sessionName"); + + $sessionManager = new SessionManager(); + $operationManager = new OperationManager($adb,$operation,$format,$sessionManager); + + try{ + if(!$sessionId || strcasecmp($sessionId,"null")===0){ + $sessionId = null; + } + + $input = $operationManager->getOperationInput(); + $adoptSession = false; + if(strcasecmp($operation,"extendsession")===0){ + if(isset($input['operation'])){ + $sessionId = vtws_getParameter($_REQUEST,"PHPSESSID"); + $adoptSession = true; + }else{ + writeErrorOutput($operationManager,new WebServiceException(WebServiceErrorCode::$AUTHREQUIRED,"Authencation required")); + return; + } + } + $sid = $sessionManager->startSession($sessionId,$adoptSession); + + if(!$sessionId && !$operationManager->isPreLoginOperation()){ + writeErrorOutput($operationManager,new WebServiceException(WebServiceErrorCode::$AUTHREQUIRED,"Authencation required")); + return; + } + + if(!$sid){ + writeErrorOutput($operationManager, $sessionManager->getError()); + return; + } + + $userid = $sessionManager->get("authenticatedUserId"); + + if($userid){ + + $seed_user = new Users(); + $current_user = $seed_user->retrieveCurrentUserInfoFromFile($userid); + + }else{ + $current_user = null; + } + + $operationInput = $operationManager->sanitizeOperation($input); + $includes = $operationManager->getOperationIncludes(); + + foreach($includes as $ind=>$path){ + require_once($path); + } + $rawOutput = $operationManager->runOperation($operationInput,$current_user); + writeOutput($operationManager, $rawOutput); + }catch(WebServiceException $e){ + writeErrorOutput($operationManager,$e); + }catch(Exception $e){ + writeErrorOutput($operationManager, + new WebServiceException(WebServiceErrorCode::$INTERNALERROR,"Unknown Error while processing request")); + } +?>