From d6d27b28b3d1fd3d3cfdc537fa1cd385285532e1 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 17 Apr 2013 10:06:51 -0400 Subject: [PATCH 1/2] DOC SYSTEM Arreglo para el instalador de docSystem Arreglo para el instalador de docSystem --- workflow/engine/controllers/installer.php | 106 ++++++++++++---------- workflow/engine/methods/services/soap.php | 9 ++ 2 files changed, 65 insertions(+), 50 deletions(-) diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index 81a806923..cae77de91 100644 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -363,8 +363,9 @@ class Installer extends Controller */ public function createWorkspace () { - if (file_exists($this->path_shared . 'partner.info')) { - $_REQUEST['PARTNER_FLAG'] = true; + $pathSharedPartner = trim( $_REQUEST['pathShared'] ); + if (file_exists($pathSharedPartner.'partner.info')) { + $_REQUEST['PARTNER_FLAG'] = true; } $this->setResponseType( 'json' ); if ($_REQUEST['db_engine'] == 'mysql') { @@ -838,19 +839,20 @@ class Installer extends Controller // getting configuration from env.ini $sysConf = System::getSystemConfiguration( $envFile ); + try { + // update the main index file + $indexFileUpdated = System::updateIndexFile( array ('lang' => 'en','skin' => $updatedConf['default_skin'] + ) ); + } catch (Exception $e) { + $info->result = false; + $info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html.")); + $info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL'); + $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html'))); + return $info; + } + if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { - $this->buildParternExtras($db_username, $db_password, $_REQUEST['workspace'], SYS_LANG); - } else { - try { - // update the main index file - $indexFileUpdated = System::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin'])); - } catch (Exception $e) { - $info->result = false; - $info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html.")); - $info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL'); - $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html'))); - return $info; - } + $this->buildParternExtras($adminUsername, $adminPassword, $_REQUEST['workspace'], SYS_LANG); } $this->installLog( G::LoadTranslation('ID_INDEX_FILE_UPDATED', SYS_LANG, Array($indexFileUpdated, $sysConf['default_lang'],$sysConf['default_skin']))); @@ -1336,9 +1338,9 @@ class Installer extends Controller $user = urlencode($username); $pass = urlencode($password); $lang = urlencode($lang); - + $ch = curl_init(); - + // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/login/authentication"); curl_setopt($ch, CURLOPT_HEADER, 0); @@ -1349,7 +1351,7 @@ class Installer extends Controller curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "form[USR_USERNAME]=$user&form[USR_PASSWORD]=$pass&form[USER_LANG]=$lang"); curl_setopt($ch, CURLOPT_TIMEOUT, 90); - + $output = curl_exec($ch); curl_close($ch); @@ -1358,10 +1360,11 @@ class Installer extends Controller */ $ch = curl_init(); + $postData = array(); // File to upload/post $postData['form[LANGUAGE_FILENAME]'] = "@".PATH_CORE."content/translations/processmaker.$lang.po"; - + curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/languages_Import"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); @@ -1372,41 +1375,16 @@ class Installer extends Controller curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_TIMEOUT, 90); - - + $output = curl_exec($ch); curl_close($ch); /** - * Upload plugin file + * Upload skin file */ $ch = curl_init(); - - // resolv the plugin name - $plugins = glob(PATH_CORE."plugins/*.tar"); - if (count($plugins) > 0) { - $pluginName = $plugins[0]; - - // File to upload/post - $postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}"; - //http://pmos/sysworkflow/en/classic/setup/skin_Ajax - curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile"); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_VERBOSE, 0); - curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile); - curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); - curl_setopt($ch, CURLOPT_TIMEOUT, 90); - - $output = curl_exec($ch); - curl_close($ch); - } - - $ch = curl_init(); + $postData = array(); $skins = glob(PATH_CORE."data/partner/*.tar"); if (count($skins) > 0) { @@ -1418,7 +1396,7 @@ class Installer extends Controller $postData['action'] = "importSkin"; // File to upload/post $postData['uploadedFile'] = "@".$skin; - + curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/skin_Ajax"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); @@ -1429,12 +1407,40 @@ class Installer extends Controller curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_TIMEOUT, 90); - - echo $output = curl_exec($ch); + + $output = curl_exec($ch); + curl_close($ch); + } + + /** + * Upload plugin file + */ + + $ch = curl_init(); + $postData = array(); + // resolv the plugin name + $plugins = glob(PATH_CORE."plugins/*.tar"); + if (count($plugins) > 0) { + $pluginName = $plugins[0]; + + // File to upload/post + $postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}"; + curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile"); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_VERBOSE, 0); + curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile); + curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); + curl_setopt($ch, CURLOPT_TIMEOUT, 90); + + + $output = curl_exec($ch); curl_close($ch); } } } - diff --git a/workflow/engine/methods/services/soap.php b/workflow/engine/methods/services/soap.php index c0e0f4ec4..ebfbc9af4 100755 --- a/workflow/engine/methods/services/soap.php +++ b/workflow/engine/methods/services/soap.php @@ -1,4 +1,13 @@ buildParternExtras('admin', 'sample', 'workflow', 'pt-BR'); + + +die; + ini_set( "soap.wsdl_cache_enabled", "0" ); // disabling WSDL cache From 545c46529fcd9b640872a930bc169411be1b509a Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 17 Apr 2013 10:25:32 -0400 Subject: [PATCH 2/2] DOC SYSTEM Arreglo para el instalador de docSystem Arreglo para el instalador de docSystem --- workflow/engine/controllers/installer.php | 29 +++++++++++------------ workflow/engine/methods/services/soap.php | 9 ------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index cae77de91..9eaefd320 100644 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -839,20 +839,19 @@ class Installer extends Controller // getting configuration from env.ini $sysConf = System::getSystemConfiguration( $envFile ); - try { - // update the main index file - $indexFileUpdated = System::updateIndexFile( array ('lang' => 'en','skin' => $updatedConf['default_skin'] - ) ); - } catch (Exception $e) { - $info->result = false; - $info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html.")); - $info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL'); - $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html'))); - return $info; - } - if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { $this->buildParternExtras($adminUsername, $adminPassword, $_REQUEST['workspace'], SYS_LANG); + } else { + try { + // update the main index file + $indexFileUpdated = System::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin'])); + } catch (Exception $e) { + $info->result = false; + $info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html.")); + $info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL'); + $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html'))); + return $info; + } } $this->installLog( G::LoadTranslation('ID_INDEX_FILE_UPDATED', SYS_LANG, Array($indexFileUpdated, $sysConf['default_lang'],$sysConf['default_skin']))); @@ -1406,16 +1405,16 @@ class Installer extends Controller curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); - curl_setopt($ch, CURLOPT_TIMEOUT, 90); + curl_setopt($ch, CURLOPT_TIMEOUT, 90); $output = curl_exec($ch); curl_close($ch); } - /** + /** * Upload plugin file */ - + $ch = curl_init(); $postData = array(); // resolv the plugin name diff --git a/workflow/engine/methods/services/soap.php b/workflow/engine/methods/services/soap.php index ebfbc9af4..c0e0f4ec4 100755 --- a/workflow/engine/methods/services/soap.php +++ b/workflow/engine/methods/services/soap.php @@ -1,13 +1,4 @@ buildParternExtras('admin', 'sample', 'workflow', 'pt-BR'); - - -die; - ini_set( "soap.wsdl_cache_enabled", "0" ); // disabling WSDL cache