Code Monkey home page Code Monkey logo

yellow-restrict's Introduction

Restrict 0.8.16

Restrict access to pages.

Screenshot

How to install an extension

Download ZIP file and copy it into your system/extensions folder. Learn more about extensions.

How to restrict the access to one or more pages

Add a Restrict setting at the top of a page to protect it and its descendant pages (top pages are considered children of the home page). The value of the setting is a comma separated list of users and groups that may access the page with their credentials.

This extension relies on the HTTP basic authentication. For sensitive data use it only over an encrypted connection (https://). For a simpler alternative there is the Private extension.

How to define usernames, passwords and groups

Usernames, passwords and groups are defined in a file system/extensions/restrict.ini, each user for line, with the following syntax:

username:password:@group1,@group2...

You can specify for each username zero or more groups it belongs to. All usernames belong moreover to an implicit group @all.

Examples

Page with restricted access:

---
Title: Reserved page
Restrict: john, @admin, @commitee
---

This page is reserved to John, administrators and members of the Commitee.

Usernames, passwords and groups in restrict.ini:

john:a2S%iZhK
mary:cAaRWC8&:@commitee,@admin
ben:5DgZAC&R:@member
lucy:ZWKD(8Jy:@admin,@member
antony:79wB5w@Z:@commitee
mark:9F5)F57e:@member

Passwords are stored in cleartext. Do not use them for any other purpose and transmit them securely to users.

Settings

The following setting can be configured in file system/extensions/yellow-system.ini:

RestrictUserFile = filename for users, passwords and groups

For the restricted pages to show the username and a tip for "logging out", add the following line to the file system/layouts/footer.html:

<?php echo $this->yellow->page->getExtraHtml("logout"); ?>

For this extension to work with the Apache webserver, sometimes it is necessary to add to the file .htaccess the following line:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

or the following lines:

RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

Other solutions may be needed.

Developer

Giovanni Salmeri. Get help.

yellow-restrict's People

Contributors

giovannisalmeri avatar

Stargazers

 avatar  avatar  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.