PHPackages                             revstrat/silverstripe-agegate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. revstrat/silverstripe-agegate

ActiveSilverstripe-vendormodule[Authentication &amp; Authorization](/categories/authentication)

revstrat/silverstripe-agegate
=============================

Adds age-gate for verifying visitor's eligibility to view restricted content

v1.2.10(7y ago)01732BSD-3-ClausePHP

Since Oct 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/RevStrat/silverstripe-agegate)[ Packagist](https://packagist.org/packages/revstrat/silverstripe-agegate)[ Docs](https://github.com/RevStrat/silverstripe-agegate)[ RSS](/packages/revstrat-silverstripe-agegate/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (3)Versions (13)Used By (0)

SilverStripe AgeGate
====================

[](#silverstripe-agegate)

This module provides an age-gate function, with support for the IPStack API or GeoLite2 database. Please provide your own GeoLite2 database in the `data` folder.

Important Notice
================

[](#important-notice)

This plugin is no longer maintained. If you wish to take over maintenance, please reach out and I'll be happy to transfer.

### Installation

[](#installation)

composer require revstrat/silverstripe-agegate

### Usage

[](#usage)

Place `` just inside your opening `` tag.

Normal template inheritance allows for customization of the age gate appearance.

Configure the desired GeoIP service by setting the following in your app's yml file:

```
RevStrat\AgeGate\PageControllerExtension:
  geoip_source: "RevStrat\\AgeGate\\IPStack"

```

Where `RevStrat\\AgeGate\\IPStack` is the namespaced class that will handle GeoIP lookups. To create your own, simply implement the `GeoIPServiceInterface` interface and update `geoip_source` to your fully namespaced class.

The IPStack interface makes use of two environment variables:

- IPSTACK\_ENDPOINT="[http://api.ipstack.com/%s?access\_key=%s](http://api.ipstack.com/%s?access_key=%s)"
- IPSTACK\_ACCESS\_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

The IPSTACK\_ENDPOINT key points to the endpoint URL and is parsed with sprintf. Update this to a compatible service (such as Nekudo) or change the protocol (paid accounts on IPStack can use https for lookups). The IPSTACK\_ACCESS\_KEY should be set to your access key.

Once everything is configured, be sure to run `/dev/build?flush=all`.

Configure age restriction by country under Settings &gt; Age Gate Control.

Overiding the form
------------------

[](#overiding-the-form)

Implement these methods on your PageController. These methods are an example of how one might use two buttons on the age gate.

```
public function updateGetShowAgeGate(&$ageGateActive, &$sufficientAge) {

    }

    public function updateAgeGateForm(&$fields, &$actions, $minimumAge) {
    	$fields->removeByName('OfAge');
    	$actions = new FieldList(
    		FormAction::create('passAgeGate')->setTitle("Yes I'm over $minimumAge"),
    		FormAction::create('failAgeGate')->setTitle("I'm not $minimumAge yet")
    	);
    }

    public function passAgeGate($data, Form $form) {
    	$data['OfAge'] = true;
    	return $this->doAgeGate($data, $form);
    }

    public function failAgeGate($data, Form $form) {
    	$data["OfAge"] = false;
    	return $this->doAgeGate($data, $form);
    }

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Recently: every ~16 days

Total

11

Last Release

2676d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05f97cca36b1b1fccd815e460825076d57bd646ea0aabbe5acd4db14c16e94c5?d=identicon)[robrev](/maintainers/robrev)

---

Top Contributors

[![robrev](https://avatars.githubusercontent.com/u/25928818?v=4)](https://github.com/robrev "robrev (12 commits)")[![denisbabs](https://avatars.githubusercontent.com/u/598559?v=4)](https://github.com/denisbabs "denisbabs (1 commits)")

---

Tags

age-gategeocodinggeolite2ipstacksilverstripesilverstripegateageagegate

### Embed Badge

![Health badge](/badges/revstrat-silverstripe-agegate/health.svg)

```
[![Health](https://phpackages.com/badges/revstrat-silverstripe-agegate/health.svg)](https://phpackages.com/packages/revstrat-silverstripe-agegate)
```

###  Alternatives

[silverstripe/contentreview

Flags pages for periodical author review (incl. reporting)

22264.3k4](/packages/silverstripe-contentreview)[silverstripe/mfa

Enable multi-factor authentication with fallback codes

10346.1k8](/packages/silverstripe-mfa)[bigfork/silverstripe-oauth-login

SilverStripe logins via OAuth2, using the PHP League's OAuth2 client

1794.7k2](/packages/bigfork-silverstripe-oauth-login)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
