RELEASE 1.0.0

This commit is contained in:
Deon George 2009-06-30 20:40:03 +10:00
parent c3713350e2
commit eccabca011
81 changed files with 710 additions and 723 deletions

View File

@ -1,5 +1,5 @@
For install instructions in non-English languages, see the wiki: For install instructions in non-English languages, see the wiki:
http://wiki.phpldapadmin.info http://wiki.pldapadmin.com
* Requirements * Requirements
@ -17,7 +17,7 @@ For install instructions in non-English languages, see the wiki:
* For additional help * For additional help
See the wiki: See the wiki:
http://wiki.phpldapadmin.info http://wiki.pldapadmin.com
Join our mailing list: Join our mailing list:
https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel

View File

@ -1 +1 @@
$Name: RELEASE-0_9_8_1 $ $Name: RELEASE-1_0_0 $

View File

@ -1,9 +1,4 @@
<?php <?php
/** NOTE **
** Make sure that <?php is the FIRST line of this file!
** IE: There should NOT be any blank lines or spaces BEFORE <?php
**/
/** /**
* The phpLDAPadmin config file * The phpLDAPadmin config file
* *
@ -14,8 +9,8 @@
* For example, the default for defining the language in config_default.php * For example, the default for defining the language in config_default.php
* *
* $this->default->appearance['lang'] = array( * $this->default->appearance['lang'] = array(
* 'desc'=>'Language', * 'desc'=>'Language',
* 'default'=>'auto'); * 'default'=>'auto');
* *
* to override this, use $config->custom->appearance['lang'] = 'en'; * to override this, use $config->custom->appearance['lang'] = 'en';
* *
@ -115,6 +110,50 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
/* Use TLS (Transport Layer Security) to connect to the LDAP server. */ /* Use TLS (Transport Layer Security) to connect to the LDAP server. */
// $ldapservers->SetValue($i,'server','tls',false); // $ldapservers->SetValue($i,'server','tls',false);
/************************************
* SASL Authentication *
************************************/
/* Enable SASL authentication LDAP SASL authentication requires PHP 5.x
configured with --with-ldap-sasl=DIR. If this option is disabled (ie, set to
false), then all other sasl options are ignored. */
// $ldapservers->SetValue($i,'server','sasl_auth', false);
/* SASL auth mechanism */
// $ldapservers->SetValue($i,'server','sasl_mech', "PLAIN");
/* SASL authentication realm name */
// $ldapservers->SetValue($i,'server','sasl_realm','');
# $ldapservers->SetValue($i,'server','sasl_realm',"example.com");
/* SASL authorization ID name
If this option is undefined, authorization id will be computed from bind DN,
using sasl_authz_id_regex and sasl_authz_id_replacement. */
// $ldapservers->SetValue($i,'server','sasl_authz_id', null);
/* SASL authorization id regex and replacement
When sasl_authz_id property is not set (default), phpLDAPAdmin will try to
figure out authorization id by itself from bind distinguished name (DN).
This procedure is done by calling preg_replace() php function in the
following way:
$authz_id = preg_replace($sasl_authz_id_regex,$sasl_authz_id_replacement,
$bind_dn);
For info about pcre regexes, see:
- pcre(3), perlre(3)
- http://www.php.net/preg_replace */
// $ldapservers->SetValue($i,'server','sasl_authz_id_regex',null);
// $ldapservers->SetValue($i,'server','sasl_authz_id_replacement',null);
# $ldapservers->SetValue($i,'server','sasl_authz_id_regex','/^uid=([^,]+)(.+)/i');
# $ldapservers->SetValue($i,'server','sasl_authz_id_replacement','$1');
/* SASL auth security props.
See http://beepcore-tcl.sourceforge.net/tclsasl.html#anchor5 for explanation.
*/
// $ldapservers->SetValue($i,'server','sasl_props',null);
/* If the link between your web server and this LDAP server is slow, it is /* If the link between your web server and this LDAP server is slow, it is
recommended that you set 'low_bandwidth' to true. This will enable recommended that you set 'low_bandwidth' to true. This will enable
phpLDAPadmin to forego some "fancy" features to conserve bandwidth. */ phpLDAPadmin to forego some "fancy" features to conserve bandwidth. */
@ -146,7 +185,7 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
/* If 'login_attr' is used above such that phpLDAPadmin will search for your DN /* If 'login_attr' is used above such that phpLDAPadmin will search for your DN
at login, you may restrict the search to a specific objectClass. EG, set this at login, you may restrict the search to a specific objectClass. EG, set this
to 'posixAccount' or 'inetOrgPerson', depending upon your setup. */ to 'posixAccount' or 'inetOrgPerson', depending upon your setup. */
// $ldapservers->SetValue($i,'login','class',null); // $ldapservers->SetValue($i,'login','class','');
/* Specify true If you want phpLDAPadmin to not display or permit any /* Specify true If you want phpLDAPadmin to not display or permit any
modification to the LDAP server. */ modification to the LDAP server. */
@ -169,50 +208,50 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
// $ldapservers->SetValue($i,'auto_number','mechanism','search'); // $ldapservers->SetValue($i,'auto_number','mechanism','search');
/* The DN of the search base when the 'search' mechanism is used above. */ /* The DN of the search base when the 'search' mechanism is used above. */
# $ldapservers->SetValue($i,'auto_number','search_base','ou=People,dc=example,dc=com'); // $ldapservers->SetValue($i,'auto_number','search_base','ou=People,dc=example,dc=com');
/* The minimum number to use when searching for the next available UID number /* The minimum number to use when searching for the next available UID number
(only when 'search' is used for auto_uid_number_mechanism' */ (only when 'search' is used for auto_uid_number_mechanism' */
// $ldapservers->SetValue($i,'auto_number','min','1000'); // $ldapservers->SetValue($i,'auto_number','min','1000');
/* The DN of the uidPool entry when 'uidpool' mechanism is used above. */ /* The DN of the uidPool entry when 'uidpool' mechanism is used above. */
# $servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com'; // $servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com';
/* If you set this, then phpldapadmin will bind to LDAP with this user ID when /* If you set this, then phpldapadmin will bind to LDAP with this user ID when
searching for the uidnumber. The idea is, this user id would have full searching for the uidnumber. The idea is, this user id would have full
(readonly) access to uidnumber in your ldap directory (the logged in user (readonly) access to uidnumber in your ldap directory (the logged in user
may not), so that you can be guaranteed to get a unique uidnumber for your may not), so that you can be guaranteed to get a unique uidnumber for your
directory. */ directory. */
// $ldapservers->SetValue($i,'auto_number','dn',null); // $ldapservers->SetValue($i,'auto_number','dn','');
/* The password for the dn above. */ /* The password for the dn above. */
// $ldapservers->SetValue($i,'auto_number','pass',null); // $ldapservers->SetValue($i,'auto_number','pass','');
/* Enable anonymous bind login. */ /* Enable anonymous bind login. */
// $ldapservers->SetValue($i,'login','anon_bind',true); // $ldapservers->SetValue($i,'login','anon_bind',true);
/* Use customized page with prefix when available. */ /* Use customized page with prefix when available. */
# $ldapservers->SetValue($i,'custom','pages_prefix','custom_'); // $ldapservers->SetValue($i,'custom','pages_prefix','custom_');
/* If you set this, then phpldapadmin will bind to LDAP with this user when /* If you set this, then phpldapadmin will bind to LDAP with this user when
testing for unique attributes (as set in unique_attrs array). If you want to testing for unique attributes (as set in unique_attrs array). If you want to
enforce unique attributes, than this id should have full (readonly) access enforce unique attributes, than this id should have full (readonly) access
to the attributes in question (the logged in user may not have enough access) to the attributes in question (the logged in user may not have enough access)
*/ */
// $ldapservers->SetValue($i,'unique_attrs','dn',null); // $ldapservers->SetValue($i,'unique_attrs','dn','');
/* The password for the dn above */ /* The password for the dn above */
// $ldapservers->SetValue($i,'unique_attrs','pass',null); // $ldapservers->SetValue($i,'unique_attrs','pass','');
/* If you set this, then only these DNs are allowed to log in. This array can /* If you set this, then only these DNs are allowed to log in. This array can
contain individual users, groups or ldap search filter(s). Keep in mind that contain individual users, groups or ldap search filter(s). Keep in mind that
the user has not authenticated yet, so this will be an anonymous search to the user has not authenticated yet, so this will be an anonymous search to
the LDAP server, so make your ACLs allow these searches to return results! */ the LDAP server, so make your ACLs allow these searches to return results! */
# $ldapservers->SetValue($i,'login','allowed_dns',array( # $ldapservers->SetValue($i,'login','allowed_dns',array(
# 'uid=stran,ou=People,dc=example,dc=com', # 'uid=stran,ou=People,dc=example,dc=com',
# '(&(gidNumber=811)(objectClass=groupOfNames))', # '(&(gidNumber=811)(objectClass=groupOfNames))',
# '(|(uidNumber=200)(uidNumber=201))', # '(|(uidNumber=200)(uidNumber=201))',
# 'cn=callcenter,ou=Group,dc=example,dc=com')); # 'cn=callcenter,ou=Group,dc=example,dc=com'));
/* Set this if you dont want this LDAP server to show in the tree */ /* Set this if you dont want this LDAP server to show in the tree */
// $ldapservers->SetValue($i,'appearance','visible',true); // $ldapservers->SetValue($i,'appearance','visible',true);
@ -245,20 +284,29 @@ $ldapservers->SetValue($i,'server','tls',false);
$ldapservers->SetValue($i,'server','low_bandwidth',false); $ldapservers->SetValue($i,'server','low_bandwidth',false);
$ldapservers->SetValue($i,'appearance','password_hash','md5'); $ldapservers->SetValue($i,'appearance','password_hash','md5');
$ldapservers->SetValue($i,'login','attr','dn'); $ldapservers->SetValue($i,'login','attr','dn');
$ldapservers->SetValue($i,'login','string',null); $ldapservers->SetValue($i,'login','string','');
$ldapservers->SetValue($i,'login','class',null); $ldapservers->SetValue($i,'login','class','');
$ldapservers->SetValue($i,'server','read_only',false); $ldapservers->SetValue($i,'server','read_only',false);
$ldapservers->SetValue($i,'appearance','show_create',true); $ldapservers->SetValue($i,'appearance','show_create',true);
$ldapservers->SetValue($i,'auto_number','enable',true); $ldapservers->SetValue($i,'auto_number','enable',true);
$ldapservers->SetValue($i,'auto_number','mechanism','search'); $ldapservers->SetValue($i,'auto_number','mechanism','search');
$ldapservers->SetValue($i,'auto_number','search_base',null); $ldapservers->SetValue($i,'auto_number','search_base','');
$ldapservers->SetValue($i,'auto_number','min','1000'); $ldapservers->SetValue($i,'auto_number','min','1000');
$ldapservers->SetValue($i,'auto_number','dn',null); $ldapservers->SetValue($i,'auto_number','dn','');
$ldapservers->SetValue($i,'auto_number','pass',null); $ldapservers->SetValue($i,'auto_number','pass','');
$ldapservers->SetValue($i,'login','anon_bind',true); $ldapservers->SetValue($i,'login','anon_bind',true);
$ldapservers->SetValue($i,'custom','pages_prefix','custom_'); $ldapservers->SetValue($i,'custom','pages_prefix','custom_');
$ldapservers->SetValue($i,'unique_attrs','dn',null); $ldapservers->SetValue($i,'unique_attrs','dn','');
$ldapservers->SetValue($i,'unique_attrs','pass',null); $ldapservers->SetValue($i,'unique_attrs','pass','');
# SASL auth
$ldapservers->SetValue($i,'server','sasl_auth', true);
$ldapservers->SetValue($i,'server','sasl_mech', "PLAIN");
$ldapservers->SetValue($i,'server','sasl_realm', "EXAMPLE.COM");
$ldapservers->SetValue($i,'server','sasl_authz_id', null);
$ldapservers->SetValue($i,'server','sasl_authz_id_regex', '/^uid=([^,]+)(.+)/i');
$ldapservers->SetValue($i,'server','sasl_authz_id_replacement', '$1');
$ldapservers->SetValue($i,'server','sasl_props', null);
*/ */
/*********************************************/ /*********************************************/
@ -270,7 +318,7 @@ $ldapservers->SetValue($i,'unique_attrs','pass',null);
$friendly_attrs = array(); $friendly_attrs = array();
$friendly_attrs['facsimileTelephoneNumber'] = 'Fax'; $friendly_attrs['facsimileTelephoneNumber'] = 'Fax';
$friendly_attrs['telephoneNumber'] = 'Phone'; $friendly_attrs['telephoneNumber'] = 'Phone';
/*********************************************/ /*********************************************/
/* Support for attrs display order */ /* Support for attrs display order */
@ -282,16 +330,16 @@ $friendly_attrs['telephoneNumber'] = 'Phone';
attributes that are not specified in this array will be displayed after in attributes that are not specified in this array will be displayed after in
alphabetical order. */ alphabetical order. */
# $attrs_display_order = array( # $attrs_display_order = array(
# 'givenName', # 'givenName',
# 'sn', # 'sn',
# 'cn', # 'cn',
# 'displayName', # 'displayName',
# 'uid', # 'uid',
# 'uidNumber', # 'uidNumber',
# 'gidNumber', # 'gidNumber',
# 'homeDirectory', # 'homeDirectory',
# 'mail', # 'mail',
# 'userPassword' # 'userPassword'
# ); # );
/*********************************************/ /*********************************************/
@ -310,8 +358,8 @@ $friendly_attrs['telephoneNumber'] = 'Phone';
/* Hidden attributes in read-only mode. If undefined, it will be equal to /* Hidden attributes in read-only mode. If undefined, it will be equal to
$hidden_attrs. */ $hidden_attrs. */
# $hidden_attrs_ro = array( # $hidden_attrs_ro = array(
# 'objectClass','shadowWarning', 'shadowLastChange', 'shadowMax', # 'objectClass','shadowWarning', 'shadowLastChange', 'shadowMax',
# 'shadowFlag', 'shadowInactive', 'shadowMin', 'shadowExpire'); # 'shadowFlag', 'shadowInactive', 'shadowMin', 'shadowExpire');
/** **/ /** **/
/** Read-only attributes **/ /** Read-only attributes **/
@ -362,7 +410,7 @@ $queries[$q]['scope'] = 'sub';
$queries[$q]['filter'] = '(&(objectClass=posixAccount)(uid=*))'; $queries[$q]['filter'] = '(&(objectClass=posixAccount)(uid=*))';
/* The attributes to return */ /* The attributes to return */
$queries[$q]['attributes'] = 'cn, uid, homeDirectory, telephonenumber, jpegphoto'; $queries[$q]['attributes'] = 'cn, uid, homeDirectory';
/* If you want to configure more pre-defined queries, copy and paste the above (including the "$q++;") */ /* If you want to configure more pre-defined queries, copy and paste the above (including the "$q++;") */
$q++; $q++;

View File

@ -1,2 +1,2 @@
Please see http://wiki.phpldapadmin.info/Translating now for information on Please see http://wiki.pldapadmin.com/Translating now for information on
translating PLA. translating PLA.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.18.2.7 2005/12/09 23:32:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.19 2005/12/10 10:34:54 wurley Exp $
/** /**
* Adds an attribute/value pair to an object * Adds an attribute/value pair to an object

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.13.2.2 2005/12/09 14:27:32 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.14 2005/12/10 10:34:54 wurley Exp $
/** /**
* Displays a form for adding an attribute/value to an LDAP entry. * Displays a form for adding an attribute/value to an LDAP entry.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass.php,v 1.17.2.5 2005/12/09 23:32:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass.php,v 1.18 2005/12/10 10:34:54 wurley Exp $
/** /**
* Adds an objectClass to the specified dn. * Adds an objectClass to the specified dn.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.23.2.6 2005/12/09 23:32:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.24 2005/12/10 10:34:54 wurley Exp $
/** /**
* This page may simply add the objectClass and take you back to the edit page, * This page may simply add the objectClass and take you back to the edit page,

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.19.2.5 2005/12/09 23:32:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.20 2005/12/10 10:34:54 wurley Exp $
/** /**
* Adds a value to an attribute for a given dn. * Adds a value to an attribute for a given dn.

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare_form.php,v 1.2.4.3 2006/04/29 03:15:34 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare_form.php,v 1.3 2005/12/10 10:34:54 wurley Exp $
/** /**
* Compares to DN entries side by side. * Compares to DN entries side by side.
@ -14,65 +14,66 @@
require './common.php'; require './common.php';
if (! $ldapserver->haveAuthInfo()) if( ! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.')); pla_error( _('Not enough information to login to server. Please check your configuration.') );
$dn = (isset($_GET['dn']) ? $_GET['dn'] : ''); $dn = (isset($_GET['dn']) ? $_GET['dn'] : '');
$rdn = get_rdn($dn);
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$container = get_container( $dn );
$attrs = $ldapserver->getDNAttrs($dn);
$select_server_html = server_select_list($ldapserver->server_id,true,'server_id_dst'); $select_server_html = server_select_list($ldapserver->server_id,true,'server_id_dst');
include './header.php'; include './header.php'; ?>
echo '<body>'; <body>
printf('<h3 class="title">%s %s</h3>',_('Compare another DN with'),htmlspecialchars($rdn)); <h3 class="title"><?php echo _('Compare another DN with'). '&nbsp;' . $rdn; ?></h3>
printf('<h3 class="subtitle">%s: <b>%s</b>',_('Server'),$ldapserver->name); <h3 class="subtitle"><?php echo _('Server'); ?>: <b><?php echo $ldapserver->name; ?></b>
if ($dn) <?php if ($dn) { ?>
printf('&nbsp;&nbsp;&nbsp;%s: <b>%s</b>',_('Distinguished Name'),htmlspecialchars($dn)); &nbsp;&nbsp;&nbsp; <?php echo _('Distinguished Name')?>: <b><?php echo $dn; ?></b>
echo '</h3>'; <?php } ?>
echo "\n"; </h3>
echo '<center>'; <center>
printf('%s <b>%s</b> %s<br />',_('Compare'),htmlspecialchars($rdn),_('with ')); <?php echo _('Compare'); ?> <b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo _('with '); ?>:<br />
<br />
echo '<form action="compare.php" method="post" name="compare_form">'; <form action="compare.php" method="post" name="compare_form">
printf('<input type="hidden" name="server_id_src" value="%s" />',$ldapserver->server_id); <input type="hidden" name="server_id_src" value="<?php echo $ldapserver->server_id; ?>" />
echo "\n";
echo '<table style="border-spacing: 10px">'; <table style="border-spacing: 10px">
echo "\n"; <tr>
echo '<tr><td>'; <?php if (! $dn) { ?>
<td><acronym title="<?php echo _('Compare this DN with another'); ?>"><?php echo _('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 _('Compare this DN with another'); ?>"><?php echo _('Destination 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>
if (! $dn) { <tr>
printf('<acronym title="%s">%s</acronym>:',_('Compare this DN with another'),_('Source DN')); <td><?php echo _('Destination Server')?>:</td>
echo '</td><td>'; <td><?php echo $select_server_html; ?></td>
printf('<input type="text" name="dn_src" size="45" value="%s" />',htmlspecialchars($dn)); </tr>
draw_chooser_link('compare_form.dn_src','true',$rdn);
} else <tr>
printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($dn)); <td colspan="2" align="right"><input type="submit" value="<?php echo _('Compare'); ?>" /></td>
</tr>
echo '</td></tr>'; </table>
echo "\n"; </form>
</center>
echo '<tr>'; </body>
printf('<td><acronym title="%s">%s</acronym>:</td>',_('Compare this DN with another'),_('Destination DN')); </html>
echo '<td>';
echo '<input type="text" name="dn_dst" size="45" value="" />';
draw_chooser_link('compare_form.dn_dst','true','');
echo '</td>';
echo '</tr>';
echo "\n";
printf('<tr><td>%s:</td><td>%s</td></tr>',_('Destination Server'),$select_server_html);
echo "\n";
printf('<tr><td colspan="2" align="right"><input type="submit" value="%s" /></td></tr>',_('Compare'));
echo "\n";
echo '</table>';
echo '</form>';
echo '</center>';
echo '</body>';
echo '</html>';
?>

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.24.4.5 2006/04/29 03:27:41 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.26 2005/12/17 00:00:11 wurley Exp $
/** /**
* Copies a given object to create a new one. * Copies a given object to create a new one.
@ -53,46 +53,34 @@ if (is_array($children) && count($children) > 0) { ?>
echo '<body>'; echo '<body>';
printf('<h3 class="title">%s %s</h3>',_('Copy'),htmlspecialchars($rdn)); printf('<h3 class="title">%s %s</h3>',_('Copy '),$rdn);
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',_('Server'),$ldapserver->name, printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',_('Server'),$ldapserver->name,_('Distinguished Name'),$dn);
_('Distinguished Name'),htmlspecialchars($dn));
echo "\n";
echo '<center>'; echo '<center>';
printf('%s <b>%s</b> %s:<br /><br />',_('Copy'),htmlspecialchars($rdn),_('to a new object')); printf('%s <b>%s</b> %s:<br /><br />',_('Copy '),htmlspecialchars($rdn),_('to a new object'));
echo '<form action="copy.php" method="post" name="copy_form">'; echo '<form action="copy.php" method="post" name="copy_form">';
printf('<input type="hidden" name="old_dn" value="%s" />',htmlspecialchars($dn)); printf('<input type="hidden" name="old_dn" value="%s" />',$dn);
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id); printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
echo "\n";
echo '<table style="border-spacing: 10px">'; echo '<table style="border-spacing: 10px">';
echo "\n";
echo '<tr>'; echo '<tr>';
printf('<td><acronym title="%s">%s</acronym>:</td>', printf('<td><acronym title="%s">%s</acronym>:</td>',_('The full DN of the new entry to be created when copying the source entry'),_('Destination DN'));
_('The full DN of the new entry to be created when copying the source entry'),_('Destination DN'));
printf('<td><input type="text" name="new_dn" size="45" value="%s" />',htmlspecialchars($dn)); printf('<td><input type="text" name="new_dn" size="45" value="%s" />',htmlspecialchars($dn));
draw_chooser_link('copy_form.new_dn','true',htmlspecialchars($rdn)); draw_chooser_link('copy_form.new_dn','true',$rdn);
echo '</td></tr>'; echo '</td></tr>';
echo "\n";
printf('<tr><td>%s</td><td>%s</td></tr>',_('Destination Server'),$select_server_html); printf('<tr><td>%s</td><td>%s</td></tr>',_('Destination Server'),$select_server_html);
echo "\n";
if (is_array($children) && count($children) > 0) { if (is_array($children) && count($children) > 0) {
echo '<tr>'; echo '<tr>';
printf('<td><label for="recursive">%s</label>:</td>',_('Recursive copy')); printf('<td><label for="recursive">%s</label>:</td>',_('Recursive copy'));
echo '<td><input type="checkbox" id="recursive" name="recursive" onClick="toggle_disable_filter_field(this)" />'; echo '<td><input type="checkbox" id="recursive" name="recursive" onClick="toggle_disable_filter_field(this)" />';
printf('<small>(%s)</small></td>',_('Recursively copy all children of this object as well.')); printf('<small>(%s)</small></td>',_('Recursively copy all children of this object as well.'));
echo '</tr>'."\n"; echo '</tr><tr>';
echo '<tr>';
printf('<td><acronym title="%s">%s</acronym>:</td>',_('When performing a recursive copy, only copy those entries which match this filter'),_('Filter')); printf('<td><acronym title="%s">%s</acronym>:</td>',_('When performing a recursive copy, only copy those entries which match this filter'),_('Filter'));
echo '<td><input type="text" name="filter" value="(objectClass=*)" size="45" disabled />'; echo '<td><input type="text" name="filter" value="(objectClass=*)" size="45" disabled />';
echo '</tr>'."\n"; echo '</tr><tr>';
echo '<tr>';
printf('<td>%s</td>',_('Delete after copy (move):')); printf('<td>%s</td>',_('Delete after copy (move):'));
echo '<td><input type="checkbox" name="remove" value="yes"/ disabled>'; echo '<td><input type="checkbox" name="remove" value="yes"/ disabled>';
printf('<small>(%s)</small)</td>',_('Make sure your filter (above) will select all child records.')); printf('<small>(%s)</small)</td>',_('Make sure your filter (above) will select all child records.'));
@ -101,12 +89,9 @@ if (is_array($children) && count($children) > 0) {
} else { } else {
printf('<tr><td>%s</td><td><input type="checkbox" name="remove" value="yes"/></td></tr>',_('Delete after copy (move):')); printf('<tr><td>%s</td><td><input type="checkbox" name="remove" value="yes"/></td></tr>',_('Delete after copy (move):'));
} }
echo "\n";
printf('<tr><td colspan="2" align="right"><input type="submit" value="%s" /></td></tr>',_('Copy ')); printf('<tr><td colspan="2" align="right"><input type="submit" value="%s" /></td></tr>',_('Copy '));
echo "\n";
echo '</table></form>'; echo '</table></form>';
echo "\n";
echo '<script type="text/javascript" language="javascript">'; echo '<script type="text/javascript" language="javascript">';
echo '<!--'; echo '<!--';
@ -116,7 +101,7 @@ echo '//-->';
echo '</script>'; echo '</script>';
if ($config->GetValue('appearance','show_hints')) if ($config->GetValue('appearance','show_hints'))
printf('<small><img src="images/light.png" alt="Light" /><span class="hint">%s</span></small>',_('Hint: Copying between different servers only works if there are no schema violations')); printf('<small><img src="images/light.png" /><span class="hint">%s</span></small>',_('Hint: Copying between different servers only works if there are no schema violations'));
echo '</center></body></html>'; echo '</center></body></html>';
?> ?>

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.44.2.6 2006/02/19 02:57:01 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.46 2006/02/19 05:44:34 wurley Exp $
/** /**
* Creates a new object. * Creates a new object.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/Attic/create_form.php,v 1.31.2.5 2005/12/31 04:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create_form.php,v 1.33 2006/01/03 20:39:58 wurley Exp $
/** /**
* The menu where the user chooses an RDN, Container, and Template for creating a new entry. * The menu where the user chooses an RDN, Container, and Template for creating a new entry.

View File

@ -1,4 +1,4 @@
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.44.4.3 2008/11/28 14:21:37 wurley Exp $ */ /* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.45 2005/12/10 10:34:54 wurley Exp $ */
span.hint { span.hint {
font-size: small; font-size: small;
font-weight: normal; font-weight: normal;
@ -35,7 +35,7 @@ table.schema_attr th {
padding: 5px; padding: 5px;
color: white; color: white;
font-weight: bold; font-weight: bold;
font-size: 100%; font-size: 125%;
} }
table.schema_attr td { table.schema_attr td {
@ -163,7 +163,7 @@ a img {
body { body {
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
background-color: white; background-color: white;
font-size: 10pt; font-size: 12pt;
} }
table.tree tr.login td { table.tree tr.login td {
@ -204,7 +204,7 @@ table.tree tr.server td {
padding-top: 15px; padding-top: 15px;
padding-bottom: 0px; padding-bottom: 0px;
vertical-align: top; vertical-align: top;
font-size: 12px; font-size: 20px;
text-align: left; text-align: left;
} }
@ -212,7 +212,7 @@ table.tree td.icon {
text-align: center; text-align: center;
padding: 0px; padding: 0px;
width: 14px; width: 14px;
font-size: 10px; font-size: 1px;
} }
table.tree td.rdn { table.tree td.rdn {
@ -267,7 +267,7 @@ h3.title {
background-color: #018; background-color: #018;
border: 1px solid black; border: 1px solid black;
font-weight: normal; font-weight: normal;
font-size: 140%; font-size: 150%;
} }
h3.subtitle { h3.subtitle {
@ -317,14 +317,14 @@ table.edit_dn input {
} }
table.edit_dn input.val { table.edit_dn input.val {
font-size: 12px; font-size: 14px;
width: 350px; width: 350px;
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
background-color: white; background-color: white;
} }
table.edit_dn textarea.val { table.edit_dn textarea.val {
font-size: 12px; font-size: 14px;
width: 350px; width: 350px;
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
background-color: white; background-color: white;
@ -418,7 +418,7 @@ input.update_dn {
} }
small { small {
font-size: 8pt; font-size: 10pt;
} }
form.edit_dn { form.edit_dn {
@ -433,7 +433,7 @@ h4.oclass {
margin-top: 8px; margin-top: 8px;
font-weight: normal; font-weight: normal;
border: 1px solid black; border: 1px solid black;
font-size: 120%; font-size: 140%;
color: white; color: white;
} }
@ -595,7 +595,7 @@ table.create td.heading {
} }
table.create td.name { table.create td.name {
font-size: 11px; font-size: 13px;
width: 350px; width: 350px;
} }
@ -642,7 +642,7 @@ table.export_form {
} }
table.export_form tr td { table.export_form tr td {
font-size: 11px; font-size: 13px;
text-align: left; text-align: left;
vertical-align: top; vertical-align: top;
padding: 4px; padding: 4px;

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.24.2.3 2005/12/11 08:21:03 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.26 2005/12/17 00:00:11 wurley Exp $
/** /**
* Deletes a DN and presents a "job's done" message. * Deletes a DN and presents a "job's done" message.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.14.2.5 2005/12/09 14:29:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.15 2005/12/10 10:34:54 wurley Exp $
/** /**
* Deletes an attribute from an entry with NO confirmation. * Deletes an attribute from an entry with NO confirmation.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.20.4.6 2006/04/29 04:05:14 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.22 2005/12/17 00:00:11 wurley Exp $
/** /**
* delete_form.php * delete_form.php
@ -31,123 +31,118 @@ include './header.php';
echo '<body>'; echo '<body>';
printf('<h3 class="title">'._('Delete %s').'</h3>',htmlspecialchars(get_rdn($dn))); printf('<h3 class="title">'._('Delete %s').'</h3>',htmlspecialchars(get_rdn($dn)));
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>', printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn)); _('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars(($dn)));
echo "\n";
echo '<center>';
if ($has_children) { if ($has_children) {
echo '<center>';
printf('<b>%s</b><br /><br />',_('Permanently delete all children also?')); printf('<b>%s</b><br /><br />',_('Permanently delete all children also?'));
flush(); flush();
# get the total number of child objects (whole sub-tree) # get the total number of child objects (whole sub-tree)
$s = $ldapserver->search(null,dn_escape($dn),'objectClass=*',array('dn')); $s = $ldapserver->search(null,dn_escape($dn),'objectClass=*',array('dn'));
$sub_tree_count = count($s); $sub_tree_count = count($s);
echo '<table class="delete_confirm">';
echo '<tr>';
echo '<td><p>';
printf(_('This entry is the root of a sub-tree containing %s entries.'),$sub_tree_count);
printf('<small>(<a href="search.php?search=true&amp;server_id=%s&amp;filter=%s&amp;base_dn=%s&amp;form=advanced&amp;scope=sub">%s</a>)</small>',
$ldapserver->server_id,rawurlencode('objectClass=*'),rawurlencode($dn),_('view entries'));
echo '<br /><br />';
printf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),($sub_tree_count-1));
echo '<br /><br />';
printf('<small>%s</small>',
_('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.'));
echo '<br /><br />';
echo "\n";
echo '<table width="100%">';
echo '<tr>';
echo '<td><center>';
echo '<form action="rdelete.php" method="post">';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" class="scary" value="%s" />',sprintf(_('Delete all %s objects'),$sub_tree_count));
echo '</form>';
echo '</center></td>';
echo '<td><center>';
echo '<form action="template_engine.php" method="get">';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
echo '</form>';
echo '</center></td>';
echo '</tr>';
echo '</table>';
echo "\n";
echo '</td>';
echo '</tr>';
echo '</table>';
echo "\n";
flush();
echo '<br /><br />';
echo _('List of entries to be deleted:');
echo '<br />';
printf('<select size="%s" multiple disabled style="background:white; color:black;width:500px" >',min(10,$sub_tree_count));
$i=0;
foreach ($s as $dn => $junk) {
$i++;
printf('<option>%s. %s</option>',$i,htmlspecialchars(dn_unescape($dn)));
}
echo '</select>';
echo "\n";
} else {
echo '<table class="delete_confirm">';
echo '<tr>';
echo '<td nowrap>';
echo _('Are you sure you want to permanently delete this object?');
echo '<br /><br />';
printf('<acronym title="%s">%s</acronym>: <b>%s</b>',_('Distinguished Name'),_('DN'),pretty_print_dn($dn));
echo '<br />';
printf('%s: <b>%s</b>',_('Server'),htmlspecialchars($ldapserver->name));
echo '<br /><br />';
echo "\n";
echo '<table width="100%">';
echo '<tr>';
echo '<td><center>';
echo '<form action="delete.php" method="post">';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="scary" />',_('Delete'));
echo '</form>';
echo '</center></td>';
echo '<td><center>';
echo '<form action="template_engine.php" method="get">';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
echo '</form>';
echo '</center></td>';
echo '</tr>';
echo '</table>';
echo "\n";
echo '</td>';
echo '</tr>';
echo '</table>';
echo "\n";
}
echo '</center>';
echo '<br />';
echo '</body>';
echo '</html>';
?> ?>
<table class="delete_confirm">
<tr>
<td>
<p>
<?php printf(_('This entry is the root of a sub-tree containing %s entries.'),$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 rawurlencode($dn); ?>&amp;form=advanced&amp;scope=sub"><?php echo _('view entries'); ?></a>)</small>
<br />
<br />
<?php printf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),($sub_tree_count-1)); ?><br />
<br />
<small><?php echo _('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.'); ?></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 printf(_('Delete all %s objects'),$sub_tree_count); ?>" />
</form>
</center>
</td>
<td>
<center>
<form action="template_engine.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 _('Cancel'); ?>" class="cancel" />
</form>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php flush(); ?>
<br />
<br />
<?php echo _('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_unescape($dn))); ?></option>
<?php } ?>
</select>
</center>
<br />
<?php } else { ?>
<center>
<table class="delete_confirm">
<tr>
<td>
<?php echo _('Are you sure you want to permanently delete this object?'); ?><br />
<br />
<nobr><acronym title="<?php echo _('Distinguished Name'); ?>"><?php echo _('DN'); ?></acronym>: <b><?php echo pretty_print_dn($dn); ?></b></nobr><br />
<nobr><?php echo _('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 _('Delete'); ?>" class="scary" />
</form>
</center>
</td>
<td>
<center>
<form action="template_engine.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 _('Cancel'); ?>" class="cancel" />
</form>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<?php } ?>
</body>
</html>

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.13.2.3 2005/12/08 11:49:28 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.14 2005/12/10 10:34:54 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.27.2.5 2008/11/28 14:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.30 2006/01/03 20:39:58 wurley Exp $
/** /**
* Display a selection (popup window) to pick a DN. * Display a selection (popup window) to pick a DN.
@ -70,9 +70,7 @@ if (isset($ldapserver) && $container !== false) {
else else
foreach ($dn_list as $dn) { foreach ($dn_list as $dn) {
$href = sprintf("javascript:returnDN('%s%s')", $href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
($rdn ? '"'.htmlspecialchars(dn_js_escape($rdn)).',"' : ''),
htmlspecialchars(dn_js_escape($dn)));
echo '&nbsp;&nbsp;&nbsp;'; echo '&nbsp;&nbsp;&nbsp;';
printf('<a href="entry_chooser.php?server_id=%s&amp;form_element=%s&amp;rdn=%s&amp;container=%s"><img src="images/plus.png" /></a>', printf('<a href="entry_chooser.php?server_id=%s&amp;form_element=%s&amp;rdn=%s&amp;container=%s"><img src="images/plus.png" /></a>',
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn)); $ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.15.4.6 2005/12/10 12:03:44 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.17 2005/12/17 00:00:11 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.21.2.4 2006/04/29 03:14:45 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.23 2005/12/17 00:00:11 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin
@ -7,6 +7,7 @@
/* We want to get $language into scope in case we were included /* We want to get $language into scope in case we were included
from within a function */ from within a function */
global $config;
$language = isset($config) ? $language = $config->GetValue('appearance','language') : 'auto'; $language = isset($config) ? $language = $config->GetValue('appearance','language') : 'auto';
# text/xml won't work with MSIE, but is very useful for debugging xhtml code. # text/xml won't work with MSIE, but is very useful for debugging xhtml code.
@ -16,8 +17,8 @@ $language = isset($config) ? $language = $config->GetValue('appearance','languag
# XML version and encoding for well-behaved browsers # XML version and encoding for well-behaved browsers
echo '<?xml version="1.0" encoding="utf-8"?>'."\n"; echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'."\n"; echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"';
echo '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n"; echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
printf('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%s" lang="%s" dir="ltr">',$language,$language); printf('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%s" lang="%s" dir="ltr">',$language,$language);
echo "\n\n"; echo "\n\n";

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/Attic/help.php,v 1.5 2005/02/26 12:35:05 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/help.php,v 1.5 2005/02/26 12:35:05 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.42.2.10 2006/03/08 22:49:27 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.46 2006/02/25 13:12:05 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin
@ -33,15 +33,10 @@ if (! is_readable(LIBDIR.'functions.php')) {
ob_end_clean(); ob_end_clean();
die("Cannot read the file 'functions.php' its permissions are too strict."); die("Cannot read the file 'functions.php' its permissions are too strict.");
} }
require LIBDIR.'functions.php'; require LIBDIR.'functions.php';
$config_file = CONFDIR.'config.php'; $config_file = CONFDIR.'config.php';
ob_end_clean(); ob_end_clean();
# Make sure this PHP install has gettext, we use it for language translation
if (! extension_loaded('gettext'))
die('Your install of PHP appears to be missing GETTEXT support. GETTEXT is used for language translation. Please install GETTEXT support before using phpLDAPadmin. (Dont forget to restart your web server afterwards)');
/* Helper functions. /* Helper functions.
* Our required helper functions are defined in functions.php * Our required helper functions are defined in functions.php
*/ */
@ -185,6 +180,12 @@ function check_config() {
REQUIRED_PHP_VERSION,phpversion())); REQUIRED_PHP_VERSION,phpversion()));
} }
# Make sure this PHP install has gettext, we use it for language translation
if (! extension_loaded('gettext')) {
pla_error('Your install of PHP appears to be missing GETTEXT support. GETTEXT is used for language translation. Please install GETTEXT support before using phpLDAPadmin. (Dont forget to restart your web server afterwards)');
return false;
}
# Make sure this PHP install has all our required extensions # Make sure this PHP install has all our required extensions
if (! extension_loaded('ldap')) { if (! extension_loaded('ldap')) {
pla_error('Your install of PHP appears to be missing LDAP support. Please install LDAP support before using phpLDAPadmin. (Dont forget to restart your web server afterwards)'); pla_error('Your install of PHP appears to be missing LDAP support. Please install LDAP support before using phpLDAPadmin. (Dont forget to restart your web server afterwards)');

View File

@ -8,7 +8,7 @@
// Bjoern Schotte <bjoern@rent-a-phpwizard.de> (PEARification) // Bjoern Schotte <bjoern@rent-a-phpwizard.de> (PEARification)
// Martin Jansen <mj@php.net> (PEAR conformance) // Martin Jansen <mj@php.net> (PEAR conformance)
// //
// $Id: PHPLIB.php,v 1.1.2.1 2005/11/27 03:55:50 wurley Exp $ // $Id: PHPLIB.php,v 1.2 2005/12/10 10:34:54 wurley Exp $
// //
//require_once "PEAR.php"; //require_once "PEAR.php";

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.33.2.3 2005/12/10 06:55:52 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.34 2005/12/10 10:34:54 wurley Exp $
/** /**
* Imports an LDIF file to the specified server_id. * Imports an LDIF file to the specified server_id.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import_form.php,v 1.20.2.3 2005/12/10 06:55:52 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import_form.php,v 1.21 2005/12/10 10:34:54 wurley Exp $
/** /**
* Displays a form to allow the user to upload and import * Displays a form to allow the user to upload and import

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.25.4.3 2008/11/28 14:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.27 2005/12/17 00:00:11 wurley Exp $
/** /**
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type. * Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
@ -69,6 +69,12 @@ include './header.php'; ?>
<center> <center>
<table class="login"> <table class="login">
<?php if( $ldapserver->isAnonBindAllowed() ) { ?>
<tr>
<td colspan="2"><small><label for="anonymous_bind_checkbox"><?php echo _('Anonymous Bind'); ?></label></small> <input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)" id="anonymous_bind_checkbox"/></td>
</tr>
<?php } ?>
<tr> <tr>
<td><small> <td><small>
<?php <?php
@ -88,15 +94,7 @@ else
</tr> </tr>
<tr> <tr>
<td colspan="2" align="center" valign="bottom"> <td colspan="2"><center><input type="submit" name="submit" value="<?php echo _('Authenticate'); ?>" /></center></td>
<input type="submit" name="submit" value="<?php echo _('Authenticate'); ?>" />
<?php if( $ldapserver->isAnonBindAllowed() ) { ?>
&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)"
id="anonymous_bind_checkbox"/>&nbsp;
<small><label for="anonymous_bind_checkbox"><?php echo _('Anonymous Bind'); ?></label></small>
<?php } ?>
</td>
</tr> </tr>
</table> </table>
</center> </center>

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.17.4.4 2005/12/16 11:33:07 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.19 2005/12/17 00:00:11 wurley Exp $
/** /**
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me * For servers whose auth_type is set to 'cookie' or 'session'. Pass me

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.14.2.3 2005/12/16 10:21:12 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.16 2005/12/17 00:00:11 wurley Exp $
/** /**
* Enables user to mass delete multiple entries using checkboxes. * Enables user to mass delete multiple entries using checkboxes.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/password_checker.php,v 1.8.4.1 2005/12/08 11:54:00 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/password_checker.php,v 1.9 2005/12/10 10:34:54 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/purge_cache.php,v 1.6.4.5 2005/12/16 11:29:35 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/purge_cache.php,v 1.8 2005/12/17 00:00:11 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/refresh.php,v 1.15.4.2 2005/12/16 11:29:35 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/refresh.php,v 1.17 2005/12/17 00:00:11 wurley Exp $
/** /**
* This script alters the session variable 'tree', by re-querying * This script alters the session variable 'tree', by re-querying

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.29.2.4 2008/11/28 14:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.30 2005/12/10 10:34:54 wurley Exp $
/** /**
* Renames a DN to a different name. * Renames a DN to a different name.
@ -47,13 +47,13 @@ if (count($new_dn_value) != 2 || ! isset($new_dn_value[1]))
$new_dn_attr = $new_dn_value[0]; $new_dn_attr = $new_dn_value[0];
$new_dn_value = $new_dn_value[1]; $new_dn_value = $new_dn_value[1];
$success = run_hook('pre_rename_entry',array('server_id'=>$ldapserver->server_id,'old_dn'=>dn_escape($dn),'new_dn'=>dn_escape($new_dn_value))); $success = run_hook('pre_rename_entry',array('server_id'=>$ldapserver->server_id,'old_dn'=>$dn,'new_dn'=>$new_dn_value));
if ($success) { if ($success) {
$success = false; $success = false;
$deleteoldrdn = $old_dn_attr == $new_dn_attr; $deleteoldrdn = $old_dn_attr == $new_dn_attr;
$success = $ldapserver->rename(dn_escape($dn),dn_escape($new_rdn),$container,$deleteoldrdn); $success = $ldapserver->rename($dn,$new_rdn,$container,$deleteoldrdn);
} else { } else {
pla_error(_('Could not rename the entry') ); pla_error(_('Could not rename the entry') );

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename_form.php,v 1.8.4.3 2006/04/29 03:29:19 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename_form.php,v 1.9 2005/12/10 10:34:54 wurley Exp $
/** /**
* Displays a form for renaming an LDAP entry. * Displays a form for renaming an LDAP entry.
@ -33,7 +33,7 @@ printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>
echo '<br /><center><form action="rename.php" method="post" class="edit_dn" />'; echo '<br /><center><form action="rename.php" method="post" class="edit_dn" />';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id); printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn)); printf('<input type="hidden" name="dn" value="%s" />',$dn);
printf('<input type="text" name="new_rdn" size="30" value="%s" />',htmlspecialchars($rdn)); printf('<input type="text" name="new_rdn" size="30" value="%s" />',htmlspecialchars($rdn));
printf('<input class="update_dn" type="submit" value="%s" />',_('Rename')); printf('<input class="update_dn" type="submit" value="%s" />',_('Rename'));
echo '</form></center>'; echo '</form></center>';

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.72.2.13 2006/10/28 05:56:56 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.75 2006/01/03 20:39:58 wurley Exp $
/** /**
* Perform LDAP searches and draw the advanced/simple search forms * Perform LDAP searches and draw the advanced/simple search forms
@ -43,7 +43,6 @@ if (isset($ldapserver)) {
} }
$filter = isset($_GET['filter']) ? clean_search_vals($_GET['filter']) : null; $filter = isset($_GET['filter']) ? clean_search_vals($_GET['filter']) : null;
$orderby = isset($_GET['orderby']) ? clean_search_vals($_GET['orderby']) : null;
$attr = isset($_GET['attribute']) ? $_GET['attribute'] : null; $attr = isset($_GET['attribute']) ? $_GET['attribute'] : null;
# grab the base dn for the search # grab the base dn for the search
@ -208,8 +207,7 @@ if (isset($_GET['search'])) {
debug_log('Search with base DN [%s]',64,$base_dn); debug_log('Search with base DN [%s]',64,$base_dn);
} }
$results = $ldapserver->search(null,dn_escape($base_dn),$filter, $results = $ldapserver->search(null,dn_escape($base_dn),$filter,$search_result_attributes,$scope,true,$config->GetValue('deref','search'));
$search_result_attributes,$scope,$orderby,$config->GetValue('deref','search'));
if ((! $results) && $ldapserver->errno()) if ((! $results) && $ldapserver->errno())
pla_error(_('Encountered an error while performing search.'),$ldapserver->error(),$ldapserver->errno()); pla_error(_('Encountered an error while performing search.'),$ldapserver->error(),$ldapserver->errno());
@ -235,8 +233,8 @@ if (isset($_GET['search'])) {
<nobr> <nobr>
<small> <small>
<?php <?php
printf('[ <a href="export_form.php?server_id=%s&amp;scope=%s&amp;dn=%s&amp;filter=%s&amp;attributes=%s"><img src="images/save.png" alt="Save" /> %s</a> ]', printf('[ <a href="export_form.php?server_id=%s&amp;scope=%s&amp;dn=%s&amp;filter=%s&amp;attributes=%s"><img src="images/save.png" /> %s</a> ]',
$ldapserver->server_id,htmlspecialchars($scope),urlencode($base_dn),urlencode($filter), $ldapserver->server_id,$scope,urlencode($base_dn),urlencode($filter),
urlencode(join(', ',$search_result_attributes)),_('export results')); urlencode(join(', ',$search_result_attributes)),_('export results'));
printf('[ <img src="images/rename.png" /> %s:',_('Format')); printf('[ <img src="images/rename.png" /> %s:',_('Format'));

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.26.2.40 2008/11/28 14:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.31 2006/02/19 05:44:34 wurley Exp $
/** /**
* Template render engine. * Template render engine.
@ -38,7 +38,7 @@ if (isset($_REQUEST['dn'])) {
if (! $ldapserver->haveAuthInfo()) if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.')); pla_error(_('Not enough information to login to server. Please check your configuration.'));
$ldapserver->dnExists(dn_escape($dn)) $ldapserver->dnExists($dn)
or pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn))); or pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn)));
$rdn = get_rdn($dn); $rdn = get_rdn($dn);
@ -87,7 +87,7 @@ if (isset($template['empty_attrs'])) {
$new_dn = sprintf('%s=%s,%s',$template['rdn'],$_REQUEST['form'][$template['rdn']],$_REQUEST['container']); $new_dn = sprintf('%s=%s,%s',$template['rdn'],$_REQUEST['form'][$template['rdn']],$_REQUEST['container']);
echo '<form action="create.php" method="post">'; echo '<form action="create.php" method="post">';
printf('<input type="hidden" name="new_dn" value="%s" />',htmlspecialchars($new_dn)); printf('<input type="hidden" name="new_dn" value="%s" />',$new_dn);
} else { } else {
echo '<form action="template_engine.php" method="post" id="template_form" name="template_form" enctype="multipart/form-data">'; echo '<form action="template_engine.php" method="post" id="template_form" name="template_form" enctype="multipart/form-data">';
@ -188,7 +188,7 @@ if (isset($template['empty_attrs'])) {
} }
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id); printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="template" value="%s" />',htmlspecialchars($_REQUEST['template'])); printf('<input type="hidden" name="template" value="%s" />',$_REQUEST['template']);
printf('<input type="hidden" name="object_classes" value="%s" />',rawurlencode(serialize(array_values($template['objectclass'])))); printf('<input type="hidden" name="object_classes" value="%s" />',rawurlencode(serialize(array_values($template['objectclass']))));
printf('<input type="hidden" name="page" value="%s" />',$page+1); printf('<input type="hidden" name="page" value="%s" />',$page+1);
@ -217,12 +217,12 @@ if (isset($template['empty_attrs'])) {
echo '<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>'; echo '<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>';
printf('<td><input type="text" name="container" size="40" value="%s" disabled />', printf('<td><input type="text" name="container" size="40" value="%s" disabled />',
htmlspecialchars($_REQUEST['container'])); htmlspecialchars($_REQUEST['container']));
printf('<input type="hidden" name="container" value="%s" /></td></tr>',htmlspecialchars($_REQUEST['container'])); printf('<input type="hidden" name="container" value="%s" /></td></tr>',$_REQUEST['container']);
echo '<tr class="spacer"><td colspan="3"></td></tr>'; echo '<tr class="spacer"><td colspan="3"></td></tr>';
} }
} else { } else {
printf('<td><input type="hidden" name="container" value="%s" /></td></tr>',htmlspecialchars($_REQUEST['container'])); printf('<td><input type="hidden" name="container" value="%s" /></td></tr>',$_REQUEST['container']);
} }
$count = 0; $count = 0;
@ -256,7 +256,7 @@ if (isset($template['empty_attrs'])) {
# Some conditional checking. # Some conditional checking.
# $detail['must'] & $detail['disable'] cannot be set at the same time. # $detail['must'] & $detail['disable'] cannot be set at the same time.
if (isset($detail['must']) && $detail['must'] && isset($detail['disable']) && $detail['disable']) if (isset($detail['must']) && $detail['must'] && isset($detail['disable']) && $detail['disable'])
pla_error(sprintf(_('Attribute [%s] is a MUST attribute, so it cannot be disabled.'),$attr)); pla_error(printf(_('Attribute [%s] is a MUST attribute, so it cannot be disabled.'),$attr));
# If this attribute is disabled, go to the next one. # If this attribute is disabled, go to the next one.
if (isset($detail['disable']) && $detail['disable']) if (isset($detail['disable']) && $detail['disable'])
@ -294,17 +294,13 @@ if (isset($template['empty_attrs'])) {
$type = 'select'; $type = 'select';
} }
# @todo: $detail['must'] && $detail['hidden'] must have $detail['value'] (with a value).
# @todo: if value is a select list, then it cannot be hidden. # @todo: if value is a select list, then it cannot be hidden.
# If this is a hidden attribute, then set its value. # If this is a hidden attribute, then set its value.
if (isset($detail['hidden']) && $detail['hidden']) { if (isset($detail['hidden']) && $detail['hidden']) {
if (isset($detail['value'])) { printf('<input type="%s" name="form[%s]" id="%s" value="%s"/>','hidden',$attr,$attr,$detail['value']);
printf('<input type="%s" name="form[%s]" id="%s" value="%s"/>','hidden',$attr,$attr,$detail['value']); continue;
continue;
} else {
pla_error(sprintf(_('Attribute [%s] is a HIDDEN attribute, however, it is missing a VALUE in your template.'),$attr));
}
} }
# This is a displayed attribute. # This is a displayed attribute.
@ -319,7 +315,7 @@ if (isset($template['empty_attrs'])) {
# Display the icon if one is required. # Display the icon if one is required.
if (isset($detail['icon']) && trim($detail['icon'])) if (isset($detail['icon']) && trim($detail['icon']))
printf('<td><img src="%s" alt="Icon" /></td>',$detail['icon']); printf('<td><img src="%s" /></td>',$detail['icon']);
else else
printf('<td>&nbsp;</td>'); printf('<td>&nbsp;</td>');
@ -328,12 +324,8 @@ if (isset($template['empty_attrs'])) {
# Display the label. # Display the label.
if (isset($detail['description']) && (trim($detail['description']))) if (isset($detail['description']) && (trim($detail['description'])))
printf('<acronym title="%s">%s</acronym>:',$detail['description'],$detail['display']); printf('<acronym title="%s">%s</acronym>:',$detail['description'],$detail['display']);
elseif (isset($detail['display']))
printf('%s:',$detail['display']);
else else
printf('%s:',_('No DISPLAY/DESCRIPTION attribute in template file')); printf('%s:',$detail['display']);
echo '</td>'; echo '</td>';
@ -489,7 +481,7 @@ if (isset($template['empty_attrs'])) {
# If there is no count, display the summary # If there is no count, display the summary
if (! $count) { if (! $count) {
printf('<tr><td><img src="%s" alt="Create" /></td><td><span class="x-small">%s :</span></td><td><b>%s</b></td></tr>', printf('<tr><td><img src="%s" /></td><td><span class="x-small">%s :</span></td><td><b>%s</b></td></tr>',
$template['icon'],_('Create Object'),htmlspecialchars($new_dn)); $template['icon'],_('Create Object'),htmlspecialchars($new_dn));
echo '<tr class="spacer"><td colspan="3"></td></tr>'; echo '<tr class="spacer"><td colspan="3"></td></tr>';
@ -498,7 +490,7 @@ if (isset($template['empty_attrs'])) {
foreach ($_REQUEST['form'] as $attr => $value) { foreach ($_REQUEST['form'] as $attr => $value) {
# Remove blank attributes. # Remove blank attributes.
if (! is_array($_REQUEST['form'][$attr]) && trim($_REQUEST['form'][$attr]) == '') { if (! $_REQUEST['form'][$attr]) {
unset($_REQUEST['form'][$attr]); unset($_REQUEST['form'][$attr]);
continue; continue;
} }
@ -519,11 +511,9 @@ if (isset($template['empty_attrs'])) {
else { else {
$display = $value; $display = $value;
if (isset($template['attribute'][$attr]['type']) && $template['attribute'][$attr]['type'] == 'password') { if (isset($template['attribute'][$attr]['type']) && $template['attribute'][$attr]['type'] == 'password')
$enc = (isset($_REQUEST['enc'])) ? $_REQUEST['enc'] : get_enc_type($value); if (obfuscate_password_display($_REQUEST['enc']))
if (obfuscate_password_display($enc))
$display = '********'; $display = '********';
}
printf('<input type="hidden" name="vals[]" value="%s" />',$value); printf('<input type="hidden" name="vals[]" value="%s" />',$value);
printf('%s</td><td><b>%s</b></td></tr>',$attr,htmlspecialchars($display)); printf('%s</td><td><b>%s</b></td></tr>',$attr,htmlspecialchars($display));
@ -531,14 +521,12 @@ if (isset($template['empty_attrs'])) {
} }
if (isset($_SESSION['submitform'])) { echo '<tr class="spacer"><td colspan="3"></td></tr>';
echo '<tr class="spacer"><td colspan="3"></td></tr>'; foreach (array_keys($_SESSION['submitform']) as $attr) {
foreach (array_keys($_SESSION['submitform']) as $attr) {
printf('<tr class="%s"><td colspan=2>%s</td><td><b>%s</b>', printf('<tr class="%s"><td colspan=2>%s</td><td><b>%s</b>',
($counter++%2==0?'even':'odd'),$attr,_('Binary value not displayed')); ($counter++%2==0?'even':'odd'),$attr,_('Binary value not displayed'));
printf('<input type="hidden" name="attrs[]" value="%s" /></td></tr>',$attr); printf('<input type="hidden" name="attrs[]" value="%s" /></td></tr>',$attr);
}
} }
} }
@ -744,7 +732,7 @@ foreach ($template['attrs'] as $attr => $vals) {
$schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s', $schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s',
$ldapserver->server_id,real_attr_name($attr)); $ldapserver->server_id,real_attr_name($attr));
printf('<b><a title="'._('Click to view the schema definition for attribute type \'%s\'').'" href="%s">%s</a></b>',$attr,$schema_href,$attr_display); printf('<b><a title="'._('Click to view the schema defintion for attribute type \'%s\'').'" href="%s">%s</a></b>',$attr,$schema_href,$attr_display);
echo '</td>'; echo '</td>';
echo '<td class="attr_note">'; echo '<td class="attr_note">';
@ -802,15 +790,15 @@ foreach ($template['attrs'] as $attr => $vals) {
if (count($vals) > 1) { if (count($vals) > 1) {
for ($i=1; $i<=count($vals); $i++) for ($i=1; $i<=count($vals); $i++)
printf('<a href="%s&amp;value_num=%s"><img src="images/save.png" alt="Save" /> %s(%s)</a><br />', printf('<a href="%s&amp;value_num=%s"><img src="images/save.png" /> %s(%s)</a><br />',
$href,$i,_('download value'),$i); $href,$i,_('download value'),$i);
} else { } else {
printf('<a href="%s"><img src="images/save.png" alt="Save" /> %s</a><br />',$href,_('download value')); printf('<a href="%s"><img src="images/save.png" /> %s</a><br />',$href,_('download value'));
} }
if (! $ldapserver->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr)) if (! $ldapserver->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr))
printf('<a href="javascript:deleteAttribute(\'%s\');" style="color:red;"><img src="images/trash.png" alt="Trash" /> %s</a>', printf('<a href="javascript:deleteAttribute(\'%s\');" style="color:red;"><img src="images/trash.png" /> %s</a>',
$attr,_('delete attribute')); $attr,_('delete attribute'));
echo '</small>'; echo '</small>';
@ -852,11 +840,10 @@ foreach ($template['attrs'] as $attr => $vals) {
if (trim($val) == '') if (trim($val) == '')
printf('<span style="color:red">[%s]</span><br />',_('empty')); printf('<span style="color:red">[%s]</span><br />',_('empty'));
elseif (! strcasecmp($attr,'userPassword') && $config->GetValue('appearance','obfuscate_password_display')) { elseif (! strcasecmp($attr,'userPassword') && $config->GetValue('appearance','obfuscate_password_display'))
$user_password = $val;
echo preg_replace('/./','*',$val).'<br />'; echo preg_replace('/./','*',$val).'<br />';
} elseif (in_array(strtolower($attr),$shadow_format_attrs)) { elseif (in_array(strtolower($attr),$shadow_format_attrs)) {
$shadow_date = shadow_date($attrs,$attr); $shadow_date = shadow_date($attrs,$attr);
echo htmlspecialchars($val).'&nbsp;'; echo htmlspecialchars($val).'&nbsp;';
echo '<small>'; echo '<small>';
@ -870,46 +857,24 @@ foreach ($template['attrs'] as $attr => $vals) {
echo '</small>'; echo '</small>';
} else { } else
if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
if ($ldapserver->dnExists($val)) {
printf('<a title="'._('Go to %s').
'" href="template_engine.php?server_id=%s&amp;dn=%s"><img '.
'style="vertical-align: top" src="images/go.png" alt="Go" '.
'/>&nbsp;%s</a>&nbsp;',
htmlspecialchars($val),$ldapserver->server_id,
rawurlencode($val),dn_unescape($val));
} else {
printf('<a title="'._('DN not available %s').'"><img '.
'style="vertical-align: top" src="images/nogo.png" alt="N/E" '.
'/>&nbsp;%s</a>&nbsp;',
htmlspecialchars($val),$ldapserver->server_id,
rawurlencode($val),dn_unescape($val));
}
elseif (is_mail_string($val))
printf('<img style="vertical-align: center" src="images/mail.png"'.
' alt="Mail" />&nbsp;<a href="mailto:%s">%s</a>&nbsp;',
htmlspecialchars($val),$val);
elseif (is_url_string($val))
printf('<img style="vertical-align: center" src="images/dc.png" '.
'alt="URL" />&nbsp;<a href="%s" target="new">%s</a>&nbsp;',
htmlspecialchars($val),$val);
else
echo htmlspecialchars($val).'<br />'; echo htmlspecialchars($val).'<br />';
}
} }
//@todo: redundant?
} else {
if (! strcasecmp($attr,'userPassword') && obfuscate_password_display())
echo preg_replace('/./','*',$vals).'<br />';
else
echo $vals.'<br />';
} }
if (! strcasecmp($attr,'userPassword') && isset($user_password)) if (! strcasecmp($attr,'userPassword'))
printf('<small><a href="javascript:passwordComparePopup(\'%s\')">%s</a></small>',base64_encode($user_password),_('Check password...')); printf('<small><a href="javascript:passwordComparePopup(\'%s\')">%s</a></small>',base64_encode($user_password),_('Check password...'));
if (preg_match("/^${attr}=/",$rdn) && if (preg_match("/^${attr}=/",$rdn))
!($ldapserver->isReadOnly() || $ldapserver->isAttrReadOnly($attr)))
printf('<small>(<a href="%s">%s</a>)</small>',$rename_href,_('rename')); printf('<small>(<a href="%s">%s</a>)</small>',$rename_href,_('rename'));
echo '</td>'; echo '</td>';
@ -942,8 +907,8 @@ foreach ($template['attrs'] as $attr => $vals) {
echo htmlspecialchars($user_password); echo htmlspecialchars($user_password);
echo '<br />'; echo '<br />';
printf('<input style="width: 260px" type="%s" name="new_values[userpassword][]" value="%s" />', printf('<input style="width: 260px" type="%s" name="new_values[userpassword][]" value="" />',
(obfuscate_password_display($enc_type) ? 'password' : 'text'),htmlspecialchars($user_password)); (obfuscate_password_display($enc_type) ? 'password' : 'text'));
echo enc_type_select_list($enc_type); echo enc_type_select_list($enc_type);
@ -1001,10 +966,10 @@ foreach ($template['attrs'] as $attr => $vals) {
$val = $vals[0]; $val = $vals[0];
printf('<input type="hidden" name="old_values[%s][]" value="%s" />',htmlspecialchars($attr),htmlspecialchars($val)); printf('<input type="hidden" name="old_values[%s][]" value="%s" />',htmlspecialchars($attr),htmlspecialchars($val));
printf('<span style="white-space: nowrap;"><input type="text" size="30" id="f_date_%s" name="new_values[%s][0]" value="%s" />&nbsp;', printf('<nobr><input type="text" size="30" id="f_date_%s" name="new_values[%s][0]" value="%s" />&nbsp;',
$attr,htmlspecialchars($attr),htmlspecialchars($val)); $attr,htmlspecialchars($attr),htmlspecialchars($val));
draw_date_selector_link($attr); draw_date_selector_link($attr);
echo '</span></td>'; echo '</nobr></td>';
echo '</tr>'; echo '</tr>';
$js[] = sprintf('<script type="text/javascript" language="javascript">defaults[\'f_date_%s\'] = \'%s\';</script>',$attr,$js_date_attrs[$attr]); $js[] = sprintf('<script type="text/javascript" language="javascript">defaults[\'f_date_%s\'] = \'%s\';</script>',$attr,$js_date_attrs[$attr]);
@ -1037,13 +1002,12 @@ foreach ($template['attrs'] as $attr => $vals) {
# Is this value is a structural objectClass, make it read-only # Is this value is a structural objectClass, make it read-only
if (! strcasecmp($attr,'objectClass')) { if (! strcasecmp($attr,'objectClass')) {
printf('<a title="%s" href="schema.php?server_id=%s&amp;view=objectClasses&amp;viewvalue=%s"><img src="images/info.png" alt="Info" /></a>&nbsp;', printf('<a title="%s" href="schema.php?server_id=%s&amp;view=objectClasses&amp;viewvalue=%s"><img src="images/info.png" /></a>&nbsp;',
_('View the schema description for this objectClass'),$ldapserver->server_id,strtolower(htmlspecialchars($val))); _('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val));
$schema_object = $ldapserver->getSchemaObjectClass($val); $schema_object = $ldapserver->getSchemaObjectClass($val);
# This should be an object, but we'll test it anyway if ($schema_object->getType() == 'structural') {
if (is_object($schema_object) && $schema_object->getType() == 'structural') {
printf(' %s <small>(<acronym title="%s">%s</acronym>)</small><br />', printf(' %s <small>(<acronym title="%s">%s</acronym>)</small><br />',
$val,_('This is a structural ObjectClass and cannot be removed.'),_('structural')); $val,_('This is a structural ObjectClass and cannot be removed.'),_('structural'));
printf('<input type="hidden" name="%s" id="%s" value="%s" />',$input_name,$input_id,htmlspecialchars($val)); printf('<input type="hidden" name="%s" id="%s" value="%s" />',$input_name,$input_id,htmlspecialchars($val));
@ -1055,23 +1019,23 @@ foreach ($template['attrs'] as $attr => $vals) {
if (is_dn_string($val) || $ldapserver->isDNAttr($attr)) if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
if ($ldapserver->dnExists($val)) { if ($ldapserver->dnExists($val)) {
printf('<a title="'._('Go to %s').'" href="template_engine.php?server_id=%s&amp;dn=%s"><img style="vertical-align: top" src="images/go.png" alt="Go" /></a>&nbsp;', printf('<a title="'._('Go to %s').'" href="template_engine.php?server_id=%s&amp;dn=%s"><img style="vertical-align: top" src="images/go.png" /></a>&nbsp;',
htmlspecialchars($val),$ldapserver->server_id,rawurlencode($val)); htmlspecialchars($val),$ldapserver->server_id,rawurlencode($val));
} else { } else {
printf('<a title="'._('DN not available %s').'"><img style="vertical-align: top" src="images/nogo.png" alt="N/E" /></a>&nbsp;', printf('<a title="'._('DN not available %s').'"><img style="vertical-align: top" src="images/nogo.png" /></a>&nbsp;',
htmlspecialchars($val),$ldapserver->server_id,rawurlencode($val)); htmlspecialchars($val),$ldapserver->server_id,rawurlencode($val));
} }
elseif (is_mail_string($val)) elseif (is_mail_string($val))
printf('<a href="mailto:%s"><img style="vertical-align: center" src="images/mail.png" alt="Mail" /></a>&nbsp;',htmlspecialchars($val)); printf('<a href="mailto:%s"><img style="vertical-align: center" src="images/mail.png" /></a>&nbsp;',htmlspecialchars($val));
elseif (is_url_string($val)) elseif (is_url_string($val))
printf('<a href="%s" target="new"><img style="vertical-align: center" src="images/dc.png" alt="URL" /></a>&nbsp;',htmlspecialchars($val)); printf('<a href="%s" target="new"><img style="vertical-align: center" src="images/dc.png" /></a>&nbsp;',htmlspecialchars($val));
if ($ldapserver->isMultiLineAttr($attr,$val)) if ($ldapserver->isMultiLineAttr($attr,$val))
printf('<textarea class="val" rows="3" cols="50" name="%s" id="%s">%s</textarea>',$input_name,$input_id,htmlspecialchars(dn_unescape($val))); printf('<textarea class="val" rows="3" cols="50" name="%s" id="%s">%s</textarea>',$input_name,$input_id,htmlspecialchars($val));
else else
printf('<input type="text" class="val" name="%s" id="%s" value="%s" />&nbsp;',$input_name,$input_id,htmlspecialchars(dn_unescape($val))); printf('<input type="text" class="val" name="%s" id="%s" value="%s" />&nbsp;',$input_name,$input_id,htmlspecialchars($val));
/* draw a link for popping up the entry browser if this is the type of attribute /* draw a link for popping up the entry browser if this is the type of attribute
that houses DNs. */ that houses DNs. */
@ -1102,12 +1066,8 @@ foreach ($template['attrs'] as $attr => $vals) {
$description = isset($group['description']) ? $group['description'] : null; $description = isset($group['description']) ? $group['description'] : null;
if (is_array($description)) { if ($description)
foreach ($description as $item)
printf(' (%s)',htmlspecialchars($item));
} else {
printf(' (%s)',htmlspecialchars($description)); printf(' (%s)',htmlspecialchars($description));
}
echo '</small>'; echo '</small>';
} }
@ -1164,7 +1124,7 @@ else
<!-- This form is submitted by JavaScript when the user clicks "Delete attribute" on a binary attribute --> <!-- 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"> <form name="delete_attribute_form" action="delete_attr.php" method="post">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" /> <input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" /> <input type="hidden" name="dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="attr" value="FILLED IN BY JAVASCRIPT" /> <input type="hidden" name="attr" value="FILLED IN BY JAVASCRIPT" />
</form> </form>

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update.php,v 1.25.2.7 2008/11/28 14:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update.php,v 1.28 2006/01/29 01:51:49 wurley Exp $
/** /**
* Updates or deletes a value from a specified attribute for a specified dn. * Updates or deletes a value from a specified attribute for a specified dn.
@ -49,35 +49,28 @@ $failed_attrs = array();
if (! is_array($update_array)) if (! is_array($update_array))
pla_error(_('update_array is malformed. This might be a phpLDAPadmin bug. Please report it.')); pla_error(_('update_array is malformed. This might be a phpLDAPadmin bug. Please report it.'));
run_hook ('pre_update',array('server_id'=>$ldapserver->server_id,'dn'=>$dn,'update_array'=>$update_array));
# Check for delete attributes (indicated by the attribute entry appearing like this: attr => '' # Check for delete attributes (indicated by the attribute entry appearing like this: attr => ''
foreach ($update_array as $attr => $val) { foreach ($update_array as $attr => $val)
if (! is_array($val)) { if (! is_array($val))
if (array_key_exists($attr,$skip_array)) if (array_key_exists($attr,$skip_array))
unset($update_array[$attr]); unset($update_array[$attr]);
elseif ($val == '') elseif ($val == '')
$update_array[$attr] = array(); $update_array[$attr] = array();
# Skip change # Skip change
else { else
if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
$val=dn_escape($val);
$update_array[$attr] = $val; $update_array[$attr] = $val;
}
} else { else
if (array_key_exists($attr,$skip_array)) if (array_key_exists($attr,$skip_array))
unset($update_array[$attr]); unset($update_array[$attr]);
else else
foreach ($val as $i => $v) { foreach ($val as $i => $v)
if (is_dn_string($v) || $ldapserver->isDNAttr($attr))
$v=dn_escape($v);
$update_array[$attr][$i] = $v; $update_array[$attr][$i] = $v;
}
}
}
run_hook ('pre_update',array('server_id'=>$ldapserver->server_id,'dn'=>$dn,'update_array'=>$update_array));
#die();
/* Call the custom callback for each attribute modification /* Call the custom callback for each attribute modification
and verify that it should be modified.*/ and verify that it should be modified.*/

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.43.2.13 2008/11/28 14:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.46 2006/01/29 01:51:49 wurley Exp $
/** /**
* Takes the results of clicking "Save" in template_engine.php and determines which * Takes the results of clicking "Save" in template_engine.php and determines which
@ -76,21 +76,16 @@ foreach ($old_values as $attr => $old_val) {
} }
# Check user password with new encoding. # Check user password with new encoding.
if (isset($new_values['userpassword']) && is_array($new_values['userpassword'])) { if (isset($new_values['userpassword']) && is_array($new_values['userpassword']))
foreach ($new_values['userpassword'] as $key => $userpassword) { foreach ($new_values['userpassword'] as $key => $userpassword) {
if ($userpassword) { if ($userpassword) {
if ($old_values['userpassword'][$key] == $new_values['userpassword'][$key] && $new_val[$key] = password_hash($userpassword,$_POST['enc_type'][$key]);
get_enc_type($old_values['userpassword'][$key]) == $_POST['enc_type'][$key])
continue;
$new_values['userpassword'][$key] = password_hash($userpassword,$_POST['enc_type'][$key]); if ($new_val[$key] != $old_values['userpassword'][$key])
$update_array['userpassword'][$key] = $new_val[$key];
} }
} }
if ($old_values['userpassword'] != $new_values['userpassword'])
$update_array['userpassword'] = $new_values['userpassword'];
}
# strip empty vals from update_array and ensure consecutive indices for each attribute # strip empty vals from update_array and ensure consecutive indices for each attribute
foreach ($update_array as $attr => $val) { foreach ($update_array as $attr => $val) {
if (is_array($val)) { if (is_array($val)) {
@ -144,25 +139,25 @@ if (count($update_array) > 0) {
printf('<tr class="%s">',$counter%2 ? 'even' : 'odd'); printf('<tr class="%s">',$counter%2 ? 'even' : 'odd');
printf('<td><b>%s</b></td>',htmlspecialchars($attr)); printf('<td><b>%s</b></td>',htmlspecialchars($attr));
echo '<td><span style="white-space: nowrap;">'; echo '<td><nobr>';
if (strcasecmp($attr,'userPassword') == 0) { if (strcasecmp($attr,'userPassword') == 0) {
foreach ($old_values[$attr] as $key => $value) { foreach ($old_values[$attr] as $key => $value) {
if (obfuscate_password_display(get_enc_type($old_values[$attr][$key]))) if (obfuscate_password_display(get_enc_type($old_values[$attr][$key])))
echo preg_replace('/./','*',$old_values[$attr][$key]).'<br />'; echo preg_replace('/./','*',$old_values[$attr][$key]).'<br />';
else else
echo nl2br(htmlspecialchars(dn_unescape($old_values[$attr][$key]))).'<br />'; echo nl2br(htmlspecialchars($old_values[$attr][$key])).'<br />';
} }
} elseif (is_array($old_values[$attr])) } elseif (is_array($old_values[$attr]))
foreach ($old_values[$attr] as $v) foreach ($old_values[$attr] as $v)
echo nl2br(htmlspecialchars(dn_unescape($v))).'<br />'; echo nl2br(htmlspecialchars($v)).'<br />';
else else
echo nl2br(htmlspecialchars(dn_unescape($old_values[$attr]))).'<br />'; echo nl2br(htmlspecialchars($old_values[$attr])).'<br />';
echo '</span></td>'; echo '</nobr></td>';
echo '<td><span style="white-space: nowrap;">'; echo '<td><nobr>';
# Is this a multi-valued attribute? # Is this a multi-valued attribute?
if (is_array($new_val)) { if (is_array($new_val)) {
@ -172,7 +167,7 @@ if (count($update_array) > 0) {
if (obfuscate_password_display(get_enc_type($new_val[$key]))) if (obfuscate_password_display(get_enc_type($new_val[$key])))
echo preg_replace('/./','*',$new_val[$key]).'<br />'; echo preg_replace('/./','*',$new_val[$key]).'<br />';
else else
echo htmlspecialchars(dn_unescape($new_val[$key])).'<br />'; echo htmlspecialchars($new_val[$key]).'<br />';
} }
} }
@ -185,7 +180,7 @@ if (count($update_array) > 0) {
$update_array[$attr] = array_values($update_array[$attr]); $update_array[$attr] = array_values($update_array[$attr]);
} else { } else {
echo nl2br(htmlspecialchars(dn_unescape($v))).'<br />'; echo nl2br(htmlspecialchars($v)).'<br />';
} }
} }
} }
@ -201,7 +196,7 @@ if (count($update_array) > 0) {
} elseif ($new_val != '') } elseif ($new_val != '')
printf('<span style="color: red">%s</span>',_('[attribute deleted]')); printf('<span style="color: red">%s</span>',_('[attribute deleted]'));
echo '</span></td>'; echo '</nobr></td>';
printf('<td><input name="skip_array[%s]" type="checkbox" /></td>',htmlspecialchars($attr)); printf('<td><input name="skip_array[%s]" type="checkbox" /></td>',htmlspecialchars($attr));
echo '</tr>'."\n\n"; echo '</tr>'."\n\n";

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/view_jpeg_photo.php,v 1.9.4.2 2005/12/08 11:58:14 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/view_jpeg_photo.php,v 1.10 2005/12/10 10:34:54 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/welcome.php,v 1.24.4.2 2005/12/08 11:58:14 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/welcome.php,v 1.25 2005/12/10 10:34:54 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/common.php,v 1.76.2.8 2007/01/27 13:21:35 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/common.php,v 1.78 2006/01/03 20:39:59 wurley Exp $
/** /**
* Contains code to be executed at the top of each phpLDAPadmin page. * Contains code to be executed at the top of each phpLDAPadmin page.
@ -29,6 +29,10 @@ ob_start();
require_once realpath(LIBDIR.'functions.php'); require_once realpath(LIBDIR.'functions.php');
ob_end_clean(); ob_end_clean();
# Turn on all notices and warnings. This helps us write cleaner code (we hope at least)
if (phpversion() < 5)
pla_error('Sorry, PLA is now a PHP5 application.<BR>For a PHP4 application, please use a 0.9.x version.');
/* Our custom error handler receives all error notices that pass the error_reporting() /* Our custom error handler receives all error notices that pass the error_reporting()
level set above. */ level set above. */
set_error_handler('pla_error_handler'); set_error_handler('pla_error_handler');
@ -51,13 +55,7 @@ require_once realpath(LIBDIR.'config_default.php');
ob_end_clean(); ob_end_clean();
# We are now ready for error reporting. # We are now ready for error reporting.
# Turn on all notices and warnings. This helps us write cleaner code (we hope at least) error_reporting(E_DEBUG);
if (phpversion() >= '5') {
# E_DEBUG is PHP5 specific and prevents warnings about using 'var' to declare class members
error_reporting(E_DEBUG);
} else
# For PHP4
error_reporting(E_ALL);
/** /**
* At this point we have read all our additional function PHP files and our configuration. * At this point we have read all our additional function PHP files and our configuration.
@ -107,7 +105,6 @@ if ($language == 'auto') {
# Set language # Set language
putenv('LANG='.$HTTP_LANG); # e.g. LANG=de_DE putenv('LANG='.$HTTP_LANG); # e.g. LANG=de_DE
$HTTP_LANG .= '.UTF-8';
setlocale(LC_ALL,$HTTP_LANG); # set LC_ALL to de_DE setlocale(LC_ALL,$HTTP_LANG); # set LC_ALL to de_DE
bindtextdomain('messages',LANGDIR); bindtextdomain('messages',LANGDIR);
bind_textdomain_codeset('messages','UTF-8'); bind_textdomain_codeset('messages','UTF-8');
@ -128,7 +125,6 @@ if ($language == 'auto') {
# Set language # Set language
putenv('LANG='.$language); # e.g. LANG=de_DE putenv('LANG='.$language); # e.g. LANG=de_DE
$language .= '.UTF-8';
setlocale(LC_ALL,$language); # set LC_ALL to de_DE setlocale(LC_ALL,$language); # set LC_ALL to de_DE
bindtextdomain('messages',LANGDIR); bindtextdomain('messages',LANGDIR);
bind_textdomain_codeset('messages','UTF-8'); bind_textdomain_codeset('messages','UTF-8');

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/config_default.php,v 1.16.2.6 2007/01/27 13:25:49 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/config_default.php,v 1.17 2005/12/10 10:34:55 wurley Exp $
/** /**
* Configuration processing and defaults. * Configuration processing and defaults.
@ -94,7 +94,7 @@ class Config {
*/ */
$this->default->appearance['obfuscate_password_display'] = array( $this->default->appearance['obfuscate_password_display'] = array(
'desc'=>'Obfuscate the display of passwords', 'desc'=>'Obfuscate the display of passwords',
'default'=>true); 'default'=>false);
$this->default->appearance['show_clear_password'] = array( $this->default->appearance['show_clear_password'] = array(
'desc'=>'Whether to show clear passwords if we dont obfuscate them', 'desc'=>'Whether to show clear passwords if we dont obfuscate them',

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
$Id: createlm.php,v 1.2.2.1 2006/04/29 07:31:08 wurley Exp $ $Id: createlm.php,v 1.2 2005/10/23 01:05:41 wurley Exp $
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2004 Roland Gruber Copyright (C) 2004 Roland Gruber
@ -133,14 +133,6 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
array( 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8), array( 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8),
array( 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11))); array( 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11)));
/**
* Fixes too large numbers
*/
function x($i) {
if ($i < 0) return 4294967296 - $i;
else return $i;
}
/** /**
* @param integer count * @param integer count
* @param array $data * @param array $data
@ -343,11 +335,7 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
# Support functions # Support functions
# Ported from SAMBA/source/lib/md4.c:F,G and H respectfully # Ported from SAMBA/source/lib/md4.c:F,G and H respectfully
function F($X, $Y, $Z) { function F($X, $Y, $Z) {
$ret = (($X&$Y) | ((~((int)$X))&$Z)); return ($X&$Y) | ((~$X)&$Z);
if ($this->x($ret) > 4294967296) {
$ret = (2*4294967296) - $this->x($ret);
}
return $ret;
} }
function G($X, $Y, $Z) { function G($X, $Y, $Z) {
@ -480,9 +468,6 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
$sum[1] &= 0xffff; $sum[1] &= 0xffff;
$sum[0] &= 0xffff; $sum[0] &= 0xffff;
$ret = ($sum[0]<<16) | $sum[1]; $ret = ($sum[0]<<16) | $sum[1];
if ($this->x($ret) > 4294967296) {
$ret = (2*4294967296) - $this->x($ret);
}
return $ret; return $ret;
} }
@ -508,14 +493,7 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
# Renamed to prevent clash with SAMBA/source/libsmb/smbdes.c:lshift # Renamed to prevent clash with SAMBA/source/libsmb/smbdes.c:lshift
function md4lshift($x, $s) { function md4lshift($x, $s) {
$x &= 0xFFFFFFFF; $x &= 0xFFFFFFFF;
if ($this->x($x) > 4294967296) { return ((($x<<$s)&0xFFFFFFFF) | $this->unsigned_shift_r($x, (32-$s)));
$x = (2*4294967296) - $this->x($x);
}
$ret = ((($x<<$s)&0xFFFFFFFF) | $this->unsigned_shift_r($x, (32-$s)));
if ($this->x($ret) > 4294967296) {
$ret = (2*4294967296) - $this->x($ret);
}
return $ret;
} }
/** /**

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/export_functions.php,v 1.32.2.10 2007/01/27 13:28:06 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/export_functions.php,v 1.34 2005/12/17 00:00:12 wurley Exp $
/** /**
* Fuctions and classes for exporting ldap entries to others formats * Fuctions and classes for exporting ldap entries to others formats

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/functions.php,v 1.283.2.42 2008/11/28 14:21:37 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/functions.php,v 1.290 2006/02/25 13:12:05 wurley Exp $
/** /**
* A collection of functions used throughout phpLDAPadmin. * A collection of functions used throughout phpLDAPadmin.
@ -85,9 +85,6 @@ function pretty_print_dn( $dn ) {
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('pretty_print_dn(): Entered with (%s)',1,$dn); debug_log('pretty_print_dn(): Entered with (%s)',1,$dn);
if (! is_dn_string($dn))
pla_error(sprintf(_('DN "%s" is not an LDAP distinguished name.'),htmlspecialchars($dn)));
$dn = pla_explode_dn( $dn ); $dn = pla_explode_dn( $dn );
foreach( $dn as $i => $element ) { foreach( $dn as $i => $element ) {
$element = htmlspecialchars($element); $element = htmlspecialchars($element);
@ -316,10 +313,6 @@ function pla_compare_dns($dn1,$dn2) {
$dn1_parts = pla_explode_dn(pla_reverse_dn($dn1)); $dn1_parts = pla_explode_dn(pla_reverse_dn($dn1));
$dn2_parts = pla_explode_dn(pla_reverse_dn($dn2)); $dn2_parts = pla_explode_dn(pla_reverse_dn($dn2));
if (! $dn1_parts || ! $dn2_parts)
return;
assert(is_array($dn1_parts)); assert(is_array($dn1_parts));
assert(is_array($dn2_parts)); assert(is_array($dn2_parts));
@ -424,16 +417,15 @@ function get_next_number(&$ldapserver,$startbase='',$type='uid') {
if (is_null($base_dn)) if (is_null($base_dn))
pla_error(sprintf(_('You specified the "auto_uid_number_mechanism" as "search" in your pla_error(sprintf(_('You specified the "auto_uid_number_mechanism" as "search" in your
configuration for server <b>%s</b>, but you did not specify the configuration for server <b>%s</b>, but you did not specify the
"auto_uid_number_search_base". Please specify it before proceeding.'),$ldapserver->name)); "auto_uid_number_search_base". Please specify it before proceeding.'),$ldapserver->name));
} else { } else {
$base_dn = $startbase; $base_dn = $startbase;
} }
if (! $ldapserver->dnExists($base_dn)) if (! $ldapserver->dnExists($base_dn))
pla_error(sprintf(_('Your phpLDAPadmin configuration specifies an invalid auto_uid_search_base for server %s'), pla_error(sprintf(_('Your phpLDAPadmin configuration specifies an invalid auto_uid_search_base for server %s'),$ldapserver->name));
$ldapserver->name));
$filter = '(|(uidNumber=*)(gidNumber=*))'; $filter = '(|(uidNumber=*)(gidNumber=*))';
$results = array(); $results = array();
@ -505,8 +497,8 @@ function get_next_number(&$ldapserver,$startbase='',$type='uid') {
# No other cases allowed. The user has an error in the configuration # No other cases allowed. The user has an error in the configuration
default : default :
pla_error( sprintf( _('You specified an invalid value for auto_uid_number_mechanism ("%s") pla_error( sprintf( _('You specified an invalid value for auto_uid_number_mechanism ("%s")
in your configration. Only "uidpool" and "search" are valid. in your configration. Only "uidpool" and "search" are valid.
Please correct this problem.') , $mechanism) ); Please correct this problem.') , $mechanism) );
} }
} }
@ -1020,7 +1012,7 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) {
?> ?>
<center> <center>
<table class="error"><tr><td class="img"><img src="images/warning.png" alt="Warning" /></td> <table class="error"><tr><td class="img"><img src="images/warning.png" /></td>
<td><center><h2><?php echo _('Error');?></h2></center> <td><center><h2><?php echo _('Error');?></h2></center>
<?php echo $msg; ?> <?php echo $msg; ?>
<br /> <br />
@ -1093,16 +1085,15 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) {
* *
* @see set_error_handler * @see set_error_handler
*/ */
function pla_error_handler($errno,$errstr,$file,$lineno) { function pla_error_handler( $errno, $errstr, $file, $lineno ) {
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('pla_error_handler(): Entered with (%s,%s,%s,%s)',1,$errno,$errstr,$file,$lineno); debug_log('pla_error_handler(): Entered with (%s,%s,%s,%s)',1,$errno,$errstr,$file,$lineno);
/* error_reporting will be 0 if the error context occurred // error_reporting will be 0 if the error context occurred
* within a function call with '@' preprended (ie, @ldap_bind() ); // within a function call with '@' preprended (ie, @ldap_bind() );
* So, don't report errors if the caller has specifically // So, don't report errors if the caller has specifically
* disabled them with '@' // disabled them with '@'
*/ if( 0 == ini_get( 'error_reporting' ) || 0 == error_reporting() )
if (ini_get('error_reporting') == 0 || error_reporting() == 0)
return; return;
$file = basename( $file ); $file = basename( $file );
@ -1127,7 +1118,7 @@ function pla_error_handler($errno,$errstr,$file,$lineno) {
$errstr = preg_replace("/\s+/"," ",$errstr); $errstr = preg_replace("/\s+/"," ",$errstr);
if( $errno == E_NOTICE ) { if( $errno == E_NOTICE ) {
echo sprintf(_('<center><table class=\'notice\'><tr><td colspan=\'2\'><center><img src=\'images/warning.png\' height=\'12\' width=\'13\' alt="Warning" /> echo sprintf(_('<center><table class=\'notice\'><tr><td colspan=\'2\'><center><img src=\'images/warning.png\' height=\'12\' width=\'13\' />
<b>You found a non-fatal phpLDAPadmin bug!</b></td></tr><tr><td>Error:</td><td><b>%s</b> (<b>%s</b>)</td></tr><tr><td>File:</td> <b>You found a non-fatal phpLDAPadmin bug!</b></td></tr><tr><td>Error:</td><td><b>%s</b> (<b>%s</b>)</td></tr><tr><td>File:</td>
<td><b>%s</b> line <b>%s</b>, caller <b>%s</b></td></tr><tr><td>Versions:</td><td>PLA: <b>%s</b>, PHP: <b>%s</b>, SAPI: <b>%s</b> <td><b>%s</b> line <b>%s</b>, caller <b>%s</b></td></tr><tr><td>Versions:</td><td>PLA: <b>%s</b>, PHP: <b>%s</b>, SAPI: <b>%s</b>
</td></tr><tr><td>Web server:</td><td><b>%s</b></td></tr> </td></tr><tr><td>Web server:</td><td><b>%s</b></td></tr>
@ -1222,8 +1213,7 @@ function draw_jpeg_photos($ldapserver,$dn,$attr_name='jpegPhoto',$draw_delete_bu
if (isset($table_html_attrs) && trim($table_html_attrs) ) if (isset($table_html_attrs) && trim($table_html_attrs) )
printf('<table %s><tr><td><center>',$table_html_attrs); printf('<table %s><tr><td><center>',$table_html_attrs);
$jpeg_data = $ldapserver->search(null,$dn,'objectClass=*',array($attr_name),'base'); $jpeg_data = array_pop($ldapserver->search(null,$dn,'objectClass=*',array($attr_name),'base'));
$jpeg_data = array_pop($jpeg_data);
if (! $jpeg_data) { if (! $jpeg_data) {
printf(_('Could not fetch jpeg data from LDAP server for attribute %s.'),htmlspecialchars($attr_name)); printf(_('Could not fetch jpeg data from LDAP server for attribute %s.'),htmlspecialchars($attr_name));
return; return;
@ -1272,7 +1262,7 @@ function draw_jpeg_photos($ldapserver,$dn,$attr_name='jpegPhoto',$draw_delete_bu
$img_height = $height; $img_height = $height;
} }
printf('<img %s%s%s src="view_jpeg_photo.php?file=%s" alt="Photo" /><br />', printf('<img %s%s%s src="view_jpeg_photo.php?file=%s" /><br />',
($fixed_width ? '' : 'width="'.$img_width.'" '), ($fixed_width ? '' : 'width="'.$img_width.'" '),
($fixed_height ? '' : 'height="'.$img_height.'"'), ($fixed_height ? '' : 'height="'.$img_height.'"'),
($img_html_attrs ? $img_html_attrs : ''),basename($jpeg_filename)); ($img_html_attrs ? $img_html_attrs : ''),basename($jpeg_filename));
@ -1647,7 +1637,7 @@ function draw_chooser_link( $form_element, $include_choose_text=true, $rdn="none
$title = _('Click to popup a dialog to select an entry (DN) graphically'); $title = _('Click to popup a dialog to select an entry (DN) graphically');
printf('<a href="%s" title="%s"><img class="chooser" src="images/find.png" alt="Find" /></a>',$href,$title); printf('<a href="%s" title="%s"><img class="chooser" src="images/find.png" /></a>',$href,$title);
if ($include_choose_text) if ($include_choose_text)
printf('<span class="x-small"><a href="%s" title="%s">%s</a></span>',$href,$title,_('browse')); printf('<span class="x-small"><a href="%s" title="%s">%s</a></span>',$href,$title,_('browse'));
} }
@ -1669,8 +1659,6 @@ function draw_chooser_link( $form_element, $include_choose_text=true, $rdn="none
* </code> * </code>
*/ */
function pla_explode_dn($dn,$with_attributes=0) { function pla_explode_dn($dn,$with_attributes=0) {
if (DEBUG_ENABLED)
debug_log('pla_explode_dn(): Entered with (%s,%s)',1,$dn,$with_attributes);
$dn = addcslashes(dn_escape($dn),'<>'); $dn = addcslashes(dn_escape($dn),'<>');
# split the dn # split the dn
@ -1692,41 +1680,17 @@ function pla_explode_dn($dn,$with_attributes=0) {
} }
/** /**
* Parse a DN and escape any special characters (rfc2253) * Parse a DN and escape any special characters
*/ */
function dn_escape($dn) { function dn_escape($dn) {
$olddn = $dn; # Check if the RDN has a comma and escape it.
# while (preg_match('/([^\\\\]),(\s*[^=]*\s*),/',$dn))
# http://rfc.net/rfc2253.html $dn = preg_replace('/([^\\\\]),(\s*[^=]*\s*),/','$1\\\\2C$2,',$dn);
# special = '"' / "," / "=" / "+" / "<" / ">" / "#" / ";"
# Check if the RDN has special chars escape them.
# - only simplest cases are dealt with
# TODO: '=' unhandled
# ';' may be used instead of ',' but its use is discouraged
while (preg_match('/([^\\\\])[;,](\s*[^=]*\s*)([;,]|$)/',$dn)) {
$dn = preg_replace('/([^\\\\]),(\s*[^=]*\s*)([;,]|$)/','$1\\\\2c$2$3',$dn);
$dn = preg_replace('/([^\\\\]);(\s*[^=]*\s*)([;,]|$)/','$1\\\\3b$2$3',$dn);
}
$dn = preg_replace('/([^\\\\])\+/','$1\\\\2b',$dn);
$dn = preg_replace('/([^\\\\])"/','$1\\\\22',$dn);
$dn = preg_replace('/([^\\\\])#([^0-9a-f]|$)/i','$1\\\\23$2',$dn);
$dn = preg_replace('/([^\\\\])>/','$1\\\\3e',$dn);
$dn = preg_replace('/([^\\\\])</','$1\\\\3c',$dn);
if (DEBUG_ENABLED)
debug_log('dn_escape(): Entered with (%s), Returning (%s)',1,$olddn,$dn);
return $dn; $dn = preg_replace('/([^\\\\]),(\s*[^=]*\s*)([^,])$/','$1\\\\2C$2$3',$dn);
}
/**
* Parse a DN and escape any special characters for use in javascript selection
*/
function dn_js_escape($dn) {
$olddn = $dn;
#
$dn = preg_replace('/([^\\\\])\'/','$1\\\\\'',$dn);
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('dn_js_escape(): Entered with (%s), Returning (%s)',1,$olddn,$dn); debug_log('dn_escape(): Entered with (%s), Returning (%s)',1,$dn,$dn);
return $dn; return $dn;
} }
@ -1748,7 +1712,7 @@ function dn_unescape($dn) {
*/ */
function get_href($type,$extra_info='') { function get_href($type,$extra_info='') {
$sf = 'https://sourceforge.net'; $sf = 'https://sourceforge.net';
$pla = 'http://wiki.phpldapadmin.info'; $pla = 'http://wiki.pldapadmin.com';
$group_id = '61828'; $group_id = '61828';
$bug_atid = '498546'; $bug_atid = '498546';
$rfe_atid = '498549'; $rfe_atid = '498549';
@ -1861,7 +1825,6 @@ function pla_reverse_dn($dn) {
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('pla_reverse_dn(): Entered with (%s)',1,$dn); debug_log('pla_reverse_dn(): Entered with (%s)',1,$dn);
$rev = '';
foreach (pla_explode_dn($dn) as $key => $branch) { foreach (pla_explode_dn($dn) as $key => $branch) {
// pla_expode_dn returns the array with an extra count attribute, we can ignore that. // pla_expode_dn returns the array with an extra count attribute, we can ignore that.
@ -2301,8 +2264,8 @@ function shadow_date( $attrs, $attr) {
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('shadow_date(): Entered with (%s,%s)',1,$attrs,$attr); debug_log('shadow_date(): Entered with (%s,%s)',1,$attrs,$attr);
$shadowLastChange = isset($attrs['shadowLastChange']) ? $attrs['shadowLastChange'] : null; $shadowLastChange = isset($attrs['shadowLastChange']) ? $attrs['shadowLastChange'][0] : null;
$shadowMax = isset($attrs['shadowMax']) ? $attrs['shadowMax'] : null; $shadowMax = isset($attrs['shadowMax']) ? $attrs['shadowMax'][0] : null;
if( 0 == strcasecmp( $attr, 'shadowLastChange' ) && $shadowLastChange) if( 0 == strcasecmp( $attr, 'shadowLastChange' ) && $shadowLastChange)
$shadow_date = $shadowLastChange; $shadow_date = $shadowLastChange;
@ -2538,20 +2501,6 @@ function binSIDtoText($binsid) {
return $result; return $result;
} }
if (! function_exists('session_cache_expire')) {
/**
* session_cache_expire is a php 4.2.0 function, we'll emulate it if we are using php <4.2.0
*/
function session_cache_expire() {
if (defined('DEBUG_ENABLED') && (DEBUG_ENABLED))
debug_log('session_cache_expire(): Entered with ()',1);
return 180;
}
}
/** /**
* Sort a multi dimensional array. * Sort a multi dimensional array.
* @param array $data Multi demension array passed by reference * @param array $data Multi demension array passed by reference
@ -2710,7 +2659,7 @@ function password_generate() {
$leftover = array_merge($leftover,$llower,$lupper,$numbers,$punc); $leftover = array_merge($leftover,$llower,$lupper,$numbers,$punc);
shuffle($leftover); shuffle($leftover);
$outarray = array_merge($outarray, a_array_rand($leftover,$length-$num_spec)); $outarray = array_merge($outarray, a_array_rand($leftover, $criteria['num'] - $num_spec));
} }
shuffle($outarray); shuffle($outarray);
@ -2834,7 +2783,7 @@ function draw_date_selector_link( $attr ) {
$href = "javascript:dateSelector('$attr');"; $href = "javascript:dateSelector('$attr');";
$title = _('Click to popup a dialog to select a date graphically'); $title = _('Click to popup a dialog to select a date graphically');
printf('<a href="%s" title="%s"><img class="chooser" src="images/calendar.png" id="f_trigger_%s" style="cursor: pointer;" alt="Calendar" /></a>',$href,$title,$attr); printf('<a href="%s" title="%s"><img class="chooser" src="images/calendar.png" id="f_trigger_%s" style="cursor: pointer;" /></a>',$href,$title,$attr);
} }
function no_expire_header() { function no_expire_header() {
@ -2844,14 +2793,4 @@ function no_expire_header() {
header('Cache-Control: post-check=0, pre-check=0', false); header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); header('Pragma: no-cache');
} }
/**
* 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
*/
function random_junk() {
$time = gettimeofday();
return md5(strtotime('now').$time['usec']);
}
?> ?>

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/hooks.php,v 1.6.4.2 2007/01/27 13:53:20 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/hooks.php,v 1.7 2006/02/25 13:12:05 wurley Exp $
/** /**
* Functions related to hooks management. * Functions related to hooks management.
@ -171,13 +171,13 @@ function clear_hooks ( $hook_name ) {
} }
/* Evaluating user-made hooks */ /* Evaluating user-made hooks */
if (is_dir(HOOKSDIR)) { if ( is_dir(HOOKSDIR) ) {
$dir = dir(HOOKSDIR); $dir = dir (HOOKSDIR);
while (false !== ($entry = $dir->read())) { while (false !== ($entry = $dir -> read() ) ) {
$filename = sprintf('%s/%s',HOOKSDIR,$entry); if ( is_file ("hooks/$entry") and eregi ('php[0-9]?$', $entry) ) {
if (is_file($filename) and eregi('php[0-9]?$',$entry)) require_once "hooks/$entry";
require_once "hooks/$entry"; }
} }
$dir -> close(); $dir -> close();

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/ldif_functions.php,v 1.27.2.3 2005/12/10 08:25:32 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/ldif_functions.php,v 1.28 2005/12/10 10:34:55 wurley Exp $
/** /**
* @todo put the display_parse_error method in ldif_import here * @todo put the display_parse_error method in ldif_import here

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/schema_functions.php,v 1.88.2.6 2006/03/08 08:22:56 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/schema_functions.php,v 1.90 2006/01/03 20:39:59 wurley Exp $
/** /**
* Classes and functions for fetching and parsing schema from an LDAP server. * Classes and functions for fetching and parsing schema from an LDAP server.
@ -145,7 +145,6 @@ class ObjectClass extends SchemaItem {
/** /**
* Creates a new ObjectClass object given a raw LDAP objectClass string. * Creates a new ObjectClass object given a raw LDAP objectClass string.
* @todo: Unfortunately, some schemas are not well defined - eg: dNSDomain. Where the schema definition is not case consistent with the attribute definitions. This causes us some problems, which we need to resolve.
*/ */
function ObjectClass($raw_ldap_schema_string,$ldapserver) { function ObjectClass($raw_ldap_schema_string,$ldapserver) {
if (DEBUG_ENABLED) if (DEBUG_ENABLED)

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_advanced.php,v 1.23.2.3 2006/10/28 05:56:56 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_advanced.php,v 1.24 2005/12/10 10:34:55 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin
@ -87,12 +87,6 @@ if( isset( $base_dn_does_not_exist ) && $base_dn_does_not_exist )
join(', ',$config->GetValue('search','result_attributes')); ?>" /> join(', ',$config->GetValue('search','result_attributes')); ?>" />
</tr> </tr>
<tr>
<td><small><acronym title="<?php echo htmlspecialchars(_('Order by').'...'); ?>">
<?php echo _('Order by'); ?></acronym></small></td>
<td><input type="text" name="orderby" id="orderby" style="width: 200px" value="<?php echo $filter ? htmlspecialchars($orderby) : ''; ?>" /></td>
</tr>
<tr> <tr>
<td colspan="2"><br /><center><input type="submit" value="<?php echo _('Search'); ?>" /></center></td> <td colspan="2"><br /><center><input type="submit" value="<?php echo _('Search'); ?>" /></center></td>
</tr> </tr>

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_predefined.php,v 1.8.4.2 2005/12/08 12:06:58 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_predefined.php,v 1.9 2005/12/10 10:34:55 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_simple.php,v 1.14.4.4 2005/12/09 14:31:27 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_simple.php,v 1.15 2005/12/10 10:34:55 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_list.php,v 1.5.4.4 2005/12/09 14:31:27 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_list.php,v 1.6 2005/12/10 10:34:55 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_table.php,v 1.7.4.5 2005/12/09 14:31:27 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_table.php,v 1.8 2005/12/10 10:34:55 wurley Exp $
/** /**
* Incoming variables (among others) * Incoming variables (among others)

View File

@ -1,5 +1,5 @@
<?php <?php
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/server_functions.php,v 1.34.2.33 2008/11/28 14:21:37 wurley Exp $ */ /* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/server_functions.php,v 1.44 2006/02/25 14:04:12 wurley Exp $ */
/** /**
* Classes and functions for LDAP server configuration and capability * Classes and functions for LDAP server configuration and capability
@ -26,6 +26,16 @@ class LDAPserver {
var $login_dn; var $login_dn;
/** Server Authentication Password as defined in config.php */ /** Server Authentication Password as defined in config.php */
var $login_pass; var $login_pass;
/** SASL auth */
var $sasl_auth = false;
var $sasl_mech = "PLAIN";
var $sasl_realm = "";
var $sasl_authz_id = "";
var $sasl_authz_id_regex = null;
var $sasl_authz_id_replacement = null;
var $sasl_props = null;
/** Array of our connections to this LDAP server */ /** Array of our connections to this LDAP server */
var $connections = array(); var $connections = array();
/** Server Base Dn */ /** Server Base Dn */
@ -148,7 +158,7 @@ class LDAPserver {
# Quick return if we have already connected. # Quick return if we have already connected.
$resource = $this->_connect($connect_id); $resource = $this->_connect($connect_id);
if (is_resource($resource) && ! $reconnect) if ($resource && ! $reconnect)
return $resource; return $resource;
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
@ -204,6 +214,20 @@ class LDAPserver {
} }
} }
# SASL auth
if ($this->sasl_auth) {
$this->connections[$connect_id]['sasl_auth'] = true;
$this->connections[$connect_id]['sasl_mech'] = $this->sasl_mech;
$this->connections[$connect_id]['sasl_realm'] = $this->sasl_realm;
$this->connections[$connect_id]['sasl_authz_id'] = $this->sasl_authz_id;
$this->connections[$connect_id]['sasl_authz_id_regex'] = $this->sasl_authz_id_regex;
$this->connections[$connect_id]['sasl_authz_id_replacement'] = $this->sasl_authz_id_replacement;
$this->connections[$connect_id]['sasl_props'] = $this->sasl_props;
} else {
$this->connections[$connect_id]['sasl_auth'] = false;
}
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('%s::connect(): Config settings, DN [%s], PASS [%s]',80, debug_log('%s::connect(): Config settings, DN [%s], PASS [%s]',80,
get_class($this),$this->connections[$connect_id]['login_dn'], get_class($this),$this->connections[$connect_id]['login_dn'],
@ -219,7 +243,7 @@ class LDAPserver {
# Now that we have worked out the connect_id, lets just check and see if we have already connected. # Now that we have worked out the connect_id, lets just check and see if we have already connected.
$resource = $this->_connect($connect_id); $resource = $this->_connect($connect_id);
if (is_resource($resource) && ! $reconnect) if ($resource && ! $reconnect)
return $resource; return $resource;
run_hook('pre_connect',array('server_id'=>$this->server_id,'connect_id'=>$connect_id)); run_hook('pre_connect',array('server_id'=>$this->server_id,'connect_id'=>$connect_id));
@ -247,8 +271,68 @@ class LDAPserver {
@ldap_start_tls($resource) or pla_error(_('Could not start TLS. Please check your LDAP server configuration.'),ldap_error($resource)); @ldap_start_tls($resource) or pla_error(_('Could not start TLS. Please check your LDAP server configuration.'),ldap_error($resource));
} }
$bind_result = @ldap_bind($resource,$this->connections[$connect_id]['login_dn'], $bind_result = false;
$this->connections[$connect_id]['login_pass']);
/**
* Implementation of SASL ldap_bind()
* This option requires PHP 5.x compiled with --with-ldap-sasl=DIR
*/
if (isset($this->connections[$connect_id]['sasl_auth']) && # admin marked this server to use SASL auth
$this->connections[$connect_id]['sasl_auth'] == true) {
# No support for ldap_sasl_bind?
if (! function_exists('ldap_sasl_bind'))
pla_error(_('Your PHP installation does not support ldap_sasl_bind() function. This function is present in PHP 5.x when compiled with --with-ldap-sasl.'));
# Fill variables
$props = $this->connections[$connect_id]['sasl_props'];
$mech = $this->connections[$connect_id]['sasl_mech'];
$realm = $this->connections[$connect_id]['sasl_realm'];
$authz_id = null;
if (DEBUG_ENABLED)
debug_log('%s::connect(): Resource [%s], Using SASL bind method. Bind DN [%s]',9,
get_class($this),$resource,$this->connections[$connect_id]['login_dn']);
# do we need to rewrite authz_id?
if (isset($this->connections[$connect_id]['sasl_authz_id']) &&
strlen($this->connections[$connect_id]['sasl_authz_id']) > 0)
$authz_id = $this->connections[$connect_id]['sasl_authz_id'];
else {
# ok, here we go
if (DEBUG_ENABLED)
debug_log('%s::connect(): Resource [%s], Rewriting bind DN [%s] -> authz_id with regex [%s] and replacement [%s].',9,
get_class($this),$resource,$this->connections[$connect_id]['login_dn'],
$this->connections[$connect_id]['sasl_authz_id_regex'],
$this->connections[$connect_id]['sasl_authz_id_replacement']);
$authz_id = @preg_replace($this->connections[$connect_id]['sasl_authz_id_regex'],
$this->connections[$connect_id]['sasl_authz_id_replacement'],
$this->connections[$connect_id]['login_dn']);
# invalid regex?
if (is_null($authz_id)) {
pla_error(sprintf(_('It seems that sasl_authz_id_regex "%s"." contains invalid PCRE regular expression.'),
$this->connections[$connect_id]['sasl_authz_id_regex']).
((isset($php_errormsg)) ? ' Error message: '.$php_errormsg : ''));
}
}
if (DEBUG_ENABLED)
debug_log('%s::connect(): Resource [%s], SASL OPTIONS: mech [%s], realm [%s], authz_id [%s], props [%s]',9,
get_class($this),$resource,$mech,$realm,$authz_id,$props);
$bind_result = @ldap_sasl_bind($resource,
$this->connections[$connect_id]['login_dn'],$this->connections[$connect_id]['login_pass'],
$mech,$realm,$authz_id,$props);
} else {
$bind_result = @ldap_bind($resource,$this->connections[$connect_id]['login_dn'],
$this->connections[$connect_id]['login_pass']);
}
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('%s::connect(): Resource [%s], Bind Result [%s]',16,get_class($this),$resource,$bind_result); debug_log('%s::connect(): Resource [%s], Bind Result [%s]',16,get_class($this),$resource,$bind_result);
@ -335,8 +419,7 @@ class LDAPserver {
debug_log('%s::getBaseDN(): Connect to LDAP to find BaseDN',80,get_class($this)); debug_log('%s::getBaseDN(): Connect to LDAP to find BaseDN',80,get_class($this));
if ($this->connect()) { if ($this->connect()) {
$r = $this->search(null,'','objectClass=*',array('namingContexts'),'base'); $r = array_pop($this->search(null,'','objectClass=*',array('namingContexts'),'base'));
$r = array_pop($r);
if (is_array($r)) if (is_array($r))
$r = array_change_key_case($r); $r = array_change_key_case($r);
@ -1671,13 +1754,13 @@ class LDAPserver {
* @param array $attrs An array of attributes to include in the search result (example: array( "objectClass", "uid", "sn" )). * @param array $attrs An array of attributes to include in the search result (example: array( "objectClass", "uid", "sn" )).
* @param string $scope The LDAP search scope. Must be one of "base", "one", or "sub". Standard LDAP search scope. * @param string $scope The LDAP search scope. Must be one of "base", "one", or "sub". Standard LDAP search scope.
* @param bool $sort_results Specify false to not sort results by DN or true to have the * @param bool $sort_results Specify false to not sort results by DN or true to have the
* returned array sorted by DN (uses ksort) * returned array sorted by DN (uses ksort)
* @param int $deref When handling aliases or referrals, this specifies whether to follow referrals. Must be one of * @param int $deref When handling aliases or referrals, this specifies whether to follow referrals. Must be one of
* LDAP_DEREF_ALWAYS, LDAP_DEREF_NEVER, LDAP_DEREF_SEARCHING, or LDAP_DEREF_FINDING. See the PHP LDAP API for details. * LDAP_DEREF_ALWAYS, LDAP_DEREF_NEVER, LDAP_DEREF_SEARCHING, or LDAP_DEREF_FINDING. See the PHP LDAP API for details.
* @param int $size_limit Size limit for search * @param int $size_limit Size limit for search
* @todo: Add entries to tree cache. * @todo: Add entries to tree cache.
*/ */
function search($resource=null,$base_dn=null,$filter,$attrs=array(),$scope='sub',$sort_results=false,$deref=LDAP_DEREF_NEVER,$size_limit=0) { function search($resource=null,$base_dn=null,$filter,$attrs=array(),$scope='sub',$sort_results=true,$deref=LDAP_DEREF_NEVER,$size_limit=0) {
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('%s::search(): Entered with (%s,%s,%s,%s,%s,%s,%s)',17, debug_log('%s::search(): Entered with (%s,%s,%s,%s,%s,%s,%s)',17,
get_class($this),is_resource($this),$base_dn,$filter,$attrs,$scope,$sort_results,$deref); get_class($this),is_resource($this),$base_dn,$filter,$attrs,$scope,$sort_results,$deref);
@ -1698,16 +1781,16 @@ class LDAPserver {
switch ($scope) { switch ($scope) {
case 'base': case 'base':
$search = @ldap_read($resource,dn_escape($base_dn),$filter,$attrs,0,$size_limit,0,$deref); $search = @ldap_read($resource,$base_dn,$filter,$attrs,0,$size_limit,0,$deref);
break; break;
case 'one': case 'one':
$search = @ldap_list($resource,dn_escape($base_dn),$filter,$attrs,0,$size_limit,0,$deref); $search = @ldap_list($resource,$base_dn,$filter,$attrs,0,$size_limit,0,$deref);
break; break;
case 'sub': case 'sub':
default: default:
$search = @ldap_search($resource,dn_escape($base_dn),$filter,$attrs,0,$size_limit,0,$deref); $search = @ldap_search($resource,$base_dn,$filter,$attrs,0,$size_limit,0,$deref);
break; break;
} }
@ -1720,10 +1803,6 @@ class LDAPserver {
$return = array(); $return = array();
if ($sort_results && is_array($return))
if (version_compare(phpversion(),'4.2.0','>='))
ldap_sort($resource, $search,$sort_results);
# Get the first entry identifier # Get the first entry identifier
if ($entry_id = ldap_first_entry($resource,$search)) if ($entry_id = ldap_first_entry($resource,$search))
@ -1763,6 +1842,8 @@ class LDAPserver {
} # End while entry_id } # End while entry_id
if ($sort_results && is_array($return))
ksort($return);
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('%s::search(): Returning (%s)',17,get_class($this),$return); debug_log('%s::search(): Returning (%s)',17,get_class($this),$return);
@ -2253,7 +2334,7 @@ class LDAPserver {
*/ */
function getLoggedInPass() { function getLoggedInPass() {
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('%s::getLoggedInPass(): Entered with ()',17,get_class($this)); debug_log('%s:getLoggedInPass(): Entered with ()',17,get_class($this));
if (! $this->auth_type) if (! $this->auth_type)
return false; return false;
@ -2306,9 +2387,6 @@ class LDAPserver {
# Set default return # Set default return
$return = false; $return = false;
if (DEBUG_ENABLED)
debug_log('%s::getLoggedInDN(): auth_type is [%s]',66,get_class($this),$this->auth_type);
if ($this->auth_type) { if ($this->auth_type) {
switch ($this->auth_type) { switch ($this->auth_type) {
case 'cookie': case 'cookie':
@ -2341,7 +2419,7 @@ class LDAPserver {
} }
if (DEBUG_ENABLED) if (DEBUG_ENABLED)
debug_log('%s::getLoggedInDN(): Entered with (), Returning (%s)',17,get_class($this),$return); debug_log('%s:getLoggedInDN(): Entered with (), Returning (%s)',17,get_class($this),$return);
return $return; return $return;
} }
@ -2443,8 +2521,7 @@ class LDAPserver {
debug_log('%s:getDNAttrs(): Entered with (%s,%s,%s)',17, debug_log('%s:getDNAttrs(): Entered with (%s,%s,%s)',17,
get_class($this),$dn,$lower_case_attr_names,$deref); get_class($this),$dn,$lower_case_attr_names,$deref);
$attrs = $this->search(null,dn_escape($dn),'(objectClass=*)',array(),'base',false,$deref); $attrs = array_pop($this->search(null,dn_escape($dn),'(objectClass=*)',array(),'base',false,$deref));
$attrs = array_pop($attrs);
if (is_array($attrs)) { if (is_array($attrs)) {
if ($lower_case_attr_names) if ($lower_case_attr_names)
@ -2944,6 +3021,40 @@ class LDAPservers {
'desc'=>'Path to custom pages', 'desc'=>'Path to custom pages',
'default'=>null); 'default'=>null);
$this->default->server['sasl_auth'] = array(
'desc' => 'Use SASL authentication when binding LDAP server',
'var' => 'sasl_auth',
'default' => false);
$this->default->server['sasl_mech'] = array(
'desc' => 'SASL mechanism used while binding LDAP server',
'var' => 'sasl_mech',
'default' => 'PLAIN');
$this->default->server['sasl_realm'] = array(
'desc' => 'SASL realm name',
'var' => 'sasl_realm',
'default' => '');
$this->default->server['sasl_authz_id'] = array(
'desc' => 'SASL authorization id',
'var' => 'sasl_authz_id',
'default' => '');
$this->default->server['sasl_authz_id_regex'] = array(
'desc' => 'SASL authorization id PCRE regular expression',
'var' => 'sasl_authz_id_regex',
'default' => null);
$this->default->server['sasl_authz_id_replacement'] = array(
'desc' => 'SASL authorization id PCRE regular expression replacement string',
'var' => 'sasl_authz_id_replacement',
'default' => null);
$this->default->server['sasl_props'] = array(
'desc' => 'SASL properties',
'var' => 'sasl_props',
'default' => null);
} }
function SetValue($server_id,$key,$index,$value) { function SetValue($server_id,$key,$index,$value) {

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/session_functions.php,v 1.16.2.1 2005/12/31 03:06:15 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/session_functions.php,v 1.17 2006/01/03 20:39:59 wurley Exp $
/** /**
* A collection of functions to handle sessions throughout phpLDAPadmin. * A collection of functions to handle sessions throughout phpLDAPadmin.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/syslog.php,v 1.11.4.1 2005/12/09 14:32:13 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/syslog.php,v 1.12 2005/12/10 10:34:55 wurley Exp $
/** /**
* Functions related to syslog logging. * Functions related to syslog logging.

View File

@ -1,5 +1,5 @@
<?php <?php
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/template_functions.php,v 1.29.2.20 2007/03/21 23:12:03 wurley Exp $ */ /* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/template_functions.php,v 1.34 2006/02/25 12:47:57 wurley Exp $ */
/** /**
* Classes and functions for the template engine.ation and capability * Classes and functions for the template engine.ation and capability
@ -464,7 +464,7 @@ class Templates {
U: Make the result upper case. U: Make the result upper case.
*/ */
case 'autoFill' : case 'autoFill' :
list($attr,$string) = preg_split('(([^,]+),(.*))',$arg,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); list($attr,$string) = split(',',$arg);
preg_match_all('/%(\w+)(\|[0-9]*-[0-9]*)?(\/[klTU]+)?%/U',$string,$matchall); preg_match_all('/%(\w+)(\|[0-9]*-[0-9]*)?(\/[klTU]+)?%/U',$string,$matchall);
//print"<PRE>";print_r($matchall); //0 = highlevel match, 1 = attr, 2 = subst, 3 = mod //print"<PRE>";print_r($matchall); //0 = highlevel match, 1 = attr, 2 = subst, 3 = mod
@ -670,7 +670,7 @@ class Templates {
else else
# @todo: Enable size and width configuration in template # @todo: Enable size and width configuration in template
$html = sprintf('<input type="text" name="%s" size="8" />',$id); $html = sprintf('<input type="text" name="%s" size="8">',$id);
} else { } else {
if (is_array($helper)) { if (is_array($helper)) {

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/timeout_functions.php,v 1.6.2.5 2005/12/31 03:06:15 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/timeout_functions.php,v 1.9 2006/01/03 20:39:59 wurley Exp $
/** /**
* A collection of functions used throughout phpLDAPadmin for the timeout and automatic logout feature * A collection of functions used throughout phpLDAPadmin for the timeout and automatic logout feature

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/Attic/tree_functions.php,v 1.20.2.23 2007/03/18 03:21:18 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/tree_functions.php,v 1.23 2006/01/03 20:39:59 wurley Exp $
/** /**
* @package phpLDAPadmin * @package phpLDAPadmin
@ -39,13 +39,13 @@ function draw_server_tree() {
echo '<tr class="server">'; echo '<tr class="server">';
printf('<td class="icon"><img src="images/server.png" alt="%s" /></td>',_('Server')); printf('<td class="icon"><img src="images/server.png" alt="%s" /></td>',_('Server'));
printf('<td colspan="99"><a name="%s"></a>',$ldapserver->server_id); printf('<td colspan="99"><a name="%s"></a>',$ldapserver->server_id);
printf('<span style="white-space: nowrap;">%s ',htmlspecialchars($ldapserver->name)); printf('<nobr>%s ',htmlspecialchars($ldapserver->name));
if ($ldapserver->haveAuthInfo() && $ldapserver->auth_type != 'config') if ($ldapserver->haveAuthInfo() && $ldapserver->auth_type != 'config')
printf('<acronym title="%s"><img width=14 height=14 src="images/timeout.png" alt="timeout" /></acronym>', printf('<acronym title="%s"><img width=14 height=14 src="images/timeout.png" alt="timeout" /></acronym>',
sprintf(_('Inactivity will log you off at %s'),strftime('%H:%M',time()+($ldapserver->session_timeout*60)))); sprintf(_('Inactivity will log you off at %s'),strftime('%H:%M',time()+($ldapserver->session_timeout*60))));
echo '</span></td></tr>'; echo '</nobr></td></tr>';
/* do we have what it takes to authenticate here, or do we need to /* do we have what it takes to authenticate here, or do we need to
present the user with a login link (for 'cookie' and 'session' auth_types)? */ present the user with a login link (for 'cookie' and 'session' auth_types)? */
@ -62,7 +62,7 @@ function draw_server_tree() {
# Draw the quick-links below the server name: # Draw the quick-links below the server name:
echo '<tr><td colspan="100" class="links">'; echo '<tr><td colspan="100" class="links">';
echo '<span style="white-space: nowrap;">'; echo '<nobr>';
echo '( '; echo '( ';
printf('<a title="%s %s" href="%s">%s</a> | ',_('View schema for'),$ldapserver->name,$schema_href,_('schema')); printf('<a title="%s %s" href="%s">%s</a> | ',_('View schema for'),$ldapserver->name,$schema_href,_('schema'));
printf('<a title="%s %s" href="%s">%s</a> | ',_('search'),$ldapserver->name,$search_href,_('search')); printf('<a title="%s %s" href="%s">%s</a> | ',_('search'),$ldapserver->name,$search_href,_('search'));
@ -74,11 +74,11 @@ function draw_server_tree() {
if ($ldapserver->auth_type != 'config') if ($ldapserver->auth_type != 'config')
printf(' | <a title="%s" href="%s" target="right_frame">%s</a>',_('Logout of this server'),$logout_href,_('logout')); printf(' | <a title="%s" href="%s" target="right_frame">%s</a>',_('Logout of this server'),$logout_href,_('logout'));
echo ' )</span></td></tr>'; echo ' )</nobr></td></tr>';
if ($ldapserver->auth_type != 'config') { if ($ldapserver->auth_type != 'config') {
$logged_in_dn = $ldapserver->getLoggedInDN(); $logged_in_dn = $ldapserver->getLoggedInDN();
echo '<tr><td class="links" colspan="100"><span style="white-space: nowrap;">'._('Logged in as: '); echo '<tr><td class="links" colspan="100"><nobr>'._('Logged in as: ');
if ($ldapserver->getDNBase($logged_in_dn) == $logged_in_dn) { if ($ldapserver->getDNBase($logged_in_dn) == $logged_in_dn) {
$logged_in_branch = ''; $logged_in_branch = '';
@ -86,12 +86,10 @@ function draw_server_tree() {
} else { } else {
$logged_in_branch = preg_replace('/,'.$ldapserver->getDNBase($logged_in_dn).'$/','',$logged_in_dn); $logged_in_branch = preg_replace('/,'.$ldapserver->getDNBase($logged_in_dn).'$/','',$logged_in_dn);
$logged_in_dn_array = pla_explode_dn($logged_in_branch); $logged_in_dn_array = explode(',',$logged_in_branch);
} }
$bases = $ldapserver->getDNBase($logged_in_dn); $logged_in_dn_array[] = $ldapserver->getDNBase($logged_in_dn);
if (is_array($bases) && count($bases))
$logged_in_dn_array[] = $bases;
$rdn = $logged_in_dn; $rdn = $logged_in_dn;
@ -110,11 +108,11 @@ function draw_server_tree() {
} else } else
echo 'Anonymous'; echo 'Anonymous';
echo '</span></td></tr>'; echo '</nobr></td></tr>';
} }
if ($ldapserver->isReadOnly()) if ($ldapserver->isReadOnly())
printf('<tr><td class="links" colspan="100"><span style="white-space: nowrap;">(%s)</span></td></tr>',_('read only')); printf('<tr><td class="links" colspan="100"><nobr>(%s)</nobr></td></tr>',_('read only'));
$javascript_forms = ''; $javascript_forms = '';
$javascript_id = 0; $javascript_id = 0;
@ -192,6 +190,9 @@ function draw_server_tree() {
$icon = isset($tree['browser'][$base_dn]['icon']) ? $tree['browser'][$base_dn]['icon'] : get_icon($ldapserver,$base_dn); $icon = isset($tree['browser'][$base_dn]['icon']) ? $tree['browser'][$base_dn]['icon'] : get_icon($ldapserver,$base_dn);
# Shall we draw the "mass-delete" checkbox?
if ($ldapserver->isMassDeleteEnabled())
printf('<td><input type="checkbox" name="mass_delete[%s]" /></td>',htmlspecialchars($base_dn));
if ($config->GetValue('appearance','tree_plm')) { if ($config->GetValue('appearance','tree_plm')) {
$tree_plm .= sprintf(".|%s|%s|%s|%s|%s|%s\n", $tree_plm .= sprintf(".|%s|%s|%s|%s|%s|%s\n",
@ -199,19 +200,14 @@ function draw_server_tree() {
} else { } else {
echo '<tr>'; echo '<tr>';
# Shall we draw the "mass-delete" checkbox?
if ($ldapserver->isMassDeleteEnabled())
printf('<td><input type="checkbox" name="mass_delete[%s]" /></td>',htmlspecialchars($base_dn));
printf('<td class="expander"><a href="%s"><img src="%s" alt="%s" /></a></td>',$expand_href,$expand_img,$expand_alt); printf('<td class="expander"><a href="%s"><img src="%s" alt="%s" /></a></td>',$expand_href,$expand_img,$expand_alt);
printf('<td class="icon"><a href="%s" target="right_frame"><img src="images/%s" alt="img" /></a></td>',$edit_href,$icon); printf('<td class="icon"><a href="%s" target="right_frame"><img src="images/%s" alt="img" /></a></td>',$edit_href,$icon);
printf('<td class="rdn" colspan="98"><span style="white-space: nowrap;"><a href="%s" target="right_frame">%s</a>',$edit_href,pretty_print_dn($base_dn)); printf('<td class="rdn" colspan="98"><nobr><a href="%s" target="right_frame">%s</a>',$edit_href,pretty_print_dn($base_dn));
if ($child_count) if ($child_count)
printf(' <span class="count">(%s)</span>',$child_count); printf(' <span class="count">(%s)</span>',$child_count);
echo '</span></td>'; echo '</nobr></td>';
echo '</tr>'; echo '</tr>';
} }
@ -336,9 +332,9 @@ function draw_tree_html($dn,$ldapserver,$level=0) {
$child_count = number_format(count($tree['browser'][$dn]['children'])); $child_count = number_format(count($tree['browser'][$dn]['children']));
if ((! $child_count) && (! $ldapserver->isShowCreateEnabled())) if ((! $child_count) && (! $ldapserver->isShowCreateEnabled()))
echo '<td class="expander"><span style="white-space: nowrap;"><img src="images/minus.png" alt="-" /></span></td>'; echo '<td class="expander"><nobr><img src="images/minus.png" alt="-" /></nobr></td>';
else else
printf('<td class="expander"><span style="white-space: nowrap;"><a href="%s"><img src="images/minus.png" alt="-" /></a></span></td>',$collapse_href); printf('<td class="expander"><nobr><a href="%s"><img src="images/minus.png" alt="-" /></a></nobr></td>',$collapse_href);
} else { } else {
$size_limit = $config->GetValue('search','size_limit'); $size_limit = $config->GetValue('search','size_limit');
@ -354,21 +350,21 @@ function draw_tree_html($dn,$ldapserver,$level=0) {
} }
if ((! $child_count) && (! $ldapserver->isShowCreateEnabled())) if ((! $child_count) && (! $ldapserver->isShowCreateEnabled()))
echo '<td class="expander"><span style="white-space: nowrap;"><img src="images/minus.png" alt="-" /></span></td>'; echo '<td class="expander"><nobr><img src="images/minus.png" alt="-" /></nobr></td>';
else else
printf('<td class="expander"><span style="white-space: nowrap;"><a href="%s"><img src="images/plus.png" alt="+" /></a></span></td>',$expand_href); printf('<td class="expander"><nobr><a href="%s"><img src="images/plus.png" alt="+" /></a></nobr></td>',$expand_href);
} }
printf('<td class="icon"><a href="%s" target="right_frame" name="%s_%s"><img src="%s" alt="img" /></a></td>', printf('<td class="icon"><a href="%s" target="right_frame" name="%s_%s"><img src="%s" alt="img" /></a></td>',
$edit_href,$ldapserver->server_id,$encoded_dn,$img_src); $edit_href,$ldapserver->server_id,$encoded_dn,$img_src);
printf('<td class="rdn" colspan="%s"><span style="white-space: nowrap;">',97-$level); printf('<td class="rdn" colspan="%s"><nobr>',97-$level);
printf('<a href="%s" target="right_frame">%s</a>',$edit_href,draw_formatted_dn($ldapserver,$dn)); printf('<a href="%s" target="right_frame">%s</a>',$edit_href,draw_formatted_dn($ldapserver,$dn));
if ($child_count) if ($child_count)
printf(' <span class="count">(%s)</span>',$child_count); printf(' <span class="count">(%s)</span>',$child_count);
echo '</span></td></tr>'; echo '</nobr></td></tr>';
if (isset($tree['browser'][$dn]['open']) && $tree['browser'][$dn]['open']) { if (isset($tree['browser'][$dn]['open']) && $tree['browser'][$dn]['open']) {
/* Draw the "create new" link at the top of the tree list if there are more than 10 /* Draw the "create new" link at the top of the tree list if there are more than 10

View File

@ -1,4 +1,4 @@
# : $Id: messages.po,v 1.1.2.2 2005/12/20 19:32:52 wurley Exp $ # : $Id: messages.po,v 1.3 2006/01/03 20:39:59 wurley Exp $
# #
# Tadashi Jokagi <elf2000@users.sourceforge.net>, 2004. # Tadashi Jokagi <elf2000@users.sourceforge.net>, 2004.
# Tadashi Jokagi <elf2000@users.sourceforge.net>, 2005. # Tadashi Jokagi <elf2000@users.sourceforge.net>, 2005.

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/custom.php,v 1.43.2.6 2006/03/01 01:04:05 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/custom.php,v 1.45 2005/12/17 00:00:12 wurley Exp $
$rdn = isset($_POST['rdn']) ? $_POST['rdn'] : null; $rdn = isset($_POST['rdn']) ? $_POST['rdn'] : null;
$container = $_POST['container']; $container = $_POST['container'];
@ -146,10 +146,8 @@ if ($step == 1) {
# is there a user-friendly translation available for this attribute? # is there a user-friendly translation available for this attribute?
if (isset($friendly_attrs[strtolower($attr)])) if (isset($friendly_attrs[strtolower($attr)]))
$attr_display = sprintf('<acronym title="%s: \'%s\' %s \'%s\'">%s</acronym>', $attr_display = sprintf('<acronym title='._('Note: \'%s\' is an alias for \'%s\'').'">%s</acronym>"',
_('Note'),htmlspecialchars($attr),_('is an alias for'), htmlspecialchars($attr),htmlspecialchars($friendly_attrs[strtolower($attr)]));
htmlspecialchars($friendly_attrs[strtolower($attr)]),
htmlspecialchars($friendly_attrs[strtolower($attr)]));
else else
$attr_display = htmlspecialchars($attr); $attr_display = htmlspecialchars($attr);

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/Attic/template_header.php,v 1.6.4.7 2007/03/18 03:23:26 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/template_header.php,v 1.7 2005/12/10 10:34:57 wurley Exp $
/** /**
* Header page for engine. * Header page for engine.
@ -9,11 +9,13 @@
include './header.php'; include './header.php';
$time = gettimeofday();
$random_junk = md5(strtotime('now').$time['usec']);
$url_base = sprintf('server_id=%s&amp;dn=%s',$ldapserver->server_id,$encoded_dn); $url_base = sprintf('server_id=%s&amp;dn=%s',$ldapserver->server_id,$encoded_dn);
$export_href_base = sprintf('export_form.php?%s&amp;scope=%s',$url_base,'base'); $export_href_base = sprintf('export_form.php?%s&amp;scope=%s',$url_base,'base');
$export_href_sub = sprintf('export_form.php?%s&amp;scope=%s',$url_base,'sub'); $export_href_sub = sprintf('export_form.php?%s&amp;scope=%s',$url_base,'sub');
$refresh_href = sprintf('template_engine.php?%s&amp;random=%s',$url_base,random_junk()); $refresh_href = sprintf('template_engine.php?%s&amp;random=%s',$url_base,$random_junk);
$copy_href = sprintf('copy_form.php?%s',$url_base); $copy_href = sprintf('copy_form.php?%s',$url_base);
$intattr_href = sprintf('template_engine.php?%s&amp;show_internal_attrs=true',$url_base); $intattr_href = sprintf('template_engine.php?%s&amp;show_internal_attrs=true',$url_base);
$delete_href = sprintf('delete_form.php?%s',$url_base); $delete_href = sprintf('delete_form.php?%s',$url_base);
@ -25,8 +27,8 @@ $addattr_href = sprintf('add_attr_form.php?%s',$url_base);
echo '<body>'; echo '<body>';
if ($dn) { if ($dn) {
$actionlayout = '<td class="icon"><img src="images/%s" alt="%s" /></td><td><a href="%s" title="%s">%s</a></td>'; $actionlayout = '<td class="icon"><img src="images/%s" /></td><td><a href="%s" title="%s">%s</a></td>';
$hintlayout = '<td class="icon"><img src="images/light.png" alt="Hint" /></td><td colspan="3"><span class="hint">%s</span></td>'; $hintlayout = '<td class="icon"><img src="images/light.png" /></td><td colspan="3"><span class="hint">%s</span></td>';
printf('<h3 class="title">%s</h3>',htmlspecialchars($rdn)); printf('<h3 class="title">%s</h3>',htmlspecialchars($rdn));
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>', printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
@ -35,24 +37,24 @@ if ($dn) {
echo "\n"; echo "\n";
echo '<table class="edit_dn_menu"><tr>'; echo '<table class="edit_dn_menu"><tr>';
printf($actionlayout,'refresh.png','Refresh',$refresh_href,_('Refresh this entry'),_('Refresh')); printf($actionlayout,'refresh.png',$refresh_href,_('Refresh this entry'),_('Refresh'));
printf($actionlayout,'save.png','Save',$export_href_base,_('Save a dump of this object'),_('Export')); printf($actionlayout,'save.png',$export_href_base,_('Save a dump of this object'),_('Export'));
echo '</tr><tr>'; echo '</tr><tr>';
printf($actionlayout,'cut.png','Cut',$copy_href,_('Copy this object to another location, a new DN, or another server'),_('Copy or move this entry')); printf($actionlayout,'cut.png',$copy_href,_('Copy this object to another location, a new DN, or another server'),_('Copy or move this entry'));
if ($show_internal_attrs) if ($show_internal_attrs)
printf($actionlayout,'tools-no.png','Hide',$refresh_href,'',_('Hide internal attributes')); printf($actionlayout,'tools-no.png',$refresh_href,'',_('Hide internal attributes'));
else else
printf($actionlayout,'tools.png','Show',$intattr_href,'',_('Show internal attributes')); printf($actionlayout,'tools.png',$intattr_href,'',_('Show internal attributes'));
echo '</tr>'; echo '</tr>';
if (! $ldapserver->isReadOnly()) { if (! $ldapserver->isReadOnly()) {
echo '<tr>'; echo '<tr>';
printf($actionlayout,'trash.png','Trash',$delete_href,_('You will be prompted to confirm this decision'),_('Delete this entry')); printf($actionlayout,'trash.png',$delete_href,_('You will be prompted to confirm this decision'),_('Delete this entry'));
printf($actionlayout,'rename.png','Rename',$rename_href,'',_('Rename')); printf($actionlayout,'rename.png',$rename_href,'',_('Rename'));
echo '</tr>'; echo '</tr>';
if ($config->GetValue('appearance','show_hints')) { if ($config->GetValue('appearance','show_hints')) {
@ -62,12 +64,12 @@ if ($dn) {
} }
echo '<tr>'; echo '<tr>';
printf($actionlayout,'compare.png','Compare',$compare_href,'',_('Compare with another entry')); printf($actionlayout,'compare.png',$compare_href,'',_('Compare with another entry'));
echo '</tr>'; echo '</tr>';
echo '<tr>'; echo '<tr>';
printf($actionlayout,'star.png','Create',$create_href,'',_('Create a child entry')); printf($actionlayout,'star.png',$create_href,'',_('Create a child entry'));
printf($actionlayout,'add.png','Add',$addattr_href,'',_('Add new attribute')); printf($actionlayout,'add.png',$addattr_href,'',_('Add new attribute'));
echo '</tr>'; echo '</tr>';
} }
@ -82,8 +84,8 @@ if ($dn) {
$ldapserver->server_id,rawurlencode('objectClass=*'),$encoded_dn); $ldapserver->server_id,rawurlencode('objectClass=*'),$encoded_dn);
echo '<tr>'; echo '<tr>';
printf($actionlayout,'children.png','Children',$child_href,'',($children_count == 1) ? _('View 1 child') : sprintf(_('View %s children'),$children_count)); printf($actionlayout,'children.png',$child_href,'',($children_count == 1) ? _('View 1 child') : sprintf(_('View %s children'),$children_count));
printf($actionlayout,'save.png','Save',$export_href_sub,_('Save a dump of this object and all of its children'),_('Export subtree')); printf($actionlayout,'save.png',$export_href_sub,_('Save a dump of this object and all of its children'),_('Export subtree'));
echo '</tr>'; echo '</tr>';
} }
@ -114,7 +116,7 @@ if ($dn) {
if (! $ldapserver->isReadOnly()) { if (! $ldapserver->isReadOnly()) {
echo '<form action="update_confirm.php" method="post" name="edit_form">'; echo '<form action="update_confirm.php" method="post" name="edit_form">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id); printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn)); printf('<input type="hidden" name="dn" value="%s" />',$dn);
} }
echo '<br />'."\n\n"; echo '<br />'."\n\n";
@ -128,7 +130,7 @@ if ($dn) {
$schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s', $schema_href = sprintf('schema.php?server_id=%s&amp;view=attributes&amp;viewvalue=%s',
$ldapserver->server_id,real_attr_name($attr)); $ldapserver->server_id,real_attr_name($attr));
printf('<tr><td colspan="2" class="attr"><b><a title="'._('Click to view the schema definition for attribute type \'%s\'').'" href="%s" />%s</b></td></tr>', printf('<tr><td colspan="2" class="attr"><b><a title="'._('Click to view the schema defintion for attribute type \'%s\'').'" href="%s" />%s</b></td></tr>',
$attr,$schema_href,htmlspecialchars($attr)); $attr,$schema_href,htmlspecialchars($attr));
echo '<tr><td class="val"><small>'; echo '<tr><td class="val"><small>';

View File

@ -6,4 +6,4 @@
# This script is run after make_po to merge the existing German translations to messages.po # This script is run after make_po to merge the existing German translations to messages.po
./make_po ./make_po
msgmerge -v ../../locale/ca_ES/LC_MESSAGES/messages.po messages.po -o messages.po msgmerge -v ../locale/ca_ES/LC_MESSAGES/messages.po messages.po -o messages.po

View File

@ -6,4 +6,4 @@
# This script is run after make_po to merge the existing German translations to messages.po # This script is run after make_po to merge the existing German translations to messages.po
./make_po ./make_po
msgmerge -v ../../locale/de_DE/LC_MESSAGES/messages.po messages.po -o messages.po msgmerge -v ../locale/de_DE/LC_MESSAGES/messages.po messages.po -o messages.po

View File

@ -6,4 +6,4 @@
# This script is run to update the existing Spanish translations in messages.po # This script is run to update the existing Spanish translations in messages.po
./make_po ./make_po
msgmerge -v ../../locale/es_ES/LC_MESSAGES/messages.po messages.po -o messages.po msgmerge -v ../locale/es_ES/LC_MESSAGES/messages.po messages.po -o messages.po

View File

@ -6,4 +6,4 @@
# This script is run after make_po to merge the existing German translations to messages.po # This script is run after make_po to merge the existing German translations to messages.po
./make_po ./make_po
msgmerge -v ../../locale/fr_FR/LC_MESSAGES/messages.po messages.po -o messages.po msgmerge -v ../locale/fr_FR/LC_MESSAGES/messages.po messages.po -o messages.po

View File

@ -6,4 +6,4 @@
# This script is run after make_po to merge the existing Hungarian translations to messages.po # This script is run after make_po to merge the existing Hungarian translations to messages.po
./make_po ./make_po
msgmerge -v ../../locale/hu_HU/LC_MESSAGES/messages.po messages.po -o messages.po msgmerge -v ../locale/hu_HU/LC_MESSAGES/messages.po messages.po -o messages.po

View File

@ -6,4 +6,4 @@
# This script is run after make_po to merge the existing German translations to messages.po # This script is run after make_po to merge the existing German translations to messages.po
./make_po ./make_po
msgmerge -v ../../locale/it_IT/LC_MESSAGES/messages.po messages.po -o messages.po msgmerge -v ../locale/it_IT/LC_MESSAGES/messages.po messages.po -o messages.po

View File

@ -6,4 +6,4 @@
# This script is run after make_po to merge the existing Japanese translations to messages.po # This script is run after make_po to merge the existing Japanese translations to messages.po
./make_po ./make_po
msgmerge -v ../../locale/ja_JP/LC_MESSAGES/messages.po messages.po -o messages.po msgmerge -v ../locale/ja_JP/LC_MESSAGES/messages.po messages.po -o messages.po

View File

@ -3,7 +3,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: phpldapadmin $Name: RELEASE-0_9_8_1 $\n" "Project-Id-Version: phpldapadmin $Name: RELEASE-1_0_0 $\n"
"Report-Msgid-Bugs-To: phpldapadmin-devel@lists.sf.net\n" "Report-Msgid-Bugs-To: phpldapadmin-devel@lists.sf.net\n"
"POT-Creation-Date: 2004-01-14 17:45+0200\n" "POT-Creation-Date: 2004-01-14 17:45+0200\n"
"PO-Revision-Date: 2004-01-14 17:45+0200\n" "PO-Revision-Date: 2004-01-14 17:45+0200\n"