• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: ​ Going back to FEU protected form after login process UDT
PostPosted: Fri Jun 16, 2017 11:11 am 
Offline
Forum Members
Forum Members

Joined: Thu Dec 13, 2012 2:54 pm
Posts: 182
​A quick description of the situation:
A page contains FEU protected contact form. To access such form, already registrated user must log in to site. Clicking on 'Log in' link opens up a new page with log-in form. That's one step away from desired contact form.
After entering proper username and password and clicking on 'Submit' button, a new page opens up containing two links by default: 'Change user settings' and 'Sign out'. That's second step away from desired contact form.

The Problem:
I needed another link called 'Back to form' and solution for taking an user two pages back while reloading the page where 'Log in' link was initially clicked.

The Solution:
With help of my friend who diggs php, we did the following...
1) create first UDT called "remember_form" with following code:
Code:
session_start();
$page = $_SERVER["REQUEST_URI"];
$_SESSION['page'] = $page;

2) put first UDT in every template for page(s) containing FEU protected form(s) right after {/strip} at the top of the template;
3) create second UDT called "back_to_form" with the following code:
Code:
session_start();
echo "http://".$_SERVER['SERVER_NAME'].$_SESSION['page'];

4) open template 'FEU logout form' (or whatever your template is called but containing the same code as in original FEU template) and put this link where you think it would be most visible or useful:
Code:
<a href="{back_to_form}">Back to form</a>

And that's it! After logging in to the site, "Back to form" link will take one back to the page where desired form is but this time the form itself will be unlocked and visible.

Now, I'm not security wizard so I don't know if this solution is 100% safe. If anyone suspects this two UDT's could cause some security issues, please, you're more than welcome to leave a post about it in reply!

Hope this was helpful and best regards to all!
Jakovbak


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
A2 Hosting