diff --git a/lam/templates/tree/add_oclass.php b/lam/templates/tree/add_oclass.php index 485e4dc3..f593f769 100644 --- a/lam/templates/tree/add_oclass.php +++ b/lam/templates/tree/add_oclass.php @@ -62,7 +62,7 @@ setlanguage(); $dn = rawurldecode( $_POST['dn'] ); $encoded_dn = rawurlencode( $dn ); -$new_oclass = $_POST['new_oclass']; +$new_oclass = unserialize( rawurldecode( $_POST['new_oclass'] ) ); $new_attrs = $_POST['new_attrs']; $new_entry = array(); diff --git a/lam/templates/tree/add_oclass_form.php b/lam/templates/tree/add_oclass_form.php index 936a23fb..0c79419b 100644 --- a/lam/templates/tree/add_oclass_form.php +++ b/lam/templates/tree/add_oclass_form.php @@ -75,11 +75,14 @@ foreach( $entry as $attr => $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(); +$schema_oclasses = get_schema_objectclasses(); +$must_attrs = array(); +foreach($new_oclass as $oclass_name) { + $oclass = get_schema_objectclass($oclass_name); + if($oclass) + $must_attrs = array_merge($must_attrs, $oclass->getMustAttrNames($schema_oclasses)); +} +$must_attrs = array_unique( $must_attrs ); // We don't want any of the attr meta-data, just the string //foreach( $must_attrs as $i => $attr ) @@ -89,7 +92,7 @@ else // but that the object does not currently contain $needed_attrs = array(); foreach( $must_attrs as $attr ) { - $attr = get_schema_attribute( $attr->getName() ); + $attr = get_schema_attribute($attr); //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 ) @@ -120,7 +123,7 @@ if( count( $needed_attrs ) > 0 )
- + diff --git a/lam/templates/tree/add_value_form.php b/lam/templates/tree/add_value_form.php index 65e135fe..b238af2e 100644 --- a/lam/templates/tree/add_value_form.php +++ b/lam/templates/tree/add_value_form.php @@ -141,7 +141,7 @@ if( $is_object_class ) { - $oclass ) { @@ -153,7 +153,7 @@ if( $is_object_class ) { - +