Giter Club home page Giter Club logo

silverstripe-age-gate's Introduction

SilverStripe Age Gate

Simple Age Gate module for SilverStripe, ensures that users entering site are 21+.

Requirements

  • SilverStripe 4.0.0+, for 3.x checkout 3.x branch

Installation & Documentation

  1. Clone Repository to your SilverStripe Project or -

     composer require moosylvania/silverstripe-age-gate
    
  2. This will add a route /age-gate to your project and all users will be presented with a yes/no button to validate of age. If you would like the user to type in their date of birth you can set the config option of 'askForAge'

     Moosylvania\AgeGate\Controllers\AgeGateController:
       askForAge: true
    

    To set the format of the dates you can change the config values 'dateFormat' (for the form intro text) and 'dateFieldFormat' for the actual SilverStripe Date Field.

     Moosylvania\AgeGate\Controllers\AgeGateController:
       dateFormat: 'm/d/Y'
       dateFieldFormat: 'MM/dd/yyyy'
    
  3. You can set up where you want a user redirected to if they select 'No' (not of age) by adding the following config value to your site -

     Moosylvania\AgeGate\Controllers\AgeGateController:
       notOfAgeRedirect: 'https://moosylvania.com'
    
  4. You can also setup how old someone needs to be to enter your site (default is 21 by editing the setting)

Moosylvania\AgeGate\Controllers\AgeGateController: yearsOld: 21

  1. Run a dev/build?flush=1 and your site will now be agegated.

silverstripe-age-gate's People

Contributors

obj63mc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.