Advertisement
Guest User

Untitled

a guest
Jan 7th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. class CustomAdminHomePage extends WireData implements Module {
  4.  
  5.     public static function getModuleInfo() {
  6.  
  7.         return array(
  8.             'title' => 'Custom Admin Home Page',
  9.             'version' => 100,
  10.             'summary' => 'Direct users to a custom page on login',
  11.             'href' => '',
  12.             'singular' => true,
  13.             'autoload' => true,
  14.             );
  15.     }
  16.  
  17.     public function init() {
  18.         $this->addHookBefore('ProcessHome::execute', $this, 'adminHomePage');
  19.     }
  20.  
  21.     /**
  22.      * Redirect users with custom-role to another page after login
  23.      */
  24.     public function adminHomePage(HookEvent $event) {
  25.         $this->session->redirect('/processwire/dashboard/'); // or whatever page you want
  26.     }
  27.    
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement