Login redirect

Permalink
Hi,
I'm making page that includes some secret pages. (concrete 5.7.)
I have login block where is only password field and user name is hidden field value="member".
That works fine.

There is only on thing if I send link to someone "http://mypage.com/secretpage" if goes to login page.
Is it possible to force it go on that page and show message "Please login first"?
Or any other good ways to do it?

OlliSavolainen
View Replies:
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi OlliSavolainen,

I am not sure if I understand the question. You want to change the login page message from "Sign In." to "Please login first"?
OlliSavolainen replied on at Permalink Reply
OlliSavolainen
Hi,
and sorry my bad english.
I mean like this: (Joomla site)
http://www.pamaus.fi/seura/web/index.php/jasenyys/arona...
It says: "You don't have permissions"
And as you can see there is place for password in top right.

Is this possible in concrete5 5.7. ?
MrKDilkington replied on at Permalink Reply
MrKDilkington
@OlliSavolainen

It is most likely possible, but I believe would require custom programming to do it.

You would have to change the redirect behavior for pages that a user does not have permission to view. Instead of redirecting immediately to the login page, you want to set a "Please login first" message. I am not sure if that could be done with a custom page type controller or by overriding core files.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@OlliSavolainen

This looks like the controller that redirects pages to login if the viewer is not registered.
controllers\single_page\page_forbidden.php

Perhaps you could change this to redirect to a regular page/single page with the message (excluded from the navigation).
OlliSavolainen replied on at Permalink Reply
OlliSavolainen
Thanks for your help.
In this case I don't have enough time to do that. I was hoping some module for that.

Thanks anyway!
mnakalay replied on at Permalink Reply
mnakalay
Actually, you probably can do all that just ery simply from the dashboard. You just need to set custom permissions on the pages you want to protect and anybody without the proper permission will be automatically redirected to the login page (or be shown a message to go there, I can't remember right now).