Restrict Access mod
The mod Restrict Access mod needs a new support person since the original mod developer or subsequent developers are no longer available to support the mod |
Restrict Access Mod | ||||||||
---|---|---|---|---|---|---|---|---|
Summary | Blocks access to files (except PDFs) unless user is logged in | |||||||
Validation | The mod is XHTML compliant. | |||||||
Mod Updated | 17 June 2018 | |||||||
Download link | For
For
| |||||||
Download stats | See download statistics | |||||||
Author(s) | Graham Chamberlain | |||||||
Homepage | Restrict Access mod (This page) | |||||||
Mod Support | TNG Community Forums | |||||||
Contact Developer | Support Person Needed | |||||||
Latest Mod | 12.0.1.6a | |||||||
Min TNG V | 9.0.0 | |||||||
Max TNG V | 14 | |||||||
Files modified | showlog.php, ajx_logxml.php, anniversaries.php, showsource.php, browsenotes.php, browsemedia.php, browsealbums.php, showmedia.php, languages/English/cust_text.php, languages/English-UTF8/cust_text.php | |||||||
Related Mods | ||||||||
Notes |
Purpose of Mod
This mod is intended for those with open access to their TNG site but who wish to disable access to media and other selected files for non-registered users. It allows access to the selected files only for logged-in users. If a non-logged-in user tries to access the relevant file they will see a template-formatted page that informs them they are not authorised to view that file and a links to the Home page and Previous page.
NOTE:
- The mod does not currently inhibit access to PDF media
- This mod is not required if your site is 'closed' and requires log-in
Mod Developer
The Mod Developer is Graham Chamberlain.
Requirements
- A working TNG installation.
- A backup of all affected files (see the list in the summary in the upper right corner of the page)
- An installed current version of the Mod Manager.
- Both English and English-UTF8 folders be on your site
Revision History
Mod Version | TNG Version | Date | Contents |
---|---|---|---|
12.0.1.6a | 12.0.1 | 24 Feb 2024 | Corrected two variable syntax errors -- Ron Krzmarzick |
12.0.1.6 | 12.0.1 | 22 May 2018 | Updated to comply with showsource.php in TNG v12.0.1 |
9.0.0.5 | 9.0 | 25 May 2016 | Correct wikipage link and adds text (UTF-8) variable for Danish |
9.0.0.4 | 9.0 | 04 February 2016 | Adds text variable 'regfam' missing from v9.0.0.3 and text (UTF-8) variables for Dutch, French, German and Spanish |
9.0.0.3 | 9.0 | 22 Apr 2012 | Adds text variable 'goback' missing from v9.0.0.2 |
9.0.0.2 | 9.0 | 05 Apr 2012 | New |
Conflicts and Issues
No known conflicts. }}
Installation
- Uninstall and delete previous version of this mod (if installed)
- Download the appropriate zip file as shown in the mod summary in the upper right corner of the page.
- Extract the file from the downloaded zip file into the mods folder or FTP the extracted file to your mods folder.
- Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the mod.
In the event of a problem
- Try using the Mod Manager Remove capability
- Copy the backup of the affected files back to your TNG directory
- Contact us through the TNG Community Forums.
Uninstalling the mod
If you want to completely Remove (uninstall) this mod and any tables if created, you should
- click the Uninstall button to uninstall the mod
- click the Delete button to delete the config file from the mods folder.
Upgrade
- Uninstall and eventually Delete the current Mod.
- Proceed as for an installation with the new Mod.
Manual Customisation
If you wish to allow browsing of media but still disallow viewing the individual media items, you should remove the directive for browsemedia.php. Alternatively, you could limit the media restriction to browsing specific collections. The following example would only block the browsing of 'histories' for non-logged-in users:
if(( ! $currentuser )&&($mediatypeID=="histories")) { $showguest=1; include("extensions/noaccess.php"); exit; }
and to limit the restriction to 'histories' and 'photos':
if(( ! $currentuser )&&($mediatypeID=="histories" || $mediatypeID=="photos")) { $showguest=1; include("extensions/noaccess.php"); exit; }
NOTE: It is not possible to use the above method to limit the viewing of individual images (showmedia.php) to a specific collection
Further Application / Customisation
The principles used in the directives of this mod to limit access also can be applied to other files.
Additional links can be provided for the Restriction Warning page by appropriately editing mods/restrict_access/noaccess.php and then reinstalling the mod.
The cfg file can be edited to suit the user's requirements:
- add or remove directives for affected files: Access Log, All Media, Anniversaries & Dates, Calendar, Notes and Sources
- change the text variables
$text['authorise'] = "You are not authorised to view this page";
and/or
$text['regfam'] = "To view this resource you must be a family member and register for a user-account";
to suit your preferred description - add appropriate language directives for your site (do not change the default English language directives other than to give a different text definition as described in the previous point.
Visualisation
This is how the standard Restriction Warning appears in Template 8:
Sites using this mod
If you download and install this mod, please add your TNG site to the table below:
- Mod Support Needed
- Mods for TNG v14
- Mods for TNG v13
- Mods for TNG v12
- Mods for TNG v11
- Mods for TNG v10
- Mods for TNG v9
- Showlog.php mods
- Ajx logxml.php mods
- Anniversaries.php mods
- Showsource.php mods
- Browsenotes.php mods
- Browsemedia.php mods
- Browsealbums.php mods
- Showmedia.php mods
- Cust text.php English mods
- Cust text.php French mods
- Cust text.php Dutch mods
- Cust text.php Spanish mods
- Cust text.php German mods