Skip to content
Snippets Groups Projects
Commit c24ee77f authored by Giovannoni Laurent's avatar Giovannoni Laurent
Browse files

fix : indentation

parent a2d3f606
No related branches found
No related tags found
No related merge requests found
<?php
/*
* Copyright 2010 Maarch
* Copyright 2012 Maarch
*
* This file is part of Maarch Framework.
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -34,154 +34,248 @@
*/
class webService {
/**
* load web service catalog of the Maarch core
*/
function WSCoreCatalog() {
if(file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php')) {
require($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php');
} elseif(file_exists($_SESSION['config']['corepath'].DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php')) {
require('core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php');
}
}
/**
* load web service catalog of the Maarch application
*/
function WSAppsCatalog() {
if(file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['businessapps'][0]['appid'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php')) {
require($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['businessapps'][0]['appid'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php');
} else {
require('apps'.DIRECTORY_SEPARATOR.$_SESSION['businessapps'][0]['appid'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php');
}
}
/**
* load web service catalog of the Maarch loading modules
*/
function WSModulesCatalog() {
for($cptModules=0;$cptModules<count($_SESSION['modules']);$cptModules++) {
if($_SESSION['modules'][$cptModules]['moduleid'] <> "" && file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules'][$cptModules]['moduleid'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php')) {
require($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules'][$cptModules]['moduleid'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php');
} elseif($_SESSION['modules'][$cptModules]['moduleid'] <> "" && file_exists($_SESSION['config']['corepath'].DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules'][$cptModules]['moduleid'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php')) {
require($_SESSION['config']['corepath'].DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules'][$cptModules]['moduleid'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'ws.php');
}
}
}
/**
* load web service catalog of the Maarch custom required
*/
function WScustomCatalog() {
if(file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'ws.php')) {
require($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'ws.php');
}
}
/**
* web service authentification
*/
function authentication() {
if((isset($_SERVER["PHP_AUTH_USER"]) && isset($_SERVER["PHP_AUTH_PW"]) && isset($_SERVER["HTTP_AUTHORIZATION"])) && $_SERVER["PHP_AUTH_USER"] && $_SERVER["PHP_AUTH_PW"] && preg_match("/^Basic /", $_SERVER["HTTP_AUTHORIZATION"])) {
list($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"]) = explode(":", base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)));
}
$authenticated = false;
if((isset($_SERVER["PHP_AUTH_USER"]) && isset($_SERVER["PHP_AUTH_PW"])) && ($_SERVER["PHP_AUTH_USER"] || $_SERVER["PHP_AUTH_PW"])) {
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_functions.php");
$func = new functions();
$connexion = new dbquery();
$connexion->connect();
if($func->isEncrypted() == "true") {
$_SESSION['user']['UserId'] = $func->decrypt($_SERVER["PHP_AUTH_USER"]);
$password = $func->decrypt($_SERVER["PHP_AUTH_PW"]);
} else {
//echo "ici";exit;
$_SESSION['user']['UserId'] = $_SERVER["PHP_AUTH_USER"];
$password = $_SERVER["PHP_AUTH_PW"];
}
$connexion->query("select * from ".$_SESSION['tablename']['users']." where user_id = '".$_SESSION['user']['UserId']."' and password = '".md5($password)."' and STATUS <> 'DEL'");
//$connexion->show();exit;
if($connexion->nb_result() > 0) {
$authenticated = true;
}
}
return $authenticated;
}
/**
* launch the web service engine required
*/
function launchWs() {
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."web_service".DIRECTORY_SEPARATOR."class_soap_server.php");
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."web_service".DIRECTORY_SEPARATOR."class_xmlrpc_server.php");
$soapServer = new MySoapServer();
$xmlRPC = new MyXmlRPCServer();
//if WSDL
if(isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'],'wsdl') == 0) {
$soapServer->makeWSDL();
} elseif(isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'],'xmlrpc') == 0) {
//XMLRPC
$xmlRPC->makeXMLRPCServer();
} else {
//if Soap
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD']=='POST') {
$soapServer->makeSOAPServer();
} else {
//default : xml Discovery
$soapServer->makeDISCO();
}
}
}
/**
* parse the requested method and return path, object and method to call
* @param $method string the methode in the signature
* @param $methods array array of signature
* @return array with path, object and method
*/
function parseRequestedMethod($method, $methods) {
if(is_array($methods)) {
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_functions.php");
$arrayMethods = array();
$func = new functions();
//var_dump($methods);
$arrayMethods = $func->object2array($methods);
//$func->show_array($arrayMethods);
foreach(array_keys($arrayMethods) as $keyMethod) {
if($arrayMethods[$keyMethod]["method"] == "custom") {
$resultArray = array("path" => "custom", "method" => null);
break;
} elseif($keyMethod == $method) {
$rootPathArray = array();
$stringMethod = $arrayMethods[$keyMethod]["method"];
$rootPathArray = explode("#",$stringMethod);
$rootPath = $rootPathArray[0];
$objectPath = $rootPathArray[1];
//echo "<br>generic path : ".$stringMethod."<br>";
//echo "root path : ".$rootPath."<br>";
//echo "object path : ".$objectPath."<br>";
$objectPathArray = array();
$objectPathArray = explode("::",$objectPath);
if($rootPath == "core") {
$path = "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR.$objectPathArray[0]."_controler.php";
} elseif($rootPath == "apps") {
$path = "apps".DIRECTORY_SEPARATOR.$_SESSION['businessapps'][0]['appid'].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR.$objectPathArray[0]."_controler.php";
} else {
preg_match("'modules'", $rootPath, $out);
if(count($out[0])) {
$modulePathArray = array();
$modulePathArray = explode("/",$rootPath);
$path = "modules".DIRECTORY_SEPARATOR.$modulePathArray[1].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR.$objectPathArray[0]."_controler.php";
}
}
$resultArray = array("path" => $path, "object" => $objectPathArray[0]."_controler", "method" => $objectPathArray[1]);
break;
}
}
} else {
$resultArray = array("path" => null, "method" => null);
}
return $resultArray;
}
/**
* load web service catalog of the Maarch core
*/
function WSCoreCatalog() {
if (file_exists($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'class'
. DIRECTORY_SEPARATOR . 'ws.php')
) {
require($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR
. 'class' . DIRECTORY_SEPARATOR . 'ws.php'
);
} elseif (file_exists($_SESSION['config']['corepath']
. DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'class'
. DIRECTORY_SEPARATOR . 'ws.php')
) {
require('core' . DIRECTORY_SEPARATOR . 'class'
. DIRECTORY_SEPARATOR . 'ws.php'
);
}
}
/**
* load web service catalog of the Maarch application
*/
function WSAppsCatalog() {
if (file_exists($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR
. $_SESSION['businessapps'][0]['appid'] . DIRECTORY_SEPARATOR
. 'class' . DIRECTORY_SEPARATOR . 'ws.php')
) {
require($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR
. $_SESSION['businessapps'][0]['appid'] . DIRECTORY_SEPARATOR
. 'class' . DIRECTORY_SEPARATOR . 'ws.php'
);
} else {
require('apps' . DIRECTORY_SEPARATOR
. $_SESSION['businessapps'][0]['appid'] . DIRECTORY_SEPARATOR
. 'class' . DIRECTORY_SEPARATOR . 'ws.php'
);
}
}
/**
* load web service catalog of the Maarch loading modules
*/
function WSModulesCatalog() {
for ($cptModules=0;$cptModules<count($_SESSION['modules']);$cptModules++) {
if (
$_SESSION['modules'][$cptModules]['moduleid'] <> ""
&& file_exists($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR
. $_SESSION['modules'][$cptModules]['moduleid']
. DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'ws.php'
)
) {
require($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR
. $_SESSION['modules'][$cptModules]['moduleid']
. DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'ws.php'
);
} elseif (
$_SESSION['modules'][$cptModules]['moduleid'] <> ""
&& file_exists($_SESSION['config']['corepath']
. DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR
. $_SESSION['modules'][$cptModules]['moduleid']
. DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'ws.php'
)
) {
require($_SESSION['config']['corepath'] . DIRECTORY_SEPARATOR
. 'modules' . DIRECTORY_SEPARATOR
. $_SESSION['modules'][$cptModules]['moduleid']
. DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'ws.php'
);
}
}
}
/**
* load web service catalog of the Maarch custom required
*/
function WScustomCatalog() {
if (file_exists($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'ws.php')
) {
require($_SESSION['config']['corepath'] . 'custom'
. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
. DIRECTORY_SEPARATOR . 'ws.php'
);
}
}
/**
* web service authentification
*/
function authentication() {
if (
(isset($_SERVER["PHP_AUTH_USER"])
&& isset($_SERVER["PHP_AUTH_PW"])
&& isset($_SERVER["HTTP_AUTHORIZATION"])
)
&& $_SERVER["PHP_AUTH_USER"] && $_SERVER["PHP_AUTH_PW"]
&& preg_match("/^Basic /", $_SERVER["HTTP_AUTHORIZATION"])
) {
list($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])
= explode(":", base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)));
}
$authenticated = false;
if (
(isset($_SERVER["PHP_AUTH_USER"])
&& isset($_SERVER["PHP_AUTH_PW"])
)
&& ($_SERVER["PHP_AUTH_USER"] || $_SERVER["PHP_AUTH_PW"])
) {
require_once("core" . DIRECTORY_SEPARATOR . "class"
. DIRECTORY_SEPARATOR . "class_functions.php");
$func = new functions();
$connexion = new dbquery();
$connexion->connect();
if ($func->isEncrypted() == "true") {
$_SESSION['user']['UserId'] = $func->decrypt($_SERVER["PHP_AUTH_USER"]);
$password = $func->decrypt($_SERVER["PHP_AUTH_PW"]);
} else {
//echo "ici";exit;
$_SESSION['user']['UserId'] = $_SERVER["PHP_AUTH_USER"];
$password = $_SERVER["PHP_AUTH_PW"];
}
$connexion->query("select * from " . $_SESSION['tablename']['users']
. " where user_id = '" . $_SESSION['user']['UserId']
. "' and password = '" . md5($password) . "' and STATUS <> 'DEL'");
//$connexion->show();exit;
if ($connexion->nb_result() > 0) {
$authenticated = true;
}
}
return $authenticated;
}
/**
* launch the web service engine required
*/
function launchWs() {
require_once("core" . DIRECTORY_SEPARATOR . "class"
. DIRECTORY_SEPARATOR . "web_service" . DIRECTORY_SEPARATOR . "class_soap_server.php");
require_once("core" . DIRECTORY_SEPARATOR . "class"
. DIRECTORY_SEPARATOR . "web_service" . DIRECTORY_SEPARATOR . "class_xmlrpc_server.php");
$soapServer = new MySoapServer();
$xmlRPC = new MyXmlRPCServer();
//if WSDL
if (
isset($_SERVER['QUERY_STRING'])
&& strcasecmp($_SERVER['QUERY_STRING'],'wsdl') == 0
) {
$soapServer->makeWSDL();
} elseif (
isset($_SERVER['QUERY_STRING'])
&& strcasecmp($_SERVER['QUERY_STRING'],'xmlrpc') == 0
) {
//XMLRPC
$xmlRPC->makeXMLRPCServer();
} else {
//if Soap
if (
isset($_SERVER['REQUEST_METHOD'])
&& $_SERVER['REQUEST_METHOD']=='POST'
) {
$soapServer->makeSOAPServer();
} else {
//default : xml Discovery
$soapServer->makeDISCO();
}
}
}
/**
* parse the requested method and return path, object and method to call
* @param $method string the methode in the signature
* @param $methods array array of signature
* @return array with path, object and method
*/
function parseRequestedMethod($method, $methods) {
if (is_array($methods)) {
require_once("core" . DIRECTORY_SEPARATOR . "class"
. DIRECTORY_SEPARATOR . "class_functions.php");
$arrayMethods = array();
$func = new functions();
//var_dump($methods);
$arrayMethods = $func->object2array($methods);
//$func->show_array($arrayMethods);
foreach (array_keys($arrayMethods) as $keyMethod) {
if ($arrayMethods[$keyMethod]["method"] == "custom") {
$resultArray = array("path" => "custom", "method" => null);
break;
} elseif ($keyMethod == $method) {
$rootPathArray = array();
$stringMethod = $arrayMethods[$keyMethod]["method"];
$rootPathArray = explode("#",$stringMethod);
$rootPath = $rootPathArray[0];
$objectPath = $rootPathArray[1];
//echo "<br>generic path : " . $stringMethod . "<br>";
//echo "root path : " . $rootPath . "<br>";
//echo "object path : " . $objectPath . "<br>";
$objectPathArray = array();
$objectPathArray = explode("::",$objectPath);
if ($rootPath == "core") {
$path = "core" . DIRECTORY_SEPARATOR . "class"
. DIRECTORY_SEPARATOR . $objectPathArray[0] . "_controler.php";
} elseif ($rootPath == "apps") {
$path = "apps" . DIRECTORY_SEPARATOR
. $_SESSION['businessapps'][0]['appid']
. DIRECTORY_SEPARATOR . "class"
. DIRECTORY_SEPARATOR . $objectPathArray[0] . "_controler.php";
} else {
preg_match("'modules'", $rootPath, $out);
if (count($out[0])) {
$modulePathArray = array();
$modulePathArray = explode("/",$rootPath);
$path = "modules" . DIRECTORY_SEPARATOR
. $modulePathArray[1] . DIRECTORY_SEPARATOR
. "class" . DIRECTORY_SEPARATOR
. $objectPathArray[0] . "_controler.php";
}
}
$resultArray = array(
"path" => $path,
"object" => $objectPathArray[0] . "_controler",
"method" => $objectPathArray[1]
);
break;
}
}
} else {
$resultArray = array("path" => null, "method" => null);
}
return $resultArray;
}
}
?>
<?php
/**
* File : index.php
/*
* Copyright 2012 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Maarch Portal entry
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief Maarch root file
*
* @package maarch
* @version MEP 1.3
* @since 10/2005
* @license GPL v3
* @author Laurent Giovannoni <dev@maarch.org>
* @file
* @author Laurent Giovannoni <dev@maarch.org>
* @date $date$
* @version $Revision$
* @ingroup core
*/
require_once('core/class/class_functions.php');
......
......@@ -8,7 +8,8 @@ $fileContentArray = array();
$fileContentArray = $client->viewResource((integer) $_REQUEST['id'], $_REQUEST['table']);
if($fileContentArray->status == "ok") {
$fileContent = base64_decode($fileContentArray->file_content);
$Fnm = $fileContentArray->tmp_path.DIRECTORY_SEPARATOR.rand()."_".md5($fileContent).".".strtolower($fileContentArray->ext);
$Fnm = $fileContentArray->tmp_path . DIRECTORY_SEPARATOR . rand()
. "_" . md5($fileContent) . "." . strtolower($fileContentArray->ext);
$inF = fopen($Fnm, "w");
fwrite($inF, $fileContent);
fclose($inF);
......@@ -18,7 +19,9 @@ if($fileContentArray->status == "ok") {
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: ".strtolower($fileContentArray->mime_type));
header("Content-Disposition: inline; filename=".basename('maarch.'.strtolower($fileContentArray->ext)).";");
header("Content-Disposition: inline; filename="
. basename('maarch.' . strtolower($fileContentArray->ext)) . ";"
);
header("Content-Transfer-Encoding: binary");
readfile($Fnm);
exit();
......
......@@ -3,7 +3,7 @@
/*
* Copyright 2010 Maarch
*
* This file is part of Maarch Framework.
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -30,19 +30,19 @@
*/
//include of classes
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_functions.php");
include_once("core".DIRECTORY_SEPARATOR."init.php");
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_portal.php");
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_db.php");
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_core_tools.php");
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."web_service".DIRECTORY_SEPARATOR."class_web_service.php");
require_once('core/class/class_functions.php');
include_once('core/init.php');
require_once('core/class/class_portal.php');
require_once('core/class/class_db.php');
require_once('core/class/class_request.php');
require_once('core/class/class_core_tools.php');
require_once('core/class/web_service/class_web_service.php');
//load Maarch session vars
$portal = new portal();
$portal->unset_session();
$portal->build_config();
$coreTools = new core_tools();
$_SESSION["custom_override_id"] = $coreTools->get_custom_id();
$_SESSION['custom_override_id'] = $coreTools->get_custom_id();
if (isset($_SESSION['custom_override_id'])
&& ! empty($_SESSION['custom_override_id'])
&& isset($_SESSION['config']['corepath'])
......@@ -50,48 +50,51 @@ if (isset($_SESSION['custom_override_id'])
) {
$path = $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
. $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR;
//echo $path;
set_include_path(
$path . PATH_SEPARATOR . $_SESSION['config']['corepath']
. PATH_SEPARATOR . get_include_path()
);
} else if (isset($_SESSION['config']['corepath'])
&& ! empty($_SESSION['config']['corepath'])
&& ! empty($_SESSION['config']['corepath'])
) {
set_include_path(
$_SESSION['config']['corepath'] . PATH_SEPARATOR . get_include_path()
);
}
$coreTools->build_core_config("core".DIRECTORY_SEPARATOR."xml".DIRECTORY_SEPARATOR."config.xml");
$_SESSION["config"]["app_id"] = $_SESSION["businessapps"][0]["appid"];
require_once("apps".DIRECTORY_SEPARATOR.$_SESSION["businessapps"][0]["appid"].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_business_app_tools.php");
$coreTools->build_core_config('core' . DIRECTORY_SEPARATOR . 'xml'
. DIRECTORY_SEPARATOR . 'config.xml'
);
$_SESSION['config']['app_id'] = $_SESSION['businessapps'][0]['appid'];
require_once('apps' . DIRECTORY_SEPARATOR . $_SESSION['businessapps'][0]['appid']
. DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR
. 'class_business_app_tools.php'
);
$businessAppTools = new business_app_tools();
$businessAppTools->build_business_app_config();
$coreTools->load_modules_config($_SESSION['modules']);
//load webservice engine
$webService = new webService();
//http Authentication
//WARNING !!!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING WARNING WARNING
//WARNING !!!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!WARNING!
if($webService->authentication()) {
//if(1==1) {
$business = new business_app_tools();
$business->load_app_var_session();
//retrieve Maarch web service catalog
$webService->WSCoreCatalog();
$webService->WSAppsCatalog();
$webService->WSModulesCatalog();
$webService->WScustomCatalog();
//launch webservice engine
$webService->launchWs();
$business = new business_app_tools();
$business->load_app_var_session();
//retrieve Maarch web service catalog
$webService->WSCoreCatalog();
$webService->WSAppsCatalog();
$webService->WSModulesCatalog();
$webService->WScustomCatalog();
//launch webservice engine
$webService->launchWs();
} else {
header("WWW-Authenticate: Basic realm=\"Maarch WebServer Engine\"");
if (preg_match("/Microsoft/", $_SERVER["SERVER_SOFTWARE"])) {
header("Status: 401 Unauthorized");
exit();
} else {
header("HTTP/1.0 401 Unauthorized");
echo "Access denied";
exit();
}
header("WWW-Authenticate: Basic realm=\"Maarch WebServer Engine\"");
if (preg_match("/Microsoft/", $_SERVER["SERVER_SOFTWARE"])) {
header("Status: 401 Unauthorized");
exit();
} else {
header("HTTP/1.0 401 Unauthorized");
echo 'Access denied';
exit();
}
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment