Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:integrationofglpiinegroupware [2009/09/10 19:48]
jcoleman
en:integrationofglpiinegroupware [2015/07/03 11:46] (current)
Line 2: Line 2:
  
  
-<pre class="​code php">​ 
 __//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//__
  
Line 10: Line 9:
     * 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                                                        *
Line 41: Line 40:
            
      /* Dependencies for this app to work *      /* 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 50: Line 49:
  
  
- +<code php> 
-    echo “< div id=' boxlogin'>​”;​+ ​[[echo]] 
 +    ​<span class="​kw3">​[[echo]]</​span> ​“< div id=' boxlogin'>​”;​
     echo “<form action='​ login.php'​ name=' connexion'​ method='​ post'>​”;​     echo “<form action='​ login.php'​ name=' connexion'​ method='​ post'>​”;​
     // authentification CASE     // 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”] [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 “<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 “</​fieldset>​”;​
     echo “<p ><​span>​ <input type=' submit'​ name=' submit'​ value='​”. $lang [“short props”] [2]. ” “class='​ submit”/></​span></​p>​”;​     echo “<p ><​span>​ <input type=' submit'​ name=' submit'​ value='​”. $lang [“short props”] [2]. ” “class='​ submit”/></​span></​p>​”;​
-    ​echo “</​form>​”;​+     echo “</​form>​”;​
      echo “<​script type=' text/​javascript'> ​ N”;      echo “<​script type=' text/​javascript'> ​ N”;
-    ​echo “document.connexion.submit.click (); ”; +     echo “document.connexion.submit.click (); ”; 
-    echo “</​script> ​ N”;+     ​echo “</​script> ​ N”; 
 +</​code>​
  
     * Modification of the login.php of GLPI (one is unaware of the test of authentification “connection_ldap_active_directory”):​     * Modification of the login.php of GLPI (one is unaware of the test of authentification “connection_ldap_active_directory”):​
 +<code php>
 +    // 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>​