isReadOnly()) pla_error(_('You cannot perform updates while server is in read-only mode')); if (! $ldapserver->haveAuthInfo()) pla_error(_('Not enough information to login to server. Please check your configuration.')); $attr = $_GET['attr']; $dn = isset($_GET['dn']) ? $_GET['dn'] : null; $encoded_dn = rawurlencode($dn); $encoded_attr = rawurlencode($attr); if (! is_null($dn)) $rdn = get_rdn($dn); else $rdn = null; $current_values = $ldapserver->getDNAttr($dn,$attr); if ($current_values) { if (! is_array($current_values)) $current_values = array($current_values); $num_current_values = count($current_values); } else { $current_values = array(); $num_current_values = 0; } $is_object_class = (strcasecmp($attr, 'objectClass') == 0) ? true : false; if ($is_object_class) { # fetch all available objectClasses and remove those from the list that are already defined in the entry $schema_oclasses = $ldapserver->SchemaObjectClasses(); foreach($current_values as $oclass) unset($schema_oclasses[strtolower($oclass)]); } else { $schema_attr = $ldapserver->getSchemaAttribute($attr); } include './header.php'; echo ''; printf('

%s %s %s %s

', _('Add new'),htmlspecialchars($attr),_('value to'),htmlspecialchars($rdn)); printf('

%s %s     %s: %s

', _('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn)); printf('%s %s %s %s:', _('Current list of'),$num_current_values,_('values for attribute'),htmlspecialchars($attr)); if ($num_current_values) { if ($ldapserver->isJpegPhoto($attr)) { echo '
'; draw_jpeg_photos($ldapserver, $dn, $attr, false); echo '
'; # printf('

%s

', _('Note: You will get an "inappropriate matching" error if you have not setup an EQUALITY rule on your LDAP server for this attribute.')); # } elseif ($ldapserver->isAttrBinary($attr)) { echo ''; # printf('

%s

', _('Note: You will get an "inappropriate matching" error if you have not setup an EQUALITY rule on your LDAP server for this attribute.')); # } else { echo ''; } } else { echo '

'; } echo _('Enter the value you would like to add:'); echo '

'; if ($is_object_class) { echo '
'; printf('',$ldapserver->server_id); printf('',$encoded_dn); echo ''; echo '
'; printf('',_('Add new ObjectClass')); echo '
'; if ($config->GetValue('appearance','show_hints')) printf('
%s
', _('Note: You may be required to enter new attributes that these objectClass(es) require')); } else { echo ''; if ($ldapserver->isAttrBinary($attr)) echo 'enctype="multipart/form-data"'; printf('',$ldapserver->server_id); printf('',$encoded_dn); printf('',$encoded_attr); if ($ldapserver->isAttrBinary($attr)) { echo ''; echo ''; } else { if ($ldapserver->isMultiLineAttr($attr)) { echo ''; } else { printf('', ($schema_attr->getMaxLength() ? sprintf(' maxlength="%s"',$schema_attr->getMaxLength()) : '')); # draw the "browse" button next to this input box if this attr houses DNs: if ($ldapserver->isDNAttr($attr)) draw_chooser_link("new_value_form.new_value", false); } } printf('',_('Add New Value')); echo '
'; if ($schema_attr->getDescription()) printf('%s: %s
',_('Description'),$schema_attr->getDescription()); if ($schema_attr->getType()) printf('%s: %s
',_('Syntax'),$schema_attr->getType()); if ($schema_attr->getMaxLength()) printf('%s: %s %s
', _('Maximum Length'),number_format($schema_attr->getMaxLength()),_('characters')); echo '
'; } echo ''; ?>