Public Access Control

From TNG_Wiki
Revision as of 18:28, 5 May 2018 by XerxX (talk | contribs)
Jump to navigation Jump to search
Restricted Downloads of Public Access Control are restricted to logged in users. If you do not have a user account on the TNG Wiki use the Request Account link to request a user account Restricted
Caution If you have trouble downloading with Google Chrome, Vivaldi, Brave or other Chromium based browser, try using a right-click and select Open in new Window, then F5, or use another browser such as Firefox


Caution


Public Access Control
Summary Introduces a panel in General Settings to restrict public access to selected parts of your TNG system.
Validation The mod is XHTML compliant.Valid-xhtml10.png
Mod Updated 10 Jun 2017
Download link for
TNG 11.1.1
Public_access_control_mod_v11.1.1.3b.zip
for
TNG 11.0
Public_access_control_mod_v11.0.0.3b.zip
for
TNG 10.1.2
Public_access_control_mod_v10.1.2.3.zip
for
TNG 10.1.1
TNG 10.1.0
Public_access_control_mod_v10.1.0.3.zip
for
TNG 10.0.3
Public_access_control_mod_v10.0.3.3.zip
for
TNG 10.0.2
TNG 10.0.1
TNG 10.0
Public_access_control_mod_v10.0.0.3.zip
Download stats Public Access Control
Author(s) Erik Hoppe
Homepage Public Access Control (this page)
Mod Support My Mod Support
Contact Developer My Mod Support
Latest Mod 10.0.0.3 for TNG v10.0.0 - 10.0.2
10.0.3.3 for TNG v10.0.3
10.1.0.3 for TNG v10.1.0 - 10.1.1
10.1.2.3 for TNG v10.1.2 - 10.1.3
11.0.0.3b for TNG v11.0.x
11.1.1.3b for TNG v11.1.1
Min TNG V 10.0.0
Max TNG V 11.x  NOT YET TESTED IN TNG v12! 
Files modified
Related Mods
Notes
Author of TNG Colouring Book
Mods by me: At my user page.


Preface

These mods were formerly known as Access Panel Beta... and are a compilation of my mods AccessRestriction and AccessRestriction_More, done for TNG v10.

These mods make all the above mods obsolete for use with TNG v10.

PLEASE NOTE that mod v10.0.0.2 is not tested live. Report wanted!


Purpose of the mod

Introduces a panel in Administration >> Setup >> General Settings: The Public Access panel, where you can select which parts of your TNG system that you want to hide from the Public Guests (or require a login), while keeping permissions and restrictions for your logged in users intact.
Corresponding Drop-Down menu items will also be protected while static menus will not be visually affected but a selection will re-direct to the Log In page.

This mod enjoys the company of my Collapsible_Standard_Events mod or Jeff Robison's Show/Hide_Standard_Events mod. (See Edit Option below)


Developer

This mod was developed by Erik Hoppe.
A list of all my mods is found at my user page


Credits

My sincere Thank You to Henny Savenije for his wonderful patience, suggestions and testing of this mod.
And likewise to Martin Pannier who has been helping and testing a lot as well as pointing me to important details and giving great suggestions.
Jay Wilpolt also suggested and helped a lot, especially with the tests for v10.0.3.0.
Without you three and your constant encouragement, this mod would not be in its current state!
Thank You!


Un-Protect The "Contact Us" Link On Index.php

If you protect the Suggest tab and have a link "Contact us" at your index.php page with this text:
If you have any questions or comments about the information on this site, please contact us. We look forward to hearing from you.
it's useless as clicking the link opens the Log-in page.
It's however possible to open the Suggest page from the Mostwanted page because of a parameter in the URL.
You can use the same parameter for the "Contact us" link:

Look in languages/ your language /text.php for the variable

$text['contactus_long']

and copy all of it to your languages/ your language /cust_text.php
In the copy, find this part:

<a href=\"suggest.php\">

and between the php and the \ you add:

&amp;xpTpart=mostwanted

so it looks like this:

<a href=\"suggest.php&amp;xpTpart=mostwanted\">

The whole thing should look like this - in your language of course:

$text['contactus_long'] = "If you have any questions or comments about the information on this site, please <span class=\"emphasis\"><a href=\"suggest.php&amp;xpTpart=mostwanted\">contact us</a></span>. We look forward to hearing from you.";

Do the same for each language you support at your site.


Reported Successes / Failures with other mods

NOTE that this table only shows reports for mods installed with some remark, under P.A.C. mod versions 10.1.0.2 and 10.1.2.2.
Other mod versions may show similar or different results.
Many more mods have been tested without remarks.
Please add to this list and/or report by this Mod Support link, thank you.

Mod By Version Test in
TNG v10.1.1 +
PAC v10.1.0.2
Test in
TNG v10.1.2 +
PAC v10.1.2.2
Installed Before
Public Access
control mod
Installed After
Public Access
control mod
Same
res f.
TNG v11.0.0
+ PAC v11.0.0.0
Note
Drop_Down_Menu_Tooltip Jeff Robison v10.0.3.1 Y Y (Failure?) EH Success EH Yes (Depends on made Edits?)
Media_Preview_Fixed Jeff Robison v9.2.2.2 Y No Failure EH Success EH n/a Conflicts with Mobile_Media
Not used in TNG v > 10.1.1
v10.1.2.0 No Y Success EH Success EH Yes Not used in TNG v < 10.1.2
Mobile_Media Ken Roy v10.1.1.4 Y No Failure EH Success EH n/a Obsolete for TNG v10.1.2
Mobile_Site_Enhancements Ken Roy v10.1.0.3 Y No Failure EH Success EH n/a Not used in TNG v > 10.1.1
v10.1.2.4 No Yes Failure EH Success EH n/a Not used in TNG v < 10.1.2
v11.0.0.1 No No Failure EH Success EH Yes (Only tested in TNG v11-environm.)
Restrict_Image_Preview Graham Chamberlain v10.1.2.4 TNG 10.1.3 + PAC 10.1.2.2b Failure CL Success CL Yes Thanks to Chris Lloyd for reporting
NEW: Forum for TNG Erik Hoppe All versions All versions Failure MC Success MC Yes Thanks to Marc Chubbuck for reporting
 If a mod is "Installed Before" with Failure and "Installed After" with Success,
 the mod should be UNinstalled while the Public Access Control mod is installed or uninstalled.
 The mod can be re-installed after the Public Access Control mod has been installed or uninstalled.


Mod Makers: Innermenu for Your mods

If you add a selection to the innermenu of any of the scripts descend.php, familygroup.php, getperson.php or pedigree.php and it opens a custom page, you can use the code-snippets below in your script to make your innermenu look the same as in the calling script, wether this mod is installed or not.

If an item is hidden from public view in the innermenu of, f.ex, descend.php it will be displayed at your innermenu and the user will arrive at the Log in page if it is clicked.
Using the code below will prevent the item to be displayed if the
Public Access control' mod is/will be installed and the item is/will be hidden.

If the Public Access control mod is not installed, there is no difference.

Only the relevant part of the innermenu is shown and only lines containing $xerxxProtect[ ] are added to the original script.
All four innermenus in a zipped .txt file


What is Not protected

  • Media displayed by other mods may not be protected, depending on how the mod displays the media.
  • Media displayed at index.php (f.ex. a Random or Featured Photo) may not be protected
  • The Most Wanted page will show media and suggest.php will open if the link on the Most Wanted page is clicked.

The TNG "event" named Associations is not protected by this mod.


Requirements

TNG version: 10.1.0
  • A working TNG installation.
  • A backup of all affected files (see the list below)
  • An installed current version of the Mod Manager (is already included in TNG v10.x)


Before installation

  • If you have installed AccessRestriction, AccessRestriction More and/or Access Panel mods, you must first
  1. Uninstall the one(s) you have
  2. Remove the .cfg file(s) and the folder AccessRestrictionX from your mods folder


