]> git.mxchange.org Git - mailer.git/blobdiff - surfbar.php
Required database changes for configuration entries in templates added
[mailer.git] / surfbar.php
index 2da2cea3a24d336961e972f62e249739ed61c2d0..ec7ce0e6f1242262fe5c278d9d7ba5d1b1b33d05 100644 (file)
@@ -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