RELEASE 1.0.2

This commit is contained in:
Deon George
2009-06-30 20:41:18 +10:00
parent 5f261ded38
commit a08bc4e9e1
67 changed files with 4036 additions and 719 deletions

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.14 2005/12/10 10:34:54 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.15 2006/10/28 07:22:39 wurley Exp $
/**
* Displays a form for adding an attribute/value to an LDAP entry.
@@ -16,166 +16,163 @@
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( _('You cannot perform updates while server is in read-only mode') );
if( ! $ldapserver->haveAuthInfo())
pla_error( _('Not enough information to login to server. Please check your configuration.') );
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
$dn = $_GET['dn'];
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$encoded_dn = rawurlencode($dn);
$rdn = get_rdn($dn);
$friendly_attrs = process_friendly_attr_table();
include './header.php'; ?>
include './header.php';
<body>
echo '<body>';
<h3 class="title"><?php echo sprintf( _('Add new attribute'), htmlspecialchars( $rdn ) ); ?></b></h3>
<h3 class="subtitle"><?php echo _('Server'); ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo _('Distinguished Name'); ?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
printf('<h3 class="title">%s <b>%s</b></h3>',_('Add new attribute'),htmlspecialchars($rdn));
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn));
<?php $attrs = $ldapserver->getDNAttrs($dn);
$attrs = $ldapserver->getDNAttrs($dn);
$oclasses = $ldapserver->getDNAttr($dn,'objectClass');
if( ! is_array( $oclasses ) )
$oclasses = array( $oclasses );
if (! is_array($oclasses))
$oclasses = array($oclasses);
$avail_attrs = array();
$schema_oclasses = $ldapserver->SchemaObjectClasses($dn);
foreach( $oclasses as $oclass ) {
$schema_oclass = $ldapserver->getSchemaObjectClass($oclass,$dn);
if (array_search('extensibleObject',$oclasses) !== FALSE) {
$schema_attrs = $ldapserver->SchemaAttributes();
if( $schema_oclass && 0 == strcasecmp( 'objectclass', get_class( $schema_oclass ) ) )
$avail_attrs = array_merge( $schema_oclass->getMustAttrNames( $schema_oclasses ),
$schema_oclass->getMayAttrNames( $schema_oclasses ),
$avail_attrs );
foreach ($schema_attrs as $attr)
$avail_attrs[]=$attr->getName();
} else {
$schema_oclasses = $ldapserver->SchemaObjectClasses($dn);
foreach ($oclasses as $oclass) {
$schema_oclass = $ldapserver->getSchemaObjectClass($oclass,$dn);
if ($schema_oclass && strcasecmp('objectclass',get_class($schema_oclass)) == 0)
$avail_attrs = array_merge($schema_oclass->getMustAttrNames($schema_oclasses),
$schema_oclass->getMayAttrNames($schema_oclasses),
$avail_attrs);
}
}
$avail_attrs = array_unique( $avail_attrs );
$avail_attrs = array_filter( $avail_attrs, "not_an_attr" );
sort( $avail_attrs );
$avail_attrs = array_unique($avail_attrs);
$avail_attrs = array_filter($avail_attrs,'not_an_attr');
sort($avail_attrs);
$avail_binary_attrs = array();
foreach( $avail_attrs as $i => $attr ) {
foreach ($avail_attrs as $i => $attr) {
if ($ldapserver->isAttrBinary($attr)) {
$avail_binary_attrs[] = $attr;
unset( $avail_attrs[ $i ] );
unset($avail_attrs[$i]);
}
}
?>
<br />
echo '<center>';
<center>
if (is_array($avail_attrs) && count($avail_attrs) > 0) {
echo '<br />';
echo _('Add new attribute');
echo '<br />';
echo '<br />';
<?php echo _('Add new attribute');
echo '<form action="add_attr.php" method="post">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
if( is_array( $avail_attrs ) && count( $avail_attrs ) > 0 ) { ?>
echo '<select name="attr">';
<br />
<br />
$attr_select_html = '';
usort($avail_attrs,'sortAttrs');
<form action="add_attr.php" method="post">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
foreach ($avail_attrs as $a) {
<select name="attr">
<?php $attr_select_html = '';
usort($avail_attrs,"sortAttrs");
foreach( $avail_attrs as $a ) {
// is there a user-friendly translation available for this attribute?
if( isset( $friendly_attrs[ strtolower( $a ) ] ) ) {
$attr_display = htmlspecialchars( $friendly_attrs[ strtolower( $a ) ] ) . " (" .
htmlspecialchars($a) . ")";
# is there a user-friendly translation available for this attribute?
if (isset($friendly_attrs[strtolower($a)])) {
$attr_display = sprintf('%s (%s)',
htmlspecialchars($friendly_attrs[strtolower($a)]),
htmlspecialchars($a));
} else {
$attr_display = htmlspecialchars( $a );
$attr_display = htmlspecialchars($a);
}
echo $attr_display;
$attr_select_html .= "<option>$attr_display</option>\n";
echo "<option value=\"" . htmlspecialchars($a) . "\">$attr_display</option>";
} ?>
printf('<option value="%s">%s</option>',htmlspecialchars($a),$attr_display);
}
</select>
echo '</select>';
<input type="text" name="val" size="20" />
<input type="submit" name="submit" value="<?php echo _('Add'); ?>" class="update_dn" />
</form>
echo '<input type="text" name="val" size="20" />';
printf('<input type="submit" name="submit" value="%s" class="update_dn" />',_('Add'));
echo '</form>';
<?php } else { ?>
} else {
echo '<br />';
printf('<small>(%s)</small>',_('no new attributes available for this entry'));
}
<br />
<br />
<small>(<?php echo _('no new attributes available for this entry'); ?>)</small>
<br />
<br />
if (count($avail_binary_attrs) > 0) {
echo '<br />';
echo _('Add new binary attribute');
echo '<br />';
echo '<br />';
<?php } ?>
echo '<!-- Form to add a new BINARY attribute to this entry -->';
echo '<form action="add_attr.php" method="post" enctype="multipart/form-data">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',$dn);
echo '<input type="hidden" name="binary" value="true" />';
<?php echo _('Add new binary attribute');
if( count( $avail_binary_attrs ) > 0 ) { ?>
echo '<select name="attr">';
<!-- Form to add a new BINARY attribute to this entry -->
<form action="add_attr.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="binary" value="true" />
<br />
$attr_select_html = '';
usort($avail_binary_attrs,'sortAttrs');
<select name="attr">
foreach ($avail_binary_attrs as $a) {
<?php $attr_select_html = '';
usort($avail_binary_attrs,"sortAttrs");
foreach( $avail_binary_attrs as $a ) {
// is there a user-friendly translation available for this attribute?
if( isset( $friendly_attrs[ strtolower( $a ) ] ) ) {
$attr_display = htmlspecialchars( $friendly_attrs[ strtolower( $a ) ] ) . " (" .
htmlspecialchars($a) . ")";
# is there a user-friendly translation available for this attribute?
if (isset($friendly_attrs[strtolower($a)])) {
$attr_display = sprintf('%s (%s)',
htmlspecialchars($friendly_attrs[strtolower($a)]),
htmlspecialchars($a));
} else {
$attr_display = htmlspecialchars( $a );
$attr_display = htmlspecialchars($a);
}
echo $attr_display;
$attr_select_html .= "<option>$attr_display</option>\n";
echo "<option value=\"" . htmlspecialchars($a) . "\">$attr_display</option>";
} ?>
printf('<option value="%s">%s</option>',htmlspecialchars($a),$attr_display);
}
</select>
echo '</select>';
<input type="file" name="val" size="20" />
<input type="submit" name="submit" value="<?php echo _('Add'); ?>" class="update_dn" />
echo '<input type="file" name="val" size="20" />';
printf('<input type="submit" name="submit" value="%s" class="update_dn" />',_('Add'));
<?php if( ! ini_get( 'file_uploads' ) )
echo "<br><small><b>" . _('Your PHP configuration has disabled file uploads. Please check php.ini before proceeding.') . "</b></small><br>";
if (! ini_get('file_uploads'))
printf('<br /><small><b>%s</b></small><br />',
_('Your PHP configuration has disabled file uploads. Please check php.ini before proceeding.'));
else
echo "<br><small><b>" . sprintf( _('Maximum file size: %s'), ini_get( 'upload_max_filesize' ) ) . "</b></small><br>";
?>
printf('<br /><small><b>%s: %s</b></small><br />',_('Maximum file size'),ini_get('upload_max_filesize'));
</form>
echo '</form>';
<?php } else { ?>
} else {
echo '<br />';
printf('<small>(%s)</small>',_('no new binary attributes available for this entry'));
}
<br />
<br />
<small>(<?php echo _('no new binary attributes available for this entry'); ?>)</small>
<?php } ?>
</center>
</body>
</html>
<?php
echo '</center>';
echo '</body>';
echo '</html>';
/**
* Given an attribute $x, this returns true if it is NOT already specified
@@ -185,13 +182,13 @@ if( count( $avail_binary_attrs ) > 0 ) { ?>
* @return bool
* @ignore
*/
function not_an_attr( $x ) {
function not_an_attr($x) {
global $attrs;
//return ! isset( $attrs[ strtolower( $x ) ] );
foreach( $attrs as $attr => $values )
if( 0 == strcasecmp( $attr, $x ) )
foreach($attrs as $attr => $values)
if (strcasecmp($attr,$x) == 0)
return false;
return true;
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.36 2005/12/17 00:00:11 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.38 2006/10/29 12:49:24 wurley Exp $
/**
* Displays a form to allow the user to enter a new value to add
@@ -34,10 +34,16 @@ else
$rdn = null;
$current_values = $ldapserver->getDNAttr($dn,$attr);
if ($current_values)
$num_current_values = (is_array($current_values) ? count($current_values) : 1);
else
if ($current_values) {
if (! is_array($current_values))
$current_values = array($current_values);
$num_current_values = count($current_values);
} else {
$current_values = array();
$num_current_values = 0;
}
$is_object_class = (strcasecmp($attr, 'objectClass') == 0) ? true : false;
@@ -107,18 +113,18 @@ if ($num_current_values) {
if (strcasecmp($attr,'userPassword') == 0) {
foreach ($current_values as $key => $value) {
if (obfuscate_password_display(get_enc_type($value)))
echo '<li><nobr>'.preg_replace('/./','*',$value).'<br /></li>';
echo '<li><span style="white-space: nowrap;">'.preg_replace('/./','*',$value).'<br /></li>';
else
echo '<li><nobr>'.htmlspecialchars($value).'<br /></li>';
echo '<li><span style="white-space: nowrap;">'.htmlspecialchars($value).'<br /></li>';
}
} else {
foreach ($current_values as $val)
printf('<li><nobr>%s</nobr></li>',htmlspecialchars($val));
printf('<li><span style="white-space: nowrap;">%s</span></li>',htmlspecialchars($val));
}
} else {
printf('<li><nobr>%s</nobr></li>',htmlspecialchars($current_values));
printf('<li><span style="white-space: nowrap;">%s</span></li>',htmlspecialchars($current_values));
}
echo '</ul>';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/collapse.php,v 1.14 2005/12/10 10:34:54 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/collapse.php,v 1.15 2006/10/28 11:42:10 wurley Exp $
/**
* This script alters the session variable 'tree', collapsing it
@@ -23,17 +23,11 @@ $tree = get_cached_item($ldapserver->server_id,'tree');
$tree['browser'][$dn]['open'] = false;
set_cached_item($ldapserver->server_id,'tree','null',$tree);
/* This is for Opera. By putting "random junk" in the query string, it thinks
that it does not have a cached version of the page, and will thus
fetch the page rather than display the cached version */
$time = gettimeofday();
$random_junk = md5(strtotime('now').$time['usec']);
/* If cookies were disabled, build the url parameter for the session id.
It will be append to the url to be redirect */
$id_session_param = '';
if (SID != '')
$id_session_param = sprintf('&%s=%s',session_name(),session_id());
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,rawurlencode($dn),$id_session_param));
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',random_junk(),$ldapserver->server_id,rawurlencode($dn),$id_session_param));
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.14 2006/01/03 20:39:58 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.15 2006/09/17 06:35:11 wurley Exp $
/**
* Compare two DNs - the destination DN is editable.
@@ -163,7 +163,7 @@ foreach ($attrs_all as $attr) {
if ($side == 'src') { ?>
<td class="attr">
<?php $schema_href="schema.php?server_id=$server_id_src&amp;view=attributes&amp;viewvalue=".real_attr_name($attr); ?>
<b><a title="<?php echo sprintf(_('Click to view the schema defintion for attribute type \'%s\''),$attr) ?>" href="<?php echo $schema_href; ?>"><?php echo $attr_display; ?></a></b>
<b><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></b>
</td>
<td class="attr_note">

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.39 2006/01/03 20:39:58 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.43 2007/03/18 01:30:33 wurley Exp $
/**
* Copies a given object to create a new one.
@@ -88,7 +88,7 @@ if ($copy_result) {
if ($do_remove) {
sleep(2);
$delete_url = sprintf('delete_form.php?server_id=%s&dn=%s',$server_id_dst,rawurlencode($dn_src));
$delete_url = sprintf('delete_form.php?server_id=%s&dn=%s',$server_id_src,rawurlencode($dn_src));
echo '<!-- redirect to the delete form -->';
printf('<script type="text/javascript" language="javascript">parent.right_frame.location="%s" </script>',$delete_url);
}
@@ -99,7 +99,7 @@ function r_copy_dn($ldapserver_src,$ldapserver_dst,$snapshottree,$root_dn,$dn_ds
debug_log('r_copy_dn: Entered with (%s,%s,%s,%s,%s)',1,
$ldapserver_src->server_id,$ldapserver_dst->server_id,$snapshottree,$root_dn,$dn_dst);
printf('<nobr>%s %s...',_('Copying '),htmlspecialchars($root_dn));
printf('<span style="white-space: nowrap;">%s %s...',_('Copying'),htmlspecialchars($root_dn));
flush();
$copy_result = copy_dn($ldapserver_src,$ldapserver_dst,$root_dn,$dn_dst);
@@ -107,7 +107,7 @@ function r_copy_dn($ldapserver_src,$ldapserver_dst,$snapshottree,$root_dn,$dn_ds
if (! $copy_result)
return false;
printf('<span style="color:green">%s</span></nobr><br />',_('Success'));
printf('<span style="color:green">%s</span><br />',_('Success'));
flush();
$children = isset($snapshottree[$root_dn]) ? $snapshottree[$root_dn] : null;
@@ -172,6 +172,7 @@ function build_tree($ldapserver,$dn,$buildtree) {
debug_log('build_tree: Entered with (%s,%s,%s)',1,
$ldapserver->server_id,$dn,$buildtree);
# we search all children, not only the visible children in the tree
$children = $ldapserver->getContainerContents($dn,0);
if (is_array($children) && count($children) > 0) {

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.27 2006/04/29 06:49:31 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.29 2007/03/18 02:18:14 wurley Exp $
/**
* Copies a given object to create a new one.

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.46 2006/02/19 05:44:34 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.47 2006/10/28 16:37:59 wurley Exp $
/**
* Creates a new object.
@@ -35,7 +35,7 @@ $redirect = isset($_POST['redirect']) ? $_POST['redirect'] : false;
# See if there are any presubmit values to work out.
if (isset($_POST['presubmit']) && count($_POST['presubmit']) && isset($_POST['template'])) {
$templates = new Templates($ldapserver->server_id);
$template = $templates->GetTemplate($_POST['template']);
$template = $templates->getCreationTemplate($_POST['template']);
foreach ($_POST['presubmit'] as $attr) {
$_POST['attrs'][] = $attr;

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create_form.php,v 1.33 2006/01/03 20:39:58 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create_form.php,v 1.34 2006/10/28 16:37:59 wurley Exp $
/**
* The menu where the user chooses an RDN, Container, and Template for creating a new entry.
@@ -51,7 +51,7 @@ echo '<table class="templates">';
$i = -1;
$template_xml = new Templates($ldapserver->server_id);
$templates = $template_xml->_template;
$templates = $template_xml->getCreationTemplates();
# Remove non-visable templates.
foreach ($templates as $index => $template)

View File

@@ -1,4 +1,4 @@
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.45 2005/12/10 10:34:54 wurley Exp $ */
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.47 2006/10/29 11:44:36 wurley Exp $ */
span.hint {
font-size: small;
font-weight: normal;
@@ -56,40 +56,89 @@ table.schema_attr tr.highlight{
font-weight: Bold;
}
table.modify_members {
border-left: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
border-top: 1px solid black;
margin-bottom: 10px;
background-color: #eee;
width: 80%;
}
table.modify_members td {
vertical-align: top;
text-align: left;
padding-left: 5px;
}
table.modify_members th {
background-color: #016;
padding: 5px;
color: white;
font-weight: bold;
font-size: 125%;
}
table.modify_members td {
padding: 5px;
vertical-align: top;
}
table.modify_members tr.even {
background-color: #eee;
}
table.modify_members tr.odd {
background-color: #ccc;
}
table.modify_members tr.highlight {
background-color: #bcd;
font-weight: Bold;
}
table.modify_members select {
width: 100%;
}
/* Bug Notice */
table.notice tr td {
font-size: 9pt;
padding: 2px;
margin: 0px;
background-color: #eee;
background-color: #eeeeee;
}
/* Error Dialog Box */
table.error {
width: 500px;
border: 2px solid black;
border: 1px solid #aa0000;
background-color: #fff0f0;
}
table.error tr td table.bug tr td{
padding: 6px;
margin: 0px;
background-color: #eee;
}
table.error tr td {
vertical-align: top;
text-align: left;
padding: 15px;
table.error th {
background-color: #aa0000;
border: 0px;
color: #ffffff;
font-size: 12pt;
font-weight: bold;
text-align: center;
vertical-align: middle;
width: 100%;
}
table.error tr td h2 {
margin: 5px;
margin-bottom: 20px;
}
table.error tr td.img {
table.error th.img {
vertical-align: middle;
text-align: center;
width: 20px;
}
table.error td {
border: 0px;
background-color: #fff0f0;
padding: 2px;
text-align: left;
vertical-align: top;
}
table.confirm th {
@@ -131,7 +180,7 @@ table.browse tr td {
}
table.template_display tr td {
vertical-align: top;
vertical-align: top;
}
table.templates tr td {
@@ -346,7 +395,7 @@ table.edit_dn tr td.heading {
}
table.edit_dn tr td.attr_note {
text-align: right;
text-align: right;
background-color: #eee;
}
@@ -480,26 +529,26 @@ form.new_value {
}
table.search_result_table {
border-spacing: 0;
border-collapse: collapse;
empty-cells: show;
border-spacing: 0;
border-collapse: collapse;
empty-cells: show;
}
table.search_result_table td {
vertical-align: top;
border: 1px solid gray;
padding: 4px;
vertical-align: top;
border: 1px solid gray;
padding: 4px;
}
table.search_result_table th {
border: 1px solid gray;
padding: 10px;
padding-left: 20px;
padding-right: 20px;
border: 1px solid gray;
padding: 10px;
padding-left: 20px;
padding-right: 20px;
}
table.search_result_table tr.highlight {
background-color: #eee;
background-color: #eee;
}
@@ -509,8 +558,8 @@ ul.search {
table.search_header {
background-color: #ddf;
width: 100%;
vertical-align: top;
width: 100%;
vertical-align: top;
}
div.search_result {
@@ -576,13 +625,39 @@ table.delete_confirm {
text-align: left;
}
table.login {
background-color: #ddf;
padding: 10px;
/* Login Box */
#pla_login {
background: url('../images/uid.png') no-repeat 0 1px;
background-color: #fafaff;
padding-left: 17px;
}
table.login td {
padding: 5px;
#pla_login:focus {
background-color: #ffffba;
}
#pla_login:disabled {
background-color: #ddddff;
}
#pla_pass {
background: url('../images/key.png') no-repeat 0 1px;
background-color: #fafaff;
padding-left: 17px;
}
#pla_pass:focus {
background-color: #ffffba;
}
#pla_pass:disabled {
background-color: #ddddff;
}
table.login {
background-color: #eeeeff;
padding: 10px;
border: 1px solid #aaaacc;
}
table.create {
@@ -602,7 +677,7 @@ table.create td.name {
div.add_value {
font-size: 10pt;
margin: 0px;
padding: 0px;
padding: 0px;
}
a.logged_in_dn {
@@ -659,6 +734,6 @@ table.form tr td {
}
img.chooser {
/* This makes the chooser image line up properly when placed next to a form element in a table cell*/
vertical-align: bottom;
/* This makes the chooser image line up properly when placed next to a form element in a table cell*/
vertical-align: bottom;
}

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.23 2006/04/29 06:49:31 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.25 2007/03/18 02:14:16 wurley Exp $
/**
* delete_form.php

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/expand.php,v 1.23 2005/12/10 10:34:54 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/expand.php,v 1.25 2006/10/28 11:42:10 wurley Exp $
/**
* This script alters the session variable 'tree', expanding it
@@ -29,23 +29,17 @@ if (! $ldapserver->haveAuthInfo())
$dn = $_GET['dn'];
# We dont need this result, as we'll use the SESSION value when we call tree.php
$ldapserver->getContainerContents($dn,0,'(objectClass=*)',$config->GetValue('deref','tree'));
$ldapserver->getContainerContents($dn,0,$config->GetValue('appearance','tree_filter'),$config->GetValue('deref','tree'));
$tree = get_cached_item($ldapserver->server_id,'tree');
$tree['browser'][$dn]['open'] = true;
set_cached_item($ldapserver->server_id,'tree','null',$tree);
/* This is for Opera. By putting "random junk" in the query string, it thinks
that it does not have a cached version of the page, and will thus
fetch the page rather than display the cached version */
$time = gettimeofday();
$random_junk = md5(strtotime('now').$time['usec']);
/* If cookies were disabled, build the url parameter for the session id.
It will be append to the url to be redirect */
$id_session_param = '';
if (SID != '')
$id_session_param = sprintf('&%s=%s',session_name(),session_id());
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,rawurlencode($dn),$id_session_param));
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',random_junk(),$ldapserver->server_id,rawurlencode($dn),$id_session_param));
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.24 2005/12/17 00:00:11 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.25 2006/10/29 12:49:24 wurley Exp $
/**
* export_form.php
@@ -52,9 +52,9 @@ printf('<tr><td>%s</td><td>%s</td></tr>',_('Server'),server_select_list());
echo '<tr>';
printf('<td style="white-space:nowrap">%s</td>',_('Base DN'));
printf('<td><nobr><input type="text" name="dn" id="dn" style="width:230px" value="%s" />&nbsp;',htmlspecialchars($dn));
printf('<td><span style="white-space: nowrap;"><input type="text" name="dn" id="dn" style="width:230px" value="%s" />&nbsp;',htmlspecialchars($dn));
draw_chooser_link('export_form.dn');
echo '</nobr></td>';
echo '</span></td>';
echo '</tr>';
echo '<tr>';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.24 2006/04/29 06:49:31 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.26 2006/09/17 04:51:56 wurley Exp $
/**
* @package phpLDAPadmin
@@ -42,12 +42,14 @@ 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="%ssearch_util.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('<link type="text/css" rel="stylesheet" media="all" href="%s/jscalendar/calendar-blue.css" title="blue" />',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);
printf('<link type="text/css" rel="stylesheet" href="%s/phplayersmenu/layerstreemenu.css"></link>',JSDIR);
printf('<script type="text/javascript" src="%smodify_member.js"></script>',JSDIR);
if (isset($meta_refresh_variable))
printf('<meta http-equiv="refresh" content="%s" />',$meta_refresh_variable);

BIN
htdocs/images/key.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

View File

@@ -5,7 +5,11 @@ function dateSelector(id) {
var parse = false;
var cal = new Calendar(0, null, onSelect, onClose);
cal.showsTime = false;
if (defaults['f_time_'+id]) {
cal.showsTime = true;
} else {
cal.showsTime = false;
}
cal.weekNumbers = true;
cal.showsOtherMonths = true;
cal.create();

View File

@@ -0,0 +1,98 @@
/* This function submits the form
* when Save Changes button is pressed.
* see modify_member_form.php
*/
function submitForm(formId) {
var formObj = document.getElementById(formId);
formObj.submit();
}
/* This function generates hidden input array from new group members
* when submit button is pressed.
* see modify_member_form.php
*/
function update_new_values(memberattr,formId) {
el = document.getElementById("dnu");
for (i=0;i<m2.length;i++) {
el.innerHTML =
el.innerHTML +
"<input type='hidden' name='new_values[" + memberattr + "][" +
i + "]' value='" + m2.options[i].text + "' />";
}
submitForm(formId);
}
/* This function moves members from left select box to right one
* see modify_member_form.php
*/
function one2two() {
m1len = m1.length ;
for (i=0;i<m1len;i++) {
if (m1.options[i].selected == true) {
m2len = m2.length;
m2.options[m2len]= new Option(m1.options[i].text);
}
}
for (i=(m1len-1);i>=0;i--){
if (m1.options[i].selected == true) {
m1.options[i] = null;
}
}
}
/* This function moves members from right select box to left one
* see modify_member_form.php
*/
function two2one() {
m2len = m2.length ;
for (i=0;i<m2len;i++){
if (m2.options[i].selected == true) {
m1len = m1.length;
m1.options[m1len]= new Option(m2.options[i].text);
}
}
for (i=(m2len-1);i>=0;i--) {
if (m2.options[i].selected == true) {
m2.options[i] = null;
}
}
}
/* This function moves all members from left select box to right one
* see modify_member_form.php
*/
function all2two() {
m1len = m1.length ;
for (i=0;i<m1len;i++) {
m2len = m2.length;
m2.options[m2len]= new Option(m1.options[i].text);
}
for (i=(m1len-1);i>=0;i--) {
m1.options[i] = null;
}
}
/* This function moves all members from right select box to left one
* see modify_member_form.php
*/
function all2one() {
m2len = m2.length ;
for (i=0;i<m2len;i++) {
m1len = m1.length;
m1.options[m1len]= new Option(m2.options[i].text);
}
for (i=(m2len-1);i>=0;i--) {
m2.options[i] = null;
}
}

View File

@@ -8,7 +8,7 @@
// Bjoern Schotte <bjoern@rent-a-phpwizard.de> (PEARification)
// Martin Jansen <mj@php.net> (PEAR conformance)
//
// $Id: PHPLIB.php,v 1.2 2005/12/10 10:34:54 wurley Exp $
// $Id: PHPLIB.php,v 1.3 2006/09/17 06:22:04 wurley Exp $
//
//require_once "PEAR.php";
@@ -31,37 +31,37 @@ class Template_PHPLIB
* If set, echo assignments
* @var bool
*/
var $debug = false;
public $debug = false;
/**
* $file[handle] = "filename";
* @var array
*/
var $file = array();
public $file = array();
/**
* fallback paths that should be defined in a child class
* @var array
*/
var $file_fallbacks = array();
public $file_fallbacks = array();
/**
* Relative filenames are relative to this pathname
* @var string
*/
var $root = "";
public $root = "";
/*
* $_varKeys[key] = "key"
* @var array
*/
var $_varKeys = array();
public $_varKeys = array();
/**
* $_varVals[key] = "value";
* @var array
*/
var $_varVals = array();
public $_varVals = array();
/**
* "remove" => remove undefined variables
@@ -69,20 +69,20 @@ class Template_PHPLIB
* "keep" => keep undefined variables
* @var string
*/
var $unknowns = "remove";
public $unknowns = "remove";
/**
* "yes" => halt, "report" => report error, continue, "no" => ignore error quietly
* @var string
*/
var $haltOnError = "report";
public $haltOnError = "report";
/**
* The last error message is retained here
* @var string
* @see halt
*/
var $_lastError = "";
public $_lastError = "";
/**

View File

@@ -22,112 +22,112 @@ class LayersMenuCommon
* @access private
* @var string
*/
var $_packageName;
public $_packageName;
/**
* The version of the package
* @access private
* @var string
*/
var $version;
public $version;
/**
* The copyright of the package
* @access private
* @var string
*/
var $copyright;
public $copyright;
/**
* The author of the package
* @access private
* @var string
*/
var $author;
public $author;
/**
* URL to be prepended to the menu hrefs
* @access private
* @var string
*/
var $prependedUrl = '';
public $prependedUrl = '';
/**
* Do you want that code execution halts on error?
* @access private
* @var string
*/
var $haltOnError = 'yes';
public $haltOnError = 'yes';
/**
* The base directory where the package is installed
* @access private
* @var string
*/
var $dirroot;
public $dirroot;
/**
* The "libjs" directory of the package
* @access private
* @var string
*/
var $libjsdir;
public $libjsdir;
/**
* The directory where images related to the menu can be found
* @access private
* @var string
*/
var $imgdir;
public $imgdir;
/**
* The http path corresponding to imgdir
* @access private
* @var string
*/
var $imgwww;
public $imgwww;
/**
* The directory where icons of menu items can be found
* @access private
* @var string
*/
var $icondir;
public $icondir;
/**
* The http path corresponding to icondir
* @access private
* @var string
*/
var $iconwww;
public $iconwww;
/**
* This array may contain width and height of all icons
* @access private
* @var integer
*/
var $iconsize = array();
public $iconsize = array();
/**
* If this var is false, width and height of icons have to be detected; if this var is true, width and height of icons are not detected and are retrieved from the iconsize array
* @access private
* @var boolean
*/
var $issetIconsize = false;
public $issetIconsize = false;
/**
* The directory where templates can be found
* @access private
* @var string
*/
var $tpldir;
public $tpldir;
/**
* The string containing the menu structure
* @access private
* @var string
*/
var $menuStructure;
public $menuStructure;
/**
* It counts nodes for all menus
* @access private
* @var integer
*/
var $_nodesCount;
public $_nodesCount;
/**
* A multi-dimensional array to store informations for each menu entry
* @access private
* @var array
*/
var $tree;
public $tree;
/**
* A multi-dimensional array used only with the DB support; for each $menu_name, it stores the $cnt associated to each item id
*
@@ -138,56 +138,56 @@ var $tree;
* @access private
* @var array
*/
var $treecnt;
public $treecnt;
/**
* The maximum hierarchical level of menu items
* @access private
* @var integer
*/
var $_maxLevel;
public $_maxLevel;
/**
* An array that counts the number of first level items for each menu
* @access private
* @var array
*/
var $_firstLevelCnt;
public $_firstLevelCnt;
/**
* An array containing the number identifying the first item of each menu
* @access private
* @var array
*/
var $_firstItem;
public $_firstItem;
/**
* An array containing the number identifying the last item of each menu
* @access private
* @var array
*/
var $_lastItem;
public $_lastItem;
/**
* Data Source Name: the connection string for PEAR DB
* @access private
* @var string
*/
var $dsn = 'pgsql://dbuser:dbpass@dbhost/dbname';
public $dsn = 'pgsql://dbuser:dbpass@dbhost/dbname';
/**
* DB connections are either persistent or not persistent
* @access private
* @var boolean
*/
var $persistent = false;
public $persistent = false;
/**
* Name of the table storing data describing the menu
* @access private
* @var string
*/
var $tableName = 'phplayersmenu';
public $tableName = 'phplayersmenu';
/**
* Name of the i18n table corresponding to $tableName
* @access private
* @var string
*/
var $tableName_i18n = 'phplayersmenu_i18n';
public $tableName_i18n = 'phplayersmenu_i18n';
/**
* Names of fields of the table storing data describing the menu
*
@@ -197,7 +197,7 @@ var $tableName_i18n = 'phplayersmenu_i18n';
* @access private
* @var array
*/
var $tableFields = array(
public $tableFields = array(
'id' => 'id',
'parent_id' => 'parent_id',
'text' => 'text',
@@ -213,7 +213,7 @@ var $tableFields = array(
* @access private
* @var array
*/
var $tableFields_i18n = array(
public $tableFields_i18n = array(
'language' => 'language',
'id' => 'id',
'text' => 'text',
@@ -224,7 +224,7 @@ var $tableFields_i18n = array(
* @access private
* @var array
*/
var $_tmpArray = array();
public $_tmpArray = array();
/**
* The constructor method; it initializates the menu system

View File

@@ -22,19 +22,19 @@ class TreeMenu extends LayersMenuCommon
* @access private
* @var string
*/
var $treeMenuImagesType;
public $treeMenuImagesType;
/**
* Prefix for filenames of images of a theme
* @access private
* @var string
*/
var $treeMenuTheme;
public $treeMenuTheme;
/**
* An array where we store the Tree Menu code for each menu
* @access private
* @var array
*/
var $_treeMenu;
public $_treeMenu;
/**
* The constructor method; it initializates the menu system

80
htdocs/js/to_ascii.js Executable file
View File

@@ -0,0 +1,80 @@
//
// Purpose of this file is to remap characters as ASCII characters
//
//
var to_ascii_array = new Array();
to_ascii_array['à'] = 'a';
to_ascii_array['á'] = 'a';
to_ascii_array['â'] = 'a';
to_ascii_array['À'] = 'a';
to_ascii_array['ã'] = 'a';
to_ascii_array['Ã¥'] = 'a';
to_ascii_array['À'] = 'A';
to_ascii_array['Á'] = 'A';
to_ascii_array['Ä'] = 'A';
to_ascii_array['Â'] = 'A';
to_ascii_array['Ã'] = 'A';
to_ascii_array['Å'] = 'A';
to_ascii_array['é'] = 'e';
to_ascii_array['Ú'] = 'e';
to_ascii_array['ë'] = 'e';
to_ascii_array['ê'] = 'e';
to_ascii_array['€'] = 'E';
to_ascii_array['ï'] = 'i';
to_ascii_array['î'] = 'i';
to_ascii_array['ì'] = 'i';
to_ascii_array['í'] = 'i';
to_ascii_array['Ï'] = 'I';
to_ascii_array['Î'] = 'I';
to_ascii_array['Ì'] = 'I';
to_ascii_array['Í'] = 'I';
to_ascii_array['ò'] = 'o';
to_ascii_array['ó'] = 'o';
to_ascii_array['ÃŽ'] = 'o';
to_ascii_array['õ'] = 'o';
to_ascii_array['ö'] = 'o';
to_ascii_array['Þ'] = 'o';
to_ascii_array['Ò'] = 'O';
to_ascii_array['Ó'] = 'O';
to_ascii_array['Ô'] = 'O';
to_ascii_array['Õ'] = 'O';
to_ascii_array['Ö'] = 'O';
to_ascii_array['Ø'] = 'O';
to_ascii_array['ù'] = 'u';
to_ascii_array['ú'] = 'u';
to_ascii_array['Ì'] = 'u';
to_ascii_array['û'] = 'u';
to_ascii_array['Ù'] = 'U';
to_ascii_array['Ú'] = 'U';
to_ascii_array['Ü'] = 'U';
to_ascii_array['Û'] = 'U';
to_ascii_array['Ê'] = 'ae';
to_ascii_array['Æ'] = 'AE';
to_ascii_array['Ü'] = 'y';
to_ascii_array['ÿ'] = 'y';
to_ascii_array['ß'] = 'SS';
to_ascii_array['Ç'] = 'C';
to_ascii_array['ç'] = 'c';
to_ascii_array['Ñ'] = 'N';
to_ascii_array['ñ'] = 'n';
to_ascii_array['¢'] = 'c';
to_ascii_array['©'] = '(C)';
to_ascii_array['®'] = '(R)';
to_ascii_array['«'] = '<<';
to_ascii_array['»'] = '>>';
function toAscii(text) {
//var text = field.value;
var position = 0;
var output = "";
for (position = 0 ; position < text.length ; position++) {
var tmp = text.substring(position,position+1);
if (to_ascii_array[tmp] != undefined) {
tmp = to_ascii_array[tmp];
}
output = output + tmp;
}
return output;
}

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login.php,v 1.54 2006/01/03 20:39:58 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login.php,v 1.55 2006/09/12 13:09:08 wurley Exp $
/**
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me the
@@ -38,7 +38,7 @@ if (! $anon_bind)
$save_auth_type = $ldapserver->auth_type;
if ($anon_bind) {
if (DEBUG_ENABLED)
if (DEBUG_ENABLED)
debug_log('Anonymous Login was posted [%s].',64,$anon_bind);
$dn = null;
@@ -78,14 +78,15 @@ if ($anon_bind) {
# Got through each of the BASE DNs and test the login.
foreach ($ldapserver->getBaseDN() as $base_dn) {
if (DEBUG_ENABLED)
if (DEBUG_ENABLED)
debug_log('Searching LDAP with base [%s]',64,$base_dn);
$result = array_pop($ldapserver->search(null,$base_dn,$filter,array('dn')));
$result = $ldapserver->search(null,$base_dn,$filter,array('dn'));
$result = array_pop($result);
$dn = $result['dn'];
if ($dn) {
if (DEBUG_ENABLED)
if (DEBUG_ENABLED)
debug_log('Got DN [%s] for user ID [%s]',64,$dn,$uid);
break;
}

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.27 2005/12/17 00:00:11 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.28 2006/10/29 11:44:36 wurley Exp $
/**
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
@@ -16,22 +16,65 @@
require './common.php';
if (! $ldapserver->auth_type)
pla_error(_('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. '));
if (! in_array($ldapserver->auth_type, array('cookie','session')))
pla_error(sprintf(_('Unknown auth_type: %s'),htmlspecialchars($ldapserver->auth_type)));
include './header.php'; ?>
include './header.php';
<body>
<?php if( $ldapserver->isAnonBindAllowed() ) { ?>
echo '<body>';
printf('<h3 class="title">%s %s</h3>',_('Authenticate to server'),$ldapserver->name);
# Check for a secure connection
if (! isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') {
echo '<br />';
echo '<center>';
echo '<span style="color:red">';
printf('<acronym title="%s"><b>%s: %s.</b></acronym>',
_('You are not using \'https\'. Web browser will transmit login information in clear text.'),
_('Warning'),_('This web connection is unencrypted'));
echo '</span>';
echo '</center>';
echo '<br />';
}
# Login form.
echo '<form action="login.php" method="post" name="login_form">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
if (isset($_GET['redirect']))
printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode($_GET['redirect']));
echo '<center>';
echo '<table class="login">';
printf('<tr><td><b>%s</b></td></tr>',$ldapserver->isLoginAttrEnabled() ? _('Login Name') : _('Login DN'));
printf('<tr><td><input type="text" id="pla_login" name="%s" size="40" value="%s" /></td></tr>',
$ldapserver->isLoginAttrEnabled() ? 'uid' : 'login_dn',
$ldapserver->isLoginAttrEnabled() ? '' : $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 colspan=2>&nbsp;</td></tr>';
# If Anon bind allowed, then disable the form if the user choose to bind anonymously.
if ($ldapserver->isAnonBindAllowed())
printf('<tr><td colspan="2"><small><b>%s</b></small> <input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)" id="anonymous_bind_checkbox" /></td></tr>',
_('Anonymous'));
printf('<tr><td colspan="2"><center><input type="submit" name="submit" value="%s" /></center></td></tr>',
_('Authenticate'));
echo '</table>';
echo '</center>';
echo '</form>';
if( $ldapserver->isAnonBindAllowed() ) { ?>
<script type="text/javascript" language="javascript">
<!--
function toggle_disable_login_fields( anon_checkbox )
{
if( anon_checkbox.checked ) {
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.login_pass.disabled = true;
} else {
@@ -41,63 +84,8 @@ include './header.php'; ?>
}
-->
</script>
<?php } ?>
<?php }
<h3 class="title"><?php printf(_('Authenticate to server %s'),$ldapserver->name); ?></h3>
<br />
<?php if (! isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') { ?>
<center>
<span style="color:red">
<acronym title="<?php echo _('You are not using \'https\'. Web browser will transmit login information in clear text.'); ?>">
<?php echo _('Warning: This web connection is unencrypted.'); ?>
</acronym>
</span>
<br />
</center>
<?php } ?>
<br />
<form action="login.php" method="post" name="login_form">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<?php if( isset( $_GET['redirect'] ) ) { ?>
<input type="hidden" name="redirect" value="<?php echo rawurlencode( $_GET['redirect'] ) ?>" />
<?php } ?>
<center>
<table class="login">
<?php if( $ldapserver->isAnonBindAllowed() ) { ?>
<tr>
<td colspan="2"><small><label for="anonymous_bind_checkbox"><?php echo _('Anonymous Bind'); ?></label></small> <input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)" id="anonymous_bind_checkbox"/></td>
</tr>
<?php } ?>
<tr>
<td><small>
<?php
if ($ldapserver->isLoginAttrEnabled())
echo _('User name');
else
echo _('Login DN');
echo '</body>';
echo '</html>';
?>
</small></td>
<td><input type="text" name="<?php echo $ldapserver->isLoginAttrEnabled() ? 'uid' : 'login_dn'; ?>" size="40" value="<?php echo $ldapserver->isLoginAttrEnabled() ? '' : $ldapserver->login_dn; ?>" /></td>
</tr>
<tr>
<td><small><?php echo _('Password'); ?></small></td>
<td><input type="password" size="40" value="" name="login_pass" /></td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="submit" value="<?php echo _('Authenticate'); ?>" /></center></td>
</tr>
</table>
</center>
</form>
</body>
</html>

View File

@@ -0,0 +1,193 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/modify_member_form.php,v 1.4 2006/10/29 01:47:08 wurley Exp $
/**
* Displays a form to allow the user to modify group members.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
* - attr (rawurlencoded) the attribute to which we are adding a value
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
$attr = $_GET['attr'];
$dn = isset($_GET['dn']) ? $_GET['dn'] : null;
$encoded_dn = rawurlencode($dn);
$encoded_attr = rawurlencode($attr);
if (! is_null($dn))
$rdn = get_rdn($dn);
else
$rdn = null;
# Get all current group members
$current_members = $ldapserver->getDNAttr($dn,$attr);
if ($current_members)
$num_current_members = (is_array($current_members) ? count($current_members) : 1);
else
$num_current_members = 0;
/*
* If there is only one member, convert scalar to array,
* arrays are required later when processing members
*/
if ($num_current_members == 1)
$current_members = array($current_members);
sort($current_members);
# Loop through all base dn's and search possible member entries
foreach ($ldapserver->getBaseDN() as $base_dn) {
# Get all entries that can be added to the group
if (preg_match("/^$attr$/i",$config->GetValue('modify_member','posixgroupattr')))
$possible_values = array_merge($ldapserver->search(null,$base_dn,
$config->GetValue('modify_member','posixfilter'),array($config->GetValue('modify_member','posixattr'))));
else
$possible_values = array_merge($ldapserver->search(null,$base_dn,
$config->GetValue('modify_member','filter'),array($config->GetValue('modify_member','attr'))));
}
if ($possible_values)
$num_possible_values = (is_array($possible_values) ? count($possible_values) : 1);
else
$num_possible_values = 0;
sort($possible_values);
include './header.php';
echo '<body>';
printf('<h3 class="title">%s <b>%s</b></h3>',_('Modify group'),htmlspecialchars($rdn));
printf('<h3 class="subtitle">%s <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn));
printf('%s <b>%s</b> %s <b>%s</b>:',
_('There are'),$num_current_members,_('members in group'),htmlspecialchars($rdn));
for ($i=0; $i<count($possible_values); $i++) {
if (preg_match("/^$attr$/i",$config->GetValue('modify_member','posixgroupattr')))
$possible_members[$i] = $possible_values[$i][$config->GetValue('modify_member','posixattr')];
else
$possible_members[$i] = $possible_values[$i][$config->GetValue('modify_member','attr')];
}
sort($possible_members);
/*
* Show only user that are not already in group.
* This loop removes existing users from possible members
*/
foreach ($possible_members as $pkey => $possible) {
foreach ($current_members as $current) {
if (preg_match("/^$current$/i","$possible_members[$pkey]")) {
unset($possible_members[$pkey]);
break;
}
}
}
/*
* Draw form with select boxes, left for all possible members and
* right one for those that belong to group
*/
# Modifications will be sent to update_confirm which takes care of rest of the processing
echo '<br />';
echo '<br />';
echo '<form action="update_confirm.php" method="post" class="add_value" name="member">';
echo '<table class="modify_members">';
echo '<tr>';
printf('<td><img src="images/user.png" alt="Users" /> %s</td>',_('Available members'));
printf('<td><img src="images/uniquegroup.png" alt="Members" /> %s</td>',_('Group members'));
echo '</tr>';
# Generate select box from all possible members
echo '<tr>';
echo '<td>';
echo '<select name="notmembers" size="10" multiple>';
foreach ($possible_members as $possible)
printf('<option>%s</option>',$possible);
echo '</select>';
echo '</td>';
# Generate select box from all current members
echo '<td>';
echo '<select name="members" size="10" multiple>';
foreach ($current_members as $current)
printf('<option>%s</option>',$current);
echo '</select>';
echo '</td>';
echo '</tr>';
# Show buttons which move users from left to right and vice versa
echo '<tr>';
echo '<td>';
printf('<input type="button" onClick="one2two()" value="%s >>" />&nbsp;<input type="button" onClick="all2two()" value="%s >>" />',
_('Add selected'),_('Add all'));
echo '</td>';
echo '<td>';
printf('<input type="button" onClick="two2one()" value="<< %s" />&nbsp;<input type="button" onClick="all2one()" value="<< %s" />',
_('Remove selected'),('Remove all'));
echo '</td>';
echo '</tr>';
echo '<tr><td colspan="2">';
# Hidden attributes for update_confirm.php
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',$dn);
printf('<input type="hidden" name="attr" value="%s" />',$encoded_attr);
/*
* Generate array of input text boxes from current members.
* update_confirm.php will see this as old_values[member-attribute][item]
*/
for ($i=0; $i<$num_current_members; $i++)
printf('<input type="hidden" name="old_values[%s][%s]" value="%s" />',
htmlspecialchars($attr),$i,htmlspecialchars($current_members[$i]));
/*
* Javascript generates array of input text boxes from new members.
* update_confirm.php will see this as new_values[member-attribute][item]
* Input text boxes will be generated to div=dnu
*/
echo '<div id="dnu">';
printf('<input type="hidden" name="new_values[%s][]" value="" />',htmlspecialchars($attr));
echo '</div>';
# Submit values to update_confirm.php and when clicked, run addSelected
printf('<input type="submit" name="save" value="%s" onClick="update_new_values(\'%s\',\'modifymember\')" />',_('Save changes'),$attr);
echo '</td></tr>';
echo '</table>';
echo '</form>';
# Variables for Javascript function that moves members from left to right
echo '<script type="text/javascript" language="javascript">';
echo 'var m1 = document.member.notmembers;';
echo 'var m2 = document.member.members;';
echo '</script>';
echo '</body></html>';
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.24 2005/12/10 10:34:54 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.27 2007/03/18 03:14:52 wurley Exp $
/**
* Recursively deletes the specified DN and all of its children
@@ -57,13 +57,13 @@ function pla_rdelete($ldapserver,$dn) {
$children = $ldapserver->getContainerContents($dn);
if (! is_array($children) || count($children) == 0) {
printf('<nobr>'._('Deleting %s').'...',htmlspecialchars($dn));
printf('<span style="white-space: nowrap;">%s %s...',_('Deleting'),htmlspecialchars($dn));
flush();
if (run_hook('pre_entry_delete',array('server_id'=>$ldapserver->server_id,'dn'=>$dn)))
if ($ldapserver->delete($dn)) {
run_hook('post_entry_delete',array('server_id'=>$ldapserver->server_id,'dn'=>$dn));
printf(' <span style="color:green">%s</span></nobr><br />',_('Success'));
printf(' <span style="color:green">%s</span></span><br />',_('Success'));
return true;
} else {
@@ -74,13 +74,13 @@ function pla_rdelete($ldapserver,$dn) {
foreach ($children as $child_dn)
pla_rdelete($ldapserver,$child_dn);
printf('<nobr>'._('Deleting %s').'...',htmlspecialchars($dn));
printf('<span style="white-space: nowrap;">%s %s...',_('Deleting'),htmlspecialchars($dn));
flush();
if (run_hook('pre_entry_delete',array('server_id'=>$ldapserver->server_id,'dn'=>$dn)))
if ($ldapserver->delete($dn)) {
run_hook('post_entry_delete',array('server_id'=>$ldapserver->server_id,'dn'=>$dn));
printf(' <span style="color:green">%s</span></nobr><br />',_('Success'));
printf(' <span style="color:green">%s</span></span><br />',_('Success'));
return true;
} else {

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.30 2005/12/10 10:34:54 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.32 2007/03/18 02:06:20 wurley Exp $
/**
* Renames a DN to a different name.

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.64 2006/01/03 20:39:58 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.66 2007/03/21 23:33:58 wurley Exp $
/**
* Displays the schema for the specified server_id

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.76 2006/04/29 06:49:31 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.77 2007/03/18 01:42:05 wurley Exp $
/**
* Perform LDAP searches and draw the advanced/simple search forms
@@ -43,6 +43,7 @@ if (isset($ldapserver)) {
}
$filter = isset($_GET['filter']) ? clean_search_vals($_GET['filter']) : null;
$orderby = isset($_GET['orderby']) ? clean_search_vals($_GET['orderby']) : null;
$attr = isset($_GET['attribute']) ? $_GET['attribute'] : null;
# grab the base dn for the search
@@ -207,7 +208,8 @@ if (isset($_GET['search'])) {
debug_log('Search with base DN [%s]',64,$base_dn);
}
$results = $ldapserver->search(null,dn_escape($base_dn),$filter,$search_result_attributes,$scope,true,$config->GetValue('deref','search'));
$results = $ldapserver->search(null,dn_escape($base_dn),$filter,
$search_result_attributes,$scope,$orderby,$config->GetValue('deref','search'));
if ((! $results) && $ldapserver->errno())
pla_error(_('Encountered an error while performing search.'),$ldapserver->error(),$ldapserver->errno());

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.24 2006/04/29 06:49:31 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.26 2006/09/17 06:35:11 wurley Exp $
/**
* Fetches and displays all information that it can from the specified server
@@ -50,13 +50,15 @@ if (! $ldapserver->haveAuthInfo())
pla_error( _('Not enough information to login to server. Please check your configuration.') );
# Fetch basic RootDSE attributes using the + and *.
$attrs = array_pop($ldapserver->search(null,'','objectClass=*',array('+','*'),'base'));
$attrs = $ldapserver->search(null,'','objectClass=*',array('+','*'),'base');
$attrs = array_pop($attrs);
/* After fetching the "basic" attributes from the RootDSE, try fetching the
more advanced ones (from ths list). Add them to the list of attrs to display
if they weren't already fetched. (this was added as a work-around for OpenLDAP
on RHEL 3. */
$attrs2 = array_pop($ldapserver->search(null,'','objectClass=*',$root_dse_attributes,'base'));
$attrs2 = $ldapserver->search(null,'','objectClass=*',$root_dse_attributes,'base');
$attrs2 = array_pop($attrs2);
if (is_array($attrs2))
foreach ($attrs2 as $attr => $values)
@@ -83,7 +85,7 @@ foreach ($attrs as $attr => $values) {
$schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s',$ldapserver->server_id,$attr);
echo '<tr><td class="attr">';
printf('<b><a title="'._('Click to view the schema defintion for attribute type \'%s\'').'" href="%s">%s</a></b>',
printf('<b><a title="'._('Click to view the schema definition for attribute type \'%s\'').'" href="%s">%s</a></b>',
$attr,$schema_href,htmlspecialchars($attr));
echo '</td></tr>';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.33 2006/05/13 12:52:26 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.44 2007/01/18 21:03:58 wurley Exp $
/**
* Template render engine.
@@ -30,7 +30,6 @@ $shadow_format_attrs = array_merge($shadow_before_today_attrs,$shadow_after_toda
# If we have a DN, then this is to edit the entry.
if (isset($_REQUEST['dn'])) {
$dn = $_GET['dn'];
$decoded_dn = rawurldecode($dn);
$encoded_dn = rawurlencode($decoded_dn);
@@ -63,7 +62,7 @@ if (isset($_REQUEST['dn'])) {
} else {
$templates = new Templates($ldapserver->server_id);
$template = $templates->GetTemplate($_REQUEST['template']);
$template = $templates->getCreationTemplate($_REQUEST['template']);
}
}
@@ -84,9 +83,25 @@ if (isset($template['empty_attrs'])) {
echo "\n\n";
if (isset($_REQUEST['nextpage']) && ! $_REQUEST['nextpage']) {
$new_dn = sprintf('%s=%s,%s',$template['rdn'],$_REQUEST['form'][$template['rdn']],$_REQUEST['container']);
echo '<form action="create.php" method="post">';
/*
* destinationcontainer is an otherride of dn.
* needed for such "actions" other than create.php
*/
if (!isset($template['destinationcontainer']))
$new_dn = sprintf('%s=%s,%s',$template['rdn'],$_REQUEST['form'][$template['rdn']],$_REQUEST['container']);
else
$new_dn = sprintf('%s',$template['destinationcontainer']);
/*
* default action is create.php
* you can change this behavior by setting <action>myscript.php</action> in template header
*/
if (!isset($template['action']))
echo '<form action="create.php" method="post">';
else
printf ('<form action="%s" method="post">',rawurlencode($template['action']));
printf('<input type="hidden" name="new_dn" value="%s" />',htmlspecialchars($new_dn));
} else {
@@ -255,7 +270,9 @@ if (isset($template['empty_attrs'])) {
# Some conditional checking.
# $detail['must'] & $detail['disable'] cannot be set at the same time.
if (isset($detail['must']) && $detail['must'] && isset($detail['disable']) && $detail['disable'])
# except when "action" is other than create.php
if (isset($detail['must']) && $detail['must'] && isset($detail['disable']) && $detail['disable']
&& (!isset($template['action']) || ($template['action']) == 'create.php'))
pla_error(sprintf(_('Attribute [%s] is a MUST attribute, so it cannot be disabled.'),$attr));
# If this attribute is disabled, go to the next one.
@@ -439,7 +456,7 @@ if (isset($template['empty_attrs'])) {
printf('<td><input type="%s" name="form[%s][]" id="%s" value="%s" %s %s />',
$type,$attr,$attr.$i,(isset($detail['value']) ? $detail['value'] : ''),
"onBlur=\"fill('$attr', this.value);\"",
'',
isset($detail['disable']) ? 'disabled' : '');
if (isset($detail['helper']) && isset($detail['helper']['location'])
@@ -507,21 +524,32 @@ if (isset($template['empty_attrs'])) {
printf('<tr class="%s"><td colspan=2>',($counter++%2==0?'even':'odd'));
printf('<input type="hidden" name="attrs[]" value="%s" />',$attr);
$countitems = false;
if (is_array($value))
foreach ($value as $item) {
if ($item && ! isset($unique[$item])) {
if (($item || $item == '0') && ! isset($unique[$item])) {
$unique[$item] = 1;
if ($countitems)
printf ('<tr class="%s"><td colspan=2>',($counter++%2==0?'even':'odd'));
$countitems = true;
printf('<input type="hidden" name="vals[%s][]" value="%s" />',
array_search($attr,$attrs),$item);
printf('%s</td><td><b>%s</b></td></tr>',$attr,htmlspecialchars($item));
}
}
else {
$display = $value;
if (isset($template['attribute'][$attr]['type']) && $template['attribute'][$attr]['type'] == 'password')
if (obfuscate_password_display($_REQUEST['enc']))
if (isset($template['attribute'][$attr]['type']) && $template['attribute'][$attr]['type'] == 'password') {
$enc = (isset($_REQUEST['enc'])) ? $_REQUEST['enc'] : get_enc_type($value);
if (obfuscate_password_display($enc))
$display = '********';
}
printf('<input type="hidden" name="vals[]" value="%s" />',$value);
printf('%s</td><td><b>%s</b></td></tr>',$attr,htmlspecialchars($display));
@@ -619,7 +647,11 @@ if (isset($template['empty_attrs'])) {
return;
else {
attrTrace[id] = 1;
document.getElementById(id).value = value;
// disable value setting in case of "select multiple"
if ((document.getElementById(id).tagName != "SELECT"
&& document.getElementById(id).tagName != "select")
|| document.getElementById(id).getAttribute("multiple") == "")
document.getElementById(id).value = value;
// here comes template-specific implementation, generated by php
if (false) {}';
@@ -738,21 +770,25 @@ foreach ($template['attrs'] as $attr => $vals) {
echo '<tr>';
echo '<td class="attr">';
$schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s',
if ($config->GetValue('appearance','show_schema_link')) {
$schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s',
$ldapserver->server_id,real_attr_name($attr));
printf('<b><a title="'._('Click to view the schema defintion for attribute type \'%s\'').'" href="%s">%s</a></b>',$attr,$schema_href,$attr_display);
printf('<b><a title="'._('Click to view the schema definition for attribute type \'%s\'').'" href="%s">%s</a></b>',$attr,$schema_href,$attr_display);
} else {
printf('<b>%s</s>',$attr_display);
}
echo '</td>';
echo '<td class="attr_note">';
if ($attr_note)
printf('<sup><small>%s</small></sup>',$attr_note);
if ($config->GetValue('appearance','show_attribute_notes')) {
echo '<td class="attr_note">';
if ($attr_note)
printf('<sup><small>%s</small></sup>',$attr_note);
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'));
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'));
echo '</td>';
echo '</td>';
}
echo '</tr>';
if ($is_modified_attr)
@@ -968,13 +1004,17 @@ foreach ($template['attrs'] as $attr => $vals) {
$val = $vals[0];
printf('<input type="hidden" name="old_values[%s][]" value="%s" />',htmlspecialchars($attr),htmlspecialchars($val));
printf('<nobr><input type="text" size="30" id="f_date_%s" name="new_values[%s][0]" value="%s" />&nbsp;',
printf('<span style="white-space: nowrap;"><input type="text" size="30" id="f_date_%s" name="new_values[%s][0]" value="%s" />&nbsp;',
$attr,htmlspecialchars($attr),htmlspecialchars($val));
draw_date_selector_link($attr);
echo '</nobr></td>';
echo '</span></td>';
echo '</tr>';
$js[] = sprintf('<script type="text/javascript" language="javascript">defaults[\'f_date_%s\'] = \'%s\';</script>',$attr,$js_date_attrs[$attr]);
$js_datetime_attrs = $config->GetValue('appearance','date_attrs_showtime');
if (in_array_ignore_case($attr,array_keys($js_datetime_attrs)) && ($js_datetime_attrs[$attr]))
$js[] = sprintf('<script type="text/javascript" language="javascript">defaults[\'f_time_%s\'] = \'%s\';</script>',$attr,'true');
if ($is_modified_attr)
echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
@@ -1005,7 +1045,7 @@ foreach ($template['attrs'] as $attr => $vals) {
if (! strcasecmp($attr,'objectClass')) {
printf('<a title="%s" href="schema.php?server_id=%s&amp;view=objectClasses&amp;viewvalue=%s"><img src="images/info.png" alt="Info" /></a>&nbsp;',
_('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val));
_('View the schema description for this objectClass'),$ldapserver->server_id,strtolower(htmlspecialchars($val)));
$schema_object = $ldapserver->getSchemaObjectClass($val);
@@ -1022,10 +1062,10 @@ foreach ($template['attrs'] as $attr => $vals) {
if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
if ($ldapserver->dnExists($val)) {
printf('<a title="'._('Go to %s').'" href="template_engine.php?server_id=%s&amp;dn=%s"><img style="vertical-align: top" src="images/go.png" /></a>&nbsp;',
printf('<a title="'._('Go to %s').'" href="template_engine.php?server_id=%s&amp;dn=%s"><img style="vertical-align: top" src="images/go.png" alt="Go" /></a>&nbsp;',
htmlspecialchars($val),$ldapserver->server_id,rawurlencode($val));
} else {
printf('<a title="'._('DN not available %s').'"><img style="vertical-align: top" src="images/nogo.png" /></a>&nbsp;',
printf('<a title="'._('DN not available %s').'"><img style="vertical-align: top" src="images/nogo.png" alt="N/E" /></a>&nbsp;',
htmlspecialchars($val),$ldapserver->server_id,rawurlencode($val));
}
@@ -1104,6 +1144,14 @@ foreach ($template['attrs'] as $attr => $vals) {
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'));
if (in_array($schema_attr->name,$config->GetValue('modify_member','groupattr'))) {
$add_href = sprintf('modify_member_form.php?server_id=%s&amp;dn=%s&amp;attr=%s',
$ldapserver->server_id,$encoded_dn,rawurlencode($attr));
printf('<div class="add_value">(<a href="%s" title="%s">%s</a>)</div>',
$add_href,sprintf('%s %s',_('Modify members for'),$dn),_('modify group members'));
}
}
echo '</td>';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/tree.php,v 1.91 2006/01/03 20:39:58 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/tree.php,v 1.92 2006/10/29 12:49:24 wurley Exp $
/**
* This script displays the LDAP tree for all the servers that you have
@@ -77,24 +77,24 @@ echo "\n\n";
echo '<!-- Links at the top of the tree viewer -->';
echo '<table class="edit_dn_menu" width=100%><tr>';
printf('<td><img src="images/home.png" alt="%s" /></td>',_('Home'));
printf('<td width=50%%><nobr><a href="welcome.php" target="right_frame">%s</a></nobr></td>',_('Home'));
printf('<td width=50%%><span style="white-space: nowrap;"><a href="welcome.php" target="right_frame">%s</a></span></td>',_('Home'));
printf('<td><img src="images/trash.png" alt="%s" /></td>',_('Purge caches'));
printf('<td width=50%%><nobr><a href="purge_cache.php" target="right_frame" title="%s">%s</a></nobr></td>',_('Purge all cached data in phpLDAPadmin, including server schemas.'),_('Purge caches'));
printf('<td width=50%%><span style="white-space: nowrap;"><a href="purge_cache.php" target="right_frame" title="%s">%s</a></span></td>',_('Purge all cached data in phpLDAPadmin, including server schemas.'),_('Purge caches'));
echo '</tr><tr>';
if (! $config->GetValue('appearance','hide_configuration_management')) {
printf('<td><img src="images/light.png" alt="%s" /></td>',_('light'));
printf('<td width=50%%><nobr><a href="%s" target="new">%s</a></nobr></td>',get_href('add_rfe'),_('Request feature'));
printf('<td width=50%%><span style="white-space: nowrap;"><a href="%s" target="new">%s</a></span></td>',get_href('add_rfe'),_('Request feature'));
printf('<td><img src="images/bug.png" alt="%s" /></td>',_('bug'));
printf('<td width=50%%><nobr><a href="%s" target="new">%s</a></nobr></td>',get_href('add_bug'),_('Report a bug'));
printf('<td width=50%%><span style="white-space: nowrap;"><a href="%s" target="new">%s</a></span></td>',get_href('add_bug'),_('Report a bug'));
echo '</tr><tr>';
printf('<td><img src="images/smile.png" alt="%s" /></td>',_('Donate'));
printf('<td width=50%%><nobr><a href="%s" target="right_frame">%s</a></nobr></td>',get_href('donate'),_('Donate'));
printf('<td width=50%%><span style="white-space: nowrap;"><a href="%s" target="right_frame">%s</a></span></td>',get_href('donate'),_('Donate'));
}
printf('<td><img src="images/help.png" alt="%s" /></td>',_('Help'));
printf('<td><nobr><a href="help.php" target="right_frame">%s</a></nobr></td>',_('Help'));
printf('<td><span style="white-space: nowrap;"><a href="help.php" target="right_frame">%s</a></span></td>',_('Help'));
echo '</tr></table>';
echo "\n\n";

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.47 2006/05/13 12:52:26 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.48 2006/10/29 12:49:24 wurley Exp $
/**
* Takes the results of clicking "Save" in template_engine.php and determines which
@@ -144,7 +144,7 @@ if (count($update_array) > 0) {
printf('<tr class="%s">',$counter%2 ? 'even' : 'odd');
printf('<td><b>%s</b></td>',htmlspecialchars($attr));
echo '<td><nobr>';
echo '<td><span style="white-space: nowrap;">';
if (strcasecmp($attr,'userPassword') == 0) {
foreach ($old_values[$attr] as $key => $value) {
@@ -161,8 +161,8 @@ if (count($update_array) > 0) {
else
echo nl2br(htmlspecialchars($old_values[$attr])).'<br />';
echo '</nobr></td>';
echo '<td><nobr>';
echo '</span></td>';
echo '<td><span style="white-space: nowrap;">';
# Is this a multi-valued attribute?
if (is_array($new_val)) {
@@ -201,7 +201,7 @@ if (count($update_array) > 0) {
} elseif ($new_val != '')
printf('<span style="color: red">%s</span>',_('[attribute deleted]'));
echo '</nobr></td>';
echo '</span></td>';
printf('<td><input name="skip_array[%s]" type="checkbox" /></td>',htmlspecialchars($attr));
echo '</tr>'."\n\n";