Installation

  1. Click on the download link for your TNG version, shown in the summary in the upper right corner of the page.
  2. Un-zip the downloaded file and you will find a folder: Open it.
  3. Move/copy/FTP the .cfg file and the folder named PublicAccessControl_10 to the mods folder of your TNG system.
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the mod.
  5. Re-install any mods that you had to uninstall in order to be able to install the Public Access Control mod


In the event of a problem


Edit option: Collapsible Standard Events

When the Public Access Control mod is used together with my Collapsible Standard Events mod or Jeff Robisons Show/Hide Standard Events mod, collapsible events can optionally be set to NOT collapsible if only icons and "Log in" are to be displayed.
Suppose that Notes and Media are protected by this mod, and...
Born is non-collapsible while Christened is set to collapsible:
Logged in view Not logged in view Default: "Christened" = initially collapsed.
Access collaps.png Pacmodimg1.png
Not logged in view Default: "Christened" = user expanded.
Pacmodimg2.png
Not logged in view: Optional behaviour
Access collaps NLI.png
As the Christened event is set to Collapsible but was only going to display the icons and "Log in" text, only the data is displayed and the event is not collapsible.
(My No_Notesring mod is active; it removes the small ring and increases the space between Notes)


After Installation

Go to Administration >> Setup >> General Settings to find the Public Access panel.
Set the public view to your liking and click the Save button.


Complete Description of Settings

A complete description of all settings, including how they interact with your settings in Trees (Gedcom and PDF permissions) and Site Design and Definition (displaying the Share, Print and Bookmark icons), is found here: Public Access Control settings


Custom Text Additions

The config file includes the English language custom text.
There are Dutch, French, German and Swedish translations if they are present in your TNG system.
For other languages you can modify the config file to add the custom text or manually add to whatever language you like.

English custom text For Reference Only!


$text['textHide'] = "Hide";
$text['textMedia'] = "Media";
$text['textNotes'] = "Notes";
$text['textRepositories'] = "Repositories";
$text['textSources'] = "Sources";
$text['textReports'] = "Reports";
$text['textRelationship'] = "Relationship";
$text['textExtractgedcom'] = "GEDCOM";
$text['textSuggest'] = "Suggest";
$text['textAncestors'] = "Ancestors";
$text['textDescendants'] = "Descendants";
$text['textTimeline'] = "Timeline";
$text['textShare'] = "Share";
$text['textPrint'] = "Print";
$text['textBookmark'] = "Bookmark";
$text['textLogin'] = "Log in";
$text['textCemeteryMap'] = "Cemetery map";

$text['xerxxProtectPanel'] = "Public Access";
$text['xerxxProtectShow'] = "Show";
$text['xerxxProtectTab'] = "Tab ";
$text['xerxxProtectTextStart'] = "Select ";
$text['xerxxProtectTextEnd'] = " to hide from public view";
$text['xerxxProtectTextFull'] = " and require ";
$text['xerxxProtectData'] = "Data";
$text['xerxxProtectIcons'] = "Icons";
$text['xerxxProtectTabs'] = "Tabs";
$text['xerxxProtectTSelections'] = "Tab <i>Selections</i>";
$text['xerxxProtectAhnentafel'] = "Ahnentafel";
$text['xerxxProtectPDF'] = "PDF";
$text['xerxxProtectRegister'] = "Register";

$text['xerxxProtectHideSet'] = "<u>When "" . $text['textHide'] . "" is set:</u> ";
$text['xerxxProtectLogInSet'] = "<u>When "" . $text['textLogin'] . "" is set:</u> ";
$text['xerxxProtectShowSet'] = "<u>When "" . $text['xerxxProtectShow'] . "" is set:</u><br />";
$text['xerxxProtectExpl1'] = "Will show icon, text and and Log in link.";
$text['xerxxProtectExpl2'] = "PDF printing opt for Tabs <i>Individuial</i><br />and <i>Family</i> are hidden from public view.<br />";
$text['xerxxProtectExpl3'] = "Will only affect Not logged in users.<br />";
$text['xerxxProtectExpl4'] = " permissions for all are set in";
$text['xerxxProtectExpl5'] = "For Logged in users permissions are set in";
$text['xerxxProtectExpl6'] = " Admin >> Trees.<br />";
$text['xerxxProtectExpl7'] = "All";
$text['xerxxProtectExpl8'] = "<br />Admin >> Setup >> General Settings >> Site Design and Definition.<br />";

$text['xerxxLogin'] = " (Log in)";
$text['xerxxNoaccount'] = "You need a user account to ";
$text['xerxxNoaccountView'] = "view ";
$text['xerxxNoaccountListen'] = "listen to ";
$text['xerxxNoaccountRead'] = "read ";

$text['xerxxAPanelAlsoHides'] = "Also hides";
$text['xerxxAPanelAll'] = "All:";
$text['xerxxAPanelHideAll'] = "Hide all";
$text['xerxxAPanelProtectAll'] = "Protect all";
$text['xerxxAPanelWLink'] = "For detailed information, see the Wiki page <a href='http://tng.lythgoes.net/wiki/index.php/Public_Access_Control' target='_blank'>Public Access Control</a> (sep. wind.)";


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 and then
  2. Click the Delete button to delete the config file from the mods folder.

In all cases: Go to Setup >> General Settings and click the Save button to clear the config.php file from the protection flags.


Revision History

Version Date Description
V11.1.1.3b
V11.0.0.3b
10 Jun 2017 French translation was missing a quote. Thanks to Randal Suire for the alert.
V11.1.1.3 29 May 2017 v11.0.0.3 doesn't install under TNG v11.1.1 - thanks to Jan Holmberg and Harold Craswell for telling me.
(Kept index 3 from all other versions)
Also added section "Un-protect the 'Contact us' link" to the Wiki - thanks to Ingemand for the inspiration.
V11.0.0.3 18 Jan 2017 Did not protect PDF in familychart.php
Thanks to Glenn for the alert.
V11.0.0.2 18 April 2016 Due to a change in whatsnew.php (TNG v11) all media was protected also when logged in.
Thanks to Rob S for the alert.
V10.0.0.3
V10.0.3.3
V10.1.0.3
V10.1.2.3
V11.0.0.1
29 March 2016 A conflict with No_Headstone_Photo_Report has been solved.
Thanks to Eilif N. for the alert.
V11.0.0.0 18 March 2016 Update by Ken Roy for TNG v11.0.0 - tested by author.
V10.0.0.2b
V10.0.3.2b
V10.1.0.2b
V10.1.2.2b
30 Oct 2015 The MM-parameters had %end:% tags. Removed.
The WhatsNew page was only protected in the DD menu. NOT protected at all now.
Both noted by M. Pannier. Thanks.
V10.0.0.2
V10.0.3.2
V10.1.0.2
V10.1.2.2
19 Oct 2015 Protected DD-menu items are now removed from the menus.
If Media is protected, there is no Media DD-menu. See Visualization of this mod.
An error involving multiple Albums when Media is protected, is corrected.
V10.0.0.1
V10.0.3.1
V10.1.0.1
V10.1.2.1
9 Aug 2015 The behaviour of collapsible standard events is now optional (see Edit Option above)
V10.0.0.0
V10.0.3.0
24 July 2015 Introduction.
After extensive testing by Jay Wilpolt of the 10.0.3.0 version, it is released.
V10.0.0.0 is looking for testers...
V10.1.0.0
V10.1.2.0
7 July 2015 Introduction.
After a lot of help and suggestions from Martin Pannier it looks like this could be worth Production status.
At the same time the name is changed from Access Panel to Public Access Control.
Dutch and French translations provided by Henny Savenije.
Dropdown menu selections are now protected.

Access Panel revision history

Version Date Description
V10.1.1.Beta11 9 June 2015 Added German (thanks Martin Pannier) and Swedish texts.
whatsnew.php does not require log in any more.
headstones.php and showmap.php are now protected (shows icons and Log in link). cemeteries.php will not show the "All Headstones" link. (Martin!)
Panel name is "Public Access" to emphasize that no user rights/restrictions are set there.
V10.1.1.Beta9 2 June 2015 Did not install after Relationship Display mod, but before. Fixed. Thanks to Martin Pannier for the alert.
V10.1.1.Beta8 1 June 2015 A small change to fit better with mobile_site_enhancements mod. Other lines make it not possible to install it before Access panel.
V10.1.1.Beta7 31 May 2015 Introduction.


