By gökhan on Saturday, 15 February 2014
Posted in General Issues
Replies 9
Likes 0
Views 1K
Votes 0
for beta 1.2.0, i changed these code below, Redirect if user already logged in from home page to dasboard

mod_easysocial_login.php

$my 		= Foundry::user();

// If user is already logged in, there's no point to show the login form.
if( !$params->get( 'show_logout_button' , true ) && $my->id )
{
return;
}


to

$my 		= Foundry::user();

// If user is already logged in, there's no point to show the login form.
if( $my->id > 0 )
{
return $this->redirect( FRoute::dashboard( array() , false ) );
}


But it doesnt work with 1.2.1, i am not sure why?
Hello,

If that is the code added to the module, it's wrong. It should be JFactory::getApplication()->redirect( $url );
·
Sunday, 16 February 2014 23:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Gokhan,

What is the home page menu where this module is loaded? If it is pointing to the dashboard, then you are in a viscous loop!
·
Saturday, 15 February 2014 23:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Ahaaaaa, i found something; I changed home page menu item from featured article to easy social login page layout... And now module redirects, so it works.

But the problem is that i cant use login layout page. I mean I have to use "featured article menu item for home page"

I have to find a way to module redirects user with featured article layout
·
Sunday, 16 February 2014 00:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, I really have no idea about your customization.
·
Sunday, 16 February 2014 00:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok, Can you see facebook home page after logged in facebook? No... My home page structure is working like facebook. So i placed Easysocial login module on my home page. But because of joomla, users can turn sometimes "home page" inadvertently. So i found that solution above, but it doesnt work without "easysocial login layout". I mean when i set "easysocial login layout" as home page" my codes works. Bu when i change home page layout from "easysocial login page" to "Featured article page layout " that codes doesnt work and login module doesnt redirects users already logged in to dasboard when they turn to home page

Ok,


1- Please connect on my web site, after that you can see a link on footer "Ana sayfa" that link goes to home page.
Currently login module will not redirec you to dasboard.

2-After that, please go to admin area find "e...sosyal" menu and find "Giriş Yap" menu item. Change is to "easysocial login page" item

3- Please to do 1. step again, and you will see login module will redirect you to dashboard


so this code will work

$my 		= Foundry::user();

// If user is already logged in, there's no point to show the login form.
if( $my->id > 0 )
{
return $this->redirect( FRoute::dashboard( array() , false ) );
}
·
Sunday, 16 February 2014 02:16
·
0 Likes
·
0 Votes
·
0 Comments
·
If your goal is to disallow users from accessing the home page when they are logged in you should never place that code in the module. Rather, create a system plugin to detect if the user is logged in.

If they are logged in, redirect them to the default page instead
·
Sunday, 16 February 2014 20:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey mark, you didnt understand me. I dont need a system pulugin, also i cant create one. My code only works with "login module +Easysocial login layout". I just need to find why it doesnt work without login layout?

Did you try these steps?

1- Please connect on my web site, after that you can see a link on footer "Ana sayfa" that link goes to home page.
Currently login module will not redirec you to dasboard.

2-After that, please go to admin area find "e...sosyal" menu and find "Giriş Yap" menu item. Change is to "easysocial login page" item

3- Please to do 1. step again, and you will see login module will redirect you to dashboard
·
Sunday, 16 February 2014 22:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Yeah that is all, thanks Mark. I always say you r awasome!
·
Sunday, 16 February 2014 23:39
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Sunday, 16 February 2014 23:50
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post