From 7834a71152c797779ce4bbf4b975fce892db6263 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Mon, 25 Mar 2013 17:29:43 -0400 Subject: [PATCH 1/2] Improvemente PARTNER FLAG in db.php --- workflow/engine/classes/class.Installer.php | 4 ++-- workflow/engine/controllers/installer.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/workflow/engine/classes/class.Installer.php b/workflow/engine/classes/class.Installer.php index 4b231de11..7b3be7fde 100755 --- a/workflow/engine/classes/class.Installer.php +++ b/workflow/engine/classes/class.Installer.php @@ -196,8 +196,8 @@ class Installer @mkdir($path_site . "xmlForms", 0777, true); $db_text = "options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_NAME', '" . $wf . "' );\n" . "define ('DB_USER', '" . (($this->cc_status == 1) ? $wf : $this->options['database']['username']) . "' );\n" . "define ('DB_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_RBAC_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_RBAC_NAME', '" . $rb . "' );\n" . "define ('DB_RBAC_USER', '" . (($this->cc_status == 1) ? $rb : $this->options['database']['username']) . "' );\n" . "define ('DB_RBAC_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_REPORT_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_REPORT_NAME', '" . $rp . "' );\n" . "define ('DB_REPORT_USER', '" . (($this->cc_status == 1) ? $rp : $this->options['database']['username']) . "' );\n" . "define ('DB_REPORT_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "?>"; - if (defined('PARTNER_FLAG')) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : 'false') . ");\n"; + if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { + $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $fp = @fopen($db_file, "w"); $this->log("Create: " . $db_file . " => " . ((!$fp) ? $fp : "OK") . "\n", $fp === false); diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index 99ae9543d..07c90f357 100644 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -680,8 +680,8 @@ class Installer extends Controller $dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass ); - if (defined('PARTNER_FLAG')) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : 'false') . ");\n"; + if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { + $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) )); @@ -947,8 +947,8 @@ class Installer extends Controller $dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass ); - if (defined('PARTNER_FLAG')) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : 'false') . ");\n"; + if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { + $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) )); From c906af907c0b64035ec83088f02e426c134f3a60 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Tue, 26 Mar 2013 09:16:53 -0400 Subject: [PATCH 2/2] Improvemente PARTNER FLAG in db.php --- workflow/engine/classes/class.Installer.php | 2 +- workflow/engine/controllers/installer.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow/engine/classes/class.Installer.php b/workflow/engine/classes/class.Installer.php index 7b3be7fde..63cd70404 100755 --- a/workflow/engine/classes/class.Installer.php +++ b/workflow/engine/classes/class.Installer.php @@ -197,7 +197,7 @@ class Installer $db_text = "options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_NAME', '" . $wf . "' );\n" . "define ('DB_USER', '" . (($this->cc_status == 1) ? $wf : $this->options['database']['username']) . "' );\n" . "define ('DB_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_RBAC_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_RBAC_NAME', '" . $rb . "' );\n" . "define ('DB_RBAC_USER', '" . (($this->cc_status == 1) ? $rb : $this->options['database']['username']) . "' );\n" . "define ('DB_RBAC_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_REPORT_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_REPORT_NAME', '" . $rp . "' );\n" . "define ('DB_REPORT_USER', '" . (($this->cc_status == 1) ? $rp : $this->options['database']['username']) . "' );\n" . "define ('DB_REPORT_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "?>"; if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; + $dbText .= "define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $fp = @fopen($db_file, "w"); $this->log("Create: " . $db_file . " => " . ((!$fp) ? $fp : "OK") . "\n", $fp === false); diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index 07c90f357..4be895ec5 100644 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -681,7 +681,7 @@ class Installer extends Controller $dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass ); if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; + $dbText .= "define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) )); @@ -948,7 +948,7 @@ class Installer extends Controller $dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass ); if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; + $dbText .= "define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) ));