if you use only the option "redirect" (everywhere for all roles) to redirect the roles to their own front pages
then Drupal redirects you after login to the front page respective to the role only when you have not displayed a node.
When you have displayed any node , drupal will (instead redirect to front_page) stay at this displayed node.

Ex.
http://localhost/node
if you have at the left column possibility to login to Drupal site,
then after login drupal do not redirect you to the defined frontpage
instead you will stay after login at the page http://localhost/node
but you will be succesfully logged in.

Ex.
Front page for anonymous user:
Write some text to the "Body"
Set "Select type" = "themed"
Save configuration
Log out from the drupal
Now:
http://localhost/ will display front page for anonymous
if you have at the left column possibility to login to Drupal site,
then after login, drupal DO redirect you to the defined frontpage

Comments

Dublin Drupaller’s picture

Status: Active » Closed (works as designed)

when you redirect away from the front_page.module you also redirect away from the front_page functionality of displaying different content to authenticated/logged in users/different roles.

If you insert the content to be displayed for anonymous users in the text area for anonymous users on the settings page, it will work as expected.

fuerst’s picture

Title: Module front sometimes does not redirect » Force redirection after login from a node page
Status: Closed (works as designed) » Active

The redirect would be possible if the Front module deletes the destination set by the login process. I use something like this in my own modules if necessary:

/**
 * Implementation of hook_user()
 */
function my_module_user($op, &$edit, &$account, $category = NULL) {
  if ('login' == $op) {
    unset($_REQUEST['destination']);
    unset($_REQUEST['edit']['destination']);
    drupal_goto(variable_get('site_frontpage', 'front_page'));
  }
}

Of course this hook can be implemented by the Front module itself. May be together with a settings checkbox to switch the remove of the destination on and off. The Rules module calls this something like force redirection.

janwalhof’s picture

I use the module Advanced Front Page Settings.
I made a redirect for roles in the module Advanced Page Settings to related views with a related url. But the requested url is only shown after I hit the home-button. Then the right page is shown!

So, I can say, I need a mechanism to run the Home-button automaticly.

Please help. What can I do to make it happen conform my wishes?

Regards,
Jan Walhof

janwalhof’s picture

I think, maybe your solution is also my solution. See my tread #3.
But, I am a newbie and don't know how to implement the hook you mentioned.
You can help?

Thank you in advance,

Regards,
Jan Walhof

Dublin Drupaller’s picture

@Jan.

I'm not entirely sure I understand what you mean...but, as a guess....try EMBEDDING the view in thfe front page, rather than redirecting.

here's the book page for embedding views: http://drupal.org/node/47417

hope that helps
dub

Dublin Drupaller’s picture

Status: Active » Closed (fixed)

actually..here's a better link for embedding views

http://groups.drupal.org/node/10129

open this back up if you're still having problems.

janwalhof’s picture

Dublin,
Thank you for your reply.

The example in #2 could help me. But I don't know how to implement.

I try to explain the current situation again:
I have a Panel with the url "/front_page_anonymous" on my screen.
If I choose for an other user (f.i. with the switch user module), I see (on the bottum of my screen) that the url for loading is the same as already shown on the screen ("/front_page_anonymous"). After loading, everything looks the same, nothing changed. But then, if I hit the "home button", I get the right url (f.i. "/front_page_administrator") wich belongs to the user who logged in on the screen.
The url "/front_page_administrator" should be displayed directly after login, but it doesn't.

Hopefully, I explained the situation better now.

Regards,
Jan Walhof

Dublin Drupaller’s picture

Assigned: Unassigned » Dublin Drupaller
Status: Closed (fixed) » Active

Hi Jan,

I think I understand. Please correct me if I have this wrong, but,

(a) you are redirecting anonymous users, using the front_page.module to /front_page_anonymous

(b) you are also redirecting administrators to /front_page_administrator

(c) you are using the panels module to generate the /front_page_administrator and /front_page_anonymous pages.

So, the problem you're having is that when an anonymous user visits the site and logs in...they see the anonymous page, instead of the administrators page.

Is that correct so far?

When you use the redirect option, you lose the functionality of the front page.module...i.e. when the anonymous user logs in....the front page.module doesn't have any control on what happens because the user is on the /front_page_anonymous page.

If that's the case.....you could try embedding the panels in the front_page.module settings page. Alternatively you could use the login destination module....which allows you to control where people are redirected after they login. The second option (i.e. using the login destination option) is simple, but, it requires another module...

hope that helps.

dub

janwalhof’s picture

Dublin,

Thank you again.

I guess we don't understand each other completely.

You wrote:
So, the problem you're having is that when an anonymous user visits the site and logs in...they see the anonymous page, instead of the administrators page.

This is the case:
So, the problem I have is that when administrators visits the site and logs in...they see the anonymous page, instead of the administrators page. The anonymous page is already on the screen before log in.

The module Front page is redirecting to /front_page/administrator but does not show the content. I don't understand why. When I type the url (/front_page/administrator) or choose Home, everything is ok.
Thus the redirect within fmodule front page is working but the panel content doens not show up. First after choising Home.

Embedding the panels in the front-page module could be a solution. But I don't know how that to manage.

Regards again,,
Jan Walhof

janwalhof’s picture

Dublin,

I read the stuff again and again. Your tread with #1 gave me the solution.
You wrote in #1:
If you insert the content to be displayed for anonymous users in the text area for anonymous users on the settings page, it will work as expected.

And indeed, my other roles (6) got a redirect, all to a different panel and they displayed what I wont. Everything is working!
Maybe later I should invest some time for embedding the text for an anonymous user in a nice panel.

Thank you for helping thinking.

Regards,
Jan Walhof

Dublin Drupaller’s picture

Status: Active » Closed (fixed)