This module lets you protect pages with ranked roles, manage members, and declare protected pages (gates). Members log in, receive a role (with a role_rank), and can access pages whose min_rank requirement they meet or exceed.
role_rank
. There is no limit to the creation of roles.page_key
and its min_rank
, copy the protection snippet.min_rank
.viewer
=rank 1, editor
=5, admin
=9).page_key
and min_rank
. Copy the snippet into the target PHP page.member_max_rank ≥ page.min_rank
.
Roles define permissions through a numeric role_rank
.
Higher rank = more access. You generally need only a few (e.g. 1, 5, 9).
Manage the member list (email, display name, active flag). You can toggle active, reset passwords, and assign a role from a dropdown. The UI includes secure password generation and a “copy credentials” helper.
Login: email
+ Password: *****
to the clipboard.
Each protected page is identified by a unique page_key
with a required min_rank
.
The gate function enforces access control.
page_key
.
Just copy it and paste it at the very top of the target PHP page to protect it.
page_key
and required min_rank
.Snippet inserted in the protected page:
<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/gates/gates.php';
gate('your_page_key'); // min_rank is enforced from DB (apm_pages)
?>
<!-- your page content -->
gate()
checks the member session, looks up the page’s min_rank
,
computes the member’s maximum role_rank
from their roles, and denies access (HTTP 403) if insufficient.
Members sign in with their email/password. reCAPTCHA v2 is supported and auto-discovered from
a recaptcha_keys.json
file placed in any direct subfolder of the same root as login.php
(folder name can vary: administration
, admin
, xxxxxx
, …).
enabled
is true, the login form renders the reCAPTCHA widget.apm_refresh_rank_cache()
(or log out/in).Important: Before using blocks, add-ons or software, please make a full backup of your project folder.
While this tool has been tested to operate safely, it performs mass modifications to your files and folders. The author cannot be held responsible for any loss, corruption, or damage caused by its use.
Use at your own risk — always work on a copy when in doubt.
* Use of the Website/Services is at your own risk. The Website/Services are provided on an "AS IS" and "AS AVAILABLE" basis without any representation or endorsement made and without warranty of any kind whether express or implied, including but not limited to the implied warranties of satisfactory quality, fitness for a particular purpose, non-infringement, compatibility, security and accuracy. To the extent permitted by law, Zen2cool will not be liable for any indirect or consequential loss or damage whatsoever (including without limitation loss of business, opportunity, data, profits) arising out of or in connection with the use of the Website/Services. We strictly try not to break any copyright law, and in case any data gets included unknowingly in our design/product, we are always willing to remove/rectify the same since we respect the copyright law.
* Mobirise and the Mobirise Logo are trademarks of Mobirise.com and are acknowledged as such.