You are not logged in.
Pages: 1
Hello.
I have GLPI configured with LDAP authentication. I have LDAP-GLPI users with usernames with more than 20 characters.
My users have Windows installed in their PCs, and they use Windows Active Directory to authenticate in their computers. Their usernames in Windows AD has a maximum of 20 characters (Windows has this limit).
I have OCS Inventory NG, which inventories my PCs. OCS saves in the "user" field the current logged user.
I want to import OCS data into GLPI, but I don't know what will happen when GLPI tries to associate PCs with GLPI users (because for the usernames with more that 20 chars they won't match).
I still haven't tested this because it's hundreds of PCs, and I don't want to break something...
Anyone has experience with this?
Thanks.
Offline
Hello
If you import users from AD correctly, their login in GLPI is the samAccountName, which means the same account used to open a Windows session.
When a new computers is imported into GLPI, we get the contact field (from OCS), which means the samAccountName, and try to match it with the login field in GLPI.
It *should* work well.
Offline
Hello wawa.
Thanks for the info, but my GLPI users authenticate against a LDAP server which isn't related to Active Directory.
The usernames in LDAP and in AD are the same, but in AD the usernames (samAccountName) are truncated to 20 chars long.
Offline
ah
then it won't work I'm afraid.
are the samAcountName and the GLPI's login the same, except that samAccountName is limited to 20 chars ?
if so, then you might be able to do automatic association by writing a plugin
Offline
No, the usernames are:
GLPI username = LDAP username
OCS username = samAccountName (AD)
For example:
GLPI username = username_very_very_long
OCS username = username_very_very_
Ins't this situation already considered in GLPI?
Offline
no it's not currently.
the best solution might be to write a plugin to it.
Offline
I have modified in ocsng.function.php the following:
if ($cfg_ocs["import_general_contact"] && !in_array("contact", $computer_updates)) {
$compupdate["contact"] = $line["USERID"];
$query = "SELECT ID FROM glpi_users WHERE SUBSTRING(name,1,7)='" . $line["USERID"] . "';";
// $query = "SELECT ID FROM glpi_users WHERE name='" . $line["USERID"] . "';";
$result = $DB->query($query);
if ($DB->numrows($result) == 1 && !in_array("FK_users", $computer_updates)) {$compupdate["FK_users"] = $DB->result($result, 0, 0);
}
}
And it works!.. (first I thought it didn't work, but I was making a mistake loading a different Apache)
Last edited by BrainSCAN (2009-01-20 09:40:28)
Offline
Anyone knows how can I convert this into a plugin so if it is useful for someone else he can use it?
Offline
Pages: 1