Restrict Access mod

From TNG_Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
NeedSupport 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 NeedSupport


Restrict Access Mod
Summary Blocks access to files (except PDFs) unless user is logged in
Validation The mod is XHTML compliant.Valid-xhtml10.png
Mod Updated 17 June 2018
Download link For
TNG 12.0.1
TNG 13.0
TNG 14.0
restrict_access_V12.0.1.6a.zip
For
TNG 9.0
TNG 10.0
TNG 11.0
TNG 12.0
restrict_access_V9.0.0.5.zip
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

  1. Uninstall and delete previous version of this mod (if installed)
  2. Download the appropriate zip file as shown in the mod summary in the upper right corner of the page.
  3. Extract the file from the downloaded zip file into the mods folder or FTP the extracted file to your mods folder.
  4. 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

Uninstalling the mod

If you want to completely Remove (uninstall) this mod and all its tables, you should

  1. click the Uninstall button to uninstall the mod
  2. 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:

  1. add or remove directives for affected files: Access Log, All Media, Anniversaries & Dates, Calendar, Notes and Sources
  2. 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
  3. 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:
Noaccess.png

Sites using this mod

If you download and install this mod, please add your TNG site to the table below:

URL User Note Mod-Version TNG-Version User-language
Chamberlain & Eidenbenz Genealogy Graham Chamberlain Mod developer 12.0.1.6 12.0.1 EN,FR,DE,ES,NL
Treichel-Familie.de Andreas Treichel Public & Private 12​.0​.1​.6 14.0.3 DE,EN,FR,ES,PL
Kemp(e) Family History Andrew Kemp see User:Kempons see User:Kempons EN
The Dutton's of Vermont Genealogy & History Darrin Dutton Public Site 9.0.0.5 11.1.1 EN
Kleinmann Genealogy John Kleinmann 12.0.1.6 14.0 EN
Turner Mob Genealogy Margaret Grogan Turner 9.0.0.3 10.1.1 EN
Grogan Mob Genealogy Margaret Grogan Turner 9.0.0.3 10.1.1 EN
Roots & Relatives Remembered Ron Krzmarzick Public & Private See Here See Here EN,DE,CS
The Extended Craxford Family Magazine Alan Craxford 9.0.0.5 10.1.3 EN
Crawford County Genealogy Gateway Frank Bernosky 9.0.0.5 11.1 EN
Rintoul/Bowman Family Andrew Rintoul Public/Private 12.0.1.6 12.3 EN,DE,ES,FR
Racine d'Alsace J-Louis Valory Public-Private - Template 17 12.0.1.6 12.0.1 FR
Gambrill Family Tree Bobby Gambrill Public 9.0.0.5 11.1.2 EN
Our Acadian Family Randal Suire Public/Private Media 9.0.0.5 11.1.2 EN,FR
Martius family Hendrik Martius Half public 12.0.0.6 12.0.3 DE,EN,FR,NL
Lloyd & Lucas - A Merging of Interests Chris Lloyd Public site 12.0.1.6 12.0.1 EN
The Severijns / Timmer Familytree Rob Severijns Public / Private 12.0.1.6a 14.0.4 NL, EN
Solem Genealogy Jan-Thore Solem Private 12​.0​.1​.6 14.0.2 EN,NO