Instance($server_id); // Unique to this template $step = isset( $_POST['step'] ) ? $_POST['step'] : 1; if( ! $ldapserver->haveAuthInfo()) pla_error( $lang['not_enough_login_info'] ); if( $step == 1 ) { $oclasses = $ldapserver->SchemaObjectClasses(); if( ! $oclasses || ! is_array( $oclasses ) ) pla_error( "Unable to retrieve the schema from your LDAP server. Cannot continue with creation." ); ?>

GetValue('appearance','show_hints')) { ?>
:

SchemaObjectClasses(); $required_attrs = array(); $all_attrs = array(); foreach( $oclasses as $oclass_name ) { $oclass = $ldapserver->getSchemaObjectClass($oclass_name); if( $oclass ) { $required_attrs = array_merge( $required_attrs, $oclass->getMustAttrNames( $schema_oclasses ) ); $all_attrs = array_merge( $all_attrs, $oclass->getMustAttrNames( $schema_oclasses ), $oclass->getMayAttrNames( $schema_oclasses ) ); } } $required_attrs = array_unique( $required_attrs ); $all_attrs = array_unique( $all_attrs ); remove_aliases( $required_attrs, $ldapserver ); remove_aliases( $all_attrs, $ldapserver ); sort( $required_attrs ); sort( $all_attrs ); // if for some reason "ObjectClass" ends up in the list of // $all_attrs or $required_attrs, remove it! This is a fix // for bug 927487 foreach( $all_attrs as $i => $attr_name ) if( 0 == strcasecmp( $attr_name, 'objectClass' ) ) { unset( $all_attrs[$i] ); $all_attrs = array_values( $all_attrs ); break; } foreach( $required_attrs as $i => $attr_name ) if( 0 == strcasecmp( $attr_name, 'objectClass' ) ) { unset( $required_attrs[$i] ); $required_attrs = array_values( $required_attrs ); break; } // remove binary attributes and add them to the binary_attrs array $binary_attrs = array(); foreach( $all_attrs as $i => $attr_name ) { if( is_attr_binary( $ldapserver, $attr_name ) ) { unset( $all_attrs[ $i ] ); $binary_attrs[] = $attr_name; } } // If we trim any attrs out above, then we will have a gap in the index // sequence and will get an "undefined index" error below. This prevents // that from happening. $all_attrs = array_values( $all_attrs ); // add the required attribute based on the RDN provided by the user // (ie, if the user specifies "cn=Bob" for their RDN, make sure "cn" is // in the list of required attributes. $rdn_attr = trim( substr( $rdn, 0, strpos( $rdn, '=' ) ) ); $rdn_value = trim( substr( $rdn, strpos( $rdn, '=' ) + 1 ) ); $rdn_value = @pla_explode_dn( $rdn ); $rdn_value = @explode( '=', $rdn_value[0], 2 ); $rdn_value = @$rdn_value[1]; if( in_array( $rdn_attr, $all_attrs ) && ! in_array( $rdn_attr, $required_attrs ) ) $required_attrs[] = $rdn_attr; ?>

\n"; } else foreach( $required_attrs as $count => $attr ) { ?> 0 ) { ?>
(" . $lang['none'] . ")
" . htmlspecialchars( $friendly_attrs[ strtolower( $attr ) ] ) . ""; } else { $attr_display = htmlspecialchars( $attr ); } echo $attr_display; ?>
" name="required_attrs[]" value="" size="40" />
()
$attr_display\n"; } return $attr_select_html; } function get_binary_attr_select_html( $binary_attrs, $friendly_attrs, $highlight_attr=null ) { $binary_attr_select_html = ""; if( ! is_array( $binary_attrs ) ) return null; if( count( $binary_attrs ) == 0 ) return null; foreach( $binary_attrs as $a ) { // is there a user-friendly translation available for this attribute? if( isset( $friendly_attrs[ strtolower( $a ) ] ) ) { $attr_display = htmlspecialchars( $friendly_attrs[ strtolower( $a ) ] ) . " (" . htmlspecialchars( $a ) . ")"; } else { $attr_display = htmlspecialchars( $a ); } $binary_attr_select_html .= ""; $attr1 = $ldapserver->getSchemaAttribute($attr_name1); if( null == $attr1 ) continue; if( $attr1->isAliasFor( $attr_name2 ) ) { //echo "* Removing attribute ". $attribute_list[ $k ] . "
"; unset( $attribute_list[ $k ] ); } } } $attribute_list = array_values( $attribute_list ); } ?>