Skip to content

Instantly share code, notes, and snippets.

@jasonmunro
Created July 14, 2020 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonmunro/2094ff2a668553d8b1de66a1be2c57ec to your computer and use it in GitHub Desktop.
Save jasonmunro/2094ff2a668553d8b1de66a1be2c57ec to your computer and use it in GitHub Desktop.
Use the default page after login setting when no page is specified in the url
diff --git a/modules/core/handler_modules.php b/modules/core/handler_modules.php
index 2c8b2357..5a5d3de3 100644
--- a/modules/core/handler_modules.php
+++ b/modules/core/handler_modules.php
@@ -647,6 +647,12 @@ class Hm_Handler_load_user_data extends Hm_Handler_Module {
}
$this->out('mailto_handler', $this->user_config->get('mailto_handler_setting', false));
$this->out('no_password_save', $this->user_config->get('no_password_save_setting', false));
+ if (!strstr($this->request->server['REQUEST_URI'], 'page=') && $this->page == 'home') {
+ $start_page = $this->user_config->get('start_page_setting', false);
+ if ($start_page && $start_page != 'none' && in_array($start_page, start_page_opts(), true)) {
+ Hm_Dispatch::page_redirect('?'.$start_page);
+ }
+ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment