X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=surfbar.php;h=ec7ce0e6f1242262fe5c278d9d7ba5d1b1b33d05;hb=4e47eb8b83ed2fcd4320aeed8b8c460eb1c8fe4b;hp=f6092ad36a3d29eb08fb748ab62be17f01a169ee;hpb=2ec9007220186d54f84846871ed1f7638c29baf7;p=mailer.git diff --git a/surfbar.php b/surfbar.php index f6092ad36a..ec7ce0e6f1 100644 --- a/surfbar.php +++ b/surfbar.php @@ -39,19 +39,24 @@ // Load security stuff here require('inc/libs/security_functions.php'); -// Init surfbar cache and start time -$GLOBALS['cache_array']['surfbar'] = array(); +// Init start time $GLOBALS['startTime'] = microtime(true); // Set module $GLOBALS['module'] = 'surfbar'; $GLOBALS['refid'] = 0; $GLOBALS['output_mode'] = 0; -$msg = null; +$GLOBALS['header_sent'] = 3; // Load the required file(s) require('inc/config-global.php'); +// Is a frame active? +if (REQUEST_ISSET_GET('frame')) { + // Then we need to set header_sent to 0 + $GLOBALS['header_sent'] = 0; +} // END - if + // Is the script installed? if (!isInstalled()) { // You have to install first! @@ -63,11 +68,37 @@ redirectOnUninstalledExtension('surfbar'); // No member? if (!IS_MEMBER()) { - // Redirect - // @TODO Display quick login form here or redirect as configured - redirectToUrl('modules.php?module=index'); + // Should we display login window or redirect to main page? + if ((getConfig('surfbar_guest_login_form') == 'Y') && (EXT_IS_ACTIVE('user'))) { + // Is the form sent? + if ((isFormSent()) && (REQUEST_ISSET_POST('id')) && (REQUEST_ISSET_POST('password'))) { + // Do the login procedure + $URL = USER_DO_LOGIN(REQUEST_POST('id'), REQUEST_POST('password'), basename(__FILE__)); + + // And redirect to the URL + redirectToUrl($URL); + } else { + // Load header + loadIncludeOnce('inc/header.php'); + + // Display login form + LOAD_TEMPLATE('surfbar_login_form'); + + // Allow footer here + $GLOBALS['header_sent'] = 2; + + // Load footer + loadIncludeOnce('inc/footer.php'); + } + } else { + // Redirect + redirectToUrl('index.php'); + } } // END - if +// Initialize the surfbar +SURFBAR_INIT(); + // Handle tasks on self-maintenance SURFBAR_HANDLE_SELF_MAINTENANCE(); @@ -125,7 +156,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array( // Load template for stopped surfbar LOAD_TEMPLATE('surfbar_stopped', false, $content); } -} elseif ((REQUEST_ISSET_GET(('check'))) && (REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('salt')))) { +} elseif ((REQUEST_ISSET_GET('check')) && (REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET('salt'))) { // Dummy next id get SURFBAR_DETERMINE_NEXT_ID(REQUEST_GET('id')); @@ -156,6 +187,9 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array( // Determine template name $templateName = SURFBAR_DETERMINE_TEMPLATE_NAME(); + // Load header in frameset mode is the default + $isFrameset = true; + // Frame "top" set? if ((REQUEST_ISSET_GET('frame')) && (REQUEST_GET('frame') == 'top')) { // Determine next id @@ -168,7 +202,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array( 'id' => $nextId, 'check' => SURFBAR_GENERATE_VALIDATION_CODE($nextId), 'salt' => SURFBAR_GET_SALT(), - 'reward' => translateComma(SURFBAR_GET_REWARD($nextId)), + 'points' => translateComma(SURFBAR_GET_REWARD($nextId)), 'url' => SURFBAR_GET_URL($nextId), 'curr_reload' => SURFBAR_GET_USER_LOCKS(), 'max_urls' => SURFBAR_GET_TOTAL_URLS(), @@ -185,9 +219,6 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array( } elseif ((REQUEST_ISSET_GET('frame')) && (REQUEST_GET('frame') == 'start')) { // Starter frame found so let the footer display REQUEST_UNSET_GET('frame'); - } else { - // Load header in frameset mode - $isFrameset = true; } // Load header @@ -199,6 +230,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array( } // Load footer +$GLOBALS['footer_sent'] = 3; loadIncludeOnce('inc/footer.php'); // [EOF]