How to Persist Login Context Through IFRAME?

If you aren't speaking german, you can ask for support or post your request here.
Antworten
Dushkin
Beiträge: 16
Registriert: 26. Mär 2018, 13:46

How to Persist Login Context Through IFRAME?

Beitrag von Dushkin »

Hi.
I have Admidio set up very nicely on our website. We are viewing the pages through an iframe.
Currently, to get to the Admidio pages, we are showing the below URL so people can log in:

https://www.admidio.org/demo_en/adm_pro ... /login.php

However, should somebody log in and click that link again, they will return to the login
page even though they have authenticated on the Admidio server.

What I would like to happen is for the user to login once. Then, when they click on
the link again, it takes them to the Announcements page.

This requires a URL to the Admidio server that shows the login page when the user is not
authenticated and then the Announcements page when the user is authenticated.

Can somebody please advise? What URL should I be passing as the SRC to my iframe?

Thank you.
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: How to Persist Login Context Through IFRAME?

Beitrag von Schwartz »

Hello Dushkin

You can see how I have chosen to do it here : http://www.energifremtiden.dk/c4d/member-system.html
It is a testsite.

When logged in, the user can edit data here : http://www.energifremtiden.dk/c4d/menschen-1.html

The meaning with this system is, that when logged in, users can download all material ( within a quota ).
If not logged in, then only free material can be downlaoded.

Kind regards
Schwartz
Dushkin
Beiträge: 16
Registriert: 26. Mär 2018, 13:46

Re: How to Persist Login Context Through IFRAME?

Beitrag von Dushkin »

Thanks a lot Schwartz. I appreciate the reply.

I was sort of hoping for a flow that always showed a login screen if the user wasn't authenticated, otherwise the Announcements page if s/he was. Not sure how to do that, though, as my web site doesn't know the Adminio server's authentication context. Having said that, your solution is infinitely better than what I have now and I have put it in place, thank you.

Best regards,
Peter
Benutzeravatar
fasse
Administrator
Beiträge: 6041
Registriert: 12. Nov 2005, 16:06

Re: How to Persist Login Context Through IFRAME?

Beitrag von fasse »

Hi Peter,

within Admidio you can set in the global preferences the Homepage (Guests) and give it the value adm_program/system/login.php and you can also set the Homepage (Logged in user) and give it the value adm_program/modules/announcements/announcements.php

Maybe this will be the solution for your problem or did I overlooked something?

Best regards
Fasse
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: How to Persist Login Context Through IFRAME?

Beitrag von Schwartz »

Hello Peter

I read you post again - I now think I have the solution for exactly what you are asking for. You have to do two things :

- In the module settings for the announcements module, you set the module access to : Logged in users only.

- In the iframe you let the value be the value that Fasse gives for the announcements :

urlforyoursite+_program/modules/announcements/announcements.php
This way the following will happen :

If a user visits the link/iframe and is not logged in, then the user will only see the login.
If a user that IS logged in visits the link/iframe, then this user will see the announcement module.

Hope this was helpful
Dateianhänge
module.jpg
module.jpg (4.89 KiB) 8020 mal betrachtet
Dushkin
Beiträge: 16
Registriert: 26. Mär 2018, 13:46

Re: How to Persist Login Context Through IFRAME?

Beitrag von Dushkin »

Hi Schwartz, Fasse,

Thank you! The bit I was missing is the blogger URL pointing to the announcements.php page.
For some reason I thought i needed to point to index and unfortunately missed that in the earlier thread.

Thank you very much!
Antworten