close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

trouble with a login page not inserting rows to a table on successful login

Thread began 10/01/2013 6:07 am by CraigR | Last modified 10/03/2013 11:29 am by CraigR | 3598 views | 12 replies |

CraigRBeta Tester

trouble with a login page not inserting rows to a table on successful login

I am having trouble with a login page.
I have a site with 3 levels of security, (4 if you include superadmin)
Group admin, admin and member
I have created access rules and setup page access using the access pages manager, all working ok

The problem I am having is with the login page, not behaving as I expect.

My login page is based on the one created by PowerCMS builder, with the added user level, and also contains code to insert the memberid to the login table, whenever a member logs in successfully.

Regardless of who logs in, I want to redirect successful logins to the site home page, or to the previous url if they came via a link

I thought I had it working, but it seems the insert into the login table isn’t happening.

Attached Files
users_login.php
Sign in to reply to this post

Jason ByrnesWebAssist

I dont follow the logic. What is the purpose behind inserting a record on login?

Sign in to reply to this post

CraigRBeta Tester

the client wants a popup message to appear on the home page whenever a member logs in, so that any news or other info pertinent to them - which has been added since they last logged in - is displayed in the pop-up window.

It also allows them to record which members are using the site regularly.

I can do this by recording the logins and logouts of every member

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

CraigRBeta Tester

PM

Sign in to reply to this post

Jason ByrnesWebAssist

I updated the webassist/securoty_assist/helper_php.php file to correct the problem.

Sign in to reply to this post

CraigRBeta Tester

thanks Jason, much appreciated.

Will check it out

Sign in to reply to this post

CraigRBeta Tester

Hi Jason,

the login table is now updated successfully, after you updated the helper_php.php file, and everything works as it should, except that I want to redirect successful logins to the site home page, or to the previous url if they came via a link

All successful logins are ALWAYS directed to the home page, they do not go to the previous url.

If I change the parameter in the post login server behavior to TRUE, the login is then redirected Ok, but the login table is no longer appended.

I think this is because the WA_AuthenticateUser() function takes the true parameter and redirects, before the insert record server behavior is triggered.

I have tried moving the insert record behavior to within the post login server behavior, but If I do this before the WA_AuthenticateUser() function is fired, the member id session value has not been retrieved.

I don't want to edit the helper_php.php page if possible, can you advise how I can overcome this issue ?

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

I had to disable the redirect to previous URL to allow the insert to occur.

try adding the following code after the inert behavior:

php:
<?php

if (isset($_GET['accesscheck'])) {
    
header("Location: ".urldecode($_GET['accesscheck']));
}
?>
Sign in to reply to this post

CraigRBeta Tester

unfortunately, that doesn't work either.- is it because the WA_AuthenticateUser() function is doing the redirecting ?

Just a thought, if I create a new function, and base it on the WA_AuthenticateUser() function, but simplify it so I only create the session values, (I only need $_session ['memberid']), and remove the redirect, and trigger this function AND the insert record server behavior BEFORE the WA_AuthenticateUser() fuction is run, I guess it should work ?

Seems a bit clumsy, and I would be setting the session values again when I run WA_AuthenticateUser()

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...