将文件添加并导入到SVN库中

+YUCHENG HU+

git-svn-id: https://svn.code.sf.net/p/hawebs/svn@30 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-04-13 21:43:23 +00:00
parent ce67d9ab0b
commit 47d101743a
3 changed files with 183 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
ini_set (error_reporting,E_ALL & ~E_NOTICE );
if(isset($_REQUEST['service']))
{
if($_REQUEST['service'] == "outlook")
{
include("soap/vtigerolservice.php");
}
elseif($_REQUEST['service'] == "customerportal")
{
include("soap/customerportal.php");
}
elseif($_REQUEST['service'] == "webforms")
{
include("soap/webforms.php");
}
elseif($_REQUEST['service'] == "firefox")
{
include("soap/firefoxtoolbar.php");
}
elseif($_REQUEST['service'] == "wordplugin")
{
include("soap/wordplugin.php");
}
elseif($_REQUEST['service'] == "thunderbird")
{
include("soap/thunderbirdplugin.php");
}
else
{
echo "No Service Configured for $_REQUEST[service]";
}
}
else
{
echo "<h1>vtigerCRM Soap Services</h1>";
echo "<li>vtigerCRM Outlook Plugin EndPoint URL -- Click <a href='vtigerservice.php?service=outlook'>here</a></li>";
echo "<li>vtigerCRM Word Plugin EndPoint URL -- Click <a href='vtigerservice.php?service=wordplugin'>here</a></li>";
echo "<li>vtigerCRM ThunderBird Extenstion EndPoint URL -- Click <a href='vtigerservice.php?service=thunderbird'>here</a></li>";
echo "<li>vtigerCRM Customer Portal EndPoint URL -- Click <a href='vtigerservice.php?service=customerportal'>here</a></li>";
echo "<li>vtigerCRM WebForm EndPoint URL -- Click <a href='vtigerservice.php?service=webforms'>here</a></li>";
echo "<li>vtigerCRM FireFox Extension EndPoint URL -- Click <a href='vtigerservice.php?service=firefox'>here</a></li>";
}
?>
+14
View File
@@ -0,0 +1,14 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
$patch_version = '';
$modified_database = '';
$vtiger_current_version = '5.1.0';
$_SESSION['vtiger_version'] = $vtiger_current_version;
?>
+115
View File
@@ -0,0 +1,115 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require_once("config.inc.php");
require_once("include/HTTP_Session/Session.php");
require_once 'include/Webservices/Utils.php';
require_once("include/Webservices/State.php");
require_once("include/Webservices/OperationManager.php");
require_once("include/Webservices/SessionManager.php");
require_once("include/Zend/Json.php");
require_once('include/logging.php');
require_once "include/language/$default_language.lang.php";
$API_VERSION = "0.2";
global $seclog,$log;
$seclog =& LoggerManager::getLogger('SECURITY');
$log =& LoggerManager::getLogger('webservice');
function getRequestParamsArrayForOperation($operation){
global $operationInput;
return $operationInput[$operation];
}
function writeErrorOutput($operationManager, $error){
$state = new State();
$state->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"));
}
?>