Merge remote branch 'upstream/master' into BUG-10852

This commit is contained in:
Hector Cortez
2013-04-16 10:02:14 -04:00

View File

@@ -838,10 +838,12 @@ class Installer extends Controller
// getting configuration from env.ini // getting configuration from env.ini
$sysConf = System::getSystemConfiguration( $envFile ); $sysConf = System::getSystemConfiguration( $envFile );
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
$this->buildParternExtras($db_username, $db_password, $_REQUEST['workspace'], SYS_LANG);
} else {
try { try {
// update the main index file // update the main index file
$indexFileUpdated = System::updateIndexFile( array ('lang' => 'en','skin' => $updatedConf['default_skin'] $indexFileUpdated = System::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin']));
) );
} catch (Exception $e) { } catch (Exception $e) {
$info->result = false; $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_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html."));
@@ -849,9 +851,6 @@ class Installer extends Controller
$this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html'))); $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html')));
return $info; return $info;
} }
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
$this->buildParternExtras($db_username, $db_password, $_REQUEST['workspace'], SYS_LANG);
} }
$this->installLog( G::LoadTranslation('ID_INDEX_FILE_UPDATED', SYS_LANG, Array($indexFileUpdated, $sysConf['default_lang'],$sysConf['default_skin']))); $this->installLog( G::LoadTranslation('ID_INDEX_FILE_UPDATED', SYS_LANG, Array($indexFileUpdated, $sysConf['default_lang'],$sysConf['default_skin'])));
@@ -1328,12 +1327,11 @@ class Installer extends Controller
// create session // create session
$cookiefile = sys_get_temp_dir() . PATH_SEP . 'curl-session';
$cookiefile = '/tmp/curl-session';
$fp = fopen($cookiefile, "w"); $fp = fopen($cookiefile, "w");
fclose($fp); fclose($fp);
chmod($cookiefile, 0777);
$user = urlencode($username); $user = urlencode($username);
$pass = urlencode($password); $pass = urlencode($password);
@@ -1341,7 +1339,6 @@ class Installer extends Controller
$ch = curl_init(); $ch = curl_init();
//die("$serv/sys{$workspace}/{$lang}/classic/login/authentication");
// set URL and other appropriate options // set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/login/authentication"); curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/login/authentication");
curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
@@ -1351,7 +1348,7 @@ class Installer extends Controller
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 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_POSTFIELDS, "form[USR_USERNAME]=$user&form[USR_PASSWORD]=$pass&form[USER_LANG]=$lang");
//curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$output = curl_exec($ch); $output = curl_exec($ch);
curl_close($ch); curl_close($ch);
@@ -1362,9 +1359,9 @@ class Installer extends Controller
$ch = curl_init(); $ch = curl_init();
// File you want to upload/post // File to upload/post
$postData['form[LANGUAGE_FILENAME]'] = "@".PATH_CORE."content/translations/processmaker.$lang.po"; $postData['form[LANGUAGE_FILENAME]'] = "@".PATH_CORE."content/translations/processmaker.$lang.po";
//http://pmos/sysworkflow/en/classic/setup/skin_Ajax
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/languages_Import"); curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/languages_Import");
curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0);
@@ -1374,11 +1371,10 @@ class Installer extends Controller
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_TIMEOUT, 90);
// grab URL and pass it to the browser $output = curl_exec($ch);
echo $output = curl_exec($ch);
curl_close($ch); curl_close($ch);
/** /**
@@ -1391,28 +1387,53 @@ class Installer extends Controller
$plugins = glob(PATH_CORE."plugins/*.tar"); $plugins = glob(PATH_CORE."plugins/*.tar");
if (count($plugins) > 0) { if (count($plugins) > 0) {
$pluginName = $plugins[0]; $pluginName = $plugins[0];
var_dump($pluginName);
var_dump("$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile"); // File to upload/post
// File you want to upload/post
$postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}"; $postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}";
//http://pmos/sysworkflow/en/classic/setup/skin_Ajax //http://pmos/sysworkflow/en/classic/setup/skin_Ajax
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile"); curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile");
//curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); 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);
}
$ch = curl_init();
$skins = glob(PATH_CORE."data/partner/*.tar");
if (count($skins) > 0) {
$skin = $skins[0];
$postData['overwrite_files'] = "on";
$postData['workspace'] = "global";
$postData['option'] = "standardupload";
$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);
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);
// grab URL and pass it to the browser
echo $output = curl_exec($ch); echo $output = curl_exec($ch);
curl_close($ch); curl_close($ch);
} }
} }
} }