RELEASE 1.1.0.5

This commit is contained in:
Deon George 2009-06-30 21:51:50 +10:00
parent d5b4aa54ea
commit d5f4f91f1b
44 changed files with 1833 additions and 2109 deletions

View File

@ -1 +1 @@
$Name: RELEASE-1_1_0_4 $
$Name: RELEASE-1_1_0_5 $

View File

@ -46,7 +46,7 @@
/* phpLDAPadmin can encrypt the content of sensitive cookies if you set this
to a big random string. */
$config->custom->session['blowfish'] = '';
// $config->custom->session['blowfish'] = null;
/* The language setting. If you set this to 'auto', phpLDAPadmin will attempt
to determine your language automatically. Otherwise, available lanaguages
@ -66,6 +66,12 @@ $config->custom->session['blowfish'] = '';
environments. */
# $config->custom->password['no_random_crypt_salt'] = true;
/* PHP script timeout control. If php runs longer than this many seconds then
PHP will stop with an Maximum Execution time error. Increase this value from
the default if queries to your LDAP server are slow. The default is either
30 seconds or the setting of max_exection_time if this is null. */
// $config->custom->session['timelimit'] = 30;
/*********************************************/
/* Commands */
/*********************************************/
@ -131,6 +137,13 @@ $config->custom->commands['all'] = array(
/* Configure what objects are shown in left hand tree */
// $config->custom->appearance['tree_filter'] = '(objectclass=*)';
/* The height and width of the tree. If these values are not set, then
no tree scroll bars are provided.
// $config->custom->appearance['tree_height'] = null;
# $config->custom->appearance['tree_height'] = 600;
// $config->custom->appearance['tree_width'] = null;
# $config->custom->appearance['tree_width'] = 250;
/*********************************************/
/* Define your LDAP servers in this section */
/*********************************************/

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.25 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.25.2.1 2008/01/13 05:37:00 wurley Exp $
/**
* This page may simply add the objectClass and take you back to the edit page,
@ -89,12 +89,12 @@ if (count($ldap['attrs']['need']) > 0) {
printf('<input type="hidden" name="dn" value="%s" />',rawurlencode($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
echo '<table class="edit_dn" cellspacing="0">';
echo '<table class="entry" cellspacing="0">';
printf('<tr><th colspan="2">%s</th></tr>',_('New Required Attributes'));
foreach ($ldap['attrs']['need'] as $count => $attr) {
printf('<tr><td class="attr">%s</td></tr>',htmlspecialchars($attr->getName()));
printf('<tr><td class="val"><input type="text" name="new_attrs[%s]" value="" size="40" /></td></tr>',htmlspecialchars($attr->getName()));
printf('<tr><td class="title">%s</td></tr>',htmlspecialchars($attr->getName()));
printf('<tr><td class="value"><input type="text" name="new_attrs[%s]" value="" size="40" /></td></tr>',htmlspecialchars($attr->getName()));
}
echo '</table>';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.39.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.39.2.3 2008/01/13 05:43:13 wurley Exp $
/**
* Displays a form to allow the user to enter a new value to add
@ -47,7 +47,7 @@ if ($tree) {
$entry['ldap'] = $tree->getEntry($entry['dn']['string']);
}
// define the template of the entry if possible
# Define the template of the entry if possible
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_reader').'($ldapserver);');
$reader->visit('Start', $entry['ldap']);
@ -62,7 +62,7 @@ eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_writer'
$ldap['attr'] = $entry['ldap']->getAttribute($entry['attr']['string']);
if (!$ldap['attr']) {
// define a new attribute for the entry
# Define a new attribute for the entry
$attributefactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','attribute_factory');
eval('$attribute_factory = new '.$attributefactoryclass.'();');
$ldap['attr'] = $attribute_factory->newAttribute($entry['attr']['string'], array());
@ -77,11 +77,6 @@ if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
if (($ldap['attr']->getValueCount() == 0) && ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')));
/*
$ldap['attrs'] = $ldapserver->getDNAttr($entry['dn']['string'],$entry['attr']['string']);
$ldap['count'] = count($ldap['attrs']);
*/
$entry['attr']['oclass'] = (strcasecmp($entry['attr']['string'],'objectClass') == 0) ? true : false;
if ($entry['attr']['oclass']) {
@ -99,88 +94,50 @@ printf('<h3 class="title">%s <b>%s</b> %s <b>%s</b></h3>',
printf('<h3 class="subtitle">%s <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),$entry['dn']['html']);
if ($ldap['count']) {
printf('%s <b>%s</b> %s <b>%s</b>%s',
_('Current list of'),$ldap['count'],_('values for attribute'),$ldap['attr']->getFriendlyName(),_(':'));
} else {
printf('%s <b>%s</b>.',
_('No current value for attribute'),$ldap['attr']->getFriendlyName());
}
if ($entry['attr']['oclass']) {
echo '<form action="cmd.php" method="post" class="new_value" name="entry_form">';
echo '<input type="hidden" name="cmd" value="add_oclass_form" />';
} else {
echo '<form action="cmd.php" method="post" class="new_value" name="entry_form" enctype="multipart/form-data" onSubmit="return submitForm(this)">';
echo '<input type="hidden" name="cmd" value="update_confirm" />';
//printf('<input type="hidden" name="attr" value="%s" />',$entry['attr']['encode']);
}
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',$entry['dn']['encode']);
echo '<center>';
echo '<table class="forminput" border=0>';
echo '<tr>';
if ($ldap['count']) {
// display current attribute values
echo '<table class="edit_dn" cellspacing="0" cellpadding="0" align="center"><tr><td>';
printf('<td class="top">%s <b>%s</b> %s <b>%s</b>%s</td>',
_('Current list of'),$ldap['count'],_('values for attribute'),$ldap['attr']->getFriendlyName(),_(':'));
} else {
printf('<td>%s <b>%s</b>.</td>',
_('No current value for attribute'),$ldap['attr']->getFriendlyName());
}
echo '<td>';
if ($ldap['count']) {
# Display current attribute values
echo '<table border=0><tr><td>';
for ($i = 0; $i < $ldap['count']; $i++) {
$writer->draw('OldValue', $ldap['attr'], $i);
$writer->draw('ReadOnlyValue', $ldap['attr'], $i);
}
echo '</td></tr></table>';
/*
if ($ldapserver->isJpegPhoto($entry['attr']['string'])) {
printf('<table><tr><td>%s</td></tr></table>',
draw_jpeg_photos($ldapserver,$entry['dn']['string'],$entry['attr']['string'],false));
# <!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
printf('<p><small>%s</small></p>',
_('Note: You will get an "inappropriate matching" error if you have not setup an EQUALITY rule on your LDAP server for this attribute.'));
# <!-- End of temporary warning -->
} elseif ($ldapserver->isAttrBinary($entry['attr']['string'])) {
echo '<ul>';
for ($i=1; $i<=count($vals); $i++) {
$href = sprintf('download_binary_attr.php?server_id=%s&amp;dn=%s&amp;attr=%s&amp;value_num=%s',
$ldapserver->server_id,$entry['dn']['encode'],$entry['attr']['string'],$i-1);
printf('<li><a href="%s"><img src="images/save.png" alt="Save" />%s (%s)</a></li>',
$href,_('download value'),$i);
}
echo '</ul>';
# <!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
printf('<p><small>%s</small></p>',
_('Note: You will get an "inappropriate matching" error if you have not setup an EQUALITY rule on your LDAP server for this attribute.'));
# <!-- End of temporary warning -->
} else {
echo '<ul class="current_values">';
if (strcasecmp($entry['attr']['string'],'userPassword') == 0) {
foreach ($ldap['attrs'] as $key => $value) {
if (obfuscate_password_display(get_enc_type($value)))
echo '<li><span style="white-space: nowrap;">'.preg_replace('/./','*',$value).'<br /></li>';
else
echo '<li><span style="white-space: nowrap;">'.htmlspecialchars($value).'<br /></li>';
}
} else {
foreach ($ldap['attrs'] as $val)
printf('<li><span style="white-space: nowrap;">%s</span></li>',htmlspecialchars($val));
}
echo '</ul>';
}
*/
} else {
echo '<br /><br />';
}
echo '</td>';
echo '</tr>';
echo _('Enter the value you would like to add:');
echo '<br /><br />';
echo '<tr>';
printf('<td class="top">%s</td>',_('Enter the value you would like to add:'));
echo '<td>';
if ($entry['attr']['oclass']) {
// draw objectClass selection
echo '<table class="edit_dn" cellspacing="0" cellpadding="0" align="center"><tr><td>';
# Draw objectClass selection
echo '<table border=0><tr><td>';
echo '<select name="new_oclass[]" multiple="true" size="15">';
foreach ($ldap['oclasses'] as $name => $oclass) {
# exclude any structural ones, as they'll only generate an LDAP_OBJECT_CLASS_VIOLATION
@ -195,36 +152,21 @@ if ($entry['attr']['oclass']) {
echo '<br />';
printf('<input id="save_button" type="submit" value="%s" />',_('Add new ObjectClass'));
echo '</td></tr></table>';
echo '<br />';
echo '</td>';
echo '</tr>';
if ($_SESSION[APPCONFIG]->GetValue('appearance','show_hints'))
printf('<small><br /><img src="images/light.png" alt="Hint" /><span class="hint">%s</span></small>',
printf('<tr><td colspan=2><small><br /><img src="images/light.png" alt="Hint" /><span class="hint">%s</span></small></td></tr>',
_('Note: You may be required to enter new attributes that these objectClass(es) require'));
echo '</table>';
echo '</center>';
echo '</form>';
} else {
// draw a blank field
echo '<table class="edit_dn" cellspacing="0" cellpadding="0" align="center"><tr><td>';
# Draw a blank field
echo '<table border=0><tr><td>';
$writer->draw('BlankValue', $ldap['attr'], $ldap['count']);
echo '</td></tr><tr><td>';
/*
if ($ldapserver->isAttrBinary($entry['attr']['string'])) {
echo '<input type="file" name="new_value" />';
echo '<input type="hidden" name="binary" value="true" />';
} else {
if ($ldapserver->isMultiLineAttr($entry['attr']['string'])) {
echo '<textarea name="new_value" rows="3" cols="30"></textarea>';
} else {
printf('<input type="text"%s name="new_value" size="40" value="" />',
($ldap['attr']->getMaxLength() ? sprintf(' maxlength="%s"',$ldap['attr']->getMaxLength()) : ''));
# Draw the "browse" button next to this input box if this attr houses DNs:
if ($ldapserver->isDNAttr($entry['attr']['string']))
draw_chooser_link("new_value_form.new_value", false);
}
}
*/
if ($ldap['schema']->getDescription())
printf('<small><b>%s:</b> %s</small><br />',_('Description'),$ldap['schema']->getDescription());
@ -240,9 +182,12 @@ if ($entry['attr']['oclass']) {
printf('<input type="submit" id="save_button" name="submit" value="%s" />',_('Add New Value'));
echo '</td></tr></table>';
echo '</td></tr>';
echo '</table>';
echo '</center>';
echo '</form>';
// javascript
# Javascript
echo '<script type="text/javascript" language="javascript">
function pla_getComponentById(id) {
return document.getElementById(id);

View File

@ -1,13 +1,10 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.2 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.3 2008/01/13 06:33:50 wurley Exp $
/**
* Compare two DNs - the destination DN is editable.
* @package phpLDAPadmin
*/
/**
* @todo: Must fix dc/domainComponent evaluation.
*/
require_once './common.php';
@ -41,38 +38,34 @@ $attrs_all = array_keys($attrs_src);
foreach ($attrs_dst as $key => $val)
if (! in_array($key,$attrs_all))
$attrs_all[] = $key;
?>
<table class="comp_dn" border=0>
<tr><td colspan=6>
<h3 class="title"><?php echo _('Comparing the following DNs'); ?></h3>
</td></tr>
printf('<h3 class="title">%s</h3>',_('Comparing the following DNs'));
<tr>
<td colspan=2 width=20%>
<h3 class="subtitle"><?php echo _('Attribute'); ?><br />&nbsp;</h3>
</td>
<td colspan=2 width=40%>
<h3 class="subtitle"><?php echo _('Server'); ?>: <b><?php echo $ldapserver_src->name; ?></b><br /><?php echo _('Distinguished Name');?>: <b><?php echo htmlspecialchars(($dn_src)); ?></b></h3>
</td>
<td colspan=2 width=40%>
<h3 class="subtitle"><?php echo _('Server'); ?>: <b><?php echo $ldapserver_dst->name; ?></b><br /><?php echo _('Distinguished Name');?>: <b><?php echo htmlspecialchars(($dn_dst)); ?></b></h3>
</td>
</tr>
<tr>
<td colspan=6 align=right>
<form action="cmd.php?cmd=compare" method="post" name="compare_form">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="server_id_src" value="<?php echo $ldapserver_dst->server_id; ?>" />
<input type="hidden" name="server_id_dst" value="<?php echo $ldapserver_src->server_id; ?>" />
<input type="hidden" name="dn_src" value="<?php echo htmlspecialchars($dn_dst); ?>" />
<input type="hidden" name="dn_dst" value="<?php echo htmlspecialchars($dn_src); ?>" />
<input type="submit" value="<?php echo _('Switch Entry'); ?>" />
</form>
</td>
</tr>
echo '<table class="entry" width=100% border=0>';
echo '<tr>';
printf('<td colspan=2 width=20%%><h3 class="subtitle">%s<br />&nbsp;</h3></td>',_('Attribute'));
printf('<td colspan=2 width=40%%><h3 class="subtitle">%s: <b>%s</b><br />%s: <b>%s</b></h3></td>',
_('Server'),$ldapserver_src->name,_('Distinguished Name'),htmlspecialchars($dn_src));
printf('<td colspan=2 width=40%%><h3 class="subtitle">%s: <b>%s</b><br />%s: <b>%s</b></h3></td>',
_('Server'),$ldapserver_dst->name,_('Distinguished Name'),htmlspecialchars($dn_dst));
echo '</tr>';
echo '<tr>';
echo '<td colspan=6 align=right>';
echo '<form action="cmd.php?cmd=compare" method="post" name="compare_form">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="server_id_src" value="%s" />',$ldapserver_dst->server_id);
printf('<input type="hidden" name="server_id_dst" value="%s" />',$ldapserver_src->server_id);
printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($dn_dst));
printf('<input type="hidden" name="dn_dst" value="%s" />',htmlspecialchars($dn_src));
printf('<input type="submit" value="%s" />',_('Switch Entry'));
echo '</form>';
echo '</td>';
echo '</tr>';
<?php
if (! $attrs_all || ! is_array($attrs_all)) {
printf('<tr><td colspan="2">(%s)</td></tr>',_('This entry has no attributes'));
print '</table>';
@ -80,11 +73,10 @@ if (! $attrs_all || ! is_array($attrs_all)) {
}
sort($attrs_all);
$formdisplayed = false;
# Work through each of the attributes.
foreach ($attrs_all as $attr) {
flush();
# If this is the DN, get the next attribute.
if (! strcasecmp($attr,'dn'))
continue;
@ -92,28 +84,20 @@ foreach ($attrs_all as $attr) {
# Has the config.php specified that this attribute is to be hidden or shown?
if ($ldapserver_src->isAttrHidden($attr) || $ldapserver_dst->isAttrHidden($attr))
continue;
?>
<!-- Begin Attribute -->
<tr>
$schema_attr_src = $ldapserver_src->getSchemaAttribute($attr,$dn_src);
$schema_attr_dst = $ldapserver_dst->getSchemaAttribute($attr,$dn_dst);
<?php foreach (array('src','dst') as $side) { ?>
# Get the values and see if they are the same.
if (isset($attrs_src[$attr]) && isset($attrs_dst[$attr]) && $attrs_src[$attr] === $attrs_dst[$attr])
echo '<tr>';
else
echo '<tr class="updated">';
<?php
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly()) { ?>
<form action="cmd.php?cmd=update_confirm" method="post" name="edit_form">
<input type="hidden" name="server_id" value="<?php echo $ldapserver_dst->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $dn_dst; ?>" />
<?php }
$schema_attr_src = $ldapserver_src->getSchemaAttribute($attr,$dn_src);
$schema_attr_dst = $ldapserver_dst->getSchemaAttribute($attr,$dn_dst);
foreach (array('src','dst') as $side) {
# Setup the $attr_note, which will be displayed to the right of the attr name (if any)
$attr_note = '';
$required_note = '';
$attr_note = '&nbsp;';
# is there a user-friendly translation available for this attribute?
if ($_SESSION[APPCONFIG]->haveFriendlyName($attr)) {
@ -122,7 +106,7 @@ foreach ($attrs_all as $attr) {
} else {
$attr_display = $attr;
$attr_note = '';
$attr_note = '&nbsp;';
}
# is this attribute required by an objectClass?
@ -154,51 +138,49 @@ foreach ($attrs_all as $attr) {
break;
}
if ($side == 'src') { ?>
<td class="attr">
<?php $schema_href="cmd.php?cmd=schema&server_id=$server_id_src&amp;view=attributes&amp;viewvalue=".real_attr_name($attr); ?>
<a title="<?php echo sprintf(_('Click to view the schema definition for attribute type \'%s\''),$attr) ?>" href="<?php echo $schema_href; ?>"><?php echo $attr_display; ?></a>
</td>
# If we are on the source side, show the attr
if ($side == 'src') {
echo '<td class="title">';
$schema_href = sprintf('cmd.php?cmd=schema&amp;server_id=%s&amp;view=attributes&amp;viewvalue=%s',$server_id_src,real_attr_name($attr));
printf('<a title="%s" href="%s">%s</a>',sprintf(_('Click to view the schema definition for attribute type \'%s\''),$attr),$schema_href,$attr_display);
echo '</td>';
<td class="attr_note">
<sup><small><?php echo $attr_note; ?></small></sup>
</td>
<?php }
printf('<td class="note"><sup><small>%s</small></sup></td>',$attr_note);
}
if ($required_by) {
$required_note .= sprintf('<acronym title="%s">%s</acronym>',sprintf(_('Required attribute for objectClass(es) %s'),$required_by),_('required'));
?>
<td colspan=2 class="attr_note">
<sup><small><?php echo $required_note; ?></small></sup>
</td>
<?php } else { ?>
<td colspan=2 class="attr_note">&nbsp;</td>
<?php } ?>
echo '<td colspan=2 class="note">';
<?php if ($ldapserver->isAttrReadOnly($attr)) { ?>
<small>(<acronym title="<?php echo _('This attribute has been flagged as read only by the phpLDAPadmin administrator'); ?>"><?php echo _('read only'); ?></acronym>)</small>
<?php } ?>
</td>
# Create our form if the dst is editable.
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! $formdisplayed) {
$formdisplayed = true;
echo '<form action="cmd.php?cmd=update_confirm" method="post" name="edit_form">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver_dst->server_id);
printf('<input type="hidden" name="dn" value="%s" />',$dn_dst);
}
<?php } ?>
if ($required_by)
printf('<sup><small><acronym title="%s">%s</acronym></small></sup>',sprintf(_('Required attribute for objectClass(es) %s'),$required_by),_('required'));
echo '</td>';
</tr>
<!-- End of Attribute -->
if ($ldapserver->isAttrReadOnly($attr))
printf('<small>(<acronym title="%s">%s</acronym>)</small>',_('This attribute has been flagged as read only by the phpLDAPadmin administrator'),_('read only'));
}
<!-- Begin Values -->
<tr>
echo '</tr>';
if (isset($attrs_src[$attr]) && isset($attrs_dst[$attr]) && $attrs_src[$attr] === $attrs_dst[$attr])
echo '<tr>';
else
echo '<tr class="updated">';
<?php
foreach (array('src','dst') as $side) {
$vals = null; ?>
$vals = null;
<?php
# If this attribute isnt set, then show a blank.
$toJump = 0;
switch ($side) {
case 'src':
print '<td colspan=2>&nbsp</td><td class="val">';
print '<td colspan=2>&nbsp;</td><td class="value">';
if (! isset($attrs_src[$attr])) {
echo "<small>&lt;". _('No Value')."&gt;</small></td>";
@ -211,7 +193,7 @@ foreach ($attrs_all as $attr) {
break;
case 'dst':
print '<td colspan=2>&nbsp</td><td class="val">';
print '<td colspan=2>&nbsp;</td><td class="value">';
if (! isset($attrs_dst[$attr])) {
echo "<small>&lt;". _('No Value')."&gt;</small></td>";
@ -224,19 +206,18 @@ foreach ($attrs_all as $attr) {
break;
}
if ($toJump) continue;
if ($toJump)
continue;
if (! is_array($vals))
$vals = array($vals);
/*
* Is this attribute a jpegPhoto?
*/
# Is this attribute a jpegPhoto?
if ($ldapserver->isJpegPhoto($attr)) {
switch ($side) {
case 'src':
// Don't draw the delete buttons if there is more than one jpegPhoto
// (phpLDAPadmin can't handle this case yet)
# Don't draw the delete buttons if there is more than one jpegPhoto (phpLDAPadmin can't handle this case yet)
draw_jpeg_photos($ldapserver,$dn_src,$attr,false);
break;
@ -249,14 +230,12 @@ foreach ($attrs_all as $attr) {
break;
}
// proceed to the next attribute
echo "</td>\n";
# proceed to the next attribute
echo '</td>'."\n";
continue;
}
/*
* Is this attribute binary?
*/
# Is this attribute binary?
if ($ldapserver->isAttrBinary($attr)) {
switch ($side) {
case 'src':
@ -267,36 +246,27 @@ foreach ($attrs_all as $attr) {
$href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_dst,$attr);
break;
}
?>
<small>
echo '<small>';
echo _('Binary value');
echo '<br />';
<?php echo _('Binary value'); ?><br />
if (count($vals) > 1)
for ($i=1; $i<=count($vals); $i++)
printf('<a href="%s&amp;value_num=%s"><img src="images/save.png" /> %s(%s)</a><br />',$href,$i,_('download value'),$i);
else
printf('<a href="%s"><img src="images/save.png" /> %s</a><br />',$href,_('download value'));
<?php if (count($vals) > 1) { for($i=1; $i<=count($vals); $i++) { ?>
<a href="<?php echo $href . "&amp;value_num=$i"; ?>"><img
src="images/save.png" /> <?php echo _('download value'); ?>(<?php echo $i; ?>)</a><br />
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr))
printf('<a href="javascript:deleteAttribute(\'%s\');" style="color:red;"><img src="images/trash.png" /> %s</a>',$attr,_('delete attribute'));
<?php } } else { ?>
<a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo _('download value'); ?></a><br />
echo '</small>';
echo '</td>';
<?php }
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr)) { ?>
<a href="javascript:deleteAttribute('<?php echo $attr; ?>');" style="color:red;"><img src="images/trash.png" /> <?php echo _('delete attribute'); ?></a>
<?php } ?>
</small>
</td>
<?php continue;
continue;
}
/*
* Note: at this point, the attribute must be text-based (not binary or jpeg)
*/
# Note: at this point, the attribute must be text-based (not binary or jpeg)
/*
* If this server is in read-only mode or this attribute is configured as read_only,
@ -306,67 +276,59 @@ foreach ($attrs_all as $attr) {
if ($side == 'dst' && ($ldapserver->isReadOnly() || $ldapserver->isAttrReadOnly($attr))) {
if (is_array($vals)) {
foreach ($vals as $i => $val) {
if (trim($val) == "")
echo "<span style=\"color:red\">[" . _('empty') . "]</span><br />\n";
if (trim($val) == '')
printf('<span style="color:red">[%s]</span><br />',_('empty'));
elseif (0 == strcasecmp($attr,'userPassword') && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
echo preg_replace('/./','*',$val) . "<br />";
elseif (strcasecmp($attr,'userPassword') == 0 && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
echo preg_replace('/./','*',$val).'<br />';
else
echo htmlspecialchars($val) . "<br />";
echo htmlspecialchars($val).'<br />';
}
// @todo: redundant - $vals is always an array.
# @todo: redundant - $vals is always an array.
} else {
if (0 == strcasecmp($attr,'userPassword') && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
echo preg_replace('/./','*',$vals) . "<br />";
if (strcasecmp($attr,'userPassword') == 0 && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
echo preg_replace('/./','*',$vals).'<br />';
else
echo $vals . "<br />";
echo $vals.'<br />';
}
echo "</td>";
echo '</td>';
continue;
}
/*
* Is this a userPassword attribute?
*/
# Is this a userPassword attribute?
if (! strcasecmp($attr,'userpassword')) {
$user_password = $vals[0];
$enc_type = get_enc_type($user_password);
// Set the default hashing type if the password is blank (must be newly created)
# Set the default hashing type if the password is blank (must be newly created)
if ($user_password == '') {
$enc_type = get_default_hash($server_id);
}
if ($side == 'dst') { ?>
if ($side == 'dst') {
printf('<input type="hidden" name="old_values[userpassword]" value="%s" />',htmlspecialchars($user_password));
echo '<!-- Special case of enc_type to detect changes when user changes enc_type but not the password value -->';
printf('<input size="38" type="hidden" name="old_enc_type" value="%s" />',$enc_type == '' ? 'clear' : $enc_type);
}
<input type="hidden" name="old_values[userpassword]" value="<?php echo htmlspecialchars($user_password); ?>" />
<!-- Special case of enc_type to detect changes when user changes enc_type but not the password value -->
<input size="38" type="hidden" name="old_enc_type" value="<?php echo ($enc_type==''?'clear':$enc_type); ?>" />
<?php }
if (obfuscate_password_display($enc_type)) {
if (obfuscate_password_display($enc_type))
echo htmlspecialchars(preg_replace('/./','*',$user_password));
} else {
else
echo htmlspecialchars($user_password);
} ?>
<br />
echo '<br />';
<?php if ($side == 'dst') { ?>
if ($side == 'dst') {
printf('<input style="width: 260px" type="password" name="new_values[userpassword]" value="%s" />',htmlspecialchars($user_password));
echo enc_type_select_list($enc_type);
<input style="width: 260px" type="password" name="new_values[userpassword]" value="<?php echo htmlspecialchars($user_password); ?>" />
}
<?php echo enc_type_select_list($enc_type);
} ?>
<br />
<script language="javascript">
echo '<br />';
?>
<script type="text/javascript" language="javascript">
<!--
function passwordComparePopup()
{
@ -377,187 +339,168 @@ foreach ($attrs_all as $attr) {
}
-->
</script>
<?php
<small><a href="javascript:passwordComparePopup()"><?php echo _('Check password'); ?></a></small>
printf('<small><a href="javascript:passwordComparePopup()">%s</a></small>',_('Check password'));
</td>
<?php continue;
echo '</td>';
continue;
}
/*
* Is this a boolean attribute?
*/
# Is this a boolean attribute?
if ($ldapserver->isAttrBoolean($attr)) {
$val = $vals[0];
if ($side = 'dst') {?>
if ($side = 'dst') {
printf('<input type="hidden" name="old_values[%s]" value="%s" />',htmlspecialchars($attr),htmlspecialchars($val));
<input type="hidden" name="old_values[<?php echo htmlspecialchars($attr); ?>]" value="<?php echo htmlspecialchars($val); ?>" />
printf('<select name="new_values[%s]">',htmlspecialchars($attr));
printf('<option value="TRUE"%s>%s</option>',$val == 'TRUE' ? ' selected' : '',_('true'));
printf('<option value="FALSE"%s>%s</option>',$val == 'FALSE' ? ' selected' : '',_('false'));
printf('<option value="">(%s)</option>',_('none, remove value'));
echo '</select>';
}
<select name="new_values[<?php echo htmlspecialchars($attr); ?>]">
<option value="TRUE"<?php echo ($val=='TRUE' ? ' selected' : ''); ?>><?php echo _('true'); ?></option>
<option value="FALSE"<?php echo ($val=='FALSE' ? ' selected' : ''); ?>><?php echo _('false'); ?></option>
<option value="">(<?php echo _('none, remove value'); ?>)</option>
</select>
<?php } ?>
</td>
<?php continue;
echo '</td>';
continue;
}
/*
* End of special case attributes (non plain text).
*/
# End of special case attributes (non plain text).
foreach ($vals as $i => $val) {
if ($side == 'dst') {
$input_name = "new_values[" . htmlspecialchars($attr) . "][$i]";
// We smack an id="..." tag in here that doesn't have [][] in it to allow the
// draw_chooser_link() to identify it after the user clicks.
$input_id = "new_values_" . htmlspecialchars($attr) . "_" . $i; ?>
$input_name = sprintf('new_values[%s][%s]',htmlspecialchars($attr),$i);
<!-- The old_values array will let update.php know if the entry contents changed
between the time the user loaded this page and saved their changes. -->
<input type="hidden" name="old_values[<?php echo htmlspecialchars($attr); ?>][<?php echo $i; ?>]" value="<?php echo htmlspecialchars($val); ?>" />
<?php }
/* We smack an id="..." tag in here that doesn't have [][] in it to allow the
* draw_chooser_link() to identify it after the user clicks.*/
$input_id = sprintf('"new_values_%s_%s',htmlspecialchars($attr),$i);
// Is this value is a structural objectClass, make it read-only
if (0 == strcasecmp($attr,'objectClass')) { ?>
echo '<!-- The old_values array will let update.php know if the entry contents changed
between the time the user loaded this page and saved their changes. -->';
printf('<input type="hidden" name="old_values[%s][%s]" value="%s" />',htmlspecialchars($attr),$i,htmlspecialchars($val));
}
<a title="<?php echo _('View the schema description for this objectClass'); ?>" href="cmd.php?cmd=schema&server_id=<?php echo $ldapserver->server_id; ?>&amp;view=objectClasses&amp;viewvalue=<?php echo htmlspecialchars($val); ?>"><img src="images/info.png" /></a>
# Is this value is a structural objectClass, make it read-only
if (0 == strcasecmp($attr,'objectClass')) {
<?php $schema_object = $ldapserver->getSchemaObjectClass($val);
printf('<a title="%s" href="cmd.php?cmd=schema&amp;server_id=%s&amp;view=objectClasses&amp;viewvalue=%s"><img src="images/info.png" /></a>',
_('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val));
if ($schema_object->getType() == 'structural') {
echo "$val <small>(<acronym title=\"" . sprintf(_('This is a structural ObjectClass and cannot be removed.')) . "\">" . _('structural') . "</acronym>)</small><br />";
$schema_object = $ldapserver->getSchemaObjectClass($val);
if ($side == 'dst') {?>
if ($schema_object->getType() == 'structural') {
printf('%s <small>(<acronym title="%s">%s</acronym>)</small><br />',
$val,_('This is a structural ObjectClass and cannot be removed.'),_('structural'));
<input type="hidden" name="<?php echo $input_name; ?>" id="<?php echo $input_id; ?>" value="<?php echo htmlspecialchars($val); ?>" />
if ($side == 'dst')
printf('<input type="hidden" name="%s" id="%s" value="%s" />',$input_name,$input_id,htmlspecialchars($val));
<?php }
continue;
continue;
}
}
if (is_dn_string($val) || $ldapserver->isDNAttr($attr)) { ?>
if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
printf('<a title="%s" href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s"><img style="vertical-align: top" src="images/go.png" /></a>',
sprintf(_('Go to %s'),htmlspecialchars($val)),$ldapserver->server_id,rawurlencode($val));
<a title="<?php echo sprintf(_('Go to %s'),htmlspecialchars($val)); ?>" href="cmd.php?cmd=template_engine&server_id=<?php echo $ldapserver->server_id; ?>&amp;dn=<?php echo rawurlencode($val); ?>"><img style="vertical-align: top" src="images/go.png" /></a>
elseif (is_mail_string($val))
printf('<a href="mailto:%s><img style="vertical-align: center" src="images/mail.png" /></a>',htmlspecialchars($val));
<?php } elseif (is_mail_string($val)) { ?>
<a href="mailto:<?php echo htmlspecialchars($val); ?>"><img style="vertical-align: center" src="images/mail.png" /></a>
<?php } elseif (is_url_string($val)) { ?>
<a href="<?php echo htmlspecialchars($val); ?>" target="new"><img style="vertical-align: center" src="images/dc.png" /></a>
<?php }
elseif (is_url_string($val))
printf('<a href="%s" target="new"><img style="vertical-align: center" src="images/dc.png" /></a>',htmlspecialchars($val));
if ($ldapserver->isMultiLineAttr($attr,$val)) {
if ($side == 'dst') {?>
<textarea class="val" rows="3" cols="30" name="<?php echo $input_name; ?>" id="<?php echo $input_id; ?>"><?php echo htmlspecialchars($val); ?></textarea>
<?php } else {
echo htmlspecialchars($val);
}
} else {
if ($side == 'dst') {?>
<input type="text" class="val" name="<?php echo $input_name; ?>" id="<?php echo $input_id; ?>" value="<?php echo htmlspecialchars($val); ?>" />
<?php } else {
echo htmlspecialchars($val);
}
}
// draw a link for popping up the entry browser if this is the type of attribute
// that houses DNs.
if ($ldapserver->isDNAttr($attr))
draw_chooser_link("edit_form.$input_id",false); ?>
<br />
<?php } ?>
</td>
<?php } /* end foreach value */ ?>
</tr>
<?php
/* Draw the "add value" link under the list of values for this attributes */
if (! $ldapserver_dst->isReadOnly()) {
// First check if the required objectClass is in this DN
$isOK = 0;
$src_oclass = array();
$attr_object = $ldapserver_dst->getSchemaAttribute($attr,$dn_dst);
foreach ($attr_object->used_in_object_classes as $oclass) {
if (in_array(strtolower($oclass),arrayLower($attrs_dst['objectClass']))) {
$isOK = 1;
break;
} else {
// Find oclass that the source has that provides this attribute.
if (in_array($oclass,$attrs_src['objectClass']))
$src_oclass[] = $oclass;
}
}
print "<tr><td colspan=2></td><td colspan=2>&nbsp</td><td>&nbsp;</td><td>";
if (! $isOK) {
if (count($src_oclass) == 1) {
$add_href = sprintf('cmd.php?cmd=add_oclass_form&server_id=%s&dn=%s&new_oclass=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,$src_oclass[0]);
} else {
$add_href = sprintf('cmd.php?cmd=add_value_form&server_id=%s&dn=%s&attr=objectClass',
$ldapserver_dst->server_id,$encoded_dn_dst);
}
if ($attr == 'objectClass')
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,_('Add ObjectClass and Attributes'),_('add value'));
if ($side == 'dst')
printf('<textarea class="value" rows="3" cols="30" name="%s" id="%s">%s</textarea>',$input_name,$input_id,htmlspecialchars($val));
else
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,sprintf(_('You need one of the following ObjectClass(es) to add this attribute %s.'),implode(" ",$src_oclass)),_('Add new ObjectClass'));
echo htmlspecialchars($val);
} else {
if (! $schema_attr_dst->getIsSingleValue() || (! isset($vals))) {
if ($side == 'dst')
printf('<input type="text" class="value" name="%s" id="%s" value="%s" />',$input_name,$input_id,htmlspecialchars($val));
else
echo htmlspecialchars($val);
}
$add_href = sprintf('cmd.php?cmd=add_value_form&server_id=%s&dn=%s&attr=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,rawurlencode($attr));
# draw a link for popping up the entry browser if this is the type of attribute that houses DNs.
if ($ldapserver->isDNAttr($attr))
draw_chooser_link("edit_form.$input_id",false);
printf('<div class="add_value">(<a href="%s" title="%s">%s</a>)</div>',
$add_href,sprintf(_('Add an additional value to attribute \'%s\''),$attr),_('add value'));
}
echo '<br />';
}
echo '</td>';
} /* end foreach value */
echo '</tr>';
# Draw the "add value" link under the list of values for this attributes
if (! $ldapserver_dst->isReadOnly()) {
# First check if the required objectClass is in this DN
$isOK = 0;
$src_oclass = array();
$attr_object = $ldapserver_dst->getSchemaAttribute($attr,$dn_dst);
foreach ($attr_object->used_in_object_classes as $oclass) {
if (in_array(strtolower($oclass),arrayLower($attrs_dst['objectClass']))) {
$isOK = 1;
break;
} else {
# Find oclass that the source has that provides this attribute.
if (in_array($oclass,$attrs_src['objectClass']))
$src_oclass[] = $oclass;
}
}
print "</td></tr>"; ?>
echo '<tr><td colspan=2></td><td colspan=2>&nbsp;</td><td>&nbsp;</td><td>';
if (! $isOK) {
</td>
if (count($src_oclass) == 1)
$add_href = sprintf('cmd.php?cmd=add_oclass_form&amp;server_id=%s&amp;dn=%s&amp;new_oclass=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,$src_oclass[0]);
else
$add_href = sprintf('cmd.php?cmd=add_value_form&amp;server_id=%s&amp;dn=%s&amp;attr=objectClass',
$ldapserver_dst->server_id,$encoded_dn_dst);
</tr>
if ($attr == 'objectClass')
printf('<div class="add_value">(<a href="%s" title="%s">%s</a>)</div>',$add_href,_('Add ObjectClass and Attributes'),_('add value'));
else
printf('<div class="add_value">(<a href="%s" title="%s">%s</a>)</div>',
$add_href,sprintf(_('You need one of the following ObjectClass(es) to add this attribute %s.'),implode(" ",$src_oclass)),
_('Add new ObjectClass'));
<?php } /* End foreach ($attrs as $attr => $vals) */
} else {
if (! $schema_attr_dst->getIsSingleValue() || (! isset($vals))) {
if (! $ldapserver_dst->isReadOnly()) { ?>
$add_href = sprintf('cmd.php?cmd=add_value_form&amp;erver_id=%s&amp;dn=%s&amp;attr=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,rawurlencode($attr));
<td colspan="2">&nbsp</td><td colspan=2><center><input type="submit" value="<?php echo _('Save Changes'); ?>" /></center></td></tr></form>
printf('<div class="add_value">(<a href="%s" title="%s">%s</a>)</div>',
$add_href,sprintf(_('Add an additional value to attribute \'%s\''),$attr),_('add value'));
}
}
}
<?php } ?>
echo '</td></tr>';
</table>
# Get the values and see if they are the same.
if (isset($attrs_src[$attr]) && isset($attrs_dst[$attr]) && $attrs_src[$attr] === $attrs_dst[$attr])
echo '<tr>';
else
echo '<tr class="updated"><td class="bottom" colspan="0">&nbsp;</td></tr>';
<?php /* If this entry has a binary attribute,we need to provide a form for it to submit when deleting it. */ ?>
} /* End foreach ($attrs as $attr => $vals) */
<script language="javascript">
if (! $ldapserver_dst->isReadOnly())
printf('<tr><td colspan=3>&nbsp;</td><td colspan=3><center><input type="submit" value="%s" /></center></form></td></tr>',_('Save Changes'));
echo '</table>';
# If this entry has a binary attribute,we need to provide a form for it to submit when deleting it. */
?>
<script type="text/javascript" language="javascript">
//<!--
function deleteAttribute(attrName)
{

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.26 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.26.2.1 2008/01/13 05:37:00 wurley Exp $
/**
* delete_form.php
@ -40,7 +40,7 @@ if (count($entry['children'])) {
$search['href'] = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&;server_id=%s&filter=%s&base_dn=%s&form=advanced&scope=sub',
$ldapserver->server_id,rawurlencode('objectClass=*'),rawurlencode($entry['dn']['string'])));
echo '<table class="delete" border=0>';
echo '<table class="forminput" border=0>';
echo '<tr>';
echo '<td colspan=2>';
printf(_('This entry is the root of a sub-tree containing %s entries.'),$search['count']);
@ -65,7 +65,7 @@ if (count($entry['children'])) {
echo '<input type="hidden" name="cmd" value="rdelete" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" class="scary" value="%s" />',sprintf(_('Delete all %s objects'),$search['count']));
printf('<input type="submit" value="%s" />',sprintf(_('Delete all %s objects'),$search['count']));
echo '</form>';
echo '</center></td>';
@ -74,7 +74,7 @@ if (count($entry['children'])) {
echo '<input type="hidden" name="cmd" value="template_engine" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
printf('<input type="submit" name="submit" value="%s" />',_('Cancel'));
echo '</form>';
echo '</center></td>';
echo '</tr>';
@ -97,7 +97,7 @@ if (count($entry['children'])) {
echo "\n";
} else {
echo '<table class="delete" border=0>';
echo '<table class="forminput" border=0>';
printf('<tr><td colspan=4>%s</td></tr>',_('Are you sure you want to permanently delete this object?'));
echo '<tr><td colspan=4>&nbsp;</td></tr>';
@ -114,7 +114,7 @@ if (count($entry['children'])) {
echo '<input type="hidden" name="cmd" value="delete" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="scary" />',_('Delete'));
printf('<input type="submit" name="submit" value="%s" />',_('Delete'));
echo '</form>';
echo '</center></td>';
@ -124,7 +124,7 @@ if (count($entry['children'])) {
echo '<input type="hidden" name="cmd" value="template_engine" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
printf('<input type="submit" name="submit" value="%s" />',_('Cancel'));
echo '</form>';
echo '</center></td>';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.31.2.2 2007/12/29 08:24:10 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.31.2.3 2008/01/13 05:37:00 wurley Exp $
/**
* Display a selection (popup window) to pick a DN.
@ -15,8 +15,8 @@ $entry['element'] = get_request('form_element','GET');
$entry['rdn'] = get_request('rdn','GET');
echo '<body>';
echo '<div class="entry_chooser">';
printf('<h3>%s</h3>',_('Entry Chooser'));
echo '<div class="popup">';
printf('<h3 class="subtitle">%s</h3>',_('Entry Chooser'));
?>
<script type="text/javascript" language="javascript">
@ -27,11 +27,11 @@ printf('<h3>%s</h3>',_('Entry Chooser'));
</script>
<?php
echo '<table class="entry_chooser" border=0>';
echo '<table class="forminput" width=100% border=0>';
if ($entry['container']) {
printf('<tr><td class="head" colspan=3>%s:</td><td class="value">%s</td></tr>',_('Server'),htmlspecialchars($ldapserver->name));
printf('<tr><td class="head" colspan=3>%s:</td><td class="value">%s</td></tr>',_('Looking in'),htmlspecialchars($entry['container']));
echo '<tr><td class="spacer" colspan=4>&nbsp;</td></tr>';
printf('<tr><td class="heading" colspan=3>%s:</td><td>%s</td></tr>',_('Server'),htmlspecialchars($ldapserver->name));
printf('<tr><td class="heading" colspan=3>%s:</td><td>%s</td></tr>',_('Looking in'),htmlspecialchars($entry['container']));
echo '<tr><td class="blank" colspan=4>&nbsp;</td></tr>';
}
/* Has the use already begun to descend into a specific server tree? */
@ -60,13 +60,13 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
}
echo '<tr>';
echo '<td class="spacer">&nbsp;</td>';
echo '<td class="blank">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="images/up.png" alt="Up" /></a></td>',$href['up']);
printf('<td class="value" colspan=2><a href="%s">%s</a></td>',$href['up'],_('Back Up...'));
printf('<td colspan=2><a href="%s">%s</a></td>',$href['up'],_('Back Up...'));
echo '</tr>';
if (! count($entry['children']))
printf('<td class="spacer" colspan=2>&nbsp;</td><td class="body" colspan=2">(%s)</td>',_('no entries'));
printf('<td class="blank" colspan=2>&nbsp;</td><td colspan=2">(%s)</td>',_('no entries'));
else
foreach ($entry['children'] as $dn) {
@ -75,10 +75,10 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
$ldapserver->server_id,$entry['element'],$entry['rdn'],rawurlencode($dn)));
echo '<tr>';
echo '<td class="spacer">&nbsp;</td>';
echo '<td class="blank">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="images/plus.png" alt="Plus" /></a></td>',$href['expand']);
printf('<td colspan=2 class="body"><a href="%s">%s</a></td>',$href['return'],htmlspecialchars($dn));
printf('<td colspan=2><a href="%s">%s</a></td>',$href['return'],htmlspecialchars($dn));
echo '</tr>';
echo "\n\n";
}
@ -95,10 +95,10 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
continue;
else {
printf('<tr><td class="head" colspan=3>%s:</td><td class="value">%s</td></tr>',_('Server'),htmlspecialchars($ldapserver->name));
printf('<tr><td class="heading" colspan=3>%s:</td><td class="heading">%s</td></tr>',_('Server'),htmlspecialchars($ldapserver->name));
foreach ($ldapserver->getBaseDN() as $dn) {
if (! $dn) {
printf('<tr><td class="spacer">&nbsp;</td><td class="body" colspan=3>(%s)</td></tr>',_('Could not determine base DN'));
printf('<tr><td class="blank">&nbsp;</td><td colspan=3>(%s)</td></tr>',_('Could not determine base DN'));
} else {
$href['return'] = sprintf("javascript:returnDN('%s%s')",($entry['rdn'] ? sprintf('%s,',$entry['rdn']) : ''),rawurlencode($dn));
@ -106,13 +106,13 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
$ldapserver->server_id,$entry['element'],$entry['rdn'],rawurlencode($dn)));
echo '<tr>';
echo '<td class="spacer">&nbsp;</td>';
echo '<td class="blank">&nbsp;</td>';
printf('<td colspan=2 class="icon"><a href="%s"><img src="images/plus.png" alt="Plus" /></a></td>',$href['expand']);
printf('<td colspan=2 class="body"><a href="%s">%s</a></td>',$href['return'],htmlspecialchars($dn));
printf('<td colspan=2><a href="%s">%s</a></td>',$href['return'],htmlspecialchars($dn));
}
}
echo '<tr><td class="spacer" colspan=4>&nbsp;</td></tr>';
echo '<tr><td class="blank" colspan=4>&nbsp;</td></tr>';
}
}
}
@ -120,5 +120,5 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
echo '</table>';
echo '</div>';
echo '</body></html>';
echo '</body>';
?>

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.26 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.26.2.1 2008/01/13 05:37:01 wurley Exp $
/**
* export_form.php
@ -38,7 +38,7 @@ echo '<br />';
echo '<center>';
echo '<form name="export_form" action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="export" />';
echo '<table class="export">';
echo '<table class="forminput">';
echo '<tr>';
echo '<td>';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.27.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.27.2.2 2008/01/27 11:57:38 wurley Exp $
/**
* @package phpLDAPadmin
@ -35,30 +35,30 @@ if (isset($_SESSION[APPCONFIG]))
$css = $_SESSION[APPCONFIG]->GetValue('appearance','stylesheet');
else
$css = 'style.css';
printf('<link type="text/css" rel="stylesheet" href="%s%s" media="screen" />','../htdocs/'.CSSDIR,$css);
printf('<link type="text/css" rel="stylesheet" href="%s%s" media="screen" />',CSSDIR,$css);
if (isset($server_id)) {
$custom_file = get_custom_file($server_id,'style.css','../htdocs/'.CSSDIR);
$custom_file = get_custom_file($server_id,'style.css',CSSDIR);
if (strcmp($custom_file,'style.css') != 0)
printf('<link type="text/css" rel="stylesheet" href="%s" media="screen" />',$custom_file);
}
printf('<script type="text/javascript" src="%sentry_chooser.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sie_png_work_around.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sgeneric_utils.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sto_ascii.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%smodify_member.js"></script>','../htdocs/'.JSDIR);
printf('<link type="text/css" rel="stylesheet" media="all" href="%s/jscalendar/calendar-blue.css" title="blue" />','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sentry_chooser.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sie_png_work_around.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sgeneric_utils.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sto_ascii.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%smodify_member.js"></script>',JSDIR);
printf('<link type="text/css" rel="stylesheet" media="all" href="%s/jscalendar/calendar-blue.css" title="blue" />',JSDIR);
echo "\n<!--\n";
printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/lang/calendar-en.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar-setup.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sdate_selector.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/lang/calendar-en.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar-setup.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sdate_selector.js"></script>',JSDIR);
echo "\n-->\n";
printf('<link type="text/css" rel="stylesheet" href="%s/phplayersmenu/layerstreemenu.css"></link>','../htdocs/'.JSDIR);
printf('<link type="text/css" rel="stylesheet" href="%s/phplayersmenu/layerstreemenu.css"></link>',JSDIR);
if (isset($meta_refresh_variable))
printf('<meta http-equiv="refresh" content="%s" />',$meta_refresh_variable);

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.49.2.4 2008/01/04 12:33:03 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.49.2.5 2008/01/12 10:01:28 wurley Exp $
/**
* @package phpLDAPadmin
@ -50,7 +50,7 @@ else
# Make sure this PHP install has gettext, we use it for language translation
if (! extension_loaded('gettext'))
pla_error('<p>Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>');
error('<p>Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>','error',true);
/**
* Helper functions.
@ -59,10 +59,10 @@ if (! extension_loaded('gettext'))
if (isset($app['function_files']) && is_array($app['function_files']))
foreach ($app['function_files'] as $file_name ) {
if (! file_exists($file_name))
pla_error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name));
error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name),'error',true);
if (! is_readable($file_name))
pla_error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name));
error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name),'error',true);
ob_start();
require $file_name;
@ -71,29 +71,10 @@ if (isset($app['function_files']) && is_array($app['function_files']))
# Configuration File check
if (! file_exists($app['config_file'])) {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"';
echo '"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">';
echo '<html>';
echo '<head>';
printf('<title>%s - %s</title>','phpLDAPadmin',pla_version());
echo '<link type="text/css" rel="stylesheet" href="css/style.css" />';
echo '</head>';
echo '<body>';
printf('<h3 class="title">Configure %s</h3>','phpLDAPadmin');
echo '<br /><br />';
echo '<center>';
printf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),'phpLDAPadmin',$app['config_file'],$app['config_file']);
echo '</center>';
echo '</body>';
echo '</html>';
die();
error(sprintf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),'phpLDAPadmin',$app['config_file'],$app['config_file']),'error',true);
} elseif (! is_readable($app['config_file'])) {
pla_error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']));
error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',true);
}
# If our config file fails the sanity check, then stop now.

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.35.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.35.2.2 2008/01/28 12:58:43 wurley Exp $
/**
* Imports an LDIF file to the specified server_id.
@ -113,10 +113,10 @@ if ($entry['continuous_mode']) {
if ($ldapWriter->ldapModify($currentEntry))
printf(' <span style="color:green;">%s</span></small><br />',_('Success'));
else {
printf('<span style="color:red;">%s</span></small><br />',_('Failed'));
printf('<small><span style="color:red;">%s: %s</span></small><br />',
printf(' <span style="color:red;">%s</span></small><br />',_('Failed'));
printf(' <small><span style="color:red;">%s: %s</span></small><br />',
_('Error code'),$ldapserver->errno());
printf('<small><span style="color:red;">%s: %s</span></small><br />',
printf(' <small><span style="color:red;">%s: %s</span></small><br />',
_('Description'),$ldapserver->error());
}
}

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import_form.php,v 1.22 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import_form.php,v 1.22.2.1 2008/01/13 05:43:13 wurley Exp $
/**
* Displays a form to allow the user to upload and import
@ -18,30 +18,32 @@ if (! ini_get('file_uploads'))
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
printf('<h3 class="title">%s</h3>',_('Import LDIF File'));
printf('<h3 class="subtitle">%s: <b>%s</b></h3>',_('Server'),htmlspecialchars($ldapserver->name));
echo '<br /><br />';
echo _('Select an LDIF file');
echo '<br /><br />';
printf('<h3 class="title" colspan=0>%s</h3>',_('Import LDIF File'));
printf('<h3 class="subtitle" colspan=0>%s: <b>%s</b></h3>',_('Server'),htmlspecialchars($ldapserver->name));
echo '<center>';
echo '<form action="cmd.php" method="post" class="new_value" enctype="multipart/form-data">';
echo '<input type="hidden" name="cmd" value="ldif_import" />';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
echo '<input type="file" name="ldif_file" /> <br />';
printf('<div style="margin-top: 5px;"><input type="checkbox" name="continuous_mode" value="1" /><span style="font-size: 90%%;">%s</span></div>',
echo '<input type="hidden" name="cmd" value="ldif_import" />';
echo '<table class="forminput" border=0>';
echo '<tr><td colspan=2>&nbsp;</td></tr>';
echo '<tr>';
printf('<td>%s</td>',_('Select an LDIF file'));
echo '<td>';
echo '<input type="file" name="ldif_file" />';
echo '</td></tr>';
printf('<tr><td>&nbsp;</td><td class="small"><b>%s %s</b></td></tr>',_('Maximum file size'),ini_get('upload_max_filesize'));
echo '<tr><td colspan=2>&nbsp;</td></tr>';
printf('<tr><td>%s</td></tr>',_('Or paste your LDIF here'));
echo '<tr><td colspan=2><textarea name="ldif" rows="20" cols="60"></textarea></td></tr>';
echo '<tr><td colspan=2>&nbsp;</td></tr>';
printf('<tr><td>&nbsp;</td><td class="small"><input type="checkbox" name="continuous_mode" value="1" />%s</td></tr>',
_("Don't stop on errors"));
printf('<div style="margin-top:10px;"><input type="submit" value="%s" /></div>',_('Proceed >>'));
printf('<br /><small><b>%s %s</b></small><br />',_('Maximum file size'),ini_get('upload_max_filesize'));
echo '</form>';
echo '<br /><br />';
echo _('Paste your LDIF here');
echo '<form action="cmd.php" method="post" class="new_value" enctype="multipart/form-data">';
echo '<input type="hidden" name="cmd" value="ldif_import" />';
echo '<textarea name="ldif" rows="10" cols="60"></textarea>';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<div style="margin-top: 5px;"><input type="checkbox" name="continuous_mode" value="1" /><span style="font-size: 90%%;">%s</span></div>',_("Don't stop on errors"));
printf('<div style="margin-top:10px;"><input type="submit" value="%s" /></div>',_('Proceed >>'));
printf('<tr><td>&nbsp;</td><td><input type="submit" value="%s" /></td></tr>',_('Proceed >>'));
echo '</table>';
echo '</form>';
echo '</center>';
?>

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.29.2.2 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.29.2.4 2008/01/13 05:37:01 wurley Exp $
/**
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
@ -40,18 +40,18 @@ if (isset($_GET['redirect']))
printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode($_GET['redirect']));
echo '<center>';
echo '<table class="login">';
echo '<table class="forminput">';
printf('<tr><td><b>%s:</b></td></tr>',
$ldapserver->login_attr == 'dn' ? _('Login DN') : $_SESSION[APPCONFIG]->getFriendlyName($ldapserver->login_attr));
printf('<tr><td><input type="text" id="pla_login" name="%s" size="40" value="%s" /></td></tr>',
printf('<tr><td><input type="text" id="login" name="%s" size="40" value="%s" /></td></tr>',
$ldapserver->login_attr,
$ldapserver->login_attr == 'dn' ? $ldapserver->login_dn : '');
echo '<tr><td colspan=2>&nbsp;</td></tr>';
printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
echo '<tr><td><input type="password" id="pla_pass" size="40" value="" name="login_pass" /></td></tr>';
echo '<tr><td><input type="password" id="password" size="40" value="" name="login_pass" /></td></tr>';
echo '<tr><td colspan=2>&nbsp;</td></tr>';
# If Anon bind allowed, then disable the form if the user choose to bind anonymously.
@ -66,18 +66,18 @@ echo '</table>';
echo '</center>';
echo '</form>';
echo '<script type="text/javascript" language="javascript">document.getElementById(\'pla_login\').focus()</script>';
echo '<script type="text/javascript" language="javascript">document.getElementById(\'login\').focus()</script>';
if( $ldapserver->isAnonBindAllowed() ) { ?>
<script type="text/javascript" language="javascript">
<!--
function toggle_disable_login_fields(anon_checkbox) {
if (anon_checkbox.checked) {
anon_checkbox.form.<?php echo $ldapserver->isLoginAttrEnabled() ? 'uid' : 'login_dn'; ?>.disabled = true;
anon_checkbox.form.<?php echo $ldapserver->login_attr; ?>.disabled = true;
anon_checkbox.form.login_pass.disabled = true;
} else {
anon_checkbox.form.<?php echo $ldapserver->isLoginAttrEnabled() ? 'uid' : 'login_dn'; ?>.disabled = false;
anon_checkbox.form.<?php echo $ldapserver->isLoginAttrEnabled() ? 'uid' : 'login_dn'; ?>.focus();
anon_checkbox.form.<?php echo $ldapserver->login_attr; ?>.disabled = false;
anon_checkbox.form.<?php echo $ldapserver->login_attr; ?>.focus();
anon_checkbox.form.login_pass.disabled = false;
}
}

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.17.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.17.2.2 2008/01/13 05:37:01 wurley Exp $
/**
* Enables user to mass delete multiple entries using checkboxes.
@ -104,7 +104,7 @@ if ($confirmed == true) {
printf('<input type="hidden" name="mass_delete[%s]" value="on" /><li>%s</li>',htmlspecialchars($dn),htmlspecialchars($dn));
echo '</ol></td></tr></table>';
printf('<input class="scary" type="submit" value="%s" /></center>',_('Yes, delete!'));
printf('<input type="submit" value="%s" /></center>',_('Yes, delete!'));
echo '</form>';
}
?>

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/password_checker.php,v 1.10 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/password_checker.php,v 1.10.2.1 2008/01/13 05:37:01 wurley Exp $
/**
* @package phpLDAPadmin
@ -8,11 +8,13 @@
*/
require './common.php';
include './header.php';
include HTDOCDIR.'header.php';
echo '<body>';
$entry['hash'] = get_request('hash','REQUEST');
$entry['password'] = get_request('check_password','REQUEST');
$entry['action'] = get_request('action','REQUEST');
$entry['componentid'] = get_request('componentid','REQUEST');
if (get_request('base64','REQUEST')) {
$entry['hash'] = base64_decode($entry['hash']);
@ -21,23 +23,23 @@ if (get_request('base64','REQUEST')) {
$entry['enc_type'] = get_enc_type($entry['hash']);
echo '<div class="password_checker">';
echo '<div class="popup">';
printf('<h3 class="subtitle">%s</h3>',_('Password Checker Tool'));
echo '<form action="password_checker.php" method="post">';
echo '<input type="hidden" name="action" value="compare" />';
echo '<table class="password_checker" border=0>';
echo '<table class="forminput" width=100% border=0>';
echo '<tr>';
printf('<td class="head">%s</td>',_('Compare'));
printf('<td class="body"><input type="%s" name="hash" id="hash" value="%s" /></td>',
printf('<td class="heading">%s</td>',_('Compare'));
printf('<td><input type="%s" name="hash" id="hash" value="%s" /></td>',
$entry['enc_type'] ? 'text' : 'password',htmlspecialchars($entry['hash']));
echo '</tr>';
echo '<tr>';
printf('<td class="head">%s</td>',_('To'));
printf('<td class="body"><input type="password" name="check_password" value="%s" /></td>',
printf('<td class="heading">%s</td>',_('To'));
printf('<td><input type="password" name="check_password" value="%s" /></td>',
htmlspecialchars($entry['password']));
echo '</tr>';
@ -62,10 +64,11 @@ echo '</tr>';
echo '</table>';
echo '</form>';
echo '</div>';
echo '</body>';
if (isset($_REQUEST['componentid'])) {
if ($entry['componentid']) {
echo '<script language="javascript">';
printf('var c = window.opener.document.getElementById(\'%s\');', $_REQUEST['componentid']);
printf('var c = window.opener.document.getElementById(\'%s\');',$entry['componentid']);
printf('var h = document.getElementById(\'%s\');', 'hash');
echo 'if (c && h) { h.value = c.value; }';
echo '</script>';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename_form.php,v 1.11 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename_form.php,v 1.11.2.1 2008/01/13 05:37:01 wurley Exp $
/**
* Displays a form for renaming an LDAP entry.
@ -28,10 +28,10 @@ printf('<h3 class="title">%s <b>%s</b></h3>',_('Rename Entry'),htmlspecialchars(
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn));
echo '<br /><center><form action="cmd.php?cmd=rename" method="post" class="edit_dn" />';
echo '<br /><center><form action="cmd.php?cmd=rename" method="post" />';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
printf('<input type="text" name="new_rdn" size="30" value="%s" />',htmlspecialchars($rdn));
printf('<input class="update_dn" type="submit" value="%s" />',_('Rename'));
printf('<input type="submit" value="%s" />',_('Rename'));
echo '</form></center>';
?>

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.4 2008/01/28 20:58:08 wurley Exp $
/**
* Displays the schema for the specified server_id
@ -38,10 +38,10 @@ printf('<h3 class="title">%s <b>%s</b></h3>',
htmlspecialchars($ldapserver->name));
$entry['schema_types'] = array(
'objectClasses'=>'ObjectClasses',
'attributes'=>'Attribute Types',
'syntaxes'=>'Syntaxes',
'matching_rules'=>'Matching Rules');
'objectClasses'=>_('ObjectClasses'),
'attributes'=>_('Attribute Types'),
'syntaxes'=>_('Syntaxes'),
'matching_rules'=>_('Matching Rules'));
echo '<br />';
echo '<center>';
@ -65,8 +65,9 @@ switch($entry['view']) {
case 'syntaxes':
$highlight_oid = isset($_GET['highlight_oid']) ? $_GET['highlight_oid'] : false;
print '<table class="schema" border=0>';
printf('<tr class="name"><td>%s</td><td>%s</td></tr>',_('Syntax OID'),_('Description'));
echo '<center>';
print '<table class="result_table" border=0>';
printf('<tr class="heading"><td>%s</td><td>%s</td></tr>',_('Syntax OID'),_('Description'));
$counter = 1;
@ -85,10 +86,11 @@ switch($entry['view']) {
else
printf('<tr class="%s">',$counter%2==0?'even':'odd');
printf('<td class="type">%s</td><td class="type">%s</td></tr>',$oid,$desc);
printf('<td>%s</td><td>%s</td></tr>',$oid,$desc);
}
print '</table>';
echo '</center>';
break;
case 'attributes':
@ -137,8 +139,8 @@ switch($entry['view']) {
if (! is_null($entry['value']))
$entry['viewed'] = true;
echo '<table class="schema" border=0>';
printf('<tr class="name"><td colspan=2><a name="%s">%s</a></td></tr>',
echo '<table class="result_table" width=100% border=0>';
printf('<tr class="heading"><td colspan=2><a name="%s">%s</a></td></tr>',
strtolower($attr->getName()),$attr->getName());
$counter = 0;
@ -146,7 +148,7 @@ switch($entry['view']) {
foreach ($entry['attr_types'] as $item => $value) {
printf('<tr class="%s">',++$counter%2 ? 'odd' : 'even');
printf('<td class="type">%s</td>',$value);
printf('<td class="title">%s</td>',$value);
switch ($item) {
case 'desc':
@ -156,7 +158,7 @@ switch($entry['view']) {
print '</tr>';
printf('<tr class="%s">',++$counter%2 ? 'odd' : 'even');
echo '<td class="type"><acronym title="Object Identier">OID</acronym></td>';
echo '<td class="title"><acronym title="Object Identier">OID</acronym></td>';
printf('<td>%s</td>',$attr->getOID());
break;
@ -311,8 +313,8 @@ switch($entry['view']) {
printf('<input type="submit" value="%s" />',_('Go'));
print '</form>';
print '<table class="schema" border=0>';
printf('<tr class="name"><td>%s</td><td>%s</td><td>%s</td></tr>',
print '<table class="result_table" width=100% border=0>';
printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td></tr>',
_('Matching Rule OID'),_('Name'),_('Used by Attributes'));
$counter = 1;
@ -334,22 +336,22 @@ switch($entry['view']) {
$desc .= sprintf(' <span style="color:red">%s</span>',_('Obsolete'));
printf('<tr class="%s">',$counter%2 ? 'odd' : 'even');
printf('<td class="type">%s</td>',$oid);
printf('<td class="type">%s</td>',$desc);
printf('<td>%s</td>',$oid);
printf('<td>%s</td>',$desc);
print '<td class="type">';
print '<td>';
if (count($rule->getUsedByAttrs()) == 0) {
printf('<center>(%s)</center><br /><br />',_('none'));
} else {
print '<table width=100% border=0><tr><td style="text-align: right">';
print '<table width=100% border=0><tr><td>';
print '<form action="cmd.php" method="get">';
print '<input type="hidden" name="cmd" value="schema" />';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
print '<input type="hidden" name="view" value="attributes" />';
print '<select style="width: 150px; color:black; background-color: #eee" size="4" name="viewvalue">';
print '<select size="4" name="viewvalue">';
foreach ($rule->getUsedByAttrs() as $attr)
printf('<option>%s</option>',$attr);
print '</select><br />';
@ -395,19 +397,19 @@ switch($entry['view']) {
if (! is_null($entry['value']))
$entry['viewed'] = true;
echo '<table class="schema_oclass" border=0>';
printf('<tr class="name"><td colspan=4><a name="%s">%s</a></td></tr>',$name,$oclass->getName());
printf('<tr class="detail"><td colspan=4>%s: <b>%s</b></td></tr>',_('OID'),$oclass->getOID());
echo '<table class="result_table" width=100% border=0>';
printf('<tr class="heading"><td colspan=4><a name="%s">%s</a></td></tr>',$name,$oclass->getName());
printf('<tr class="odd"><td colspan=4>%s: <b>%s</b></td></tr>',_('OID'),$oclass->getOID());
if ($oclass->getDescription())
printf('<tr class="detail"><td colspan=4>%s: <b>%s</b></td></tr>',_('Description'),$oclass->getDescription());
printf('<tr class="odd"><td colspan=4>%s: <b>%s</b></td></tr>',_('Description'),$oclass->getDescription());
printf('<tr class="detail"><td colspan=4>%s: <b>%s</b></td></tr>',_('Type'),$oclass->getType());
printf('<tr class="odd"><td colspan=4>%s: <b>%s</b></td></tr>',_('Type'),$oclass->getType());
if ($oclass->getIsObsolete())
printf('<tr class="detail"><td colspan=4>%s</td></tr>',_('This objectClass is obsolete.'));
printf('<tr class="odd"><td colspan=4>%s</td></tr>',_('This objectClass is obsolete.'));
printf('<tr class="detail"><td colspan=4>%s: <b>',_('Inherits from'));
printf('<tr class="odd"><td colspan=4>%s: <b>',_('Inherits from'));
if (count($oclass->getSupClasses()) == 0)
printf('(%s)',_('none'));
@ -423,7 +425,7 @@ switch($entry['view']) {
}
echo '</b></td></tr>';
printf('<tr class="detail"><td colspan=4>%s: <b>',_('Parent to'));
printf('<tr class="odd"><td colspan=4>%s: <b>',_('Parent to'));
if (strcasecmp($oclass->getName(),'top') == 0) {
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],''));
printf('(<a href="%s">all</a>)',$href);
@ -441,16 +443,15 @@ switch($entry['view']) {
}
echo '</b></td></tr>';
printf('<tr class="attrshead"><td class="left">&nbsp;</td><td><b>%s</b></td><td><b>%s</b></td><td class="right">&nbsp;</td></tr>',
printf('<tr class="even"><td class="blank" rowspan=2>&nbsp;</td><td><b>%s</b></td><td><b>%s</b></td><td class="blank" rowspan=2>&nbsp;</td></tr>',
_('Required Attributes'),_('Optional Attributes'));
echo '<tr class="attrs">';
echo '<td class="left">&nbsp;</td>';
echo '<tr class="odd">';
echo '<td>';
if (count($oclass->getMustAttrs($schema_oclasses)) > 0) {
echo '<ul class="schema">';
echo '<ul class="list">';
foreach ($oclass->getMustAttrs($schema_oclasses) as $attr) {
echo '<li>';
$href = htmlspecialchars(sprintf($entry['href']['attributes'],strtolower($attr->getName())));
@ -473,7 +474,7 @@ switch($entry['view']) {
if (count($oclass->getMayAttrs($schema_oclasses)) > 0) {
echo '<ul class="schema">';
echo '<ul class="list">';
foreach ($oclass->getMayAttrs($schema_oclasses) as $attr) {
echo '<li>';
$href = htmlspecialchars(sprintf($entry['href']['attributes'],strtolower($attr->getName())));
@ -492,7 +493,6 @@ switch($entry['view']) {
printf('(%s)',_('none'));
echo '</td>';
echo '<td class="right">&nbsp;</td>';
echo '</tr>';
echo '</table>';
echo '<br />';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.78.2.4 2007/12/29 08:24:10 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.78.2.6 2008/01/27 11:57:38 wurley Exp $
/**
* Perform LDAP searches and draw the advanced/simple search forms
@ -78,7 +78,7 @@ if ($entry['base_dn']['string']) {
if (isset($ldapserver))
$base_dns = $ldapserver->getBaseDN();
printf('<script type="text/javascript" src="%ssearch_util.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%ssearch_util.js"></script>',JSDIR);
echo '<center>';
$entry['command']['as'] = $_SESSION[APPCONFIG]->isCommandAvailable('search','advanced_search');
@ -259,10 +259,10 @@ if ($entry['search']) {
$end_entry = min($start_entry+$size_limit+1,$count+1);
# Search Results Table
echo '<table class="search_result" border=0>';
echo '<table class="result" border=0>';
echo '<tr class="header">';
printf('<td>%s%s <b>%s</b> <small>(%s %s)</small></td>',_('Entries found'),_(':'),
echo '<tr class="heading">';
printf('<td>%s%s <b>%s</b><div class="execution_time">(%s %s)</div></td>',_('Entries found'),_(':'),
number_format($count),$time_elapsed,_('seconds'));
if ($_SESSION[APPCONFIG]->isCommandAvailable('export')) {
@ -387,10 +387,6 @@ if ($entry['search']) {
printf('<center>%s</center>',$pager_html);
}
}
printf('<br /><br /><div class="search_result"><center><small><span style="font-weight:normal;font-size:75%%;">%s <b>%s</b> %s.</span></small></center></div>',
_('Search performed by phpLDAPadmin in'),$time_elapsed,_('seconds'));
}
}
?>

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27.2.2 2008/01/13 05:37:01 wurley Exp $
/**
* Fetches and displays all information that it can from the specified server
@ -72,20 +72,20 @@ if (count($attrs) == 0) {
return;
}
echo '<table class="edit_dn">';
echo '<table class="result" border=0>';
foreach ($attrs as $attr => $values) {
if ($attr == 'dn')
continue;
$schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s',$ldapserver->server_id,$attr);
$schema_href = sprintf('cmd.php?cmd=schema&amp;server_id=%s&amp;view=attributes&amp;viewvalue=%s',$ldapserver->server_id,$attr);
echo '<tr><td class="attr">';
echo '<tr class="list_item"><td class="heading" rowspan=2>';
printf('<a title="'._('Click to view the schema definition for attribute type \'%s\'').'" href="%s">%s</a>',
$attr,$schema_href,htmlspecialchars($attr));
echo '</td></tr>';
echo '<tr><td class="val">';
echo '<table class="edit_dn">';
echo '<tr class="list_item"><td class="blank">&nbsp;</td><td class="value">';
echo '<table class="result" border=0>';
if (is_array($values))
foreach ($values as $value) {
@ -118,7 +118,7 @@ foreach ($attrs as $attr => $values) {
}
else
printf('<tr><td>%s</td></tr>',htmlspecialchars($values));
printf('<tr><td>%s&nbsp;</td></tr>',htmlspecialchars($values));
echo '</table>';
echo '</td></tr>';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.49.2.2 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.49.2.3 2008/01/13 05:37:01 wurley Exp $
/**
* Takes the results of clicking "Save" in template_engine.php and determines which
@ -195,7 +195,7 @@ if (count($entry['values']['new']) > 0) {
echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="update" />';
echo "\n";
echo '<table class="confirm">';
echo '<table class="result_table">';
echo "\n";
printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
@ -278,10 +278,8 @@ if (count($entry['values']['new']) > 0) {
printf('<td><input name="skip_array[%s]" type="checkbox" %s %s/></td>',htmlspecialchars($attr),$input_disabled,$input_onclick);
echo '</tr>'."\n\n";
}
echo '</table>';
echo '</table><table class="form">';
echo '<tr>';
echo '<td>';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',$entry['dn']['string']);
@ -301,25 +299,18 @@ if (count($entry['values']['new']) > 0) {
}
}
printf('<input type="submit" value="%s" class="happy" />',_('Commit'));
echo '</td>';
echo '<td>';
printf('<input type="submit" name="cancel" value="%s" class="scary" />',_('Cancel'));
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<br />';
printf('<input type="submit" value="%s" />',_('Commit'));
printf('<input type="submit" name="cancel" value="%s" />',_('Cancel'));
echo '</form>';
if (count($attr_to_delete) > 0) {
echo '<table class="form"><tr><td><br/>';
echo _('The deletion of objectClass(es)');
echo _(':');
echo ' <b>';
echo implode('</b>, <b>', $oc_to_delete);
echo '</b><br/>';
echo _('will delete the attribute(s)');
echo _(':');
echo ' <b>';
echo '<table class="result_table"><tr>';
printf('<td class="heading">%s%s</td>',_('The deletion of objectClass(es)'),_(':'));
printf('<td class="value"><b>%s</b></td>',implode('</b>, <b>', $oc_to_delete));
echo '</tr><tr>';
printf('<td class="heading">%s%s</td>',_('will delete the attribute(s)'),_(':'));
echo '<td class="value"><b>';
$i = 0;
foreach ($attr_to_delete as $attr) {
if ($i++ != 0) echo '</b>, <b>';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/Entry.php,v 1.2.2.2 2008/01/04 14:31:05 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/Entry.php,v 1.2.2.3 2008/01/27 07:23:43 wurley Exp $
/**
* @package phpLDAPadmin
@ -11,8 +11,8 @@
abstract class Entry {
protected $dn;
# the tree to which the entry belongs
protected $tree;
# the server_id to which the entry belongs
protected $server_id;
# is the entry a leaf ?
private $leaf;
@ -66,15 +66,15 @@ abstract class Entry {
return $attr;
}
public function setTree($tree) {
$this->tree = $tree;
public function setTree($index) {
$this->server_id = $index;
}
private function readChildren($nolimit=false) {
if (DEBUG_ENABLED)
debug_log('Entered with ()',1,__FILE__,__LINE__,__METHOD__);
$ldapserver = ($this->tree ? $this->tree->getLdapServer() : null);
$ldapserver = (isset($this->server_id) ? $_SESSION[APPCONFIG]->ldapservers->Instance($this->server_id) : null);
if (DEBUG_ENABLED)
debug_log('LdapServer (%s)',1,__FILE__,__LINE__,__METHOD__, $ldapserver ? $ldapserver->server_id : -1);
@ -86,18 +86,22 @@ abstract class Entry {
if (DEBUG_ENABLED)
debug_log('Children of (%s) are (%s)',64,__FILE__,__LINE__,__METHOD__,$this->getDn(),$ldap['children']);
if ($this->tree) {
if (isset($this->server_id)) {
$this->reading_children = true;
$tree = get_cached_item($ldapserver->server_id,'tree');
foreach ($ldap['children'] as $dn) {
if (DEBUG_ENABLED)
debug_log('Adding (%s)',64,__FILE__,__LINE__,__METHOD__,$dn);
if (! $this->tree->getEntry($dn))
$this->tree->addEntry($dn);
if (! $tree->getEntry($dn))
$tree->addEntry($dn);
}
set_cached_item($ldapserver->server_id,'tree','null',$tree);
usort($this->children,'pla_compare_dns');
$this->reading_children = false;
}
if (count($this->children) == $ldap['child_limit'])
$this->size_limited = true;
else

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryReader.php,v 1.2.2.1 2007/12/29 08:24:10 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryReader.php,v 1.2.2.3 2008/01/27 14:09:14 wurley Exp $
define('ENTRY_READER_CREATION_CONTEXT', '1');
define('ENTRY_READER_EDITING_CONTEXT', '2');
@ -12,11 +12,11 @@ define('ENTRY_READER_EDITING_CONTEXT', '2');
* Visit an entry and its attributes to initialize their values
*/
class EntryReader extends Visitor {
protected $ldapserver;
protected $index;
protected $context;
public function __construct($ldapserver) {
$this->ldapserver = $ldapserver;
$this->index = $ldapserver->server_id;
$this->context = 0;
}
@ -109,6 +109,7 @@ class EntryReader extends Visitor {
debug_log('Enter with (%s) for attribute (%s)',1,__FILE__,__LINE__,__METHOD__,$attribute,$attribute->getName());
$name = $attribute->getName();
// @todo editing objectclasses
if (($this->context == ENTRY_READER_CREATION_CONTEXT) && ($name == 'objectClass')) return;
@ -140,8 +141,6 @@ class EntryReader extends Visitor {
}
foreach ($new_vals as $i => $new_val) {
//$new_val = trim($new_val); // no trim if binary value
// if the attribute has not been already modified by a post of a previous page
if (!$attribute->hasBeenModified()) {
// if the value has changed (added or modified/deleted)
@ -157,7 +156,6 @@ class EntryReader extends Visitor {
}
// old value deletion
//if (($this->context == ENTRY_READER_EDITING_CONTEXT) && !$attribute->isInternal()) {
if (isset($_POST['old_values'][$name]) && !$attribute->isInternal()) {
for ($i = count($new_vals); $i < count($old_vals); $i++) {
$attribute->addValue('', $i);
@ -220,22 +218,17 @@ class EntryReader extends Visitor {
switch ($matches[1]) {
case 'Password' :
preg_match_all('/%(\w+)(\|.+)?(\/[lU])?%/U',$matches[2],$matchall);
//if (!isset($_POST['enc_type'][$i]) || !$_POST['enc_type'][$i]) {
// pla_error(sprintf(_('Your template is missing variable (%s)'),'enc_type'));
//}
//$enc = $_POST['enc_type'][$i]; //$_REQUEST[$matchall[1][0]];
$enc = $this->get('RequestValue', $attribute, $i, $val, $matchall[1][0]);
$password = $val; //$_REQUEST['form'][$matchall[1][1]];
$password = $val;
if ($password) {
$val = password_hash($password, $enc);
}
break;
case 'SambaPassword' :
$matchall = explode(',',$matches[2]);
//$attr = preg_replace('/%/','',$matchall[1]);
# If we have no password, then dont hash nothing!
if (strlen($val) <= 0) //if (! trim($_REQUEST['form'][$attr]))
if (strlen($val) <= 0)
break;
$sambapassword = new smbHash;
@ -253,15 +246,6 @@ class EntryReader extends Visitor {
$values = array();
foreach ($matchall[1] as $joinattr) {
//$joinattribute = null;
//if ($attribute->getEntry()) {
// $joinattribute = $attribute->getEntry()->getAttribute($joinattr);
//}
//if ($joinattribute) {
// $values = array_merge($values, $joinattribute->getValues());
//} else {
// pla_error(sprintf(_('Your template is missing variable (%s)'),$joinattr));
//}
$values[] = $this->get('RequestValue', $attribute, $i, $val, $joinattr);
}
@ -308,11 +292,10 @@ class EntryReader extends Visitor {
$attribute->addFileName($filename, $i);
foreach ($file as $filepath => $binaries) {
$attribute->addFilePath($filepath, $i);
//$attribute->addValue($binaries, $i);
$bin = $binaries;
}
}
$vals[] = $bin; //$new_val;
$vals[] = $bin;
$i++;
}
}
@ -333,7 +316,7 @@ class EntryReader extends Visitor {
$key = md5("$file_name|$file_path");
$_SESSION['submitform'][$name][$key][$file_name][$file_path] = $binary_data;
$vals[] = $binary_data; //$key;
$vals[] = $binary_data;
$i++;
}
}
@ -365,8 +348,14 @@ class EntryReader extends Visitor {
if ($attribute->hasProperty('post')) {
$val = $this->get('Attribute::PostValue', $attribute, $i, $val);
} elseif (strlen($val) > 0) {
$val = password_hash($val, get_default_hash($this->ldapserver->server_id));
if (isset($_REQUEST['enc'][$attribute->getName()][$i]))
$enc = $_REQUEST['enc'][$attribute->getName()][$i];
else
$enc = get_default_hash($this->index);
$val = password_hash($val, $enc);
}
return $val;
}
@ -398,5 +387,4 @@ class EntryReader extends Visitor {
return $val;
}
}
?>

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter.php,v 1.2 2007/12/15 07:50:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter.php,v 1.2.2.1 2008/01/27 06:48:59 wurley Exp $
define('ENTRY_WRITER_CREATION_CONTEXT', '1');
define('ENTRY_WRITER_EDITING_CONTEXT', '2');
@ -13,7 +13,7 @@ define('ENTRY_WRITER_EDITING_CONTEXT', '2');
*/
class EntryWriter extends Visitor {
# Ldapserver from context
protected $ldapserver;
protected $index;
# Context : creation or editing
protected $context;
@ -27,11 +27,20 @@ class EntryWriter extends Visitor {
protected $visit_attributes;
public function __construct($ldapserver) {
$this->ldapserver = $ldapserver;
$this->index = $ldapserver->server_id;
$this->visit_attributes = true;
$this->context = 0;
}
public function getLDAPServer() {
static $CACHE;
if (! isset($CACHE[$this->index]))
$CACHE[$this->index] = $_SESSION[APPCONFIG]->ldapservers->Instance($this->index);
return $CACHE[$this->index];
}
/**************************/
/* Paint an Entry */
/**************************/

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter1.php,v 1.3.2.6 2008/01/04 14:31:05 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter1.php,v 1.3.2.13 2008/01/28 11:40:16 wurley Exp $
define('IdEntryRefreshMenuItem', '0');
define('IdEntryExportBaseMenuItem', '1');
@ -195,7 +195,7 @@ class EntryWriter1 extends EntryWriter {
$objectclasses_ok = true;
if ($this->step != 1) {
if (!$container || !$this->ldapserver->dnExists($container)) {
if (!$container || !$this->getLDAPServer()->dnExists($container)) {
$container_ok = false;
$this->step = 1;
}
@ -244,7 +244,7 @@ class EntryWriter1 extends EntryWriter {
protected function drawDefaultCreatingEntrySubtitle($entry) {
printf('<h3 class="subtitle">%s%s <b>%s</b></h3>',
_('Server'),_(':'),$this->ldapserver->name);
_('Server'),_(':'),$this->getLDAPServer()->name);
}
protected function drawDefaultCreatingEntryStepTitle($entry, $step) {
@ -277,9 +277,9 @@ class EntryWriter1 extends EntryWriter {
$container = $entry->getContainer();
if ($step == 1) {
printf('<input type="hidden" name="server_id" value="%s" />', $this->ldapserver->server_id);
printf('<input type="hidden" name="server_id" value="%s" />', $this->index);
printf('<input type="hidden" name="step" value="%s" />', $step + 1);
echo '<table class="create" align="center">';
echo '<table class="forminput" align="center">';
$this->draw('ContainerChooser', $entry, $container);
$this->draw('ObjectClassChooser', $entry);
@ -288,9 +288,9 @@ class EntryWriter1 extends EntryWriter {
echo '</table>';
} else {
printf('<input type="hidden" name="container" value="%s" />', htmlspecialchars($container));
printf('<input type="hidden" name="server_id" value="%s" />', $this->ldapserver->server_id);
printf('<input type="hidden" name="server_id" value="%s" />', $this->index);
printf('<input type="hidden" name="step" value="%s" />', $step + 1);
echo '<table class="edit_dn" cellspacing="0" align="center">';
echo '<table class="entry" cellspacing="0" align="center" border=0>';
$this->draw('RdnChooser', $entry);
$this->draw('ShownAttributes', $entry);
@ -332,7 +332,7 @@ class EntryWriter1 extends EntryWriter {
}
protected function drawDefaultCreatingEntryObjectClassChooser($entry) {
$oclasses = $this->ldapserver->SchemaObjectClasses();
$oclasses = $this->getLDAPServer()->SchemaObjectClasses();
if (!$oclasses) $oclasses = array();
elseif (!is_array($oclasses)) $oclasses = array($oclasses);
@ -353,7 +353,7 @@ class EntryWriter1 extends EntryWriter {
echo '</tr>';
if ($_SESSION[APPCONFIG]->GetValue('appearance', 'show_hints')) {
echo '<tr><td>&nbsp;</td><td><small><img src="images/light.png" alt="Hint" /><span class="hint">';
printf('<tr><td>&nbsp;</td><td><small><img src="%s/light.png" alt="Hint" /><span class="hint">',IMGDIR);
echo _('Hint: You must choose exactly one structural objectClass (shown in bold above)');
echo '</span></small><br /></td></tr>';
}
@ -364,7 +364,7 @@ class EntryWriter1 extends EntryWriter {
$rdn_attr = $entry->getRdnAttribute();
printf('<tr><th colspan="2">%s</th></tr>', 'RDN');
echo '<tr><td class="val" colspan="2"><select name="rdn_attribute">';
echo '<tr><td class="value" colspan="2"><select name="rdn_attribute">';
printf('<option value="">%s</option>', _('select the rdn attribute'));
foreach ($attrs as $attr) {
@ -402,7 +402,7 @@ class EntryWriter1 extends EntryWriter {
if (!$has_optional_attrs) {
if (!$has_required_attrs) {
printf('<tr><th colspan="2">%s</th></tr>', _('Required Attributes'));
printf('<tr class="row1"><td colspan="2"><center>(%s)</center></td></tr>', _('none'));
printf('<tr class="noinput"><td colspan="2"><center>(%s)</center></td></tr>', _('none'));
}
printf('<tr><th colspan="2">%s</th></tr>', _('Optional Attributes'));
$has_optional_attrs = true;
@ -415,7 +415,7 @@ class EntryWriter1 extends EntryWriter {
if (!$has_optional_attrs) {
printf('<tr><th colspan="2">%s</th></tr>', _('Optional Attributes'));
printf('<tr class="row1"><td colspan="2"><center>(%s)</center></td></tr>', _('none'));
printf('<tr class="noinput"><td colspan="2"><center>(%s)</center></td></tr>', _('none'));
}
}
@ -447,12 +447,12 @@ class EntryWriter1 extends EntryWriter {
// form start
if (! $entry->isReadOnly()) {
echo '<form action="cmd.php?cmd=update_confirm" method="post" enctype="multipart/form-data" name="entry_form" onSubmit="return submitForm(this)">';
printf('<input type="hidden" name="server_id" value="%s" />',$this->ldapserver->server_id);
printf('<input type="hidden" name="server_id" value="%s" />',$this->index);
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry->getDn()));
}
echo '<br />'."\n\n";
echo '<table class="edit_dn" align="center">';
echo '<table class="entry" align="center" border=0>';
}
public function visitDefaultEditingEntryEnd($entry) {
@ -489,9 +489,9 @@ class EntryWriter1 extends EntryWriter {
protected function initDefaultEditingEntryVisit($entry) {
parent::initDefaultEditingEntryVisit($entry);
$this->url_base = sprintf('cmd.php?server_id=%s&dn=%s', $this->ldapserver->server_id, rawurlencode($entry->getDn()));
$this->hint_layout = '<td class="icon"><img src="images/light.png" alt="'._('Hint').'" /></td><td colspan="3"><span class="hint">%s</span></td>';
$this->action_layout = '<td class="icon"><img src="images/%s" alt="%s" /></td><td><a href="%s" title="%s">%s</a></td>';
$this->url_base = sprintf('cmd.php?server_id=%s&dn=%s', $this->index, rawurlencode($entry->getDn()));
$this->hint_layout = sprintf('<td class="icon"><img src="%s/light.png" alt="%s" /></td><td colspan="3"><span class="hint">%%s</span></td>',IMGDIR,_('Hint'));
$this->action_layout = '<td class="icon"><img src="%s/%s" alt="%s" /></td><td><a href="%s" title="%s">%s</a></td>';
}
protected function drawDefaultEditingEntryTitle($entry) {
@ -506,7 +506,7 @@ class EntryWriter1 extends EntryWriter {
echo _('Server');
echo _(':');
echo ' <b>';
echo $this->ldapserver->name;
echo $this->getLDAPServer()->name;
echo '</b> &nbsp;&nbsp;&nbsp; ';
echo _('Distinguished Name');
@ -533,7 +533,7 @@ class EntryWriter1 extends EntryWriter {
$i = 0;
$item = '';
echo '<table class="edit_dn_menu" width="100%" border=0>';
echo '<table class="menu" width="100%" border=0>';
echo '<tr>';
$menuitem_number = 0;
@ -672,7 +672,7 @@ class EntryWriter1 extends EntryWriter {
$more_children = $entry->isSizeLimited();
if (!$more_children) {
// all children in ldap
$all_children = $this->ldapserver->getContainerContents(
$all_children = $this->getLDAPServer()->getContainerContents(
$entry->getDn(), $children_count + 1,
'(objectClass=*)', $config->GetValue('deref','view'));
$more_children = (count($all_children) > $children_count);
@ -722,21 +722,21 @@ class EntryWriter1 extends EntryWriter {
protected function getDefaultEditingEntryRefreshMenuItem($entry) {
$href = $this->url_base.'&cmd=template_engine&junk='.random_junk();
return sprintf($this->action_layout,'refresh.png',_('Refresh'),
return sprintf($this->action_layout,IMGDIR,'refresh.png',_('Refresh'),
htmlspecialchars($href),_('Refresh this entry'),_('Refresh'));
}
protected function getDefaultEditingEntryExportBaseMenuItem($entry) {
$href = $this->url_base.'&cmd=export_form&scope=base';
return sprintf($this->action_layout,'save.png',_('Save'),
return sprintf($this->action_layout,IMGDIR,'save.png',_('Save'),
htmlspecialchars($href),_('Save a dump of this object'),_('Export'));
}
protected function getDefaultEditingEntryMoveMenuItem($entry) {
$href = $this->url_base.'&cmd=copy_form';
return sprintf($this->action_layout,'cut.png',_('Cut'),htmlspecialchars($href),
return sprintf($this->action_layout,IMGDIR,'cut.png',_('Cut'),htmlspecialchars($href),
_('Copy this object to another location,a new DN, or another server'),
_('Copy or move this entry'));
}
@ -745,13 +745,13 @@ class EntryWriter1 extends EntryWriter {
if (get_request('show_internal_attrs','REQUEST')) {
$href = $this->url_base.'&cmd=template_engine&junk='.random_junk();
return sprintf($this->action_layout,'tools-no.png',_('Hide'),
return sprintf($this->action_layout,IMGDIR,'tools-no.png',_('Hide'),
htmlspecialchars($href),'',_('Hide internal attributes'));
} else {
$href = $this->url_base.'&cmd=template_engine&show_internal_attrs=true';
return sprintf($this->action_layout,'tools.png',_('Show'),
return sprintf($this->action_layout,IMGDIR,'tools.png',_('Show'),
htmlspecialchars($href),'',_('Show internal attributes'));
}
}
@ -759,48 +759,48 @@ class EntryWriter1 extends EntryWriter {
protected function getDefaultEditingEntryDeleteMenuItem($entry) {
$href = $this->url_base.'&cmd=delete_form';
return sprintf($this->action_layout,'trash.png',_('Trash'),htmlspecialchars($href),
return sprintf($this->action_layout,IMGDIR,'trash.png',_('Trash'),htmlspecialchars($href),
_('You will be prompted to confirm this decision'),_('Delete this entry'));
}
protected function getDefaultEditingEntryRenameMenuItem($entry) {
$href = $this->url_base.'&cmd=rename_form';
return sprintf($this->action_layout,'rename.png',_('Rename'),htmlspecialchars($href),'',_('Rename'));
return sprintf($this->action_layout,IMGDIR,'rename.png',_('Rename'),htmlspecialchars($href),'',_('Rename'));
}
protected function getDefaultEditingEntryCompareMenuItem($entry) {
$href = $this->url_base.'&cmd=compare_form';
return sprintf($this->action_layout,'compare.png',_('Compare'),
return sprintf($this->action_layout,IMGDIR,'compare.png',_('Compare'),
htmlspecialchars($href),'',_('Compare with another entry'));
}
protected function getDefaultEditingEntryCreateMenuItem($entry) {
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&container=%s',
$this->ldapserver->server_id,rawurlencode($entry->getDn()));
$this->index,rawurlencode($entry->getDn()));
return sprintf($this->action_layout,'star.png',_('Create'),htmlspecialchars($href),'',_('Create a child entry'));
return sprintf($this->action_layout,IMGDIR,'star.png',_('Create'),htmlspecialchars($href),'',_('Create a child entry'));
}
protected function getDefaultEditingEntryAddAttributeMenuItem($entry) {
$href = $this->url_base.'&cmd=add_attr_form';
return sprintf($this->action_layout,'add.png',_('Add'),htmlspecialchars($href),'',_('Add new attribute'));
return sprintf($this->action_layout,IMGDIR,'add.png',_('Add'),htmlspecialchars($href),'',_('Add new attribute'));
}
protected function getDefaultEditingEntryShowChildrenMenuItem($entry,$children_count) {
$href = sprintf('cmd.php?cmd=search&server_id=%s&search=true&filter=%s&base_dn=%s&form=advanced&scope=one',
$this->ldapserver->server_id,rawurlencode('objectClass=*'),rawurlencode($entry->getDn()));
$this->index,rawurlencode('objectClass=*'),rawurlencode($entry->getDn()));
return sprintf($this->action_layout,'children.png',_('Children'),htmlspecialchars($href),'',
return sprintf($this->action_layout,IMGDIR,'children.png',_('Children'),htmlspecialchars($href),'',
($children_count == 1) ? _('View 1 child') : sprintf(_('View %s children'),$children_count));
}
protected function getDefaultEditingEntryExportSubMenuItem($entry) {
$href = sprintf('%s&cmd=export_form&scope=%s',$this->url_base,'sub');
return sprintf($this->action_layout,'save.png',_('Save'),htmlspecialchars($href),
return sprintf($this->action_layout,IMGDIR,'save.png',_('Save'),htmlspecialchars($href),
_('Save a dump of this object and all of its children'),_('Export subtree'));
}
@ -991,10 +991,10 @@ class EntryWriter1 extends EntryWriter {
$container = $entry->getContainer();
printf('<input type="hidden" name="container" value="%s" />', htmlspecialchars($container));
printf('<input type="hidden" name="server_id" value="%s" />', $this->ldapserver->server_id);
printf('<input type="hidden" name="server_id" value="%s" />', $this->index);
printf('<input type="hidden" name="template" value="%s" />', $entry->getSelectedTemplateName());
printf('<input type="hidden" name="step" value="%s" />', $step + 1);
echo '<table class="edit_dn" cellspacing="0" align="center">';
echo '<table class="entry" cellspacing="0" align="center">';
$this->draw('RdnChooser', $entry);
@ -1027,17 +1027,15 @@ class EntryWriter1 extends EntryWriter {
echo "<input type=\"hidden\" name=\"$p\" value=\"$v\">";
}
echo '<table class="create" width="100%">';
echo '<table class="forminput" width="100%" border=0>';
$server_menu_html = server_select_list($this->ldapserver->server_id, true);
printf('<tr><td class="heading">%s%s</td><td>%s</td></tr>', _('Server'), _(':'), $server_menu_html);
$server_menu_html = server_select_list($this->index, true);
printf('<tr><td class="heading">%s%s</td><td colspan=2>%s</td></tr>', _('Server'), _(':'), $server_menu_html);
echo '<tr>';
printf('<td class="heading">%s%s</td>', _('Templates'), _(':'));
echo '<td>';
echo '<table class="template_display" width="100%">';
echo '<tr><td>';
echo '<table class="templates">';
echo '<table border=0>';
$i = -1;
$templates = &$entry->getTemplates();
@ -1053,13 +1051,13 @@ class EntryWriter1 extends EntryWriter {
# Balance the columns properly
if (($nb_templates % 2 == 0 && $i == intval($nb_templates / 2)) ||
($nb_templates % 2 == 1 && $i == intval($nb_templates / 2) + 1)) {
echo '</table></td><td><table class="templates">';
echo '</table></td><td><table>';
}
echo '<tr>';
if (isset($template_attrs['invalid']) && $template_attrs['invalid']) {
echo '<td class="icon"><img src="images/error.png" alt="Error" /></td>';
printf('<td class="icon"><img src="%s/error.png" alt="Error" /></td>',IMGDIR);
} else {
printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="document.forms.template_choice_form.submit()" /></td>',
htmlspecialchars($template_name), htmlspecialchars($template_name));
@ -1067,7 +1065,7 @@ class EntryWriter1 extends EntryWriter {
printf('<td class="icon"><label for="%s"><img src="%s" alt="" /></label></td>',
htmlspecialchars($template_name), $template_attrs['icon']);
printf('<td class="name"><label for="%s">',
printf('<td class="label"><label for="%s">',
htmlspecialchars($template_name));
if (isset($template_attrs['invalid']) && $template_attrs['invalid']) {
@ -1088,19 +1086,15 @@ class EntryWriter1 extends EntryWriter {
$i++;
if (($nb_templates % 2 == 0 && $i == intval($nb_templates / 2)) ||
($nb_templates % 2 == 1 && $i == intval($nb_templates / 2) + 1)) {
echo '</table></td><td><table class="templates">';
echo '</table></td><td><table>';
}
echo '<tr>'
.'<td><input type="radio" name="template" value="none"'
.' onclick="document.forms.template_choice_form.submit()" /></td>'
.'<td class="icon"><label><img src="images/object.png" alt="" /></label></td>'
.'<td class="name"><label>'
._('Default')
.'</label></td></tr>';
echo '<tr>';
echo '<td><input type="radio" name="template" value="none" onclick="document.forms.template_choice_form.submit()" /></td>';
printf('<td class="icon"><label><img src="%s/object.png" alt="" /></label></td>',IMGDIR);
printf('<td class="label"><label>%s</label></td></tr>',_('Default'));
}
echo '</table>';
echo '</td></tr></table>';
echo '</td></tr>';
echo '</table>';
@ -1145,15 +1139,15 @@ class EntryWriter1 extends EntryWriter {
protected function drawTemplateCreatingEntryJavascript($entry) {
$this->draw('DefaultCreatingEntry::Javascript', $entry);
$templates = new Templates($this->ldapserver->server_id);
$templates = new Templates($this->index);
foreach ($entry->getAttributes() as $attribute) {
if ($attribute->hasProperty('onchange')) {
$onchange = $attribute->getProperty('onchange');
if (is_array($onchange)) {
foreach ($onchange as $value)
$templates->OnChangeAdd($this->ldapserver,$attribute->getName(),$value);
$templates->OnChangeAdd($this->getLDAPServer(),$attribute->getName(),$value);
} else {
$templates->OnChangeAdd($this->ldapserver,$attribute->getName(),$onchange);
$templates->OnChangeAdd($this->getLDAPServer(),$attribute->getName(),$onchange);
}
}
}
@ -1255,13 +1249,11 @@ class EntryWriter1 extends EntryWriter {
echo "<input type=\"hidden\" name=\"$p\" value=\"$v\">";
}
echo '<table class="create" width="100%">';
echo '<table class="forminput" width="100%" border=0>';
echo '<tr>';
printf('<td class="heading">%s%s</td>',_('Templates'), _(':'));
echo '<td>';
echo '<table class="template_display" width="100%">';
echo '<tr><td>';
echo '<table class="templates">';
echo '<table>';
$i = -1;
$templates = &$entry->getTemplates();
@ -1277,18 +1269,17 @@ class EntryWriter1 extends EntryWriter {
# Balance the columns properly
if (($nb_templates % 2 == 0 && $i == intval($nb_templates / 2)) ||
($nb_templates % 2 == 1 && $i == intval($nb_templates / 2) + 1)) {
echo '</table></td><td><table class="templates">';
echo '</table></td><td><table>';
}
echo '<tr>';
printf('<td><input type="radio" name="template" value="%s" id="%s"'
.' onclick="document.forms.template_choice_form.submit()" /></td>',
printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="document.forms.template_choice_form.submit()" /></td>',
htmlspecialchars($template_name), htmlspecialchars($template_name));
printf('<td class="icon"><label for="%s"><img src="%s" alt="" /></label></td>',
htmlspecialchars($template_name), $template_attrs['icon']);
printf('<td class="name"><label for="%s">',htmlspecialchars($template_name));
printf('<td class="label"><label for="%s">',htmlspecialchars($template_name));
echo htmlspecialchars($template_attrs['desc']);
@ -1300,19 +1291,15 @@ class EntryWriter1 extends EntryWriter {
$i++;
if (($nb_templates % 2 == 0 && $i == intval($nb_templates / 2)) ||
($nb_templates % 2 == 1 && $i == intval($nb_templates / 2) + 1)) {
echo '</table></td><td><table class="templates">';
echo '</table></td><td><table>';
}
echo '<tr>'
.'<td><input type="radio" name="template" value="none"'
.' onclick="document.forms.template_choice_form.submit()" /></td>'
.'<td class="icon"><label><img src="images/object.png" alt="" /></label></td>'
.'<td class="name"><label>'
._('Default')
.'</label></td></tr>';
echo '<tr>';
echo '<td><input type="radio" name="template" value="none" onclick="document.forms.template_choice_form.submit()" /></td>';
printf('<td class="icon"><label><img src="%s/object.png" alt="" /></label></td>',IMGDIR);
printf('<td class="label"><label>%s</label></td></tr>',_('Default'));
}
echo '</table>';
echo '</td></tr></table>';
echo '</td></tr>';
echo '</table>';
@ -1335,15 +1322,15 @@ class EntryWriter1 extends EntryWriter {
protected function drawTemplateEditingEntryJavascript($entry) {
$this->draw('DefaultEditingEntry::Javascript', $entry);
$templates = new Templates($this->ldapserver->server_id);
$templates = new Templates($this->index);
foreach ($entry->getAttributes() as $attribute) {
if ($attribute->hasProperty('onchange')) {
$onchange = $attribute->getProperty('onchange');
if (is_array($onchange)) {
foreach ($onchange as $value)
$templates->OnChangeAdd($this->ldapserver,$attribute->getName(),$value);
$templates->OnChangeAdd($this->getLDAPServer(),$attribute->getName(),$value);
} else {
$templates->OnChangeAdd($this->ldapserver,$attribute->getName(),$onchange);
$templates->OnChangeAdd($this->getLDAPServer(),$attribute->getName(),$onchange);
}
}
}
@ -1401,7 +1388,7 @@ class EntryWriter1 extends EntryWriter {
echo ' var valid = true;';
$this->draw('ValidateJavascript', $attribute, 'component', 'silence', 'valid');
echo ' if (valid) component.style.backgroundColor = "white";';
echo ' else component.style.backgroundColor = \'#ffffba\';';
echo ' else component.style.backgroundColor = \'#F0F0FF\';';
echo ' return valid;';
echo '}';
echo '</script>';
@ -1430,7 +1417,7 @@ class EntryWriter1 extends EntryWriter {
}';
echo 'var comp = getAttributeComponents("new", "'.$attribute->getName().'");
for (var i = 0; i < comp.length; i++) {
comp[i].style.backgroundColor = '.$var_valid.' ? "white" : \'#ffffba\';
comp[i].style.backgroundColor = '.$var_valid.' ? "white" : \'#F0F0FF\';
}';
}
}
@ -1468,14 +1455,14 @@ class EntryWriter1 extends EntryWriter {
}
protected function drawAttributeInformations($attribute) {
if (($this->context == ENTRY_WRITER_EDITING_CONTEXT) && $attribute->hasBeenModified()) echo '<tr class="updated_attr">';
if (($this->context == ENTRY_WRITER_EDITING_CONTEXT) && $attribute->hasBeenModified()) echo '<tr class="updated">';
else echo '<tr>';
echo '<td class="attr">';
echo '<td class="title">';
$this->draw('Name', $attribute);
echo '</td>';
echo '<td class="attr_note">';
echo '<td class="note">';
# Setup the $attr_note, which will be displayed to the right of the attr name (if any)
if ($_SESSION[APPCONFIG]->GetValue('appearance', 'show_attribute_notes')) {
@ -1509,7 +1496,7 @@ class EntryWriter1 extends EntryWriter {
if ($attr_note) printf('<sup><small>%s</small></sup>', $attr_note);
if ($attribute->isReadOnly() && $this->ldapserver->isAttrReadOnly($attribute->getName())) {
if ($attribute->isReadOnly() && $this->getLDAPServer()->isAttrReadOnly($attribute->getName())) {
printf('<small>(<acronym title="%s">%s</acronym>)</small>',
_('This attribute has been flagged as read only by the phpLDAPadmin administrator'),
_('read only'));
@ -1592,11 +1579,11 @@ class EntryWriter1 extends EntryWriter {
protected function drawAttributeStartValueLine($attribute) {
if (($this->context == ENTRY_WRITER_EDITING_CONTEXT) && $attribute->hasBeenModified()) {
echo '<tr class="updated_attr">';
echo '<tr class="updated">';
} else {
echo '<tr>';
}
echo '<td class="val" colspan="2">';
echo '<td class="value" colspan="2">';
}
protected function drawAttributeEndValueLine($attribute) {
@ -1604,7 +1591,7 @@ class EntryWriter1 extends EntryWriter {
echo '</tr>';
if (($this->context == ENTRY_WRITER_EDITING_CONTEXT) && $attribute->hasBeenModified()) {
echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
echo '<tr class="updated"><td class="bottom" colspan="2"></td></tr>';
}
}
@ -1671,7 +1658,7 @@ class EntryWriter1 extends EntryWriter {
if (!is_string($val)) $val = '';
if ($i < 0) $i = 0;
printf('<input type="hidden" class="val" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" />',
printf('<input type="hidden" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" />',
htmlspecialchars($attribute->getName()), $i, htmlspecialchars($attribute->getName()), $i,
htmlspecialchars($val));
}
@ -1699,7 +1686,7 @@ class EntryWriter1 extends EntryWriter {
* draw_chooser_link() to identify it after the user clicks. */
$id = sprintf('new_values_%s_%s', htmlspecialchars($attribute->getName()), $i);
printf('<input type="text" class="val" name="new_values[%s][%s]"'.
printf('<input type="text" class="value" name="new_values[%s][%s]"'.
' id="%s" value="%s" onFocus="focus_%s(this);" onBlur="blur_%s(this);" %s %s/>',
htmlspecialchars($attribute->getName()), $i, $id,
htmlspecialchars($val), $attribute->getName(), $attribute->getName(),
@ -1739,9 +1726,10 @@ class EntryWriter1 extends EntryWriter {
}
}
$ldapserver = $this->getLDAPServer();
$arr1 = array();
foreach ($vals as $id_parval => $parval) {
$arr2 = Templates::EvaluateDefault($this->ldapserver, $parval, $dn, null, null);
$arr2 = Templates::EvaluateDefault($ldapserver, $parval, $dn, null, null);
if (is_array($arr2)) $arr1 = array_merge($arr1,$arr2);
else $arr1[$id_parval] = $arr2;
}
@ -1749,7 +1737,7 @@ class EntryWriter1 extends EntryWriter {
$arr1 = array();
foreach ($opts as $id_parval => $parval) {
$arr2 = Templates::EvaluateDefault($this->ldapserver, $parval, $dn, null, null);
$arr2 = Templates::EvaluateDefault($ldapserver, $parval, $dn, null, null);
if (is_array($arr2)) $arr1 = array_merge($arr1,$arr2);
else $arr1[$id_parval] = $arr2;
}
@ -1811,7 +1799,7 @@ class EntryWriter1 extends EntryWriter {
if ($attribute->getEntry()) $encoded_dn = rawurlencode($attribute->getEntry()->getDn());
if (!$encoded_dn) return; // creating entry
$url_base = sprintf('cmd.php?server_id=%s&dn=%s', $this->ldapserver->server_id, $encoded_dn);
$url_base = sprintf('cmd.php?server_id=%s&dn=%s', $this->index, $encoded_dn);
$href = sprintf('%s&cmd=rename_form', $url_base);
return sprintf('<small>(<a href="%s">%s</a>)</small>', htmlspecialchars($href), _('rename'));
@ -1829,7 +1817,7 @@ class EntryWriter1 extends EntryWriter {
if (!$encoded_dn) return; // creating entry
$href = sprintf('cmd.php?cmd=add_value_form&server_id=%s&dn=%s%s&attr=%s',
$this->ldapserver->server_id, $encoded_dn, $template ? "&template=$template" : '', rawurlencode($attribute->getName()));
$this->index, $encoded_dn, $template ? "&template=$template" : '', rawurlencode($attribute->getName()));
return sprintf('(<a href="%s" title="%s">%s</a>)',
htmlspecialchars($href), sprintf(_('Add an additional value to attribute \'%s\''),
@ -1842,14 +1830,14 @@ class EntryWriter1 extends EntryWriter {
if (!$encoded_dn) return; // creating entry
$href = sprintf('cmd.php?cmd=modify_member_form&server_id=%s&dn=%s&attr=%s',
$this->ldapserver->server_id, $encoded_dn, rawurlencode($attribute->getName()));
$this->index, $encoded_dn, rawurlencode($attribute->getName()));
return sprintf('(<a href="%s" title="%s">%s</a>)',
htmlspecialchars($href), sprintf(_('Modify members for \'%s\''), $dn), _('modify group members'));
}
protected function drawAttributeIcon($attribute, $val) {
if (is_dn_string($val) || $this->ldapserver->isDNAttr($attribute->getName())) {
if (is_dn_string($val) || $this->getLDAPServer()->isDNAttr($attribute->getName())) {
$this->draw('DnValueIcon', $attribute, $val);
} elseif (is_mail_string($val)) {
$this->draw('MailValueIcon', $attribute, $val);
@ -1863,27 +1851,27 @@ class EntryWriter1 extends EntryWriter {
protected function drawAttributeDnValueIcon($attribute, $val) {
if (strlen($val) <= 0) {
echo '<img src="images/go.png" alt="Go" align="top" />&nbsp;';
printf('<img src="%s/go.png" alt="Go" align="top" />&nbsp;',IMGDIR);
} elseif ($this->ldapserver->dnExists($val)) {
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$this->ldapserver->server_id,$val);
printf('<a title="%s %s" href="%s"><img src="images/go.png" alt="Go" /></a>&nbsp;',_('Go to'),
htmlspecialchars($val), htmlspecialchars($href));
} elseif ($this->getLDAPServer()->dnExists($val)) {
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$this->index,$val);
printf('<a title="%s %s" href="%s"><img src="%s/go.png" alt="Go" /></a>&nbsp;',_('Go to'),
htmlspecialchars($val), htmlspecialchars($href),IMGDIR);
} else {
printf('<a title="%s %s"><img src="images/nogo.png" alt="Go" /></a>&nbsp;',_('DN not available'),htmlspecialchars($val));
printf('<a title="%s %s"><img src="%s/nogo.png" alt="Go" /></a>&nbsp;',_('DN not available'),htmlspecialchars($val),IMGDIR);
}
}
protected function drawAttributeMailValueIcon($attribute, $val) {
$img = '<img src="images/mail.png" alt="'._('Mail').'" align="top" />';
$img = sprintf('<img src="%s/mail.png" alt="%s" align="top" />',IMGDIR,_('Mail'));
if (strlen($val) <= 0) echo $img;
else printf('<a href="mailto:%s">'.$img.'</a>', htmlspecialchars($val));
echo '&nbsp;';
}
protected function drawAttributeUrlValueIcon($attribute, $val) {
$img = '<img src="images/dc.png" alt="'._('URL').'" align="top" />';
$img = sprintf('<img src="%s/dc.png" alt="%s" align="top" />',IMGDIR,_('URL'));
if (strlen($val) <= 0) echo $img;
else printf('<a href="%s" target="new">'.$img.'</a>', htmlspecialchars($val));
echo '&nbsp;';
@ -1897,7 +1885,7 @@ class EntryWriter1 extends EntryWriter {
if ($attribute->getEntry() && $attribute->getEntry()->getDn() // if not creating attribute
&& $config->isCommandAvailable('schema') ) {
$href = sprintf('cmd.php?cmd=schema&server_id=%s&view=attributes&viewvalue=%s',
$this->ldapserver->server_id, real_attr_name($attribute->getName()));
$this->index, real_attr_name($attribute->getName()));
printf('<a title="'._('Click to view the schema definition for attribute type \'%s\'')
.'" href="%s">%s</a>', $attribute->getName(), htmlspecialchars($href), $attr_display);
} else {
@ -1921,7 +1909,7 @@ class EntryWriter1 extends EntryWriter {
$required_by = '';
if ($attribute->getEntry()) {
$schema_attr = $this->ldapserver->getSchemaAttribute($attribute->getName(),$attribute->getEntry()->getDn());
$schema_attr = $this->getLDAPServer()->getSchemaAttribute($attribute->getName(),$attribute->getEntry()->getDn());
if ($schema_attr) {
$entry_attributes = $attribute->getEntry()->getAttributes();
$objectclass_attribute = null;
@ -1989,24 +1977,24 @@ class EntryWriter1 extends EntryWriter {
if ($valcount > 0) {
if ($attribute->getEntry() && $attribute->getEntry()->getDn()) {
$href = sprintf('download_binary_attr.php?server_id=%s&dn=%s&attr=%s',
$this->ldapserver->server_id, rawurlencode($attribute->getEntry()->getDn()),
$this->index, rawurlencode($attribute->getEntry()->getDn()),
$attribute->getName());
if ($valcount > 1) {
for ($i=1; $i<=$valcount; $i++) {
printf('<a href="%s&value_num=%s"><img src="images/save.png" alt="Save" /> %s(%s)</a><br />',
htmlspecialchars($href), $i, _('download value'), $i);
printf('<a href="%s&value_num=%s"><img src="%s/save.png" alt="Save" /> %s(%s)</a><br />',
htmlspecialchars($href), $i,IMGDIR,_('download value'), $i);
}
} else {
printf('<a href="%s"><img src="images/save.png" alt="Save" /> %s</a><br />',
htmlspecialchars($href),_('download value'));
printf('<a href="%s"><img src="%s/save.png" alt="Save" /> %s</a><br />',
htmlspecialchars($href),IMGDIR,_('download value'));
}
}
if (! $attribute->isReadOnly() && $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete')) {
printf('<a href="javascript:deleteAttribute(\'%s\', \'%s\');" style="color:red;">'.
'<img src="images/trash.png" alt="Trash" /> %s</a>',
$attribute->getName(), $attribute->getFriendlyName(), _('delete attribute'));
'<img src="%s/trash.png" alt="Trash" /> %s</a>',
$attribute->getName(), $attribute->getFriendlyName(),IMGDIR,_('delete attribute'));
}
} elseif ($attribute->isReadOnly() || ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value')) {
printf('<input type="text" class="roval" value="%s" readonly /><br />',
@ -2015,7 +2003,7 @@ class EntryWriter1 extends EntryWriter {
$i = 0;
$val = '';
$id = sprintf('new_values_%s_%s', htmlspecialchars($attribute->getName()), $i);
printf('<input type="file" class="val" name="new_values[%s][%s]"'.
printf('<input type="file" class="value" name="new_values[%s][%s]"'.
' id="%s" value="%s" onFocus="focus_%s(this);" onBlur="blur_%s(this);" %s %s/><br />',
htmlspecialchars($attribute->getName()), $i, $id,
htmlspecialchars($val), $attribute->getName(), $attribute->getName(),
@ -2054,7 +2042,7 @@ class EntryWriter1 extends EntryWriter {
echo '
<!-- This form is submitted by JavaScript when the user clicks "Delete attribute" on a binary attribute -->
<form name="delete_attribute_form" action="cmd.php?cmd=delete_attr" method="post">
<input type="hidden" name="server_id" value="'.$this->ldapserver->server_id.'" />
<input type="hidden" name="server_id" value="'.$this->index.'" />
<input type="hidden" name="dn" value="'.htmlspecialchars($dn).'" />
<input type="hidden" name="attr" value="FILLED IN BY JAVASCRIPT" />
</form>';
@ -2082,7 +2070,7 @@ class EntryWriter1 extends EntryWriter {
$val = $attribute->getValue($i);
if (!is_string($val)) $val = '';
printf('<span style="white-space: nowrap;"><input type="text" class="val" id="f_date_%s_%s"'
printf('<span style="white-space: nowrap;"><input type="text" class="value" id="f_date_%s_%s"'
.' name="new_values[%s][%s]" value="%s" onFocus="focus_%s(this);" onBlur="blur_%s(this);" %s %s/>&nbsp;',
$attribute->getName(), $i, htmlspecialchars($attribute->getName()), $i, htmlspecialchars($val),
$attribute->getName(), $attribute->getName(),
@ -2102,11 +2090,9 @@ class EntryWriter1 extends EntryWriter {
if (isset($entry['date'][$attribute->getName()]))
$entry['format'] = $entry['date'][$attribute->getName()];
//included in class page to avoid multiple inclusions
//printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/lang/calendar-en.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar-setup.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sdate_selector.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/lang/calendar-en.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar-setup.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sdate_selector.js"></script>',JSDIR);
for ($i = 0; $i <= $attribute->getValueCount(); $i++) {
printf('<script type="text/javascript" language="javascript">defaults[\'f_date_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,$entry['format']);
@ -2132,7 +2118,7 @@ class EntryWriter1 extends EntryWriter {
$input_name = sprintf('new_values[%s][%s]', htmlspecialchars($attribute->getName()), $i);
$input_id = sprintf('new_values_%s_%s', htmlspecialchars($attribute->getName()), $i);
printf('<span style="white-space: nowrap;"><input type="text" class="val" name="%s" id="%s" value="%s"'
printf('<span style="white-space: nowrap;"><input type="text" class="value" name="%s" id="%s" value="%s"'
.' onFocus="focus_%s(this);" onBlur="blur_%s(this);" %s %s/>&nbsp;',
$input_name, $input_id, htmlspecialchars($val),
$attribute->getName(), $attribute->getName(),
@ -2169,10 +2155,10 @@ class EntryWriter1 extends EntryWriter {
if ($attribute->getEntry()) $dn = $attribute->getEntry()->getDn();
# If this is a gidNumber on a non-PosixGroup entry, lookup its name and description for convenience
if (! in_array_ignore_case('posixGroup', $this->ldapserver->getDNAttr($dn, 'objectClass'))) {
if (! in_array_ignore_case('posixGroup', $this->getLDAPServer()->getDNAttr($dn, 'objectClass'))) {
$gid_number = $val;
$search_group_filter = "(&(objectClass=posixGroup)(gidNumber=$val))";
$group = $this->ldapserver->search(null, null, $search_group_filter,array('dn','description'));
$group = $this->getLDAPServer()->search(null, null, $search_group_filter,array('dn','description'));
if (count($group) > 0) {
echo '<br />';
@ -2182,7 +2168,7 @@ class EntryWriter1 extends EntryWriter {
$group_name = explode('=',get_rdn($group_dn));
$group_name = $group_name[1];
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',
$this->ldapserver->server_id, rawurlencode($group_dn));
$this->index, rawurlencode($group_dn));
echo '<small>';
printf('<a href="%s">%s</a>', htmlspecialchars($href), htmlspecialchars($group_name));
@ -2214,7 +2200,7 @@ class EntryWriter1 extends EntryWriter {
/* Don't draw the delete buttons if there is more than one jpegPhoto
* (phpLDAPadmin can't handle this case yet) */
if ($attribute->getEntry() && $attribute->getEntry()->getDn()) {
draw_jpeg_photos($this->ldapserver, $attribute->getEntry()->getDn(),
draw_jpeg_photos($this->getLDAPServer(), $attribute->getEntry()->getDn(),
$attribute->getName(), ! $attribute->isReadOnly()
&& $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'));
}
@ -2224,7 +2210,7 @@ class EntryWriter1 extends EntryWriter {
$i = 0;
$val = '';
$id = sprintf('new_values_%s_%s', htmlspecialchars($attribute->getName()), $i);
printf('<input type="file" class="val" name="new_values[%s][%s]"'.
printf('<input type="file" class="value" name="new_values[%s][%s]"'.
' id="%s" value="%s" onFocus="focus_%s(this);" onBlur="blur_%s(this);" %s %s/><br />',
htmlspecialchars($attribute->getName()), $i, $id,
htmlspecialchars($val), $attribute->getName(), $attribute->getName(),
@ -2261,7 +2247,7 @@ class EntryWriter1 extends EntryWriter {
if (!is_string($val)) $val = '';
if ($i < 0) $i = 0;
printf('<textarea class="val" %s %s name="new_values[%s][%s]" '.
printf('<textarea class="value" %s %s name="new_values[%s][%s]" '.
'id="new_values_%s_%s" onFocus="focus_%s(this);" onBlur="blur_%s(this);">%s</textarea>',
($attribute->getRows() > 0) ? 'rows="'.$attribute->getRows().'"' : '',
($attribute->getCols() > 0) ? 'cols="'.$attribute->getCols().'"' : '',
@ -2280,7 +2266,7 @@ class EntryWriter1 extends EntryWriter {
if (!is_string($val)) $val = '';
if ($i < 0) $i = 0;
$schema_object = ($val) ? $this->ldapserver->getSchemaObjectClass($val) : false;
$schema_object = ($val) ? $this->getLDAPServer()->getSchemaObjectClass($val) : false;
$structural = (is_object($schema_object) && $schema_object->getType() == 'structural');
if (!$attribute->isVisible()) {
@ -2303,9 +2289,9 @@ class EntryWriter1 extends EntryWriter {
protected function drawObjectClassAttributeIcon($attribute, $val) {
if (strlen($val) > 0) {
$href = sprintf('cmd.php?cmd=schema&server_id=%s&view=objectClasses&viewvalue=%s',
$this->ldapserver->server_id, $val);
printf('<a title="%s" href="%s"><img src="images/info.png" alt="Info" /></a>&nbsp;',
_('View the schema description for this objectClass'), htmlspecialchars($href));
$this->index, $val);
printf('<a title="%s" href="%s"><img src="%s/info.png" alt="Info" /></a>&nbsp;',
_('View the schema description for this objectClass'), htmlspecialchars($href),IMGDIR);
}
}
@ -2331,7 +2317,7 @@ class EntryWriter1 extends EntryWriter {
if ($i < 0) $i = 0;
$enc_type = get_enc_type($val);
if ($val == '') $enc_type = get_default_hash($this->ldapserver->server_id);
if ($val == '') $enc_type = get_default_hash($this->index);
$obfuscate_password = obfuscate_password_display($enc_type);
printf('<input type="%s" class="roval" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" %s readonly /><br />',
@ -2350,25 +2336,14 @@ class EntryWriter1 extends EntryWriter {
# Set the default hashing type if the password is blank (must be newly created)
if ($val == '') {
$enc_type = get_default_hash($this->ldapserver->server_id);
$enc_type = get_default_hash($this->index);
}
//printf('<input type="hidden" name="old_values[%s][%s]" value="%s" />', $attribute->getName(), $i, htmlspecialchars($val));
//if (strlen($val) > 0) {
// if (obfuscate_password_display($enc_type)) {
// echo htmlspecialchars(preg_replace('/./','*', $val));
// } else {
// echo htmlspecialchars($val);
// }
// echo '<br />';
//}
echo '<table cellspacing="0" cellpadding="0"><tr><td valign="top">';
$obfuscate_password = obfuscate_password_display($enc_type);
$id = sprintf('new_values_%s_%s', htmlspecialchars($attribute->getName()), $i);
printf('<input type="%s" class="val" name="new_values[%s][%s]" id="%s" value="%s"'
printf('<input type="%s" class="value" name="new_values[%s][%s]" id="%s" value="%s"'
.' onFocus="focus_%s(this);" onBlur="blur_%s(this);" %s %s/>',
($obfuscate_password ? 'password' : 'text'),
htmlspecialchars($attribute->getName()), $i, $id,
@ -2380,12 +2355,14 @@ class EntryWriter1 extends EntryWriter {
echo '</td><td valign="top">';
if ($attribute->hasProperty('helper')) {
$this->draw('Helper', $attribute, $i);
} else {
echo enc_type_select_list($enc_type,'enc',$attribute,$i);
}
echo '</td></tr><tr><td valign="top">';
if ($attribute->hasProperty('verify') && $attribute->getProperty('verify') && $obfuscate_password) {
$id_v = sprintf('new_values_verify_%s_%s', htmlspecialchars($attribute->getName()), $i);
printf('<input type="password" class="val" name="new_values_verify[%s][%s]" id="%s" value="" %s %s/>',
printf('<input type="password" class="value" name="new_values_verify[%s][%s]" id="%s" value="" %s %s/>',
htmlspecialchars($attribute->getName()), $i, $id_v,
($attribute->getSize() > 0) ? 'size="'.$attribute->getSize().'"' : '',
($attribute->getMaxLength() > 0) ? 'maxlength="'.$attribute->getMaxLength().'"' : '');
@ -2405,7 +2382,7 @@ class EntryWriter1 extends EntryWriter {
# Set the default hashing type if the password is blank (must be newly created)
if ($val == '') {
$enc_type = get_default_hash($this->ldapserver->server_id);
$enc_type = get_default_hash($this->index);
}
return $enc_type;
@ -2474,7 +2451,7 @@ class EntryWriter1 extends EntryWriter {
if (!is_string($val)) $val = '';
if ($i < 0) $i = 0;
printf('<input type="hidden" class="val" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" />',
printf('<input type="hidden" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" />',
htmlspecialchars($attribute->getName()), $i,
htmlspecialchars($attribute->getName()), $i,
htmlspecialchars($val));
@ -2608,7 +2585,7 @@ class EntryWriter1 extends EntryWriter {
if (!is_string($val)) $val = '';
if ($i < 0) $i = 0;
printf('<input type="hidden" class="val" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" />',
printf('<input type="hidden" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" />',
htmlspecialchars($attribute->getName()), $i,
htmlspecialchars($attribute->getName()), $i,
htmlspecialchars($val));

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter2.php,v 1.2.2.1 2007/12/26 09:26:33 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter2.php,v 1.2.2.3 2008/01/27 06:48:59 wurley Exp $
/**
* @package phpLDAPadmin
@ -145,7 +145,7 @@ class EntryWriter2 extends EntryWriter1 {
protected function drawAttribute($attribute) {
if ($attribute->isVisible()) {
if (($this->context == ENTRY_WRITER_EDITING_CONTEXT) && $attribute->hasBeenModified()) {
echo '<tr class="updated_attr">';
echo '<tr class="updated">';
} else {
echo '<tr>';
}
@ -157,7 +157,7 @@ class EntryWriter2 extends EntryWriter1 {
if ($attribute->isVisible()) {
echo '</tr>';
if (($this->context == ENTRY_WRITER_EDITING_CONTEXT) && $attribute->hasBeenModified()) {
//echo '<tr class="updated_attr"><td class="bottom" colspan="3"></td></tr>';
//echo '<tr class="updated"><td class="bottom" colspan="3"></td></tr>';
}
if ($attribute->hasProperty('spacer') && $attribute->getProperty('spacer')) {
echo '<tr class="spacer"><td colspan="3">&nbsp;</td></tr>';
@ -205,7 +205,7 @@ class EntryWriter2 extends EntryWriter1 {
if ($attr_note) printf('<sup><small>%s</small></sup>', $attr_note);
if ($attribute->isReadOnly() && $this->ldapserver->isAttrReadOnly($attribute->getName())) {
if ($attribute->isReadOnly() && $this->getLDAPServer()->isAttrReadOnly($attribute->getName())) {
printf('<small>(<acronym title="%s">%s</acronym>)</small>',
_('This attribute has been flagged as read only by the phpLDAPadmin administrator'),
_('read only'));

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/HTMLTree.php,v 1.2.2.2 2007/12/29 07:23:45 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/HTMLTree.php,v 1.2.2.6 2008/01/27 10:17:28 wurley Exp $
/**
* @package phpLDAPadmin
@ -38,10 +38,14 @@ class HTMLTree extends Tree {
printf('<tr><td class="blank" colspan="%s">&nbsp;</td></tr>',$this->getDepth()+3);
if ($ldapserver->isReadOnly())
printf('<tr><td class="spacer"></td><td class="links" colspan="%s">(%s)</td></tr>',$this->getDepth()+3-1,_('read only'));
printf('<tr><td class="spacer"></td><td class="logged_in" colspan="%s">(%s)</td></tr>',$this->getDepth()+3-1,_('read only'));
else
printf('<tr><td class="blank" colspan="%s">&nbsp;</td></tr>',$this->getDepth()+3);
printf('<tr><td>&nbsp;</td><td><div style="overflow: auto; %s%s"><table class="tree" border=0>',
$_SESSION['plaConfig']->GetValue('appearance','tree_width') ? sprintf('width: %spx; ',$_SESSION['plaConfig']->GetValue('appearance','tree_width')) : '',
$_SESSION['plaConfig']->GetValue('appearance','tree_height') ? sprintf('height: %spx; ',$_SESSION['plaConfig']->GetValue('appearance','tree_height')) : '');
foreach ($ldapserver->getBaseDN() as $base_dn) {
# Did we get a base_dn for this server somehow?
if ($base_dn) {
@ -83,6 +87,7 @@ class HTMLTree extends Tree {
continue;
}
}
echo '</table></div></td></tr>';
} else { // end if( $ldapserver->connect(false) )
# @todo: need this message to display the LDAP server name, so we know which one is the problematic one.
@ -271,7 +276,7 @@ class HTMLTree extends Tree {
$ldapserver = $this->getLdapServer();
$logged_in_dn = $ldapserver->getLoggedInDN();
printf('<tr><td class="spacer"></td><td class="links" colspan="%s"><span style="white-space: nowrap;">%s%s ',$this->getDepth()+3-1,_('Logged in as'),_(':'));
printf('<tr><td class="spacer"></td><td class="logged_in" colspan="%s">%s%s ',$this->getDepth()+3-1,_('Logged in as'),_(':'));
if ($ldapserver->getDNBase($logged_in_dn) == $logged_in_dn) {
$logged_in_branch = '';
@ -294,7 +299,7 @@ class HTMLTree extends Tree {
if (strcasecmp('anonymous',$logged_in_dn)) {
foreach ($logged_in_dn_array as $rdn_piece) {
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$ldapserver->server_id,rawurlencode($rdn));
printf('<a class="logged_in_dn" href="%s">%s</a>',htmlspecialchars($href),pretty_print_dn($rdn_piece));
printf('<a href="%s">%s</a>',htmlspecialchars($href),pretty_print_dn($rdn_piece));
if ($rdn_piece != end($logged_in_dn_array))
echo ',';
@ -306,7 +311,7 @@ class HTMLTree extends Tree {
echo 'Anonymous';
}
echo '</span></td></tr>';
echo '</td></tr>';
}
/**
@ -336,7 +341,7 @@ class HTMLTree extends Tree {
$img_src = sprintf('images/%s',$dnEntry->getIcon($ldapserver));
$rdn = get_rdn($dn);
echo '<tr>';
echo '<tr class="option">';
$colspan = $this->getDepth()+3+$level+1;
for ($i=0;$i<=$level;$i++) {
@ -373,7 +378,7 @@ class HTMLTree extends Tree {
printf('<td class="icon"><a href="%s" name="%s_%s"><img src="%s" alt="img" /></a></td>',$href['edit'],$ldapserver->server_id,$encoded_dn,$img_src);
$colspan--;
printf('<td class="rdn" colspan="%s" width=100%%><span style="white-space: nowrap;">',$colspan);
printf('<td class="logged_in" colspan="%s" width=100%%><span style="white-space: nowrap;">',$colspan);
printf('<a href="%s">%s</a>',$href['edit'],$this->get_formatted_dn($dnEntry,$level));
if ($child_count)
@ -454,7 +459,7 @@ class HTMLTree extends Tree {
echo '<td class="spacer"></td>';
echo '<td class="spacer"></td>';
printf('<td class="icon"><a href="%s"><img src="images/star.png" alt="%s" /></a></td>',$href,_('new'));
printf('<td class="create" colspan="%s"><a href="%s" title="%s %s">%s</a></td>',
printf('<td class="link" colspan="%s"><a href="%s" title="%s %s">%s</a></td>',
$this->getDepth()+3-$level-1-3,$href,_('Create a new entry in'),$rdn,_('Create new entry here'));
echo '</tr>';
}
@ -467,9 +472,9 @@ class HTMLTree extends Tree {
$href = htmlspecialchars(
sprintf('cmd.php?cmd=%s&server_id=%s',get_custom_file($ldapserver->server_id,'login_form',''),$ldapserver->server_id));
echo '<tr><td class="spacer"></td>';
echo '<tr class="option"><td class="spacer"></td>';
printf('<td class="icon"><a href="%s"><img src="images/uid.png" alt="%s" /></a></td>',$href,_('login'));
printf('<td class="rdn" colspan="%s"><a href="%s">%s</a></td>',$this->getDepth()+3-2,$href,_('Login').'...');
printf('<td class="logged_in" colspan="%s"><a href="%s">%s</a></td>',$this->getDepth()+3-2,$href,_('Login').'...');
echo '</tr>';
printf('<tr><td class="blank" colspan="%s">&nbsp;</td>',$this->getDepth()+3);

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/Tree.php,v 1.2.2.1 2007/12/26 09:26:33 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/Tree.php,v 1.2.2.2 2008/01/27 07:23:43 wurley Exp $
/**
* @package phpLDAPadmin
@ -127,7 +127,7 @@ abstract class Tree {
debug_log('New ENTRY (%s) for (%s).',64,__FILE__,__LINE__,__METHOD__,$dnlower,$dn);
$this->entries[$dnlower] = $entry_factory->newEditingEntry($dn);
$this->entries[$dnlower]->setTree($this);
$this->entries[$dnlower]->setTree($ldapserver->server_id);
if ($ldapserver->isReadOnly())
$this->entries[$dnlower]->setReadOnly();

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/common.php,v 1.80.2.8 2008/01/04 12:33:03 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/common.php,v 1.80.2.9 2008/01/30 11:14:02 wurley Exp $
/**
* Contains code to be executed at the top of each application page.
@ -146,6 +146,10 @@ if (! isset($_SESSION[APPCONFIG])) {
$_SESSION[APPCONFIG]->CheckCustom();
}
# Set our timezone, if it is specified in config.php
if ($_SESSION[APPCONFIG]->GetValue('appearance','timezone'))
date_default_timezone_set($_SESSION[APPCONFIG]->GetValue('appearance','timezone'));
# If we are here, $_SESSION is set - so enabled DEBUGing if it has been configured.
if (($_SESSION[APPCONFIG]->GetValue('debug','syslog') || $_SESSION[APPCONFIG]->GetValue('debug','file'))
&& $_SESSION[APPCONFIG]->GetValue('debug','level'))

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/config_default.php,v 1.27.2.5 2008/01/10 12:29:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/config_default.php,v 1.27.2.7 2008/01/30 11:16:02 wurley Exp $
/**
* Configuration processing and defaults.
@ -88,6 +88,10 @@ class Config {
'desc'=>'Hide the features that may provide sensitive debugging information to the browser',
'default'=>true);
$this->default->appearance['timezone'] = array(
'desc'=>'Define our timezone, if not defined in php.ini',
'default'=>null);
/** Language
* The language setting. If you set this to 'auto', phpLDAPadmin will
* attempt to determine your language automatically. Otherwise, available
@ -189,9 +193,13 @@ class Config {
'desc'=>'LDAP attribute to show in the tree',
'default'=>'%rdn');
$this->default->appearance['tree_height'] = array(
'desc'=>'Pixel height of the tree browser',
'default'=>null);
$this->default->appearance['tree_width'] = array(
'desc'=>'Pixel width of the left frame view (tree browser)',
'default'=>320);
'desc'=>'Pixel width of the tree browser',
'default'=>null);
/**
* Tree display filter
@ -316,7 +324,7 @@ class Config {
'default'=>null);
$this->default->debug['addr'] = array(
'desc'=>'IP address of PLA client to provide debugging info.',
'desc'=>'IP address of client to provide debugging info.',
'default'=>null);
$this->default->debug['append'] = array(
@ -500,10 +508,10 @@ class Config {
if (! isset($config[$key]))
error(sprintf('A call was made in [%s] to GetValue requesting [%s] that isnt predefined.',
basename($_SERVER['PHP_SELF']),$key));
basename($_SERVER['PHP_SELF']),$key),'error',true);
if (! isset($config[$key][$index]))
error("Requesting a index [$index] that isnt predefined.");
error(sprintf('Requesting an index [%s] in key [%s] that isnt predefined.',$index,$key),'error',true);
return isset($config[$key][$index]['value']) ? $config[$key][$index]['value'] : $config[$key][$index]['default'];
}
@ -518,23 +526,23 @@ class Config {
if (isset($this->default->$masterkey)) {
if (! is_array($masterdetails))
error("Error in configuration file, [$masterdetails] should be an ARRAY.");
error(sprintf('Error in configuration file, [%s] should be an ARRAY.',$masterdetails),'error',true);
foreach ($masterdetails as $key => $value) {
# Test that the key is correct.
if (! in_array($key,array_keys($this->default->$masterkey)))
error("Error in configuration file, [$key] has not been defined as a PLA configurable variable.");
error(sprintf('Error in configuration file, [%s] has not been defined as a configurable variable.',$key),'error',true);
# Test if its should be an array or not.
if (is_array($this->default->{$masterkey}[$key]['default']) && ! is_array($value))
error("Error in configuration file, {$masterkey}['$key'] SHOULD be an array of values.");
error(sprintf('Error in configuration file, %s[\'%s\'] SHOULD be an array of values.',$masterkey,$key),'error',true);
if (! is_array($this->default->{$masterkey}[$key]['default']) && is_array($value))
error("Error in configuration file, {$masterkey}['$key'] should NOT be an array of values.");
error(sprintf('Error in configuration file, %s[\'%s\'] should NOT be an array of values.',$masterkey,$key),'error',true);
}
} else {
error("Error in configuration file, [$masterkey] has not been defined as a PLA MASTER configurable variable.");
error(sprintf('Error in configuration file, [%s] has not been defined as a MASTER configurable variable.',$masterkey),'error',true);
}
}
}

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/functions.php,v 1.303.2.21 2008/01/10 12:30:13 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/functions.php,v 1.303.2.26 2008/01/30 11:17:00 wurley Exp $
/**
* A collection of common generic functions used throughout the application.
@ -151,7 +151,7 @@ function pla_error_handler($errno,$errstr,$file,$lineno) {
}
# If this is a more serious error, call the error call.
error(sprintf('%s: %s',$errtype,$errstr),'error',-1,true,true);
error(sprintf('%s: %s',$errtype,$errstr),'error',true,true);
}
/**
@ -223,35 +223,35 @@ function check_config($config_file) {
# Make sure their PHP version is current enough
if (strcmp(phpversion(),REQUIRED_PHP_VERSION) < 0)
pla_error(sprintf('phpLDAPadmin requires PHP version %s or greater.<br /><small>(You are using %s)</small>',
REQUIRED_PHP_VERSION,phpversion()));
system_message(array(
'title'=>_('Incorrect version of PHP'),
'body'=>sprintf('phpLDAPadmin requires PHP version %s or greater.<br /><small>(You are using %s)</small>',
REQUIRED_PHP_VERSION,phpversion()),
'type'=>'error'));
# Make sure this PHP install has all our required extensions
if (! extension_loaded('ldap'))
system_message(array(
'title'=>_('Missing required extension'),
'body'=> 'Your install of PHP appears to be missing LDAP support.<br /><br />Please install LDAP support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'body'=>'Your install of PHP appears to be missing LDAP support.<br /><br />Please install LDAP support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error'));
# Make sure that we have php-xml loaded.
if (! function_exists('xml_parser_create'))
system_message(array(
'title'=>_('Missing required extension'),
'body'=> 'Your install of PHP appears to be missing XML support.<br /><br />Please install XML support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'body'=>'Your install of PHP appears to be missing XML support.<br /><br />Please install XML support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error'));
# Make sure their session save path is writable, if they are using a file system session module, that is.
if (! strcasecmp('Files',session_module_name() && ! is_writable(realpath(session_save_path()))))
system_message(array(
'title'=>_('Missing required extension'),
'body'=> 'Your PHP session configuration is incorrect. Please check the value of session.save_path in your php.ini to ensure that the directory specified there exists and is writable. The current setting of "'.session_save_path().'" is un-writable by the web server.',
'title'=>_('PHP session configuration incorrect'),
'body'=>sprintf('Your PHP session configuration is incorrect. Please check the value of session.save_path in your php.ini to ensure that the directory specified there exists and is writable. The current setting of "%s" is un-writable by the web server.',session_save_path()),
'type'=>'error'));
$config = new Config;
/* Check for syntax errors in config.php
As of php 4.3.5, this NO longer catches fatal errors :( */
ob_start();
require $config_file;
$str = '';
@ -272,48 +272,41 @@ function check_config($config_file) {
$file = file($config_file);
echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"'."\n";
echo ' "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">'."\n";
echo "\n";
$body = '<h3 class="title">Config file ERROR</h3>';
$body .= sprintf('<h3 class="subtitle">%s (%s) on line %s</h3>',$error_type,$error,$line_num);
echo '<html>';
echo '<head>';
echo '<title>phpLDAPadmin Config File Error</title>';
echo '<link type="text/css" rel="stylesheet" href="css/style.css" />';
echo '</head>';
$body .= '<center>';
$body .= sprintf('Looks like your config file has an ERROR on line %s.<br />',$line_num);
$body .= 'Here is a snippet around that line <br />';
$body .= '<br />'."\n";
echo '<body>';
echo '<h3 class="title">Config File ERROR</h3>';
printf('<h3 class="subtitle">%s (%s) on line %s</h3>',$error_type,$error,$line_num);
echo '<center>';
printf('Looks like your config file has an ERROR on line %s.<br />',$line_num);
echo 'Here is a snippet around that line <br />';
echo '<br />'."\n";
echo '<div style="text-align: left; font-family: monospace; margin-left: 80px; margin-right: 80px; border: 1px solid black; padding: 10px;">';
$body .= '<div style="text-align: left; font-family: monospace; margin-left: 80px; margin-right: 80px; border: 1px solid black; padding: 10px;">';
for ($i = $line_num-9; $i<$line_num+5; $i++) {
if ($i+1 == $line_num)
echo '<div style="color:red;background:#fdd">';
$body .= '<div style="color:red;background:#fdd">';
if ($i < 0)
continue;
printf('<b>%s</b>: %s<br />',$i+1,htmlspecialchars($file[$i]));
$body .= sprintf('<b>%s</b>: %s<br />',$i+1,htmlspecialchars($file[$i]));
if ($i+1 == $line_num)
echo '</div>';
$body .= '</div>';
}
echo '</div>';
echo '<br />';
echo 'Hint: Sometimes these errors are caused by lines <b>preceding</b> the line reported.';
echo '</center>';
echo '</body>';
echo '</html>';
$body .= '</div>';
$body .= '<br />';
$body .= 'Hint: Sometimes these errors are caused by lines <b>preceding</b> the line reported.';
$body .= '</center>';
return false;
$block = new block();
$block->SetBody($body);
$www['page'] = new page();
$www['page']->block_add('body',$block);
$www['page']->display();
die();
}
}
@ -515,7 +508,7 @@ function error($msg,$type='note',$fatal=false,$backtrace=false) {
# if the error is fatal, we'll need to stop here.
if (! isset($www['page']))
$www['page'] = new page(null);
$www['page'] = new page();
$www['page']->setsysmsg(array('title'=>_('Error'),'body'=>$msg,'type'=>$type));
@ -530,7 +523,7 @@ function error($msg,$type='note',$fatal=false,$backtrace=false) {
$backtraceblock = new block();
$backtraceblock->SetTitle('PHP Debug Backtrace');
$body = '<table class="search_result_table">';
$body = '<table class="result_table">';
$body .= "\n";
foreach (debug_backtrace() as $error => $line) {
$body .= sprintf('<tr class="hightlight"><td colspan="2"><b><small>%s</small></b></td><td>%s (%s)</td></tr>',
@ -1755,8 +1748,8 @@ function support_oid_to_text($oid_id) {
*/
function pla_error($msg,$ldap_err_msg=null,$ldap_err_no=-1,$fatal=true) {
if (defined('DEBUG_ENABLED') && (DEBUG_ENABLED))
debug_log('Entered with (%s,%s,%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,
$msg,$ldap_err_msg,$ldap_err_no,$fatal,$backtrace);
debug_log('Entered with (%s,%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,
$msg,$ldap_err_msg,$ldap_err_no,$fatal);
$title = '';
@ -2928,13 +2921,15 @@ function server_info_list($visible=false) {
return $server_info_list;
}
function enc_type_select_list($enc_type) {
function enc_type_select_list($enc_type,$id,$attribute,$i) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s)',1,__FILE__,__LINE__,__METHOD__,$enc_type);
debug_log('Entered with (%s,%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,$enc_type,$id,$attribute,$i);
$html = sprintf('<select id="%s_%s_%s" name="%s[%s][%s]">',
$id, htmlspecialchars($attribute->getName()), $i,
$id, htmlspecialchars($attribute->getName()), $i);
$html = '<select name="enc_type[]">';
$html .= '<option>clear</option>';
foreach (array('crypt','ext_des','md5crypt','blowfish','md5','smd5','sha','ssha') as $option)
$html .= sprintf('<option%s>%s</option>',($enc_type == $option ? ' selected="true"' : ''),$option);

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/page.php,v 1.3.2.13 2008/01/10 12:30:14 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/page.php,v 1.3.2.14 2008/01/27 11:57:39 wurley Exp $
/**
* Page Rendering Functions
@ -107,17 +107,17 @@ class page {
# Style sheet.
printf('<link type="text/css" rel="stylesheet" href="%s" />',$this->_app['urlcss']);
printf('<link rel="shortcut icon" href="%s/images/favicon.ico" type="image/vnd.microsoft.icon" />','../htdocs/');
printf('<link rel="shortcut icon" href="%s/favicon.ico" type="image/vnd.microsoft.icon" />',IMGDIR);
if (defined('JSDIR')) {
printf('<link type="text/css" rel="stylesheet" media="all" href="%sjscalendar/calendar-blue.css" title="blue" />',JSDIR);
printf('<link type="text/css" rel="stylesheet" href="%s/phplayersmenu/layerstreemenu.css" />','../htdocs/'.JSDIR);
printf('<link type="text/css" rel="stylesheet" href="%s/phplayersmenu/layerstreemenu.css" />',JSDIR);
echo "\n";
printf('<script type="text/javascript" src="%spla_ajax.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%stree_hide.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sentry_chooser.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sto_ascii.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sto_ascii.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>',JSDIR);
echo "\n";
}

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_advanced.php,v 1.26.2.1 2007/12/26 09:26:33 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_advanced.php,v 1.26.2.2 2008/01/13 05:37:02 wurley Exp $
/**
* @package phpLDAPadmin
@ -22,14 +22,15 @@ function focus_filter() {
}
</script>
<form action="cmd.php" method="get" class="search" name="advanced_search_form">
<h3 class="title"><?php echo _('Advanced Search Form'); ?></h3>
<br />
<form action="cmd.php" name="advanced_search_form">
<input type="hidden" name="cmd" value="search" />
<input type="hidden" name="search" value="true" />
<input type="hidden" name="form" value="advanced" />
<input type="hidden" name="format" value="<?php echo $entry['format']; ?>" />
<table class="search" border=0>
<tr><td class="title" colspan=2><?php echo _('Advanced Search Form'); ?></td></tr>
<table class="forminput" border=0>
<?php
$ss = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'simple_search');
@ -57,26 +58,26 @@ function focus_filter() {
<tr><td colspan=2>&nbsp;</td></tr>
<tr><td><small><?php echo _('Server'); ?></small></td><td><?php echo $server_menu_html; ?></td></tr>
<tr><td><?php echo _('Server'); ?></td><td><?php echo $server_menu_html; ?></td></tr>
<tr>
<td><small><?php echo _('Base DN'); ?></small></td>
<td><?php echo _('Base DN'); ?></td>
<td><input type="text" name="base_dn" value="<?php echo count($base_dns) == 1 ? $base_dns[0] : '' ?>" style="width: 200px" id="base_dn" />
<?php
draw_chooser_link('advanced_search_form.base_dn');
if (isset($entry['base_dn']['invalid']) && $entry['base_dn']['invalid'])
printf('<small style="color:red; white-space: nowrap">%s</small>',_('This is not a valid DN.'));
printf('<tr><td>&nbsp;</td><td><small style="color:red; white-space: nowrap">%s</small></td></tr>',_('This is not a valid DN.'));
if (isset($entry['base_dn']['exist']) && $entry['base_dn']['exist'])
printf('<small style="color:red; white-space: nowrap">%s</small>',_('This entry does not exist.'));
printf('<tr><td>&nbsp;</td><td><small style="color:red; white-space: nowrap">%s</small></td></tr>',_('This entry does not exist.'));
?>
</td>
</tr>
<tr>
<td><small><acronym title="<?php echo _('The scope in which to search'); ?>"><?php echo _('Search Scope'); ?></acronym></small></td>
<td><acronym title="<?php echo _('The scope in which to search'); ?>"><?php echo _('Search Scope'); ?></acronym></td>
<td>
<select name="scope" style="width: 200px">
<option<?php echo $entry['scope']=='sub'?' selected':''; ?> value="sub">
@ -93,14 +94,14 @@ if (isset($entry['base_dn']['exist']) && $entry['base_dn']['exist'])
</tr>
<tr>
<td><small><acronym title="<?php echo htmlspecialchars(_('Standard LDAP search filter. Example: (&(sn=Smith)(givenname=David))')); ?>">
<?php echo _('Search Filter'); ?></acronym></small></td>
<td><acronym title="<?php echo htmlspecialchars(_('Standard LDAP search filter. Example: (&(sn=Smith)(givenname=David))')); ?>">
<?php echo _('Search Filter'); ?></acronym></td>
<td><input type="text" name="filter" id="filter" style="width: 200px" value="<?php echo $entry['filter']['clean'] ? htmlspecialchars($entry['filter']['clean']) : 'objectClass=*'; ?>" /></td>
</tr>
<tr>
<td><small><acronym title="<?php echo _('A list of attributes to display in the results (comma-separated)'); ?>">
<?php echo _('Show Attributtes'); ?></acronym></small></td>
<td><acronym title="<?php echo _('A list of attributes to display in the results (comma-separated)'); ?>">
<?php echo _('Show Attributtes'); ?></acronym></td>
<td><input type="text" name="display_attrs" style="width: 200px" value="<?php
echo $entry['display']['string'] ? htmlspecialchars($entry['display']['string']) :
@ -108,7 +109,7 @@ if (isset($entry['base_dn']['exist']) && $entry['base_dn']['exist'])
</tr>
<tr>
<td><small><acronym title="<?php echo htmlspecialchars(_('Order by').'...'); ?>"><?php echo _('Order by'); ?></acronym></small></td>
<td><acronym title="<?php echo htmlspecialchars(_('Order by').'...'); ?>"><?php echo _('Order by'); ?></acronym></td>
<td><input type="text" name="orderby" id="orderby" style="width: 200px" value="<?php echo htmlspecialchars($entry['orderby']['string']) ?>" /></td>
</tr>

View File

@ -1,25 +1,26 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_predefined.php,v 1.10.2.1 2007/12/26 09:26:33 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_predefined.php,v 1.10.2.2 2008/01/13 05:37:02 wurley Exp $
/**
* @package phpLDAPadmin
*/
echo '<form action="cmd.php" method="get" class="search">';
printf('<h3 class="title">%s</h3>',_('Predefined Searches'));
echo '<br />';
echo '<form action="cmd.php">';
echo '<input type="hidden" name="cmd" value="search" />';
echo '<input type="hidden" name="search" value="true" />';
echo '<input type="hidden" name="form" value="predefined" />';
printf('<input type="hidden" name="format" value="%s" />',$entry['format']);
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
echo '<table class="search" border=0>';
echo '<table class="forminput" border=0>';
if ($entry['predefined'])
$selected_q_number = intval($entry['predefined']);
else
$selected_q_number = null;
printf('<tr><td class="title" colspan=2>%s</td></tr>',_('Predefined Searches'));
$ss = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'simple_search');
$as = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'advanced_search');
@ -42,7 +43,7 @@ if (! isset($_SESSION[APPCONFIG]->queries) || ! is_array($_SESSION[APPCONFIG]->q
} else {
echo '<tr>';
printf('<td><small>%s: </small></td>',_('Select a predefined search'));
printf('<td>%s:</td>',_('Select a predefined search'));
echo '<td>';
echo '<select name="predefined">';

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_simple.php,v 1.16.2.2 2007/12/26 09:26:33 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_simple.php,v 1.16.2.3 2008/01/13 05:37:02 wurley Exp $
/**
* @package phpLDAPadmin
@ -12,15 +12,16 @@
}
</script>
<form action="cmd.php" method="get" class="search" name="simple_search_form">
<h3 class="title"><?php echo _('Simple Search Form'); ?></h3>
<br />
<form action="cmd.php" name="simple_search_form">
<input type="hidden" name="cmd" value="search" />
<input type="hidden" name="search" value="true" />
<input type="hidden" name="form" value="simple" />
<input type="hidden" name="scope" value="sub" />
<input type="hidden" name="format" value="<?php echo $entry['format']; ?>" />
<table class="search" border=0>
<tr><td class="title"><?php echo _('Simple Search Form'); ?></td></tr>
<table class="forminput" border=0>
<?php
$as = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'advanced_search');

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_list.php,v 1.7.2.2 2007/12/26 09:26:33 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_list.php,v 1.7.2.3 2008/01/13 05:37:02 wurley Exp $
/**
* @package phpLDAPadmin
@ -17,9 +17,9 @@ foreach ($results as $dn => $dndetails) {
if ($i >= $end_entry)
break;
echo '<table class="search_result" border=0>';
echo '<table class="result" border=0>';
echo '<tr class="list_dn">';
echo '<tr class="list_title">';
printf('<td class="icon"><img src="images/%s" alt="icon" /></td>',get_icon($ldapserver,$dn));
$formatted_dn = get_rdn($dn);
@ -33,7 +33,7 @@ foreach ($results as $dn => $dndetails) {
echo '</tr>';
if ($_SESSION[APPCONFIG]->isCommandAvailable('schema')) {
printf('<tr class="list_attr"><td class="blank">&nbsp;</td><td class="attr">dn</td><td class="val">%s</td></tr>',htmlspecialchars(dn_unescape($dn)));
printf('<tr class="list_item"><td class="blank">&nbsp;</td><td class="heading">dn</td><td class="value">%s</td></tr>',htmlspecialchars(dn_unescape($dn)));
}
# Iterate over each attribute for this entry
@ -45,11 +45,11 @@ foreach ($results as $dn => $dndetails) {
if ($ldapserver->isAttrBinary($attr))
$values = array('(binary)');
echo '<tr class="list_attr">';
echo '<tr class="list_item">';
echo '<td class="blank">&nbsp;</td>';
printf('<td class="attr" valign="top">%s</td>',$_SESSION[APPCONFIG]->getFriendlyHTML($attr));
printf('<td class="heading" valign="top">%s</td>',$_SESSION[APPCONFIG]->getFriendlyHTML($attr));
echo '<td class="val">';
echo '<td class="value">';
if ($ldapserver->isJpegPhoto($attr))
draw_jpeg_photos($ldapserver,$dn,$attr,false,false,'align="left"');

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_table.php,v 1.9.2.2 2007/12/26 09:26:33 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_table.php,v 1.9.2.3 2008/01/13 05:37:02 wurley Exp $
/**
* Incoming variables (among others)
@ -91,7 +91,7 @@ $header_row .= '</tr>';
# Begin drawing table
echo '<br />';
echo '<center>';
echo '<table class="search_result_table">';
echo '<table class="result_table">';
for ($i=0;$i<count($entries_display);$i++) {
$result = $entries_display[$i];
@ -99,10 +99,7 @@ for ($i=0;$i<count($entries_display);$i++) {
if ($i %10 == 0)
echo $header_row;
if ($i % 2 == 0 )
echo '<tr class="highlight">';
else
echo '<tr>';
printf('<tr class="%s">',$i%2 ? 'even' : 'odd');
foreach ($all_attrs as $attr) {
echo '<td>';

View File

@ -1,5 +1,5 @@
<?php
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/server_functions.php,v 1.51.2.6 2007/12/31 06:27:34 wurley Exp $ */
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/server_functions.php,v 1.51.2.7 2008/01/31 12:34:26 wurley Exp $ */
/**
* Classes and functions for LDAP server configuration and capability
@ -92,7 +92,7 @@ class LDAPserver {
$return = true;
} else {
pla_error(sprintf(_('Error: You have an error in your config file. The only three allowed values for auth_type in the $servers section are \'session\', \'cookie\', and \'config\'. You entered \'%s\', which is not allowed.'),htmlspecialchars($this->auth_type)));
error(sprintf(_('Error: You have an error in your config file. The only three allowed values for auth_type in the $servers section are \'session\', \'cookie\', and \'config\'. You entered \'%s\', which is not allowed.'),htmlspecialchars($this->auth_type)),'error',true);
}
if (DEBUG_ENABLED)
@ -130,6 +130,8 @@ class LDAPserver {
debug_log('Creating new connection [%s] for Server ID [%s]',16,__FILE__,__LINE__,__METHOD__,
$connect_id,$this->server_id);
$this->connection[$connect_id]['resource'] = null;
# Grab the AUTH INFO based on the auth_type for this server
if ($connect_id == 'anonymous') {
if (DEBUG_ENABLED)
@ -259,8 +261,8 @@ class LDAPserver {
# Try to fire up TLS is specified in the config
if ($this->isTLSEnabled()) {
function_exists('ldap_start_tls') or pla_error(_('Your PHP install does not support TLS.'));
@ldap_start_tls($resource) or pla_error(_('Could not start TLS. Please check your LDAP server configuration.'),ldap_error($resource));
function_exists('ldap_start_tls') or error(_('Your PHP install does not support TLS.'),'error');
@ldap_start_tls($resource) or error(_('Could not start TLS. Please check your LDAP server configuration.'),'error',true);
}
$bind_result = false;
@ -274,7 +276,7 @@ class LDAPserver {
# No support for ldap_sasl_bind?
if (! function_exists('ldap_sasl_bind'))
pla_error(_('Your PHP installation does not support ldap_sasl_bind() function. This function is present in PHP 5.x when compiled with --with-ldap-sasl.'));
error(_('Your PHP installation does not support ldap_sasl_bind() function. This function is present in PHP 5.x when compiled with --with-ldap-sasl.'),'error');
# Fill variables
$props = $this->connection[$connect_id]['sasl_props'];
@ -336,16 +338,16 @@ class LDAPserver {
if ($process_error) {
switch (ldap_errno($resource)) {
case 0x31:
error(_('Bad username or password. Please try again.'),'error',true);
error(_('Bad username or password. Please try again.'),'error');
break;
case 0x32:
error(_('Insufficient access rights.'),'error',true);
error(_('Insufficient access rights.'),'error');
break;
case -1:
error(sprintf(_('Could not connect to "%s" on port "%s"'),$host,$port),'error',true);
error(sprintf(_('Could not connect to "%s" on port "%s"'),$host,$port),'error');
break;
default:
error(_('Could not bind to the LDAP server (%s).',ldap_err2str($resource),$resource),'error',true);
error(_('Could not bind to the LDAP server (%s).',ldap_err2str($resource),$resource),'error');
}
} else {

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/session_functions.php,v 1.18.2.3 2007/12/29 08:24:11 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/session_functions.php,v 1.18.2.4 2008/01/13 06:35:51 wurley Exp $
/**
* A collection of functions to handle sessions throughout phpLDAPadmin.
@ -69,7 +69,7 @@ function pla_session_verify_id() {
function pla_session_param() {
/* If cookies were disabled, build the url parameter for the session id.
It will be append to the url to be redirect */
* It will be append to the url to be redirect */
return (SID != '') ? sprintf('&%s=%s',session_name(),session_id()) : '';
}
@ -121,9 +121,9 @@ function pla_session_start() {
# Check we have the correct version of the SESSION cache
if (isset($_SESSION['cache']) || isset($_SESSION[pla_session_id_init])) {
if (!is_array($_SESSION[pla_session_id_init])) $_SESSION[pla_session_id_init] = array();
if (! is_array($_SESSION[pla_session_id_init])) $_SESSION[pla_session_id_init] = array();
if (!isset($_SESSION[pla_session_id_init]['version']) || !isset($_SESSION[pla_session_id_init]['config'])
if (! isset($_SESSION[pla_session_id_init]['version']) || ! isset($_SESSION[pla_session_id_init]['config'])
|| $_SESSION[pla_session_id_init]['version'] !== pla_version()
|| $_SESSION[pla_session_id_init]['config'] != filemtime(CONFDIR.'config.php')) {
@ -160,6 +160,6 @@ function pla_session_start() {
* Stops the current session.
*/
function pla_session_close() {
@session_write_close();
@session_write_close();
}
?>

View File

@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/timeout_functions.php,v 1.10.2.1 2007/12/29 08:24:11 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/timeout_functions.php,v 1.10.2.2 2008/01/27 05:11:41 wurley Exp $
/**
* A collection of functions used throughout phpLDAPadmin for the timeout and automatic logout feature
@ -11,7 +11,6 @@
/**
* Responsible for setting/updating two session-vars that are used for the timeout and auto logout feature:
* - "activity" var records the server last activity.
* - "rightframe_server_id" var records the ID of the server active on the right frame.
* where X is the * ID of the server which the user is working on
*
* @param object $ldapserver The LDAPServer object of the server which the user has logged in.
@ -22,7 +21,6 @@ function set_lastactivity($ldapserver) {
debug_log('Entered with (%s)',1,__FILE__,__LINE__,__METHOD__,$ldapserver->server_id);
$_SESSION['activity']['server'][$ldapserver->server_id] = time();
$_SESSION['activity']['rightframe_server_id'] = $ldapserver->server_id;
return true;
}
@ -63,7 +61,7 @@ function session_timed_out($ldapserver) {
else
$session_timeout = $ldapserver->session_timeout;
# Get the $last_activity and $rightframe_server_id value
# Get the $last_activity value
$last_activity = $_SESSION['activity']['server'][$ldapserver->server_id];
# If diff between current time and last activity greater than $session_timeout, log out user

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff