// Which status do we have?
switch ($ret) {
case 'done': // Admin and password are okay, so we log in now
- // Construct URL and redirect
- $url = 'modules.php?module=admin&';
-
- // Rewrite overview module
- if (getWhat() == 'overview') {
- setAction(getActionFromModuleWhat(getModule(), getWhat()));
- } // END - if
-
- // Add data to URL
- if (isWhatSet()) {
- $url .= 'what=' . getWhat();
- } elseif (isActionSet()) {
- $url .= 'action=' . getAction();
- } elseif (isGetRequestElementSet('area')) {
- $url .= 'area=' . getRequestElement('area');
- }
-
// Load URL
- redirectToUrl($url);
+ redirectToUrl('modules.php?' . addAllGetRequestParameters());
break;
case '404': // Administrator login not found
} // END - if
} // END - if
- // Load login form
- if (isWhatSet()) {
- // Restore old what value
- $content = merge_array($content, array('target' => 'what', 'value' => getWhat()));
- } elseif (isActionSet()) {
- if (getAction() != 'logout') {
- // Restore old action value
- $content = merge_array($content, array('target' => 'action', 'value' => getAction()));
- } else {
- // Set default values
- $content = merge_array($content, array('target' => 'action', 'value' => 'login'));
- }
- } elseif (isGetRequestElementSet('area')) {
- // Restore old area value
- $content = merge_array(
- $content,
- array(
- 'target' => 'area',
- 'value' => getRequestElement('area')
- )
- );
- } else {
- // Set default values
- $content = merge_array($content, array('target' => 'action', 'value' => 'login'));
- }
+ // Add all parameter
+ $content['all_parameter'] = addAllGetRequestParameters();
// Load login form template
loadTemplate('admin_login_form', false, $content);
return $_SERVER['REQUEST_URI'];
}
+// Add all GET parameters to a string (without leading sign)
+function addAllGetRequestParameters () {
+ // Init variable
+ $return = '';
+
+ // Now add all parameters
+ foreach (getRequestArray() as $key => $value) {
+ // Add it secured
+ $return .= SQL_ESCAPE($key) . '=' . SQL_ESCAPE($value) . '&';
+ } // END - foreach
+
+ // Remove trailing &
+ $return = substr($return, 0, -5);
+
+ // Return it
+ return $return;
+}
+
// [EOF]
?>