Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class CustomAdminHomePage extends WireData implements Module {
- public static function getModuleInfo() {
- return array(
- 'title' => 'Custom Admin Home Page',
- 'version' => 100,
- 'summary' => 'Direct users to a custom page on login',
- 'href' => '',
- 'singular' => true,
- 'autoload' => true,
- );
- }
- public function init() {
- $this->addHookBefore('ProcessHome::execute', $this, 'adminHomePage');
- }
- /**
- * Redirect users with custom-role to another page after login
- */
- public function adminHomePage(HookEvent $event) {
- $this->session->redirect('/processwire/dashboard/'); // or whatever page you want
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement