This commit is contained in:
Roly Rudy Gutierrez Pinto
2018-10-19 17:01:49 -04:00
parent 0e84876ee3
commit af2ec6e71c
23 changed files with 171 additions and 280 deletions

View File

@@ -5451,7 +5451,7 @@ class G
} elseif ($configuration['MESS_ENGINE'] == 'PHPMAILER' && preg_match('/(.+)@(.+)\.(.+)/', $configuration['MESS_ACCOUNT'], $match)) {
$from .= ' <' . $configuration['MESS_ACCOUNT'] . '>';
} else {
$from .= ' <info@' . ((isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] != '') ? $_SERVER['HTTP_HOST'] : 'processmaker.com') . '>';
$from .= ' <info@' . System::getDefaultMailDomain() . '>';
}
}
} else {
@@ -5460,15 +5460,15 @@ class G
} elseif ($configuration['MESS_FROM_NAME'] != '' && $configuration['MESS_ENGINE'] == 'PHPMAILER' && preg_match('/(.+)@(.+)\.(.+)/', $configuration['MESS_ACCOUNT'], $match)) {
$from = $configuration['MESS_FROM_NAME'] . ' <' . $configuration['MESS_ACCOUNT'] . '>';
} elseif ($configuration['MESS_FROM_NAME'] != '') {
$from = $configuration['MESS_FROM_NAME'] . ' <info@' . ((isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] != '') ? $_SERVER['HTTP_HOST'] : 'processmaker.com') . '>';
$from = $configuration['MESS_FROM_NAME'] . ' <info@' . System::getDefaultMailDomain() . '>';
} elseif ($configuration['MESS_FROM_MAIL'] != '') {
$from = $configuration['MESS_FROM_MAIL'];
} elseif ($configuration['MESS_ENGINE'] == 'PHPMAILER' && preg_match('/(.+)@(.+)\.(.+)/', $configuration['MESS_ACCOUNT'], $match)) {
$from = $configuration['MESS_ACCOUNT'];
} elseif ($configuration['MESS_ENGINE'] == 'PHPMAILER' && $configuration['MESS_ACCOUNT'] != '' && !preg_match('/(.+)@(.+)\.(.+)/', $configuration['MESS_ACCOUNT'], $match)) {
$from = $configuration['MESS_ACCOUNT'] . ' <info@' . ((isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] != '') ? $_SERVER['HTTP_HOST'] : 'processmaker.com') . '>';
$from = $configuration['MESS_ACCOUNT'] . ' <info@' . System::getDefaultMailDomain() . '>';
} else {
$from = 'info@' . ((isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] != '') ? $_SERVER['HTTP_HOST'] : 'processmaker.com');
$from = 'info@' . System::getDefaultMailDomain();
}
}
return $from;

View File

@@ -1,45 +1,6 @@
<?php
/**
* class.table.php
*
* @package gulliver.system
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
*
*
*
*
*
*
* Table class definition
* Render table
*
* @package gulliver.system
* @author Fernando Ontiveros Lira <fernando@colosa.com>
* @copyright (C) 2002 by Colosa Development Team.
*
*/
use ProcessMaker\Core\System;
class Table
{
@@ -125,8 +86,8 @@ class Table
public function SetSource ($stQry = "", $stDefaultOrder = "UID", $stDefaultOrderDir = 'ASC')
{
//to fix missing value for variable orderDir, when between pages changes.
$url1 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '?';
$url2 = strstr( $_SERVER['HTTP_REFERER'] . '?', $_SERVER['HTTP_HOST'] );
$url1 = System::getServerHost() . $_SERVER['REQUEST_URI'] . '?';
$url2 = strstr($_SERVER['HTTP_REFERER'] . '?', System::getServerHost());
$url1 = substr( $url1, 0, strpos( $url1, '?' ) );
$url2 = substr( $url2, 0, strpos( $url2, '?' ) );
if ($url1 != $url2) {

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
/**
@@ -2939,7 +2940,7 @@ class XmlFormFieldFile extends XmlFormField
if ($row["DOC_UID"] == $this->input) {
$permission = true;
$url = ((G::is_https()) ? "https://" : "http://") . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]) . "/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$url = System::getServerProtocolHost() . dirname($_SERVER["REQUEST_URI"]) . "/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$sw = 1;
}
}

View File

@@ -1,6 +1,6 @@
<?php
use ProcessMaker\Core\System;
class ActionsByEmailCoreClass extends PMPlugin
{
@@ -131,21 +131,8 @@ class ActionsByEmailCoreClass extends PMPlugin
$_SESSION['CURRENT_DYN_UID'] = $configuration['DYN_UID'];
$__ABE__ = '';
$conf = new Configurations();
$envSkin = defined("SYS_SKIN") ? SYS_SKIN : $conf->getConfiguration('SKIN_CRON', '');
$envHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : SERVER_NAME;
$envProtocol = defined("REQUEST_SCHEME") && REQUEST_SCHEME === "https";
if (isset($_SERVER['SERVER_PORT'])) {
$envPort = ($_SERVER['SERVER_PORT'] != "80") ? ":" . $_SERVER['SERVER_PORT'] : "";
} else if (defined('SERVER_PORT')) {
$envPort = (SERVER_PORT . "" != "80") ? ":" . SERVER_PORT : "";
} else {
$envPort = ""; // Empty by default
}
if (!empty($envPort) && strpos($envHost, $envPort) === false) {
$envHost = $envHost . $envPort;
}
$link = (G::is_https() || $envProtocol ? 'https://' : 'http://') . $envHost . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $envSkin . '/services/ActionsByEmail';
$link = System::getServerMainPath() . '/services/ActionsByEmail';
switch ($configuration['ABE_TYPE']) {
case 'CUSTOM':

View File

@@ -1,5 +1,7 @@
<?php
use ProcessMaker\Core\System;
if (! defined( 'JAVA_BRIDGE_PATH' )) {
define( 'JAVA_BRIDGE_PATH', 'JavaBridgePM' );
}
@@ -10,11 +12,6 @@ if (! defined( 'JAVA_BRIDGE_HOST' )) {
define( 'JAVA_BRIDGE_HOST', '127.0.0.1' );
}
/**
*
* @package workflow.engine.classes
*/
class JavaBridgePM
{
public $JavaBridgeDir = JAVA_BRIDGE_PATH;
@@ -125,7 +122,7 @@ class JavaBridgePM
$template->assign( 'heightDetail', count( $xmlFields ) * 15 + 20 );
$template->assign( 'PAGE_NUMBER', '{PAGE_NUMBER}' );
$logoReporte = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/images/processmaker.logo.jpg';
$logoReporte = System::getServerProtocolHost() . '/images/processmaker.logo.jpg';
$template->assign( 'logoReporte', $logoReporte );
foreach ($xmlFields as $key => $val) {

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
class ProcessMap
@@ -2708,13 +2709,7 @@ class ProcessMap
global $G_FORM;
$G_PUBLISH = new Publisher();
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$link = System::getServerMainPath() . '/' . $sProcessUID . '/';
$row = array();
$c = 0;
@@ -4725,38 +4720,22 @@ class ProcessMap
$task->load($task_uid);
$task_name = $task->getTasTitle();
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$link = System::getServerMainPath() . '/' . $sProcessUID . '/';
$row = array();
$c = 0;
/*
$oTask = new Task ( );
$TaskFields = $oTask->kgetassigType ( $sProcessUID , $tas='');
*/
$TaskFields['TAS_ASSIGN_TYPE'] = '';
//$row [] = array ('W_TITLE' => '', 'W_DELETE' => '', 'TAS_ASSIGN_TYPE' => $TaskFields ['TAS_ASSIGN_TYPE'] );
if (is_dir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
$dynTitle = str_replace(' ', '_', str_replace('/', '_', $dynTitle));
$arlink = $link . $dynTitle . '.php';
//$arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>";
}
}
}
$row = array('W_LINK' => $arlink, 'DYN_TITLE' => $dynTitle, 'TAS_TITLE' => $task_name, 'USR_UID' => $usr_uid_evn, 'DYN_UID' => $dynUid );
// $oJSON = new Services_JSON ( );
// $tmpData = $oJSON->encode( $row ) ;
// $tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
// $result = $tmpData;
$result = array();
$result['success'] = true;
$result['data'] = $row;

View File

@@ -2487,7 +2487,7 @@ class WsBase
$arrayUserData = $user->load($userId);
if (trim($arrayUserData["USR_EMAIL"]) == "") {
$arrayUserData["USR_EMAIL"] = "info@" . $_SERVER["HTTP_HOST"];
$arrayUserData["USR_EMAIL"] = "info@" . System::getDefaultMailDomain();
}
$sFromName = "\"" . $arrayUserData["USR_FIRSTNAME"] . " " . $arrayUserData["USR_LASTNAME"] . "\" <" . $arrayUserData["USR_EMAIL"] . ">";

View File

@@ -1,16 +1,7 @@
<?php
/**
* Skeleton subclass for representing a row from the 'OUTPUT_DOCUMENT' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package workflow.engine.classes.model
*/
use ProcessMaker\Core\System;
class OutputDocument extends BaseOutputDocument
{
public function __construct()
@@ -1160,7 +1151,7 @@ class OutputDocument extends BaseOutputDocument
copy($sPath . $sFilename . '.html', PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');
try {
$status = $pipeline->process((G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $_SESSION['APPLICATION'] . '/outdocs/' . $sFilename . '.html', $g_media);
$status = $pipeline->process(System::getServerProtocolHost() . '/files/' . $_SESSION['APPLICATION'] . '/outdocs/' . $sFilename . '.html', $g_media);
copy(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf', $sPath . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');

View File

@@ -555,7 +555,7 @@ class InstallerModule extends Controller
public function forceTogenerateTranslationsFiles($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, G::browserCacheFilesUrl((G::is_https() ? "https://" : "http://") . $_SERVER["HTTP_HOST"] . "/js/ext/translation.en.js?r=" . rand(1, 10000)));
curl_setopt($ch, CURLOPT_URL, G::browserCacheFilesUrl(System::getServerProtocolHost() . "/js/ext/translation.en.js?r=" . rand(1, 10000)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
class caseSchedulerProxy extends HttpProxyController
@@ -92,12 +93,7 @@ class caseSchedulerProxy extends HttpProxyController
$sWS_USER = trim( $params->WS_USER );
$sWS_PASS = trim( $params->WS_PASS );
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = System::getServerMainPath() . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$user = $sWS_USER;

View File

@@ -40,13 +40,7 @@ class webEntryProxy extends HttpProxyController
$sWS_USER = trim( $params->WS_USER );
$sWS_PASS = trim( $params->WS_PASS );
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = System::getServerMainPath() . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$user = $sWS_USER;
@@ -137,12 +131,6 @@ class webEntryProxy extends HttpProxyController
$oTask->load( $sTASKS );
$tas_title = $oTask->getTasTitle();
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$sContent = '';
$SITE_PUBLIC_PATH = '';
if (file_exists( $SITE_PUBLIC_PATH . '' )) {
@@ -167,8 +155,8 @@ class webEntryProxy extends HttpProxyController
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
$template = new TemplatePower( $pluginTpl );
$template->prepare();
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'wsdlUrl', System::getServerMainPath() . '/services/wsdl2');
$template->assign( 'wsUploadUrl', System::getServerMainPath() . '/services/upload');
$template->assign( 'processUid', $sPRO_UID );
$template->assign( 'dynaformUid', $sDYNAFORM );
$template->assign( 'taskUid', $sTASKS );
@@ -218,7 +206,7 @@ class webEntryProxy extends HttpProxyController
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update( $aDataEvent );
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$link = System::getServerMainPath() . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$this->success = true;
$this->msg = G::LoadTranslation( 'ID_WEB_ENTRY_SUCCESS_NEW' );

View File

@@ -1,46 +1,16 @@
<?php
/**
* cases_SchedulerValidateUser.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/**
* process_SchedulerValidate_User
* validates if the username and password are valid data and if the user assigned
* to the process and task has the rights and persmissions required to create a cron task
*/
use ProcessMaker\Core\System;
$sWS_USER = trim( $_REQUEST['USERNAME'] );
$sWS_PASS = trim( $_REQUEST['PASSWORD'] );
$streamContext = [];
if (G::is_https()) {
$http = 'https://';
$streamContext = ['stream_context' => stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]])];
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = System::getServerMainPath() . '/services/wsdl2';
$client = new SoapClient($endpoint, $streamContext);
$user = $sWS_USER;

View File

@@ -267,7 +267,7 @@ try {
$aLog['LOG_SID'] = session_id();
$aLog['LOG_INIT_DATE'] = date('Y-m-d H:i:s');
//$aLog['LOG_END_DATE'] = '0000-00-00 00:00:00';
$aLog['LOG_CLIENT_HOSTNAME']= $_SERVER['HTTP_HOST'];
$aLog['LOG_CLIENT_HOSTNAME']= System::getServerHost();
$aLog['USR_UID'] = $_SESSION['USER_LOGGED'];
$weblog->create($aLog);
/**end log**/

View File

@@ -32,7 +32,6 @@ try {
throw (new Exception( G::LoadTranslation('ID_TASK') . "'" . $TaskFields['TAS_TITLE'] . "'" . G::LoadTranslation('ID_NOT_HAVE_USERS')));
}
$http = (G::is_https())? "https://" : "http://";
$sContent = '';
$infoProcess = new Process();
@@ -68,8 +67,8 @@ try {
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
$template = new TemplatePower( $pluginTpl );
$template->prepare();
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'wsdlUrl', System::getServerMainPath() . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', System::getServerMainPath() . '/services/upload' );
$template->assign( 'processUid', $sPRO_UID );
$template->assign( 'dynaformUid', $sDYNAFORM );
$template->assign( 'taskUid', $sTASKS );
@@ -134,18 +133,18 @@ try {
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update( $aDataEvent );
//Show link
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$link = System::getServerMainPath() . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
print $link;
//print "\n<a href='$link' target='_new' > $link </a>";
} else {
$G_FORM = new Form( $sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false );
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
$G_FORM->action = System::getServerMainPath() . '/services/cases_StartExternal.php';
$scriptCode = '';
$scriptCode = $G_FORM->render( PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode );
$scriptCode = str_replace( '/controls/', $http . $_SERVER['HTTP_HOST'] . '/controls/', $scriptCode );
$scriptCode = str_replace( '/js/maborak/core/images/', $http . $_SERVER['HTTP_HOST'] . '/js/maborak/core/images/', $scriptCode );
$scriptCode = str_replace( '/controls/', System::getServerProtocolHost() . '/controls/', $scriptCode );
$scriptCode = str_replace( '/js/maborak/core/images/', System::getServerProtocolHost() . '/js/maborak/core/images/', $scriptCode );
//render the template
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentry.tpl';
@@ -157,7 +156,7 @@ try {
$template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
$template->assign("siteUrl", System::getServerProtocolHost());
$template->assign("sysSys", config("system.workspace"));
$template->assign("sysLang", SYS_LANG);
$template->assign("sysSkin", SYS_SKIN);
@@ -171,7 +170,7 @@ try {
if (sizeof( $sUidGrids ) > 0) {
foreach ($sUidGrids as $k => $v) {
$template->newBlock( 'grid_uids' );
$template->assign( 'siteUrl', $http . $_SERVER['HTTP_HOST'] );
$template->assign( 'siteUrl', System::getServerProtocolHost() );
$template->assign( 'gridFileName', $sPRO_UID . '/' . $v );
}
}

View File

@@ -1,9 +1,6 @@
<?php
/**
* process_webEntryValidate
* validates if the username and password are valid data and if the user assigned
* to the webentry has the rights and persmissions required
*/
use ProcessMaker\Core\System;
$sPRO_UID = $oData->PRO_UID;
$sTASKS = $oData->TASKS;
@@ -16,20 +13,12 @@ $sWS_PASS = trim( $oData->WS_PASS );
$sWS_ROUNDROBIN = $oData->WS_ROUNDROBIN;
$sWE_USR = $oData->WE_USR;
//echo ($sPRO_UID."<br>");
//echo ($sTASKS."<br>");
//echo ($sDYNAFORM."<br>");
$streamContext = [];
if (G::is_https()) {
$http = 'https://';
$streamContext = ['stream_context' => stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]])]; //lsl
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = System::getServerMainPath() . '/services/wsdl2';
$client = new SoapClient( $endpoint, $streamContext );
$user = $sWS_USER;

View File

@@ -1,28 +1,19 @@
<?php
/**
* webEntryValidate_Val_assig
* it gets the assign type for the task
* with pro_uid and tas_uid
*/
use ProcessMaker\Core\System;
$sPRO_UID = $oData->PRO_UID;
$sTASKS = $oData->TASKS;
$sDYNAFORM = $oData->DYNAFORM;
if (G::is_https())
$http = 'https://';
else
$http = 'http://';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = System::getServerMainPath() . '/services/wsdl2';
@$client = new SoapClient($endpoint);
$oTask = new Task();
$TaskFields = $oTask->kgetassigType($sPRO_UID, $sTASKS);
if ($TaskFields['TAS_ASSIGN_TYPE'] == 'BALANCED')
if ($TaskFields['TAS_ASSIGN_TYPE'] == 'BALANCED') {
echo 1;
else
} else {
echo 0;
?>
}

View File

@@ -1,26 +1,7 @@
<?php
/**
* webServicesSetup.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
use ProcessMaker\Core\System;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
return $RBAC_Response;
@@ -28,7 +9,7 @@ $dbc = new DBConnection();
$ses = new DBSession( $dbc );
if (! isset( $_SESSION['END_POINT'] )) {
$aFields['WS_HOST'] = $_SERVER['HTTP_HOST'];
$aFields['WS_HOST'] = System::getServerHost();
$aFields['WS_WORKSPACE'] = config("system.workspace");
} else {
if (strpos( $_SESSION['END_POINT'], 'https' ) !== false) {

View File

@@ -1,6 +1,7 @@
<?php
namespace ProcessMaker\BusinessModel\Cases;
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
class OutputDocument
@@ -932,7 +933,7 @@ class OutputDocument
}
copy($sPath . $sFilename . '.html', PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');
try {
$status = $pipeline->process((\G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $sApplication . '/outdocs/' . $sFilename . '.html', $g_media);
$status = $pipeline->process(System::getServerProtocolHost() . '/files/' . $sApplication . '/outdocs/' . $sFilename . '.html', $g_media);
copy(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf', $sPath . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');

View File

@@ -1,7 +1,9 @@
<?php
namespace ProcessMaker\BusinessModel;
use \G;
use ProcessMaker\Core\System;
class ProjectUser
{
@@ -222,12 +224,8 @@ class ProjectUser
$sTASKS = $sActivityUID;
$sWS_USER = trim( $oData['username'] );
$sWS_PASS = trim( $oData['password'] );
if (\G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = System::getServerMainPath() . '/services/wsdl2';
@$client = new \SoapClient( $endpoint );
$user = $sWS_USER;
$pass = $sWS_PASS;
@@ -323,9 +321,7 @@ class ProjectUser
public function userLogin($username, $password)
{
try {
$http = (\G::is_https())? "https://" : "http://";
$client = new \SoapClient($http . $_SERVER["HTTP_HOST"] . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/wsdl2");
$client = new \SoapClient(System::getServerMainPath() . "/services/wsdl2");
$params = array(
"userid" => $username,

View File

@@ -42,7 +42,7 @@ class WebEntry
public function __construct()
{
$this->pathDataPublic = defined("PATH_DATA_PUBLIC") ? PATH_DATA_PUBLIC : \G::$pathDataPublic;
$this->httpHost = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : \G::$httpHost;
$this->httpHost = System::getServerHost();
$this->sysSys = !empty(config("system.workspace")) ? config("system.workspace") : \G::$sysSys;
$this->sysSkin = defined("SYS_SKIN") ? SYS_SKIN : \G::$sysSkin;
try {
@@ -848,9 +848,7 @@ class WebEntry
{
try {
if ((!isset($record['WE_LINK_GENERATION']) || $record['WE_LINK_GENERATION']==='DEFAULT') && $record["WE_METHOD"] == "WS") {
$http = (\G::is_https())? "https://" : "http://";
$url = $http . $_SERVER["HTTP_HOST"] . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $record["PRO_UID"];
$url = System::getServerMainPath() . "/" . $record["PRO_UID"];
$record["WE_DATA"] = $url . "/" . $record["WE_DATA"];
}

View File

@@ -2,30 +2,30 @@
namespace ProcessMaker\BusinessModel;
use WebEntryEventPeer;
use ProcessPeer;
use BasePeer;
use BpmnFlowPeer;
use Content;
use Criteria;
use WebEntryPeer;
use Exception;
use G;
use BpmnFlowPeer;
use ProcessMaker\BusinessModel\Process as BusinessModelProcess;
use ProcessMaker\BusinessModel\Validator as BusinessModelValidator;
use ProcessMaker\Core\System;
use ProcessMaker\Project\Workflow;
use WebEntryEvent as ModelWebEntryEvent;
use ProcessMaker\Util\Common;
use Task as ModelTask;
use ProcessPeer;
use Propel;
use BasePeer;
use Content;
use Tasks;
use Step;
use TaskPeer;
use StepPeer;
use ResultSet;
use Step;
use StepPeer;
use Task as ModelTask;
use TaskPeer;
use Tasks;
use TaskUser;
use TaskUserPeer;
use WebEntryEvent as ModelWebEntryEvent;
use WebEntryEventPeer;
use WebEntryPeer;
class WebEntryEvent
{
@@ -1394,8 +1394,7 @@ class WebEntryEvent
return $url . "/" . $weData;
} else {
$url = $http . $_SERVER["HTTP_HOST"] . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $prj_uid;
$url = System::getServerMainPath() . "/" . $prj_uid;
return $url . "/" . $weData;
}
}

View File

@@ -1321,7 +1321,7 @@ class System
$serverProtocol = ($serverProtocol != '') ? $serverProtocol : ((G::is_https()) ? 'https' : 'http');
$serverHostname = $arraySystemConfiguration['server_hostname_requests_frontend'];
$serverHostname = ($serverHostname != '') ? $serverHostname : $_SERVER['HTTP_HOST'];
$serverHostname = ($serverHostname != '') ? $serverHostname : System::getServerHost();
//Return
return $serverProtocol . '://' . $serverHostname;
@@ -1523,5 +1523,93 @@ class System
config(['connections.report.username' => $dbReportUser]);
config(['connections.report.password' => $dbReportPass]);
}
/**
* Get current server protocol.
*
* @return string
*/
public static function getServerProtocol()
{
return G::is_https() ? "https://" : "http://";
}
/**
* Get current server host
*
* @return string
*/
public static function getServerHostname()
{
$host = "";
if (!empty($_SERVER['SERVER_NAME'])) {
$host = $_SERVER['SERVER_NAME'];
} else if (defined('SERVER_NAME')) {
$host = SERVER_NAME;
}
return $host;
}
/**
* Get current server port.
*
* @return string
*/
public static function getServerPort()
{
$port = "";
if (isset($_SERVER['SERVER_PORT'])) {
$port = $_SERVER['SERVER_PORT'];
} else if (defined('SERVER_PORT')) {
$port = SERVER_PORT;
}
return $port;
}
/**
* Get current host (hostname + port).
*
* @return string
*/
public static function getServerHost()
{
$port = self::getServerPort();
if (!empty($port) && $port != '80') {
$port = ':' . $port;
}
return self::getServerHostname() . $port;
}
/**
* Get current server protocol and host.
*
* @return string
*/
public static function getServerProtocolHost()
{
return self::getServerProtocol() . self::getServerHost();
}
/**
* Get server main path (protocol + host + port + workspace + lang + skin).
*
* @return string
*/
public static function getServerMainPath()
{
$conf = new Configurations();
$skin = defined("SYS_SKIN") ? SYS_SKIN : $conf->getConfiguration('SKIN_CRON', '');
return self::getServerProtocolHost() . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $skin;
}
/**
* Get default domain mail.
*
* @return string
*/
public static function getDefaultMailDomain()
{
return !empty(self::getServerHostname()) ? self::getServerHostname() : 'processmaker.com';
}
}
// end System class

View File

@@ -1,27 +1,6 @@
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
use ProcessMaker\Core\System;
$wsSessionId = '';
if (isset ($_SESSION ['WS_SESSION_ID'])) {
@@ -38,7 +17,7 @@ if (isset ($_GET ['x'])) {
}
} else {
if (!isset ($_SESSION ['END_POINT'])) {
$wsdl = 'http://' . $_SERVER ['HTTP_HOST'];
$wsdl = System::getServerProtocolHost();
$workspace = config("system.workspace");
} else {
$wsdl = $_SESSION ['END_POINT'];