Visualization of this mod

Click here for screen-shots from a fully protected site and of graphic trees if they should be accessible.

The Public Access panel after mod installation: No restrictions are set
AccessPanel.png
The below images show results when Media, Notes and Sources are set to Log in.
Individ's Media section (part), Logged-in view (67%) The same individ's Media section (full), Not logged-in view (67%)
IndMedia1LI67.png IndividualBottomNLI67.png
Protected items will also protect the corresponding Drop-Down menu items
Everything is protected in this example (Public Guest view):
Xprotmenus.jpg


Sites using this mod

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

www.blumensaadt-ingemand.dk
URL User Note Mod-Version TNG-Version User-language
Andersson, Hoppe, Sahlin, Thorell Erik Hoppe Mod author 11.1.1.3b 11.1.2 SE, GB, DE (flags top left)
Chubbuck & Ware Genealogy Marc Chubbuck User & Hosting Provider V10.1.2.2 11.0.1 EN
Our Acadian Family Randal Suire Great hide media mod. V11.1.1.3b 11.1.2 EN, FR
Ingemand Great mod 11.0.0.2 11.0.2 SE, GB, DE , DK, NO, ES, FR,NL
Crawford County Genealogy Gateway Frank Bernosky Public site 11.1.1.3 11.1.1 English
Your Roots are Showing Harold Craswell Public site 11.1.1.3 11.1.1 English
Familiestamboom.frl Renze Petersohn Public site 11.1.1.3B 11.1.2 Eng, Deu, Ned, Fra

TNG Modules Impacted

NOTE: The file config.php is not modified by the mod but will be affected by the actions of the modified file admin_updateconfig.php,
and should be backed up prior to installing this mod.


The following TNG Modules are modified, and should be backed up prior to installing this mod:

  • admin_genconfig.php
  • admin_updateconfig.php
  • ahnentafel.php
  • cemeteries.php
  • descend.php
  • descendtext.php
  • extrastree.php
  • familychart.php
  • familygroup.php
  • functions.php
  • genlib.php
  • getperson.php
  • globallib.php
  • headstones.php
  • mostwanted.php
  • pedbox.php
  • pedigree.php
  • pedigreetext.php
  • personlib.php
  • placesearch.php
  • register.php
  • showmap.php
  • verticalchart.php
  • whatsnew.php (from v11.0.0.2)


The following TNG Modules vill only have re-direction code added to the beginning,
and should also be backed up prior to installing this mod:

  • bookmarks.php
  • browsealbums.php
  • browsemedia.php
  • browsenotes.php
  • browserepos.php
  • browsesources.php
  • gedform.php
  • relateform.php
  • relationship.php
  • reports.php
  • showalbum.php
  • showmedia.php
  • showrepo.php
  • showreport.php
  • showsource.php
  • suggest.php
  • timeline.php


The custom texts will be added to these files, which should also be backed up prior to installing this mod:

  • languages/English/cust_text.php
  • languages/English-UTF8/cust_text.php
  • languages/Dutch/cust_text.php - if present
  • languages/Dutch-UTF8/cust_text.php - if present
  • languages/French/cust_text.php - if present
  • languages/French-UTF8/cust_text.php - if present
  • languages/German/cust_text.php - if present
  • languages/German-UTF8/cust_text.php - if present
  • languages/Swedish/cust_text.php - if present
  • languages/Swedish-UTF8/cust_text.php - if present


These images will be copied to your (root) img folder:

  • xerxxNonotes.png
  • xerxxNoalbums.png
  • xerxxNophotos.png
  • xerxxNodocuments.png
  • xerxxNoheadstones.png
  • xerxxNohistories.png
  • xerxxNorecordings.png
  • xerxxNovideos.png
  • xerxxNocitations.png
  • xerxxNomedia.png