TNG Integtrated Login - e107 v1.1

Author: Nicholas B. Flint, http://www.flintfamilyhistory.com/
The newest version of TNG Integrated Login will always be available at http://www.flintfamilyhistory.com/download.php.

The Next Generation 5, TNG, is a commercially available php script for the presentation of genealogical information. It is the sole property of Darrin Lythgoe. It can be purchased from http://www.lythgoes.net/genealogy/software.php

License
Description of TNG Integrated Login
Support
Requirements
Installation
Option Integration Steps

License

If you use any version of tngIL please create a link on your site to http://www.flintfamilyhistory.com.

This program is free software; you can redistribute it and/or modify it under the terms of  the GNU General Public License as published by the Free Software Foundation; either version  2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Back to Top

Description of TNG Integrated Login

TNG Integrated Login - e107 provides a means of integrating TNG 6 with e107 v.7. If a tngIL user is already in your TNG database they will be logged into TNG. If a tngIL user is not already in your database they will be added and then logged in. You can select which TNG security options to assign by default to all TNG users created using tngIL. Currently only one set of TNG security options is available for all users by default. Future versions will include multiple TNG security options depending on e107 user classes.

Features:

Back to Top

Support

Support is not available via e-mail. For all support related questions please visit the support forums at http://www.tngforum.us.

Back to Top

Requirements

e107 v.7, TNG 6.x

Back to Top

Installation

  1. Install e107.
     
  2. Upload tngIL folder to e107/e107_plugins/ directory. Do not install the plugin yet.
     
  3. Install TNG 5 into the /e107/e107_plugins/tngIL/ directory. Setup your main admin user in TNG as normal.
     
  4. Edit the TNG file, tngIL\begin.php, so that it is exactly as follows:
     
    <?php
    $istngfile = "yes";
    require_once("../../class2.php");

    if($tngprint == "1") { //if it's a print formatted page don't add the e107 stuff
    //dont load the e107 stuff
    } else {
    require_once(HEADERF);
    if(file_exists(e_PLUGIN."plugTNG/language/".e_LANGUAGE.".php")){
    require_once(e_PLUGIN."tngIL_menu/language/".e_LANGUAGE.".php");
    }
    } //end if eregi

    include("config.php");
    ?>


     

  5. Rename tngIL\footer.html to tngIL\footer.php. Add the following code to the bottom of the file now named footer.php:
     
    <?
    //include the footer
    require_once(FOOTERF);
    ?>


     

  6. class2.php is an e107 file located in the root e107 folder. Open class2.php and find:
     
    // Destroy! (if we need to)
    if($register_globals == true){
    while (list($global) = each($GLOBALS)) {
    if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST|retrieve_prefs|eplug_admin)$/',
    $global)) {
    unset($$global);
    }
    }
    unset($global);
    }

    Change it to:

    if(!isset($istngfile)){$istngfile="no";}
    if($istngfile != "yes"){
    // Destroy! (if we need to)
    if($register_globals == true){
    while (list($global) = each($GLOBALS)) {
    if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST|retrieve_prefs|eplug_admin)$/',
    $global)) {
    unset($$global);
    }
    }
    unset($global);
    }
    } //end if


     

  7. Log into the admin section of TNG. Click “Setup."
     
  8. Click “General Settings.”
     
  9. Change the Custom Footer field in the Site Design and Definition to be footer.php.
     
  10. Login and enter the e107 admin section. Using the Plugin Manager install the tngIL plugin.
     
  11. After TNG Integrated Login is installed click the "Configuration" button to configure the plugin. Setup the TNG Settings, Class Settings and the E-mail Notification configuration. After changing the default settings click submit.
     
  12. In the Class Settings, the No Class Assigned and Site Visitors are required to be setup. Explanation of the class system
    is as follows:

    No Class Assigned: Users that are members of your website but have not been assigned to one of the three optional tngIL classes. By default your users will recieve the settings specified here.

    Site Visitors: Users accessing TNG through tngIL that are not registered members of your site or are not logged into your
    site. Only one "Guest" account will be created in TNG using the settings specified here. All visitors will use this account.

    TNG_Admin: Recommended, though the name may be changed. Whatever name you use here will need to be created as a class in e107
    manually. If you do not create the class your users will default to No Class Assigned status. By default, users assigned to
    this class would be given full admin rights to TNG.

    TNG_Member: Recommended, though the name may be changed. Whatever name you use here will need to be created as a class in
    e107 manually. If you do not create the class your users will default to No Class Assigned status. By default, users
    assigned to this class would be given rights to make some changes to TNG.

    TNG_Guest: Recommended, though the name may be changed. Whatever name you use here will need to be created as a class in e107 manually. If you do not create the class your users will default to No Class Assigned status. By default, these users are registered members of your e107 site that you do not want to have Admin, Member, or No Class Assigned rights.

    So, create your classes in e107, update your class names in tngIL if needed, assign your site users to their appropriate
    classes.

    NOTE: If you change a users class in e107, tngIL will update their TNG user account to the appropriate settings the next time they login to TNG.

Back to Top

Optional Integration Steps

e107 Menu Visibility
To integrate the TNG admin section
To display TNG with only one e107 Menu bar

e107 Menu Visibility

These options are useful when used with the Links Menu and the Admin Links Menu.

To hide or show a menu when TNG public files are access enter the following code in the visibility section of that
menu:

tngIL/

To hide or show a menu when TNG admin files are access enter the following code in the visibility section of that
menu:

tngIL/admin/

Back to Optional Integration Steps

To integrate the TNG admin section

  1. Open admin/adminlib.php
  2. Find:
     
    include("../globallib.php");

    and add before that line:

    $istngfile="yes";
    require_once("../../../class2.php");
    if(eregi(e_PAGE, "findpersonform.php")
    || eregi(e_PAGE, "findperson.php")
    || eregi(e_PAGE, "findfamilyform.php")
    || eregi(e_PAGE, "findfamily2.php")
    || eregi(e_PAGE, "findsourceform.php")
    || eregi(e_PAGE, "findsource2.php")
    || eregi(e_PAGE, "findplaceform.php")
    || eregi(e_PAGE, "findplace2.php")
    || eregi(e_PAGE, "newentity.php")
    || eregi(e_PAGE, "addentity.php")
    || eregi(e_PAGE, "newevent.php")
    || eregi(e_PAGE, "notes.php")
    || eregi(e_PAGE, "filepicker.php")
    ){
    //dont load the e107 stuff
    } else {
    require_once(HEADERF);
    if(file_exists(e_PLUGIN."plugTNG/language/".e_LANGUAGE.".php")){
    require_once(e_PLUGIN."tngIL_menu/language/".e_LANGUAGE.".php");
    }
    } //end if eregi


     

  3. Open admin/index.php
  4. Delete the entire contents of admin/index.php (or comment out the entire contents).
  5. Add this code to admin/index.php:
     
    <?php
    header("location: $e107_dir/e107_plugins/tngIL/admin/main.php");
    exit;
    ?>

    Note: this will only add the e107 site header to admin pages, currently adding a footer would require editing each admin page and inserting the following code at the bottom:

    <?
    //include the footer
    require_once(FOOTERF);
    ?>

Back to Optional Integration Steps

To display TNG with only one e107 Menu bar

This requires editing the e107 theme.php file in use on your site. There are several ways to do this. I will only list the way I use. Check out $CUSTOMHEADER, $CUSTOMFOOTER, and $CUSTOMPAGES on e107.org for more information.

  1. Open your theme.php file.
  2. Find the lines that look like this:

     
    $HEADER = "The code for the e107 header";
    $FOOTER = "The code for the e107 footer";

    and change it to this:

    if(isset($istngfile) && $istngfile == "yes"
    || eregi(e_PAGE, "forum.php") //this line is used to add other pages to the same layout; just repeat it as many times as need and change the file name; delete this line if you don't need it
    ){
    $HEADER = "Your edited code for the e107 header";
    $FOOTER = "Your edited code for the e107 footer";
    } else {
    $HEADER = "The code for the normal e107 header";
    $FOOTER = "The code for the normal e107 footer";
    }

Back to Optional Integration Steps

Back to Top