I created a custom plugin to allow Joomla to redirect the user to a specific page based on the user group. In the plugin xml I setup some configuration parameters for each user group. example: Code:

    <config>
      <fields name="params">
         <fieldset name="basic">
            <field name="superuser" type="text"
               default="/super-user-dashboard"
               description="Put in the path you want them to see when logging in"
               label="Super User Dashboard"
            ></field>
         </fieldset>
      </fields>
   </config>

Then in the plugin php file, you'll need something like the following: Code:

public function onUserLogin($user, $options = array()){
   $app = &JFactory::getApplication();
   if(!$app->isSite()):
      return true;//make sure plugin doesn't run for backend
   endif;
      
   jimport('joomla.user.helper');
   $instance = JUser::getInstance();
   if ($id = intval(JUserHelper::getUserId($user['username'])))  {
      $instance->load($id);
   }      

/*
//theres better ways to do this, but it worked for me.  you might want to print_r the groups array and see what you can use
*/      
if($instance->groups["Super Users"]=="8"):
  $app->redirect(  $this->params->get('superuser', 1) );
  return true;
endif;
...

Kategori: Joomla

Search My Site