Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrianbj/pageprotector
ProcessWire module to allow site editors to protect pages from guest access
https://github.com/adrianbj/pageprotector
access-control password processwire protected-page
Last synced: about 2 months ago
JSON representation
ProcessWire module to allow site editors to protect pages from guest access
- Host: GitHub
- URL: https://github.com/adrianbj/pageprotector
- Owner: adrianbj
- License: gpl-2.0
- Created: 2014-11-25T00:12:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-03T16:04:19.000Z (over 3 years ago)
- Last Synced: 2024-05-02T00:34:54.112Z (8 months ago)
- Topics: access-control, password, processwire, protected-page
- Language: PHP
- Size: 66.4 KB
- Stars: 14
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Page Protector
Processwire module to allow site editors to protect pages from guest access.
### Functionality
* Ability for your site editors to control the user access to pages directly from Settings tab of each page
* Include whether to protect all children of this page or not
* Optionally allow access to only specified roles
* Option to protect all hidden pages (and optionally their children)
* Ability to change the message on the login page to make it specific to this page
* Option to have login form and prohibited message injected into a custom template
* Access to the "Protect this Page" settings panel is controlled by the "page-edit-protected" permission
* Table in the module config settings that lists the details all of the protected pages
* Shortcut to protect entire site with one click### API method
You can make changes to the protection settings of a page via the API```
// all optional, except "page_protected", which must be set to true/false
// if setting it to false, the other options are not relevant$options = array(
"page_protected" => true,
"children_protected" => true,
"roles" => array("role1", "role2"),
"message_override" => "My custom login message",
"prohibited_message" => "My custom prohibited access message"
);$page->protect($options);
```You can also check the status of a page with:
```
$page->protected
$page->prohibited
```#### Support forum:
https://processwire.com/talk/topic/8387-page-protector/## License
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.(See included LICENSE file for full license text.)