Agree to License with checkbox before first login.

3 posts by 3 authors in: Forums > CMS Builder
Last Post: October 12, 2012   (RSS)

By Mikey - October 12, 2012

I'd like to have a check box that requires the user to check the box that confirms that they have been made aware of the "License Agreement", were provided a clear opportunity to read it before they log in, and the check box is required at least on the first log in for the user. And if they do not agree to the license agreement, they do not get access to CMS Builder.

The red portion would be a link to the "License Agreement" page (admin.php?menu=license)

username [ ]
password [ ]
[checkbox] I agree with the terms of the License Agreement



Anyone have any suggestions, is there a plugin or can someone provide guidance on building this - before I go poking around in the admin.php file and make a wreck of it? I think it would also need to be a field that is stored within the "accounts" record, but without the ability to edit the check box.

Thanks Zick.

Re: [zick] Agree to License with checkbox before first login.

Hi Zick,

If you decide to tackle this yourself, here’s the outline of one approach using if statements that should get you going.

Create a check box called “license agreement” in user accounts.

Create a single record section called “terms”

On your login form page, create a link to the terms detail page with the text “read our terms” or similar.

In your login form, create a check box field for the license agreement with the statement that agreement is required.

Add if statements around the license agreement field so that the field only shows if a check of the value in the user account field returns either empty or zero, and if that is the case, a check in the check box field is required before successful form submission.

Use the same “if” statement approach to show or hide the link to the “terms” page.

Don’t forget the code that inserts a value of 1 if the “license agreement” check box if checked in the form.

There are a few recipes in my CMSB Cookbook www.thecmsbcookbook.com that deal with forms and check boxes, and that include code examples for retrieving values from tables and for error checking.

Good luck,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php