From ae8810b4a9857fcfdc771181da5a962ac1a99e6c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 9 Mar 2004 10:40:52 +0000 Subject: [PATCH] fixed problem with misspelled object classes --- lam-0.4/lib/account.inc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lam-0.4/lib/account.inc b/lam-0.4/lib/account.inc index 1264abe6..0b63794a 100644 --- a/lam-0.4/lib/account.inc +++ b/lam-0.4/lib/account.inc @@ -1017,6 +1017,16 @@ function loaduser($dns) { $j++; } + // fix misspelled object classes + $j = 0; + while (isset($attr['objectClass'][$j])) { + if (strtolower($attr['objectClass'][$j]) == "inetorgperson") $attr['objectClass'][$j] = "inetOrgPerson"; + else if (strtolower($attr['objectClass'][$j]) == "posixaccount") $attr['objectClass'][$j] = "posixAccount"; + else if (strtolower($attr['objectClass'][$j]) == "sambaaccount") $attr['objectClass'][$j] = "sambaAccount"; + else if (strtolower($attr['objectClass'][$j]) == "sambasamaccount") $attr['objectClass'][$j] = "sambaSamAccount"; + else if (strtolower($attr['objectClass'][$j]) == "shadowaccount") $attr['objectClass'][$j] = "shadowAccount"; + $j++; + } // load objectclasses $j=0; while (isset($attr['objectClass'][$j])) { @@ -1154,6 +1164,15 @@ function loadhost($dn) { // Set host samba flags $return->smb_flags['W'] = true; $return->smb_flags['X'] = true; + // fix misspelled object classes + $j = 0; + while (isset($attr['objectClass'][$j])) { + if (strtolower($attr['objectClass'][$j]) == "account") $attr['objectClass'][$j] = "account"; + else if (strtolower($attr['objectClass'][$j]) == "posixaccount") $attr['objectClass'][$j] = "posixAccount"; + else if (strtolower($attr['objectClass'][$j]) == "sambaaccount") $attr['objectClass'][$j] = "sambaAccount"; + else if (strtolower($attr['objectClass'][$j]) == "sambasamaccount") $attr['objectClass'][$j] = "sambaSamAccount"; + $j++; + } // load objectclasses $i=0; while (isset($attr['objectClass'][$i])) { @@ -1257,6 +1276,13 @@ function loadgroup($dn) { * Some values don't have to be set. These are only loaded if they are set */ + // fix misspelled object classes + $j = 0; + while (isset($attr['objectClass'][$j])) { + if (strtolower($attr['objectClass'][$j]) == "posixgroup") $attr['objectClass'][$j] = "posixGroup"; + else if (strtolower($attr['objectClass'][$j]) == "sambagroupmapping") $attr['objectClass'][$j] = "sambaGroupMapping"; + $j++; + } // load objectclasses $i=0; while (isset($attr['objectClass'][$i])) {