%s.

%s', _('Could not retrieve schema from'),$app['server']->getName(), _('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.')); printf('

%s %s

',_('Schema for server'),$app['server']->getName()); $entry['schema_types'] = array( 'objectclasses'=>_('ObjectClasses'), 'attributes'=>_('Attribute Types'), 'syntaxes'=>_('Syntaxes'), 'matching_rules'=>_('Matching Rules')); echo '
'; echo '
'; $counter = 0; foreach ($entry['schema_types'] as $item => $value) { if ($counter++) { echo ' | '; } $entry['href'][$item] = sprintf('cmd=schema&server_id=%s&view=%s',$app['server']->getIndex(),$item); if ($entry['view'] == $item) { echo _($value); } else { if (isAjaxEnabled()) { printf('%s', htmlspecialchars($entry['href'][$item]),htmlspecialchars($entry['href'][$item]),$value,$value,$value); } else { printf('%s', htmlspecialchars($entry['href'][$item]), _($value)); } } } echo '
'; echo '
'; switch($entry['view']) { case 'syntaxes': $highlight_oid = get_request('highlight_oid','GET',false,false); echo ''; printf('',_('Syntax OID'),_('Description')); $counter = 1; $schema_syntaxes = $app['server']->SchemaSyntaxes(); if (! $schema_syntaxes) { error($schema_error_str, 'error', 'index.php'); } foreach ($schema_syntaxes as $syntax) { $counter++; $oid = $syntax->getOID(); $desc = $syntax->getDescription(); if ($highlight_oid && $highlight_oid == $oid) { echo ''; } else { printf('', $counter % 2 == 0 ? 'even' : 'odd'); } printf('',$oid,$desc); } echo '
%s%s
%s%s
'; break; case 'attributes': $entry['attr_types'] = array( 'desc' => _('Description'), 'obsolete' => _('Obsolete'), 'inherits' => _('Inherits from'), 'equality' => _('Equality'), 'ordering' => _('Ordering'), 'substring_rule' => _('Substring Rule'), 'syntax' => _('Syntax'), 'single_valued' => _('Single Valued'), 'collective' => _('Collective'), 'user_modification' => _('User Modification'), 'usage' => _('Usage'), 'maximum_length' => _('Maximum Length'), 'aliases' => _('Aliases'), 'used_by_objectclasses' => _('Used by objectClasses'), 'force_as_may' => _('Force as MAY by config') ); $sattrs = $app['server']->SchemaAttributes(); if (! $sattrs || ! $app['server']->SchemaObjectClasses()) { error($schema_error_str, 'error', 'index.php'); } printf('%s:',_('Jump to an attribute type')); echo '
'; echo '
'; echo ''; printf('',$entry['view']); printf('',$app['server']->getIndex()); if (isAjaxEnabled()) { drawJSItems($sattrs); echo ''; } echo ''; foreach ($sattrs as $name => $attr) { printf('', $name, $name == $entry['value'] ? 'selected="selected" ' : '', $attr->getName(FALSE)); } echo ''; if (isAjaxEnabled()) { printf('', _('Go')); } else { printf('', _('Go')); } echo '
'; echo '
'; echo '
'; foreach ($sattrs as $attr) { if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$attr->getName())) { if ((! is_null($entry['value']) && $entry['value']==$attr->getName()) || ! trim($entry['value'])) { $entry['viewed'] = TRUE; } if (isAjaxEnabled() && $entry['value']) { printf('
', $attr->getName(), strcasecmp($entry['value'], $attr->getName()) ? 'none' : 'block'); } else { printf('
', $attr->getName()); } echo ''; printf('', $attr->getName(),$attr->getName(false)); $counter = 0; foreach ($entry['attr_types'] as $item => $value) { printf('',++$counter%2 ? 'odd' : 'even'); printf('',$value); switch ($item) { case 'desc': printf('', is_null($attr->getDescription()) ? '('._('no description').')' : $attr->getDescription()); echo ''; printf('',++$counter%2 ? 'odd' : 'even'); echo ''; printf('',$attr->getOID()); break; case 'obsolete': printf('',$attr->getIsObsolete() ? ''._('Yes').'' : _('No')); break; case 'inherits': echo ''; break; case 'equality': echo ''; break; case 'ordering': printf('', is_null($attr->getOrdering()) ? '('._('not specified').')' : $attr->getOrdering()); break; case 'substring_rule': printf('', is_null($attr->getSubstr()) ? '('._('not specified').')' : $attr->getSubstr()); break; case 'syntax': echo ''; break; case 'single_valued': printf('',$attr->getIsSingleValue() ? _('Yes') : _('No')); break; case 'collective': printf('',$attr->getIsCollective() ? _('Yes') : _('No')); break; case 'user_modification': printf('',$attr->getIsNoUserModification() ? _('No') : _('Yes')); break; case 'usage': printf('',$attr->getUsage() ? $attr->getUsage() : '('._('not specified').')'); break; case 'maximum_length': echo ''; break; case 'aliases': echo ''; break; case 'used_by_objectclasses': echo ''; break; case 'force_as_may': printf('',$attr->isForceMay() ? _('Yes') : _('No')); break; } echo ''; } echo '
%s
%s%s
OID%s%s'; if (is_null($attr->getSupAttribute())) { printf('(%s)', _('none')); } else { $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($attr->getSupAttribute()))); if (isAjaxEnabled()) { printf('%s', $href, strtolower($attr->getSupAttribute()), $attr->getSupAttribute()); } else { printf('%s', $href, $attr->getSupAttribute()); } } echo ''; if (is_null($attr->getEquality())) { printf('(%s)', _('not specified')); } else { $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['matching_rules'],$attr->getEquality())); if (isAjaxEnabled()) { printf('%s', $href, $href, _('Matching Rules'), $attr->getEquality(), $attr->getEquality()); } else { printf('%s', $href, $attr->getEquality()); } } echo '%s%s'; if (is_null($attr->getType())) { echo $attr->getSyntaxOID(); } else { $href = htmlspecialchars(sprintf('%s&highlight_oid=%s',$entry['href']['syntaxes'],$attr->getSyntaxOID())); if (isAjaxEnabled()) { printf('%s (%s)', $href, $href, _('Syntaxes'), '', $attr->getType(), $attr->getSyntaxOID()); } else { printf('%s (%s)', $href, $attr->getType(), $attr->getSyntaxOID()); } } echo '%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')); } echo ''; if (count($attr->getAliases()) == 0) { printf('(%s)', _('none')); } else { foreach ($attr->getAliases() as $alias) { $href = htmlspecialchars(sprintf('%s&viewvalue=%s', $entry['href']['attributes'], strtolower($alias))); if (isAjaxEnabled()) { printf('%s', $href, strtolower($alias), $alias); } else { printf('%s', $href, $alias); } } } echo ''; if (count($attr->getUsedInObjectClasses()) == 0) { printf('(%s)', _('none')); } else { foreach ($attr->getUsedInObjectClasses() as $objectclass) { $href = htmlspecialchars(sprintf('%s&viewvalue=%s', $entry['href']['objectclasses'], strtolower($objectclass))); if (isAjaxEnabled()) { printf('%s ', $href, $href, _('ObjectClasses'), strtolower($objectclass), $objectclass); } else { printf('%s ', $href, $objectclass); } } } echo '%s
'; echo '
'; echo '
'; } } break; case 'matching_rules': $schema_matching_rules = $app['server']->MatchingRules(); if (! $schema_matching_rules) { error($schema_error_str, 'error', 'index.php'); } printf('%s
',_('Jump to a matching rule')); echo '
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); echo ''; if (isAjaxEnabled()) { drawJSItems($schema_matching_rules); echo ''; } echo ''; foreach ($schema_matching_rules as $rule) { printf('', $rule->getName(), ($rule->getName() == $entry['value'] ? 'selected="selected"' : ''), $rule->getName(FALSE)); } echo ''; if (isAjaxEnabled()) { printf('', _('Go')); } else { printf('', _('Go')); } echo '
'; echo '
'; echo '
'; echo ''; printf('', _('Matching Rule OID'),_('Name'),_('Used by Attributes')); $counter = 1; foreach ($schema_matching_rules as $rule) { $counter++; $oid = $rule->getOID(); $desc = $rule->getName(false); if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$rule->getName())) { if ((! is_null($entry['value']) && $entry['value']==$rule->getName()) || ! trim($entry['value'])) { $entry['viewed'] = TRUE; } if (null != $rule->getDescription()) { $desc .= sprintf(' (%s)', $rule->getDescription()); } if ( $rule->getIsObsolete()) { $desc .= sprintf(' %s', _('Obsolete')); } if (isAjaxEnabled() && $entry['value']) { printf('', $counter % 2 ? 'odd' : 'even', $rule->getName(), strcasecmp($entry['value'], $rule->getName()) ? 'none' : ''); } else { printf('', $counter % 2 ? 'odd' : 'even', $rule->getName()); } printf('',$oid); printf('',$desc); echo ''; echo ''; } } echo '
%s%s%s
%s%s'; if (count($rule->getUsedByAttrs()) == 0) { printf('
(%s)


',_('none')); } else { echo '
'; echo '
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); echo ''; printf('
'; if (isAjaxEnabled()) { printf('', _('Go'), $app['server']->getIndex(), _('Attributes'), $rule->getName()); } else { printf('', _('Go')); } echo '
'; echo '
'; echo '
'; } echo '
'; break; case 'objectclasses': $socs = $app['server']->SchemaObjectClasses(); if (! $socs) { error($schema_error_str, 'error', 'index.php'); } printf('%s:',_('Jump to an objectClass')); echo '
'; echo '
'; echo ''; printf('',$entry['view']); printf('',$app['server']->getIndex()); if (isAjaxEnabled()) { drawJSItems($socs); echo ''; } echo ''; foreach ($socs as $name => $oclass) { printf('', $name, $name == $entry['value'] ? 'selected="selected" ' : '', $oclass->getName(FALSE)); } echo ''; if (isAjaxEnabled()) { printf('', _('Go')); } else { printf('', _('Go')); } echo '
'; echo '
'; echo '
'; foreach ($socs as $name => $oclass) { if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$oclass->getName())) { if ((! is_null($entry['value']) && $entry['value']==$oclass->getName()) || ! trim($entry['value'])) { $entry['viewed'] = TRUE; } if (isAjaxEnabled() && $entry['value']) { printf('
', $oclass->getName(), strcasecmp($entry['value'], $oclass->getName()) ? 'none' : ''); } else { printf('
', $oclass->getName()); } echo ''; printf('',$name,$oclass->getName(false)); printf('',_('OID'),$oclass->getOID()); if ($oclass->getDescription()) { printf('', _('Description'), $oclass->getDescription()); } printf('',_('Type'),$oclass->getType()); if ($oclass->getIsObsolete()) { printf('', _('This objectClass is obsolete.')); } printf(''; printf(''; printf('', _('Required Attributes'),_('Optional Attributes')); echo ''; echo ''; echo ''; echo ''; echo '
%s
%s: %s
%s: %s
%s: %s
%s
%s: ',_('Inherits from')); if (count($oclass->getSupClasses()) == 0) { printf('(%s)', _('none')); } else { foreach ($oclass->getSupClasses() as $i => $object_class) { $href = htmlspecialchars(sprintf('%s&viewvalue=%s', $entry['href']['objectclasses'], strtolower($object_class))); if (isAjaxEnabled()) { printf('%s', $href, strtolower($object_class), $object_class); } else { printf('%s', $href, $object_class, _('Jump to this objectClass definition'), $object_class); } if ($i < count($oclass->getSupClasses()) - 1) { echo ', '; } } } echo '
%s: ',_('Parent to')); if (strcasecmp($oclass->getName(),'top') == 0) { $href = htmlspecialchars($entry['href']['objectclasses']); if (isAjaxEnabled()) { printf('all', $href); } else { printf('(all)', $href); } } elseif (count($oclass->getChildObjectClasses()) == 0) { printf('(%s)', _('none')); } else { foreach ($oclass->getChildObjectClasses() as $i => $object_class) { $href = htmlspecialchars(sprintf('%s&viewvalue=%s', $entry['href']['objectclasses'], strtolower($object_class))); if (isAjaxEnabled()) { printf('%s', $href, _('Jump to this objectClass definition'), strtolower($object_class), $object_class); } else { printf('%s', $href, _('Jump to this objectClass definition'), $object_class); } if ($i < count($oclass->getChildObjectClasses()) - 1) { echo ', '; } } } echo '
 %s%s 
'; if ($attrs = $oclass->getMustAttrs(true)) { echo '
    '; foreach ($attrs as $attr) { echo '
  • '; $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName())); if (isAjaxEnabled()) { printf('%s', $href, $href, _('Attributes'), $attr->getName(), $attr->getName(FALSE)); } else { printf('%s', $href, $attr->getName(FALSE)); } if ($attr->getSource() != $oclass->getName(false)) { echo '
    '; $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource()))); printf('(%s ',_('Inherited from')); if (isAjaxEnabled()) { printf('%s', $href, _('Jump to this objectClass definition'), strtolower($attr->getSource()), $attr->getSource()); } else { printf('%s', $href, $attr->getSource()); } echo ')'; } echo '
  • '; } echo '
'; } else { printf('(%s)', _('none')); } echo '
'; if ($attrs = $oclass->getMayAttrs(true)) { echo '
    '; foreach ($attrs as $attr) { echo '
  • '; $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName())); if (isAjaxEnabled()) { printf('%s', $href, $href, _('Attributes'), $attr->getName(), $attr->getName(FALSE)); } else { printf('%s', $href, $attr->getName(FALSE)); } if ($attr->getSource() != $oclass->getName(false)) { echo '
    '; $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource()))); printf('(%s ',_('Inherited from')); if (isAjaxEnabled()) { printf('%s', $href, _('Jump to this objectClass definition'), strtolower($attr->getSource()), $attr->getSource()); } else { printf('%s', $href, $attr->getSource()); } echo ')'; } if ($oclass->isForceMay($attr->getName())) { echo '
    '; printf('%s',_('This attribute has been forced as a MAY attribute by the configuration')); } echo '
  • '; } echo '
'; } else { printf('(%s)', _('none')); } echo '
'; echo '
'; echo '
'; } } break; } if (! is_null($entry['value']) && ! $entry['viewed']) { error(sprintf(_('No such schema item: "%s"'), $entry['value']), 'error', 'index.php'); } function drawJSItems($object) { echo ''; }