From: <axe...@us...> - 2010-05-10 04:22:12
|
Revision: 109 http://wpmu-ldap.svn.sourceforge.net/wpmu-ldap/?rev=109&view=rev Author: axelseaa Date: 2010-05-10 04:22:06 +0000 (Mon, 10 May 2010) Log Message: ----------- added linux/windows specific attribute area Modified Paths: -------------- trunk/ldap/lib/defines.php trunk/ldap/lib/ldap_core.php trunk/ldap/lib/wpmu_ldap_admin.functions.php Modified: trunk/ldap/lib/defines.php =================================================================== --- trunk/ldap/lib/defines.php 2010-05-10 03:34:51 UTC (rev 108) +++ trunk/ldap/lib/defines.php 2010-05-10 04:22:06 UTC (rev 109) @@ -37,11 +37,13 @@ define ('LDAP_DEFAULT_ATTRIBUTE_PHONE', 'phone'); define ('LDAP_DEFAULT_ATTRIBUTE_HOMEDIR', 'homedirectory'); define ('LDAP_DEFAULT_ATTRIBUTE_MEMBER', 'member'); +define ('LDAP_DEFAULT_ATTRIBUTE_MEMBERNIX', 'uniquemember'); define ('LDAP_DEFAULT_ATTRIBUTE_MACADDRESS', 'zenwmmacaddress'); define ('LDAP_DEFAULT_ATTRIBUTE_DN', 'dn'); define ('LDAP_DEFAULT_ATTRIBUTE_NIXSEARCH', 'uid'); define ('LDAP_DEFAULT_ATTRIBUTE_WINSEARCH', 'samaccountname'); define ('LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASS','group'); +define ('LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASSNIX','groupofuniquenames'); define ('LDAP_DELIM', ","); define ('LDAP_USER_SEARCH_FULLNAME', '0'); Modified: trunk/ldap/lib/ldap_core.php =================================================================== --- trunk/ldap/lib/ldap_core.php 2010-05-10 03:34:51 UTC (rev 108) +++ trunk/ldap/lib/ldap_core.php 2010-05-10 04:22:06 UTC (rev 109) @@ -207,9 +207,14 @@ // Get Groups $attributes_to_get = array(get_site_option('ldapAttributeDN',LDAP_DEFAULT_ATTRIBUTE_DN)); - $search_filter = "(".get_site_option('ldapAttributeMember',LDAP_DEFAULT_ATTRIBUTE_MEMBER)."=$userDN)"; - $search_filter .= "(objectclass=".get_site_option('ldapAttributeGroupObjectclass',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASS)."))"; - $this->SetSearchCriteria("(&(".get_site_option('ldapAttributeMember',LDAP_DEFAULT_ATTRIBUTE_MEMBER)."=$userDN)(objectclass=".get_site_option('ldapAttributeGroupObjectclass',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASS)."))", $attributes_to_get); + if (get_site_option('ldapLinuxWindows')) { + $search_filter = "(".get_site_option('ldapAttributeMemberNix',LDAP_DEFAULT_ATTRIBUTE_MEMBERNIX)."=$userDN)"; + $search_filter .= "(objectclass=".get_site_option('ldapAttributeGroupObjectclassNix',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASSNIX).")"; + } else { + $search_filter = "(".get_site_option('ldapAttributeMember',LDAP_DEFAULT_ATTRIBUTE_MEMBER)."=$userDN)"; + $search_filter .= "(objectclass=".get_site_option('ldapAttributeGroupObjectclass',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASS).")"; + } + $this->SetSearchCriteria("(&$search_filter)", $attributes_to_get); $this->Search(); $results = ldap_get_entries($this->connection_handle, $this->search_result); Modified: trunk/ldap/lib/wpmu_ldap_admin.functions.php =================================================================== --- trunk/ldap/lib/wpmu_ldap_admin.functions.php 2010-05-10 03:34:51 UTC (rev 108) +++ trunk/ldap/lib/wpmu_ldap_admin.functions.php 2010-05-10 04:22:06 UTC (rev 109) @@ -175,11 +175,13 @@ $ret['ldapAttributePhone'] = get_site_option('ldapAttributePhone',LDAP_DEFAULT_ATTRIBUTE_PHONE); $ret['ldapAttributeHomedir'] = get_site_option('ldapAttributeHomedir',LDAP_DEFAULT_ATTRIBUTE_HOMEDIR); $ret['ldapAttributeMember'] = get_site_option('ldapAttributeMember',LDAP_DEFAULT_ATTRIBUTE_MEMBER); + $ret['ldapAttributeMemberNix'] = get_site_option('ldapAttributeMemberNix',LDAP_DEFAULT_ATTRIBUTE_MEMBERNIX); $ret['ldapAttributeMacaddress'] = get_site_option('ldapAttributeMacaddress',LDAP_DEFAULT_ATTRIBUTE_MACADDRESS); $ret['ldapAttributeDn'] = get_site_option('ldapAttributeDN',LDAP_DEFAULT_ATTRIBUTE_DN); $ret['ldapAttributeNixSearch'] = get_site_option('ldapAttributeNixSearch',LDAP_DEFAULT_ATTRIBUTE_NIXSEARCH); $ret['ldapAttributeWinSearch'] = get_site_option('ldapAttributeWinSearch',LDAP_DEFAULT_ATTRIBUTE_WINSEARCH); $ret['ldapAttributeGroupObjectclass'] = get_site_option('ldapAttributeGroupObjectclass',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASS); + $ret['ldapAttributeGroupObjectclassNix']= get_site_option('ldapAttributeGroupObjectclassNix',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASSNIX); $ret['ldapGroupAllowLogin'] = wpmuLdapGroupsGet(array('siteoption' => 'ldapGroupAllowLogin','display' => 'web')); $ret['ldapGroupAllowLoginCreate'] = wpmuLdapGroupsGet(array('siteoption' => 'ldapGroupAllowLoginCreate','display' => 'web')); @@ -516,6 +518,7 @@ <form method="post" id="ldap_auth_options"> <h3>LDAP Attribute Mapping</h3> <p>This page will allow you to modify which ldap attribute the plugin uses to populate default values for the user.</p> + <b>General Attributes</b> <table class="form-table"> <tr valign="top"> <th scope="row"><label for="ldapAttributeMail">Email:</label></th> @@ -560,48 +563,71 @@ </td> </tr> <tr valign="top"> - <th scope="row"><label for="ldapAttributeMember">Group Attribute:</label></th> + <th scope="row"><label for="ldapAttributeMacaddress">Mac Address:</label></th> <td> - <input type="text" name="ldapAttributeMember" id="ldapAttributeMember" value="<?php echo $ldapAttributeMember ?>" /> + <input type="text" name="ldapAttributeMacaddress" id="ldapAttributeMacaddress" value="<?php echo $ldapAttributeMacaddress ?>" /> <br/> </td> </tr> <tr valign="top"> - <th scope="row"><label for="ldapAttributeGroupObjectclass">Group Objectclass:</label></th> + <th scope="row"><label for="ldapAttributeDn">Distinguished Name (DN):</label></th> <td> - <input type="text" name="ldapAttributeGroupObjectclass" id="ldapAttributeGroupObjectclass" value="<?php echo $ldapAttributeGroupObjectclass ?>" /> + <input type="text" name="ldapAttributeDn" id="ldapAttributeDn" value="<?php echo $ldapAttributeDn ?>" /> <br/> </td> </tr> + </table> + + <br/><b>Windows Attributes</b> + <table class="form-table"> <tr valign="top"> - <th scope="row"><label for="ldapAttributeMacaddress">Mac Address:</label></th> + <th scope="row"><label for="ldapAttributeWinSearch">Search Attribute:</label></th> <td> - <input type="text" name="ldapAttributeMacaddress" id="ldapAttributeMacaddress" value="<?php echo $ldapAttributeMacaddress ?>" /> + <input type="text" name="ldapAttributeWinSearch" id="ldapAttributeWinSearch" value="<?php echo $ldapAttributeWinSearch ?>" /> <br/> </td> </tr> <tr valign="top"> - <th scope="row"><label for="ldapAttributeDn">Distinguished Name (DN):</label></th> + <th scope="row"><label for="ldapAttributeMember">Group Attribute:</label></th> <td> - <input type="text" name="ldapAttributeDn" id="ldapAttributeDn" value="<?php echo $ldapAttributeDn ?>" /> + <input type="text" name="ldapAttributeMember" id="ldapAttributeMember" value="<?php echo $ldapAttributeMember ?>" /> <br/> </td> </tr> <tr valign="top"> - <th scope="row"><label for="ldapAttributeNixSearch">Search Attribute (Linux):</label></th> + <th scope="row"><label for="ldapAttributeGroupObjectclass">Group Objectclass:</label></th> <td> + <input type="text" name="ldapAttributeGroupObjectclass" id="ldapAttributeGroupObjectclass" value="<?php echo $ldapAttributeGroupObjectclass ?>" /> + <br/> + </td> + </tr> + </table> + + <br/><b>Linux Attributes</b> + <table class="form-table"> + <tr valign="top"> + <th scope="row"><label for="ldapAttributeNixSearch">Search Attribute:</label></th> + <td> <input type="text" name="ldapAttributeNixSearch" id="ldapAttributeNixSearch" value="<?php echo $ldapAttributeNixSearch ?>" /> <br/> </td> </tr> <tr valign="top"> - <th scope="row"><label for="ldapAttributeWinSearch">Search Attribute (Windows):</label></th> + <th scope="row"><label for="ldapAttributeMemberNix">Group Attribute:</label></th> <td> - <input type="text" name="ldapAttributeWinSearch" id="ldapAttributeWinSearch" value="<?php echo $ldapAttributeWinSearch ?>" /> + <input type="text" name="ldapAttributeMemberNix" id="ldapAttributeMemberNix" value="<?php echo $ldapAttributeMemberNix ?>" /> <br/> </td> </tr> + <tr valign="top"> + <th scope="row"><label for="ldapAttributeGroupObjectclassNix">Group Objectclass:</label></th> + <td> + <input type="text" name="ldapAttributeGroupObjectclassNix" id="ldapAttributeGroupObjectclassNix" value="<?php echo $ldapAttributeGroupObjectclassNix ?>" /> + <br/> + </td> + </tr> </table> + <p class="submit"><input type="submit" name="ldapOptionsSave" value="Save Attributes" /></p> </form> <?php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |