close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Log in expiry dates

Thread began 8/19/2013 7:25 am by Heckie | Last modified 8/20/2013 7:19 am by Heckie | 217 views | 3 replies |

Heckie

Log in expiry dates

I am setting up a 'concierge' system for a holiday location to allow guests to order food, wine etc.

I have set up a table called 'Guests' with GuestID, GuestUserName, GuestPassword, GuestArrival and GuestDepart.

What I would like to do is only allow their log in details to work between their check in (GuestArrival) and check out (GuestDepart) dates.

I have set up the standard login page with Username and Password which works, but I'm not sure about getting the dates to work.

If it is going to be too complex to do a date range, then I would like at the very least to be able to make the log in expire so that they cannot order stuff after they have left.

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to set the login page to store the arrival date and the departure date in session variables


in the access rules, you will want to use time() to return the current time stamp, and strtotime to convert the dates in the sesson variables to a time stamp


the access rule settings will look like:

Allow IF
Value: <?php echo strtotime($_SESSION['arrivalDate']); ?>
Criteria: >=
Compare To: <?php echo time(); ?>

Allow IF
Value: <?php echo strtotime($_SESSION['departureDate']); ?>
Criteria: <=
Compare To: <?php echo time(); ?>

Sign in to reply to this post

Heckie

Thanks Jason.

I followed your instructions, but it is not working properly.

It is still allowing me to use log in details with an expired date, and also when I click 'logout' - I am able to access the site and place orders (although there are no session variables active) and it doesn't return me to the log in page.

Sign in to reply to this post

Heckie

OK - I got it to work, but I had to use 'Restrict IF'.

Sign in to reply to this post

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