X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=surfbar.php;h=ec7ce0e6f1242262fe5c278d9d7ba5d1b1b33d05;hp=4318b54590197f28601e3495f540b27c9057aa3c;hb=50b91687d7e7201f6c596a9ad40e8ff35c995074;hpb=b8aa17b98b99c27eafbdca0fa090bae63527da9a diff --git a/surfbar.php b/surfbar.php index 4318b54590..ec7ce0e6f1 100644 --- a/surfbar.php +++ b/surfbar.php @@ -68,9 +68,32 @@ 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 @@ -164,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 @@ -193,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