Hi folks,
I just discovered a little bug. If a return adress is given for after the login, the jsn_users plugin overwrites that always with the login given in the configuration. You also do a little bit much checking. It would be enough to do the following in the onUserLogin event at the end:
// Redirect on First Login
if($this->config->get('firstLoginUrl') && $instance->lastvisitDate=='0000-00-00 00:00:00')
{
JFactory::getApplication()->setUserState('users.login.form.return', 'index.php?Itemid='.$this->config->get('firstLoginUrl') );
}
// Redirect on Login
if($this->config->get('loginUrl') && !(JFactory::getApplication()->getUserState('users.login.form.return')))
{
JFactory::getApplication()->setUserState('users.login.form.return', JRoute::_('index.php?Itemid='.$this->config->get('loginUrl')) );
}