haveAuthInfo()) pla_error( _('Not enough information to login to server. Please check your configuration.') ); $view = isset($_GET['view']) ? $_GET['view'] : 'objectClasses'; $viewvalue = isset($_GET['viewvalue']) ? $_GET['viewvalue'] : null; if (trim($viewvalue) == "") $viewvalue = null; if (! is_null($viewvalue)) $viewed = false; include './header.php'; $schema_error_str = sprintf('%s %s.

%s', _('Could not retrieve schema from'),htmlspecialchars($ldapserver->name), _('This could happen for several reasons, the most probable of which are:'),_('The server does not fully support the LDAP protocol.'), _('Your version of PHP does not correctly perform the query.'),_('phpLDAPadmin doesn\'t know how to fetch the schema for your server.'), _('Or lastly, your LDAP server doesnt provide this information.')); ?>

name); ?>


%s', $ldapserver->server_id,'objectClasses',_('ObjectClasses'))); ?> | %s', $ldapserver->server_id,'attributes',_('Attribute Types'))); ?> | %s', $ldapserver->server_id,'syntaxes',_('Syntaxes'))); ?> | %s', $ldapserver->server_id,'matching_rules',_('Matching Rules'))); ?>

'; printf('%s%s',_('Syntax OID'),_('Description')); $counter = 1; $schema_syntaxes = $ldapserver->SchemaSyntaxes(null,true); if (! $schema_syntaxes) pla_error($schema_error_str); foreach ($schema_syntaxes as $syntax) { $counter++; $oid = htmlspecialchars($syntax->getOID()); $desc = htmlspecialchars($syntax->getDescription()); if ($highlight_oid && $highlight_oid == $oid) echo ''; else printf('',$counter%2==0?'even':'odd'); printf('%s%s',$oid,$desc); } print ''; break; case 'attributes': $schema_attrs = $ldapserver->SchemaAttributes(); $schema_object_classes = $ldapserver->SchemaObjectClasses(); if (! $schema_attrs || ! $schema_object_classes) pla_error($schema_error_str); printf('%s:',_('Jump to an attribute type')); echo '
'; printf('',$view); printf('',$ldapserver->server_id); echo ''; printf('
',_('Go')); echo '
'; echo ''; foreach ($schema_attrs as $attr) { if (is_null($viewvalue) || ! strcasecmp($viewvalue,$attr->getName())) { if (! is_null($viewvalue)) $viewed = true; printf('', strtolower($attr->getName()),$attr->getName()); $counter = 0; foreach ( array('desc','obsolete','inherits','equality','ordering','substring_rule','syntax', 'single_valued','collective','user_modification','usage','maximum_length', 'aliases','used_by_objectclasses' ) as $item) { printf('',++$counter%2 ? 'odd' : 'even'); switch ($item) { case 'desc': printf('',_('Description')); printf('', is_null($attr->getDescription()) ? '('._('no description').')' : $attr->getDescription()); print ''; printf('',++$counter%2 ? 'odd' : 'even'); echo ''; printf('',$attr->getOID()); break; case 'obsolete': printf('',_('Obsolete')); printf('',$attr->getIsObsolete() ? ''._('Yes').'' : _('No')); break; case 'inherits': printf('',_('Inherits from')); print ''; break; case 'equality': printf('',_('Equality')); printf('', is_null($attr->getEquality()) ? '('._('not specified').')' : sprintf('%s', $ldapserver->server_id,$attr->getEquality(),$attr->getEquality())); break; case 'ordering': printf('',_('Ordering')); printf('', is_null($attr->getOrdering()) ? '('._('not specified').')' : $attr->getOrdering()); break; case 'substring_rule': printf('',_('Substring Rule')); printf('', is_null($attr->getSubstr()) ? '('._('not specified').')' : $attr->getSubstr()); break; case 'syntax': printf('',_('Syntax')); print ''; break; case 'single_valued': printf('',_('Single Valued')); printf('',$attr->getIsSingleValue() ? _('Yes') : _('No')); break; case 'collective': printf('',_('Collective')); printf('',$attr->getIsCollective() ? _('Yes') : _('No')); break; case 'user_modification': printf('',_('User Modification')); printf('',$attr->getIsNoUserModification() ? _('No') : _('Yes')); break; case 'usage': printf('',_('Usage')); printf('',$attr->getUsage() ? $attr->getUsage() : '('._('not specified').')'); break; case 'maximum_length': printf('',_('Maximum Length')); print ''; break; case 'aliases': printf('',_('Aliases')); print ''; break; case 'used_by_objectclasses': printf('',_('Used by objectClasses')); print ''; break; } print ''; } flush(); } } print '
%s
%s%s
OID%s%s%s%s'; if (is_null($attr->getSupAttribute())) printf('(%s)',_('none')); else printf('%s', $ldapserver->server_id,$view, strtolower($attr->getSupAttribute()),$attr->getSupAttribute()); print '%s%s%s%s%s%s%s'; if (is_null($attr->getType())) { echo $attr->getSyntaxOID(); } else { printf('%s (%s)', $ldapserver->server_id, $attr->getSyntaxOID(),$attr->getSyntaxOID(), $attr->getType(),$attr->getSyntaxOID()); } print '%s%s%s%s%s%s%s%s%s'; if ( is_null($attr->getMaxLength())) echo '('._('not applicable').')'; else printf('%s %s',number_format($attr->getMaxLength()), $attr->getMaxLength()>1 ? _('characters') : _('character')); print '%s'; if (count($attr->getAliases()) == 0) echo '('._('none').')'; else foreach ($attr->getAliases() as $alias_attr_name) printf('%s', $ldapserver->server_id,strtolower($alias_attr_name),$alias_attr_name); print '%s'; if (count($attr->getUsedInObjectClasses()) == 0) echo '('._('none').')'; else foreach ($attr->getUsedInObjectClasses() as $used_in_oclass) printf('%s ', $ldapserver->server_id,strtolower($used_in_oclass),$used_in_oclass); print '
'; break; case 'matching_rules': $schema_matching_rules = $ldapserver->MatchingRules(null,true); if (! $schema_matching_rules) pla_error($schema_error_str); printf('%s
',_('Jump to a matching rule')); print '
'; printf('',$ldapserver->server_id); print ''; print ''; printf('',_('Go')); print '
'; print ''; printf('', _('Matching Rule OID'),_('Name'),_('Used by Attributes')); $counter = 1; foreach ($schema_matching_rules as $rule) { $counter++; $oid = htmlspecialchars($rule->getOID()); $desc = htmlspecialchars($rule->getName()); if ( is_null($viewvalue) || $viewvalue == ($rule->getName())) { if (! is_null($viewvalue)) $viewed = true; if (null != $rule->getDescription()) $desc .= sprintf(' (%s)',$rule->getDescription()); if ( $rule->getIsObsolete()) $desc .= sprintf(' %s',_('Obsolete')); printf('',$counter%2 ? 'odd' : 'even'); printf('',$oid); printf('',$desc); print ''; print ''; } } print '
%s%s%s
%s%s'; if (count($rule->getUsedByAttrs()) == 0) { printf('
(%s)


