Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:integrationofglpiinegroupware [2009/09/10 00:53]
jcoleman created
en:integrationofglpiinegroupware [2015/07/03 11:46] (current)
Line 1: Line 1:
 ==== How to integrate GLPI in eGroupware in order to avoid a double identification when an external source of authentification is used Active Directory? ==== ==== How to integrate GLPI in eGroupware in order to avoid a double identification when an external source of authentification is used Active Directory? ====
 +
  
 __//These data are valid for GLPI 0.68.3 and eGroupware 1.2.104//__ __//These data are valid for GLPI 0.68.3 and eGroupware 1.2.104//__
  
  
-    * To copy file GLPI in the repertory”… htdocs/​egroupware/​”+    * To copy file GLPI in the repository”… htdocs/​egroupware/​”
  
     * To create the file as follows”… htdocs/​egroupware/​glpi/​setup/​setup.inc.php”:​     * To create the file as follows”… htdocs/​egroupware/​glpi/​setup/​setup.inc.php”:​
   ​   ​
- +<code php> 
- +<? php> 
-    /​************************************************************************** +  /​************************************************************************** 
-    * eGroupWare - glpi                                                        * +  * eGroupWare - glpi                                                        * 
-    * http://​www.egroupware.org ​                                               * +  * http://​www.egroupware.org ​                                               * 
-    * -------------------------------------------- ​                            * +  * -------------------------------------------- ​                            * 
-    *  This program is free software; you edge redistribute it and/or modify it* +  *  This program is free software; you edge redistribute it and/or modify it* 
-    *  under the terms off General the GNU Public License ace published by the * +  *  under the terms off General the GNU Public License ace published by the * 
-    *  Free Software Foundation; either version 2 off the License, but (At your* +  *  Free Software Foundation; either version 2 off the License, but (At your* 
-    *  option) any later version. ​                                             * +  *  option) any later version. ​                                             * 
-    ***************************************************************************/​ +  ***************************************************************************/​
-      +
-     /* $Id: setup.inc.php 21493 2006-04-30 12:53: 55Z ralfbecker $ * +
-     +
-    $setup_info [“glpi”] [“name”] ​   = “glpi”;​ +
-    $setup_info [“glpi”] [“version”] = “0.68.3”;​ +
-    $setup_info [“glpi”] [“app_order”] = 3; +
-    $setup_info [“glpi”] [“enable”] ​ = 1; +
-     +
-    $setup_info [“glpi”] [“license”] ​ = “LPG”;​ +
-    $setup_info [“glpi”] [“description”] = +
-        “Administrative of tickets. ”; +
-    $setup_info [“glpi”] [“note”] =  +
-        '';​ +
-    $setup_info [“glpi”] [“author”] = $setup_info [“glpi”] [“maintainer”] = array ( +
-        “name” ​ => “INDEPNET Development TEAM”, +
-        “email” => “glpi-porject.org” +
-    );  +
-       /* The hooks this app includes, needed for hooks registration * +
-        +
-       /* Dependencies for this app to work * +
-     +
        
 +   /* $Id: setup.inc.php 21493 2006-04-30 12:53: 55Z ralfbecker $ *
 +  ​
 +  $setup_info [“glpi”] [“name”] ​   = “glpi”;
 +  $setup_info [“glpi”] [“version”] = “0.68.3”;​
 +  $setup_info [“glpi”] [“app_order”] = 3;
 +  $setup_info [“glpi”] [“enable”] ​ = 1;
 +  ​
 +  $setup_info [“glpi”] [“license”] ​ = “LPG”;
 +  $setup_info [“glpi”] [“description”] =
 +      “Administrative of tickets. ”;
 +  $setup_info [“glpi”] [“note”] = 
 +      '';​
 +  $setup_info [“glpi”] [“author”] = $setup_info [“glpi”] [“maintainer”] = array (
 +      “name” ​ => “INDEPNET Development TEAM”,
 +      “email” => “glpi-porject.org”
 +  ); 
 +     /* The hooks this app includes, needed for hooks registration *
 +     
 +     /* Dependencies for this app to work *
 +</​code>​
  
     * To create the file if required”… htdocs/​egroupware/​glpi/​templates/​default/​images/​navbar.png” (it is the image which will appear in the menu of the eGroupWare applications)     * To create the file if required”… htdocs/​egroupware/​glpi/​templates/​default/​images/​navbar.png” (it is the image which will appear in the menu of the eGroupWare applications)
Line 46: Line 46:
     * To add application GLPI (State: Activated - Window popup) and to give the rights to the users in eGroupWare     * To add application GLPI (State: Activated - Window popup) and to give the rights to the users in eGroupWare
  
-    * Modification of the index.php of GLPI //(sending of the form automatically with the value “last_loginid” for the login)://+    * Modification of the index.php of GLPI (sending of the form automatically with the velaur ​“last_loginid” for the login): 
  
 +<code php>
 + ​[[echo]]
 +    <span class="​kw3">​[[echo]]</​span>​ “< div id=' boxlogin'>​”;​
 +    echo “<form action='​ login.php'​ name=' connexion'​ method='​ post'>​”;​
 +    // authentification CASE
 +</​code>​
 +<code php>
 +    echo “<div class='​ row'><​span class='​ label'><​label>​”. $lang [“login”] [6].” :  </​label></​span><​span class='​ formw'>​ <input type=' text' name=' login_name'​ id=' login_name'​ value='​ “. $_REQUEST [“last_loginid”]. ” “size='​ 15”/></​span></​div>​”;​
 +     echo “<div class='​ row'><​span class='​ label'><​label>​”. $lang [“login”] [7].” : </​label></​span><​span class='​ formw'><​input type=' password'​ name=' login_password'​ id=' login_password'​ value='​ bidon' size=' 15 '/> </​span></​div>​ ";
 +     echo “</​fieldset>​”;​
 +    echo “<p ><​span>​ <input type=' submit'​ name=' submit'​ value='​”. $lang [“short props”] [2]. ” “class='​ submit”/></​span></​p>​”;​
 +     echo “</​form>​”;​
 +     echo “<​script type=' text/​javascript'> ​ N”;
 +     echo “document.connexion.submit.click (); ”;
 +     echo “</​script> ​ N”;
 +</​code>​
  
-  +    * Modification of the login.php of GLPI (one is unaware of the test of authentification “connection_ldap_active_directory”):​ 
-    <a href="​http:​//www.php.net/echo"><​span class="​kw3">​echo<​/span><​/a> <span class="​st0"​> [[http://www.php.net/echo" | echo]]  <form action=' login.php'​ name=' connection'​ method=' post'>​”</​span><span class="​sy0"​>;</span> +<code php> 
-    ​<span class="​co1"​>// authentification CASE</span></pre>+    ​// Fifth try Activates directory LDAP in depth search 
 +        ​// we check all the auth sources in turn… 
 +        ​// First, we get the DNN and then, we try to log in 
 +        yew (! $auth_succeded&&​! empty ($cfg_glpi [“ldap_host”])) { 
 +            //echo “AD”; 
 +            $found_dn=false;​ 
 +            $auth_succeded=0;​ 
 +            $found_dn=$identificat->ldap_get_dn_active_directory ($cfg_glpi ​[“ldap_host”],​ $cfg_glpi ​[“ldap_basedn”],​ $_POST [“login_name”],​ $cfg_glpi [“ldap_rootdn”],​ $cfg_glpi [“ldap_pass”],​ $cfg_glpi [“ldap_port”]);​ 
 +            ​//echo $found_dn“---”;​ 
 +            yew ($found_dn! =false&&​! empty ($_POST [“login_password”])){  
 +                ​// $auth_succeded = $identificat->​connection_ldap_active_directory ($cfg_glpi [“ldap_host”], $found_dn, $_POST [“login_name”], $_POST [login_password”],​ $cfg_glpi [“ldap_condition”],​ $cfg_glpi [“ldap_port”]);​ 
 +                $auth_succeded=true; 
 +                yew ($auth_succeded) { 
 +                    $identificat->​extauth=1; 
 +                    $user_present ​$identificat->user->​getFromDBbyName ($_POST [“login_name]); 
 +                    $identificat->​user->​getFromLDAP_active_directory ($cfg_glpi [“ldap_host”],​ $cfg_glpi [“ldap_port”],​ $found_dn, $cfg_glpi [“ldap_rootdn”],​ $cfg_glpi [“ldap_pass”],​ $cfg_glpi [“ldap_fields”],​ $_POST [“login_name”],​ $cfg_glpi [“ldap_condition”]);​ 
 +                } 
 +            } 
 +        } 
 +</code> 
 +          * Modification of the logout.php of glpi (closing of window GLPI): 
 +<code php> 
 +      // Redirect to the login-page 
 +       //​glpi_header ($cfg_glpi [“root_doc”]. ”/“. $noCAS); 
 +      echo “<html><body onload ​“Javascript:​ window.close ();  “></body> 
 +  ​</html>” ? > 
 +</code>