- // 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');
+ }