close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Security Assist Page Redirect For Logged In Users

Thread began 5/07/2012 6:32 pm by Mysite07430650 | Last modified 6/07/2013 6:51 am by Jason Byrnes | 6150 views | 11 replies |

Mysite07430650

Security Assist Page Redirect For Logged In Users

Hello All,

I have finished creating the relevant pages for user to register, login, logout and update their information. Although the forms are functional it can be pretty cumbersome for users to be on for example Page A click on the Log In link on Page A and be redirected to the Login page after successfully logging in; only to click the go to previous page on the browser to return back to Page A.

Is it possible instead for Users clicking on the Log In Link on Page A, be redirected back to the same Page A after they have successfully logged in.

Can this be applied to all the pages created within Security Assist, so that when a User is logged out, the Log Out page shows briefly only to redirect the user back to the original page where the Log Out link was clicked.


Thank you in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

for the login link use the following code:

php:
<a href="/login.php?accesscheck=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>">Login</a>





for the logout link, use:

php:
<a href="/logout.php?accesscheck=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>">Login</a>




on the login page, make sure the action of the form uses the following code:

php:
 action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""?>"




on the logout page, add an access restriction to restrict access to only allow logged in users, make sure the access restriction code is after the clear session code on the logout page.

that should do the trick.

Sign in to reply to this post

Mysite07430650

Originally Said By: Jason Byrnes
  for the login link use the following code:

php:
<a href="/login.php?accesscheck=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>">Login</a>




for the logout link, use:
php:
<a href="/logout.php?accesscheck=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>">Login</a>



on the login page, make sure the action of the form uses the following code:
php:
 action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""?>"



on the logout page, add an access restriction to restrict access to only allow logged in users, make sure the access restriction code is after the clear session code on the logout page.

that should do the trick.  



Hello Jason,

I have inserted the code as instructed and ensured the restrictions applied to the Log Out Page came after the Session Code. The problem arises when you are not logged on but click on the Logout link and expected to be redirected to a page selected in Manage Page Access, instead I get an error out captured in the image attached.

What do I do?

Thanks for your help.

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the logout page please

Sign in to reply to this post

Mysite07430650

Originally Said By: Jason Byrnes
  send a copy of the logout page please  



Here is a copy of the Logout Page.

Attached Files
logout.txt
Sign in to reply to this post

Mysite07430650

Database Connection Failure on Live Testing

I wanted to test live the pages created with Security Assist on the live server and I did as follows:

[1] I Exported the database including table for Security Assist to Remote Server.
[2] I imported the database into Remote Server using PHPMyAdmin and was able to confirm the database, username and password are indeed present in remote server.
[3] I uploaded the Secuirty Assist created pages and other relevant pages in protected.
[4] Previewed the Login Page and got the following error message detailed in the screen capture image attached.

Please help!

Thank you.

Sign in to reply to this post

Mysite07430650

Originally Said By: Mysite07430650
  Here is a copy of the Logout Page.  



Hello Jason,

I know you must be very busy with dealing with so many enquiry. I just wanted to remind you that I have sent the logout page as requested. I would also appreciate guidance on how to go about fulfilling the database requirement for Security Assist in order to go live. I seem to be experiencing problems with that.

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

h150477

I solved it in the userupdate form by moving the code that shows when successfully updated from the top of the page to the bottom. Its logical to put this code at the bottom instead of the top as it stops the form from jumping up and down.
<?php if(WA_Auth_RulePasses("Successful update")){ // Begin Show Region ?>
<p>Information updated successfully</p>
<p> Please <span class="menbut"><a href="login.php">log in</a></span> to continue</p>
<?php } // End Show Region ?>
That done insert the following code after it within the same show region.

<p> Please <span class="menbut"><a href="login.php">log in</a></span> to continue</p>
<?php } // End Show Region ?>

All this does is create a button round the log in text which only shows after a successful result.
When clicked it then redirects to the login page in case the user has changed the password.
You can use this in most of the forms to redirect to any page on your site just by changing the href..

Sign in to reply to this post

Mysite07430650

Originally Said By: h150477
  I solved it in the userupdate form by moving the code that shows when successfully updated from the top of the page to the bottom. Its logical to put this code at the bottom instead of the top as it stops the form from jumping up and down.
<?php if(WA_Auth_RulePasses("Successful update")){ // Begin Show Region ?>
<p>Information updated successfully</p>
<p> Please <span class="menbut"><a href="login.php">log in</a></span> to continue</p>
<?php } // End Show Region ?>
That done insert the following code after it within the same show region.

<p> Please <span class="menbut"><a href="login.php">log in</a></span> to continue</p>
<?php } // End Show Region ?>

All this does is create a button round the log in text which only shows after a successful result.
When clicked it then redirects to the login page in case the user has changed the password.
You can use this in most of the forms to redirect to any page on your site just by changing the href..  



Hello h150477,

Is this solution to a problem you had experienced or do you consider it a general workaorund for the userupdate php file? Did you experience same problem that I am having with Security Assist pages?

I am still waiting for support to contact me?

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...