Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-31 07:01:53

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

[plugin] jk_access_by_ip: restrict access to content by user's IP

Not sure if this exists already, but here it is nonetheless. This plugin allows users access to content on your site based on their IP address. While certainly not high level security, it does get the job done. Possible uses might include serving different navigations items to different users, allowing some users access to full body text while other can see only excerpts, and so forth. The heart of the plugin is two conditional container functions: if_authorized and if_not_authorized. The plugin can also output information regarding the user based on their IP — as specified by you. Blocks of IP ranges can be also specified. Support for an optional password override is in place, and will be made active in future versions.

This plugin makes use of a new table in the TXP database and does its magic via Cookies (which expire every 24 hours). Important: before setting this up, please create an addition table using the MYSQL code in the file subscribers.sql. This code creates the table “subscribers”. This name can be changed later as long as $ip_database is modified in the plugin source. Using phpmyadmin, you can also view how many times a user has logged in (actually, how many times the cookie has been set), and when their last login was. I would be interested in incorporating the user database information into the TXP admin interface in a future version. If someone can point me to a tutorial on creating plugins that add tabs to TXP I would be grateful.

If you find some use in this plugin, consider making a donation to our publishing project Fillip — donations will encourage development of this plugin beyond my own needs.

Last edited by Jeff_K (2007-01-31 07:07:26)

Offline

Board footer

Powered by FluxBB