User Restrictions

Apply configured restrictions for users.

User Restrictions module for ProcessWire

This module provides additional restrictions for users. As of this writing it can be used to restrict login attempts to the admin using a predefined set of IPs or geolocations.

Note: geolocation data is fetched from an external API, which may require credentials. This feature has been built with ipgeolocation.io in mind, but should technically work with any other service as well — as long as said service returns data in JSON format.

Configuration settings are defined via $config->UserRestrictions:

$config->UserRestrictions = [
	'login_restriction_enabled' => !$this->config->debug,
	'login_restriction_enabled_for' => [
		// array containing users that are restricted; supported formats:
		// 'my_admin_username' or 'user:my_admin_user' (username)
		// 41 or 'user:41' (user ID)
		// 'role:superuser' (role)
		// 'regex:/.*/' (regex pattern, which is matched against username)
	],
	'valid_ip_addresses' => [
		// list of valid IP addresses; supported formats:
		// '127.0.0.1' (individual IP)
		// '127.0.0.1-127.0.0.255' (IP range)
		// '127.0.0.0/24' (CIDR)
	],
	'valid_geolocations' => [
		// list of valid geolocations; supported formats:
		// 'Finland' or 'country:Finland' (country)
		// 'prefix:value' (any other valid geolocation data key)
	],
	'geolocation_api_url' => 'https://api.ipgeolocation.io/v2/ipgeo?apiKey={api_key}&ip={ip}',
	'geolocation_api_key' => '',
	'display_errors' => false,
	'log_errors' => true,
];

More modules by Teppo

  • Version Control

    Version control features for page content.
  • SearchEngine

    SearchEngine is a ProcessWire CMS/CMF module for indexing and searching site contents.
  • Changelog

    This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site.
  • Version Control For Text Fields

    Simplified version control for text type fields.
  • WireMail: Swift Mailer

    WireMail module providing Swift Mailer integration
  • Login History

    This module keeps track of login attempts to your site.
  • AdminBar

    Provides easy front-end admin bar for editing page content in ProcessWire.
  • Textarea Markup

    Markup, plain text and optionally values from other fields as a non-editable, run-time field visible in Page Edit.
  • Wireframe

    An output framework for ProcessWire.

All modules by Teppo

Install and use modules at your own risk. Always have a site and database backup before installing new modules.