$junk ) $current_attrs[] = strtolower($attr); // grab the required attributes for the new objectClass $oclass = get_schema_objectclass( $new_oclass ); if( $oclass ) $must_attrs = $oclass->getMustAttrs(); else $must_attrs = array(); // We don't want any of the attr meta-data, just the string //foreach( $must_attrs as $i => $attr ) //$must_attrs[$i] = $attr->getName(); // build a list of the attributes that this new objectClass requires, // but that the object does not currently contain $needed_attrs = array(); foreach( $must_attrs as $attr ) { $attr = get_schema_attribute( $attr->getName() ); //echo "
"; var_dump( $attr ); echo "
"; // First, check if one of this attr's aliases is already an attribute of this entry foreach( $attr->getAliases() as $alias_attr_name ) if( in_array( strtolower( $alias_attr_name ), $current_attrs ) ) // Skip this attribute since it's already in the entry continue; if( in_array( strtolower($attr->getName()), $current_attrs ) ) continue; // We made it this far, so the attribute needs to be added to this entry in order // to add this objectClass $needed_attrs[] = $attr; } if( count( $needed_attrs ) > 0 ) { echo $_SESSION['header']; echo "LDAP Account Manager\n"; echo "\n"; echo "\n"; ?>


$attr ) { ?>
getName()); ?>


server; $add_res = @ldap_mod_add( $ds, $dn, array( 'objectClass' => $new_oclass ) ); if( ! $add_res ) { echo $_SESSION['header']; echo "LDAP Account Manager\n"; echo "\n"; echo "\n"; StatusMessage('ERROR', _("Was unable to modify attribtues from DN: %s."), ldap_error( $ds ), array($dn)); echo ""; } else header( "Location: edit.php?dn=$encoded_dn&modified_attrs[]=objectClass" ); } ?>