Moved files

This commit is contained in:
Deon George
2009-06-30 19:39:45 +10:00
parent df48b8ff9b
commit bbcd2cb3b6
313 changed files with 0 additions and 0 deletions

163
htdocs/add_attr.php Normal file
View File

@@ -0,0 +1,163 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/add_attr.php,v 1.15 2005/09/25 16:11:44 wurley Exp $
/**
* Adds an attribute/value pair to an object
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn
* - attr
* - val
* - binary
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
require TMPLDIR.'template_config.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$attr = $_POST['attr'];
$val = isset( $_POST['val'] ) ? $_POST['val'] : false;;
$dn = $_POST['dn'] ;
$is_binary_val = isset( $_POST['binary'] ) ? true : false;
$encoded_dn = rawurlencode( $dn );
$encoded_attr = rawurlencode( $attr );
if( ! $is_binary_val && $val == "" ) {
pla_error( $lang['left_attr_blank'] );
}
// special case for binary attributes (like jpegPhoto and userCertificate):
// we must go read the data from the file and override $val with the binary data
// Secondly, we must check if the ";binary" option has to be appended to the name
// of the attribute.
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, array($val) ) ) {
$search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) );
}
if( $is_binary_val ) {
if( 0 == $_FILES['val']['size'] )
pla_error( $lang['file_empty'] );
if( ! is_uploaded_file( $_FILES['val']['tmp_name'] ) ) {
if( isset( $_FILES['val']['error'] ) )
switch($_FILES['val']['error']) {
case 0: //no error; possible file attack!
pla_error( $lang['invalid_file'] );
break;
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
pla_error( $lang['uploaded_file_too_big'] );
break;
case 2: //uploaded file exceeds the MAX_FILE_SIZE directive specified in the html form
pla_error( $lang['uploaded_file_too_big'] );
break;
case 3: //uploaded file was only partially uploaded
pla_error( $lang['uploaded_file_partial'] );
break;
case 4: //no file was uploaded
pla_error( $lang['left_attr_blank'] );
break;
default: //a default error, just in case! :)
pla_error( $lang['invalid_file'] );
break;
}
else
pla_error( $lang['invalid_file'] );
}
$file = $_FILES['val']['tmp_name'];
$f = fopen( $file, 'r' );
$binary_data = fread( $f, filesize( $file ) );
fclose( $f );
$val = $binary_data;
if( is_binary_option_required( $ldapserver, $attr ) )
$attr .= ";binary";
}
/* Automagically hash new userPassword attributes according to the
chosen in config.php. */
if( 0 == strcasecmp( $attr, 'userpassword' ) ) {
if (trim($ldapserver->default_hash) != '' ) {
$enc_type = $ldapserver->default_hash;
$val = password_hash( $val, $enc_type );
}
}
elseif( in_array( $attr,array('sambantpassword','sambalmpassword') ) ){
$mkntPassword = new MkntPasswdUtil();
$mkntPassword->createSambaPasswords( $val );
$val = $mkntPassword->valueOf($attr);
}
$new_entry = array( $attr => $val );
$result = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry );
if ($result)
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=%s',
$ldapserver->server_id,$encoded_dn,$encoded_attr));
else
pla_error( $lang['failed_to_add_attr'],ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()) );
/**
* Check if we need to append the ;binary option to the name
* of some binary attribute
*
* @param object $ldapserver Server Object that the attribute is in.
* @param attr $attr Attribute to test to see if it requires ;binary added to it.
* @return bool
*/
function is_binary_option_required( $ldapserver, $attr ) {
// list of the binary attributes which need the ";binary" option
$binary_attributes_with_options = array(
// Superior: Ldapv3 Syntaxes (1.3.6.1.4.1.1466.115.121.1)
'1.3.6.1.4.1.1466.115.121.1.8' => "userCertificate",
'1.3.6.1.4.1.1466.115.121.1.8' => "caCertificate",
'1.3.6.1.4.1.1466.115.121.1.10' => "crossCertificatePair",
'1.3.6.1.4.1.1466.115.121.1.9' => "certificateRevocationList",
'1.3.6.1.4.1.1466.115.121.1.9' => "authorityRevocationList",
// Superior: Netscape Ldap attributes types (2.16.840.1.113730.3.1)
'2.16.840.1.113730.3.1.40' => "userSMIMECertificate"
);
// quick check by attr name (short circuits the schema check if possible)
//foreach( $binary_attributes_with_options as $oid => $name )
//if( 0 == strcasecmp( $attr, $name ) )
//return true;
$schema_attr = get_schema_attribute( $ldapserver, $attr );
if( ! $schema_attr )
return false;
$syntax = $schema_attr->getSyntaxOID();
if( isset( $binary_attributes_with_options[ $syntax ] ) )
return true;
return false;
}
?>

197
htdocs/add_attr_form.php Normal file
View File

@@ -0,0 +1,197 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/add_attr_form.php,v 1.12 2005/07/22 05:42:18 wurley Exp $
/**
* Displays a form for adding an attribute/value to an LDAP entry.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$dn = $_GET['dn'];
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$friendly_attrs = process_friendly_attr_table();
include './header.php'; ?>
<body>
<h3 class="title"><?php echo sprintf( $lang['add_new_attribute'], htmlspecialchars( $rdn ) ); ?></b></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']; ?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
<?php $attrs = get_object_attrs( $ldapserver, $dn );
$oclasses = get_object_attr( $ldapserver, $dn, 'objectClass' );
if( ! is_array( $oclasses ) )
$oclasses = array( $oclasses );
$avail_attrs = array();
$schema_oclasses = get_schema_objectclasses( $ldapserver, $dn );
foreach( $oclasses as $oclass ) {
$schema_oclass = get_schema_objectclass( $ldapserver, $oclass, $dn );
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 );
}
$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 ) {
if( is_attr_binary( $ldapserver, $attr ) ) {
$avail_binary_attrs[] = $attr;
unset( $avail_attrs[ $i ] );
}
}
?>
<br />
<center>
<?php echo $lang['add_new_attribute'];
if( is_array( $avail_attrs ) && count( $avail_attrs ) > 0 ) { ?>
<br />
<br />
<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); ?>" />
<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) . ")";
} else {
$attr_display = htmlspecialchars( $a );
}
echo $attr_display;
$attr_select_html .= "<option>$attr_display</option>\n";
echo "<option value=\"" . htmlspecialchars($a) . "\">$attr_display</option>";
} ?>
</select>
<input type="text" name="val" size="20" />
<input type="submit" name="submit" value="<?php echo $lang['add']; ?>" class="update_dn" />
</form>
<?php } else { ?>
<br />
<br />
<small>(<?php echo $lang['no_new_attrs_available']; ?>)</small>
<br />
<br />
<?php } ?>
<?php echo $lang['add_new_binary_attr'];
if( count( $avail_binary_attrs ) > 0 ) { ?>
<!-- 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 />
<select name="attr">
<?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) . ")";
} else {
$attr_display = htmlspecialchars( $a );
}
echo $attr_display;
$attr_select_html .= "<option>$attr_display</option>\n";
echo "<option value=\"" . htmlspecialchars($a) . "\">$attr_display</option>";
} ?>
</select>
<input type="file" name="val" size="20" />
<input type="submit" name="submit" value="<?php echo $lang['add']; ?>" class="update_dn" />
<?php if( ! ini_get( 'file_uploads' ) )
echo "<br><small><b>" . $lang['warning_file_uploads_disabled'] . "</b></small><br>";
else
echo "<br><small><b>" . sprintf( $lang['max_file_size'], ini_get( 'upload_max_filesize' ) ) . "</b></small><br>";
?>
</form>
<?php } else { ?>
<br />
<br />
<small>(<?php echo $lang['no_new_binary_attrs_available']; ?>)</small>
<?php } ?>
</center>
</body>
</html>
<?php
/**
* Given an attribute $x, this returns true if it is NOT already specified
* in the current entry, returns false otherwise.
*
* @param attr $x
* @return bool
* @ignore
*/
function not_an_attr( $x ) {
global $attrs;
//return ! isset( $attrs[ strtolower( $x ) ] );
foreach( $attrs as $attr => $values )
if( 0 == strcasecmp( $attr, $x ) )
return false;
return true;
}
?>

64
htdocs/add_oclass.php Normal file
View File

@@ -0,0 +1,64 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/add_oclass.php,v 1.16 2005/07/22 06:34:55 wurley Exp $
/**
* Adds an objectClass to the specified dn.
*
* Note, this does not do any schema violation checking. That is
* performed in add_oclass_form.php.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn (rawurlencoded)
* - new_oclass
* - new_attrs (array, if any)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$dn = rawurldecode( $_POST['dn'] );
$new_oclass = unserialize( rawurldecode( $_POST['new_oclass'] ) );
$new_attrs = $_POST['new_attrs'];
$encoded_dn = rawurlencode( $dn );
if( is_attr_read_only( $ldapserver, 'objectClass' ) )
pla_error( "ObjectClasses are flagged as read only in the phpLDAPadmin configuration." );
$new_entry = array();
$new_entry['objectClass'] = $new_oclass;
$new_attrs_entry = array();
$new_oclass_entry = array( 'objectClass' => $new_oclass );
if( is_array( $new_attrs ) && count( $new_attrs ) > 0 )
foreach( $new_attrs as $attr => $val ) {
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, array($val) ) ) {
$search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) );
}
$new_entry[ $attr ] = $val;
}
$add_res = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry );
if (! $add_res)
pla_error($lang['could_not_perform_ldap_mod_add'],ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()));
else
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=objectclass',$ldapserver->server_id,$encoded_dn));
?>

133
htdocs/add_oclass_form.php Normal file
View File

@@ -0,0 +1,133 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/add_oclass_form.php,v 1.20 2005/07/22 06:34:55 wurley Exp $
/**
* This page may simply add the objectClass and take you back to the edit page,
* but, in one condition it may prompt the user for input. That condition is this:
*
* If the user has requested to add an objectClass that requires a set of
* attributes with 1 or more not defined by the object. In that case, we will
* present a form for the user to add those attributes to the object.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as REQUEST vars:
* - dn (rawurlencoded)
* - new_oclass
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$new_oclass = $_REQUEST['new_oclass'];
$dn = rawurldecode( $_REQUEST['dn'] );
$encoded_dn = rawurlencode( $dn );
/* Ensure that the object has defined all MUST attrs for this objectClass.
* If it hasn't, present a form to have the user enter values for all the
* newly required attrs. */
$entry = get_object_attrs( $ldapserver, $dn, true );
$current_attrs = array();
foreach( $entry as $attr => $junk )
$current_attrs[] = strtolower($attr);
// grab the required attributes for the new objectClass
$schema_oclasses = get_schema_objectclasses( $ldapserver );
$must_attrs = array();
foreach( $new_oclass as $oclass_name ) {
$oclass = get_schema_objectclass( $ldapserver, $oclass_name );
if( $oclass )
$must_attrs = array_merge( $must_attrs, $oclass->getMustAttrNames( $schema_oclasses ) );
}
$must_attrs = array_unique( $must_attrs );
// We don't want any of the attr meta-data, just the string
//foreach( $must_attrs as $i => $attr )
//$must_attrs[$i] = $attr->getName();
// build a list of the attributes that this new objectClass requires,
// but that the object does not currently contain
$needed_attrs = array();
foreach( $must_attrs as $attr ) {
$attr = get_schema_attribute( $ldapserver, $attr );
//echo "<pre>"; var_dump( $attr ); echo "</pre>";
// First, check if one of this attr's aliases is already an attribute of this entry
foreach( $attr->getAliases() as $alias_attr_name )
if( in_array( strtolower( $alias_attr_name ), $current_attrs ) )
// Skip this attribute since it's already in the entry
continue;
if( in_array( strtolower($attr->getName()), $current_attrs ) )
continue;
// We made it this far, so the attribute needs to be added to this entry in order
// to add this objectClass
$needed_attrs[] = $attr;
}
if( count( $needed_attrs ) > 0 ) {
include './header.php'; ?>
<body>
<h3 class="title"><?php echo $lang['new_required_attrs']; ?></h3>
<h3 class="subtitle"><?php echo $lang['requires_to_add'] . ' ' . count($needed_attrs) .
' ' . $lang['new_attributes']; ?></h3>
<small>
<?php echo $lang['new_required_attrs_instructions'];
echo ' ' . count( $needed_attrs ) . ' ' . $lang['new_attributes'] . ' ';
echo $lang['that_this_oclass_requires']; ?>
</small>
<br />
<br />
<form action="add_oclass.php" method="post">
<input type="hidden" name="new_oclass" value="<?php echo rawurlencode( serialize( $new_oclass ) ); ?>" />
<input type="hidden" name="dn" value="<?php echo $encoded_dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<table class="edit_dn" cellspacing="0">
<tr><th colspan="2"><?php echo $lang['new_required_attrs']; ?></th></tr>
<?php foreach( $needed_attrs as $count => $attr ) { ?>
<tr><td class="attr"><b><?php echo htmlspecialchars($attr->getName()); ?></b></td></tr>
<tr><td class="val"><input type="text" name="new_attrs[<?php echo htmlspecialchars($attr->getName()); ?>]" value="" size="40" /></tr>
<?php } ?>
</table>
<br />
<br />
<center><input type="submit" value="<?php echo $lang['add_oclass_and_attrs']; ?>" /></center>
</form>
</body>
</html>
<?php } else {
$add_res = @ldap_mod_add( $ldapserver->connect(), $dn, array( 'objectClass' => $new_oclass ) );
if (! $add_res)
pla_error("Could not perform ldap_mod_add operation.",
ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()));
else
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=objectClass',
$ldapserver->server_id,$encoded_dn));
}
?>

74
htdocs/add_value.php Normal file
View File

@@ -0,0 +1,74 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/add_value.php,v 1.18 2005/07/22 05:42:18 wurley Exp $
/**
* Adds a value to an attribute for a given dn.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn (rawurlencoded)
* - attr (rawurlencoded) the attribute to which we are adding a value
* - new_value (form element)
* - binary
*
* On success, redirect to the edit_dn page. On failure, echo an error.
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$attr = $_POST['attr'];
$new_value = $_POST['new_value'];
$dn = rawurldecode( $_POST['dn'] );
$is_binary_val = isset( $_POST['binary'] ) ? true : false;
$encoded_dn = rawurlencode( $dn );
$encoded_attr = rawurlencode( $attr );
if( is_attr_read_only( $ldapserver, $attr ) )
pla_error(sprintf($lang['attr_is_read_only'],htmlspecialchars( $attr )));
// special case for binary attributes:
// we must go read the data from the file.
if( $is_binary_val ) {
$file = $_FILES['new_value']['tmp_name'];
$f = fopen( $file, 'r' );
$binary_value = fread( $f, filesize( $file ) );
fclose( $f );
$new_value = $binary_value;
}
$new_entry = array( $attr => $new_value );
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, $new_entry ) ) {
$search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) );
}
// Call the custom callback for each attribute modification
// and verify that it should be modified.
if( run_hook ( 'pre_attr_add', array ( 'server_id' => $ldapserver->server_id, 'dn' => $dn, 'attr_name' => $attr,
'new_value' => $new_entry ) ) ) {
$add_result = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry );
if (! $add_result)
pla_error($lang['could_not_perform_ldap_mod_add'],
ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()));
}
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=%s',
$ldapserver->server_id,$encoded_dn,$encoded_attr));
?>

211
htdocs/add_value_form.php Normal file
View File

@@ -0,0 +1,211 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/add_value_form.php,v 1.32 2005/07/22 06:34:55 wurley Exp $
/**
* Displays a form to allow the user to enter a new value to add
* to the existing list of values for a multi-valued attribute.
*
* 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( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$attr = $_GET['attr'];
$dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null;
$encoded_dn = rawurlencode( $dn );
$encoded_attr = rawurlencode( $attr );
if (! is_null($dn))
$rdn = get_rdn( $dn );
else
$rdn = null;
$current_values = get_object_attr( $ldapserver, $dn, $attr );
$num_current_values = ( is_array($current_values) ? count($current_values) : 0 );
$is_object_class = ( 0 == strcasecmp( $attr, 'objectClass' ) ) ? true : false;
$is_jpeg_photo = is_jpeg_photo( $ldapserver, $attr ); //( 0 == strcasecmp( $attr, 'jpegPhoto' ) ) ? true : false;
if( $is_object_class ) {
// fetch all available objectClasses and remove those from the list that are already defined in the entry
$schema_oclasses = get_schema_objectclasses( $ldapserver );
foreach( $current_values as $oclass )
unset( $schema_oclasses[ strtolower( $oclass ) ] );
} else {
$schema_attr = get_schema_attribute( $ldapserver, $attr );
}
include './header.php'; ?>
<body>
<h3 class="title">
<?php echo $lang['add_new']; ?>
<b><?php echo htmlspecialchars($attr); ?></b>
<?php echo $lang['value_to']; ?>
<b><?php echo htmlspecialchars($rdn); ?></b></h3>
<h3 class="subtitle">
<?php echo $lang['server']; ?>:
<b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp;
<?php echo $lang['distinguished_name']; ?>: <b><?php echo htmlspecialchars( $dn ); ?></b></h3>
<?php echo $lang['current_list_of']; ?> <b><?php echo $num_current_values; ?></b>
<?php echo $lang['values_for_attribute']; ?> <b><?php echo htmlspecialchars($attr); ?></b>:
<?php if ($num_current_values) { ?>
<?php if( $is_jpeg_photo ) { ?>
<table><tr><td>
<?php draw_jpeg_photos( $ldapserver, $dn, $attr, false ); ?>
</td></tr></table>
<!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
<p><small>
<?php echo $lang['inappropriate_matching_note']; ?>
</small></p>
<!-- End of temporary warning -->
<?php } else if( is_attr_binary( $ldapserver, $attr ) ) { ?>
<ul>
<?php if( is_array( $vals ) ) {
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,$encoded_dn,$attr,$i-1); ?>
<li><a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value'] . ' ' . $i; ?>)</a></li>
<?php }
} else {
$href = sprintf('download_binary_attr.php?server_id=%s&amp;dn=%s&amp;attr=%s',$ldapserver->server_id,$encoded_dn,$attr); ?>
<li><a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?></a></li>
<?php } ?>
</ul>
<!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
<p><small>
<?php echo $lang['inappropriate_matching_note']; ?>
</small></p>
<!-- End of temporary warning -->
<?php } else { ?>
<ul class="current_values">
<?php if( is_array( $current_values ) ) /*$num_current_values > 1 )*/ {
foreach( $current_values as $val ) { ?>
<li><nobr><?php echo htmlspecialchars(($val)); ?></nobr></li>
<?php } ?>
<?php } else { ?>
<li><nobr><?php echo htmlspecialchars(($current_values)); ?></nobr></li>
<?php } ?>
</ul>
<?php } ?>
<?php } else { ?>
<br />
<br />
<?php } ?>
<?php echo $lang['enter_value_to_add']; ?>
<br />
<br />
<?php if( $is_object_class ) { ?>
<form action="add_oclass_form.php" method="post" class="new_value">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $encoded_dn; ?>" />
<select name="new_oclass[]" multiple="true" size="15">
<?php foreach( $schema_oclasses as $name => $oclass ) {
// exclude any structural ones, as they'll only generate an LDAP_OBJECT_CLASS_VIOLATION
if ($oclass->type == "structural") continue; ?>
<option value="<?php echo $oclass->getName(); ?>"><?php echo $oclass->getName(); ?></option>
<?php } ?>
</select>
<br />
<input type="submit" value="<?php echo $lang['add_new_objectclass']; ?>" />
<br />
<?php if ($config->GetValue('appearance','show_hints')) { ?>
<small>
<br />
<img src="images/light.png" /><span class="hint"><?php echo $lang['new_required_attrs_note']; ?></span>
</small>
<?php }
} else { ?>
<form action="add_value.php" method="post" class="new_value" name="new_value_form"<?php
if( is_attr_binary( $ldapserver, $attr ) ) echo "enctype=\"multipart/form-data\""; ?>>
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $encoded_dn; ?>" />
<input type="hidden" name="attr" value="<?php echo $encoded_attr; ?>" />
<?php if( is_attr_binary( $ldapserver, $attr ) ) { ?>
<input type="file" name="new_value" />
<input type="hidden" name="binary" value="true" />
<?php } else {
if( is_multi_line_attr( $attr, $ldapserver->server_id ) ) { ?>
<textarea name="new_value" rows="3" cols="30"></textarea>
<?php } else { ?>
<input type="text" <?php if( $schema_attr->getMaxLength() ) echo "maxlength=\"" . $schema_attr->getMaxLength() . "\" "; ?>name="new_value" size="40" value="" />
<?php // draw the "browse" button next to this input box if this attr houses DNs:
if( is_dn_attr( $ldapserver, $attr ) )
draw_chooser_link( "new_value_form.new_value", false ); ?>
<?php }
} ?>
<input type="submit" name="submit" value="<?php echo $lang['add_new_value']; ?>" />
<br />
<?php if( $schema_attr->getDescription() ) { ?>
<small><b><?php echo $lang['desc']; ?>:</b> <?php echo $schema_attr->getDescription(); ?></small><br />
<?php } ?>
<?php if( $schema_attr->getType() ) { ?>
<small><b><?php echo $lang['syntax']; ?>:</b> <?php echo $schema_attr->getType(); ?></small><br />
<?php } ?>
<?php if( $schema_attr->getMaxLength() ) { ?>
<small><b><?php echo $lang['maximum_length']; ?>:</b> <?php echo number_format( $schema_attr->getMaxLength() ); ?> <?php echo $lang['characters']; ?></small><br />
<?php } ?>
</form>
<?php } ?>
</body>
</html>

42
htdocs/collapse.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/collapse.php,v 1.13 2005/07/22 05:55:19 wurley Exp $
/**
* This script alters the session variable 'tree', collapsing it
* at the dn specified in the query string.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
* Note: this script is equal and opposite to expand.php
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
$dn = $_GET['dn'];
$encoded_dn = rawurlencode($dn);
initialize_session_tree();
if (array_key_exists($dn,$_SESSION['tree'][$ldapserver->server_id]))
unset($_SESSION['tree'][$ldapserver->server_id][$dn]);
/* 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 = "&".session_name()."=".session_id();
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,$encoded_dn,$id_session_param));
?>

579
htdocs/compare.php Normal file
View File

@@ -0,0 +1,579 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/compare.php,v 1.10 2005/09/25 16:11:44 wurley Exp $
/**
* Compare two DNs - the destination DN is editable.
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
$dn_src = isset($_POST['dn_src']) ? $_POST['dn_src'] : null;
$dn_dst = isset($_POST['dn_dst']) ? $_POST['dn_dst'] : null;
$encoded_dn_src = rawurlencode($dn_src);
$encoded_dn_dst = rawurlencode($dn_dst);
$server_id_src = (isset($_POST['server_id_src']) ? $_POST['server_id_src'] : '');
$server_id_dst = (isset($_POST['server_id_dst']) ? $_POST['server_id_dst'] : '');
$ldapserver_src = $ldapservers->Instance($server_id_src);
if ( ! $ldapserver_src->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$ldapserver_dst = $ldapservers->Instance($server_id_dst);
if ( ! $ldapserver_src->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
dn_exists($ldapserver_src,$dn_src) or pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn_src)));
dn_exists($ldapserver_dst,$dn_dst) or pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn_dst)));
$friendly_attrs = process_friendly_attr_table();
$attrs_src = get_object_attrs($ldapserver_src,$dn_src,false,$config->GetValue('deref','view'));
$attrs_dst = get_object_attrs($ldapserver_dst,$dn_dst,false,$config->GetValue('deref','view'));
# Get a list of all attributes.
$attrs_all = array_keys($attrs_src);
foreach ($attrs_dst as $key => $val)
if (! in_array($key,$attrs_all))
$attrs_all[] = $key;
include './header.php';
?>
<body>
<table class="comp_dn" border=0>
<tr><td colspan=6>
<h3 class="title"><?php echo $lang['comparing']; ?></h3>
</td></tr>
<tr>
<td colspan=2 width=20%>
<h3 class="subtitle"><?php echo $lang['attribute']; ?><br />&nbsp;</h3>
</td>
<td colspan=2 width=40%>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver_src->name; ?></b><br /><?php echo $lang['distinguished_name'];?>: <b><?php echo htmlspecialchars(($dn_src)); ?></b></h3>
</td>
<td colspan=2 width=40%>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver_dst->name; ?></b><br /><?php echo $lang['distinguished_name'];?>: <b><?php echo htmlspecialchars(($dn_dst)); ?></b></h3>
</td>
</tr>
<tr>
<td colspan=6 align=right>
<form action="compare.php" method="post" name="compare_form">
<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 $lang['switch_entry']; ?>" />
</form>
</td>
</tr>
<?php
if(! $attrs_all || ! is_array($attrs_all)) {
printf('<tr><td colspan="2">(%s)</td></tr>',$lang['no_attributes']);
print '</table>';
print '</html>';
die();
}
sort($attrs_all);
# 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;
# Has the config.php specified that this attribute is to be hidden or shown?
if (is_attr_hidden($ldapserver_src,$attr) || is_attr_hidden($ldapserver_dst,$attr))
continue;
?>
<!-- Begin Attribute -->
<tr>
<?php foreach (array('src','dst') as $side) { ?>
<?php
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly()) { ?>
<form action="update_confirm.php" 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 = get_schema_attribute($ldapserver_src,$attr,$dn_src);
$schema_attr_dst = get_schema_attribute($ldapserver_dst,$attr,$dn_dst);
# Setup the $attr_note, which will be displayed to the right of the attr name (if any)
$attr_note = '';
$required_note = '';
# is there a user-friendly translation available for this attribute?
if (isset($friendly_attrs[strtolower($attr)])) {
$attr_display = $friendly_attrs[strtolower($attr)];
$attr_note = sprintf('<acronym title="%s">alias</acronym>',sprintf($lang['alias_for'],$attr_display,$attr));
} else {
$attr_note = '';
$attr_display = $attr;
}
# is this attribute required by an objectClass?
$required_by = '';
switch ($side) {
case 'src':
$ldapserver = $ldapserver_src;
if ($schema_attr_src)
foreach ($schema_attr_src->getRequiredByObjectClasses() as $required)
if (isset($attrs_src['objectClass']) && in_array(strtolower($required),arrayLower($attrs_src['objectClass'])))
$required_by .= $required . ' ';
# It seems that some LDAP servers (Domino) returns attributes in lower case?
elseif( isset($attrs_src['objectclass']) && in_array(strtolower($required),arrayLower($attrs_src['objectclass'])))
$required_by .= $required . ' ';
break;
case 'dst':
$ldapserver = $ldapserver_dst;
if ($schema_attr_dst)
foreach ($schema_attr_dst->getRequiredByObjectClasses() as $required)
if (isset($attrs_dst['objectClass']) && in_array(strtolower($required),arrayLower($attrs_dst['objectClass'])))
$required_by .= $required . ' ';
# It seems that some LDAP servers (Domino) returns attributes in lower case?
elseif (isset($attrs_dst['objectclass']) && in_array(strtolower($required),arrayLower($attrs_dst['objectclass'])))
$required_by .= $required . ' ';
break;
}
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($lang['attr_name_tooltip'],$attr) ?>" href="<?php echo $schema_href; ?>"><?php echo $attr_display; ?></a></b>
</td>
<td class="attr_note">
<sup><small><?php echo $attr_note; ?></small></sup>
</td>
<?php }
if ($required_by) {
$required_note .= sprintf('<acronym title="%s">%s</acronym>',sprintf($lang['required_for'],$required_by),$lang['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 } ?>
<?php if (is_attr_read_only($ldapserver,$attr)) { ?>
<small>(<acronym title="<?php echo $lang['read_only_tooltip']; ?>"><?php echo $lang['read_only']; ?></acronym>)</small>
<?php } ?>
</td>
<?php } ?>
</tr>
<!-- End of Attribute -->
<!-- Begin Values -->
<tr>
<?php
foreach (array('src','dst') as $side) {
$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="attr">';
if (! isset($attrs_src[$attr])) {
echo "<small>&lt;". $lang['no_value']."&gt;</small></td>";
$toJump = 1;
continue;
} else
$vals = $attrs_src[$attr];
$ldapserver = $ldapserver_src;
break;
case 'dst':
print '<td colspan=2>&nbsp</td><td class="val">';
if (! isset($attrs_dst[$attr])) {
echo "<small>&lt;". $lang['no_value']."&gt;</small></td>";
$toJump = 1;
continue;
} else
$vals = $attrs_dst[$attr];
$ldapserver = $ldapserver_dst;
break;
}
if ($toJump) continue;
/*
* Is this attribute a jpegPhoto?
*/
if (is_jpeg_photo($ldapserver,$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)
draw_jpeg_photos( $ldapserver, $dn_src, $attr, false );
break;
case 'dst':
if( $ldapserver_dst->isReadOnly() || is_attr_read_only( $ldapserver_dst, $attr ) )
draw_jpeg_photos( $ldapserver, $dn_dst, $attr, false );
else
draw_jpeg_photos( $ldapserver, $dn_dst, $attr, true );
break;
}
// proceed to the next attribute
echo "</td>\n";
continue;
}
/*
* Is this attribute binary?
*/
if( is_attr_binary( $ldapserver, $attr ) ) {
switch ($side) {
case 'src':
$href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_src,$attr);
break;
case 'dst':
$href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_dst,$attr);
break;
}
?>
<small>
<?php echo $lang['binary_value']; ?><br />
<?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 $lang['download_value']; ?>(<?php echo $i; ?>)</a><br />
<?php } } else { ?>
<a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?></a><br />
<?php }
if( $side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! is_attr_read_only( $ldapserver, $attr ) ) { ?>
<a href="javascript:deleteAttribute( '<?php echo $attr; ?>' );" style="color:red;"><img src="images/trash.png" /> <?php echo $lang['delete_attribute']; ?></a>
<?php } ?>
</small>
</td>
<?php continue;
}
/*
* 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,
* simply draw the attribute values and continue.
*/
if( $side == 'dst' && ($ldapserver->isReadOnly() || is_attr_read_only( $ldapserver, $attr )) ) {
if( is_array( $vals ) ) {
foreach( $vals as $i => $val ) {
if( trim( $val ) == "" )
echo "<span style=\"color:red\">[" . $lang['empty'] . "]</span><br />\n";
elseif( 0 == strcasecmp( $attr, 'userPassword' ) && $config->GetValue('appearance','obfuscate_password_display'))
echo preg_replace( '/./', '*', $val ) . "<br />";
else
echo htmlspecialchars( $val ) . "<br />";
}
} else {
if( 0 == strcasecmp( $attr, 'userPassword' ) && $config->GetValue('appearance','obfuscate_password_display'))
echo preg_replace( '/./', '*', $vals ) . "<br />";
else
echo $vals . "<br />";
}
echo "</td>";
continue;
}
/*
* 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)
if( $user_password == '' ) {
$enc_type = get_default_hash( $server_id );
}
if ($side == 'dst') { ?>
<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( $config->GetValue('appearance','obfuscate_password_display') || is_null( $enc_type ) ) {
echo htmlspecialchars( preg_replace( "/./", "*", $user_password ) );
} else {
echo htmlspecialchars( $user_password );
} ?>
<br />
<?php if ($side == 'dst') { ?>
<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">
<!--
function passwordComparePopup()
{
mywindow = open( 'password_checker.php', 'myname', 'resizable=no,width=450,height=200,scrollbars=1' );
mywindow.location.href = 'password_checker.php?hash=<?php echo base64_encode($user_password); ?>&base64=true';
if( mywindow.opener == null )
mywindow.opener = self;
}
-->
</script>
<small><a href="javascript:passwordComparePopup()"><?php echo $lang['t_check_pass']; ?></a></small>
</td>
<?php continue;
}
/*
* Is this a boolean attribute?
*/
if( is_attr_boolean( $ldapserver, $attr) ) {
$val = $vals[0];
if ($side = 'dst') {?>
<input type="hidden" name="old_values[<?php echo htmlspecialchars( $attr ); ?>]" value="<?php echo htmlspecialchars($val); ?>" />
<select name="new_values[<?php echo htmlspecialchars( $attr ); ?>]">
<option value="TRUE"<?php echo ($val=='TRUE' ? ' selected' : ''); ?>><?php echo $lang['true']; ?></option>
<option value="FALSE"<?php echo ($val=='FALSE' ? ' selected' : ''); ?>><?php echo $lang['false']; ?></option>
<option value="">(<?php echo $lang['none_remove_value']; ?>)</option>
</select>
<?php } ?>
</td>
<?php continue;
}
/*
* 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; ?>
<!-- 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 }
// Is this value is a structural objectClass, make it read-only
if( 0 == strcasecmp( $attr, 'objectClass' ) ) { ?>
<a title="<?php echo $lang['view_schema_for_oclass']; ?>" href="schema.php?server_id=<?php echo $ldapserver->server_id; ?>&amp;view=objectClasses&amp;viewvalue=<?php echo htmlspecialchars( $val ); ?>"><img src="images/info.png" /></a>
<?php $schema_object = get_schema_objectclass( $ldapserver, $val);
if ($schema_object->type == 'structural') {
echo "$val <small>(<acronym title=\"" . sprintf( $lang['structural_object_class_cannot_remove'] ) . "\">" . $lang['structural'] . "</acronym>)</small><br />";
if ($side == 'dst') {?>
<input type="hidden" name="<?php echo $input_name; ?>" id="<?php echo $input_id; ?>" value="<?php echo htmlspecialchars($val); ?>" />
<?php }
continue;
}
}
if( is_dn_string( $val ) || is_dn_attr( $ldapserver, $attr ) ) { ?>
<a title="<?php echo sprintf( $lang['go_to_dn'], htmlspecialchars($val) ); ?>" href="edit.php?server_id=<?php echo $ldapserver->server_id; ?>&amp;dn=<?php echo rawurlencode($val); ?>"><img style="vertical-align: top" src="images/go.png" /></a>
<?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 }
if( is_multi_line_attr( $attr, $val, $ldapserver->server_id ) ) {
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( is_dn_attr( $ldapserver, $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 = get_schema_attribute( $ldapserver_dst, $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 = "add_oclass_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&new_oclass=$src_oclass[0]";
} else {
$add_href = "add_value_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&attr=objectClass";
}
if ($attr == 'objectClass')
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,$lang['add_oclass_and_attrs'],$lang['add_value']);
else
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,sprintf($lang['need_oclass'], implode(" ",$src_oclass)),$lang['add_new_objectclass']);
} else {
if(! $schema_attr_dst->getIsSingleValue() || (! isset($vals))) {
$add_href = "add_value_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&attr=" . rawurlencode( $attr );
printf('<div class="add_value">(<a href="%s" title="%s">%s</a>)</div>',
$add_href,sprintf($lang['add_value_tooltip'],$attr),$lang['add_value']);
}
}
}
print "</td></tr>"; ?>
</td>
<?php flush(); ?>
</tr>
<?php } /* End foreach( $attrs as $attr => $vals ) */
if( ! $ldapserver_dst->isReadOnly( ) ) { ?>
<td colspan="2">&nbsp</td><td colspan=2><center><input type="submit" value="<?php echo $lang['save_changes']; ?>" /></center></td></tr></form>
<?php } ?>
</table>
<?php /* If this entry has a binary attribute, we need to provide a form for it to submit when deleting it. */ ?>
<script language="javascript">
//<!--
function deleteAttribute( attrName )
{
if( confirm( "<?php echo $lang['really_delete_attribute']; ?> '" + attrName + "'?" ) ) {
document.delete_attribute_form.attr.value = attrName;
document.delete_attribute_form.submit();
}
}
//-->
</script>
<!-- This form is submitted by JavaScript when the user clicks "Delete attribute" on a binary attribute -->
<form name="delete_attribute_form" action="delete_attr.php" method="post">
<input type="hidden" name="server_id" value="<?php echo $ldapserver_dst->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $dn_dst; ?>" />
<input type="hidden" name="attr" value="FILLED IN BY JAVASCRIPT" />
</form>
</body>
</html>

79
htdocs/compare_form.php Normal file
View File

@@ -0,0 +1,79 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/compare_form.php,v 1.2 2005/07/22 05:47:43 wurley Exp $
/**
* Compares to DN entries side by side.
*
* - dn (rawurlencoded)
* - server_id
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$dn = (isset($_GET['dn']) ? $_GET['dn'] : '');
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$container = get_container( $dn );
$attrs = get_object_attrs( $ldapserver, $dn );
$select_server_html = server_select_list($ldapserver->server_id,true,'server_id_dst');
include './header.php'; ?>
<body>
<h3 class="title"><?php echo $lang['compare_dn']. '&nbsp;' . $rdn; ?></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b>
<?php if ($dn) { ?>
&nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b>
<?php } ?>
</h3>
<center>
<?php echo $lang['compare']; ?> <b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo $lang['with']; ?>:<br />
<br />
<form action="compare.php" method="post" name="compare_form">
<input type="hidden" name="server_id_src" value="<?php echo $ldapserver->server_id; ?>" />
<table style="border-spacing: 10px">
<tr>
<?php if (! $dn) { ?>
<td><acronym title="<?php echo $lang['compf_dn_tooltip']; ?>"><?php echo $lang['compf_source_dn']; ?></acronym>:</td>
<td>
<input type="text" name="dn_src" size="45" value="<?php echo htmlspecialchars( $dn ); ?>" />
<?php draw_chooser_link( 'compare_form.dn_src', 'true', $rdn ); ?></td>
</td>
<?php } else { ?>
<input type="hidden" name="dn_src" value="<?php echo htmlspecialchars( $dn ); ?>" />
<?php } ?>
</tr>
<tr>
<td><acronym title="<?php echo $lang['compf_dn_tooltip']; ?>"><?php echo $lang['copyf_dest_dn']; ?></acronym>:</td>
<td>
<input type="text" name="dn_dst" size="45" value="" />
<?php draw_chooser_link( 'compare_form.dn_dst', 'true', '' ); ?></td>
</td>
</tr>
<tr>
<td><?php echo $lang['copyf_dest_server']?>:</td>
<td><?php echo $select_server_html; ?></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="<?php echo $lang['compare']; ?>" /></td>
</tr>
</table>
</form>
</center>
</body>
</html>

220
htdocs/copy.php Normal file
View File

@@ -0,0 +1,220 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/copy.php,v 1.35 2005/09/25 16:11:44 wurley Exp $
/**
* Copies a given object to create a new one.
*
* Vars that come in as POST vars
* - source_dn (rawurlencoded)
* - new_dn (form element)
* - server_id
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
$server_id_src = (isset($_POST['server_id']) ? $_POST['server_id'] : '');
$server_id_dst = (isset($_POST['dest_server_id']) ? $_POST['dest_server_id'] : '');
$ldapserver_src = $ldapservers->Instance($server_id_src);
$ldapserver_dst = $ldapservers->Instance($server_id_dst);
if ($ldapserver_dst->isReadOnly())
pla_error($lang['copy_server_read_only']);
if (! $ldapserver_src->haveAuthInfo() || ! $ldapserver_dst->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn_src = $_POST['old_dn'];
$dn_dst = $_POST['new_dn'];
$do_recursive = (isset($_POST['recursive']) && $_POST['recursive'] == 'on') ? true : false;
$do_remove = (isset($_POST['remove']) && $_POST['remove'] == 'yes') ? true : false;
$encoded_dn = rawurlencode($dn_src);
include './header.php';
# Error checking
if (0 == strlen(trim($dn_dst)))
pla_error($lang['copy_dest_dn_blank']);
if (pla_compare_dns($dn_src,$dn_dst) == 0 && $server_id_src == $server_id_dst)
pla_error($lang['copy_source_dest_dn_same']);
if (dn_exists($ldapserver_dst,$dn_dst))
pla_error(sprintf($lang['copy_dest_already_exists'],pretty_print_dn($dn_dst)));
if (! dn_exists($ldapserver_dst,get_container($dn_dst)))
pla_error(sprintf($lang['copy_dest_container_does_not_exist'],pretty_print_dn(get_container($dn_dst))));
if ($do_recursive) {
$filter = isset($_POST['filter']) ? $_POST['filter'] : '(objectClass=*)';
# Build a tree similar to that of the tree browser to give to r_copy_dn
$snapshot_tree = array();
print '<body>';
printf('<h3 class="title">%s%s</h3>',$lang['copy_copying'],htmlspecialchars($dn_src));
printf('<h3 class="subtitle">%s</h3>',$lang['copy_recursive_copy_progress']);
print '<br /><br />';
print '<small>';
print $lang['copy_building_snapshot'];
flush();
$snapshot_tree = build_tree($ldapserver_src,$dn_src,array(),$filter);
printf('<span style="color:green">%s</span><br />',$lang['success']);
flush();
# Prevent script from bailing early on a long delete
@set_time_limit(0);
$copy_result = r_copy_dn($ldapserver_src,$ldapserver_dst,$snapshot_tree,$dn_src,$dn_dst);
print '</small>';
} else {
$copy_result = copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst);
}
if ($copy_result) {
$edit_url = sprintf('edit.php?server_id=%s&dn=%s',$server_id_dst,rawurlencode($dn_dst));
$new_rdn = get_rdn($dn_dst);
$container = get_container($dn_dst);
if (array_key_exists('tree',$_SESSION)) {
# do we not have a tree and tree icons yet? Build a new ones.
initialize_session_tree();
$tree = $_SESSION['tree'];
$tree_icons = $_SESSION['tree_icons'];
if (isset($tree[$server_id_dst][$container])) {
$tree[$server_id_dst][$container][] = $dn_dst;
sort($tree[$server_id_dst][$container]);
$tree_icons[$server_id_dst][$dn_dst] = get_icon($ldapserver_dst,$dn_dst);
$_SESSION['tree'] = $tree;
$_SESSION['tree_icons'] = $tree_icons;
session_write_close();
}
}
?>
<center>
<?php printf('%s<a href="%s">%s</a>',$lang['copy_successful_like_to'],$edit_url,$lang['copy_view_new_entry']) ?>
</center>
<!-- refresh the tree view (with the new DN renamed)
and redirect to the edit_dn page -->
<script language="javascript">
parent.left_frame.location.reload();
</script>
</body>
</html>
<?php
if ($do_remove) {
sleep(2);
$delete_url = sprintf('delete_form.php?server_id=%s&dn=%s',$server_id_dst,rawurlencode($dn_src));
?>
<!-- redirect to the delete form -->
<script language="javascript">
parent.right_frame.location="<?php echo $delete_url; ?>"
</script>
<?php }
} else {
exit;
}
function r_copy_dn($ldapserver_src,$ldapserver_dst,$tree,$root_dn,$dn_dst) {
debug_log(sprintf('r_copy_dn: Entered with (%s,%s,%s,%s,%s)',
$ldapserver_src->server_id,$ldapserver_dst->server_id,serialize($tree),$root_dn,$dn_dst),2);
global $lang;
printf('<nobr>%s %s...',$lang['copy_copying'],htmlspecialchars($root_dn));
flush();
$copy_result = copy_dn($ldapserver_src,$ldapserver_dst,$root_dn,$dn_dst);
if (! $copy_result)
return false;
printf('<span style="color:green">%s</span></nobr><br />',$lang['success']);
flush();
$children = isset($tree[$root_dn]) ? $tree[$root_dn] : null;
if (is_array($children) && count($children) > 0) {
foreach($children as $child_dn) {
$child_rdn = get_rdn($child_dn);
$new_dest_dn = sprintf('%s,%s',$child_rdn,$dn_dst);
r_copy_dn($ldapserver_src,$ldapserver_dst,$tree,$child_dn,$new_dest_dn);
}
} else {
return true;
}
return true;
}
function copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst) {
debug_log(sprintf('copy_dn: Entered with (%s,%s,%s,%s)',
$ldapserver_src->server_id,$ldapserver_dst->server_id,$dn_src,$dn_dst),2);
global $lang;
$new_entry = get_object_attrs($ldapserver_src,$dn_src);
# modify the prefix-value (ie "bob" in cn=bob) to match the destination DN's value.
$rdn_attr = substr($dn_dst,0,strpos($dn_dst,'='));
$rdn_value = get_rdn($dn_dst);
$rdn_value = substr($rdn_value,strpos($rdn_value,'=') + 1);
$new_entry[$rdn_attr] = $rdn_value;
# don't need a dn attribute in the new entry
unset($new_entry['dn']);
# Check the user-defined custom call back first
if (true === run_hook('pre_entry_create',
array ('server_id'=>$ldapserver_dst->server_id,'dn'=>$dn_dst,'attrs'=>$new_entry))) {
$add_result = @ldap_add($ldapserver_dst->connect(),$dn_dst,$new_entry);
if (! $add_result) {
run_hook('post_entry_create',array('server_id'=>$ldapserver_dst->server_id,
'dn'=>$dn_dst,'attrs'=>$new_entry));
print '</small><br /><br />';
pla_error($lang['copy_failed'] . $dn_dst,ldap_error($ldapserver_dst->connect()),ldap_errno($ldapserver_dst->connect()));
}
return $add_result;
} else {
return false;
}
}
/**
* @param object $ldapserver
* @param dn $dn
* @param array $tree
* @param string $filter
*/
function build_tree($ldapserver,$dn,$tree,$filter='(objectClass=*)') {
debug_log(sprintf('build_tree: Entered with (%s,%s,%s,%s)',
$ldapserver->server_id,$dn,serialize($tree),$filter),2);
$children = get_container_contents($ldapserver,$dn,0,$filter);
if (is_array($children) && count($children) > 0) {
$tree[$dn] = $children;
foreach ($children as $child_dn)
$tree = build_tree($ldapserver,$child_dn,$tree,$filter);
}
debug_log(sprintf('build_tree: Returning (%s)',serialize($tree)),1);
return $tree;
}
?>

124
htdocs/copy_form.php Normal file
View File

@@ -0,0 +1,124 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/copy_form.php,v 1.24 2005/07/22 05:47:43 wurley Exp $
/**
* Copies a given object to create a new one.
*
* Variables that come in via common.php
* - server_id
* Variables that come in via GET variables
* - dn (rawurlencoded)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn = $_GET['dn'] ;
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$container = get_container( $dn );
$attrs = get_object_attrs( $ldapserver, $dn );
$select_server_html = server_select_list($ldapserver->server_id,true,'dest_server_id');
$children = get_container_contents( $ldapserver, $dn );
include './header.php';
// Draw some javaScrpt to enable/disable the filter field if this may be a recursive copy
if( is_array( $children ) && count( $children ) > 0 ) { ?>
<script language="javascript">
//<!--
function toggle_disable_filter_field( recursive_checkbox )
{
if( recursive_checkbox.checked ) {
recursive_checkbox.form.remove.disabled = false;
recursive_checkbox.form.filter.disabled = false;
} else {
recursive_checkbox.form.remove.disabled = true;
recursive_checkbox.form.remove.checked = false;
recursive_checkbox.form.filter.disabled = true;
}
}
//-->
</script>
<?php } ?>
<body>
<h3 class="title"><?php echo $lang['copyf_title_copy'] . $rdn; ?></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b></h3>
<center>
<?php echo $lang['copyf_title_copy'] ?><b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo $lang['copyf_to_new_object']?>:<br />
<br />
<form action="copy.php" method="post" name="copy_form">
<input type="hidden" name="old_dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<table style="border-spacing: 10px">
<tr>
<td><acronym title="<?php echo $lang['copyf_dest_dn_tooltip']; ?>"><?php echo $lang['copyf_dest_dn']?></acronym>:</td>
<td>
<input type="text" name="new_dn" size="45" value="<?php echo htmlspecialchars( $dn ); ?>" />
<?php draw_chooser_link( 'copy_form.new_dn', 'true', $rdn ); ?></td>
</td>
</tr>
<tr>
<td><?php echo $lang['copyf_dest_server']?>:</td>
<td><?php echo $select_server_html; ?></td>
</tr>
<?php if( is_array( $children ) && count( $children ) > 0 ) { ?>
<tr>
<td><label for="recursive"><?php echo $lang['recursive_copy']; ?></label>:</td>
<td><input type="checkbox" id="recursive" name="recursive" onClick="toggle_disable_filter_field(this)" />
<small>(<?php echo $lang['copyf_recursive_copy']?>)</small></td>
</tr>
<tr>
<td><acronym title="<?php echo $lang['filter_tooltip']; ?>"><?php echo $lang['filter']; ?></acronym>:</td>
<td><input type="text" name="filter" value="(objectClass=*)" size="45" disabled />
</tr>
<tr>
<td><?php echo $lang['delete_after_copy']; ?></td>
<td><input type="checkbox" name="remove" value="yes"/ disabled>
<small>(<?php echo $lang['delete_after_copy_warn']; ?>)</small)</td>
</tr>
<?php } else { ?>
<tr>
<td><?php echo $lang['delete_after_copy']; ?></td>
<td><input type="checkbox" name="remove" value="yes"/></td>
</tr>
<?php } ?>
<tr>
<td colspan="2" align="right"><input type="submit" value="<?php echo $lang['copyf_title_copy']; ?>" /></td>
</tr>
</table>
</form>
<script language="javascript">
//<!--
/* If the user uses the back button, this way we draw the filter field properly. */
toggle_disable_filter_field( document.copy_form.recursive );
//-->
</script>
<?php if ($config->GetValue('appearance','show_hints')) {?>
<small><img src="images/light.png" /><span class="hint"><?php echo $lang['copyf_note']?></span></small>
<?php } ?>
</center>
</body>
</html>

190
htdocs/create.php Normal file
View File

@@ -0,0 +1,190 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/create.php,v 1.43 2005/09/25 16:11:44 wurley Exp $
/**
* Creates a new object.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - new_dn
* - attrs (an array of attributes)
* - vals (an array of values for the above attrs)
* - required_attrs (an array with indices being the attributes,
* and the values being their respective values)
* - object_classes (rawurlencoded, and serialized array of objectClasses)
*
* @package phpLDAPadmin
*/
/**
* @todo: posixgroup with empty memberlist generates an error.
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$new_dn = isset( $_POST['new_dn'] ) ? $_POST['new_dn'] : null;
$required_attrs = isset( $_POST['required_attrs'] ) ? $_POST['required_attrs'] : false;
$object_classes = unserialize( rawurldecode( $_POST['object_classes'] ) );
$redirect = isset( $_POST['redirect'] ) ? $_POST['redirect'] : false;
$encoded_dn = rawurlencode( $new_dn );
$container = get_container( $new_dn );
// 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']);
foreach ($_POST['presubmit'] as $attr) {
$_POST['attrs'][] = $attr;
$_POST['form'][$attr] = $templates->EvaluateDefault($ldapserver,$template['attribute'][$attr]['presubmit'],$_POST['container']);
$_POST['vals'][] = $_POST['form'][$attr];
}
# @todo: This section needs to be cleaned up, and will be when the old templates are removed. In the mean time...
# Rebuild the $_POST['attrs'] & $_POST['vals'], as they can be inconsistent.
unset($_POST['attrs']);
unset($_POST['vals']);
foreach ($_POST['form'] as $attr => $val) {
$_POST['attrs'][] = $attr;
$_POST['vals'][] = $val;
}
}
$vals = isset( $_POST['vals'] ) ? $_POST['vals'] : array();
$attrs = isset( $_POST['attrs'] ) ? $_POST['attrs'] : array();
// build the new entry
$new_entry = array();
if( isset( $required_attrs ) && is_array( $required_attrs ) ) {
foreach( $required_attrs as $attr => $val ) {
if( $val == '' )
pla_error( sprintf( $lang['create_required_attribute'], htmlspecialchars( $attr ) ) );
$new_entry[ $attr ][] = $val;
}
}
if( isset( $attrs ) && is_array( $attrs ) ) {
foreach( $attrs as $i => $attr ) {
if( is_attr_binary( $ldapserver, $attr ) ) {
if( isset( $_FILES['vals']['name'][$i] ) && $_FILES['vals']['name'][$i] != '' ) {
// read in the data from the file
$file = $_FILES['vals']['tmp_name'][$i];
$f = fopen( $file, 'r' );
$binary_data = fread( $f, filesize( $file ) );
fclose( $f );
$val = $binary_data;
$new_entry[ $attr ][] = $val;
}
} else {
if (is_array($vals[$i])) {
# If the array has blank entries, then ignore them.
foreach ($vals[$i] as $value) {
# $new_entry[$attr] = $vals[$i];
if (trim($value))
$new_entry[$attr][] = $value;
}
} else {
$val = isset( $vals[$i] ) ? $vals[$i] : '';
if( '' !== trim($val) )
$new_entry[ $attr ][] = $val;
}
}
}
}
$new_entry['objectClass'] = $object_classes;
if( ! in_array( 'top', $new_entry['objectClass'] ) )
$new_entry['objectClass'][] = 'top';
foreach( $new_entry as $attr => $vals ) {
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $new_dn, $attr, $vals ) ) {
$search_href = sprintf('search.php?search=true&amp;form=advanced&amp;server_id=%s&amp;filter=%s=%s',
$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$new_dn,$search_href ) );
}
if( ! is_attr_binary( $ldapserver, $attr ) )
if( is_array( $vals ) )
foreach( $vals as $i => $v )
$new_entry[ $attr ][ $i ] = $v;
else
$new_entry[ $attr ] = $vals;
}
//echo "<pre>"; var_dump( $new_dn );print_r( $new_entry ); echo "</pre>";
// Check the user-defined custom call back first
if( true === run_hook ( 'pre_entry_create', array ( 'server_id' => $ldapserver->server_id,'dn' => $new_dn,'attrs' => $new_entry ) ) )
$add_result = @ldap_add( $ldapserver->connect(), $new_dn, $new_entry );
else {
pla_error( $lang['create_could_not_add'] );
exit;
}
if( $add_result ) {
run_hook ( 'post_entry_create', array ( 'server_id' => $ldapserver->server_id, 'dn' => $new_dn, 'attrs' => $new_entry ) );
if ($redirect)
$redirect_url = $redirect;
else
$redirect_url = sprintf('edit.php?server_id=%s&dn=%s',$ldapserver->server_id,rawurlencode($new_dn));
if( array_key_exists( 'tree', $_SESSION ) ) {
$tree = $_SESSION['tree'];
$tree_icons = $_SESSION['tree_icons'];
if( isset( $tree[$ldapserver->server_id][$container] ) ) {
$tree[$ldapserver->server_id][$container][] = $new_dn;
sort( $tree[$ldapserver->server_id][$container] );
$tree_icons[$ldapserver->server_id][$new_dn] = get_icon( $ldapserver, $new_dn );
}
$_SESSION['tree'] = $tree;
$_SESSION['tree_icons'] = $tree_icons;
session_write_close();
}
?>
<html>
<head>
<?php if (isset($tree[$ldapserver->server_id][$container]) || in_array($new_dn,$ldapserver->getBaseDN())) { ?>
<!-- refresh the tree view (with the new DN renamed)
and redirect to the edit_dn page -->
<script language="javascript">
parent.left_frame.location.reload();
location.href='<?php echo $redirect_url; ?>';
</script>
<?php } ?>
<meta http-equiv="refresh" content="0; url=<?php echo $redirect_url; ?>" />
</head>
<body>
<?php echo $lang['redirecting'] ?> <a href="<?php echo $redirect_url; ?>"><?php echo $lang['here']?></a>.
</body>
</html>
<?php } else {
pla_error( $lang['create_could_not_add'], ldap_error( $ldapserver->connect() ), ldap_errno( $ldapserver->connect() ) );
}
?>

175
htdocs/create_form.php Normal file
View File

@@ -0,0 +1,175 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/create_form.php,v 1.30 2005/09/25 16:11:44 wurley Exp $
/**
* The menu where the user chooses an RDN, Container, and Template for creating a new entry.
* After submitting this form, the user is taken to their chosen Template handler.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars
* - container (rawurlencoded) (optional)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
require TMPLDIR.'template_config.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : 1; // defaults to 1
$container = $_REQUEST['container'];
$server_menu_html = server_select_list($ldapserver->server_id,true);
include './header.php'; ?>
<body>
<h3 class="title"><?php echo $lang['createf_create_object']?></h3>
<h3 class="subtitle"><?php echo $lang['createf_choose_temp']?></h3>
<center><h3><?php echo $lang['createf_select_temp']?></h3></center>
<form action="creation_template.php" method="post">
<input type="hidden" name="container" value="<?php echo htmlspecialchars( $container ); ?>" />
<table class="create">
<tr>
<td class="heading"><?php echo $lang['server']; ?>:</td>
<td><?php echo $server_menu_html; ?></td>
</tr>
<tr>
<td class="heading"><?php echo $lang['template']; ?>:</td>
<td>
<table class="template_display">
<tr>
<td>
<table class="templates">
<?php
$i = -1;
if ($config->GetValue('template_engine','enable')) {
$template_xml = new Templates($ldapserver->server_id);
if ($config->GetValue('template_engine','disable_old'))
$templates = $template_xml->_template;
else
$templates = array_merge($template_xml->_template,$templates);
}
# Remove non-visable templates.
foreach ($templates as $index => $template)
if (isset($template['visible']) && (! $template['visible']))
unset ($templates[$index]);
$templates['custom']['title'] = 'Custom';
$templates['custom']['icon'] = 'images/object.png';
$count = count( $templates );
foreach( $templates as $name => $template ) {
$i++;
# If the template doesnt have a title, we'll use the desc field.
$template['desc'] = isset($template['title']) ? $template['title'] : $template['desc'];
# Balance the columns properly
if( ( count( $templates ) % 2 == 0 && $i == intval( $count / 2 ) ) ||
( count( $templates ) % 2 == 1 && $i == intval( $count / 2 ) + 1 ) )
echo "</table></td><td><table class=\"templates\">";
# Check and see if this template should be shown in the list
$isValid = false;
if( isset($template['regexp'] ) ) {
if( @preg_match( "/".$template['regexp']."/i", $container ) ) {
$isValid = true;
}
} else {
$isValid = true;
if (isset($template['invalid']) && $template['invalid'])
$isValid = false;
} ?>
</td>
</tr>
<tr>
<?php
if (isset($template['invalid']) && $template['invalid'] || (isset($template['handler']) && ! file_exists(TMPLDIR.'creation/'.$template['handler']))) {
?>
<td class="icon">
<img src="images/error.png" />
</td>
<?php
} else {
?>
<td>
<input type="radio" name="template" value="<?php echo htmlspecialchars($name);?>"
id="<?php echo htmlspecialchars($name); ?>"
<?php
if( 0 == strcasecmp( 'Custom', $name ) ) echo ' checked';
if( ! $isValid ) echo ' disabled';
?> />
</td>
<?php
}
?>
<td class="icon">
<label for="<?php echo htmlspecialchars($name);?>">
<img src="<?php echo $template['icon']; ?>" />
</label>
</td>
<td>
<label for="<?php echo htmlspecialchars($name);?>">
<?php if( 0 == strcasecmp( 'Custom', $template['desc'] ) ) echo '<b>';
if( ! $isValid )
if (isset($template['invalid']) && $template['invalid'])
printf('<span style="color: gray"><acronym title="%s">',$lang['template_invalid']);
else
printf('<span style="color: gray"><acronym title="%s">',$lang['template_restricted']);
echo htmlspecialchars( $template['desc'] );
if( ! $isValid ) echo "</acronym></span>";
if( 0 == strcasecmp( 'Custom', $template['desc'] ) ) echo '</b>'; ?>
</label>
</td>
</tr>
<?php } // end foreach ?>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="submit" value="<?php echo $lang['proceed_gt']?>" /></center></td>
</tr>
</table>
</form>
</body>
</html>

View File

@@ -0,0 +1,71 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/creation_template.php,v 1.29 2005/09/25 16:11:44 wurley Exp $
/**
* This file simply acts as a plugin grabber for the creator templates in
* the directory templates/creation/
*
* Variables that come in via common.php
* server_id
* Expected POST vars:
* template
*
* @package phpLDAPadmin
* @deprecated This file is no longer need when the template engine is up and running.
*/
/**
*/
require './common.php';
if ($config->GetValue('template_engine','enable') && (! is_numeric($_REQUEST['template']))) {
require './template_engine.php';
die();
}
require TMPLDIR.'template_config.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$template = (isset($_REQUEST['template']) ? $_REQUEST['template'] : null);
! is_null($template) or pla_error($lang['ctemplate_no_template']);
if ($template == 'custom') {
foreach ($templates as $id => $template) {
if ($template['handler'] == 'custom.php') {
$template = $id;
break;
}
}
}
isset($templates[$template]) or pla_error(sprintf($lang['invalid_template'], htmlspecialchars($template)));
$template_id = $template;
$template = isset($templates[$template]) ? $templates[$template_id] : null;
if (! array_key_exists('no_header',$template)) {
include './header.php';
?>
<body>
<h3 class="title"><?php echo $lang['createf_create_object']?></h3>
<h3 class="subtitle"><?php echo $lang['ctemplate_on_server']?> '<?php echo htmlspecialchars($ldapserver->name); ?>', <?php echo $lang['using_template']?> '<?php echo htmlspecialchars($template['desc']); ?>'</h3>
<?php }
$handler = TMPLDIR.'creation/' . $template['handler'];
if (! file_exists($handler))
pla_error(sprintf($lang['template_does_not_exist'],htmlspecialchars($template['handler'])));
if (! is_readable($handler))
pla_error(sprintf($lang['template_not_readable'],htmlspecialchars($template['handler'])));
include $handler;
if (! array_key_exists('no_header',$template))
echo "</body>\n</html>";
?>

658
htdocs/css/style.css Normal file
View File

@@ -0,0 +1,658 @@
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/style.css,v 1.44 2005/03/12 14:03:36 wurley Exp $ */
span.hint {
font-size: small;
font-weight: normal;
color: #888;
}
span.warning {
font-size: small;
font-weight: normal;
color: #f00;
}
span.x-small {
font-size: x-small;
}
table.schema_oclasses {
border-left: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
border-top: 0;
margin-bottom: 10px;
background-color: #eee;
}
table.schema_oclasses td {
vertical-align: top;
text-align: left;
padding-left: 5px;
}
table.schema_attr th {
background-color: #016;
padding: 5px;
color: white;
font-weight: bold;
font-size: 125%;
}
table.schema_attr td {
padding: 5px;
vertical-align: top;
}
table.schema_attr tr.even {
background-color: #eee;
}
table.schema_attr tr.odd {
background-color: #ccc;
}
table.schema_attr tr.highlight{
background-color: #bcd;
font-weight: Bold;
}
table.notice tr td {
font-size: 9pt;
padding: 2px;
margin: 0px;
background-color: #eee;
}
table.error {
width: 500px;
border: 2px solid black;
}
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;
border: 0px;
}
table.error tr td h2 {
margin: 5px;
margin-bottom: 20px;
}
table.error tr td.img {
vertical-align: middle;
text-align: center;
width: 20px;
}
table.confirm th {
background-color: #016;
padding: 5px;
color: white;
font-weight: normal;
}
table.confirm tr td {
padding: 4px;
}
table.confirm tr.spacer {
background-color: #ddd;
}
table.confirm tr.even {
background-color: #ccc;
}
table.confirm tr.odd {
background-color: #eee;
}
table.confirm tr td.heading {
text-align: right;
font-size: 75%;
}
table.confirm td.icon {
text-align: center;
}
table.browse tr td {
border: 0;
margin: 0;
padding: 0;
}
table.template_display tr td {
vertical-align: top;
}
table.templates tr td {
text-align: left;
vertical-align: middle;
}
table.templates tr {
height: 25px;
}
table.templates td.icon {
text-align: center;
}
table.exporters tr td {
text-align: left;
vertical-align: middle;
}
table.exporters tr {
height: 25px;
}
a img {
border: 0px;
}
body {
font-family: arial, helvetica, sans-serif;
background-color: white;
font-size: 12pt;
}
table.tree tr.login td {
}
table.tree td.links {
padding: 0px;
font-size: 10px;
padding-left: 12px;
font-size: 10px;
}
table.tree td.links a {
font-size: 10px;
}
table.tree {
border: 0px;
}
table.tree img {
border: 0px;
}
table.tree td {
padding: 2px;
border: 0px solid black;
}
table.tree tr {
}
table.tree tr.server td.icon {
width: 14px;
}
table.tree tr.server td {
padding-top: 15px;
padding-bottom: 0px;
vertical-align: top;
font-size: 20px;
text-align: left;
}
table.tree td.icon {
text-align: center;
padding: 0px;
width: 14px;
font-size: 1px;
}
table.tree td.rdn {
width: 500px;
}
table.tree td.rdn a {
text-decoration: none;
color: black;
}
table.tree td.rdn a:hover {
text-decoration: underline;
color: blue;
}
table.tree td.create {
}
table.tree td.create a {
text-decoration: none;
color: black;
}
table.tree td.create a:hover {
text-decoration: underline;
color: blue;
}
table.tree td.spacer {
width: 22px;
}
table.tree td.expander {
text-align: center;
width: 22px;
max-width: 22px;
min-width: 22px;
}
table.tree td span.count {
color: gray;
font-size: 85%;
}
h3.title {
text-align: center;
margin: 0px;
padding: 10px;
color: white;
background-color: #018;
border: 1px solid black;
font-weight: normal;
font-size: 150%;
}
h3.subtitle {
text-align: center;
margin: 0px;
margin-bottom: 15px;
font-size: 75%;
color: white;
border-bottom: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
background: #018;
padding: 4px;
font-weight: normal;
}
table.comp_dn {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
font-size: 80%;
}
table.comp_dn tr {
width: 200px;
}
table.comp_dn tr td.attr {
background-color: #eee;
vertical-align: top;
}
table.comp_dn tr td.attr_note {
text-align: right;
background-color: #eee;
padding-right: 50px;
}
table.edit_dn {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
width: 600px;
}
table.edit_dn input {
margin: 1px;
}
table.edit_dn input.val {
font-size: 14px;
width: 350px;
font-family: arial, helvetica, sans-serif;
background-color: white;
}
table.edit_dn textarea.val {
font-size: 14px;
width: 350px;
font-family: arial, helvetica, sans-serif;
background-color: white;
}
table.edit_dn tr td {
padding: 4px;
padding-right: 0px;
}
table.edit_dn tr td.attr {
background-color: #eee;
vertical-align: top;
}
table.edit_dn tr td.heading {
border-top: 3px solid #ccc;
font-weight: bold;
}
table.edit_dn tr td.attr_note {
text-align: right;
background-color: #eee;
}
table.edit_dn tr td.attr a {
text-decoration: none;
color: black;
}
table.edit_dn tr td.attr a:hover {
text-decoration: underline;
color: #016;
}
table.edit_dn tr td.val {
text-align: left;
vertical-align: middle;
padding-bottom: 10px;
padding-left: 50px;
}
/** When an attr is updated, it is highlighted to indicate such */
table.edit_dn tr.updated_attr td.attr {
border-top: 1px dashed green;
border-left: 1px dashed green;
background-color: #ded;
}
table.edit_dn tr.updated_attr td.attr_note {
border-top: 1px dashed green;
border-right: 1px dashed green;
background-color: #ded;
}
/** An extra row that sits at the bottom of recently modified attrs to encase them in dashes */
table.edit_dn tr.updated_attr td.bottom {
border-top: 1px dashed green;
}
/** Formatting for the value cell when it is the attribute that has been recently modified */
table.edit_dn tr.updated_attr td.val {
border-left: 1px dashed green;
border-right: 1px dashed green;
}
/* Neede to prevent sub-tables (like the one in which jpegPhotos are displayed)
* from drawing borders as well. */
table.edit_dn tr.updated_attr td table td {
border: 0px;
}
table.edit_dn tr.updated_attr a {
}
table.edit_dn tr.mod_dn {
background: #def;
}
table.edit_dn tr.row1 {
background: #eee;
}
table.edit_dn tr.row2 {
background: #ccc;
}
input.update_dn {
font-size: 65%;
}
small {
font-size: 10pt;
}
form.edit_dn {
margin: 0px;
padding: 0px;
}
h4.oclass {
background: #016;
padding: 5px;
margin: 0px;
margin-top: 8px;
font-weight: normal;
border: 1px solid black;
font-size: 140%;
color: white;
}
h4.oclass_sub {
background: #dde;
border: 1px solid black;
border-top: 0px;
font-weight: normal;
margin: 0px;
padding: 2px;
padding-left: 5px;
font-size: 80%;
}
ul.schema {
margin: 5px;
margin-left: 0px;
padding-left: 20px;
}
ul.schema li {
margin-left: 0px;
padding-left: 0px;
}
ul.schema li small {
font-size: 75%;
color: #777;
}
ul.schema li small a {
color: #77c;
}
ul.current_values {
padding: 5px;
padding-left: 25px;
width: 200px;
margin-left: 50px;
}
form.new_value {
margin-left: 70px;
}
table.search_result_table {
border-spacing: 0;
border-collapse: collapse;
empty-cells: show;
}
table.search_result_table td {
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;
}
table.search_result_table tr.highlight {
background-color: #eee;
}
ul.search {
font-weight: bold;
}
table.search_header {
background-color: #ddf;
width: 100%;
vertical-align: top;
}
div.search_result {
list-style-type: none;
padding: 6px;
padding-left: 20px;
margin-right: 40px;
}
table.attrs {
font-weight: normal;
font-size: 75%;
margin: 0px;
margin-left: 35px;
}
table.attrs td {
padding-right: 10px;
}
table.attrs td.attr {
color: #aaa;
padding-left: 15px;
}
form.search {
width: 500px;
background-color: #ddf;
padding: 5px;
}
table.edit_dn_menu {
font-size: 75%;
}
table.edit_dn_menu td.icon {
width: 16px;
text-align: center;
}
input.scary {
background: red;
font-weight: bold;
color: white;
}
input.cancel {
padding-left: 10px;
padding-right: 10px;
font-weight: bold;
}
input.happy {
background: green;
font-weight: bold;
color: white;
}
table.delete_confirm {
width: 76%;
background-color: #ddf;
padding: 20px;
text-align: left;
}
table.login {
background-color: #ddf;
padding: 10px;
}
table.login td {
padding: 5px;
}
table.create {
font-size: 75%;
}
table.create td.heading {
vertical-align: top;
padding: 10px;
}
div.add_value {
font-size: 10pt;
margin: 0px;
padding: 0px;
}
a.logged_in_dn {
text-decoration: none;
color: black;
}
a.logged_in_dn:hover {
text-decoration: underline;
color: blue;
}
a:hover {
color: red;
}
/* Styles for formatting the documentation page */
h3.doc {
margin-left: 60px;
}
h2.doc {
margin-left: 20px;
}
p.doc {
margin-left: 100px;
}
table.export_form {
font-size: 75%;
width: 400px;
border-spacing: 10px;
border-collapse: separate;
}
table.export_form tr td {
text-align: left;
vertical-align: top;
padding: 4px;
}
table.form tr td {
vertical-align: top;
padding: 4px;
}
.attribute_failed {
color: red;
}
img.chooser {
/* This makes the chooser image line up properly when placed next to a form element in a table cell*/
vertical-align: bottom;
}

81
htdocs/delete.php Normal file
View File

@@ -0,0 +1,81 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/delete.php,v 1.23 2005/09/25 16:11:44 wurley Exp $
/**
* Deletes a DN and presents a "job's done" message.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn (rawurlencoded)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn = $_POST['dn'];
$encoded_dn = rawurlencode($dn);
if (is_null($dn))
pla_error($lang['you_must_specify_a_dn']);
dn_exists($ldapserver,$dn) or pla_error(sprintf($lang['no_such_entry'], '<b>' . pretty_print_dn($dn) . '</b>'));
// Check the user-defined custom callback first.
if (run_hook('pre_entry_delete',array('server_id' => $ldapserver->server_id,'dn' => $dn)))
$del_result = @ldap_delete($ldapserver->connect(), $dn);
else
pla_error(sprintf($lang['could_not_delete_entry'],'<b>'.pretty_print_dn($dn).'</b>'));
if ($del_result) {
# Custom callback
run_hook('post_entry_delete',array('server_id' => $ldapserver->server_id,'dn' => $dn));
# kill the DN from the tree browser session variable and
# refresh the tree viewer frame (left_frame)
if (array_key_exists('tree', $_SESSION)) {
$tree = $_SESSION['tree'];
if (isset($tree[$ldapserver->server_id]) && is_array($tree[$ldapserver->server_id])) {
# does it have children? (it shouldn't, but hey, you never know)
if (isset($tree[$ldapserver->server_id][$dn]))
unset($tree[$ldapserver->server_id][$dn]);
# search and destroy
foreach ($tree[$ldapserver->server_id] as $tree_dn => $subtree)
foreach ($subtree as $key => $sub_tree_dn)
if (0 == strcasecmp($sub_tree_dn, $dn))
unset($tree[$ldapserver->server_id][$tree_dn][$key]);
$_SESSION['tree'] = $tree;
}
session_write_close();
}
include './header.php'; ?>
<script language="javascript">
parent.left_frame.location.reload();
</script>
<br />
<br />
<center><?php echo sprintf($lang['entry_deleted_successfully'],'<b>'.pretty_print_dn($dn).'</b>'); ?></center>
<?php
} else {
pla_error(sprintf($lang['could_not_delete_entry'], '<b>' . pretty_print_dn($dn) . '</b>'),
ldap_error($ldapserver->connect()), ldap_errno($ldapserver->connect()));
}
?>

54
htdocs/delete_attr.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/delete_attr.php,v 1.13 2005/09/17 20:04:29 wurley Exp $
/**
* Deletes an attribute from an entry with NO confirmation.
*
* Variables that come in via common.php
* - server_id
*
* On success, redirect to edit.php
* On failure, echo an error.
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn = isset($_POST['dn']) ? $_POST['dn'] : null;
$attr = isset($_POST['attr']) ? $_POST['attr'] : null;
if (! $dn)
pla_error($lang['no_dn_specified']);
if (! $attr)
pla_error($lang['no_attr_specified']);
$encoded_dn = rawurlencode($dn);
if (is_attr_read_only($ldapserver,$attr))
pla_error(sprintf($lang['attr_is_read_only'],htmlspecialchars($attr)));
$update_array = array();
$update_array[$attr] = array();
$res = @ldap_modify($ldapserver->connect(),$dn,$update_array);
if ($res) {
$redirect_url = sprintf("edit.php?server_id=%s&dn=%s",$ldapserver->server_id,$encoded_dn);
foreach($update_array as $attr => $junk)
$redirect_url .= "&modified_attrs[]=$attr";
header("Location: $redirect_url");
} else {
pla_error($lang['could_not_perform_ldap_modify'],ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()));
}
?>

153
htdocs/delete_form.php Normal file
View File

@@ -0,0 +1,153 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/delete_form.php,v 1.20 2005/07/22 05:47:44 wurley Exp $
/**
* delete_form.php
* Displays a last chance confirmation form to delete a dn.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn = $_GET['dn'];
$encoded_dn = rawurlencode( $dn );
$rdn = pla_explode_dn( $dn );
$rdn = $rdn[0];
$children = get_container_contents( $ldapserver,$dn,0,'(objectClass=*)',LDAP_DEREF_NEVER );
$has_children = count($children) > 0 ? true : false;
include './header.php'; ?>
<body>
<h3 class="title"><?php echo sprintf( $lang['delete_dn'], htmlspecialchars( $rdn ) ); ?></b></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']; ?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
<?php if( $has_children ) { ?>
<center><b><?php echo $lang['permanently_delete_children']; ?></b><br /><br />
<?php
flush();
# get the total number of child objects (whole sub-tree)
$s = pla_ldap_search( $ldapserver, 'objectClass=*', $dn, array('dn'), 'sub' );
$sub_tree_count = count( $s );
?>
<table class="delete_confirm">
<tr>
<td>
<p>
<?php echo sprintf( $lang['entry_is_root_sub_tree'], $sub_tree_count ); ?>
<small>(<a href="search.php?search=true&amp;server_id=<?php echo $ldapserver->server_id; ?>&amp;filter=<?php echo rawurlencode('objectClass=*'); ?>&amp;base_dn=<?php echo $encoded_dn; ?>&amp;form=advanced&amp;scope=sub"><?php echo $lang['view_entries']; ?></a>)</small>
<br />
<br />
<?php echo sprintf( $lang['confirm_recursive_delete'], ($sub_tree_count-1) ); ?><br />
<br />
<small><?php echo $lang['confirm_recursive_delete_note']; ?></small>
<br />
<br />
<table width="100%">
<tr>
<td>
<center>
<form action="rdelete.php" method="post">
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" class="scary" value="<?php echo sprintf( $lang['delete_all_x_objects'], $sub_tree_count ); ?>" />
</form>
</center>
</td>
<td>
<center>
<form action="edit.php" method="get">
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" name="submit" value="<?php echo $lang['cancel']; ?>" class="cancel" />
</form>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php flush(); ?>
<br />
<br />
<?php echo $lang['list_of_entries_to_be_deleted']; ?><br />
<select size="<?php echo min( 10, $sub_tree_count );?>" multiple disabled style="background:white; color:black;width:500px" >
<?php $i=0;
foreach( $s as $dn => $junk ) {
$i++; ?>
<option><?php echo $i; ?>. <?php echo htmlspecialchars( ( $dn ) ); ?></option>
<?php } ?>
</select>
<br />
<?php } else { ?>
<center>
<table class="delete_confirm">
<tr>
<td>
<?php echo $lang['sure_permanent_delete_object']; ?><br />
<br />
<nobr><acronym title="<?php echo $lang['distinguished_name']; ?>"><?php echo $lang['dn']; ?></acronym>: <b><?php echo pretty_print_dn( $dn ); ?></b><nobr><br />
<nobr><?php echo $lang['server']; ?>: <b><?php echo htmlspecialchars($ldapserver->name); ?></b></nobr><br />
<br />
<table width="100%">
<tr>
<td>
<center>
<form action="delete.php" method="post">
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" name="submit" value="<?php echo $lang['delete']; ?>" class="scary" />
</form>
</center>
</td>
<td>
<center>
<form action="edit.php" method="get">
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" name="submit" value="<?php echo $lang['cancel']; ?>" class="cancel" />
</form>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<?php } ?>
</body>
</html>

52
htdocs/documentation.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/documentation.php,v 1.9 2005/09/25 16:11:44 wurley Exp $
/**
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
//include './header.php';
echo "<body>";
$view = isset( $_GET['view'] ) ? $_GET['view'] : false;
switch( $view ) {
case 'credits':
echo "<h3 class=\"title\">phpLDAPadmin Credits</h3>";
echo "<pre>";
echo "<small>";
include DOCDIR.'CREDITS';
echo "</small>";
echo "</pre>";
echo "</body>";
echo "</html>";
exit;
break;
case 'changelog':
echo "<h3 class=\"title\">phpLDAPadmin ChangeLog</h3>";
echo "<pre>";
echo "<small>";
include DOCDIR.'ChangeLog';
echo "</small>";
echo "</pre>";
echo "</body>";
echo "</html>";
exit;
break;
}
?>
<h3 class="title">phpLDAPadmin documentation</h3>
<h3 class="subtitle">Stuff you wish you already knew.</h3>
<h2 class="doc">Extending phpLDAPadmin</h2>
<h3 class="doc">Creation Templates</h3>
<p class="doc">TODO: Write me.</p>
<h3 class="doc">Modification Templates</h3>
<p class="doc">TODO: Write me.</p>

52
htdocs/donate.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/donate.php,v 1.7 2005/02/26 12:35:05 wurley Exp $
/**
* @package phpLDAPadmin
*/
/**
*/
include './common.php';
include './header.php';
$donate_base_href="https://sourceforge.net/donate/index.php?group_id=61828&amp;type=0";
$amounts = array( 10, 20, 50, 100 );
?>
<body>
<h3 class="title">Donate</h3>
<br />
<br />
<br />
<p style="text-align: center"><?php echo $lang['donation_instructions']; ?></p>
<br />
<table style="width: 100%; font-size: 12px">
<tr>
<?php foreach( $amounts as $amount ) { ?>
<td align="center">
<a href="<?php echo $donate_base_href; ?>&amp;amt=<?php echo $amount; ?>" target="new">
<img src="images/paypal-donate.png"
alt="[<?php echo sprintf( $lang['donate_amount'], '$US ' . $amount ); ?>]"
title="<?php echo sprintf( $lang['donate_amount'], '$US ' . $amount ); ?>" /></a>
</td>
<?php } ?>
</tr>
<tr>
<?php foreach( $amounts as $amount ) { ?>
<td align="center"><?php echo sprintf( $lang['donate_amount'], '$' . $amount ); ?></td>
<?php } ?>
</tr>
</table>
<br />
<br />
</body>
</html>

View File

@@ -0,0 +1,44 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/download_binary_attr.php,v 1.12 2005/07/22 05:47:44 wurley Exp $
/**
* @package phpLDAPadmin
* Variables that come in via common.php
* - server_id
*/
/**
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn = rawurldecode($_GET['dn']);
$attr = $_GET['attr'];
# if there are multiple values in this attribute, which one do you want to see?
$value_num = isset($_GET['value_num']) ? $_GET['value_num'] : 0;
dn_exists($ldapserver,$dn) or
pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn)));
$search = @ldap_read($ldapserver->connect(),$dn,"(objectClass=*)",array($attr),0,0,0,$config->GetValue('deref','view'));
if (! $search)
pla_error($lang['error_performing_search'],ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()));
$entry = ldap_first_entry($ldapserver->connect(),$search);
$attrs = ldap_get_attributes($ldapserver->connect(),$entry);
$attr = ldap_first_attribute($ldapserver->connect(),$entry,$attrs);
$values = ldap_get_values_len($ldapserver->connect(),$entry,$attr);
$count = $values['count'];
// Dump the binary data to the browser
header("Content-type: octet-stream");
header("Content-disposition: attachment; filename=$attr");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
echo $values[$value_num];
?>

59
htdocs/edit.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/edit.php,v 1.56 2005/09/25 16:11:44 wurley Exp $
/**
* Displays the specified dn from the specified server for editing
* in its template as determined by get_template(). This is a simple
* shell for displaying entries. The real work is done by the templates
* found in tempaltes/modification/
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
* - use_default_template (optional) If set, use the default template no matter what
* - Other vars may be set and used by the modification templates
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
require TMPLDIR.'template_config.php';
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$dn = isset($_GET['dn']) ? $_GET['dn'] : false;
$dn !== false or pla_error($lang['missing_dn_in_query_string']);
$decoded_dn = rawurldecode($dn);
$encoded_dn = rawurlencode($decoded_dn);
/* Template authors may wish to present the user with a link back to the default, generic
template for editing. They may use this as the target of the href to do so.
@deprectated
*/
$default_href = sprintf("edit.php?server_id=%s&amp;dn=%s&amp;use_default_template=true",$ldapserver->server_id,$encoded_dn);
$use_default_template = isset( $_GET['use_default_template'] ) || $config->GetValue('template_engine','enable');
if( $use_default_template ) {
if ($config->GetValue('template_engine','enable'))
require './template_engine.php';
else
require TMPLDIR.'modification/default.php';
} else {
$template = get_template($ldapserver,$dn);
$template_file = TMPLDIR."modification/$template.php";
if (file_exists($template_file))
require $template_file;
else {
printf('%s <b>%s</b> %s<br />',$lang['missing_template_file'],$template_file,$lang['using_default']);
require TMPLDIR.'modification/default.php';
}
}
?>

114
htdocs/entry_chooser.php Normal file
View File

@@ -0,0 +1,114 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/entry_chooser.php,v 1.26 2005/08/24 15:14:39 wurley Exp $
/**
* Display a selection (popup window) to pick a DN.
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
$container = isset($_GET['container']) ? rawurldecode($_GET['container']) : false;
$return_form_element = isset($_GET['form_element']) ? htmlspecialchars($_GET['form_element']) : null;
$rdn = isset($_GET['rdn']) ? htmlspecialchars($_GET['rdn']) : null;
include "./header.php";
printf('<h3 class="subtitle">%s</h3>',$lang['entry_chooser_title']);
flush();
?>
<script language="javascript">
function returnDN( dn ) {
opener.document.<?php echo $return_form_element; ?>.value = dn;
close();
}
</script>
<?php
if ($container) {
printf('%s<b>%s</b>',$lang['server_colon_pare'],htmlspecialchars($ldapserver->name));
print '<br />';
printf('%s<b>%s</b>',$lang['look_in'],htmlspecialchars($container));
print '<br />';
}
/* Has the use already begun to descend into a specific server tree? */
if (isset($ldapserver) && $container !== false) {
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn_list = get_container_contents($ldapserver,$container,0,'(objectClass=*)',$config->GetValue('deref','tree'));
sort($dn_list);
foreach ($ldapserver->getBaseDN() as $base_dn) {
debug_log(sprintf('%s: Comparing BaseDN [%s] with container [%s]','entry_chooser.php',$base_dn,$container),9);
if (! pla_compare_dns($container,$base_dn)) {
$parent_container = false;
$up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s',$return_form_element,$rdn);
break;
} else {
$parent_container = get_container($container);
$up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s&amp;server_id=%s&amp;container=%s',
$return_form_element,$rdn,$ldapserver->server_id,rawurlencode($parent_container));
}
}
print '&nbsp;';
printf('<a href="%s" style="text-decoration:none"><img src="images/up.png"> %s</a>',$up_href,$lang['back_up_p']);
print '<br />';
if (! count($dn_list))
printf('&nbsp;&nbsp;&nbsp;(%s)<br />',$lang['no_entries']);
else
foreach ($dn_list as $dn) {
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
print '&nbsp;&nbsp;&nbsp;';
printf('<a href="entry_chooser.php?server_id=%s&amp;form_element=%s&rdn=%s&amp;container=%s"><img src="images/plus.png" /></a>',
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
printf('<a href="%s">%s</a>',$href,htmlspecialchars($dn));
print '<br />';
}
/* draw the root of the selection tree (ie, list all the servers) */
} else {
foreach ($ldapservers->GetServerList() as $id) {
$ldapserver = $ldapservers->Instance($id);
if ($ldapserver->isVisible()) {
if (! $ldapserver->haveAuthInfo())
continue;
else {
printf('<b>%s</b>',htmlspecialchars($ldapserver->name));
print '<br />';
foreach ($ldapserver->getBaseDN() as $dn) {
if (! $dn) {
printf('<small>&nbsp;&nbsp;&nbsp;(%s)</small><br />',$lang['could_not_det_base_dn']);
} else {
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
print '&nbsp;&nbsp;&nbsp;';
printf('<a href="entry_chooser.php?server_id=%s&amp;form_element=%s&rdn=%s&amp;container=%s"><img src="images/plus.png" /></a> ',
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
printf('<a href="%s">%s</a>',$href,htmlspecialchars($dn));
print '<br />';
}
}
}
}
}
}
?>

69
htdocs/expand.php Normal file
View File

@@ -0,0 +1,69 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/expand.php,v 1.22 2005/07/22 05:47:44 wurley Exp $
/**
* This script alters the session variable 'tree', expanding it
* at the dn specified in the query string.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
* Note: this script is equal and opposite to collapse.php
* @package phpLDAPadmin
* @see collapse.php
*/
/**
*/
require './common.php';
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
# no expire header stuff
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
# This allows us to display large sub-trees without running out of time.
@set_time_limit( 0 );
$dn = $_GET['dn'];
$encoded_dn = rawurlencode( $dn );
initialize_session_tree();
$tree = $_SESSION['tree'];
$tree_icons = $_SESSION['tree_icons'];
$contents = get_container_contents( $ldapserver, $dn, 0, '(objectClass=*)', $config->GetValue('deref','tree'));
usort( $contents, 'pla_compare_dns' );
$tree[$ldapserver->server_id][$dn] = $contents;
foreach( $contents as $dn )
$tree_icons[$ldapserver->server_id][$dn] = get_icon( $ldapserver, $dn );
$_SESSION['tree'] = $tree;
$_SESSION['tree_icons'] = $tree_icons;
// 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 = "&".session_name()."=".session_id();
session_write_close();
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,$encoded_dn,$id_session_param));
?>

106
htdocs/export.php Executable file
View File

@@ -0,0 +1,106 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/export.php,v 1.15 2005/09/25 16:11:44 wurley Exp $
/**
* @package phpLDAPadmin
*/
/**
*/
# Fix a bug with IE:
ini_set('session.cache_limiter','');
require './common.php';
require LIBDIR.'export_functions.php';
// get the POST parameters
$server_id = (isset($_POST['server_id']) ? $_POST['server_id'] : '');
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$base_dn = isset($_POST['dn']) ? $_POST['dn']:NULL;
$format = isset( $_POST['format'] ) ? $_POST['format'] : "unix";
$scope = isset($_POST['scope']) ? $_POST['scope'] : 'base';
$filter = isset($_POST['filter']) ? $_POST['filter'] : 'objectclass=*';
$target = isset($_POST['target']) ? $_POST['target'] : 'display';
$save_as_file = isset( $_POST['save_as_file'] ) && $_POST['save_as_file'] == 'on';
// add system attributes if needed
$attributes = array();
if( isset( $_POST['sys_attr'] ) ){
array_push($attributes,'*');
array_push($attributes,'+');
}
isset($_POST['exporter_id']) or pla_error( $lang['must_choose_export_format'] );
$exporter_id = $_POST['exporter_id'];
isset($exporters[$exporter_id]) or pla_error( $lang['invalid_export_format'] );
// Initialisation of other variables
$rdn = get_rdn( $base_dn );
$friendly_rdn = get_rdn( $base_dn, 1 );
$extension = $exporters[$exporter_id]['extension'];
//set the default CRLN to Unix format
$br = "\n";
// default case not really needed
switch( $format ) {
case 'win':
$br = "\r\n";
break;
case 'mac':
$br = "\r";
break;
case 'unix':
default:
$br = "\n";
}
// get the decoree,ie the source
$plaLdapExporter = new PlaLdapExporter($server_id,$filter,$base_dn,$scope,$attributes);
// the decorator
// do it that way for the moment
$exporter = NULL;
switch($exporter_id){
case 0:
$exporter = new PlaLdifExporter($plaLdapExporter);
break;
case 1:
$exporter = new PlaDsmlExporter($plaLdapExporter);
break;
case 2:
$exporter = new PlaVcardExporter($plaLdapExporter);
break;
case 3:
$exporter = new PlaCSVExporter($plaLdapExporter);
break;
default:
// truly speaking,this default case will never be reached. See check at the bottom.
$plaLdapExporter->pla_close();
pla_error( $lang['no_exporter_found'] );
}
// set the CLRN
$exporter->setOutputFormat($br);
// prevent script from bailing early for long search
@set_time_limit( 0 );
// send the header
if( $save_as_file )
header( "Content-type: application/download" );
else
header( "Content-type: text/plain" );
header( "Content-Disposition: filename=$friendly_rdn.".$exporters[$exporter_id]['extension'] );
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: post-check=0, pre-check=0", false );
// and export
$exporter->export();
?>

150
htdocs/export_form.php Executable file
View File

@@ -0,0 +1,150 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/export_form.php,v 1.22 2005/09/25 16:11:44 wurley Exp $
/**
* export_form.php
* --------------------
*
* Html form to choose an export format(ldif,...)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
require LIBDIR.'export_functions.php';
$server_id = isset( $_GET['server_id'] ) ? $_GET['server_id']:NULL ;
$format = isset( $_GET['format'] ) ? $_GET['format'] : get_line_end_format();
$scope = isset( $_GET['scope'] ) ? $_GET['scope'] : 'base' ;
$exporter_id = isset( $_GET['exporter_id'] ) ? $_GET['exporter_id'] : 0 ;
$dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null;
$filter = isset( $_GET['filter'] ) ? $_GET['filter'] : '(objectClass=*)';
$attributes = isset( $_GET['attributes'] ) ? $_GET['attributes'] : '*';
$sys_attr = isset( $_GET['sys_attr'] ) && $_GET['sys_attr'] == 'true' ? true : false;
$available_formats = array(
'unix' => 'UNIX (Linux, BSD)',
'mac' => 'Macintosh',
'win' => 'Windows'
);
$available_scopes = array(
'base' => $lang['scope_base'],
'one' => $lang['scope_one'],
'sub' => $lang['scope_sub']
);
include './header.php'; ?>
<body>
<h3 class="title"><?php echo $lang['export']; ?></h3>
<br />
<center>
<form name="export_form" action="export.php" method="POST">
<table class="export_form">
<tr>
<td>
<fieldset>
<legend><?php echo $lang['export']; ?></legend>
<table>
<tr>
<td><?php echo $lang['server']; ?></td>
<td><?php print server_select_list(); ?></td>
</tr>
<tr>
<td style="white-space:nowrap"><?php echo $lang['base_dn']; ?></td>
<td><nobr><input type="text" name="dn" id="dn" style="width:230px" value="<?php echo htmlspecialchars( $dn ); ?>" /> <?php draw_chooser_link( 'export_form.dn' ); ?></nobr></td>
</tr>
<tr>
<td><span style="white-space: nowrap"><?php echo $lang['search_scope']; ?></span></td>
<td>
<?php foreach( $available_scopes as $id => $desc ) {
$id = htmlspecialchars( $id );
$desc = htmlspecialchars( $desc ); ?>
<input type="radio" name="scope" value="<?php echo $id; ?>" id="<?php echo $id; ?>"<?php if($id==$scope) echo ' checked="true"';?> /><label for="<?php echo $id; ?>"><?php echo $desc; ?></label><br />
<?php } ?>
</td>
</tr>
<tr>
<td><?php echo $lang['search_filter']; ?></td>
<td><input type="text" name="filter" style="width:300px" value="<?php echo htmlspecialchars($filter); ?>" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" name="sys_attr" id="sys_attr" <?php if( $sys_attr ) echo 'checked="true" '; ?>/> <label for="sys_attr"><?php echo $lang['include_system_attrs']; ?></label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" id="save_as_file" name="save_as_file" /><label for="save_as_file"><?php echo $lang['save_as_file']; ?></label></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr><td style="width: 50%">
<fieldset style="height: 100px">
<legend><?php echo $lang['export_format']; ?></legend>
<?php foreach($exporters as $index => $exporter){?>
<input type="radio" name="exporter_id" value="<?php echo htmlspecialchars($index); ?>" id="<?php echo htmlspecialchars($index); ?>" <?php if($index==$exporter_id) echo ' checked="true"'; ?> />
<label for="<?php echo htmlspecialchars( $index ); ?>"><?php echo htmlspecialchars( $exporter['desc'] ); ?></label><br />
<?php } ?>
</fieldset>
</td>
<td style="width: 50%">
<fieldset style="height: 100px">
<legend><?php echo $lang['line_ends']; ?></legend>
<?php foreach( $available_formats as $id => $desc ) {
$id = htmlspecialchars( $id );
$desc = htmlspecialchars( $desc );
?>
<input type="radio" name="format" value="<?php echo $id; ?>" id="<?php echo $id; ?>"<?php if($format==$id) echo ' checked="true"'; ?> /><label for="<?php echo $id; ?>"><?php echo $desc; ?></label><br />
<?php } ?>
</fieldset>
</td></tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<center>
<input type="submit" name="target" value="<?php echo $lang['proceed_gt']; ?>" />
</center>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
<?php
/**
* Helper functoin for fetching the line end format.
* @return String 'win', 'unix', or 'mac' based on the user's browser..
*/
function get_line_end_format()
{
if( is_browser_os_windows() )
return 'win';
elseif( is_browser_os_unix() )
return 'unix';
elseif( is_browser_os_mac() )
return 'mac';
else
return 'unix';
}

44
htdocs/header.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/header.php,v 1.19 2005/09/25 16:11:44 wurley Exp $
/**
* @package phpLDAPadmin
*/
// We want to get $language into scope in case we were included
// from within a function
global $config;
$language = isset($config) ? $language = $config->GetValue('appearance','language') : 'auto';
// text/xml won't work with MSIE, but is very useful for debugging xhtml code.
//@header( "Content-type: text/xml; charset=\"UTF-8\"" );
@header( "Content-type: text/html; charset=\"UTF-8\"" );
// XML version and encoding for well-behaved browsers
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $language; ?>" lang="<?php echo $language; ?>" dir="ltr">
<head>
<?php if (isset($config) && $pagetitle = $config->GetValue('appearance','page_title')) { ?>
<title>phpLDAPadmin - <?php echo $pagetitle; ?></title>
<?php } else { ?>
<title>phpLDAPadmin</title>
<?php } ?>
<link rel="stylesheet" href="<?php echo CSSDIR ?>style.css" media="screen" />
<?php if( isset( $server_id ) ) {
$custom_file = get_custom_file( $server_id, 'style.css',CSSDIR );
if( strcmp( $custom_file, 'style.css' ) != 0 ) { ?>
<link rel="stylesheet" href="<?php echo $custom_file ?>" media="screen" />
<?php }
} ?>
<script src="<?php echo JSDIR; ?>entry_chooser.js" type="text/javascript"></script>
<script src="<?php echo JSDIR; ?>ie_png_work_around.js" type="text/javascript"></script>
<script src="<?php echo JSDIR; ?>search_util.js" type="text/javascript"></script>
<script src="<?php echo JSDIR; ?>generic_utils.js" type="text/javascript"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>

28
htdocs/help.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/help.php,v 1.5 2005/02/26 12:35:05 wurley Exp $
/**
* @package phpLDAPadmin
*/
/**
*/
include './common.php';
include './header.php';
$forum_href = get_href( 'forum' );
?>
<body>
<h3 class="title">Help</h3>
<br />
<center>
<p>Do you have a problem or question?</p>
<p>Perhaps you are new to LDAP and need a little guidance?</p>
<p>Help is only one click away. Visit the online <a href="<?php echo $forum_href; ?>">phpLDAPadmin support forum</a>.</p>
<br />
</center>
</body>
</html>

BIN
htdocs/images/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
htdocs/images/bug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

BIN
htdocs/images/catalog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
htdocs/images/children.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

BIN
htdocs/images/compare.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More