close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Security Assist - Creating advanced access rules

Thread began 1/23/2013 1:46 pm by Brendan | Last modified 1/24/2013 9:19 am by Jason Byrnes | 1209 views | 1 replies |

Brendan

Security Assist - Creating advanced access rules

I am trying to create a "Trial Membership" for my client where we would like to allow a user to register, and then be granted access for 14 days. After 14 days I would like their access to be denied automatically.

I was thinking that I could add a registrationdate field to my user database, but not sure how to create an access rule that would make the comparison with the current date and registration date and validate that value with the trial membership length.

Sign in to reply to this post

Jason ByrnesWebAssist

You will need a registrationDate column in the users table

set the default value for the registration date to:
CURRENT_TIMESTAMP

when a new users is registered, it will automatically store the registration date in the format:
YYY-mm-dd

on the login page, edit the Security Assist authenticate user behavior, on the sessions tab, make note of the user ID sesson name that already exists, and click the plus button to add the registration date column to be stored as a session

in the security assist rule will use the date() and mktime() php functions to convert the current date to a time stamp, and convert the registration date to a timestamp with 14 days added

set the rule up as:

Restrict IF
Value: Click the lightning bolt icon and select the user ID Session
Criteria: =
Compare to: Leave this blank

Allow IF
Value: enter the following code:

php:
<?php echo (mktime(000date("m"strtotime($_SESSION['regDate'])), date("d"strtotime($_SESSION['regDate'])) + 14date("Y"strtotime($_SESSION['regDate'])))); ?>



this assumes the session for the registration date is "regDate".
Criteria: =>
Compare to: enter the following code:

php:
<?php echo (mktime(000date("m"), date("d"), date("Y"))); ?>
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...