From: Roland Häder Date: Wed, 28 Oct 2009 21:48:07 +0000 (+0000) Subject: Fixes for POST setter, template and others X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a975001c8e332a6af3513ea57e9acebeaadf1640;p=mailer.git Fixes for POST setter, template and others --- diff --git a/inc/functions.php b/inc/functions.php index de59b2e8e4..c55b421dd3 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -889,7 +889,7 @@ function generateDerefererUrl ($URL) { // Don't de-refer our own links! if (substr($URL, 0, strlen(getConfig('URL'))) != getConfig('URL')) { // De-refer this link - $URL = 'modules.php?module=loader&url=' . encodeString(compileUriCode($URL)); + $URL = '{?URL?}/modules.php?module=loader&url=' . encodeString(compileUriCode($URL)); } // END - if // Return link diff --git a/inc/header.php b/inc/header.php index cd22a87054..3ea5b4acfb 100644 --- a/inc/header.php +++ b/inc/header.php @@ -46,12 +46,12 @@ if (!defined('__SECURITY')) { // Is the header already sent? if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) { // If not in CSS mode generate the header - if ((getOutputMode() != '1')) { - // Generate header - $TITLE = ''; - + if (getOutputMode() != '1') { // Config and database connection valid? if ((isConfigLocalLoaded()) && (isConfigLoaded()) && (SQL_IS_LINK_UP()) && (isExtensionActive('sql_patches'))) { + // Init title + $TITLE = ''; + // Title decoration enabled? if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left'))." "; @@ -128,7 +128,7 @@ if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) { } // END - if // Add BODY tag or not? -if ((getOutputMode() != '1') && ($GLOBALS['header_sent'] == 1)) { +if ((getOutputMode() != '1') && ($GLOBALS['header_sent'] == 1) && ((getModule() != 'frametester') || (isGetRequestElementSet('frame')))) { loadTemplate('page_body'); $GLOBALS['header_sent'] = 2; } // END - if diff --git a/inc/js/js-order_send.php b/inc/js/js-order_send.php index 916faaba60..18981108fc 100644 --- a/inc/js/js-order_send.php +++ b/inc/js/js-order_send.php @@ -35,7 +35,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * * MA 02110-1301 USA * ************************************************************************/ - // Some security stuff... if (!defined('__SECURITY')) { die(); @@ -44,7 +43,7 @@ if (!defined('__SECURITY')) { } // Simply load the JavaScript here -loadTemplate('js_order_sent'); +loadTemplate('js_order_send'); // [EOF] ?> diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index 5779deb1bf..6bf21086fc 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -77,20 +77,21 @@ if ((isPostRequestElementSet('url')) || (isGetRequestElementSet('url')) || (isGe // Default URL is ours $url = getConfig('URL'); - // Decode URL if set in GET parameters - if (isGetRequestElementSet('url')) $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(getRequestElement('url'))))); - - // Use URL from POST data if set - if (isPostRequestElementSet('url')) $url = postRequestElement('url'); + // Use URL from POST or GET data if set + if (isPostRequestElementSet('url')) { + // POST data comes first + $url = postRequestElement('url'); + } elseif (isGetRequestElementSet('url')) { + // Then GET data + $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(getRequestElement('url'))))); + } // Add missing element $frame = ''; if (isGetRequestElementSet('frame')) $frame = getRequestElement('frame'); - switch ($frame) - { + switch ($frame) { case '': - switch ($mode) - { + switch ($mode) { case 'member': // Build frameset $content['order'] = bigintval(getRequestElement('order')); @@ -102,24 +103,25 @@ if ((isPostRequestElementSet('url')) || (isGetRequestElementSet('url')) || (isGe $content['url'] = generateDerefererUrl($url); loadTemplate('guest_frametester', false, $content); break; - } + } // END - switch break; - case 'test_top': - loadTemplate('admin_settings_saved', false, '
{--GUEST_FRAMETESTER_TOP--}'); - break; + case 'test_top': + loadTemplate('admin_settings_saved', false, '
{--GUEST_FRAMETESTER_TOP--}'); + break; - case 'back': // Back buttom - loadTemplate('member_order_back', false, getRequestElement('order')); - break; + case 'back': // Back buttom + loadTemplate('member_order_back', false, getRequestElement('order')); + break; - case 'send': // Send mail away - loadTemplate('member_order_send', false, getRequestElement('order')); - break; - } + case 'send': // Send mail away + loadTemplate('member_order_send', false, getRequestElement('order')); + break; + } // END - switch } else { // Go away... redirectToUrl('modules.php?module=login'); } -// + +// [EOF] ?> diff --git a/inc/modules/order.php b/inc/modules/order.php index 6fca97ea81..b82fb34b9d 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -74,7 +74,7 @@ if (empty($URL)) { if (SQL_AFFECTEDROWS() == 1) { // @TODO Unused: 2,4 // Load mail again... 0 1 2 3 4 5 6 7 - $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, `cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1", array(bigintval(getRequestElement('order')), getUserId()), __FILE__, __LINE__); $content = merge_array($content, SQL_FETCHARRAY($result)); SQL_FREERESULT($result); @@ -89,7 +89,6 @@ if (empty($URL)) { subtractPoints('order', getUserId(), $usedPoints); // Compile content - $content['block'] = getConfig('max_send'); $content['payment'] = getPaymentTitlePrice($content['payment_id']); $content['category'] = getCategory($content['cat_id']); diff --git a/inc/request-functions.php b/inc/request-functions.php index f67df00b8a..f4486a5c6f 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -114,7 +114,7 @@ function setRequestGetElement ($element, $value) { $GLOBALS['raw_request']['get'][$element] = $value; // Update cache - $GLOBALS['cache_request']['request_get'][$element] = $value; + $GLOBALS['cache_request']['request_get'][$element][null] = $value; } // Wrapper for elements in $_POST @@ -219,7 +219,7 @@ function setRequestPostElement ($element, $value) { } // Update cache - $GLOBALS['cache_request']['request_post'][$element] = $value; + $GLOBALS['cache_request']['request_post'][$element][null] = $value; } // Checks wether a form was sent. If so, the $_POST['ok'] element must be set diff --git a/templates/de/emails/order-admin.tpl b/templates/de/emails/order-admin.tpl index b122222b3d..339358fdca 100644 --- a/templates/de/emails/order-admin.tpl +++ b/templates/de/emails/order-admin.tpl @@ -2,7 +2,7 @@ Hallo Administrator Ein Mitglied hat soeben eine Mailbuchung durchgeführt! -Seine Buchung befindet sich nun im Sende-Pool und wird automatisch in $content[blocks] Mail-Bloecken versand. +Seine Buchung befindet sich nun im Sende-Pool und wird automatisch in {?max_send?} Mail-Bloecken versand. Hier sind nochmals seine Daten, gebuchter Text und URL zur Verifizierung: ------------------------------------------------ diff --git a/templates/de/html/member/member_order_send.tpl b/templates/de/html/member/member_order_send.tpl index aa2f86f91d..08dadaf0bc 100644 --- a/templates/de/html/member/member_order_send.tpl +++ b/templates/de/html/member/member_order_send.tpl @@ -2,5 +2,5 @@ {--MEMBER_ORDER_PLEASE_WAIT_1--}10{--MEMBER_ORDER_PLEASE_WAIT_2--}
+ src="{?URL?}/js.php?js=order_send{%version=order%}">