',_('none')); } else { print '
'; print '
'; printf('',$ldapserver->server_id); print ''; print '
'; printf('',_('Go')); print '
'; print '
'; } print '
'; break; case 'objectClasses': $schema_oclasses = $ldapserver->SchemaObjectClasses(); if (! $schema_oclasses) pla_error($schema_error_str); printf('%s:',_('Jump to an objectClass')); echo '
'; printf('',$view); printf('',$ldapserver->server_id); echo ''; printf('',_('Go')); echo '
'; echo '
'; flush(); foreach ($schema_oclasses as $name => $oclass) { if (is_null($viewvalue) || ($viewvalue == $name)) { if (! is_null($viewvalue)) $viewed = true; printf('

%s

',$name,$oclass->getName()); printf('

%s: %s

',_('OID'),$oclass->getOID()); if ($oclass->getDescription()) printf('

%s: %s

',_('Description'),$oclass->getDescription()); printf('

%s: %s

',_('Type'),$oclass->getType()); if ($oclass->getIsObsolete()) printf('

%s

',_('This objectClass is obsolete.')); printf('

%s: ',_('Inherits from')); if (count($oclass->getSupClasses()) == 0) printf('(%s)',_('none')); else foreach ($oclass->getSupClasses() as $i => $object_class) { printf('%s', _('Jump to this objectClass definition'), $ldapserver->server_id,$view,strtolower(htmlspecialchars($object_class)), htmlspecialchars($object_class)); if ($i < count($oclass->getSupClasses()) - 1) echo ', '; } echo '

'; printf('

%s: ',_('Parent to')); if (strcasecmp($oclass->getName(),'top') == 0) printf('(all)',$ldapserver->server_id); elseif (count($oclass->getChildObjectClasses()) == 0) printf('(%s)',_('none')); else foreach ($oclass->getChildObjectClasses() as $i => $object_class) { printf('%s', _('Jump to this objectClass definition'), $ldapserver->server_id,$view,strtolower(htmlspecialchars($object_class)), htmlspecialchars($object_class)); if ( $i < count($oclass->getChildObjectClasses()) - 1) echo ', '; } echo '

'; echo ''; echo ''; printf('',_('Required Attributes')); printf('',_('Optional Attributes')); echo ''; echo ''; echo ''; echo ''; echo ''; echo '
%s%s
'; if (count($oclass->getMustAttrs($schema_oclasses)) > 0) { echo '
    '; foreach ($oclass->getMustAttrs($schema_oclasses) as $attr) { echo '
  • '; printf('%s', $ldapserver->server_id,rawurlencode(strtolower($attr->getName())),htmlspecialchars($attr->getName())); if ($attr->getSource() != $oclass->getName()) { echo '
    '; printf('  (%s %s)', _('Inherited from'),$ldapserver->server_id,strtolower($attr->getSource()),$attr->getSource()); } echo '
  • '; } echo '
'; } else printf('
(%s)
',_('none')); echo '
'; if (count($oclass->getMayAttrs($schema_oclasses)) > 0) { echo '
    '; foreach ($oclass->getMayAttrs($schema_oclasses) as $attr) { echo '
  • '; printf('%s', $ldapserver->server_id,rawurlencode(strtolower($attr->getName())),htmlspecialchars($attr->getName())); if ($attr->getSource() != $oclass->getName()) { echo '
    '; printf('   (%s %s)', _('Inherited from'),$ldapserver->server_id,strtolower($attr->getSource()),$attr->getSource()); } echo '
  • '; } echo '
'; } else printf('
(%s)
',_('none')); echo '
'; } } /* End foreach objectClass */ break; } if (! is_null($viewvalue) && ! $viewed) pla_error(sprintf(_('No such schema item: "%s"'),htmlspecialchars($viewvalue))); echo ''; echo '';