BullGuard Antivirus Sale - 60% Off with openElement !
openElement Website Homepage
Forum Home Forum Home >

openElement

> Dynamic OE - Databases, etc
  New Posts New Posts RSS Feed - How can fix to redirect after login to the page?
  FAQ FAQ  Forum Search   Register Register  Login Login

How can fix to redirect after login to the page?

 Post Reply Post Reply
Author
Message
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: Aug 02 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Topic: How can fix to redirect after login to the page?
    Posted: Dec 07 2016 at 2:57pm
Hi! OE team.

My page structure is

    Homepage(summary page) ---> system status page ---> laser status page --->...and so on

The homepage is protected by Packs #50: Protect a page.

Every page is build on BaseLayer which has Packs#20: 'Mini-Login' form.

My question is that:
    1. If I logout from 'laser status page' using Packs#20 and login again, the page goes to 'laser status page'
    2. How can I redirect the page to 'Homepage' after login even user logout from any page beside 'Homepage'???
    3. In other words,
        At 'system status page' ----> logout from Packs#20 ----> login from 'user-login(connect)-v1' page ----> to 'Homepage' after successful login


Thanks in advance,

DJ Joo
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 5271
Post Options Post Options   Thanks (1) Thanks(1)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Dec 07 2016 at 10:59pm
Hi,

By default the login page should redirect to the homepage. Check the corresponding parameter in this Pack's configuration (on the top of the login page).

Why do you have the mini-login form on every page? Is it really necessary?
Back to Top
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: Aug 02 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Posted: Dec 09 2016 at 1:27pm
1. Yes, the configuration of 'Page to open by default after login' of [20 - For 'Login' page (PK1)] is "index.php"
    However, if I logout from not index.php but the other page such as 'status.php' and login again from login page, the page after login is redirected to the page that is not index.php but logout page.

2. Sorry, it is my confusion.
    It is not 'mini-login form', but the packs in the BaseLayer is [61 - 'Show User' element: several format (PK7)]
    The reason why pack[61] is installed in BaseLayer because my Web App is network mornitor and control app for device, so the login user can logout anytime when he/she has done his/her job from any page.

In summary, if user logout from some page not index.php using the logout link of packs[61] and login again from login page, the redirect page is not index.php but logout page just before.

Thank you,

DJ


Edited by djju1029 - Dec 09 2016 at 1:27pm
Back to Top
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: Aug 02 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Posted: Dec 09 2016 at 1:47pm
For example, if user logout from '/Advance/Advance_main.php', then the redirection of login page on the address bar of browser is:

http://192.168.1.56/oe-users/user-login(connect)-v1.php?oeredirect=Advance/Advance_main.php&oelogout=1
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 5271
Post Options Post Options   Thanks (1) Thanks(1)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Dec 10 2016 at 10:53pm
I propose you a workaround.

On the login page, you can add a simple PHP script that checks whether there's the "oeredirect" parameter specified, and no other parameters except eventually "oelogout", and reload the page without "oeredirect".

On the login page, add a Code Block (Source) type PHP position StartDocument:


if (isset($_GET['oeredirect']) && (
    (isset($_GET['oelogout']) && count($_GET) === 2) // exactly these 2 parameters present in URL - in case of using Logout
 || (count($_GET) === 1) // or only oeredirect parameter is present - in case of Login
    )
  )
{
  header('Location: ?oelogout=1');
  exit(); // request redirect without "oeredirect" and stop the page execution
}


Back to Top
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: Aug 02 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Posted: Dec 12 2016 at 4:10pm
Thank you so much. It works!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,031 seconds.