Author Topic: After login to a specific page?  (Read 769 times)

Offline johnbroeckaert

  • Posts: 186
  • Gender: Male
After login to a specific page?
« on: January 05, 2018, 08:54:59 PM »
Hi,

On a site I want the visitor to be referred to another page after login. Is that possible?
wb2.10
php7.1.x

THANX
It is a happy talent to know how to play!

Offline crnogorac081

  • Posts: 1899
  • Gender: Male
Re: After login to a specific page?
« Reply #1 on: January 05, 2018, 09:56:41 PM »
there is a redrect in core files, but I didnt see the option in backend.. You would need to change the core.
no bb in signature

Offline johnbroeckaert

  • Posts: 186
  • Gender: Male
Re: After login to a specific page?
« Reply #2 on: January 05, 2018, 10:17:19 PM »
@crnogorac081

Quote
there is a redrect in core files
I don't know what you mean by that. It is in the frontend that i want to send a user who logged in to an other page.
cheers
It is a happy talent to know how to play!

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: After login to a specific page?
« Reply #3 on: January 05, 2018, 11:00:49 PM »
Normally the login page is shown when a user wants to access a page that has access set to registered.
Linking to that page will first show the login page and after a succesfull login it will redirect to the original linked page.

If you use a loginbox in a normal page you can add a hidden field (in the login form) that holds the url to be used after succesfull login.

The standard droplet to generate a loginform has this built in already.
Use:
Code: [Select]
[[LoginBox?redirect=url]]
So just put this droplet - with the redirect parameter - somewhere in your template or in a normal wysiwyg page.

Offline johnbroeckaert

  • Posts: 186
  • Gender: Male
Re: After login to a specific page?
« Reply #4 on: January 06, 2018, 12:38:18 PM »
Maybe I should explain the problem.
There are a number of user groups. Each user group must go to another OWN user group page after login.

As far as I can see I can't use the loginbox droplet because there is only room for a 'static' page there.

I'm now trying the template madoven, because there is already a login in the template, to get so far that it switches to another page after login.
Unfortunately I am not such a coder hence my question here. :|

john
It is a happy talent to know how to play!

Offline crnogorac081

  • Posts: 1899
  • Gender: Male
Re: After login to a specific page?
« Reply #5 on: January 06, 2018, 12:51:15 PM »
you must customize login droplet..

you must give us more info which group to go where..
no bb in signature

Offline johnbroeckaert

  • Posts: 186
  • Gender: Male
Re: After login to a specific page?
« Reply #6 on: January 06, 2018, 01:05:00 PM »
Hi @crnogorac081,

There is a seperate page for every group. Group A has to go to page A. Group B has to go to page B. etc.
For each new group, there will be a new page with the name of that group.

Is this clear enough.

The login is only for members of a group. Other users stay on the public pages.
It is a happy talent to know how to play!

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: After login to a specific page?
« Reply #7 on: January 06, 2018, 01:47:12 PM »
You cannot do that by using the redirect parameter. Before logged-in you don't know what group the user will be in.

I like the idea, so I made a small droplet to handle this for you.
It is published here: https://dev4me.com/droplets/other/go-to-grouppage-after-login/

Just set one or more of these lines in the top of the droplet:

$urllist[group_id] = WB_URL.'/pages/page-for-that group.php';

..or when using shorturl

$urllist[group_id] = WB_URL.'/page-for-that group/';


Offline johnbroeckaert

  • Posts: 186
  • Gender: Male
Re: After login to a specific page?
« Reply #8 on: January 06, 2018, 01:56:27 PM »
@ruud

 (Y) (Y) (Y) (Y) (Y) (Y) (Y) (Y) (Y)
Nice work.... T H A N K S
It is a happy talent to know how to play!

Offline crnogorac081

  • Posts: 1899
  • Gender: Male
Re: After login to a specific page?
« Reply #9 on: January 06, 2018, 02:11:47 PM »
 (Y)
no bb in signature