From 6e5f3b8bddf39371f0d72847e4e3f15facc91171 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jan 2014 16:29:25 +0100 Subject: [PATCH] Fix: entity into public pages not set at correct place --- htdocs/public/members/new.php | 9 ++++----- htdocs/public/members/public_card.php | 11 +++++------ htdocs/public/members/public_list.php | 11 +++++------ htdocs/public/paybox/newpayment.php | 6 ++++++ htdocs/public/paybox/paymentko.php | 6 ++++++ htdocs/public/paybox/paymentok.php | 6 ++++++ htdocs/public/paypal/newpayment.php | 9 ++++----- htdocs/public/paypal/paymentko.php | 11 ++++++----- htdocs/public/paypal/paymentok.php | 11 ++++++----- 9 files changed, 48 insertions(+), 32 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 3e3082cc981..34a96f7bcb6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -38,12 +38,11 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -// For MultiCompany module +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_int($entity)) -{ - define("DOLENTITY", $entity); -} +if (is_int($entity)) define("DOLENTITY", $entity); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 0fc725c8ed4..2a9b3465543 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -27,12 +27,11 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -// For MultiCompany module -$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : 1); -if (is_int($entity)) -{ - define("DOLENTITY", $entity); -} +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_int($entity)) define("DOLENTITY", $entity); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index d186467ee04..1b6d23d946c 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -27,12 +27,11 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -// For MultiCompany module -$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : 1); -if (is_int($entity)) -{ - define("DOLENTITY", $entity); -} +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_int($entity)) define("DOLENTITY", $entity); require '../../main.inc.php'; diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 77437c110d2..b8bad33c08f 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -27,6 +27,12 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_int($entity)) define("DOLENTITY", $entity); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index f01628324bb..a9da81d0e68 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -26,6 +26,12 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_int($entity)) define("DOLENTITY", $entity); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index e204b6d6697..350d409735c 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -26,6 +26,12 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_int($entity)) define("DOLENTITY", $entity); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 81c362633ed..91d1f67a3b9 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -29,12 +29,11 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -// For MultiCompany module +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_int($entity)) -{ - define("DOLENTITY", $entity); -} +if (is_int($entity)) define("DOLENTITY", $entity); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index 5a59e288662..3427f6a9b82 100644 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -29,16 +29,17 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_int($entity)) define("DOLENTITY", $entity); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -// For MultiCompany module. -// TODO This should be useless. Because entity must be retreive from object ref and not from url. -$entity=GETPOST('entity')?GETPOST('entity','int'):1; -if (is_int($entity)) define("DOLENTITY", $entity); - // Security check if (empty($conf->paypal->enabled)) accessforbidden('',1,1,1); diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index d4aed404597..68420f3bbd8 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -29,16 +29,17 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retreive from object ref and not from url. +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_int($entity)) define("DOLENTITY", $entity); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -// For MultiCompany module -// TODO This should be useless. Because entity must be retreive from object ref and not from url. -$entity=GETPOST('entity')?GETPOST('entity','int'):1; -if (is_int($entity)) define("DOLENTITY", $entity); - // Security check if (empty($conf->paypal->enabled)) accessforbidden('',1,1,1);