Compare commits

..

13 Commits

Author SHA1 Message Date
Deon George
23a33eef99 RELEASE 1.1.0.3 2009-06-30 21:48:22 +10:00
Deon George
5c88e0a098 RELEASE 1.1.0.2 2009-06-30 21:46:44 +10:00
Deon George
f990f72eb5 RELEASE 1.1.0.1 2009-06-30 20:46:41 +10:00
Deon George
dd581eb5c8 RELEASE 1.1.0 2009-06-30 20:46:00 +10:00
Deon George
a08bc4e9e1 RELEASE 1.0.2 2009-06-30 20:41:18 +10:00
Deon George
5f261ded38 RELEASE 1.0.1 2009-06-30 20:40:33 +10:00
Deon George
eccabca011 RELEASE 1.0.0 2009-06-30 20:40:03 +10:00
Deon George
c3713350e2 RELEASE 0.9.8.5 2009-06-30 20:28:51 +10:00
Deon George
c131e8b479 RELEASE 0.9.8.4 2009-06-30 20:28:19 +10:00
Deon George
a01f7c8289 RELEASE 0.9.8.3 2009-06-30 20:27:56 +10:00
Deon George
7741110caf RELEASE 0.9.8.2 2009-06-30 20:27:11 +10:00
Deon George
abc62c7fdc RELEASE 0.9.8.1 2009-06-30 20:26:45 +10:00
Deon George
fdee1bdbd1 RELEASE 0.9.8 2009-06-30 20:26:08 +10:00
327 changed files with 57036 additions and 38454 deletions

28
INSTALL
View File

@@ -1,37 +1,23 @@
For install instructions in non-English languages, see the files
in the "doc" directory.
For install instructions in non-English languages, see the wiki:
http://phpldapadmin.wiki.sourceforge.net
* Requirements
phpLDAPadmin requires the following:
a. A web server (Apache, IIS, etc).
b. PHP 4.1.0 or newer (with LDAP support)
b. PHP 5.0.0 or newer (with LDAP support)
* To install
1. Unpack the archive (if you're reading this, you already did that).
2. Put the resulting 'phpldapadmin' directory somewhere in your webroot.
3. Copy 'config.php.example' to 'config.php' and edit to taste.
3. Copy 'config.php.example' to 'config.php' and edit to taste (this is in the config/ directory).
4. Then, point your browser to the phpldapadmin directory.
* For additional help
See the files in the "doc" directory.
See the wiki:
http://phpldapadmin.wiki.sourceforge.net
Join our mailing list:
https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
* Platform specific notes
* OpenBSD with chroot'ed Apache:
For jpeg photos to work properly, you must do this:
# mkdir /var/www/tmp, and then
# chown root:daemon /var/www/tmp
# chmod 1755 /var/www/tmp
Where tmp is the $config->custom->tmpdir['jpeg'] configured in config.php
* Windows
For jpeg photos to work properly, be sure to change $config->custom->tmpdir['jpeg']
from "/tmp" to "c:\\temp" or similar.

View File

@@ -1 +1 @@
$Name: RELEASE-0_9_7_2 $
$Name: RELEASE-1_1_0_3 $

View File

@@ -1,4 +1,9 @@
<?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
*
@@ -9,8 +14,8 @@
* For example, the default for defining the language in config_default.php
*
* $this->default->appearance['lang'] = array(
* 'desc'=>'Language',
* 'default'=>'auto');
* 'desc'=>'Language',
* 'default'=>'auto');
*
* to override this, use $config->custom->appearance['lang'] = 'en';
*
@@ -22,7 +27,7 @@
*
* NOTE: Commented out values in this file prefixed by //, represent the
* defaults that have been defined in config_default.php.
* Commented out values prefixed by #, dont refelct their default value, you can
* Commented out values prefixed by #, dont reflect their default value, you can
* check config_default.php if you want to see what the default is.
*
* DONT change config_default.php, you changes will be lost by the next release
@@ -35,7 +40,7 @@
/*********************************************/
/* If you are asked to put pla in debug mode, this is how you do it: */
# $config->custom->debug['level'] = 2;
# $config->custom->debug['level'] = 255;
# $config->custom->debug['syslog'] = true;
# $config->custom->debug['file'] = '/tmp/pla_debug.log';
@@ -55,6 +60,76 @@ $config->custom->session['blowfish'] = '';
// $config->custom->jpeg['tmpdir'] = "/tmp"; // Example for Unix systems
# $config->custom->jpeg['tmpdir'] = "c:\\temp"; // Example for Windows systems
/* Set this to (bool)true if you do NOT want a random salt used when
calling crypt(). Instead, use the first two letters of the user's
password. This is insecure but unfortunately needed for some older
environments. */
# $config->custom->password['no_random_crypt_salt'] = true;
/*********************************************/
/* Commands */
/*********************************************/
/* Command availability ; if you don't authorize a command the command
links will not be shown and the command action will not be permitted.
For better security, set also ACL in your ldap directory. */
/*
$config->custom->commands['all'] = array(
'home' => true,
'external_links' => array('feature' => true,
'bug' => true,
'donation' => true,
'help' => true,
'credits' => true),
'purge' => true,
'schema' => true,
'import' => false,
'export' => true,
'search' => array('simple_search' => true,
'predefined_search' => false,
'advanced_search' => false),
'server_refresh' => false,
'server_info' => false,
'entry_refresh' => true,
'entry_move' => true,
'entry_internal_attributes_show' => true,
'entry_delete' => array('simple_delete' => true,
'mass_delete' => false),
'entry_rename' => true,
'entry_compare' => true,
'entry_create' => true,
'attribute_add' => true,
'attribute_add_value' => true,
'attribute_delete' => true,
'attribute_delete_value' => true);
*/
/*********************************************/
/* Appearance */
/*********************************************/
/* If you want to choose the appearance of the tree, specify a class name which
inherits from the Tree class. */
// $config->custom->appearance['tree'] = "AJAXTree";
# $config->custom->appearance['tree'] = "HTMLTree";
/* If you want to customise the entry view/edition, specify your factory name which
inherits from the EntryFactory class.
The 'DefaultEntryFactory' draws all the attributes of an entry according this
config file and the ldap schema definition ; the 'TemplateEntryFactory' draws
an entry according to the template whose regexp matches with the dn. */
# $config->custom->appearance['entry_factory'] = "DefaultEntryFactory";
// $config->custom->appearance['entry_factory'] = "TemplateEntryFactory";
/* If you want to customise an attribute view/edition, specify your factory name which
inherits from the AttributeFactory class.
An AttributeFactory defines which class to use to represent a given attribute */
// $config->custom->appearance['attribute_factory'] = "AttributeFactory";
/* Configure what objects are shown in left hand tree */
// $config->custom->appearance['tree_filter'] = '(objectclass=*)';
/*********************************************/
/* Define your LDAP servers in this section */
/*********************************************/
@@ -80,12 +155,14 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
auto-detect it for you. */
// $ldapservers->SetValue($i,'server','base',array(''));
/* Three options for auth_type:
/* Four options for auth_type:
1. 'cookie': you will login via a web form, and a client-side cookie will
store your login dn and password.
2. 'session': same as cookie but your login dn and password are stored on the
web server in a persistent session variable.
3. 'config': specify your login dn and password here in this config file. No
3. 'http': same as session but your login dn and password are retrieved via
HTTP authentication.
4. 'config': specify your login dn and password here in this config file. No
login will be required to use phpLDAPadmin for this server.
Choose wisely to protect your authentication information appropriately for
@@ -110,6 +187,50 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
/* Use TLS (Transport Layer Security) to connect to the LDAP server. */
// $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
recommended that you set 'low_bandwidth' to true. This will enable
phpLDAPadmin to forego some "fancy" features to conserve bandwidth. */
@@ -130,6 +251,14 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
users in. See 'login_string' directly below. */
// $ldapservers->SetValue($i,'login','attr','dn');
/* If you specified something different from 'dn', for example 'uid', as the
login_attr above, you can optionally specify here to fall back to
authentication with dn.
This is useful, when users should be able to log in with their uid, but
the ldap administrator wants to log in with his root-dn, that does not
necessarily have the uid attribute. */
// $ldapservers->SetValue($i,'login','fallback_dn',false);
/* If you specified 'cookie' or 'session' as the auth_type above, and you
specified 'string' for 'login_attr' above, you must provide a string here for
logging users in. If, for example, I have a lot of user entries with DNs like
@@ -141,7 +270,7 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
/* 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
to 'posixAccount' or 'inetOrgPerson', depending upon your setup. */
// $ldapservers->SetValue($i,'login','class','');
// $ldapservers->SetValue($i,'login','class',null);
/* Specify true If you want phpLDAPadmin to not display or permit any
modification to the LDAP server. */
@@ -164,50 +293,50 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
// $ldapservers->SetValue($i,'auto_number','mechanism','search');
/* 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
(only when 'search' is used for auto_uid_number_mechanism' */
// $ldapservers->SetValue($i,'auto_number','min','1000');
/* 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
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
may not), so that you can be guaranteed to get a unique uidnumber for your
directory. */
// $ldapservers->SetValue($i,'auto_number','dn','');
// $ldapservers->SetValue($i,'auto_number','dn',null);
/* The password for the dn above. */
// $ldapservers->SetValue($i,'auto_number','pass','');
// $ldapservers->SetValue($i,'auto_number','pass',null);
/* Enable anonymous bind login. */
// $ldapservers->SetValue($i,'login','anon_bind',true);
/* 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
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
to the attributes in question (the logged in user may not have enough access)
*/
// $ldapservers->SetValue($i,'unique_attrs','dn','');
// $ldapservers->SetValue($i,'unique_attrs','dn',null);
/* The password for the dn above */
// $ldapservers->SetValue($i,'unique_attrs','pass','');
// $ldapservers->SetValue($i,'unique_attrs','pass',null);
/* 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
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! */
# $ldapservers->SetValue($i,'login','allowed_dns',array(
# 'uid=stran,ou=People,dc=example,dc=com',
# '(&(gidNumber=811)(objectClass=groupOfNames))',
# '(|(uidNumber=200)(uidNumber=201))',
# 'cn=callcenter,ou=Group,dc=example,dc=com'));
# $ldapservers->SetValue($i,'login','allowed_dns',array(
# 'uid=stran,ou=People,dc=example,dc=com',
# '(&(gidNumber=811)(objectClass=groupOfNames))',
# '(|(uidNumber=200)(uidNumber=201))',
# 'cn=callcenter,ou=Group,dc=example,dc=com'));
/* Set this if you dont want this LDAP server to show in the tree */
// $ldapservers->SetValue($i,'appearance','visible',true);
@@ -239,21 +368,30 @@ $ldapservers->SetValue($i,'login','pass','');
$ldapservers->SetValue($i,'server','tls',false);
$ldapservers->SetValue($i,'server','low_bandwidth',false);
$ldapservers->SetValue($i,'appearance','password_hash','md5');
$ldapservers->SetValue($i,'login','attr','uid');
$ldapservers->SetValue($i,'login','string','');
$ldapservers->SetValue($i,'login','class','');
$ldapservers->SetValue($i,'login','attr','dn');
$ldapservers->SetValue($i,'login','string',null);
$ldapservers->SetValue($i,'login','class',null);
$ldapservers->SetValue($i,'server','read_only',false);
$ldapservers->SetValue($i,'appearance','show_create',true);
$ldapservers->SetValue($i,'auto_number','enable',true);
$ldapservers->SetValue($i,'auto_number','mechanism','search');
$ldapservers->SetValue($i,'auto_number','search_base','');
$ldapservers->SetValue($i,'auto_number','search_base',null);
$ldapservers->SetValue($i,'auto_number','min','1000');
$ldapservers->SetValue($i,'auto_number','dn','');
$ldapservers->SetValue($i,'auto_number','pass','');
$ldapservers->SetValue($i,'auto_number','dn',null);
$ldapservers->SetValue($i,'auto_number','pass',null);
$ldapservers->SetValue($i,'login','anon_bind',true);
$ldapservers->SetValue($i,'custom','pages_prefix','custom_');
$ldapservers->SetValue($i,'unique_attrs','dn','');
$ldapservers->SetValue($i,'unique_attrs','pass','');
$ldapservers->SetValue($i,'unique_attrs','dn',null);
$ldapservers->SetValue($i,'unique_attrs','pass',null);
# 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);
*/
/*********************************************/
@@ -265,7 +403,8 @@ $ldapservers->SetValue($i,'unique_attrs','pass','');
$friendly_attrs = array();
$friendly_attrs['facsimileTelephoneNumber'] = 'Fax';
$friendly_attrs['telephoneNumber'] = 'Phone';
$friendly_attrs['telephoneNumber'] = 'Phone';
$friendly_attrs['uid'] = 'User Name';
/*********************************************/
/* Support for attrs display order */
@@ -277,16 +416,16 @@ $friendly_attrs['telephoneNumber'] = 'Phone';
attributes that are not specified in this array will be displayed after in
alphabetical order. */
# $attrs_display_order = array(
# 'givenName',
# 'sn',
# 'cn',
# 'displayName',
# 'uid',
# 'uidNumber',
# 'gidNumber',
# 'homeDirectory',
# 'mail',
# 'userPassword'
# 'givenName',
# 'sn',
# 'cn',
# 'displayName',
# 'uid',
# 'uidNumber',
# 'gidNumber',
# 'homeDirectory',
# 'mail',
# 'userPassword'
# );
/*********************************************/
@@ -305,8 +444,8 @@ $friendly_attrs['telephoneNumber'] = 'Phone';
/* Hidden attributes in read-only mode. If undefined, it will be equal to
$hidden_attrs. */
# $hidden_attrs_ro = array(
# 'objectClass','shadowWarning', 'shadowLastChange', 'shadowMax',
# 'shadowFlag', 'shadowInactive', 'shadowMin', 'shadowExpire');
# 'objectClass','shadowWarning', 'shadowLastChange', 'shadowMax',
# 'shadowFlag', 'shadowInactive', 'shadowMin', 'shadowExpire');
/** **/
/** Read-only attributes **/
@@ -336,6 +475,19 @@ $friendly_attrs['telephoneNumber'] = 'Phone';
present a user with the option of changing the unique attributes. */
# $unique_attrs = array('uid','uidNumber','mail');
/*********************************************/
/* Group attributes */
/*********************************************/
/* Add "modify group members" link to the attribute. */
// $config->custom->modify_member['groupattr'] = array('member','uniqueMember','memberUid')
/* Configure filter for member search. This only applies to "modify group members" feature */
// $config->custom->modify_member['filter'] = '(objectclass=Person)';
/* Attribute that is added to the group member attribute. */
// $config->custom->modify_member['attr'] = 'dn';
/*********************************************/
/* Predefined Queries (canned views) */
/*********************************************/
@@ -357,7 +509,7 @@ $queries[$q]['scope'] = 'sub';
$queries[$q]['filter'] = '(&(objectClass=posixAccount)(uid=*))';
/* The attributes to return */
$queries[$q]['attributes'] = 'cn, uid, homeDirectory';
$queries[$q]['attributes'] = 'cn, uid, homeDirectory, telephonenumber, jpegphoto';
/* If you want to configure more pre-defined queries, copy and paste the above (including the "$q++;") */
$q++;

View File

@@ -1,59 +0,0 @@
* Project Creator:
- David Smith
* Project Developers:
- Deon George Maintainer
- Xavier Renard Import/Export and Samba
- Uwe Ebel I18n
* Patch writers:
- Bayu Irawan userPassword hash, html fixes, ldap_modify fixes
- Uwe Ebel short_open_tags fix
- Andrew Tipton SUP support in schema parser
- Eigil Bjørgum UTF-8 support
- Brandon Lederer DNS entry template
Nathan Rotschafer
- Steve Rigler Password hash patch
- Chris Jackson Blowfish and md5crypt passwords
- Marius Rieder Perfected schema parser
- Nick Burch realpath() fixes for *BSD
- Matt Perlman Fix for IBM LDAP schema support
- K Yoder Predefined searches
- Piotr Tarnowski i18n fixes
- Deon George Auto-uidNumber enhancements and many fixes
- Pierre Belanger Speed-ups to auto-uidNumber
- Benjamin Drieu Syslog, Hooks and other fixes
- Samuel Tran User login restriction
- Daniel van Eeden Unicode, CSS fixes
- Piotr Tarnowski More locatisation fixes
- Tomas Kuliavas Improved password encoding functions
- Alessandro De Zorzi Enhancement with the new template engine and others
- Matt Harrington Fixes
- Jonathan Thurman Add Multiple objectClasses
- And many others, whose names are lost in the changelog. Thank you.
* Translators:
- Marius Reider, German
Uwe Ebel,
Dieter Kluenter
- Xavier Renard French
- Dave Smith English ;)
- Richard Lucassen Dutch
- Andreu Sanchez Spanish and Català
- Dmitry Gorpinenko, Russian
Aleksey Soldatov
Sergey Saukh
- Unknown Italian, Tain, Simplified Chinese
- Alexandre Maciel Portuguese (Brasilian)
Elton Schroeder Fenner (CLeGi)
- Piotr Tarnowski (DrFugazi) Polish
- Gunnar Nystrom Swedish
- VOROSBARANYI Zoltan, Hungarian
SIPOS Agnes
- Tadashi Jokagi (elf2000) Japanese
If you can help translate, please join the phpldapadmin-devel mailing list:
https://lists.sourceforge.net/mailman/listinfo/phpldapadmin-devel

View File

@@ -1,418 +0,0 @@
* Version 0.9.7, 2005-09-11
* Summary:
- Now fully supporting PHP5 - this will be the last version developed on PHP4.
- Revamped how you configure PLA - now using a config object and some checking,
- Revamped how you define LDAP servers - extending the LDAPServer object and adding some checking.
- Fixed all functions so that they now use the LDAPServer object.
- Introduced the template engine and configuration by XML files. (The old templates are still in this
version, unchanged from 0.9.6. They will be removed after this version is released.)
- Changed dependancy checking to just index.php, so that common.php executes faster.
- Minor improvements to compare.php
- Much improved debug logging
- Much improved caching
- Improved LDAP server info display
- Some code readability cleanup
- Add other fixes as per the ChangeLog (ChangeLogCVS.txt).
Thank you for everybody who has submitted fixes/enhancements/recommendations and feedback for this version.
* Version 0.9.6, 2005-04-03
* Summary:
The main goals for this version was to close all the outstanding bugs and apply all the submitted patchs
on sourceforge. All the sourceforge easy to do RFE's where also included.
* Notes:
- Added support for mulpiple Base DN's
- Added support to log for syslog (Benjamin Drieu)
- Added hooks feature to replace custom functions (Benjamin Drieu)
- Entry chooser now auto adds rdn entry for copy/move operations (wigi2)
- Initial support for AD Schema Retrieval
- Added login restriction (Samuel Tran)
- Added support to move objects (aka Copy then Delete) (wigi2)
- No longer show + next to objects that have no children in tree viewer (when hide_configuration_management=true)
- Added date evaluation to shadow attributes (shadowAccount)
- Added Enhancement to show attributes in a specifc order (Samuel Tran)
- Added Server Info OID descriptions
- Added new feature to compare two DNs
- Binary SID to text SID feature for MSAD objectSid entries.
- Added session timeout feature (Samuel Tran)
* New Languages:
- Taiwan (Anonymous)
- Simplfied Chinese (Anonymous)
* Changes:
- LDAP server configuration is being moved into an Object LDAPServer, all future interactions should
use this object class from now on.
- Some more conversions of english static text into language files.
- Some code cleanup, excess whitespace removal, etc...
- Tags for phpdoc updated.
- Added cvs header to files missing the header.
- LDIF Import function improvements (Xavier Renard)
- UniqueAttrs fix, now showing actual value (in multi value attribs) that breaches uniqueness
- Fixed check_lang_files when register_globals=off
- css fixes (Daniel van Eeden)
- More locatisation fixes (Piotr Tarnowski)
- Schema functions all use cached entries now by default
- Improved password encoding functions (Tomas Kuliavas)
- If auth_type = session, then dn and password is also blowfish encrypted
- Prettied up the icon index (Dave Smith)
- Make the rdn not editable in the default template.
* Fixes:
- password_check when magic_quotes_gpc is on.
- Misc fixes (Benjamin Drieu)
- Fix searchs when searching for values with brackets
- Unicode fixes (Daniel van Eeden)
- View jpeg photo minor security fix (Dave Smith)
- Check password link missing in read-only mode
* Sourceforge bug fixes:
1117099 1117316 1120048 1150947 1152962 1153360 1055401 1158148 1161425
* Version 0.9.5, 2004-12-17
* Notes:
This version adds substantial new features and several minor bug fixes as well as PHP5 support!
* Changes:
- Added PHP5 support using Zend1 compatibility options.
- Users can now specify a format string for custom display of DNs in the tree viewer
(see $tree_display_format in config.php.example)
- If using http auth_type, DNs and passwords are now encrypted int he cookie using blowfish.
- If base entry is missing, phpLDAPadmin will prompt you to create it and give you some
sane default values to get started.
- Added index file for viewing of all PLA icons (see phpldapadmin/images/index.php)
- Added custom country flag icons for DNs in the form "c=us"
- Added more custom icons (ipNetwork, Device, Room)
- Made it easier to create the base entry of an empty tree.
- Fixed bug related to predefined search queries with patch from Olivier Mounier
- Added a template for mozillaOrgPerson
- Improved error handling for non-existent or unreadable template files.
- "Create new" now displays at the top *and* bottom of the tree viewer list if there are
more than 10 entries in the container (make it easier for users by reducing scrolling)
- Optimized several pages by closing the session early if not needed.
- By request, reversed the order of first name / last name in the inetOrgPerson template.
- Added a login_string feature for admins who have all their users in a single container,
so they can specify a string like "uid=<username>,ou=People,dc=example,dc=com" instead
of setting up the painful login_attr stuff.
- Changed the delete button to be red (like phpMyAdmin) to make it more obvious.
- Consolidated the links at the top of the tree viewer to make better use of real estate.
- New logo!
- Patch from Dimitre to fix unique attrs enforcement.
- Templates can now redirect wherever they want using a hidden form input.
- Added a "Home" button in the tree viewer to get back to the main PLA page if desired.
- PLA now looks up the gidNumber to display group description and name in user accounst.
- Improved the hint about structural objectClasses in the custom creation template
- Added ability to purge caches (mostly just schema objects) and caches are auto-purged
when the schema is viewed in the schema browser.
- Changed the arrow icon next to objectClass values to be an information button.
- Search results can be displayed in table format now.
- Fixes to LDIF import.
- Added support for exporting to VCard 2.1 format.
- Lots of little session fixes.
- Structural objectClasses are now shown in bold in the custom creation template.
- Fixed lots of bugs, some big some minor:
1025353 1037715 1029103 1026427 1025353 1020606
1020376 1010576 1009410 1007281 1007132 1004042
1002794 1001941 1000185 999605 999170 996842
995362 995297 995296 994343 993875 992419
991891 989219 984587 983375 981283 979395
977598 974369 973520 973323 965165 964410
962074 959950 958372 957284 954453
* Version 0.9.4b, 2004-05-11
* Notes:
This follow-on release fixes one critical bug contained in 0.9.4
relating to session.auto_start and schema caching.
* Changes
- Fixed bugs (all duplicates of single bug):
947981
951003
951140
- Fixed binary attribute creation (create.php)
* Version 0.9.4a, 2004-05-08
* Notes:
This follow-on release fixes several critical bugs contained in 0.9.4.
* Changes:
- Fixed bugs:
949500 Error while adding New User Account
949500 Creating a new uid under ou=People
948695 is_executable() error using phpldapadmin - windows
948741 Level: E_WARNING
948413 Undefined variable: lang (E_NOTICE) after install
* Version 0.9.4, 2004-05-04
* Notes:
This release adds many new features and fixes many minor bugs.
General performance has improved, especially for handling large data
sets. Of particular note is that users can page through search results,
flag individual attributes as read-only, view in-line jpegPhotos in
search results, export DSML, all from the comfort of their own language.
phpLDAPadmin is now availble in 11 languages.
* Changes:
- Fixed bug 936223 by adding more robust error-handling to the binary
attr viewing code.
- Improved support for Microsoft Active Direcotry
Added many new icons and logic to detect "special" Active Directory
objects.
Fixed a bug which prevented phpLDAPadmin's tree viewer from
properly browsing an Active Directory.
- Improved support for Novell eDirectory
Added many new icons and logic to detect Novell eDirectory (NDS)
entries.
- Enhanced export form
Users can specify the type of export, line ends, search scope, and more
from one handy form similar in appearance to phpMyAdmin export forms (though
more simple). As a result, I cleaned up the links at the top of the default
mod template (removed mac | win | unix links, for example).
- Cleaned up the entry browser link
It now better aligns itself with neighboring form elements.
- Fixed several E_NOTICE bugs
- Added paging to search results Search results are now paged into groups
of 50 entries and users can step through the pages like Google. This is not
only a nicety, but with large searches users may have waited for hours for
their browser to render all the entries. That problem is fixed by paging.
- DNs are pretty-printed
DNs in the tree viewer and else-where are now "syntax-highlighted".
- Faster schema surfing
You can "jump to" schema elements without rendering all other elements in
the schema browser. This is a major speed enhancement.
- Configurable: hide "Create new"
Thanks to a patch from Deon George, users can hide the "create new" link in the
tree viewer if desired.
- DSML exports
- Various XHTML fixes supplied by Uwe Ebel.
- More binary safety:
get_object_attrs() is now completely binary safe. Developers can use it to
fetch jpegPhotos and any other binary data.
- Re-order the search criteria menu
Users can re-order the search criteria drop-down box (for simple search
form) as desired from the config.
- Obfuscated passwords with ****
Users can configure PLA to display userPasswords as ****** if desired.
- Tree browser displays child counts
We found a fast solution to display child counts below each node without
having to expand the node in the tree viewer. Works great.
- "Used by" hyperlinks
The "used by" list in matching rules are now hyper-linked to attributes in
the schema viewer.
- jpegPhotos in the search results.
When a search result includes jpegPhotos, they will be displayed inline
with other attributes. Very handy for address books!
- We can draw any jpeg now
Modified the infrastrucutre to draw any jpegPhoto attribute, regardless of
its name.
- Added a groupOfNames template
For editing groupOfNames and groupOfUniqueNames
- Fixes to the entry browser
The entry browser can be clicked and closed before it's finished loading
- Read-only attributes
Users can now mark certain attributes as read-only, and PLA will refuse to
modify them (ie, objectClasses) and display them without form input fields.
- Configurable handling of aliases and referrals
Admins can configure how phpLDAPadmin should handle aliases and
referrals with fine-grained control.
- Schema caching
Network traffic between the web server and LDAP server has been reduced
drastically and user page loads should run much faster thanks to a
two-level session-based and memory-based schema cache.
- Low bandwidth mode
Users who have a slow link between their LDAP server and web server can
run phpLDAPadmin in low-bandwidth mode to discourage excessive network
traffic.
- Fixed DN explosion
A bug in PHP's LDAP API caused common segmentation faults in
ldap_explode_dn(). We have re-implemented this function in PHP and have
eliminated all segmentation faults.
- Almost complete localization
phpLDAPadmin is 100% internationalized with the exception of creation
templates, available in 11 languages.
- Added support for IBM LDAP and ISODE M-Vault LDAP servers.
- Linkable displayed DNs
When a user views an attribute that contains a DN, an arrow will appear
to the left side. When clicked, the user is taken to the referenced DN.
- Recursive copy fliters
When users copy a sub-tree, they may apply a filter to the copy such
that only entries that match the filter will be copied.
- Auto uidNumber enhancements
Admins can now specify a DN to bind with when auto-searching for the next
available uidNumber.
- Schema code cleanups
Applied object-oriented inheritance to schema items and cleaned up
access functions. No affect on end user, just a developers' itch.
- Custom creation template usability enhancements
- Fixed session bugs
If PHP is auto-starting sessions, we will not throw errors anymore.
- Added new auth_type: http
Users can now use http auth_types for form-based logins. Their
DN/password will be stored on the server in memory rather than in
a cookie on the client.
- TLS fixes
More robust coverage. If users have configured 'tls' = true in
config.php, we use TLS for all transactions with the LDAP
server.
- Error handling fixes
pla_verbose_error() is more tolerant of crappy input (ie, bad LDAP
error codes).
- Cleaned up default mod template
Editing entries is now much cleaner-looking. Buttons at the top are
in two columns. The browser doesn't have to be full-screen anymore
to edit an entry.
- Minor cosmetic fixes to custom creation template
- Added phpDoc commentary to all functions in functions.php and
schema_functions.php, and export_functions.php. This allows us to
auto-doc the code using phpDocumentor.
* Version 0.9.3, 2003-12-19
* Notes:
This release focused almost entirely on finding and fixing bugs.
The schema viewer has also been streamlined to save bandwidth (and several
endangered species), while template configuration has been moved to its
own file located in the templates directory. Over all, phpLDAPadmin has
been made more solid thanks to testing and reporting by hundreds of users.
Thansk for all your reports! Special thanks goes out to Matt Perlman for
the IBM work-around and Uwe Ebel for the enhanced schema viewer.
* Changes:
As this was primarily a bug-fix release, here's the list of significant
fixes:
862225 an E_NOTICE on delete fixed
861730 (and many duplicates of it) an E_NOTICE on determining the
language in 'auto' lanuage mode for browsers who don't
set HTTP_ACCEPT_LANGUAGE (like Opera).
861491 (and many duplicates of it) Anonymous form-based logins
often failed due to several E_NOTICE problems.
856832 IBM LDAP servers refernece SUP attributes by OID, not name.
A patch was provided to accomodate this circumstance.
860179 Another anonymous form-based login bug.
858611 (lots of dups of this one) Fixed the error handler so that
it will not cause a "cannot send header information" message.
844547 A coulpe E_NOTICE bugs in the posix group creation template.
841816 An E_NOTICE bug during creation of an entry.
844340 A sprintf error during login
- Many many more bug fixes.
- The schema viewer was also streamlined.
- Support work-around for IBM LDAP Server was added.
* Version 0.9.2, 2003-11-14
* Notes:
This release has undergone major code hardening as we've subjected it to
the most stringent standard of PHP error reporting. The result is
fewer unhandled errors, improved usability, and better performance.
We've given more attention to internationalization as well,
and that effort is nearly 80% complete. Translators and coders are still
needed to help complete the localization effort. We've added a whole new
custom callback infrastructure that is event driven. Users can write their
own custom code to be executed as the result of LDAP events. Events include
entry creation, entry deletion, and entry modification. Users can define
custom code to execute automatically before and after each of these events.
See "custom_functions.php" for details and documentation. Lots of other new
features and bug fixes are outlined in the ChangeLog. phpLDAPadmin finally
has a roadmap included with each release. Find it in the file called "ROADMAP"
in the root of the install. This roadmap will be constantly updated to
list our goals for each release. Enjoy 0.9.2! As always, your feedback
is most welcome on the development mailing list and on the SourceForge
bug tracker.
* Changes:
- Localization work continues. About 80% complete.
- New languages: Ialian, German, Catala
- Fixed major encoding bugs. All pages are now true UTF-8 encoded
- Support for auto-determining user's language based on the browser
- Custom event callbacks infrastructure (see custom_functions.php). Users can now
define custom code to execute as a result of LDAP events (ie, new entries,
modifications, etc).
- Major code cleanup. Removed all E_NOTICE messages and enabled E_ALL error_reporting.
- Added support for smd5 and ssha passwords
- Added configurable hints throughout the application
- Added template-based entry editing. The infrastructure is now in place to use custom
templates for editing LDAP entries. No templates are being shipped with 0.9.2, but
they are on the way for 0.9.3.
- Added photo display support for non-jpegPhoto photo attributes.
- Added mass deletion. If enabled in the configuration, users can mass-delete multiple
entries from the tree browser with checkboxes.
- Much improved schema retrieval code. Now PLA uses the Root DSE (or any relevant DN)
to fetch the schema based on the RFC-complian subSchemaSubEntry value.
- Added support for viewing schema for attributes with ";" in their names (like
userCertificate;binary or sn;lang-fr)
- Schema code is 100% object oriented.
- Enhanced search code can handle large searches without running out of memory.
- Fixed minor XSS vulnerabilities in several creation templates.
- Enhanced the server information viewer to actively retrieve attributes that the server
may not give voluntarily.
- Made the tree viewer more intelligent for failed binds.
- Added better caching of the base DN for the tree viewer, which speeds up page loads
considerably with multiple servers all configured to auto-determine the base DN.
- Added intelligence around password updates on the currently logged-in user entry.
* Version 0.9.1, 2003-09-24
* Notes:
We fixed a mountain of bugs for this release and implemented the
most popular feature requests. The result is a much more robust LDAP
management tool that supports a wider range of harsh environments and spoken
languages. This release was over a month in the making and it shows. We've
had great feed back from users. Special thanks to Nick Burch, Xavier
Renard, Uwe Ebel, Schuller Tom, and Marius Reider for their code
contributions. Thanks to everyone who contributed code and bug reports!
* Changes:
- Preliminary support for LDIF imports.
- Binary attribute support for viewing, deleting, and adding.
- Users can specify attributes to hide while editing entries.
- Schema browser now displays which objectClasses each attribute is used in.
- Preliminary multi-language support (some localization, infrastructure in place).
- New template for creating posixGroup entries.
- Optional read-only mode of operation.
- Error dialog beautified.
- Localization effort begun, now available in German and French.
- New samba user template.
* Bugs fixed:
- I18n support was made more robust (UTF-8 problems fixed in *many* places).
- Improved LDIF exports with better LDIF comments and cleaner IE support.
- Cleaned up code in edit.php.
- After updates, modified attribute(s) now highlighted properly.
- Many realpath() fixes to allow symlink installs with multiple configs.
- Simple search form 'Starts with' '*' searches produced PHP error.
- Entry creation now adds the new entry to the tree browser in sorted order.
- Complete re-work of schema browser, much more efficient parser.
- Began effort to remove all E_NOTICE notices.
* Version 0.9.0, 2003-08-12
* Notes:
This is the first release of phpLDAPAdmin. It should be stable enough and
ready for use on your production LDAP servers. This is still a beta release
and the paranoid may want to wait. phpLDAPAdmin is based on an improved
version of DaveDAP 0.8.4.
* Changes:
phpLDAPAdmin was DaveDAP. Changes since DaveDAP 0.8.4 include:
- Better LDAP compliance when copying entries.
- Fixed boolean attribute support.
- jpegPhoto scaling when necessary.
- More robust schema browser.
- Added internal attributes support.
- Slightly improved look and feel.

View File

@@ -1,68 +0,0 @@
Installationsanleitung von phpldapadmin auf Deutsch
===================================================
$Header: /cvsroot/phpldapadmin/phpldapadmin/doc/INSTALL-de.txt,v 1.3 2004/03/01 19:48:58 i18phpldapadmin Exp $
Die Installationsanweisung geht davon aus das:
a) Ein Webserver (Apache, IIS, etc.)
b) PHP 4.1.0 oder neuer (mit LDAP-Support)
installiert sind und auch funktionieren
* Installation von phpLDAPadmin in vier einfachen Schritten:
1. Entpacken des Archives (wenn man diesen Text lesen kann,
dann ist das schon geschehen)
2. Das entpackte Verzeichnis phpldapadmin sollte vom webroot
aus erreicht werden
3. Kopieren der 'config.php.example' nach 'config.php'
und anpassen.
4. Mit einem Browser auf das phpldapadmin-Verzeichnis zugreifen
(wenn Sie das Verzeichnis sehen, dann bitte noch ein index.php
anhaengen)
* Browser Hinweise
phpLDAPadmin wird unter Mozilla entwickelt und sollte auch am
Besten darunter laufen. Andere Browser (bspw. Internet Explorer)
sollten ebenfalls funktionieren.
Keine Tests wurden mit dem Konqueror (oder jeder andere khtml-basierende
Browser wie Safari) oder Opera vorgenommen. Falls es zu Browser
Inkompatibilitaet kommen sollten, dann bitte einen Fehlerreport senden.
* Lizenz
Die Verwendete Lizenz ist in der Datei LICENCE zu finden
* Mitwirkende:
Projektentwickler:
Bitte in der Datei INSTALL unter 'Project Developers:' nachsehen
Patches:
Bitte in der Datei INSTALL unter 'Patch writers:' nachsehen
Uebersetzungen:
Bitte in der Datei INSTALL unter 'Translators:' nachsehen
Wer in der Uebersetzung helfen moechte sollte an der Mailingliste
phpldapadmin-devel teilnehmen:
https://lists.sourceforge.net/mailman/listinfo/phpldapadmin-devel
* Hinweise zur Konfiguration von config.php
Wer eine Benuetzerfuehrung auf Deutsch haben moechte sollte in der
config.php die Zeile
$language = 'en';
mit
$language = 'de';
abaendern. Weitere Sprachen sieht man im Unterverzeichnis 'lang'

View File

@@ -1,56 +0,0 @@
$Header: /cvsroot/phpldapadmin/phpldapadmin/doc/INSTALL-es.txt,v 1.4 2005/02/06 00:37:15 wurley Exp $
Estas instrucciones dejan por sentado que tienes una instalación
funcionando de:
a. Servidor Web (Apache, IIS, etc).
b. PHP 4.1.0 o mas nuevo (con soporte LDAP)
* Instalando phpLDAPadmin en 4 pasos muy simples:
1. Desempaqueta el archivo (si estás leyendo esto, ya lo has hecho).
2. Pon el directorio resultante 'phpldapadmin' en algún lugar de tu
directorio web raiz.
3. Copia 'config.php.example' a 'config.php' y edítalo para que se
acomode a tu configuración y tu gusto.
4. Entonces, con el navegador ve a la dirección que contiene los archivos
del directorio phpldapadmin.
* Notas del navegador
phpLDAP se desarrolló bajo Mozilla, y será donde seguramente corra mejor.
Aún así, las pruebas se han hecho bajo Internet Explorer, y tendría que funcionar
bien también. No se ha hecho ninguna prueba con Konqueror (o cualquier navegador
basado en kthml como Safari) o Opera. Si encuentras alguna incompatibilidad, por favor
háznoslo saber.
* Contribuidores
Desarrolladores del proyecto:
- David Smith Mantenedor
- Xavier Renard Master de LDIF
- Marius Rieder Master de los Esquemas
- Nate Rotschafer Encargado de los lanzamientos
Escribidores de los parches:
- Bayu Irawan userPassword hash, arreglos html, arreglos ldap_modify
- Uwe Ebel arreglo short_open_tags
- Andrew Tipton soporte SUP en el parseador del esquema
- Eigil Bjørgum soporte UTF-8
- Brandon Lederer plantilla de entrada de DNS
Nathan Rotschafer
- Steve Rigler Parche para Password hash
- Chris Jackson Contraseñas Blowfish y md5crypt
- Marius Rieder Parseador avanzado de esquema
- Nick Burch Un montón de arreglos de realpath()
Traductores:
- Uwe Ebel Alemán
- Xavier Renard Francés
- Dave Smith Inglés ;)
Si puedes ayudar a traducir, por favor apúntate a la lista de correo phpldapadmin:
https://lists.sourceforge.net/mailman/listinfo/phpldapadmin-devel

View File

@@ -1,57 +0,0 @@
$Header: /cvsroot/phpldapadmin/phpldapadmin/doc/INSTALL-fr.txt,v 1.4 2005/02/06 00:37:15 wurley Exp $
Les instructions suivantes supposent une installation en état de marche de:
a. Un serveur web (Apache, IIS, etc).
b. PHP 4.1.0 ou une version plus récente (avec le support LDAP).
* Installer phpLDAPadmin en quatre étapes simples:
1. Dé-tarrer l'archive (si vous lisez ceci, c'est que vous l'avez déjà fait).
2. Mettre le répertoire 'phpldapadmin' ainsi obtenu quelque part sous
la racine de votre serveur web.
3. Copier 'config.php.example' vers 'config.php' et éditer selon vos besoins.
4. Ensuite, pointer votre navigateur vers le répertoire phpldapadmin.
* Notes sur les navigateurs
phpLDAPadmin a été developpé avec Mozilla et fonctionnera vraisemblablement
mieux avec celui-ci. Cependant, des tests ont été effectué avec Internet Explorer
et cela devrait fonctionner également. Aucun test n'a été réalisé ni avec Konqueror
(ou un navigateur basé sur khtml comme Safari par exemple) ni avec Opera. Si
vous trouvez une incompatibilité avec votre navigateur, merci de la reporter.
* Contributions:
Developeurs:
- David Smith Maintenance
- Xavier Renard Responsable LDIF
- Marius Rieder Responsable pour les schéma LDAP
- Nate Rotschafer Directeur des releases
Auteurs de patchs:
- Bayu Irawan hachage pour le mot de passe utilisateur,
corrections html, corrections pour ldap_modiy
- Uwe Ebel Corrections pour short_open_tags
- Andrew Tipton Support pour SUP dans le parseur de schémas
- Eigil Bjørgum Support pour UTF-8
- Brandon Lederer Patron pour les entrées DNS
Nathan Rotschafer
- Steve Rigler Correction pour les hachages des mots de passe
- Chris Jackson Mots de passe Blowfish et md5crypt
- Marius Rieder Amélioration du parseur de schémas
- Nick Burch Corrections multiples pour realpath()
Traducteurs:
- Uwe Ebel & Marius Reider Allemand
- Xavier Renard Français
- Dave Smith Anglais ;)
- Richard Lucassen Néerlandais
- Andreu Sanchez Espagnol et Catalan
- Dmitry Gorpinenko Russe
- Unknown Italien
Si vous pouvez aider à traduire phpLDAPAdmin, veuillez s'il vous plaît vous abonner
à la liste de diffusion phpldapadmin-devel:
https://lists.sourceforge.net/mailman/listinfo/phpldapadmin-devel

View File

@@ -1,101 +1,2 @@
README-translation
==================
$Header: /cvsroot/phpldapadmin/phpldapadmin/doc/README-translation.txt,v 1.3 2004/06/03 12:45:21 uugdave Exp $
This readme is for translators.
phpLDAPadmin currently supports the following languages:
- en, of course
- de, german
- es, spanish
- fr, french
- it, italien
- nl, netherland
- pl, polish
- pt-br, portuguese (brazilian)
- ru, russian
- sv, swedish
* Where are the files located?
All files are in the directory:
phpldapadmin/lang/
* How are the files named?
Every language is named by its local representation. For example English is "en" and
British English is "en_GB" (though phpLDAPadmin does not have an "en_GB" translation).
* Is the location phpldapadmin/lang/ used in the application?
No, there is a Makefile in phpldapadmin/lang/ that converts the
native encoding of the language file to utf8 into the directory
phpldapadmin/lang/recoded. For example the file
phpldapadmin/lang/de.php is converted via the programm iconv to the
the encoding utf8 to the file phpldapadmin/lang/recoded/de.php.
* Is there a rule for the form of the translation?
Yes, all translation is stored in an array called lang[].
The "mother" of all translation is english (en.php).
Use your native encoding like iso8859-1 for european
or iso8859-2 for polish.
Every translated string is in single quotes "'"
Don't use html-code in the translation.
If you need to enclose text in quotes, use a double quote '"' (no escaping required).
* Why shouldn't I use html-code?
To avoid problemens wich htmlspecialchars (which coverts "<" to "&lt;", for example).
To avoid JavaScript problems.
To keep the way open for other targets like xml.
To keep the output well formed.
* How could I start?
First, the base for translation is the CVS version.
Checkout the CVS version and start your translation.
Create a file that contains your translation.
For me the easiest way was to copy the file phpldapadmin/lang/en.php
to the phpldapadmin/lang/[new-langage].php
That gives the way to put the original translation at the end
as a comment. Look at the de.php and you can see what I mean.
Add a target to Makefile so that your langugage is also converted.
* How could I verify that my translation is complete?
phpLDAPadmin contains the file phpldapadmin/check_lang_files.php
Open it in your browser and it will tell you if your lang file has any
omissions or extraneous strings.
- extra entries: if entry is not in the en.php, maybe the value was
changed in en.php or you type in a wrong key.
- missing entries: the entry is present in en.php but is missing in
the translated langugage.
* What is zz.php and the zzz.php in the phpldapadmin/lang/ directory?
Well that is not really a language. That is only for developers
and translators to make sure that all strings are translated in the
application.
The zz.php replace all characters in the lang[] to Z. That helps
in finding hardcoding translation in the the source.
The ZZZ.php helps you to find the used "key".
* How could I enable the zz and zzz language?
Well, one is to set $language to 'zz' or 'zzz' in the config.php file. That is not the
best way - but the way that always works.
Mozilla users do this:
* Click Edit->Preferences
* Option Navigator->Lanugages
Klick the button "add" and type into "Other" the
language "zz"
* With Move up / Move down you can change your priority.
* With the Button "OK" you can activate your choice.
Do the same if you want to activate/test your translation.
Please see http://wiki.phpldapadmin.info/Translating now for information on
translating PLA.

4567
doc/certs/ca-bundle.crt Normal file

File diff suppressed because it is too large Load Diff

17
doc/certs/slapd.crt Normal file
View File

@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE-----
MIICtTCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjES
MBAGA1UECBMJQmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcwFQYDVQQKEw5N
eSBDb21wYW55IEx0ZDAeFw0wNTA5MTUwMjAyMTNaFw0yMTA3MjYxNjM2NTNaMEwx
CzAJBgNVBAYTAkdCMRIwEAYDVQQIEwlCZXJrc2hpcmUxEDAOBgNVBAcTB05ld2J1
cnkxFzAVBgNVBAoTDk15IENvbXBhbnkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQCr6PfdngYTUobwJDwIqY7ywDCWd/IJ+SL2hbe46558oVI7Vw2GbqWn
VZ1fJa0wV2pcy/e10HzZX+RpIwKOZUQvbH1jHJyZ/0bt7on8jmI5o+p+rLVspci5
yVNcgu1tQttpyKnTrDSDkLVbQ6VX8FKLnKnZ7+dk8SNibt0KbzKnOQIDAQABo4Gm
MIGjMB0GA1UdDgQWBBQ4xLvszjgfXgWht8V6s1eRAZS/OjB0BgNVHSMEbTBrgBQ4
xLvszjgfXgWht8V6s1eRAZS/OqFQpE4wTDELMAkGA1UEBhMCR0IxEjAQBgNVBAgT
CUJlcmtzaGlyZTEQMA4GA1UEBxMHTmV3YnVyeTEXMBUGA1UEChMOTXkgQ29tcGFu
eSBMdGSCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAgzaIKI03l
lZmX7IpLN3vqC/PL6QQTUQkdDRXJYGH+DdURx7v0nE/kkb3R3X92BpNxe5jywhHg
A5NaUhjAR76+F3Guk/4XFaWPctJ2PvfJWolS/VrY+KGc3N4zz9A2i8B6SHBzE6V8
EHkcGJtGXkFvCVp1ZbCyejJhw4PUEYawsQ==
-----END CERTIFICATE-----

15
doc/certs/slapd.key Normal file
View File

@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICWwIBAAKBgQCr6PfdngYTUobwJDwIqY7ywDCWd/IJ+SL2hbe46558oVI7Vw2G
bqWnVZ1fJa0wV2pcy/e10HzZX+RpIwKOZUQvbH1jHJyZ/0bt7on8jmI5o+p+rLVs
pci5yVNcgu1tQttpyKnTrDSDkLVbQ6VX8FKLnKnZ7+dk8SNibt0KbzKnOQIDAQAB
AoGAdfKYpag3WOiFhpwFyJe1aV5tt79CBI+36lZicHDQw4fXqLkYoYSnCYFXQSHT
ithfNJ4JLeiG0InXaD9KELLwLU2C7rr7mgOBczzmVBGCYUDNuV3bMcNDOQk/drum
GLGqHhxU6W0dlCUnoBZoEHK6dvtDZnxCa+cUBozvFbuLOTUCQQDZJf+Mz7vc78nn
Cc7nnHFfO+79NQi9h0ydW6kb2LLSGB/f3oqwary8eqCs7RVinG21PMWbjrh0lGOJ
DjYP6dLDAkEAyqrs8pgxcxSTcJiaU4/sxGCeaS4fvoeCbYvKLlS5k5Km6DmA3nY+
KwxQyLHg64g1ImDSuLy3P/E2lZGCPhZGUwJAMVUxpqL3Mi2D+CpBSFtBYnpyRDJN
Rwm6/TD6zWnAznxOmYSsi4HkWQmfAUpnhly1i+w/lKSrAUlJB7Uj0R+1EwJAOADv
pUIFOCXRcGXbD4hQBxwj6jDCuOW9VwQwBImJFoyJ7tYlFFRcbYzjrfHpk2x6MlvL
Hx2XDeZcDQy+juWc3QJAHOpmlHuWqS07i5UIXVl5ohhoWkFd9Qs7/TowyFQF3zpO
BqnwfHZRpySjSUlNE0QpoJRJQPq7p3BWtS3PWMj0/A==
-----END RSA PRIVATE KEY-----

13
doc/demo-reset.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
for i in $(grep directory phpldapadmin-demo.conf|awk '{print $2}'); do
rm -f $i/*dbb $i/alock $i/log.*
done
slapadd -b "dc=example.com" -l ldif-example.com
slapadd -b "dc=example,dc=com" -l ldif-example-com
slapadd -b "o=Simpsons" -l ldif-Simpsons
for i in $(grep directory phpldapadmin-demo.conf|awk '{print $2}'); do
chown -R ldap:ldap $i
done

File diff suppressed because it is too large Load Diff

461
doc/ldif-Simpsons Normal file
View File

@@ -0,0 +1,461 @@
# extended LDIF
#
# LDAPv3
# base <o=Simpsons> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# Simpsons
dn: o=Simpsons
o: Simpsons
objectClass: organization
objectClass: top
# People, Simpsons
dn: ou=People,o=Simpsons
ou: People
objectClass: organizationalUnit
objectClass: top
# Pets, Simpsons
dn: ou=Pets,o=Simpsons
ou: Pets
objectClass: organizationalUnit
objectClass: top
# Santas Little Helper, Pets, Simpsons
dn: cn=Santas Little Helper,ou=Pets,o=Simpsons
givenName: Santas Little Helper
sn: Simpson
objectClass: inetOrgPerson
objectClass: top
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCABn
AEsDASIAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAQGAgUHAwH/xAA8EAACAQMCAwYDAwkJA
AAAAAABAgMABBEFIQYSMRMiQVFhcTKBkRRCogcVI5KhsbLB0TM0U2JygoPw8f/EABoBAAIDAQEAAA
AAAAAAAAAAAAAEAwUGAgH/xAArEQACAgECAwcEAwAAAAAAAAABAgADEQQxEhMhBXGBkbHR8BQyQWF
R4fH/2gAMAwEAAhEDEQA/AOwXNzDZ273FxIsUSDLOxwBXPdS46vYb+WeC4SOJMGK0lQASKTygsSOY
EnyPd8tjm+6lp8Op2MlpcKGjfHUZwQcg+4IqkrwRpdlqsrzS3sskcSFRAOaR+duUkbE4XAzjpk52p
b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IpSlEIpSlEJVOFtCktb2
6vb0rJcGRsMDnOT1q10pXgAAwJ6SScmf//Z
o: The Simpsons
cn: Santas Little Helper
# Bart Simpson, People, Simpsons
dn: cn=Bart Simpson,ou=People,o=Simpsons
cn: Bart Simpson
gidNumber: 1000
givenName: Bart
homeDirectory: /home/users/simpsons/bart
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw
8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRw
hMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAB1
AEEDASIAAhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAAAAcFBgIDBAEI/8QARxAAAgEDAwIEAgQIC
A8AAAAAAQIDAAQRBRIhBjETQVFxImEUgYKRBxUzQlOhscIWUnKSk8HS4RcjJTI2Q1RVYnSistHw8f
/EABsBAAEFAQEAAAAAAAAAAAAAAAUAAgMEBgEH/8QAMBEAAQMCAwUHAwUAAAAAAAAAAQACAwQRBSE
xBhJBUXETYaGxwdHwFCKBMkJSkeH/2gAMAwEAAhEDEQA/AH/RRRSSRUFrWs3FnJPaW9rIZDbho51I
O12LAfCe4BUE+44qdqv9QIV1HT5/zSssPuTtYfqRqoYnNJBSPli1aL+/gpImhzwCow3GtM/iC+USQ
gJCTyko5JMijAycgcdtuRjJFcx06UxmI3szRA+JGHO5lm/SZz34yB6knz4kKK83fjFc/WQ/Le3nzK
JCCMcFG/iuVZTLHeOkpxLuC8fSP0xGeT5EeY47V36Ml3b63bwfTppLY+I4iY9vhGcn84ljn5ZrOtm
m/wCkNt/y8v7UohguIVUldHG+QkE5+foo542CMkBWiiiivR0NRRRRSSRUL1IMWtpMe0V0uftBk/aw
qaqI6mH+QpW8o5YpD7LIpP6hVWuZ2lNIzm0+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inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: bart
uidNumber: 1000
userPassword:: ZWF0bXlzaG9ydHM=
# Homer Simpson, People, Simpsons
dn: cn=Homer Simpson,ou=People,o=Simpsons
cn: Homer Simpson
gidNumber: 1000
givenName: Homer
homeDirectory: /home/users/simpsons/homer
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCABP
AHIDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAABAUDBgACBwH/xABHEAACAQIEBAEHBgoIB
wAAAAABAgMEEQAFEiEGEzFBIhQyNVFhcYEHFlWRk6EVI0JSU2JzdJKyJFSCosHR0uEXJTSkscLT/8
QAGgEAAwEBAQEAAAAAAAAAAAAAAgMEBQYBAP/EAC4RAAEEAQMCAwYHAAAAAAAAAAEAAgMRBBIhMQV
BE1FhInGhsdHwFBUygZHB4f/aAAwDAQACEQMRAD8AFyDIMnn4foJpsspZJHp0ZmaIEsSOpOGHzbyP
6Io/sVwLw/RyPw7lzCvqkvTIdKlLDbtdMMHo2jRnfM6tVUEsS0dgB1PmYQTvyqQNuEBX5RkNDBzDk
9EzNcKDEoGwJJJtsAASevsBJAwD+CqaNVkk4fotDMFGqlVASTYC+tmW52uV6kXtiw0fC8mZaKnMay
sEFrxU5ZVaxsbsQoIJsNhYjueoDZ+GcskjKMlSQbX/AKbNv/fxkS9axon6Nz7k0QOcLpVyDIcgqII
5o8ppCkihlvAt7EXxv828j+iKP7FcE1mRTZWyGLMqw0TMEAuhaFj0udO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UYZaqvGlWwAiE7WVfETuLa1uLgE2J3xTeEeJODIKSlbPqvQ0ECRGnFM7c2wG7kCxW
42Xobb32At1R8qnBdTm9M0mYP5HSxOyg0sljI3hG2nsmserx+zAhu9phftQVr4hoKfM6qioQvLqZC
XNTH4ZYYksW0t1F2KLbp4j6sJXq6mOkngcKMxhcU+m2zSsQEYD81tSt7AT6jgDL/lG+TnLKmSelzG
oUuoQK0MzLGoJOlARZBc9BYdPVjaf5S/k7qM0gzKTMJTUQKVUimlAPWxItYkamtfpqPrxDm4EeVpL
uQR/HcL2OUx3SsuQUUGQVs2UBQ3NTyiGoYfjJwCA4durMpI3P5LqOxxWc2qKWXPKmqojrpKhlXnrv
G9QAQ6q3S9gnvN7X3tJX/Kd8nOZrEtbV89Ym1IHo5CAbW/N3Fj0OxwJ/xM4FavrYpazmZfWQprjNJ
Jp5i3U+HT3UR/wYu0iqQB1G1uvnD34Byf0RS/s/8AE4VScccMU1bJFT5nLUUos0MjwPrAPVWuLki3
XuCL7gki5dxvw/T5fBDLWOHRbMOS5t92FaSnhwKt+XGp+cNC9JSGsenDyvEHCaVKlQ2o7X3IAPUk+
okXNeIsvjISuMuXSdNNYnLF/UH8xvgxxQuHvlM4MybKXkmrpZK6e8s6JTPctbwxgkW8IsvW17nucb
H5VsmqVMsnE8dIzdKePLJJUX2MzAFveNPuw1ooJDjZtX+pybJc2tPUZfR1RYXErRKx94br9Rwi4h4
SyemyOsrIRVwSUsLzRFKyXSrqp0nQWK/C3fFYo/lD4AZ5PK2WknU/9Tl0M0AmB7+CzA+sG/axPbeu
484FzClaiqOKc0ejcjmQNASHAN7FjHrtcD8rHxaDuQvASFML9+vfHvfFYp+PMiECLUVzNKoszCF7M
Rtq6d+vxxJ8/eHP66/2D/5YVpKp1N81zDOvTlf+8yfzHGYjzOZKnNKueI3jlnd1NrXBYkYzD1Kv/9
k=
mail: homer.simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: homer
uidNumber: 1001
userPassword:: ZWF0bXlzaG9ydHM=
# Lisa Simpson, People, Simpsons
dn: cn=Lisa Simpson,ou=People,o=Simpsons
cn: Lisa Simpson
gidNumber: 1000
givenName: Lisa
homeDirectory: /home/users/simpsons/lisa
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCACA
AEwDASIAAhEBAxEB/8QAHAAAAQUBAQEAAAAAAAAAAAAABgEDBAUHAAII/8QAORAAAgECBAQEAwYGA
QUAAAAAAQIDBBEABRIhBjFBURMUImEycYEHFTNCYqEjUnKCkbEkU4OSsvD/xAAaAQACAwEBAAAAAA
AAAAAAAAAEBQADBgIB/8QAMREAAQMCBAMFCAMBAAAAAAAAAQACAwQRBRIhMUFRYROB0eHwBhQicZG
hwfEVQrFS/9oADAMBAAIRAxEAPwDZcR66siy+gnrJgxjgjaRgouSAL2Hvh/FNxY1sheO/400MfzBk
W/7XxxI/Iwu5C69aLkBe4eKMokYJLVeUc7aapTFv2BawP0JwmdZ4tFGlPRlJayddUY5rGv8A1G9uw
/MduVyB07gg8jzHfDUNNT02rwIIodZu3hoF1HubYyp9oJDGRks7nw+iY+5jNvorPJ86ly+daXMKiS
amma0dRK12jcn4WP8AKxOx6E25FQCmSWOFC8rqijmzGwH1wDOiSxtHIodHBVlYXBB5gjDPkaTUGNN
E7DkzoGb/ACd8eUuOujiyytzEcfFSSkDnXabI8pa2lrY2kpKmKoRWKlopA4B7XHXcYewO8IWCZoB0
rBt/2IsEWNRBL20TZLWuAfql725XFvJ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5pOYnbpx/HmizC47HYMWc
XYYraSKvopaScHw5VKkqbEdiD0IO4PQgYfx2Ios541q5RkS1VUwFZSrUZdUFRa7yRgowHQMUjI7a7
cwcZhAA7vL7lF9gDb/d/2xtnGuSHMaCVotvMIsE2xNrNqicgb2STn+l3PQYySm4dzxak5d9z1nm0d
lMYiJA3Njr+G36r298LaqE5s7RutV7PVMMWYSuA469P2VBlkVFF3RCxChnNgCep9uv0wzSKLuRq0p
6E121aee/vvv8sa/wAM/ZzTUeWVP3zpnq62FoWCHaBGG4U9W/V7C3UkeoPskzdaloqvMaRKYSMfGi
DNI4Jv8JACm3ube+OfdXhmm5R4x2mfVF7yQ1o0035+XyVRwfw2/E2crFIh8jTkPVN0I6R/Nv2Fz2v
t6gKoVQAALADpiHk+TUWRZbHQUEWiJNyTuzt1Zj1J/wDtsTcHQxCJtll8Rr3105kOg4DkF//Z
mail: lisa.simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: lisa
uidNumber: 1002
userPassword:: YnJhaW5z
# Maggie Simpson, People, Simpsons
dn: cn=Maggie Simpson,ou=People,o=Simpsons
cn: Maggie Simpson
gidNumber: 1000
givenName: Maggie
homeDirectory: /home/users/simpsons/maggie
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCABm
AE0DASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAAAAUEBgIDBwH/xAA8EAACAQMDAgUCBAIGC
wAAAAABAgMABBEFEiExQQYT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simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: maggie
uidNumber: 1003
userPassword:: ZHVtbXk=
# Marge Simpson, People, Simpsons
dn: cn=Marge Simpson,ou=People,o=Simpsons
gidNumber: 1000
givenName: Marg
homeDirectory: /home/users/simpsons/marg
mail: marg.simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: marg
uidNumber: 1004
userPassword:: Ymx1ZWhhaXI=
cn: Marge Simpson
jpegPhoto:: R0lGODlhhABwAIcAAAAAAAICBQIEAgUFAQUFBAICCwYICw4EBAsJAgkJCAgJDQ4NCA
0NDQECEgEDGwsMEA4QDhMEAhILAhANARANBBYODhwCARoJARMQAhIQBBURARQRBBcVAhIQCBEQDRQ
SDhgSABkUARwTARwVAB0YARISERsbGwIEIgIEKgEENAAEPAQINAQIOiMBASwCAiIbATUDAz0CAicg
AiogASsjBCskAS0jAS0kAS4oBTEnATQqAjkuATswAz0xATwxBj80BCIiIikpKS8vLzQ0NDk5OT09P
QIFQwEGTAQJRAMITQEFUQEGWwMIUwMIWgIIYwIIbAAGcQAGfwEIdAEIfEICAksBAVIBAV8AAEAzAU
E1AUU2AUU3BEU4AUw8AVA+AWEBAWsCAnIBAXwBAU5ABFRDAlhGAVxHAltJAWFNAWBNBGJQBGVRAmp
UAW1YAW1YBHFZAHFaBHFcAnRaAnVdAXVeBHleAHdgAntiAURERElJSU1NTVJSUllZWV1dXWFhYWVl
ZWxsbHJycnV1dXt7ewAIg4QBAYwBAZIAAJsCAqICAqsCArQDA7sCAoFlAYRpAohqAIptAIxuAo1wA
pN0AZZ5Bph3AJp7AaB/AYF/f8ECAssBAdMEBNwBAeICAuwBAfIBAf4AAJ6AAqGAAaODBKaCAKSCBK
aEAKqGAayHAK2JAbKMAra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PBw0pXu5fsUYhEx
OAAAtFDdDZOh5TwvO2O2QYAWKOITnkBECyxxWg33AA+CwK+psd6TarTAE1wHBScugGLo2rxSLxBDG
Czwh426kvA8+UMhEv/0L0iCFDxAAAWyIHXHgoAToPCEC+A+eLkPRg9O57wYOGB3T3QiERbwnKN64V
ZdpIIUtjj90xVRJJBjHiaDAAPnQUGFwye+ExZ4BTAa8YIETKALr6CUIxAQgypEAACoB0X/Jkp58eO
/RB0MWETiEQEARCy/EGjwAhW27glDSIAVjXBB+D/xhSo8XQwU53KuBxjWgAEhYAWIcAgxIAMIsAnL
lwkCQAWctwgvQAHhx3UuoAiHUAFbVH4DOBf7Iwq8MAlrwAaW8As4kAnLpwgAoIKc5wISyHmFQACNd
nUfqBZ9ED+rQgfKx3lWAH7LZwUxmHiH4AdjF3LERg0hYFuWkgsi4H5cVwgv8AOxl3gWEAGIl3hVwA
CkFncVtz+ogCywIAMwIHkukAO2oAoWcIGgEAZccAZX8AlchwgjIAlBUFnEZn4Y4QcohyzAcAqN4Ah
GJQyQEAFiwAiJEAM4kAu/0AUu/yAGhlAFJKABvsAF5OOBxJYNGMBuuOUKbGBtlWAuwbAKdfAGJ0gD
q2ALFMBmeXiDTNEPQjAJj5dec+AGwuAIKmJ8rrgUx2BmCGcprCADwcBErMdwu9gT9FACvPOLlvICH
9MKH+BgredmgWAGzMgqcNAGlMIGYteKPWYOC6Bg11gpsQACquILIaBk0whifsAGs6hiPWAJdXIJQI
CH/HaML1EOFNBY47gqo5AD5tIDxOCNrtQHb9CPrVIDplAnr+ABwlZu+LgS5kABnIiQdVIKMoBoa2C
EBBeRKhEI6GWRqxIMclInurABrDgveohM+iSSq/IKGIALlNIIGmWMeGQMWizwjnbWBnUjDL7AASJy
eR55EUEQhi6JLiMACf0SCbsklBDxlFAZlVI5lVIZEAA7
# search result
search: 2
result: 0 Success
# numResponses: 10
# numEntries: 9

588
doc/ldif-example-com Normal file
View File

@@ -0,0 +1,588 @@
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# example.com
dn: dc=example,dc=com
dc: example
objectClass: dNSDomain
# AU, example.com
dn: c=AU,dc=example,dc=com
c: AU
objectClass: country
objectClass: top
description: Australia
# DE, example.com
dn: c=DE,dc=example,dc=com
c: DE
objectClass: country
objectClass: top
description: Germany
# GB, example.com
dn: c=GB,dc=example,dc=com
c: GB
objectClass: country
objectClass: top
description: Great Britain
# FR, example.com
dn: c=FR,dc=example,dc=com
c: FR
objectClass: country
objectClass: top
description: France
# NO, example.com
dn: c=NO,dc=example,dc=com
c: NO
description: Norway
objectClass: country
objectClass: top
# SE, example.com
dn: c=SE,dc=example,dc=com
c: SE
objectClass: country
objectClass: top
# US, example.com
dn: c=US,dc=example,dc=com
c: US
description: United States of America
objectClass: country
objectClass: top
# RU, example.com
dn: c=RU,dc=example,dc=com
c: RU
objectClass: country
objectClass: top
# \D0\A7\D0\B5\D0\BB\D0\BE\D0\B2\D0\B5\D0\BA\D0\B8, RU, example.com
dn:: Y2490KfQtdC70L7QstC10LrQuCxjPVJVLGRjPWV4YW1wbGUsZGM9Y29t
cn:: 0KfQtdC70L7QstC10LrQuA==
objectClass: inetOrgPerson
objectClass: top
sn:: 0KfQtdC70L7QstC10LrQuA==
# \D0\94\D0\B5\D0\B4 \D0\9B\D0\BE\D0\B3\D0\BE\D0\BF\D0\B5\D0\B4, \D0\A7\D0\B5
\D0\BB\D0\BE\D0\B2\D0\B5\D0\BA\D0\B8, RU, example.com
dn:: Y2490JTQtdC0INCb0L7Qs9C+0L/QtdC0LGNuPdCn0LXQu9C+0LLQtdC60LgsYz1SVSxkYz1le
GFtcGxlLGRjPWNvbQ==
cn:: 0JTQtdC0INCb0L7Qs9C+0L/QtdC0
givenName:: 0JTQtdC0
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBw
YIDAoMDAsKCwsNDhIQDQ4R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
p6FlIoAy9UQLE5A7VzDJ5h/Guj1aUi1ZvXisTyTGuDwR1oA/cX/gnT8CPFfwl/Z21nR/Gugpo9/rO
pSXS6df7XdrdoUQCZATtJKt8p5xjPWvefh98HdE8D3d3qcNnb2lzPGYXisVaO2EI6IIySOPWvRulY
XjjWYvD/hLVdQmfy4oLd3ZvQAUAfjx+0H42kHxR8TLajybdb2VY4lPAAY4FefeGbx9Q1yzlu7f+0r
bdmSEt8x9QAeK1PiQi614n1LUlbi4neXn3Ymud0m9l0G6jlVC6E5OOoPqKAIPFPhq88O+Mr7V9J1i
/trC4kMyWaiRHyf4Sn3BjpnJGKpT6yNe0lk1W0jN2DgTBAN49T716NqOrXXiC1807dm3rIcV5j4mb
7KrZYbsHkUAeW+JIEt7hIYwCqtvwPb/ACKwXBySec1v39nPc3DTshCNwmR1HrVGfT2jIJHFAH9Gkf
xQspdds7KKOWaGZtr3CITHEMcMzdAM4/OuR/aP1qLXPhtqOiaVdQzXV4hQ/PhQMcknFeXeAdRnSzR
xG88UxGx9mVJPTnHGcGuk1+4h1LSnijRHkYlVjk4kVvQHHrQB+f8A4m/Zy8Y380kOnapokEZGS91c
vk+wAQ1zq/svfEC5/cp4i0O2KHaR5UzsT/3yM19ea9aW8R3y3ElndKSWhdBtkB6HBxj6g1w+tarcx
RRXLxS3mmxuE3ohCA9SNwwwP1oA8Ksv2WvHGAl143s40xjba6cznn/eYVFrX7LRuYUjbxa817nkTW
B2MPqrEj9a9jXxZqt4DEkqoVb93DKN3b+8MEHjjI9Kq6j421mwSNL64ESSqytuYOj+gYdvqKAPAvF
/wOv9EtR5z2tyEG3fDuX9GUYryPXfB15axs62ryxhtu+Ebxn6rmvpXW9cilF00+piYDO17cOVK9Mc
9vqO1eQ+LNVSOd3g3NAvJMmUJ+vP9aAP/9k=
objectClass: inetOrgPerson
objectClass: top
sn:: 0JvQvtCz0L7Qv9C10LQ=
# IT, example.com
dn: c=IT,dc=example,dc=com
c: IT
objectClass: country
objectClass: top
# ES, example.com
dn: c=ES,dc=example,dc=com
c: ES
objectClass: country
objectClass: top
# Simpsons, US, example.com
dn: o=Simpsons,c=US,dc=example,dc=com
o: Simpsons
objectClass: organization
objectClass: top
# People, Simpsons, US, example.com
dn: ou=People,o=Simpsons,c=US,dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: People
# Bart Simpson, People, Simpsons, US, example.com
dn: cn=Bart Simpson,ou=People,o=Simpsons,c=US,dc=example,dc=com
cn: Bart Simpson
gidNumber: 1000
givenName: Bart
homeDirectory: /home/users/simpsons/bart
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw
8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRw
hMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAB1
AEEDASIAAhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAAAAcFBgIDBAEI/8QARxAAAgEDAwIEAgQIC
A8AAAAAAQIDAAQRBRIhBjETQVFxImEUgYKRBxUzQlOhscIWUnKSk8HS4RcjJTI2Q1RVYnSistHw8f
/EABsBAAEFAQEAAAAAAAAAAAAAAAUAAgMEBgEH/8QAMBEAAQMCAwUHAwUAAAAAAAAAAQACAwQRBSE
xBhJBUXETYaGxwdHwFCKBMkJSkeH/2gAMAwEAAhEDEQA/AH/RRRSSRUFrWs3FnJPaW9rIZDbho51I
O12LAfCe4BUE+44qdqv9QIV1HT5/zSssPuTtYfqRqoYnNJBSPli1aL+/gpImhzwCow3GtM/iC+USQ
gJCTyko5JMijAycgcdtuRjJFcx06UxmI3szRA+JGHO5lm/SZz34yB6knz4kKK83fjFc/WQ/Le3nzK
JCCMcFG/iuVZTLHeOkpxLuC8fSP0xGeT5EeY47V36Ml3b63bwfTppLY+I4iY9vhGcn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0uVk+lS3bSlQrBuEwq547nOPQ05bKyt9PtEtrWPZEuSBkkkk5JJPJ
JJJJPJJoopOc5xu43SZGyMWYLDuXRRRRTU9f//Z
mail: bart.simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: bart
uidNumber: 1000
userPassword:: ZWF0bXlzaG9ydHM=
# Homer Simpson, People, Simpsons, US, example.com
dn: cn=Homer Simpson,ou=People,o=Simpsons,c=US,dc=example,dc=com
cn: Homer Simpson
gidNumber: 1000
givenName: Homer
homeDirectory: /home/users/simpsons/homer
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCABP
AHIDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAABAUDBgACBwH/xABHEAACAQIEBAEHBgoIB
wAAAAABAgMEEQAFEiEGEzFBIhQyNVFhcYEHFlWRk6EVI0JSU2JzdJKyJFSCosHR0uEXJTSkscLT/8
QAGgEAAwEBAQEAAAAAAAAAAAAAAgMEBQYBAP/EAC4RAAEEAQMCAwYHAAAAAAAAAAEAAgMRBBIhMQV
BE1FhInGhsdHwFBUygZHB4f/aAAwDAQACEQMRAD8AFyDIMnn4foJpsspZJHp0ZmaIEsSOpOGHzbyP
6Io/sVwLw/RyPw7lzCvqkvTIdKlLDbtdMMHo2jRnfM6tVUEsS0dgB1PmYQTvyqQNuEBX5RkNDBzDk
9EzNcKDEoGwJJJtsAASevsBJAwD+CqaNVkk4fotDMFGqlVASTYC+tmW52uV6kXtiw0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6d+vxxJ8/eHP66/2D/5YVpKp1N81zDOvTlf+8yfzHGYjzOZKnNKueI3jlnd1NrXBYkYzD1Kv/9
k=
mail: homer.simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: homer
uidNumber: 1001
userPassword:: ZWF0bXlzaG9ydHM=
# Lisa Simpson, People, Simpsons, US, example.com
dn: cn=Lisa Simpson,ou=People,o=Simpsons,c=US,dc=example,dc=com
cn: Lisa Simpson
gidNumber: 1000
givenName: Lisa
homeDirectory: /home/users/simpsons/lisa
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCACA
AEwDASIAAhEBAxEB/8QAHAAAAQUBAQEAAAAAAAAAAAAABgEDBAUHAAII/8QAORAAAgECBAQEAwYGA
QUAAAAAAQIDBBEABRIhBjFBURMUImEycYEHFTNCYqEjUnKCkbEkU4OSsvD/xAAaAQACAwEBAAAAAA
AAAAAAAAAEBQADBgIB/8QAMREAAQMCBAMFCAMBAAAAAAAAAQACAwQRBRIhMUFRYROB0eHwBhQicZG
hwfEVQrFS/9oADAMBAAIRAxEAPwDZcR66siy+gnrJgxjgjaRgouSAL2Hvh/FNxY1sheO/400MfzBk
W/7XxxI/Iwu5C69aLkBe4eKMokYJLVeUc7aapTFv2BawP0JwmdZ4tFGlPRlJayddUY5rGv8A1G9uw
/MduVyB07gg8jzHfDUNNT02rwIIodZu3hoF1HubYyp9oJDGRks7nw+iY+5jNvorPJ86ly+daXMKiS
amma0dRK12jcn4WP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fVbsDq3PM8rgHc6GTI64VmK0E8zRZ2pN7cth4aa
961rMftdyell8Okoqur32awjDfIH1f5AwR8McUUvE+WNWwwyUxjlMUkUxW4YANzBIIswxhEcSx3O7
M3xOeZxsv2cZSaDhOOWZPXXSGpseikAL/lVU/XBkE7pXEHZKMWwqGhga5pOYnbpx/HmizC47HYMWc
XYYraSKvopaScHw5VKkqbEdiD0IO4PQgYfx2Ios541q5RkS1VUwFZSrUZdUFRa7yRgowHQMUjI7a7
cwcZhAA7vL7lF9gDb/d/2xtnGuSHMaCVotvMIsE2xNrNqicgb2STn+l3PQYySm4dzxak5d9z1nm0d
lMYiJA3Njr+G36r298LaqE5s7RutV7PVMMWYSuA469P2VBlkVFF3RCxChnNgCep9uv0wzSKLuRq0p
6E121aee/vvv8sa/wAM/ZzTUeWVP3zpnq62FoWCHaBGG4U9W/V7C3UkeoPskzdaloqvMaRKYSMfGi
DNI4Jv8JACm3ube+OfdXhmm5R4x2mfVF7yQ1o0035+XyVRwfw2/E2crFIh8jTkPVN0I6R/Nv2Fz2v
t6gKoVQAALADpiHk+TUWRZbHQUEWiJNyTuzt1Zj1J/wDtsTcHQxCJtll8Rr3105kOg4DkF//Z
mail: lisa.simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: lisa
uidNumber: 1002
userPassword:: YnJhaW5z
# Maggie Simpson, People, Simpsons, US, example.com
dn: cn=Maggie Simpson,ou=People,o=Simpsons,c=US,dc=example,dc=com
cn: Maggie Simpson
gidNumber: 1000
givenName: Maggie
homeDirectory: /home/users/simpsons/maggie
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs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qZot5/aG7NrpyYkAyTcHYAPtuz+1FFRe5whIMsqx62vCEdNyzJ4OuTGWk1VVk9Et/oHzl
sn7EfasP7H3v/Nbf/wm/wDrRRQ38Td+qMH5fi/oE2w+DBJlb7UWljPDRwwiMMO4JJY889CPtVoUBV
CgYAGAKKKqexnO2O5oqorpGqxqf//Z
mail: maggie.simpson@example.com
o: The Simpsons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: maggie
uidNumber: 1003
userPassword:: ZHVtbXk=
# Marge Simpson, People, Simpsons, US, example.com
dn: cn=Marge Simpson,ou=People,o=Simpsons,c=US,dc=example,dc=com
cn: Marge Simpson
gidNumber: 1000
givenName: Marg
homeDirectory: /home/users/simpsons/marg
jpegPhoto:: R0lGODlhhABwAIcAAAAAAAICBQIEAgUFAQUFBAICCwYICw4EBAsJAgkJCAgJDQ4NCA
0NDQECEgEDGwsMEA4QDhMEAhILAhANARANBBYODhwCARoJARMQAhIQBBURARQRBBcVAhIQCBEQDRQ
SDhgSABkUARwTARwVAB0YARISERsbGwIEIgIEKgEENAAEPAQINAQIOiMBASwCAiIbATUDAz0CAicg
AiogASsjBCskAS0jAS0kAS4oBTEnATQqAjkuATswAz0xATwxBj80BCIiIikpKS8vLzQ0NDk5OT09P
QIFQwEGTAQJRAMITQEFUQEGWwMIUwMIWgIIYwIIbAAGcQAGfwEIdAEIfEICAksBAVIBAV8AAEAzAU
E1AUU2AUU3BEU4AUw8AVA+AWEBAWsCAnIBAXwBAU5ABFRDAlhGAVxHAltJAWFNAWBNBGJQBGVRAmp
UAW1YAW1YBHFZAHFaBHFcAnRaAnVdAXVeBHleAHdgAntiAURERElJSU1NTVJSUllZWV1dXWFhYWVl
ZWxsbHJycnV1dXt7ewAIg4QBAYwBAZIAAJsCAqICAqsCArQDA7sCAoFlAYRpAohqAIptAIxuAo1wA
pN0AZZ5Bph3AJp7AaB/AYF/f8ECAssBA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ons
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
roomNumber: 45
sn: Simpson
telephoneNumber: +15551234567
uid: marg
uidNumber: 1004
userPassword:: Ymx1ZWhhaXI=
# Pets, Simpsons, US, example.com
dn: ou=Pets,o=Simpsons,c=US,dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: Pets
# Santas Little Helper, Pets, Simpsons, US, example.com
dn: cn=Santas Little Helper,ou=Pets,o=Simpsons,c=US,dc=example,dc=com
cn: Santas Little Helper
givenName: Santas Little Helper
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFh
EYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCI
oOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCABn
AEsDASIAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAQGAgUHAwH/xAA8EAACAQMCAwYDAwkJA
AAAAAABAgMABBEFIQYSMRMiQVFhcTKBkRRCogcVI5KhsbLB0TM0U2JygoPw8f/EABoBAAIDAQEAAA
AAAAAAAAAAAAAEAwUGAgH/xAArEQACAgECAwcEAwAAAAAAAAABAgADEQQxEhMhBXGBkbHR8BQyQWF
R4fH/2gAMAwEAAhEDEQA/AOwXNzDZ273FxIsUSDLOxwBXPdS46vYb+WeC4SOJMGK0lQASKTygsSOY
EnyPd8tjm+6lp8Op2MlpcKGjfHUZwQcg+4IqkrwRpdlqsrzS3sskcSFRAOaR+duUkbE4XAzjpk52p
bUV2uBy2xj55Rih6kJ5i5+es834l1uWTtRfiLO4ijhQoP1gWP1+le4451N4RIlnbARFhIDzEzcpwe
XfuZx481e+ncP6d2WpT3ctxfrZzSRrHCzBsKoOCExzOc/uwBVbu9CWfigWF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simpsons,c=US,dc=example,dc=com
cn: simpsons
objectClass: groupOfUniqueNames
objectClass: top
uniqueMember: cn=Bart Simpson,ou=People,o=Simpsons
uniqueMember: cn=Homer Simpson,ou=People,o=Simpsons
uniqueMember: cn=Lisa Simpson,ou=People,o=Simpsons
uniqueMember: cn=Maggie Simpson,ou=People,o=Simpsons
uniqueMember: cn=Marge Simpson,ou=People,o=Simpsons
# search result
search: 2
result: 0 Success
# numResponses: 24
# numEntries: 23

215
doc/ldif-example.com Normal file
View File

@@ -0,0 +1,215 @@
# extended LDIF
#
# LDAPv3
# base <dc=example.com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# example.com
dn: dc=example.com
dc: example.com
objectClass: dNSDomain
# Bad DNs, example.com
dn: ou=Bad DNs,dc=example.com
ou: Bad DNs
objectClass: organizationalUnit
# double plus \2B\2B, Bad DNs, example.com
dn: c=double plus \2B\2B,ou=Bad DNs,dc=example.com
c: double plus ++
objectClass: country
# end dollar$, Bad DNs, example.com
dn: c=end dollar$,ou=Bad DNs,dc=example.com
c: end dollar$
objectClass: country
# multi + value, Bad DNs, example.com
dn: uid=multi+uid=value,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: multi
uid: value
objectClass: inetOrgPerson
# quote\22double, Bad DNs, example.com
dn: uid=quote\22double,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: quote"double
objectClass: inetOrgPerson
# quote'single, Bad DNs, example.com
dn: uid=quote'single,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: quote'single
objectClass: inetOrgPerson
# angle\3Cleft, Bad DNs, example.com
dn: uid=angle\3Cleft,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: angle<left
objectClass: inetOrgPerson
# angle\3Eright, Bad DNs, example.com
dn: uid=angle\3Eright,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: angle>right
objectClass: inetOrgPerson
# sign@at, Bad DNs, example.com
dn: uid=sign@at,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: sign@at
objectClass: inetOrgPerson
# sign\3Bsemicolon@at, Bad DNs, example.com
dn: uid=sign\3Bsemicolon@at,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: sign;semicolon@at
objectClass: inetOrgPerson
# sign?question, Bad DNs, example.com
dn: uid=sign?question,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: sign?question
objectClass: inetOrgPerson
# sign\2Ccomma, Bad DNs, example.com
dn: uid=sign\2Ccomma,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: sign,comma
objectClass: inetOrgPerson
# brace(left, Bad DNs, example.com
dn: uid=brace(left,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: brace(left
objectClass: inetOrgPerson
# brace)right, Bad DNs, example.com
dn: uid=brace)right,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: brace)right
objectClass: inetOrgPerson
# sign%percent, Bad DNs, example.com
dn: uid=sign%percent,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: sign%percent
objectClass: inetOrgPerson
# sign\3Dequal, Bad DNs, example.com
dn: uid=sign\3Dequal,ou=Bad DNs,dc=example.com
uid: sign=equal
cn: Test
sn: Test
objectClass: inetOrgPerson
# sign\2Bplus, Bad DNs, example.com
dn: uid=sign\2Bplus,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: sign+plus
objectClass: inetOrgPerson
# colon\3Bsemi, Bad DNs, example.com
dn: uid=colon\3Bsemi,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: colon;semi
objectClass: inetOrgPerson
# colon:full, Bad DNs, example.com
dn: uid=colon:full,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: colon:full
objectClass: inetOrgPerson
# multi + sign@at, Bad DNs, example.com
dn: uid=multi+uid=sign@at,ou=Bad DNs,dc=example.com
cn: Test
sn: Test
uid: multi
uid: sign@at
objectClass: inetOrgPerson
# sign@at + multi-mixed, Bad DNs, example.com
dn: sn=sign@at+uid=multi-mixed,ou=Bad DNs,dc=example.com
cn: Test
uid: multi-mixed
sn: sign@at
objectClass: inetOrgPerson
# Non English Chars, example.com
dn: ou=Non English Chars,dc=example.com
ou: Non English Chars
objectClass: organizationalUnit
objectClass: top
# \D0\A7\D0\B5\D0\BB\D0\BE\D0\B2\D0\B5\D0\BA\D0\B8, Non English Chars, exampl
e.com
dn:: Y2490KfQtdC70L7QstC10LrQuCxvdT1Ob24gRW5nbGlzaCBDaGFycyxkYz1leGFtcGxlLmNvb
Q==
cn:: 0KfQtdC70L7QstC10LrQuA==
objectClass: inetOrgPerson
objectClass: top
sn:: 0KfQtdC70L7QstC10LrQuA==
# \D0\94\D0\B5\D0\B4 \D0\9B\D0\BE\D0\B3\D0\BE\D0\BF\D0\B5\D0\B4, \D0\A7\D0\B5
\D0\BB\D0\BE\D0\B2\D0\B5\D0\BA\D0\B8, Non English Chars, example.com
dn:: Y2490JTQtdC0INCb0L7Qs9C+0L/QtdC0LGNuPdCn0LXQu9C+0LLQtdC60Lgsb3U9Tm9uIEVuZ
2xpc2ggQ2hhcnMsZGM9ZXhhbXBsZS5jb20=
cn:: 0JTQtdC0INCb0L7Qs9C+0L/QtdC0
givenName:: 0JTQtdC0
jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBw
YIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQs
NFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAAw
AEADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEA
wUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKS
o0NTY3ODk6Q0RFRkdISUpTVFVWV1hZ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WaiRHyf4Sn3BjpnJGKpT6yNe0lk1W0jN2DgTBAN49T716NqOrXXiC1807dm3rIcV5j4mb
7KrZYbsHkUAeW+JIEt7hIYwCqtvwPb/ACKwXBySec1v39nPc3DTshCNwmR1HrVGfT2jIJHFAH9Gkf
xQspdds7KKOWaGZtr3CITHEMcMzdAM4/OuR/aP1qLXPhtqOiaVdQzXV4hQ/PhQMcknFeXeAdRnSzR
xG88UxGx9mVJPTnHGcGuk1+4h1LSnijRHkYlVjk4kVvQHHrQB+f8A4m/Zy8Y380kOnapokEZGS91c
vk+wAQ1zq/svfEC5/cp4i0O2KHaR5UzsT/3yM19ea9aW8R3y3ElndKSWhdBtkB6HBxj6g1w+tarcx
RRXLxS3mmxuE3ohCA9SNwwwP1oA8Ksv2WvHGAl143s40xjba6cznn/eYVFrX7LRuYUjbxa817nkTW
B2MPqrEj9a9jXxZqt4DEkqoVb93DKN3b+8MEHjjI9Kq6j421mwSNL64ESSqytuYOj+gYdvqKAPAvF
/wOv9EtR5z2tyEG3fDuX9GUYryPXfB15axs62ryxhtu+Ebxn6rmvpXW9cilF00+piYDO17cOVK9Mc
9vqO1eQ+LNVSOd3g3NAvJMmUJ+vP9aAP/9k=
objectClass: inetOrgPerson
objectClass: top
sn:: 0JvQvtCz0L7Qv9C10LQ=
# search result
search: 2
result: 0 Success
# numResponses: 26
# numEntries: 25

View File

@@ -0,0 +1,59 @@
TLSCACertificateFile /etc/openldap/pla/ca-bundle.crt
TLSCertificateFile /etc/openldap/pla/slapd.crt
TLSCertificateKeyFile /etc/openldap/pla/slapd.key
access to dn.regex="dc=example.com$"
by * write
access to dn.regex="dc=example,dc=com$"
by * write
access to dn.regex="o=Simpsons$"
by self write
by dn.regex="cn=.*,ou=People,o=Simpsons" write
by * read
access to *
by * read
database ldbm
suffix "dc=example.com"
rootdn "cn=Manager,dc=example.com"
rootpw NotAllowed
directory /var/lib/ldap/pla-1
dirtyread
cachesize 2000
checkpoint 32 1
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
database ldbm
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw NotAllowed
directory /var/lib/ldap/pla-2
dirtyread
cachesize 2000
checkpoint 32 1
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
database ldbm
suffix "o=Simpsons"
rootdn "cn=Manager,o=Simpsons"
rootpw NotAllowed
directory /var/lib/ldap/pla-3
dirtyread
cachesize 2000
checkpoint 32 1
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub

View File

@@ -1,15 +0,0 @@
#!/bin/sh
# $Header: /cvsroot/phpldapadmin/phpldapadmin/doc/test_encoding.sh,v 1.1 2005/02/06 00:37:15 wurley Exp $
# $Id: test_encoding.sh,v 1.1 2005/02/06 00:37:15 wurley Exp $
# Written by: Daniel van Eeden <daniel_e@dds.nl>
# Purpose: test utf-8 encoding
for file in `find . -type f ! -name \*png ! -name \*jpg | egrep -v "^./lang/"`
do
output=`iconv ${file} -o /dev/null 2>&1`
err=$?
output=`echo ${output} | cut -d: -f2`
if [ ${err} != "0" ]; then
echo "${file}:${output}"
fi
done

3
hooks/classes/README Normal file
View File

@@ -0,0 +1,3 @@
Put your hook class files here.
A file wich contains "class MyClass" definition must be called "MyClass.php".

1
hooks/functions/README Normal file
View File

@@ -0,0 +1 @@
Put your hook function files here.

View File

@@ -1,11 +1,9 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.15.2.4 2005/10/22 14:22:47 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.20.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* Adds an attribute/value pair to an object
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn
* - attr
@@ -19,113 +17,116 @@
*/
require './common.php';
require TMPLDIR.'template_config.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
$attr = $_POST['attr'];
$val = isset( $_POST['val'] ) ? $_POST['val'] : false;;
$dn = $_POST['dn'] ;
$is_binary_val = isset( $_POST['binary'] ) ? true : false;
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')));
$encoded_dn = rawurlencode( $dn );
$encoded_attr = rawurlencode( $attr );
$entry['val'] = get_request('val','POST');
$entry['binary'] = get_request('binary','POST');
if( ! $is_binary_val && $val == "" ) {
pla_error( $lang['left_attr_blank'] );
$entry['dn']['string'] = get_request('dn','POST');
$entry['dn']['encode'] = rawurlencode($entry['dn']['string']);
$entry['attr']['string'] = get_request('attr','POST');
$entry['attr']['encode'] = rawurlencode($entry['attr']['string']);
if ((strlen($entry['binary']) <= 0) && (strlen($entry['val']) <= 0))
pla_error(_('You left the attribute value blank. Please go back and try again.'));
/*
* Special case for binary attributes (like jpegPhoto and userCertificate):
* we must go read the data from the file and override $val with the binary data
* Secondly, we must check if the ";binary" option has to be appended to the name
* of the attribute.
*/
# Check to see if this is a unique Attribute
if ($badattr = $ldapserver->checkUniqueAttr($entry['dn']['string'],$entry['attr']['string'],array($entry['val']))) {
$href = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$entry['attr']['string'],$badattr));
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href));
}
// special case for binary attributes (like jpegPhoto and userCertificate):
// we must go read the data from the file and override $val with the binary data
// Secondly, we must check if the ";binary" option has to be appended to the name
// of the attribute.
if (strlen($entry['binary']) > 0) {
if ($_FILES['val']['size'] == 0)
pla_error(_('The file you chose is either empty or does not exist. Please go back and try again.'));
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, array($val) ) ) {
$search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) );
}
if( $is_binary_val ) {
if( 0 == $_FILES['val']['size'] )
pla_error( $lang['file_empty'] );
if( ! is_uploaded_file( $_FILES['val']['tmp_name'] ) ) {
if( isset( $_FILES['val']['error'] ) )
if (! is_uploaded_file($_FILES['val']['tmp_name'])) {
if (isset($_FILES['val']['error']))
switch($_FILES['val']['error']) {
case 0: //no error; possible file attack!
pla_error( $lang['invalid_file'] );
case 0: # No error; possible file attack!
pla_error(_('Security error: The file being uploaded may be malicious.'));
break;
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
pla_error( $lang['uploaded_file_too_big'] );
case 1: # Uploaded file exceeds the upload_max_filesize directive in php.ini
pla_error(_('The file you uploaded is too large. Please check php.ini, upload_max_size setting'));
break;
case 2: //uploaded file exceeds the MAX_FILE_SIZE directive specified in the html form
pla_error( $lang['uploaded_file_too_big'] );
case 2: # Uploaded file exceeds the MAX_FILE_SIZE directive specified in the html form
pla_error(_('The file you uploaded is too large. Please check php.ini, upload_max_size setting'));
break;
case 3: //uploaded file was only partially uploaded
pla_error( $lang['uploaded_file_partial'] );
case 3: # Uploaded file was only partially uploaded
pla_error(_('The file you selected was only partially uploaded, likley due to a network error.'));
break;
case 4: //no file was uploaded
pla_error( $lang['left_attr_blank'] );
case 4: # No file was uploaded
pla_error(_('You left the attribute value blank. Please go back and try again.'));
break;
default: //a default error, just in case! :)
pla_error( $lang['invalid_file'] );
default: # A default error, just in case! :)
pla_error(_('Security error: The file being uploaded may be malicious.'));
break;
}
else
pla_error( $lang['invalid_file'] );
pla_error(_('Security error: The file being uploaded may be malicious.'));
}
$file = $_FILES['val']['tmp_name'];
$f = fopen( $file, 'r' );
$binary_data = fread( $f, filesize( $file ) );
fclose( $f );
$binaryfile['name'] = $_FILES['val']['tmp_name'];
$binaryfile['handle'] = fopen($binaryfile['name'],'r');
$binaryfile['data'] = fread($binaryfile['handle'],filesize($binaryfile['name']));
fclose($binaryfile['handle']);
$val = $binary_data;
$entry['val'] = $binaryfile['data'];
if( is_binary_option_required( $ldapserver, $attr ) )
$attr .= ";binary";
if (is_binary_option_required($ldapserver,$entry['attr']['string']))
$entry['attr']['string'] .= ';binary';
}
/* Automagically hash new userPassword attributes according to the
chosen in config.php. */
if( 0 == strcasecmp( $attr, 'userpassword' ) ) {
if (strcasecmp($entry['attr']['string'],'userpassword') == 0) {
if (trim($ldapserver->default_hash) != '' ) {
$enc_type = $ldapserver->default_hash;
$val = password_hash( $val, $enc_type );
$entry['val'] = password_hash($entry['val'],$enc_type);
}
}
elseif (strcasecmp($attr,'sambaNTPassword') == 0) {
} elseif (strcasecmp($entry['attr']['string'],'sambaNTPassword') == 0) {
$sambapassword = new smbHash;
$val = $sambapassword->nthash($val);
}
$entry['val'] = $sambapassword->nthash($entry['val']);
elseif (strcasecmp($attr,'sambaLMPassword') == 0) {
} elseif (strcasecmp($entry['attr']['string'],'sambaLMPassword') == 0) {
$sambapassword = new smbHash;
$val = $sambapassword->lmhash($val);
$entry['val'] = $sambapassword->lmhash($entry['val']);
}
$new_entry = array( $attr => $val );
$result = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry );
$new_entry = array($entry['attr']['string'] => $entry['val']);
$result = $ldapserver->attrModify($entry['dn']['string'],$new_entry);
if ($result)
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=%s',
$ldapserver->server_id,$encoded_dn,$encoded_attr));
if ($result) {
header(sprintf('Location: cmd.php?cmd=template_engine&server_id=%s&dn=%s&modified_attrs[]=%s',
$ldapserver->server_id,$entry['dn']['encode'],$entry['attr']['encode']));
die();
else
pla_error( $lang['failed_to_add_attr'],$ldapserver->error(),$ldapserver->errno() );
} else {
pla_error(_('Failed to add the attribute.'),$ldapserver->error(),$ldapserver->errno());
}
/**
* Check if we need to append the ;binary option to the name
@@ -136,31 +137,25 @@ else
* @return bool
*/
function is_binary_option_required( $ldapserver, $attr ) {
// list of the binary attributes which need the ";binary" option
function is_binary_option_required($ldapserver,$attr) {
# List of the binary attributes which need the ";binary" option
$binary_attributes_with_options = array(
// Superior: Ldapv3 Syntaxes (1.3.6.1.4.1.1466.115.121.1)
'1.3.6.1.4.1.1466.115.121.1.8' => "userCertificate",
'1.3.6.1.4.1.1466.115.121.1.8' => "caCertificate",
'1.3.6.1.4.1.1466.115.121.1.10' => "crossCertificatePair",
'1.3.6.1.4.1.1466.115.121.1.9' => "certificateRevocationList",
'1.3.6.1.4.1.1466.115.121.1.9' => "authorityRevocationList",
// Superior: Netscape Ldap attributes types (2.16.840.1.113730.3.1)
'2.16.840.1.113730.3.1.40' => "userSMIMECertificate"
# Superior: Ldapv3 Syntaxes (1.3.6.1.4.1.1466.115.121.1)
'1.3.6.1.4.1.1466.115.121.1.8' => 'userCertificate',
'1.3.6.1.4.1.1466.115.121.1.8' => 'caCertificate',
'1.3.6.1.4.1.1466.115.121.1.10' => 'crossCertificatePair',
'1.3.6.1.4.1.1466.115.121.1.9' => 'certificateRevocationList',
'1.3.6.1.4.1.1466.115.121.1.9' => 'authorityRevocationList',
# Superior: Netscape Ldap attributes types (2.16.840.1.113730.3.1)
'2.16.840.1.113730.3.1.40' => 'userSMIMECertificate'
);
// quick check by attr name (short circuits the schema check if possible)
//foreach( $binary_attributes_with_options as $oid => $name )
//if( 0 == strcasecmp( $attr, $name ) )
//return true;
$schema_attr = $ldapserver->getSchemaAttribute($attr);
if( ! $schema_attr )
if (! $schema_attr)
return false;
$syntax = $schema_attr->getSyntaxOID();
if( isset( $binary_attributes_with_options[ $syntax ] ) )
if (isset($binary_attributes_with_options[$syntax]))
return true;
return false;

View File

@@ -1,11 +1,9 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.12.2.1 2005/10/16 20:19:16 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.16.2.2 2007/12/26 09:26:32 wurley Exp $
/**
* Displays a form for adding an attribute/value to an LDAP entry.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
@@ -16,166 +14,153 @@
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
$dn = $_GET['dn'];
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$entry['dn']['string'] = get_request('dn','GET');
$entry['rdn'] = get_rdn($entry['dn']['string']);
$friendly_attrs = process_friendly_attr_table();
printf('<h3 class="title">%s <b>%s</b></h3>',_('Add new attribute'),htmlspecialchars($entry['rdn']));
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($entry['dn']['string']));
include './header.php'; ?>
$dn['attrs'] = $ldapserver->getDNAttrs($entry['dn']['string']);
$dn['oclasses'] = $ldapserver->getDNAttr($entry['dn']['string'],'objectClass');
<body>
if (! is_array($dn['oclasses']))
$dn['oclasses'] = array($dn['oclasses']);
<h3 class="title"><?php echo sprintf( $lang['add_new_attribute'], htmlspecialchars( $rdn ) ); ?></b></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']; ?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
$ldap['attrs']['avail'] = array();
<?php $attrs = get_object_attrs( $ldapserver, $dn );
if (array_search('extensibleObject',$dn['oclasses']) !== false) {
$ldap['attrs']['ldap'] = $ldapserver->SchemaAttributes();
$oclasses = get_object_attr( $ldapserver, $dn, 'objectClass' );
if( ! is_array( $oclasses ) )
$oclasses = array( $oclasses );
foreach ($ldap['attrs']['ldap'] as $attr)
$ldap['attrs']['avail'][] = $attr->getName();
$avail_attrs = array();
} else {
$ldap['oclasses'] = $ldapserver->SchemaObjectClasses($entry['dn']['string']);
$schema_oclasses = $ldapserver->SchemaObjectClasses($dn);
foreach( $oclasses as $oclass ) {
$schema_oclass = $ldapserver->getSchemaObjectClass($oclass,$dn);
foreach ($dn['oclasses'] as $oclass) {
$ldap['oclass'] = $ldapserver->getSchemaObjectClass($oclass,$entry['dn']['string']);
if( $schema_oclass && 0 == strcasecmp( 'objectclass', get_class( $schema_oclass ) ) )
$avail_attrs = array_merge( $schema_oclass->getMustAttrNames( $schema_oclasses ),
$schema_oclass->getMayAttrNames( $schema_oclasses ),
$avail_attrs );
}
$avail_attrs = array_unique( $avail_attrs );
$avail_attrs = array_filter( $avail_attrs, "not_an_attr" );
sort( $avail_attrs );
$avail_binary_attrs = array();
foreach( $avail_attrs as $i => $attr ) {
if( is_attr_binary( $ldapserver, $attr ) ) {
$avail_binary_attrs[] = $attr;
unset( $avail_attrs[ $i ] );
if ($ldap['oclass'] && strcasecmp('objectclass',get_class($ldap['oclass'])) == 0)
$ldap['attrs']['avail'] = array_merge($ldap['oclass']->getMustAttrNames($ldap['oclasses']),
$ldap['oclass']->getMayAttrNames($ldap['oclasses']),
$ldap['attrs']['avail']);
}
}
?>
<br />
$ldap['attrs']['avail'] = array_unique($ldap['attrs']['avail']);
$ldap['attrs']['avail'] = array_filter($ldap['attrs']['avail'],'not_an_attr');
sort($ldap['attrs']['avail']);
<center>
$ldap['binattrs']['avail'] = array();
<?php echo $lang['add_new_attribute'];
foreach ($ldap['attrs']['avail'] as $i => $attr) {
if ($ldapserver->isAttrBinary($attr)) {
$ldap['binattrs']['avail'][] = $attr;
unset($ldap['attrs']['avail'][$i]);
}
}
if( is_array( $avail_attrs ) && count( $avail_attrs ) > 0 ) { ?>
echo '<center>';
<br />
<br />
if (is_array($ldap['attrs']['avail']) && count($ldap['attrs']['avail']) > 0) {
echo '<br />';
echo _('Add new attribute');
echo '<br />';
echo '<br />';
<form action="add_attr.php" method="post">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="add_attr" />';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
<select name="attr">
echo '<select name="attr">';
<?php $attr_select_html = '';
usort($avail_attrs,"sortAttrs");
foreach( $avail_attrs as $a ) {
$attr_select_html = '';
usort($ldap['attrs']['avail'],'sortAttrs');
// is there a user-friendly translation available for this attribute?
if( isset( $friendly_attrs[ strtolower( $a ) ] ) ) {
$attr_display = htmlspecialchars( $friendly_attrs[ strtolower( $a ) ] ) . " (" .
htmlspecialchars($a) . ")";
foreach ($ldap['attrs']['avail'] as $a) {
# is there a user-friendly translation available for this attribute?
if ($_SESSION[APPCONFIG]->haveFriendlyName($a)) {
$attr_display = sprintf('%s (%s)',
htmlspecialchars($_SESSION[APPCONFIG]->getFriendlyName($a)),
htmlspecialchars($a));
} else {
$attr_display = htmlspecialchars( $a );
$attr_display = htmlspecialchars($a);
}
echo $attr_display;
$attr_select_html .= "<option>$attr_display</option>\n";
echo "<option value=\"" . htmlspecialchars($a) . "\">$attr_display</option>";
} ?>
printf('<option value="%s">%s</option>',htmlspecialchars($a),$attr_display);
}
</select>
echo '</select>';
<input type="text" name="val" size="20" />
<input type="submit" name="submit" value="<?php echo $lang['add']; ?>" class="update_dn" />
</form>
echo '<input type="text" name="val" size="20" />';
printf('<input type="submit" name="submit" value="%s" class="update_dn" />',_('Add'));
echo '</form>';
<?php } else { ?>
} else {
echo '<br />';
printf('<small>(%s)</small>',_('no new attributes available for this entry'));
}
<br />
<br />
<small>(<?php echo $lang['no_new_attrs_available']; ?>)</small>
<br />
<br />
if (count($ldap['binattrs']['avail']) > 0) {
echo '<br />';
echo _('Add new binary attribute');
echo '<br />';
echo '<br />';
<?php } ?>
echo '<!-- Form to add a new BINARY attribute to this entry -->';
echo '<form action="cmd.php" method="post" enctype="multipart/form-data">';
echo '<input type="hidden" name="cmd" value="add_attr" />';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',$entry['dn']['string']);
echo '<input type="hidden" name="binary" value="true" />';
<?php echo $lang['add_new_binary_attr'];
if( count( $avail_binary_attrs ) > 0 ) { ?>
echo '<select name="attr">';
<!-- Form to add a new BINARY attribute to this entry -->
<form action="add_attr.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="binary" value="true" />
<br />
$attr_select_html = '';
usort($ldap['binattrs']['avail'],'sortAttrs');
<select name="attr">
foreach ($ldap['binattrs']['avail'] as $a) {
<?php $attr_select_html = '';
usort($avail_binary_attrs,"sortAttrs");
foreach( $avail_binary_attrs as $a ) {
// is there a user-friendly translation available for this attribute?
if( isset( $friendly_attrs[ strtolower( $a ) ] ) ) {
$attr_display = htmlspecialchars( $friendly_attrs[ strtolower( $a ) ] ) . " (" .
htmlspecialchars($a) . ")";
# is there a user-friendly translation available for this attribute?
if ($_SESSION[APPCONFIG]->haveFriendlyName($a)) {
$attr_display = sprintf('%s (%s)',
htmlspecialchars($_SESSION[APPCONFIG]->getFriendlyName($a)),
htmlspecialchars($a));
} else {
$attr_display = htmlspecialchars( $a );
$attr_display = htmlspecialchars($a);
}
echo $attr_display;
$attr_select_html .= "<option>$attr_display</option>\n";
echo "<option value=\"" . htmlspecialchars($a) . "\">$attr_display</option>";
} ?>
printf('<option value="%s">%s</option>',htmlspecialchars($a),$attr_display);
}
</select>
echo '</select>';
<input type="file" name="val" size="20" />
<input type="submit" name="submit" value="<?php echo $lang['add']; ?>" class="update_dn" />
echo '<input type="file" name="val" size="20" />';
printf('<input type="submit" name="submit" value="%s" class="update_dn" />',_('Add'));
<?php if( ! ini_get( 'file_uploads' ) )
echo "<br><small><b>" . $lang['warning_file_uploads_disabled'] . "</b></small><br>";
if (! ini_get('file_uploads'))
printf('<br /><small><b>%s</b></small><br />',
_('Your PHP configuration has disabled file uploads. Please check php.ini before proceeding.'));
else
echo "<br><small><b>" . sprintf( $lang['max_file_size'], ini_get( 'upload_max_filesize' ) ) . "</b></small><br>";
?>
printf('<br /><small><b>%s: %s</b></small><br />',_('Maximum file size'),ini_get('upload_max_filesize'));
</form>
echo '</form>';
<?php } else { ?>
} else {
echo '<br />';
printf('<small>(%s)</small>',_('no new binary attributes available for this entry'));
}
<br />
<br />
<small>(<?php echo $lang['no_new_binary_attrs_available']; ?>)</small>
<?php } ?>
</center>
</body>
</html>
<?php
echo '</center>';
/**
* Given an attribute $x, this returns true if it is NOT already specified
@@ -185,13 +170,13 @@ if( count( $avail_binary_attrs ) > 0 ) { ?>
* @return bool
* @ignore
*/
function not_an_attr( $x ) {
global $attrs;
function not_an_attr($x) {
global $dn;
//return ! isset( $attrs[ strtolower( $x ) ] );
foreach( $attrs as $attr => $values )
if( 0 == strcasecmp( $attr, $x ) )
foreach ($dn['attrs'] as $attr => $values)
if (strcasecmp($attr,$x) == 0)
return false;
return true;
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass.php,v 1.16.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass.php,v 1.19 2007/12/15 07:50:30 wurley Exp $
/**
* Adds an objectClass to the specified dn.
@@ -7,8 +7,6 @@
* Note, this does not do any schema violation checking. That is
* performed in add_oclass_form.php.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn (rawurlencoded)
* - new_oclass
@@ -21,44 +19,48 @@
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
$dn = rawurldecode( $_POST['dn'] );
$new_oclass = unserialize( rawurldecode( $_POST['new_oclass'] ) );
$new_attrs = $_POST['new_attrs'];
if ($ldapserver->isAttrReadOnly('objectClass'))
pla_error(_('ObjectClasses are flagged as read only in the phpLDAPadmin configuration.'));
$encoded_dn = rawurlencode( $dn );
$entry['dn']['encode'] = get_request('dn');
$entry['dn']['string'] = urldecode($entry['dn']['encode']);
if( is_attr_read_only( $ldapserver, 'objectClass' ) )
pla_error( "ObjectClasses are flagged as read only in the phpLDAPadmin configuration." );
$entry['new']['oclass'] = unserialize(rawurldecode(get_request('new_oclass')));
$entry['new']['attrs'] = get_request('new_attrs');
$new_entry = array();
$new_entry['objectClass'] = $new_oclass;
$new_entry['objectClass'] = $entry['new']['oclass'];
$new_attrs_entry = array();
$new_oclass_entry = array( 'objectClass' => $new_oclass );
if (is_array($entry['new']['attrs']) && count($entry['new']['attrs']) > 0)
foreach ($entry['new']['attrs'] as $attr => $val) {
if( is_array( $new_attrs ) && count( $new_attrs ) > 0 )
foreach( $new_attrs as $attr => $val ) {
# Check to see if this is a unique Attribute
if ($badattr = $ldapserver->checkUniqueAttr($entry['dn']['string'],$attr,array($val))) {
$href['search'] = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$attr,$badattr));
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, array($val) ) ) {
$search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) );
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$entry['dn']['string'],$href['search']));
}
$new_entry[ $attr ] = $val;
$new_entry[$attr] = $val;
}
$add_res = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry );
$result = $ldapserver->attrModify($entry['dn']['string'],$new_entry);
if (! $add_res)
pla_error($lang['could_not_perform_ldap_mod_add'],$ldapserver->error(),$ldapserver->errno());
if (! $result)
pla_error(_('Could not perform ldap_mod_add operation.'),$ldapserver->error(),$ldapserver->errno());
else
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=objectclass',$ldapserver->server_id,$encoded_dn));
else {
$modified_attrs = array_keys($entry['new']['attrs']);
$modified_attrs[] = 'objectclass';
$href['complete'] = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s&modified_attrs=%s',
$ldapserver->server_id,$entry['dn']['encode'],serialize($modified_attrs));
header(sprintf('Location: %s',$href['complete']));
die();
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.20.2.3 2005/10/22 11:55:31 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.25 2007/12/15 07:50:30 wurley Exp $
/**
* This page may simply add the objectClass and take you back to the edit page,
@@ -9,8 +9,6 @@
* attributes with 1 or more not defined by the object. In that case, we will
* present a form for the user to add those attributes to the object.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as REQUEST vars:
* - dn (rawurlencoded)
* - new_oclass
@@ -22,116 +20,102 @@
*/
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$entry['oclass']['new'] = get_request('new_oclass','REQUEST');
$entry['dn']['string'] = get_request('dn','REQUEST');
if (! isset($_POST['new_oclass']))
pla_error( $lang['no_objectclasses_selected']);
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
$new_oclass = $_REQUEST['new_oclass'];
$dn = rawurldecode( $_REQUEST['dn'] );
$encoded_dn = rawurlencode( $dn );
if (! $entry['oclass']['new'])
pla_error(_('You did not select any ObjectClasses for this object. Please go back and do so.'));
/* Ensure that the object has defined all MUST attrs for this objectClass.
* If it hasn't, present a form to have the user enter values for all the
* newly required attrs. */
* newly required attrs.
*/
$entry = get_object_attrs( $ldapserver, $dn, true );
$entry['dn']['attrs'] = $ldapserver->getDNAttrs($entry['dn']['string'],true);
$current_attrs = array();
foreach( $entry as $attr => $junk )
$current_attrs[] = strtolower($attr);
$entry['attrs']['current'] = array();
foreach ($entry['dn']['attrs'] as $attr => $junk)
$entry['attrs']['current'][] = strtolower($attr);
// grab the required attributes for the new objectClass
$schema_oclasses = $ldapserver->SchemaObjectClasses();
$must_attrs = array();
foreach( $new_oclass as $oclass_name ) {
$oclass = $ldapserver->getSchemaObjectClass($oclass_name);
if( $oclass )
$must_attrs = array_merge( $must_attrs, $oclass->getMustAttrNames( $schema_oclasses ) );
# Grab the required attributes for the new objectClass
$ldap['oclasses'] = $ldapserver->SchemaObjectClasses();
$ldap['attrs']['must'] = array();
foreach ($entry['oclass']['new'] as $oclass_name) {
$ldap['oclass'] = $ldapserver->getSchemaObjectClass($oclass_name);
if ($ldap['oclass'])
$ldap['attrs']['must'] = array_merge($ldap['attrs']['must'],$ldap['oclass']->getMustAttrNames($ldap['oclasses']));
}
$must_attrs = array_unique( $must_attrs );
$ldap['attrs']['must'] = array_unique($ldap['attrs']['must']);
// We don't want any of the attr meta-data, just the string
//foreach( $must_attrs as $i => $attr )
//$must_attrs[$i] = $attr->getName();
// build a list of the attributes that this new objectClass requires,
// but that the object does not currently contain
$needed_attrs = array();
foreach( $must_attrs as $attr ) {
/* Build a list of the attributes that this new objectClass requires,
* but that the object does not currently contain
*/
$ldap['attrs']['need'] = array();
foreach ($ldap['attrs']['must'] as $attr) {
$attr = $ldapserver->getSchemaAttribute($attr);
//echo "<pre>"; var_dump( $attr ); echo "</pre>";
// First, check if one of this attr's aliases is already an attribute of this entry
foreach( $attr->getAliases() as $alias_attr_name )
if( in_array( strtolower( $alias_attr_name ), $current_attrs ) )
// Skip this attribute since it's already in the entry
# First, check if one of this attr's aliases is already an attribute of this entry
foreach ($attr->getAliases() as $alias_attr_name)
if (in_array(strtolower($alias_attr_name),$entry['attrs']['current']))
continue;
if( in_array( strtolower($attr->getName()), $current_attrs ) )
if (in_array(strtolower($attr->getName()),$entry['attrs']['current']))
continue;
// We made it this far, so the attribute needs to be added to this entry in order
// to add this objectClass
$needed_attrs[] = $attr;
/* We made it this far, so the attribute needs to be added to this entry in order
* to add this objectClass */
$ldap['attrs']['need'][] = $attr;
}
if( count( $needed_attrs ) > 0 ) {
include './header.php'; ?>
<body>
if (count($ldap['attrs']['need']) > 0) {
printf('<h3 class="title">%s</h3>',_('New Required Attributes'));
printf('<h3 class="subtitle">%s %s %s</h3>',_('This action requires you to add'),count($ldap['attrs']['need']),_('new attributes'));
<h3 class="title"><?php echo $lang['new_required_attrs']; ?></h3>
<h3 class="subtitle"><?php echo $lang['requires_to_add'] . ' ' . count($needed_attrs) .
' ' . $lang['new_attributes']; ?></h3>
printf('<small><b>%s: </b>%s <b>%s</b> %s %s</small>',
_('Instructions'),
_('In order to add these objectClass(es) to this entry, you must specify'),
count($ldap['attrs']['need']),_('new attributes'),
_('that this objectClass requires.'));
<small>
echo '<br /><br />';
<?php echo $lang['new_required_attrs_instructions'];
echo ' ' . count( $needed_attrs ) . ' ' . $lang['new_attributes'] . ' ';
echo $lang['that_this_oclass_requires']; ?>
echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="add_oclass" />';
printf('<input type="hidden" name="new_oclass" value="%s" />',rawurlencode(serialize($entry['oclass']['new'])));
printf('<input type="hidden" name="dn" value="%s" />',rawurlencode($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
</small>
echo '<table class="edit_dn" cellspacing="0">';
printf('<tr><th colspan="2">%s</th></tr>',_('New Required Attributes'));
<br />
<br />
foreach ($ldap['attrs']['need'] as $count => $attr) {
printf('<tr><td class="attr">%s</td></tr>',htmlspecialchars($attr->getName()));
printf('<tr><td class="val"><input type="text" name="new_attrs[%s]" value="" size="40" /></td></tr>',htmlspecialchars($attr->getName()));
}
<form action="add_oclass.php" method="post">
<input type="hidden" name="new_oclass" value="<?php echo rawurlencode( serialize( $new_oclass ) ); ?>" />
<input type="hidden" name="dn" value="<?php echo $encoded_dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
echo '</table>';
<table class="edit_dn" cellspacing="0">
<tr><th colspan="2"><?php echo $lang['new_required_attrs']; ?></th></tr>
echo '<br /><br />';
<?php foreach( $needed_attrs as $count => $attr ) { ?>
printf('<center><input type="submit" value="%s" /></center>',_('Add ObjectClass and Attributes'));
echo '</form>';
<tr><td class="attr"><b><?php echo htmlspecialchars($attr->getName()); ?></b></td></tr>
<tr><td class="val"><input type="text" name="new_attrs[<?php echo htmlspecialchars($attr->getName()); ?>]" value="" size="40" /></tr>
<?php } ?>
} else {
$result = $ldapserver->attrModify($entry['dn']['string'],array('objectClass'=>$entry['oclass']['new']));
</table>
<br />
<br />
<center><input type="submit" value="<?php echo $lang['add_oclass_and_attrs']; ?>" /></center>
</form>
if (! $result)
pla_error('Could not perform ldap_mod_add operation.',$ldapserver->error(),$ldapserver->errno());
</body>
</html>
<?php } else {
$add_res = @ldap_mod_add( $ldapserver->connect(), $dn, array( 'objectClass' => $new_oclass ) );
if (! $add_res)
pla_error("Could not perform ldap_mod_add operation.",
$ldapserver->error(),$ldapserver->errno());
else
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=objectClass',
$ldapserver->server_id,$encoded_dn));
else {
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s&modified_attrs[]=objectClass',
$ldapserver->server_id,rawurlencode($entry['dn']['string']));
header(sprintf('Location: %s',$href));
die();
}
}
?>

View File

@@ -1,11 +1,9 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.18.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.21.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* Adds a value to an attribute for a given dn.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn (rawurlencoded)
* - attr (rawurlencoded) the attribute to which we are adding a value
@@ -19,56 +17,68 @@
/**
*/
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')));
$attr = $_POST['attr'];
$new_value = $_POST['new_value'];
$dn = rawurldecode( $_POST['dn'] );
$is_binary_val = isset( $_POST['binary'] ) ? true : false;
# The DN and ATTR we are working with.
$entry['dn']['encode'] = get_request('dn','POST',true);
$entry['dn']['string'] = rawurldecode($entry['dn']['encode']);
$entry['attr']['encode'] = get_request('attr','POST',true);
$entry['attr']['string'] = rawurldecode($entry['attr']['encode']);
$entry['attr']['html'] = htmlspecialchars($entry['attr']['string']);
$encoded_dn = rawurlencode( $dn );
$encoded_attr = rawurlencode( $attr );
$entry['value']['string'] = get_request('new_value','POST',true);
$entry['value']['bin'] = get_request('binary','POST') ? true : false;
if( is_attr_read_only( $ldapserver, $attr ) )
pla_error(sprintf($lang['attr_is_read_only'],htmlspecialchars( $attr )));
if ($ldapserver->isAttrReadOnly($entry['attr']['string']))
pla_error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),$entry['attr']['html']));
// special case for binary attributes:
// we must go read the data from the file.
if( $is_binary_val ) {
$file = $_FILES['new_value']['tmp_name'];
/*
* Special case for binary attributes:
* we must go read the data from the file.
*/
if ($entry['value']['bin']) {
$binaryfile['name'] = $_FILES['new_value']['tmp_name'];
$binaryfile['handle'] = fopen($binaryfile['name'],'r');
$binaryfile['data'] = fread($binaryfile['handle'],filesize($binaryfile['name']));
fclose($binaryfile['handle']);
$f = fopen( $file, 'r' );
$binary_value = fread( $f, filesize( $file ) );
fclose( $f );
$new_value = $binary_value;
$entry['value']['string'] = $binaryfile['data'];
}
$new_entry = array( $attr => $new_value );
$new_entry = array($entry['attr']['string']=>$entry['value']['string']);
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, $new_entry ) ) {
$search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) );
# Check to see if this is a unique Attribute
if ($badattr = $ldapserver->checkUniqueAttr($entry['dn']['string'],$entry['attr']['string'],$new_entry)) {
$href = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$entry['attr']['string'],$badattr));
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href));
}
// Call the custom callback for each attribute modification
// and verify that it should be modified.
if( run_hook ( 'pre_attr_add', array ( 'server_id' => $ldapserver->server_id, 'dn' => $dn, 'attr_name' => $attr,
'new_value' => $new_entry ) ) ) {
# Call the custom callback for each attribute modification and verify that it should be modified.
if (run_hook('pre_attr_add',
array('server_id'=>$ldapserver->server_id,'dn'=> $entry['dn']['string'],'attr_name'=>$entry['attr']['string'],'new_value'=>$new_entry))) {
$add_result = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry );
if (run_hook('pre_attr_modify',
array('server_id'=>$ldapserver->server_id,'dn'=>$entry['dn']['string'],'attr_name'=>$entry['attr']['string'],'new_value'=>$new_entry))) {
if (! $add_result)
pla_error($lang['could_not_perform_ldap_mod_add'],
$ldapserver->error(),$ldapserver->errno());
$add_result = $ldapserver->attrModify($entry['dn']['string'],$new_entry);
if (! $add_result) {
pla_error(_('Could not perform ldap_mod_add operation.'),
$ldapserver->error(),$ldapserver->errno());
} else {
run_hook('post_attr_modify',
array('server_id'=>$ldapserver->server_id,'dn'=>$entry['dn']['string'],'attr_name'=>$entry['attr']['string'],'new_value'=>$new_entry));
}
}
}
header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=%s',
$ldapserver->server_id,$encoded_dn,$encoded_attr));
header(sprintf('Location: cmd.php?cmd=template_engine&server_id=%s&dn=%s&modified_attrs[]=%s',
$ldapserver->server_id,$entry['dn']['encode'],$entry['attr']['encode']));
die();
?>

View File

@@ -1,16 +1,10 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.32.2.2 2005/10/16 20:19:16 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.39.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* Displays a form to allow the user to enter a new value to add
* to the existing list of values for a multi-valued attribute.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
* - attr (rawurlencoded) the attribute to which we are adding a value
*
* @package phpLDAPadmin
*/
/**
@@ -18,194 +12,368 @@
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error( $lang['no_updates_in_read_only_mode'] );
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
$attr = $_GET['attr'];
$dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null;
$encoded_dn = rawurlencode( $dn );
$encoded_attr = rawurlencode( $attr );
if (! is_null($dn))
$rdn = get_rdn( $dn );
# The DN and ATTR we are working with.
$entry['dn']['encode'] = get_request('dn','GET',true);
$entry['dn']['string'] = urldecode($entry['dn']['encode']);
$entry['dn']['html'] = htmlspecialchars($entry['dn']['string']);
$entry['attr']['string'] = get_request('attr','GET',true);
$entry['attr']['encode'] = rawurlencode($entry['attr']['string']);
$entry['attr']['html'] = htmlspecialchars($entry['attr']['string']);
if (! is_null($entry['dn']['string']))
$entry['rdn']['string'] = get_rdn($entry['dn']['string']);
else
$rdn = null;
$entry['rdn']['string'] = null;
$entry['rdn']['html'] = htmlspecialchars($entry['rdn']['string']);
$current_values = get_object_attr( $ldapserver, $dn, $attr );
$num_current_values = ( is_array($current_values) ? count($current_values) : 0 );
$is_object_class = ( 0 == strcasecmp( $attr, 'objectClass' ) ) ? true : false;
$is_jpeg_photo = is_jpeg_photo( $ldapserver, $attr ); //( 0 == strcasecmp( $attr, 'jpegPhoto' ) ) ? true : false;
/***************/
/* get entry */
/***************/
if (! $entry['dn']['string'] || ! $ldapserver->dnExists($entry['dn']['string']))
pla_error(sprintf(_('The entry (%s) does not exist.'),$entry['dn']['html']),null,-1,true);
if( $is_object_class ) {
// fetch all available objectClasses and remove those from the list that are already defined in the entry
$schema_oclasses = $ldapserver->SchemaObjectClasses();
$tree = get_cached_item($ldapserver->server_id,'tree');
$entry['ldap'] = null;
if ($tree) {
$entry['ldap'] = $tree->getEntry($entry['dn']['string']);
foreach( $current_values as $oclass )
unset( $schema_oclasses[ strtolower( $oclass ) ] );
if (! $entry['ldap'])
$tree->addEntry($entry['dn']['string']);
} else {
$schema_attr = $ldapserver->getSchemaAttribute($attr);
$entry['ldap'] = $tree->getEntry($entry['dn']['string']);
}
include './header.php'; ?>
// define the template of the entry if possible
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_reader').'($ldapserver);');
$reader->visit('Start', $entry['ldap']);
<body>
if (! $entry['ldap'] || $entry['ldap']->isReadOnly())
pla_error(sprintf(_('The entry (%s) is in readonly mode.'),$entry['dn']['html']),null,-1,true);
<h3 class="title">
<?php echo $lang['add_new']; ?>
<b><?php echo htmlspecialchars($attr); ?></b>
<?php echo $lang['value_to']; ?>
<b><?php echo htmlspecialchars($rdn); ?></b></h3>
/*********************/
/* attribute values */
/*********************/
<h3 class="subtitle">
<?php echo $lang['server']; ?>:
<b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp;
<?php echo $lang['distinguished_name']; ?>: <b><?php echo htmlspecialchars( $dn ); ?></b></h3>
eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_writer').'($ldapserver);');
<?php echo $lang['current_list_of']; ?> <b><?php echo $num_current_values; ?></b>
<?php echo $lang['values_for_attribute']; ?> <b><?php echo htmlspecialchars($attr); ?></b>:
$ldap['attr'] = $entry['ldap']->getAttribute($entry['attr']['string']);
if (!$ldap['attr']) {
// define a new attribute for the entry
$attributefactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','attribute_factory');
eval('$attribute_factory = new '.$attributefactoryclass.'();');
$ldap['attr'] = $attribute_factory->newAttribute($entry['attr']['string'], array());
$ldap['attr']->setEntry($entry['ldap']);
}
$ldap['count'] = $ldap['attr']->getValueCount();
<?php if ($num_current_values) { ?>
<?php if( $is_jpeg_photo ) { ?>
if ($ldap['attr']->isReadOnly())
pla_error(sprintf(_('The attribute (%s) is in readonly mode.'),$entry['attr']['html']),null,-1,true);
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')));
if (($ldap['attr']->getValueCount() == 0) && ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')));
<table><tr><td>
<?php draw_jpeg_photos( $ldapserver, $dn, $attr, false ); ?>
</td></tr></table>
/*
$ldap['attrs'] = $ldapserver->getDNAttr($entry['dn']['string'],$entry['attr']['string']);
$ldap['count'] = count($ldap['attrs']);
*/
<!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
<p><small>
<?php echo $lang['inappropriate_matching_note']; ?>
</small></p>
<!-- End of temporary warning -->
$entry['attr']['oclass'] = (strcasecmp($entry['attr']['string'],'objectClass') == 0) ? true : false;
<?php } else if( is_attr_binary( $ldapserver, $attr ) ) { ?>
<ul>
if ($entry['attr']['oclass']) {
# Fetch all available objectClasses and remove those from the list that are already defined in the entry
$ldap['oclasses'] = $ldapserver->SchemaObjectClasses();
<?php if( is_array( $vals ) ) {
foreach($ldap['attr']->getValues() as $oclass)
unset($ldap['oclasses'][strtolower($oclass)]);
} else {
$ldap['schema'] = $ldapserver->getSchemaAttribute($entry['attr']['string']);
}
for( $i=1; $i<=count($vals); $i++ ) {
printf('<h3 class="title">%s <b>%s</b> %s <b>%s</b></h3>',
_('Add new'),$entry['attr']['html'],_('value to'),$entry['rdn']['html']);
printf('<h3 class="subtitle">%s <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),$entry['dn']['html']);
if ($ldap['count']) {
printf('%s <b>%s</b> %s <b>%s</b>%s',
_('Current list of'),$ldap['count'],_('values for attribute'),$ldap['attr']->getFriendlyName(),_(':'));
} else {
printf('%s <b>%s</b>.',
_('No current value for attribute'),$ldap['attr']->getFriendlyName());
}
if ($entry['attr']['oclass']) {
echo '<form action="cmd.php" method="post" class="new_value" name="entry_form">';
echo '<input type="hidden" name="cmd" value="add_oclass_form" />';
} else {
echo '<form action="cmd.php" method="post" class="new_value" name="entry_form" enctype="multipart/form-data" onSubmit="return submitForm(this)">';
echo '<input type="hidden" name="cmd" value="update_confirm" />';
//printf('<input type="hidden" name="attr" value="%s" />',$entry['attr']['encode']);
}
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="dn" value="%s" />',$entry['dn']['encode']);
if ($ldap['count']) {
// display current attribute values
echo '<table class="edit_dn" cellspacing="0" cellpadding="0" align="center"><tr><td>';
for ($i = 0; $i < $ldap['count']; $i++) {
$writer->draw('OldValue', $ldap['attr'], $i);
$writer->draw('ReadOnlyValue', $ldap['attr'], $i);
}
echo '</td></tr></table>';
/*
if ($ldapserver->isJpegPhoto($entry['attr']['string'])) {
printf('<table><tr><td>%s</td></tr></table>',
draw_jpeg_photos($ldapserver,$entry['dn']['string'],$entry['attr']['string'],false));
# <!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
printf('<p><small>%s</small></p>',
_('Note: You will get an "inappropriate matching" error if you have not setup an EQUALITY rule on your LDAP server for this attribute.'));
# <!-- End of temporary warning -->
} elseif ($ldapserver->isAttrBinary($entry['attr']['string'])) {
echo '<ul>';
for ($i=1; $i<=count($vals); $i++) {
$href = sprintf('download_binary_attr.php?server_id=%s&amp;dn=%s&amp;attr=%s&amp;value_num=%s',
$ldapserver->server_id,$encoded_dn,$attr,$i-1); ?>
$ldapserver->server_id,$entry['dn']['encode'],$entry['attr']['string'],$i-1);
<li><a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value'] . ' ' . $i; ?>)</a></li>
<?php }
printf('<li><a href="%s"><img src="images/save.png" alt="Save" />%s (%s)</a></li>',
$href,_('download value'),$i);
}
echo '</ul>';
# <!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
printf('<p><small>%s</small></p>',
_('Note: You will get an "inappropriate matching" error if you have not setup an EQUALITY rule on your LDAP server for this attribute.'));
# <!-- End of temporary warning -->
} else {
$href = sprintf('download_binary_attr.php?server_id=%s&amp;dn=%s&amp;attr=%s',$ldapserver->server_id,$encoded_dn,$attr); ?>
<li><a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?></a></li>
<?php } ?>
echo '<ul class="current_values">';
if (strcasecmp($entry['attr']['string'],'userPassword') == 0) {
foreach ($ldap['attrs'] as $key => $value) {
if (obfuscate_password_display(get_enc_type($value)))
echo '<li><span style="white-space: nowrap;">'.preg_replace('/./','*',$value).'<br /></li>';
else
echo '<li><span style="white-space: nowrap;">'.htmlspecialchars($value).'<br /></li>';
}
</ul>
<!-- Temporary warning until we find a way to add jpegPhoto values without an INAPROPRIATE_MATCHING error -->
<p><small>
<?php echo $lang['inappropriate_matching_note']; ?>
</small></p>
<!-- End of temporary warning -->
} else {
foreach ($ldap['attrs'] as $val)
printf('<li><span style="white-space: nowrap;">%s</span></li>',htmlspecialchars($val));
}
echo '</ul>';
}
*/
} else {
echo '<br /><br />';
}
<?php } else { ?>
echo _('Enter the value you would like to add:');
echo '<br /><br />';
<ul class="current_values">
if ($entry['attr']['oclass']) {
// draw objectClass selection
echo '<table class="edit_dn" cellspacing="0" cellpadding="0" align="center"><tr><td>';
echo '<select name="new_oclass[]" multiple="true" size="15">';
foreach ($ldap['oclasses'] as $name => $oclass) {
# exclude any structural ones, as they'll only generate an LDAP_OBJECT_CLASS_VIOLATION
if ($oclass->getType() == 'structural')
continue;
<?php if( is_array( $current_values ) ) /*$num_current_values > 1 )*/ {
printf('<option value="%s">%s</option>',$oclass->getName(),$oclass->getName());
}
echo '</select>';
echo '</td></tr><tr><td>';
foreach( $current_values as $val ) { ?>
<li><nobr><?php echo htmlspecialchars(($val)); ?></nobr></li>
<?php } ?>
echo '<br />';
printf('<input id="save_button" type="submit" value="%s" />',_('Add new ObjectClass'));
echo '</td></tr></table>';
echo '<br />';
<?php } else { ?>
<li><nobr><?php echo htmlspecialchars(($current_values)); ?></nobr></li>
<?php } ?>
if ($_SESSION[APPCONFIG]->GetValue('appearance','show_hints'))
printf('<small><br /><img src="images/light.png" alt="Hint" /><span class="hint">%s</span></small>',
_('Note: You may be required to enter new attributes that these objectClass(es) require'));
echo '</form>';
</ul>
} else {
// draw a blank field
echo '<table class="edit_dn" cellspacing="0" cellpadding="0" align="center"><tr><td>';
$writer->draw('BlankValue', $ldap['attr'], $ldap['count']);
echo '</td></tr><tr><td>';
/*
if ($ldapserver->isAttrBinary($entry['attr']['string'])) {
echo '<input type="file" name="new_value" />';
echo '<input type="hidden" name="binary" value="true" />';
<?php } ?>
<?php } else { ?>
<br />
<br />
<?php } ?>
} else {
if ($ldapserver->isMultiLineAttr($entry['attr']['string'])) {
echo '<textarea name="new_value" rows="3" cols="30"></textarea>';
} else {
printf('<input type="text"%s name="new_value" size="40" value="" />',
($ldap['attr']->getMaxLength() ? sprintf(' maxlength="%s"',$ldap['attr']->getMaxLength()) : ''));
<?php echo $lang['enter_value_to_add']; ?>
<br />
<br />
# Draw the "browse" button next to this input box if this attr houses DNs:
if ($ldapserver->isDNAttr($entry['attr']['string']))
draw_chooser_link("new_value_form.new_value", false);
}
}
*/
<?php if( $is_object_class ) { ?>
if ($ldap['schema']->getDescription())
printf('<small><b>%s:</b> %s</small><br />',_('Description'),$ldap['schema']->getDescription());
<form action="add_oclass_form.php" method="post" class="new_value">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $encoded_dn; ?>" />
<select name="new_oclass[]" multiple="true" size="15">
if ($ldap['schema']->getType())
printf('<small><b>%s:</b> %s</small><br />',_('Syntax'),$ldap['schema']->getType());
<?php foreach( $schema_oclasses as $name => $oclass ) {
if ($ldap['schema']->getMaxLength())
printf('<small><b>%s:</b> %s %s</small><br />',
_('Maximum Length'),number_format($ldap['schema']->getMaxLength()),_('characters'));
// exclude any structural ones, as they'll only generate an LDAP_OBJECT_CLASS_VIOLATION
if ($oclass->getType() == "structural") continue; ?>
echo '<br />';
printf('<input type="submit" id="save_button" name="submit" value="%s" />',_('Add New Value'));
echo '</td></tr></table>';
<option value="<?php echo $oclass->getName(); ?>"><?php echo $oclass->getName(); ?></option>
echo '</form>';
<?php } ?>
// javascript
echo '<script type="text/javascript" language="javascript">
function pla_getComponentById(id) {
return document.getElementById(id);
}
</select>
<br />
<input type="submit" value="<?php echo $lang['add_new_objectclass']; ?>" />
function pla_getComponentsByName(name) {
return document.getElementsByName(name);
}
<br />
<?php if ($config->GetValue('appearance','show_hints')) { ?>
<small>
<br />
<img src="images/light.png" /><span class="hint"><?php echo $lang['new_required_attrs_note']; ?></span>
</small>
<?php }
function pla_getComponentValue(component) {
if (component.type == "checkbox") {
if (component.checked) return component.value;
} else if (component.type == "select-one") {
if (component.selectedIndex >= 0) return component.options[component.selectedIndex].value;
} else if (component.type == "select-multiple") {
if (component.selectedIndex >= 0) return component.options[component.selectedIndex].value;
} else if (component.type == undefined) { // option
if (component.selected) return component.value;
} else {
return component.value;
}
return "";
}
} else { ?>
function pla_setComponentValue(component, value) {
if (component.type == "checkbox") {
if (component.value == value) component.checked = true;
else component.checked = false;
} else if (component.type == "select-one") {
for (var i = 0; i < component.options.length; i++) {
if (component.options[i].value == value) component.options[i].selected = true;
}
} else if (component.type == "select-multiple") {
for (var i = 0; i < component.options.length; i++) {
if (component.options[i].value == value) component.options[i].selected = true;
}
} else if (component.type == undefined) { // option
if (component.value == value) component.selected = true;
else component.selected = false;
} else { // text, textarea
component.value = value;
}
}</script>';
<form action="add_value.php" method="post" class="new_value" name="new_value_form"<?php
if( is_attr_binary( $ldapserver, $attr ) ) echo "enctype=\"multipart/form-data\""; ?>>
echo '<script type="text/javascript" language="javascript">
function getAttributeComponents(prefix, name) {
var components = new Array();
var i = 0;
var j = 0;
var c = pla_getComponentsByName(prefix + "_values[" + name + "][" + j + "]");
while (c && (c.length > 0)) {
for (var k = 0; k < c.length; k++) {
components[i++] = c[k];
}
++j;
c = pla_getComponentsByName(prefix + "_values[" + name + "][" + j + "]");
}
c = pla_getComponentsByName(prefix + "_values[" + name + "][]");
if (c && (c.length > 0)) {
for (var k = 0; k < c.length; k++) {
components[i++] = c[k];
}
}
return components;
}
function getAttributeValues(prefix, name) {
var components = getAttributeComponents(prefix, name);
var values = new Array();
for (var k = 0; k < components.length; k++) {
var val = pla_getComponentValue(components[k]);
if (val) values[values.length] = val;
}
return values;
}</script>';
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $encoded_dn; ?>" />
<input type="hidden" name="attr" value="<?php echo $encoded_attr; ?>" />
echo '<script type="text/javascript" language="javascript">
function validateForm(silence) {
var i = 0;
var valid = true;
var components = null;
components = getAttributeComponents("new", "'.$ldap['attr']->getName().'");
for (i = 0; i < components.length; i++) {
if (window.validate_'.$ldap['attr']->getName().') {
valid = (!validate_'.$ldap['attr']->getName().'(components[i], silence) || !valid) ? false : true;
}
}
return valid;
}
</script>';
<?php if( is_attr_binary( $ldapserver, $attr ) ) { ?>
<input type="file" name="new_value" />
<input type="hidden" name="binary" value="true" />
echo '<script type="text/javascript" language="javascript">
function submitForm(form) {
for (var i = 0; i < form.elements.length; i++) {
form.elements[i].blur();
}
return validateForm(true);
}
function alertError(err, silence) {
if (!silence) alert(err);
}
</script>';
<?php } else {
if( is_multi_line_attr( $attr, $ldapserver->server_id ) ) { ?>
echo '<script type="text/javascript" language="javascript">
var attrTrace;
function fill(id, value) {
attrTrace = new Array();
fillRec(id, value);
}
function fillRec(id, value) {
if (attrTrace[id] == 1) {
return;
} else {
var pre = "";
var suf = "";
var i;
attrTrace[id] = 1;
pla_setComponentValue(pla_getComponentById(id), value);
// here comes template-specific implementation, generated by php
if (false) {}';
$attr = $ldap['attr']->getName();
echo "\t\t\telse if ((i = id.indexOf('_".$attr."_')) >= 0) {\n";
echo "\t\t\t\tpre = id.substring(0, i+1);\n";
echo "\t\t\t\tsuf = id.substring(i + 1 + '$attr'.length, id.length);\n";
$writer->draw('FillJavascript', $ldap['attr'], 'id', 'value');
echo "\t\t\t}\n";
echo '}}</script>';
<textarea name="new_value" rows="3" cols="30"></textarea>
$writer->draw('Javascript', $ldap['attr']);
<?php } else { ?>
<input type="text" <?php if( $schema_attr->getMaxLength() ) echo "maxlength=\"" . $schema_attr->getMaxLength() . "\" "; ?>name="new_value" size="40" value="" />
<?php // draw the "browse" button next to this input box if this attr houses DNs:
if( is_dn_attr( $ldapserver, $attr ) )
draw_chooser_link( "new_value_form.new_value", false ); ?>
<?php }
} ?>
<input type="submit" name="submit" value="<?php echo $lang['add_new_value']; ?>" />
<br />
<?php if( $schema_attr->getDescription() ) { ?>
<small><b><?php echo $lang['desc']; ?>:</b> <?php echo $schema_attr->getDescription(); ?></small><br />
<?php } ?>
<?php if( $schema_attr->getType() ) { ?>
<small><b><?php echo $lang['syntax']; ?>:</b> <?php echo $schema_attr->getType(); ?></small><br />
<?php } ?>
<?php if( $schema_attr->getMaxLength() ) { ?>
<small><b><?php echo $lang['maximum_length']; ?>:</b> <?php echo number_format( $schema_attr->getMaxLength() ); ?> <?php echo $lang['characters']; ?></small><br />
<?php } ?>
</form>
<?php } ?>
</body>
</html>
echo '<script type="text/javascript" language="javascript">
validateForm(true);
</script>';
}
?>

54
htdocs/cmd.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/cmd.php,v 1.3.2.2 2007/12/24 10:45:57 wurley Exp $
/**
* @package phpLDAPadmin
*/
require_once './common.php';
$www['cmd'] = get_request('cmd','REQUEST');
$www['meth'] = get_request('meth','REQUEST');
ob_start();
if (is_null($www['cmd']))
$www['cmd'] = 'welcome';
switch ($www['cmd']) {
case '_debug' :
debug_dump($_REQUEST,1);
$file = '';
break;
default :
if (defined('HOOKSDIR') && file_exists(HOOKSDIR.$www['cmd'].'.php'))
$file = HOOKSDIR.$www['cmd'].'.php';
elseif (defined('HTDOCDIR') && file_exists(HTDOCDIR.$www['cmd'].'.php'))
$file = HTDOCDIR.$www['cmd'].'.php';
else
$file = 'welcome.php';
}
if (DEBUG_ENABLED)
debug_log('Ready to render page for command [%s,%s].',128,__FILE__,__LINE__,__METHOD__,$www['cmd'],$file);
# Create page.
$www['page'] = new page($ldapserver->server_id);
if ($file)
include $file;
# Capture the output and put into the body of the page.
$www['body'] = new block();
$www['body']->SetBody(ob_get_contents());
$www['page']->block_add('body',$www['body']);
ob_end_clean();
if ($www['meth'] == 'get_body')
$www['page']->body(true);
else
$www['page']->display();
?>

View File

@@ -1,42 +1,26 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/collapse.php,v 1.13 2005/07/22 05:55:19 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/collapse.php,v 1.16 2007/12/15 07:50:30 wurley Exp $
/**
* This script alters the session variable 'tree', collapsing it
* at the dn specified in the query string.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
* Note: this script is equal and opposite to expand.php
* @package phpLDAPadmin
* @see expand.php
*/
/**
*/
require './common.php';
$dn = $_GET['dn'];
$encoded_dn = rawurlencode($dn);
$dn = get_request('dn','GET',true);
$tree = get_cached_item($ldapserver->server_id,'tree');
$entry = $tree->getEntry($dn);
$entry->close();
set_cached_item($ldapserver->server_id,'tree','null',$tree);
initialize_session_tree();
if (array_key_exists($dn,$_SESSION['tree'][$ldapserver->server_id]))
unset($_SESSION['tree'][$ldapserver->server_id][$dn]);
/* This is for Opera. By putting "random junk" in the query string, it thinks
that it does not have a cached version of the page, and will thus
fetch the page rather than display the cached version */
$time = gettimeofday();
$random_junk = md5(strtotime('now') . $time['usec']);
/* If cookies were disabled, build the url parameter for the session id.
It will be append to the url to be redirect */
$id_session_param = "";
if (SID != "")
$id_session_param = "&".session_name()."=".session_id();
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,$encoded_dn,$id_session_param));
header(sprintf('Location:index.php?server_id=%s&junk=%s#%s%s',
$ldapserver->server_id,random_junk(),htmlid($ldapserver->server_id,$dn),pla_session_param()));
die();
?>

View File

@@ -1,5 +1,12 @@
<?php
# This is a temporary file
@define('LIBDIR',sprintf('%s/',realpath('../lib/')));
require LIBDIR.'common.php';
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/common.php,v 1.3.2.3 2007/12/26 08:21:10 wurley Exp $
/**
* @package phpLDAPadmin
*/
# This is just here to provide a convenient link back to the proper common.php
if (! defined('LIBDIR'))
define('LIBDIR',sprintf('%s/',realpath('../lib/')));
require_once LIBDIR.'common.php';
?>

View File

@@ -1,14 +1,15 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.10.2.3 2005/10/16 20:19:16 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.2 2007/12/26 09:26:32 wurley Exp $
/**
* Compare two DNs - the destination DN is editable.
* @package phpLDAPadmin
*/
/**
* @todo: Must fix dc/domainComponent evaluation.
*/
require './common.php';
require_once './common.php';
$dn_src = isset($_POST['dn_src']) ? $_POST['dn_src'] : null;
$dn_dst = isset($_POST['dn_dst']) ? $_POST['dn_dst'] : null;
@@ -19,67 +20,63 @@ $encoded_dn_dst = rawurlencode($dn_dst);
$server_id_src = (isset($_POST['server_id_src']) ? $_POST['server_id_src'] : '');
$server_id_dst = (isset($_POST['server_id_dst']) ? $_POST['server_id_dst'] : '');
$ldapserver_src = $ldapservers->Instance($server_id_src);
if ( ! $ldapserver_src->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$ldapserver_src = $_SESSION[APPCONFIG]->ldapservers->Instance($server_id_src);
if (! $ldapserver_src->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
$ldapserver_dst = $ldapservers->Instance($server_id_dst);
if ( ! $ldapserver_src->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$ldapserver_dst = $_SESSION[APPCONFIG]->ldapservers->Instance($server_id_dst);
if (! $ldapserver_src->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
dn_exists($ldapserver_src,$dn_src) or pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn_src)));
dn_exists($ldapserver_dst,$dn_dst) or pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn_dst)));
if (! $ldapserver_src->dnExists($dn_src))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_src)));
if (! $ldapserver_dst->dnExists($dn_dst))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_dst)));
$friendly_attrs = process_friendly_attr_table();
$attrs_src = get_object_attrs($ldapserver_src,$dn_src,false,$config->GetValue('deref','view'));
$attrs_dst = get_object_attrs($ldapserver_dst,$dn_dst,false,$config->GetValue('deref','view'));
$attrs_src = $ldapserver_src->getDNAttrs($dn_src,false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
$attrs_dst = $ldapserver_dst->getDNAttrs($dn_dst,false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
# Get a list of all attributes.
$attrs_all = array_keys($attrs_src);
foreach ($attrs_dst as $key => $val)
if (! in_array($key,$attrs_all))
$attrs_all[] = $key;
include './header.php';
?>
<body>
<table class="comp_dn" border=0>
<tr><td colspan=6>
<h3 class="title"><?php echo $lang['comparing']; ?></h3>
<h3 class="title"><?php echo _('Comparing the following DNs'); ?></h3>
</td></tr>
<tr>
<td colspan=2 width=20%>
<h3 class="subtitle"><?php echo $lang['attribute']; ?><br />&nbsp;</h3>
<h3 class="subtitle"><?php echo _('Attribute'); ?><br />&nbsp;</h3>
</td>
<td colspan=2 width=40%>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver_src->name; ?></b><br /><?php echo $lang['distinguished_name'];?>: <b><?php echo htmlspecialchars(($dn_src)); ?></b></h3>
<h3 class="subtitle"><?php echo _('Server'); ?>: <b><?php echo $ldapserver_src->name; ?></b><br /><?php echo _('Distinguished Name');?>: <b><?php echo htmlspecialchars(($dn_src)); ?></b></h3>
</td>
<td colspan=2 width=40%>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver_dst->name; ?></b><br /><?php echo $lang['distinguished_name'];?>: <b><?php echo htmlspecialchars(($dn_dst)); ?></b></h3>
<h3 class="subtitle"><?php echo _('Server'); ?>: <b><?php echo $ldapserver_dst->name; ?></b><br /><?php echo _('Distinguished Name');?>: <b><?php echo htmlspecialchars(($dn_dst)); ?></b></h3>
</td>
</tr>
<tr>
<td colspan=6 align=right>
<form action="compare.php" method="post" name="compare_form">
<form action="cmd.php?cmd=compare" method="post" name="compare_form">
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="hidden" name="server_id_src" value="<?php echo $ldapserver_dst->server_id; ?>" />
<input type="hidden" name="server_id_dst" value="<?php echo $ldapserver_src->server_id; ?>" />
<input type="hidden" name="dn_src" value="<?php echo htmlspecialchars( $dn_dst ); ?>" />
<input type="hidden" name="dn_dst" value="<?php echo htmlspecialchars( $dn_src ); ?>" />
<input type="submit" value="<?php echo $lang['switch_entry']; ?>" />
<input type="hidden" name="dn_src" value="<?php echo htmlspecialchars($dn_dst); ?>" />
<input type="hidden" name="dn_dst" value="<?php echo htmlspecialchars($dn_src); ?>" />
<input type="submit" value="<?php echo _('Switch Entry'); ?>" />
</form>
</td>
</tr>
<?php
if(! $attrs_all || ! is_array($attrs_all)) {
printf('<tr><td colspan="2">(%s)</td></tr>',$lang['no_attributes']);
if (! $attrs_all || ! is_array($attrs_all)) {
printf('<tr><td colspan="2">(%s)</td></tr>',_('This entry has no attributes'));
print '</table>';
print '</html>';
die();
return;
}
sort($attrs_all);
@@ -93,7 +90,7 @@ foreach ($attrs_all as $attr) {
continue;
# Has the config.php specified that this attribute is to be hidden or shown?
if (is_attr_hidden($ldapserver_src,$attr) || is_attr_hidden($ldapserver_dst,$attr))
if ($ldapserver_src->isAttrHidden($attr) || $ldapserver_dst->isAttrHidden($attr))
continue;
?>
@@ -105,7 +102,7 @@ foreach ($attrs_all as $attr) {
<?php
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly()) { ?>
<form action="update_confirm.php" method="post" name="edit_form">
<form action="cmd.php?cmd=update_confirm" method="post" name="edit_form">
<input type="hidden" name="server_id" value="<?php echo $ldapserver_dst->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $dn_dst; ?>" />
@@ -119,13 +116,13 @@ foreach ($attrs_all as $attr) {
$required_note = '';
# is there a user-friendly translation available for this attribute?
if (isset($friendly_attrs[strtolower($attr)])) {
$attr_display = $friendly_attrs[strtolower($attr)];
$attr_note = sprintf('<acronym title="%s">alias</acronym>',sprintf($lang['alias_for'],$attr_display,$attr));
if ($_SESSION[APPCONFIG]->haveFriendlyName($attr)) {
$attr_display = $_SESSION[APPCONFIG]->getFriendlyName($attr);
$attr_note = sprintf('<acronym title="%s: \'%s\' %s \'%s\'">%s</acronym>',_('Note'),$attr_display,_('is an alias for'),$attr,_('alias'));
} else {
$attr_note = '';
$attr_display = $attr;
$attr_note = '';
}
# is this attribute required by an objectClass?
@@ -139,7 +136,7 @@ foreach ($attrs_all as $attr) {
$required_by .= $required . ' ';
# It seems that some LDAP servers (Domino) returns attributes in lower case?
elseif( isset($attrs_src['objectclass']) && in_array(strtolower($required),arrayLower($attrs_src['objectclass'])))
elseif (isset($attrs_src['objectclass']) && in_array(strtolower($required),arrayLower($attrs_src['objectclass'])))
$required_by .= $required . ' ';
break;
@@ -159,8 +156,8 @@ foreach ($attrs_all as $attr) {
if ($side == 'src') { ?>
<td class="attr">
<?php $schema_href="schema.php?server_id=$server_id_src&amp;view=attributes&amp;viewvalue=".real_attr_name($attr); ?>
<b><a title="<?php echo sprintf($lang['attr_name_tooltip'],$attr) ?>" href="<?php echo $schema_href; ?>"><?php echo $attr_display; ?></a></b>
<?php $schema_href="cmd.php?cmd=schema&server_id=$server_id_src&amp;view=attributes&amp;viewvalue=".real_attr_name($attr); ?>
<a title="<?php echo sprintf(_('Click to view the schema definition for attribute type \'%s\''),$attr) ?>" href="<?php echo $schema_href; ?>"><?php echo $attr_display; ?></a>
</td>
<td class="attr_note">
@@ -169,7 +166,7 @@ foreach ($attrs_all as $attr) {
<?php }
if ($required_by) {
$required_note .= sprintf('<acronym title="%s">%s</acronym>',sprintf($lang['required_for'],$required_by),$lang['required']);
$required_note .= sprintf('<acronym title="%s">%s</acronym>',sprintf(_('Required attribute for objectClass(es) %s'),$required_by),_('required'));
?>
<td colspan=2 class="attr_note">
<sup><small><?php echo $required_note; ?></small></sup>
@@ -178,8 +175,8 @@ foreach ($attrs_all as $attr) {
<td colspan=2 class="attr_note">&nbsp;</td>
<?php } ?>
<?php if (is_attr_read_only($ldapserver,$attr)) { ?>
<small>(<acronym title="<?php echo $lang['read_only_tooltip']; ?>"><?php echo $lang['read_only']; ?></acronym>)</small>
<?php if ($ldapserver->isAttrReadOnly($attr)) { ?>
<small>(<acronym title="<?php echo _('This attribute has been flagged as read only by the phpLDAPadmin administrator'); ?>"><?php echo _('read only'); ?></acronym>)</small>
<?php } ?>
</td>
@@ -201,10 +198,10 @@ foreach ($attrs_all as $attr) {
$toJump = 0;
switch ($side) {
case 'src':
print '<td colspan=2>&nbsp</td><td class="attr">';
print '<td colspan=2>&nbsp</td><td class="val">';
if (! isset($attrs_src[$attr])) {
echo "<small>&lt;". $lang['no_value']."&gt;</small></td>";
echo "<small>&lt;". _('No Value')."&gt;</small></td>";
$toJump = 1;
continue;
} else
@@ -217,7 +214,7 @@ foreach ($attrs_all as $attr) {
print '<td colspan=2>&nbsp</td><td class="val">';
if (! isset($attrs_dst[$attr])) {
echo "<small>&lt;". $lang['no_value']."&gt;</small></td>";
echo "<small>&lt;". _('No Value')."&gt;</small></td>";
$toJump = 1;
continue;
} else
@@ -228,24 +225,26 @@ foreach ($attrs_all as $attr) {
}
if ($toJump) continue;
if (! is_array($vals))
$vals = array($vals);
/*
* Is this attribute a jpegPhoto?
*/
if (is_jpeg_photo($ldapserver,$attr)) {
if ($ldapserver->isJpegPhoto($attr)) {
switch ($side) {
case 'src':
// Don't draw the delete buttons if there is more than one jpegPhoto
// (phpLDAPadmin can't handle this case yet)
draw_jpeg_photos( $ldapserver, $dn_src, $attr, false );
draw_jpeg_photos($ldapserver,$dn_src,$attr,false);
break;
case 'dst':
if( $ldapserver_dst->isReadOnly() || is_attr_read_only( $ldapserver_dst, $attr ) )
draw_jpeg_photos( $ldapserver, $dn_dst, $attr, false );
if ($ldapserver_dst->isReadOnly() || $ldapserver_dst->isAttrReadOnly($attr))
draw_jpeg_photos($ldapserver,$dn_dst,$attr,false);
else
draw_jpeg_photos( $ldapserver, $dn_dst, $attr, true );
draw_jpeg_photos($ldapserver,$dn_dst,$attr,true);
break;
}
@@ -258,7 +257,7 @@ foreach ($attrs_all as $attr) {
/*
* Is this attribute binary?
*/
if( is_attr_binary( $ldapserver, $attr ) ) {
if ($ldapserver->isAttrBinary($attr)) {
switch ($side) {
case 'src':
$href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_src,$attr);
@@ -272,20 +271,20 @@ foreach ($attrs_all as $attr) {
<small>
<?php echo $lang['binary_value']; ?><br />
<?php echo _('Binary value'); ?><br />
<?php if( count( $vals ) > 1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?>
<?php if (count($vals) > 1) { for($i=1; $i<=count($vals); $i++) { ?>
<a href="<?php echo $href . "&amp;value_num=$i"; ?>"><img
src="images/save.png" /> <?php echo $lang['download_value']; ?>(<?php echo $i; ?>)</a><br />
src="images/save.png" /> <?php echo _('download value'); ?>(<?php echo $i; ?>)</a><br />
<?php } } else { ?>
<a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?></a><br />
<a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo _('download value'); ?></a><br />
<?php }
if( $side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! is_attr_read_only( $ldapserver, $attr ) ) { ?>
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr)) { ?>
<a href="javascript:deleteAttribute( '<?php echo $attr; ?>' );" style="color:red;"><img src="images/trash.png" /> <?php echo $lang['delete_attribute']; ?></a>
<a href="javascript:deleteAttribute('<?php echo $attr; ?>');" style="color:red;"><img src="images/trash.png" /> <?php echo _('delete attribute'); ?></a>
<?php } ?>
@@ -304,22 +303,23 @@ foreach ($attrs_all as $attr) {
* simply draw the attribute values and continue.
*/
if( $side == 'dst' && ($ldapserver->isReadOnly() || is_attr_read_only( $ldapserver, $attr )) ) {
if( is_array( $vals ) ) {
foreach( $vals as $i => $val ) {
if( trim( $val ) == "" )
echo "<span style=\"color:red\">[" . $lang['empty'] . "]</span><br />\n";
if ($side == 'dst' && ($ldapserver->isReadOnly() || $ldapserver->isAttrReadOnly($attr))) {
if (is_array($vals)) {
foreach ($vals as $i => $val) {
if (trim($val) == "")
echo "<span style=\"color:red\">[" . _('empty') . "]</span><br />\n";
elseif( 0 == strcasecmp( $attr, 'userPassword' ) && $config->GetValue('appearance','obfuscate_password_display'))
echo preg_replace( '/./', '*', $val ) . "<br />";
elseif (0 == strcasecmp($attr,'userPassword') && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
echo preg_replace('/./','*',$val) . "<br />";
else
echo htmlspecialchars( $val ) . "<br />";
echo htmlspecialchars($val) . "<br />";
}
// @todo: redundant - $vals is always an array.
} else {
if( 0 == strcasecmp( $attr, 'userPassword' ) && $config->GetValue('appearance','obfuscate_password_display'))
echo preg_replace( '/./', '*', $vals ) . "<br />";
if (0 == strcasecmp($attr,'userPassword') && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
echo preg_replace('/./','*',$vals) . "<br />";
else
echo $vals . "<br />";
}
@@ -330,13 +330,13 @@ foreach ($attrs_all as $attr) {
/*
* Is this a userPassword attribute?
*/
if( ! strcasecmp( $attr, 'userpassword' ) ) {
if (! strcasecmp($attr,'userpassword')) {
$user_password = $vals[0];
$enc_type = get_enc_type( $user_password );
$enc_type = get_enc_type($user_password);
// Set the default hashing type if the password is blank (must be newly created)
if( $user_password == '' ) {
$enc_type = get_default_hash( $server_id );
if ($user_password == '') {
$enc_type = get_default_hash($server_id);
}
if ($side == 'dst') { ?>
@@ -348,17 +348,17 @@ foreach ($attrs_all as $attr) {
<?php }
if( obfuscate_password_display( $enc_type ) ) {
echo htmlspecialchars( preg_replace( "/./", "*", $user_password ) );
if (obfuscate_password_display($enc_type)) {
echo htmlspecialchars(preg_replace('/./','*',$user_password));
} else {
echo htmlspecialchars( $user_password );
echo htmlspecialchars($user_password);
} ?>
<br />
<?php if ($side == 'dst') { ?>
<input style="width: 260px" type="password" name="new_values[userpassword]" value="<?php echo htmlspecialchars( $user_password ); ?>" />
<input style="width: 260px" type="password" name="new_values[userpassword]" value="<?php echo htmlspecialchars($user_password); ?>" />
<?php echo enc_type_select_list($enc_type);
@@ -370,15 +370,15 @@ foreach ($attrs_all as $attr) {
<!--
function passwordComparePopup()
{
mywindow = open( 'password_checker.php', 'myname', 'resizable=no,width=450,height=200,scrollbars=1' );
mywindow = open('password_checker.php','myname','resizable=no,width=450,height=200,scrollbars=1');
mywindow.location.href = 'password_checker.php?hash=<?php echo base64_encode($user_password); ?>&base64=true';
if( mywindow.opener == null )
if (mywindow.opener == null)
mywindow.opener = self;
}
-->
</script>
<small><a href="javascript:passwordComparePopup()"><?php echo $lang['t_check_pass']; ?></a></small>
<small><a href="javascript:passwordComparePopup()"><?php echo _('Check password'); ?></a></small>
</td>
@@ -388,17 +388,17 @@ foreach ($attrs_all as $attr) {
/*
* Is this a boolean attribute?
*/
if( is_attr_boolean( $ldapserver, $attr) ) {
if ($ldapserver->isAttrBoolean($attr)) {
$val = $vals[0];
if ($side = 'dst') {?>
<input type="hidden" name="old_values[<?php echo htmlspecialchars( $attr ); ?>]" value="<?php echo htmlspecialchars($val); ?>" />
<input type="hidden" name="old_values[<?php echo htmlspecialchars($attr); ?>]" value="<?php echo htmlspecialchars($val); ?>" />
<select name="new_values[<?php echo htmlspecialchars( $attr ); ?>]">
<option value="TRUE"<?php echo ($val=='TRUE' ? ' selected' : ''); ?>><?php echo $lang['true']; ?></option>
<option value="FALSE"<?php echo ($val=='FALSE' ? ' selected' : ''); ?>><?php echo $lang['false']; ?></option>
<option value="">(<?php echo $lang['none_remove_value']; ?>)</option>
<select name="new_values[<?php echo htmlspecialchars($attr); ?>]">
<option value="TRUE"<?php echo ($val=='TRUE' ? ' selected' : ''); ?>><?php echo _('true'); ?></option>
<option value="FALSE"<?php echo ($val=='FALSE' ? ' selected' : ''); ?>><?php echo _('false'); ?></option>
<option value="">(<?php echo _('none, remove value'); ?>)</option>
</select>
<?php } ?>
@@ -412,28 +412,28 @@ foreach ($attrs_all as $attr) {
* End of special case attributes (non plain text).
*/
foreach( $vals as $i => $val ) {
foreach ($vals as $i => $val) {
if ($side == 'dst') {
$input_name = "new_values[" . htmlspecialchars( $attr ) . "][$i]";
$input_name = "new_values[" . htmlspecialchars($attr) . "][$i]";
// We smack an id="..." tag in here that doesn't have [][] in it to allow the
// draw_chooser_link() to identify it after the user clicks.
$input_id = "new_values_" . htmlspecialchars($attr) . "_" . $i; ?>
<!-- The old_values array will let update.php know if the entry contents changed
between the time the user loaded this page and saved their changes. -->
<input type="hidden" name="old_values[<?php echo htmlspecialchars( $attr ); ?>][<?php echo $i; ?>]" value="<?php echo htmlspecialchars($val); ?>" />
<input type="hidden" name="old_values[<?php echo htmlspecialchars($attr); ?>][<?php echo $i; ?>]" value="<?php echo htmlspecialchars($val); ?>" />
<?php }
// Is this value is a structural objectClass, make it read-only
if( 0 == strcasecmp( $attr, 'objectClass' ) ) { ?>
if (0 == strcasecmp($attr,'objectClass')) { ?>
<a title="<?php echo $lang['view_schema_for_oclass']; ?>" href="schema.php?server_id=<?php echo $ldapserver->server_id; ?>&amp;view=objectClasses&amp;viewvalue=<?php echo htmlspecialchars( $val ); ?>"><img src="images/info.png" /></a>
<a title="<?php echo _('View the schema description for this objectClass'); ?>" href="cmd.php?cmd=schema&server_id=<?php echo $ldapserver->server_id; ?>&amp;view=objectClasses&amp;viewvalue=<?php echo htmlspecialchars($val); ?>"><img src="images/info.png" /></a>
<?php $schema_object = $ldapserver->getSchemaObjectClass($val);
if ($schema_object->getType() == 'structural') {
echo "$val <small>(<acronym title=\"" . sprintf( $lang['structural_object_class_cannot_remove'] ) . "\">" . $lang['structural'] . "</acronym>)</small><br />";
echo "$val <small>(<acronym title=\"" . sprintf(_('This is a structural ObjectClass and cannot be removed.')) . "\">" . _('structural') . "</acronym>)</small><br />";
if ($side == 'dst') {?>
@@ -444,21 +444,21 @@ foreach ($attrs_all as $attr) {
}
}
if( is_dn_string( $val ) || is_dn_attr( $ldapserver, $attr ) ) { ?>
if (is_dn_string($val) || $ldapserver->isDNAttr($attr)) { ?>
<a title="<?php echo sprintf( $lang['go_to_dn'], htmlspecialchars($val) ); ?>" href="edit.php?server_id=<?php echo $ldapserver->server_id; ?>&amp;dn=<?php echo rawurlencode($val); ?>"><img style="vertical-align: top" src="images/go.png" /></a>
<a title="<?php echo sprintf(_('Go to %s'),htmlspecialchars($val)); ?>" href="cmd.php?cmd=template_engine&server_id=<?php echo $ldapserver->server_id; ?>&amp;dn=<?php echo rawurlencode($val); ?>"><img style="vertical-align: top" src="images/go.png" /></a>
<?php } elseif( is_mail_string( $val ) ) { ?>
<?php } elseif (is_mail_string($val)) { ?>
<a href="mailto:<?php echo htmlspecialchars($val); ?>"><img style="vertical-align: center" src="images/mail.png" /></a>
<?php } elseif( is_url_string( $val ) ) { ?>
<?php } elseif (is_url_string($val)) { ?>
<a href="<?php echo htmlspecialchars($val); ?>" target="new"><img style="vertical-align: center" src="images/dc.png" /></a>
<?php }
if( is_multi_line_attr( $attr, $val, $ldapserver->server_id ) ) {
if ($ldapserver->isMultiLineAttr($attr,$val)) {
if ($side == 'dst') {?>
<textarea class="val" rows="3" cols="30" name="<?php echo $input_name; ?>" id="<?php echo $input_id; ?>"><?php echo htmlspecialchars($val); ?></textarea>
@@ -480,8 +480,8 @@ foreach ($attrs_all as $attr) {
// draw a link for popping up the entry browser if this is the type of attribute
// that houses DNs.
if( is_dn_attr( $ldapserver, $attr ) )
draw_chooser_link( "edit_form.$input_id", false ); ?>
if ($ldapserver->isDNAttr($attr))
draw_chooser_link("edit_form.$input_id",false); ?>
<br />
<?php } ?>
@@ -494,7 +494,6 @@ foreach ($attrs_all as $attr) {
<?php
/* Draw the "add value" link under the list of values for this attributes */
if (! $ldapserver_dst->isReadOnly()) {
// First check if the required objectClass is in this DN
@@ -516,23 +515,26 @@ foreach ($attrs_all as $attr) {
if (! $isOK) {
if (count($src_oclass) == 1) {
$add_href = "add_oclass_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&new_oclass=$src_oclass[0]";
$add_href = sprintf('cmd.php?cmd=add_oclass_form&server_id=%s&dn=%s&new_oclass=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,$src_oclass[0]);
} else {
$add_href = "add_value_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&attr=objectClass";
$add_href = sprintf('cmd.php?cmd=add_value_form&server_id=%s&dn=%s&attr=objectClass',
$ldapserver_dst->server_id,$encoded_dn_dst);
}
if ($attr == 'objectClass')
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,$lang['add_oclass_and_attrs'],$lang['add_value']);
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,_('Add ObjectClass and Attributes'),_('add value'));
else
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,sprintf($lang['need_oclass'], implode(" ",$src_oclass)),$lang['add_new_objectclass']);
printf('<div class="add_oclass">(<a href="%s" title="%s">%s</a>)</div>',$add_href,sprintf(_('You need one of the following ObjectClass(es) to add this attribute %s.'),implode(" ",$src_oclass)),_('Add new ObjectClass'));
} else {
if(! $schema_attr_dst->getIsSingleValue() || (! isset($vals))) {
if (! $schema_attr_dst->getIsSingleValue() || (! isset($vals))) {
$add_href = "add_value_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&attr=" . rawurlencode( $attr );
$add_href = sprintf('cmd.php?cmd=add_value_form&server_id=%s&dn=%s&attr=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,rawurlencode($attr));
printf('<div class="add_value">(<a href="%s" title="%s">%s</a>)</div>',
$add_href,sprintf($lang['add_value_tooltip'],$attr),$lang['add_value']);
$add_href,sprintf(_('Add an additional value to attribute \'%s\''),$attr),_('add value'));
}
}
}
@@ -541,26 +543,25 @@ foreach ($attrs_all as $attr) {
</td>
<?php flush(); ?>
</tr>
<?php } /* End foreach( $attrs as $attr => $vals ) */
<?php } /* End foreach ($attrs as $attr => $vals) */
if( ! $ldapserver_dst->isReadOnly( ) ) { ?>
if (! $ldapserver_dst->isReadOnly()) { ?>
<td colspan="2">&nbsp</td><td colspan=2><center><input type="submit" value="<?php echo $lang['save_changes']; ?>" /></center></td></tr></form>
<td colspan="2">&nbsp</td><td colspan=2><center><input type="submit" value="<?php echo _('Save Changes'); ?>" /></center></td></tr></form>
<?php } ?>
</table>
<?php /* If this entry has a binary attribute, we need to provide a form for it to submit when deleting it. */ ?>
<?php /* If this entry has a binary attribute,we need to provide a form for it to submit when deleting it. */ ?>
<script language="javascript">
//<!--
function deleteAttribute( attrName )
function deleteAttribute(attrName)
{
if( confirm( "<?php echo $lang['really_delete_attribute']; ?> '" + attrName + "'?" ) ) {
if (confirm("<?php echo _('Really delete attribute'); ?> '" + attrName + "'?")) {
document.delete_attribute_form.attr.value = attrName;
document.delete_attribute_form.submit();
}
@@ -569,11 +570,8 @@ function deleteAttribute( attrName )
</script>
<!-- This form is submitted by JavaScript when the user clicks "Delete attribute" on a binary attribute -->
<form name="delete_attribute_form" action="delete_attr.php" method="post">
<form name="delete_attribute_form" action="cmd.php?cmd=delete_attr" method="post">
<input type="hidden" name="server_id" value="<?php echo $ldapserver_dst->server_id; ?>" />
<input type="hidden" name="dn" value="<?php echo $dn_dst; ?>" />
<input type="hidden" name="attr" value="FILLED IN BY JAVASCRIPT" />
</form>
</body>
</html>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare_form.php,v 1.2 2005/07/22 05:47:43 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare_form.php,v 1.5 2007/12/15 07:50:30 wurley Exp $
/**
* Compares to DN entries side by side.
@@ -12,68 +12,59 @@
/**
*/
require './common.php';
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
require_once './common.php';
$dn = (isset($_GET['dn']) ? $_GET['dn'] : '');
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$container = get_container( $dn );
$attrs = get_object_attrs( $ldapserver, $dn );
$rdn = get_rdn($dn);
$select_server_html = server_select_list($ldapserver->server_id,true,'server_id_dst');
include './header.php'; ?>
printf('<h3 class="title">%s %s</h3>',_('Compare another DN with'),htmlspecialchars($rdn));
printf('<h3 class="subtitle">%s: <b>%s</b>',_('Server'),$ldapserver->name);
if ($dn)
printf('&nbsp;&nbsp;&nbsp;%s: <b>%s</b>',_('Distinguished Name'),htmlspecialchars($dn));
echo '</h3>';
echo "\n";
<body>
echo '<center>';
printf('%s <b>%s</b> %s<br />',_('Compare'),htmlspecialchars($rdn),_('with '));
<h3 class="title"><?php echo $lang['compare_dn']. '&nbsp;' . $rdn; ?></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b>
<?php if ($dn) { ?>
&nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b>
<?php } ?>
</h3>
echo '<form action="cmd.php?cmd=compare" method="post" name="compare_form">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="hidden" name="server_id_src" value="%s" />',$ldapserver->server_id);
echo "\n";
<center>
<?php echo $lang['compare']; ?> <b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo $lang['with']; ?>:<br />
<br />
echo '<table style="border-spacing: 10px">';
echo "\n";
echo '<tr><td>';
<form action="compare.php" method="post" name="compare_form">
<input type="hidden" name="server_id_src" value="<?php echo $ldapserver->server_id; ?>" />
if (! $dn) {
printf('<acronym title="%s">%s</acronym>:',_('Compare this DN with another'),_('Source DN'));
echo '</td><td>';
printf('<input type="text" name="dn_src" size="45" value="%s" />',htmlspecialchars($dn));
draw_chooser_link('compare_form.dn_src','true',$rdn);
<table style="border-spacing: 10px">
<tr>
<?php if (! $dn) { ?>
<td><acronym title="<?php echo $lang['compf_dn_tooltip']; ?>"><?php echo $lang['compf_source_dn']; ?></acronym>:</td>
<td>
<input type="text" name="dn_src" size="45" value="<?php echo htmlspecialchars( $dn ); ?>" />
<?php draw_chooser_link( 'compare_form.dn_src', 'true', $rdn ); ?></td>
</td>
<?php } else { ?>
<input type="hidden" name="dn_src" value="<?php echo htmlspecialchars( $dn ); ?>" />
<?php } ?>
</tr>
<tr>
<td><acronym title="<?php echo $lang['compf_dn_tooltip']; ?>"><?php echo $lang['copyf_dest_dn']; ?></acronym>:</td>
<td>
<input type="text" name="dn_dst" size="45" value="" />
<?php draw_chooser_link( 'compare_form.dn_dst', 'true', '' ); ?></td>
</td>
</tr>
} else
printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($dn));
<tr>
<td><?php echo $lang['copyf_dest_server']?>:</td>
<td><?php echo $select_server_html; ?></td>
</tr>
echo '</td></tr>';
echo "\n";
<tr>
<td colspan="2" align="right"><input type="submit" value="<?php echo $lang['compare']; ?>" /></td>
</tr>
</table>
</form>
</center>
</body>
</html>
echo '<tr>';
printf('<td><acronym title="%s">%s</acronym>:</td>',_('Compare this DN with another'),_('Destination DN'));
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>';
?>

View File

@@ -1,13 +1,13 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.35.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.44.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* Copies a given object to create a new one.
*
* Vars that come in as POST vars
* - source_dn (rawurlencoded)
* - new_dn (form element)
* - server_id
* - source_dn (rawurlencoded)
* - new_dn (form element)
* - server_id
*
* @package phpLDAPadmin
*/
@@ -16,158 +16,114 @@
require './common.php';
$server_id_src = (isset($_POST['server_id']) ? $_POST['server_id'] : '');
$server_id_dst = (isset($_POST['dest_server_id']) ? $_POST['dest_server_id'] : '');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_move'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('copy entry')));
$ldapserver_src = $ldapservers->Instance($server_id_src);
$ldapserver_dst = $ldapservers->Instance($server_id_dst);
$entry['src']['id'] = get_request('server_id');
$entry['dst']['id'] = get_request('dest_server_id');
if ($ldapserver_dst->isReadOnly())
pla_error($lang['copy_server_read_only']);
$entry['src']['ldapserver'] = $_SESSION[APPCONFIG]->ldapservers->Instance($entry['src']['id']);
$entry['dst']['ldapserver'] = $_SESSION[APPCONFIG]->ldapservers->Instance($entry['dst']['id']);
if (! $ldapserver_src->haveAuthInfo() || ! $ldapserver_dst->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
if ($entry['dst']['ldapserver']->isReadOnly())
pla_error(_('Destination server is currently READ-ONLY.'));
$dn_src = $_POST['old_dn'];
$dn_dst = $_POST['new_dn'];
$do_recursive = (isset($_POST['recursive']) && $_POST['recursive'] == 'on') ? true : false;
$do_remove = (isset($_POST['remove']) && $_POST['remove'] == 'yes') ? true : false;
$encoded_dn = rawurlencode($dn_src);
if (! $entry['src']['ldapserver']->haveAuthInfo() || ! $entry['dst']['ldapserver']->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
include './header.php';
$entry['src']['dn'] = get_request('old_dn');
$entry['dst']['dn'] = get_request('new_dn');
$entry['src']['recursive'] = (get_request('recursive') == 'on') ? true : false;
$entry['src']['remove'] = (get_request('remove') == 'yes') ? true : false;
# Error checking
if (0 == strlen(trim($dn_dst)))
pla_error($lang['copy_dest_dn_blank']);
if (strlen(trim($entry['dst']['dn'])) == 0)
pla_error(_('You left the destination DN blank.'));
if (pla_compare_dns($dn_src,$dn_dst) == 0 && $server_id_src == $server_id_dst)
pla_error($lang['copy_source_dest_dn_same']);
if (pla_compare_dns($entry['src']['dn'],$entry['dst']['dn']) == 0 && $entry['src']['id'] == $entry['dst']['id'])
pla_error(_('The source and destination DN are the same.'));
if (dn_exists($ldapserver_dst,$dn_dst))
pla_error(sprintf($lang['copy_dest_already_exists'],pretty_print_dn($dn_dst)));
if ($entry['dst']['ldapserver']->dnExists($entry['dst']['dn']))
pla_error(sprintf(_('The destination entry (%s) already exists.'),pretty_print_dn($entry['dst']['dn'])));
if (! dn_exists($ldapserver_dst,get_container($dn_dst)))
pla_error(sprintf($lang['copy_dest_container_does_not_exist'],pretty_print_dn(get_container($dn_dst))));
if (! $entry['dst']['ldapserver']->dnExists(get_container($entry['dst']['dn'])))
pla_error(sprintf(_('The destination container (%s) does not exist.'),pretty_print_dn(get_container($entry['dst']['dn']))));
if ($do_recursive) {
if ($entry['src']['recursive']) {
$filter = isset($_POST['filter']) ? $_POST['filter'] : '(objectClass=*)';
# Build a tree similar to that of the tree browser to give to r_copy_dn
$snapshot_tree = array();
print '<body>';
printf('<h3 class="title">%s%s</h3>',$lang['copy_copying'],htmlspecialchars($dn_src));
printf('<h3 class="subtitle">%s</h3>',$lang['copy_recursive_copy_progress']);
printf('<h3 class="title">%s%s</h3>',_('Copying '),htmlspecialchars($entry['src']['dn']));
printf('<h3 class="subtitle">%s</h3>',_('Recursive copy progress'));
print '<br /><br />';
print '<small>';
print $lang['copy_building_snapshot'];
print _('Building snapshot of tree to copy... ');
flush();
$snapshot_tree = build_tree($ldapserver_src,$dn_src,array(),$filter);
printf('<span style="color:green">%s</span><br />',$lang['success']);
flush();
$snapshot_tree = build_tree($entry['src']['ldapserver'],$entry['src']['dn'],array(),$filter);
printf('<span style="color:green">%s</span><br />',_('Success'));
# Prevent script from bailing early on a long delete
@set_time_limit(0);
$copy_result = r_copy_dn($ldapserver_src,$ldapserver_dst,$snapshot_tree,$dn_src,$dn_dst);
$copy_result = r_copy_dn($entry['src']['ldapserver'],$entry['dst']['ldapserver'],$snapshot_tree,$entry['src']['dn'],$entry['dst']['dn']);
# @todo: This is not showing the complete results - only the children of the dst - need to look at.
$copy_message = $copy_result;
print '</small>';
} else {
$copy_result = copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst);
$copy_result = copy_dn($entry['src']['ldapserver'],$entry['dst']['ldapserver'],$entry['src']['dn'],$entry['dst']['dn']);
$copy_message = sprintf('%s DN%s <b>%s</b> %s',_('Copy successful!'),_(':'),htmlspecialchars($entry['dst']['dn']),_('has been created.'));
}
if ($copy_result) {
$edit_url = sprintf('edit.php?server_id=%s&dn=%s',$server_id_dst,rawurlencode($dn_dst));
$new_rdn = get_rdn($dn_dst);
$container = get_container($dn_dst);
$redirect_url = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$entry['dst']['id'],rawurlencode($entry['dst']['dn']));
$new_rdn = get_rdn($entry['dst']['dn']);
$container = get_container($entry['dst']['dn']);
if (array_key_exists('tree',$_SESSION)) {
# do we not have a tree and tree icons yet? Build a new ones.
initialize_session_tree();
$tree = $_SESSION['tree'];
$tree_icons = $_SESSION['tree_icons'];
if ($entry['src']['remove'])
$redirect_url = sprintf('cmd.php?cmd=delete_form&server_id=%s&dn=%s',$entry['src']['id'],rawurlencode($entry['src']['dn']));
if (isset($tree[$server_id_dst][$container])) {
$tree[$server_id_dst][$container][] = $dn_dst;
sort($tree[$server_id_dst][$container]);
$tree_icons[$server_id_dst][$dn_dst] = get_icon($ldapserver_dst,$dn_dst);
$_SESSION['tree'] = $tree;
$_SESSION['tree_icons'] = $tree_icons;
session_write_close();
}
}
?>
<center>
<?php printf('%s<a href="%s">%s</a>',$lang['copy_successful_like_to'],$edit_url,$lang['copy_view_new_entry']) ?>
</center>
<!-- refresh the tree view (with the new DN renamed)
and redirect to the edit_dn page -->
<script language="javascript">
parent.left_frame.location.reload();
</script>
</body>
</html>
<?php
if ($do_remove) {
sleep(2);
$delete_url = sprintf('delete_form.php?server_id=%s&dn=%s',$server_id_dst,rawurlencode($dn_src));
?>
<!-- redirect to the delete form -->
<script language="javascript">
parent.right_frame.location="<?php echo $delete_url; ?>"
</script>
<?php }
} else {
exit;
system_message(array(
'title'=>_('Copy Entry'),
'body'=>$copy_message,
'type'=>'info'),
$redirect_url);
}
function r_copy_dn($ldapserver_src,$ldapserver_dst,$tree,$root_dn,$dn_dst) {
if (DEBUG_ENABLED)
debug_log('r_copy_dn: Entered with (%s,%s,%s,%s,%s)',2,
$ldapserver_src->server_id,$ldapserver_dst->server_id,serialize($tree),$root_dn,$dn_dst);
function r_copy_dn($ldapserver_src,$ldapserver_dst,$snapshottree,$root_dn,$dn_dst) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s,%s,%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,
$ldapserver_src->server_id,$ldapserver_dst->server_id,$snapshottree,$root_dn,$dn_dst);
global $lang;
printf('<nobr>%s %s...',$lang['copy_copying'],htmlspecialchars($root_dn));
flush();
$copy_message = array();
$copy_result = copy_dn($ldapserver_src,$ldapserver_dst,$root_dn,$dn_dst);
if (! $copy_result)
return false;
printf('<span style="color:green">%s</span></nobr><br />',$lang['success']);
flush();
$copy_message[] = sprintf('%s DN: <b>%s</b> %s',_('Copy successful!'),htmlspecialchars($dn_dst),_('has been created.'));
$children = isset($tree[$root_dn]) ? $tree[$root_dn] : null;
$children = isset($snapshottree[$root_dn]) ? $snapshottree[$root_dn] : null;
if (is_array($children) && count($children) > 0) {
foreach($children as $child_dn) {
$child_rdn = get_rdn($child_dn);
$new_dest_dn = sprintf('%s,%s',$child_rdn,$dn_dst);
r_copy_dn($ldapserver_src,$ldapserver_dst,$tree,$child_dn,$new_dest_dn);
$copy_result = r_copy_dn($ldapserver_src,$ldapserver_dst,$snapshottree,$child_dn,$new_dest_dn);
$copy_message[] = array_shift($copy_result);
}
} else {
return true;
}
return true;
return $copy_message;
}
function copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst) {
if (DEBUG_ENABLED)
debug_log('copy_dn: Entered with (%s,%s,%s,%s)',2,
if (DEBUG_ENABLED)
debug_log('Entered with (%s,%s,%s,%s)',17,__FILE__,__LINE__,__METHOD__,
$ldapserver_src->server_id,$ldapserver_dst->server_id,$dn_src,$dn_dst);
global $lang;
$new_entry = get_object_attrs($ldapserver_src,$dn_src);
$new_entry = $ldapserver_src->getDNAttrs($dn_src);
# modify the prefix-value (ie "bob" in cn=bob) to match the destination DN's value.
$rdn_attr = substr($dn_dst,0,strpos($dn_dst,'='));
@@ -179,16 +135,16 @@ function copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst) {
unset($new_entry['dn']);
# Check the user-defined custom call back first
if (true === run_hook('pre_entry_create',
if (run_hook('pre_entry_create',
array ('server_id'=>$ldapserver_dst->server_id,'dn'=>$dn_dst,'attrs'=>$new_entry))) {
$add_result = @ldap_add($ldapserver_dst->connect(),$dn_dst,$new_entry);
$add_result = $ldapserver_dst->add($dn_dst,$new_entry);
if (! $add_result) {
run_hook('post_entry_create',array('server_id'=>$ldapserver_dst->server_id,
'dn'=>$dn_dst,'attrs'=>$new_entry));
print '</small><br /><br />';
pla_error($lang['copy_failed'] . $dn_dst,$ldapserver_dst->error(),$ldapserver_dst->errno());
echo '</small><br /><br />';
pla_error(_('Failed to copy DN: ').$dn_dst,$ldapserver_dst->error(),$ldapserver_dst->errno());
} else {
run_hook('post_entry_create',
array('server_id'=>$ldapserver_dst->server_id,'dn'=>$dn_dst,'attrs'=>$new_entry));
}
return $add_result;
@@ -204,19 +160,23 @@ function copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst) {
* @param array $tree
* @param string $filter
*/
function build_tree($ldapserver,$dn,$tree,$filter='(objectClass=*)') {
$children = get_container_contents($ldapserver,$dn,0,$filter);
function build_tree($ldapserver,$dn,$buildtree) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,
$ldapserver->server_id,$dn,$buildtree);
# we search all children, not only the visible children in the tree
$children = $ldapserver->getContainerContents($dn,0);
if (is_array($children) && count($children) > 0) {
$tree[$dn] = $children;
$buildtree[$dn] = $children;
foreach ($children as $child_dn)
$tree = build_tree($ldapserver,$child_dn,$tree,$filter);
$buildtree = build_tree($ldapserver,$child_dn,$buildtree);
}
if (DEBUG_ENABLED)
debug_log('build_tree: Entered with (%s,%s,%s,%s), Returning (%s)',1,
$ldapserver->server_id,$dn,serialize($tree),$filter,serialize($tree));
debug_log('Returning (%s)',1,__FILE__,__LINE__,__METHOD__,$buildtree);
return $tree;
return $buildtree;
}
?>

View File

@@ -1,11 +1,9 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.24 2005/07/22 05:47:43 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.30.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* Copies a given object to create a new one.
*
* Variables that come in via common.php
* - server_id
* Variables that come in via GET variables
* - dn (rawurlencoded)
*
@@ -17,30 +15,21 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
pla_error(_('You cannot perform updates while server is in read-only mode'));
$dn = $_GET['dn'] ;
$entry['dn'] = get_request('dn','GET');
$entry['rdn'] = get_rdn($entry['dn']);
$encoded_dn = rawurlencode( $dn );
$rdn = get_rdn( $dn );
$container = get_container( $dn );
# We search all children, not only the visible children in the tree
$entry['children'] = $ldapserver->getContainerContents($entry['dn']);
$attrs = get_object_attrs( $ldapserver, $dn );
$select_server_html = server_select_list($ldapserver->server_id,true,'dest_server_id');
$children = get_container_contents( $ldapserver, $dn );
# Draw some javaScrpt to enable/disable the filter field if this may be a recursive copy
if (is_array($entry['children']) && count($entry['children']) > 0) { ?>
include './header.php';
// Draw some javaScrpt to enable/disable the filter field if this may be a recursive copy
if( is_array( $children ) && count( $children ) > 0 ) { ?>
<script language="javascript">
//<!--
function toggle_disable_filter_field( recursive_checkbox )
<script type="text/javascript" language="javascript">
function toggle_disable_filter_field(recursive_checkbox)
{
if( recursive_checkbox.checked ) {
if (recursive_checkbox.checked) {
recursive_checkbox.form.remove.disabled = false;
recursive_checkbox.form.filter.disabled = false;
} else {
@@ -49,76 +38,68 @@ if( is_array( $children ) && count( $children ) > 0 ) { ?>
recursive_checkbox.form.filter.disabled = true;
}
}
//-->
</script>
<?php } ?>
<?php }
<body>
printf('<h3 class="title">%s %s</h3>',_('Copy'),htmlspecialchars($entry['rdn']));
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',_('Server'),$ldapserver->name,
_('Distinguished Name'),htmlspecialchars($entry['dn']));
echo "\n";
<h3 class="title"><?php echo $lang['copyf_title_copy'] . $rdn; ?></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b></h3>
echo '<center>';
printf('%s <b>%s</b> %s:<br /><br />',_('Copy'),htmlspecialchars($entry['rdn']),_('to a new object'));
<center>
<?php echo $lang['copyf_title_copy'] ?><b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo $lang['copyf_to_new_object']?>:<br />
<br />
echo '<form action="cmd.php" method="post" name="copy_form">';
echo '<input type="hidden" name="cmd" value="copy" />';
printf('<input type="hidden" name="old_dn" value="%s" />',htmlspecialchars($entry['dn']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
echo "\n";
<form action="copy.php" method="post" name="copy_form">
<input type="hidden" name="old_dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
echo '<table style="border-spacing: 10px">';
echo "\n";
<table style="border-spacing: 10px">
<tr>
<td><acronym title="<?php echo $lang['copyf_dest_dn_tooltip']; ?>"><?php echo $lang['copyf_dest_dn']?></acronym>:</td>
<td>
<input type="text" name="new_dn" size="45" value="<?php echo htmlspecialchars( $dn ); ?>" />
<?php draw_chooser_link( 'copy_form.new_dn', 'true', $rdn ); ?></td>
</td>
</tr>
echo '<tr>';
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'));
printf('<td><input type="text" name="new_dn" size="45" value="%s" />',htmlspecialchars($entry['dn']));
draw_chooser_link('copy_form.new_dn','true',htmlspecialchars($entry['rdn']));
echo '</td></tr>';
echo "\n";
<tr>
<td><?php echo $lang['copyf_dest_server']?>:</td>
<td><?php echo $select_server_html; ?></td>
</tr>
printf('<tr><td>%s</td><td>%s</td></tr>',_('Destination Server'),server_select_list($ldapserver->server_id,true,'dest_server_id'));
echo "\n";
<?php if( is_array( $children ) && count( $children ) > 0 ) { ?>
<tr>
<td><label for="recursive"><?php echo $lang['recursive_copy']; ?></label>:</td>
<td><input type="checkbox" id="recursive" name="recursive" onClick="toggle_disable_filter_field(this)" />
<small>(<?php echo $lang['copyf_recursive_copy']?>)</small></td>
</tr>
<tr>
<td><acronym title="<?php echo $lang['filter_tooltip']; ?>"><?php echo $lang['filter']; ?></acronym>:</td>
<td><input type="text" name="filter" value="(objectClass=*)" size="45" disabled />
</tr>
<tr>
<td><?php echo $lang['delete_after_copy']; ?></td>
<td><input type="checkbox" name="remove" value="yes"/ disabled>
<small>(<?php echo $lang['delete_after_copy_warn']; ?>)</small)</td>
</tr>
<?php } else { ?>
<tr>
<td><?php echo $lang['delete_after_copy']; ?></td>
<td><input type="checkbox" name="remove" value="yes"/></td>
</tr>
<?php } ?>
<tr>
<td colspan="2" align="right"><input type="submit" value="<?php echo $lang['copyf_title_copy']; ?>" /></td>
</tr>
</table>
</form>
if (is_array($entry['children']) && count($entry['children']) > 0) {
echo '<tr>';
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)" />';
printf('<small>(%s)</small></td>',_('Recursively copy all children of this object as well.'));
echo '</tr>'."\n";
<script language="javascript">
//<!--
/* If the user uses the back button, this way we draw the filter field properly. */
toggle_disable_filter_field( document.copy_form.recursive );
//-->
</script>
echo '<tr>';
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 '</tr>'."\n";
<?php if ($config->GetValue('appearance','show_hints')) {?>
<small><img src="images/light.png" /><span class="hint"><?php echo $lang['copyf_note']?></span></small>
<?php } ?>
echo '<tr>';
printf('<td>%s</td>',_('Delete after copy (move):'));
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.'));
echo '</tr>';
</center>
</body>
</html>
} else {
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 '));
echo "\n";
echo '</table></form>';
echo "\n";
if ($_SESSION[APPCONFIG]->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'));
echo '</center>';
?>

View File

@@ -1,15 +1,11 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.43.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.48.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* Creates a new object.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - new_dn
* - attrs (an array of attributes)
* - vals (an array of values for the above attrs)
* - required_attrs (an array with indices being the attributes,
* and the values being their respective values)
* - object_classes (rawurlencoded, and serialized array of objectClasses)
@@ -23,168 +19,116 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
pla_error(_('You cannot perform updates while server is in read-only mode'), null, -1, true);
$new_dn = isset( $_POST['new_dn'] ) ? $_POST['new_dn'] : null;
$required_attrs = isset( $_POST['required_attrs'] ) ? $_POST['required_attrs'] : false;
$object_classes = unserialize( rawurldecode( $_POST['object_classes'] ) );
$redirect = isset( $_POST['redirect'] ) ? $_POST['redirect'] : false;
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_create'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('create entry')));
$encoded_dn = rawurlencode( $new_dn );
$container = get_container( $new_dn );
$rdn_attr = isset($_POST['rdn_attribute']) ? $_POST['rdn_attribute'] : null;
// See if there are any presubmit values to work out.
if (isset($_POST['presubmit']) && count($_POST['presubmit']) && isset($_POST['template'])) {
$templates = new Templates($ldapserver->server_id);
$template = $templates->GetTemplate($_POST['template']);
$entryfactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','entry_factory');
eval('$entry_factory = new '.$entryfactoryclass.'();');
$entry = $entry_factory->newCreatingEntry('');
foreach ($_POST['presubmit'] as $attr) {
$_POST['attrs'][] = $attr;
$_POST['form'][$attr] = $templates->EvaluateDefault($ldapserver,$template['attribute'][$attr]['presubmit'],$_POST['container']);
$_POST['vals'][] = $_POST['form'][$attr];
}
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_reader').'($ldapserver);');
$entry->accept($reader);
# @todo: This section needs to be cleaned up, and will be when the old templates are removed. In the mean time...
# Rebuild the $_POST['attrs'] & $_POST['vals'], as they can be inconsistent.
unset($_POST['attrs']);
unset($_POST['vals']);
foreach ($_POST['form'] as $attr => $val) {
$_POST['attrs'][] = $attr;
$_POST['vals'][] = $val;
}
$container = $entry->getContainer();
if (!$container || !$ldapserver->dnExists($container))
pla_error(sprintf(_('The container you specified (%s) does not exist. Please try again.'),htmlspecialchars($container)),null,-1,true);
$tree = get_cached_item($ldapserver->server_id,'tree');
if ($tree) {
$container_entry = $tree->getEntry($container);
if (!$container_entry)
$tree->addEntry($container);
$container_entry = $tree->getEntry($container);
if ($container_entry->isLeaf())
pla_error(sprintf(_('The container (%s) is a leaf.'), htmlspecialchars($container)), null, -1, true);
}
$vals = isset( $_POST['vals'] ) ? $_POST['vals'] : array();
$attrs = isset( $_POST['attrs'] ) ? $_POST['attrs'] : array();
$entry->setRdnAttributeName($rdn_attr);
if (!$entry->getRdnAttribute())
pla_error(sprintf(_('The Rdn attribute (%s) does not exist.'), htmlspecialchars($rdn_attr)), null, -1, true);
$new_dn = $entry->getDn();
if (! $new_dn)
pla_error(_('You left the RDN field blank.'));
$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : false;
// build the new entry
$new_entry = array();
if( isset( $required_attrs ) && is_array( $required_attrs ) ) {
foreach( $required_attrs as $attr => $val ) {
if( $val == '' )
pla_error( sprintf( $lang['create_required_attribute'], htmlspecialchars( $attr ) ) );
$new_entry[ $attr ][] = $val;
$attrs = $entry->getAttributes();
foreach ($attrs as $attr) {
$vals = $attr->getValues();
$new_vals = array();
foreach ($vals as $val) {
if (strlen($val) > 0)
$new_vals[] = $val;
}
if ($attr->isRequired() && !$new_vals)
pla_error(sprintf(_('You left the value blank for required attribute (%s).'), htmlspecialchars($attr->getName())));
if ($new_vals)
$new_entry[$attr->getName()] = $new_vals;
}
if( isset( $attrs ) && is_array( $attrs ) ) {
foreach( $attrs as $i => $attr ) {
if( is_attr_binary( $ldapserver, $attr ) ) {
if( isset( $_FILES['vals']['name'][$i] ) && $_FILES['vals']['name'][$i] != '' ) {
// read in the data from the file
$file = $_FILES['vals']['tmp_name'][$i];
$f = fopen( $file, 'r' );
$binary_data = fread( $f, filesize( $file ) );
fclose( $f );
$val = $binary_data;
$new_entry[ $attr ][] = $val;
}
} else {
if (is_array($vals[$i])) {
# If the array has blank entries, then ignore them.
foreach ($vals[$i] as $value) {
# $new_entry[$attr] = $vals[$i];
if (trim($value))
$new_entry[$attr][] = $value;
}
} else {
$val = isset( $vals[$i] ) ? $vals[$i] : '';
if( '' !== trim($val) )
$new_entry[ $attr ][] = $val;
}
}
}
}
$new_entry['objectClass'] = $object_classes;
if( ! in_array( 'top', $new_entry['objectClass'] ) )
if (! in_array('top', $new_entry['objectClass']))
$new_entry['objectClass'][] = 'top';
foreach( $new_entry as $attr => $vals ) {
// Check to see if this is a unique Attribute
if( $badattr = checkUniqueAttr( $ldapserver, $new_dn, $attr, $vals ) ) {
$search_href = sprintf('search.php?search=true&amp;form=advanced&amp;server_id=%s&amp;filter=%s=%s',
$ldapserver->server_id,$attr,$badattr);
pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$new_dn,$search_href ) );
foreach ($new_entry as $attr => $vals) {
# Check to see if this is a unique Attribute
if ($badattr = $ldapserver->checkUniqueAttr($new_dn,$attr,$vals)) {
$search_href = sprintf('?cmd=search&amp;search=true&amp;form=advanced&amp;server_id=%s&amp;filter=%s=%s', $ldapserver->server_id,$attr,$badattr);
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$new_dn,$search_href));
}
if( ! is_attr_binary( $ldapserver, $attr ) )
if( is_array( $vals ) )
foreach( $vals as $i => $v )
$new_entry[ $attr ][ $i ] = $v;
else
$new_entry[ $attr ] = $vals;
}
//echo "<pre>"; var_dump( $new_dn );print_r( $new_entry ); echo "</pre>";
# Check the user-defined custom call back first
if (run_hook('pre_entry_create',array('server_id'=>$ldapserver->server_id,'dn'=>$new_dn,'attrs'=>$new_entry)))
$add_result = $ldapserver->add($new_dn,$new_entry);
// Check the user-defined custom call back first
if( true === run_hook ( 'pre_entry_create', array ( 'server_id' => $ldapserver->server_id,'dn' => $new_dn,'attrs' => $new_entry ) ) )
$add_result = @ldap_add( $ldapserver->connect(), $new_dn, $new_entry );
if ($add_result) {
run_hook('post_entry_create',array('server_id'=>$ldapserver->server_id,'dn'=>$new_dn,'attrs'=>$new_entry));
else {
pla_error( $lang['create_could_not_add'] );
exit;
}
$action_number = $_SESSION[APPCONFIG]->GetValue('appearance', 'action_after_creation');
if( $add_result ) {
run_hook ( 'post_entry_create', array ( 'server_id' => $ldapserver->server_id, 'dn' => $new_dn, 'attrs' => $new_entry ) );
$container = get_container($new_dn,false);
//$container_container = get_container($container);
if ($redirect)
if ($redirect) {
$redirect_url = $redirect;
else
$redirect_url = sprintf('edit.php?server_id=%s&dn=%s',$ldapserver->server_id,rawurlencode($new_dn));
if( array_key_exists( 'tree', $_SESSION ) ) {
$tree = $_SESSION['tree'];
$tree_icons = $_SESSION['tree_icons'];
if( isset( $tree[$ldapserver->server_id][$container] ) ) {
$tree[$ldapserver->server_id][$container][] = $new_dn;
sort( $tree[$ldapserver->server_id][$container] );
$tree_icons[$ldapserver->server_id][$new_dn] = get_icon( $ldapserver, $new_dn );
}
$_SESSION['tree'] = $tree;
$_SESSION['tree_icons'] = $tree_icons;
session_write_close();
} else if ($action_number == 2) {
$redirect_url = sprintf('cmd.php?cmd=template_engine&server_id=%s&container=%s', $ldapserver->server_id, rawurlencode($container));
} else {
$redirect_url = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s', $ldapserver->server_id, rawurlencode($new_dn));
}
?>
<html>
<head>
if ($action_number == 1 || $action_number == 2)
printf('<meta http-equiv="refresh" content="0; url=%s" />',$redirect_url);
<?php if (isset($tree[$ldapserver->server_id][$container]) || in_array($new_dn,$ldapserver->getBaseDN())) { ?>
if ($action_number == 1 || $action_number == 2) {
$create_message = sprintf('%s DN%s <b>%s</b> %s',_('Creation successful!'),_(':'),htmlspecialchars($new_dn),_('has been created.'));
<!-- refresh the tree view (with the new DN renamed)
and redirect to the edit_dn page -->
<script language="javascript">
parent.left_frame.location.reload();
location.href='<?php echo $redirect_url; ?>';
</script>
system_message(array(
'title'=>_('Create Entry'),
'body'=>$create_message,
'type'=>'info'),
$redirect_url);
} else {
printf('<h3 class="title">%s</h3>',_('Entry created'));
echo '<br />';
echo '<center>';
printf('<a href="cmd.php?cmd=template_engine&server_id=%s&dn=%s">%s</a>.',$ldapserver->server_id,rawurlencode($new_dn),_('Display the new created entry'));
echo '<br />';
printf('<a href="cmd.php?cmd=template_engine&server_id=%s&container=%s">%s</a>.',$ldapserver->server_id,rawurlencode($container),_('Create another entry'));
echo '</center>';
}
<?php } ?>
<meta http-equiv="refresh" content="0; url=<?php echo $redirect_url; ?>" />
</head>
<body>
<?php echo $lang['redirecting'] ?> <a href="<?php echo $redirect_url; ?>"><?php echo $lang['here']?></a>.
</body>
</html>
<?php } else {
pla_error( $lang['create_could_not_add'], $ldapserver->error(), $ldapserver->errno() );
} else {
pla_error(_('Could not add the object to the LDAP server.'),$ldapserver->error(),$ldapserver->errno());
}
?>

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,9 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.23.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.27.2.2 2007/12/26 09:26:32 wurley Exp $
/**
* Deletes a DN and presents a "job's done" message.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as POST vars:
* - dn (rawurlencoded)
*
@@ -17,65 +15,38 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
pla_error(_('You cannot perform updates while server is in read-only mode'));
$dn = $_POST['dn'];
$encoded_dn = rawurlencode($dn);
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'simple_delete'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')));
if (is_null($dn))
pla_error($lang['you_must_specify_a_dn']);
$entry['dn'] = get_request('dn');
dn_exists($ldapserver,$dn) or pla_error(sprintf($lang['no_such_entry'], '<b>' . pretty_print_dn($dn) . '</b>'));
if (! $entry['dn'])
pla_error(_('You must specify a DN'));
// Check the user-defined custom callback first.
if (run_hook('pre_entry_delete',array('server_id' => $ldapserver->server_id,'dn' => $dn)))
$del_result = @ldap_delete($ldapserver->connect(), $dn);
if (! $ldapserver->dnExists($entry['dn']))
pla_error(sprintf(_('No such entry: %s'),'<b>'.pretty_print_dn($entry['dn']).'</b>'));
# Check the user-defined custom callback first.
if (run_hook('pre_entry_delete',array('server_id'=>$ldapserver->server_id,'dn'=>$entry['dn'])))
$result = $ldapserver->delete($entry['dn']);
else
pla_error(sprintf($lang['could_not_delete_entry'],'<b>'.pretty_print_dn($dn).'</b>'));
if ($del_result) {
pla_error(sprintf(_('Could not delete the entry: %s'),'<b>'.pretty_print_dn($entry['dn']).'</b>'));
if ($result) {
# Custom callback
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'=>$entry['dn']));
# kill the DN from the tree browser session variable and
# refresh the tree viewer frame (left_frame)
if (array_key_exists('tree', $_SESSION)) {
$tree = $_SESSION['tree'];
system_message(array(
'title'=>_('Delete DN'),
'body'=>_('Successfully deleted DN ').sprintf('<b>%s</b>',$entry['dn']),
'type'=>'info'),
sprintf('index.php?server_id=%s',$ldapserver->server_id));
if (isset($tree[$ldapserver->server_id]) && is_array($tree[$ldapserver->server_id])) {
# does it have children? (it shouldn't, but hey, you never know)
if (isset($tree[$ldapserver->server_id][$dn]))
unset($tree[$ldapserver->server_id][$dn]);
# search and destroy
foreach ($tree[$ldapserver->server_id] as $tree_dn => $subtree)
foreach ($subtree as $key => $sub_tree_dn)
if (0 == strcasecmp($sub_tree_dn, $dn))
unset($tree[$ldapserver->server_id][$tree_dn][$key]);
$_SESSION['tree'] = $tree;
}
session_write_close();
}
include './header.php'; ?>
<script language="javascript">
parent.left_frame.location.reload();
</script>
<br />
<br />
<center><?php echo sprintf($lang['entry_deleted_successfully'],'<b>'.pretty_print_dn($dn).'</b>'); ?></center>
<?php
} else {
pla_error(sprintf($lang['could_not_delete_entry'], '<b>' . pretty_print_dn($dn) . '</b>'),
$ldapserver->error(), $ldapserver->errno());
pla_error(sprintf(_('Could not delete the entry: %s'),'<b>'.pretty_print_dn($entry['dn']).'</b>'),
$ldapserver->error(),$ldapserver->errno());
}
?>

View File

@@ -1,13 +1,10 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.13.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.16.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* Deletes an attribute from an entry with NO confirmation.
*
* Variables that come in via common.php
* - server_id
*
* On success, redirect to edit.php
* On success, redirect to template_engine.php
* On failure, echo an error.
*
* @package phpLDAPadmin
@@ -18,37 +15,38 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
pla_error(_('You cannot perform updates while server is in read-only mode'));
$dn = isset($_POST['dn']) ? $_POST['dn'] : null;
$attr = isset($_POST['attr']) ? $_POST['attr'] : null;
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete attribute')));
if (! $dn)
pla_error($lang['no_dn_specified']);
$entry['dn']['string'] = get_request('dn');
$entry['dn']['encode'] = rawurlencode($entry['dn']['string']);
$entry['attr'] = get_request('attr');
if (! $attr)
pla_error($lang['no_attr_specified']);
if (! $entry['dn']['string'])
pla_error(_('No DN specified'));
$encoded_dn = rawurlencode($dn);
if (! $entry['attr'])
pla_error(_('No attribute name specified.'));
if (is_attr_read_only($ldapserver,$attr))
pla_error(sprintf($lang['attr_is_read_only'],htmlspecialchars($attr)));
if ($ldapserver->isAttrReadOnly($entry['attr']))
pla_error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),htmlspecialchars($entry['attr'])));
$update_array = array();
$update_array[$attr] = array();
$update_array[$entry['attr']] = array();
$res = @ldap_modify($ldapserver->connect(),$dn,$update_array);
if ($res) {
$redirect_url = sprintf("edit.php?server_id=%s&dn=%s",$ldapserver->server_id,$encoded_dn);
$result = $ldapserver->modify($entry['dn']['string'],$update_array);
if ($result) {
$redirect_url = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$ldapserver->server_id,$entry['dn']['encode']);
foreach($update_array as $attr => $junk)
foreach ($update_array as $attr => $junk)
$redirect_url .= "&modified_attrs[]=$attr";
header("Location: $redirect_url");
die();
} else {
pla_error($lang['could_not_perform_ldap_modify'],$ldapserver->error(),$ldapserver->errno());
pla_error(_('Could not perform ldap_modify operation.'),$ldapserver->error(),$ldapserver->errno());
}
?>

View File

@@ -1,12 +1,10 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.20 2005/07/22 05:47:44 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.26 2007/12/15 07:50:30 wurley Exp $
/**
* delete_form.php
* Displays a last chance confirmation form to delete a dn.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
@@ -18,136 +16,123 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
pla_error(_('You cannot perform updates while server is in read-only mode'));
$dn = $_GET['dn'];
$entry['dn']['string'] = get_request('dn','GET');
$entry['dn']['html'] = htmlspecialchars($entry['dn']['string']);
$encoded_dn = rawurlencode( $dn );
$rdn = pla_explode_dn( $dn );
$rdn = $rdn[0];
$children = get_container_contents( $ldapserver,$dn,0,'(objectClass=*)',LDAP_DEREF_NEVER );
$has_children = count($children) > 0 ? true : false;
# We search all children, not only the visible children in the tree
$entry['children'] = $ldapserver->getContainerContents($entry['dn']['string'],0,'(objectClass=*)',LDAP_DEREF_NEVER);
include './header.php'; ?>
printf('<h3 class="title">'._('Delete %s').'</h3>',htmlspecialchars(get_rdn($entry['dn']['string'])));
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),$entry['dn']['html']);
echo "\n";
<body>
echo '<center>';
<h3 class="title"><?php echo sprintf( $lang['delete_dn'], htmlspecialchars( $rdn ) ); ?></b></h3>
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']; ?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
if (count($entry['children'])) {
printf('<b>%s</b><br /><br />',_('Permanently delete all children also?'));
<?php if( $has_children ) { ?>
# Get the total number of child objects (whole sub-tree)
$search['entries'] = $ldapserver->search(null,dn_escape($entry['dn']['string']),'objectClass=*',array('dn'));
$search['count'] = count($search['entries']);
$search['href'] = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&;server_id=%s&filter=%s&base_dn=%s&form=advanced&scope=sub',
$ldapserver->server_id,rawurlencode('objectClass=*'),rawurlencode($entry['dn']['string'])));
<center><b><?php echo $lang['permanently_delete_children']; ?></b><br /><br />
echo '<table class="delete" border=0>';
echo '<tr>';
echo '<td colspan=2>';
printf(_('This entry is the root of a sub-tree containing %s entries.'),$search['count']);
printf(' <small>(<a href="%s">%s</a>)</small>',
$search['href'],_('view entries'));
echo '</td></tr>';
<?php
flush();
echo '<tr><td colspan=2>&nbsp;</td></tr>';
# get the total number of child objects (whole sub-tree)
$s = pla_ldap_search( $ldapserver, 'objectClass=*', $dn, array('dn'), 'sub' );
$sub_tree_count = count( $s );
printf('<tr><td colspan=2>%s</td></tr>',
sprintf(_('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?'),$search['count']-1));
echo '<tr><td colspan=2>&nbsp;</td></tr>';
printf('<tr><td colspan=2><small>%s</small></td></tr>',
_('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 "\n";
echo '<tr>';
echo '<td width=50%><center>';
echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="rdelete" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" class="scary" value="%s" />',sprintf(_('Delete all %s objects'),$search['count']));
echo '</form>';
echo '</center></td>';
echo '<td width=50%><center>';
echo '<form action="cmd.php" method="get">';
echo '<input type="hidden" name="cmd" value="template_engine" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
echo '</form>';
echo '</center></td>';
echo '</tr>';
echo "\n";
echo '</table>';
echo "\n";
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,$search['count']));
$i = 0;
foreach ($search['entries'] as $dn => $junk) {
$i++;
printf('<option>%s. %s</option>',$i,htmlspecialchars(dn_unescape($dn)));
}
echo '</select>';
echo "\n";
} else {
echo '<table class="delete" border=0>';
printf('<tr><td colspan=4>%s</td></tr>',_('Are you sure you want to permanently delete this object?'));
echo '<tr><td colspan=4>&nbsp;</td></tr>';
printf('<tr><td width=10%%>%s:</td><td colspan=3 width=75%%><b>%s</b></td></tr>',_('Server'),htmlspecialchars($ldapserver->name));
printf('<tr><td width=10%%><acronym title="%s">%s</acronym></td><td colspan=3 width=75%%><b>%s</b></td></tr>',
_('Distinguished Name'),_('DN'),$entry['dn']['string']);
echo '<tr><td colspan=4>&nbsp;</td></tr>';
echo "\n";
echo '<tr>';
echo '<td colspan=2 width=50%><center>';
echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="delete" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="scary" />',_('Delete'));
echo '</form>';
echo '</center></td>';
echo '<td colspan=2 width=50%><center>';
echo '<form action="cmd.php" method="get">';
echo '<input type="hidden" name="cmd" value="template_engine" />';
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($entry['dn']['string']));
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
echo '</form>';
echo '</center></td>';
echo '</tr>';
echo '</table>';
echo "\n";
}
echo '</center>';
echo '<br />';
?>
<table class="delete_confirm">
<tr>
<td>
<p>
<?php echo sprintf( $lang['entry_is_root_sub_tree'], $sub_tree_count ); ?>
<small>(<a href="search.php?search=true&amp;server_id=<?php echo $ldapserver->server_id; ?>&amp;filter=<?php echo rawurlencode('objectClass=*'); ?>&amp;base_dn=<?php echo $encoded_dn; ?>&amp;form=advanced&amp;scope=sub"><?php echo $lang['view_entries']; ?></a>)</small>
<br />
<br />
<?php echo sprintf( $lang['confirm_recursive_delete'], ($sub_tree_count-1) ); ?><br />
<br />
<small><?php echo $lang['confirm_recursive_delete_note']; ?></small>
<br />
<br />
<table width="100%">
<tr>
<td>
<center>
<form action="rdelete.php" method="post">
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" class="scary" value="<?php echo sprintf( $lang['delete_all_x_objects'], $sub_tree_count ); ?>" />
</form>
</center>
</td>
<td>
<center>
<form action="edit.php" method="get">
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" name="submit" value="<?php echo $lang['cancel']; ?>" class="cancel" />
</form>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php flush(); ?>
<br />
<br />
<?php echo $lang['list_of_entries_to_be_deleted']; ?><br />
<select size="<?php echo min( 10, $sub_tree_count );?>" multiple disabled style="background:white; color:black;width:500px" >
<?php $i=0;
foreach( $s as $dn => $junk ) {
$i++; ?>
<option><?php echo $i; ?>. <?php echo htmlspecialchars( ( $dn ) ); ?></option>
<?php } ?>
</select>
<br />
<?php } else { ?>
<center>
<table class="delete_confirm">
<tr>
<td>
<?php echo $lang['sure_permanent_delete_object']; ?><br />
<br />
<nobr><acronym title="<?php echo $lang['distinguished_name']; ?>"><?php echo $lang['dn']; ?></acronym>: <b><?php echo pretty_print_dn( $dn ); ?></b><nobr><br />
<nobr><?php echo $lang['server']; ?>: <b><?php echo htmlspecialchars($ldapserver->name); ?></b></nobr><br />
<br />
<table width="100%">
<tr>
<td>
<center>
<form action="delete.php" method="post">
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" name="submit" value="<?php echo $lang['delete']; ?>" class="scary" />
</form>
</center>
</td>
<td>
<center>
<form action="edit.php" method="get">
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
<input type="submit" name="submit" value="<?php echo $lang['cancel']; ?>" class="cancel" />
</form>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<?php } ?>
</body>
</html>

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.12.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.15.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* @package phpLDAPadmin
@@ -12,33 +12,29 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
pla_error(_('You cannot perform updates while server is in read-only mode'));
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
pla_error(_('Not enough information to login to server. Please check your configuration.'));
$dn = rawurldecode($_GET['dn']);
$attr = $_GET['attr'];
# if there are multiple values in this attribute, which one do you want to see?
$value_num = isset($_GET['value_num']) ? $_GET['value_num'] : 0;
$value_num = isset($_GET['value_num']) ? $_GET['value_num'] : null;
dn_exists($ldapserver,$dn) or
pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn)));
if (! $ldapserver->dnExists($dn))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn)));
$search = @ldap_read($ldapserver->connect(),$dn,"(objectClass=*)",array($attr),0,0,0,$config->GetValue('deref','view'));
if (! $search)
pla_error($lang['error_performing_search'],$ldapserver->error(),$ldapserver->errno());
$search = $ldapserver->search(null,$dn,'(objectClass=*)',array($attr),'base',false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
$entry = ldap_first_entry($ldapserver->connect(),$search);
$attrs = ldap_get_attributes($ldapserver->connect(),$entry);
$attr = ldap_first_attribute($ldapserver->connect(),$entry,$attrs);
$values = ldap_get_values_len($ldapserver->connect(),$entry,$attr);
$count = $values['count'];
// Dump the binary data to the browser
header("Content-type: octet-stream");
# Dump the binary data to the browser
if (ob_get_level()) ob_end_clean();
header('Content-type: octet-stream');
header("Content-disposition: attachment; filename=$attr");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
echo $values[$value_num];
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
if ($value_num && is_array($search[$attr][$dn]))
echo $search[$dn][$attr][$value_num];
else
echo $search[$dn][$attr];
?>

41
htdocs/draw_tree_node.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/draw_tree_node.php,v 1.2.2.1 2007/12/21 12:11:55 wurley Exp $
/**
* @package phpLDAPadmin
*/
$entry['dn'] = get_request('dn','REQUEST');
$entry['server_id'] = get_request('server_id','REQUEST');
$entry['code'] = get_request('code','REQUEST');
$entry['action'] = get_request('action','REQUEST');
$tree = Tree::getInstance($entry['server_id']);
if (! $tree)
die();
$dnentry = $tree->getEntry($entry['dn']);
if (! $dnentry) {
$tree->addEntry($entry['dn']);
$dnentry = $this->getEntry($entry['dn']);
}
if (! $dnentry)
die();
if ($entry['action'] == 0) {
$dnentry->close();
} elseif ($entry['action'] == 2) {
$dnentry->open();
} else {
$dnentry->open();
if ($entry['dn']) {
echo $tree->draw_children($dnentry,$entry['code']);
} else {
$tree->draw(true);
}
}
die();
?>

View File

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

View File

@@ -1,89 +1,93 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.26.2.1 2005/10/09 09:07:21 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.31.2.2 2007/12/29 08:24:10 wurley Exp $
/**
* Display a selection (popup window) to pick a DN.
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
include './common.php';
include HTDOCDIR.'header.php';
$container = isset($_GET['container']) ? rawurldecode($_GET['container']) : false;
$return_form_element = isset($_GET['form_element']) ? htmlspecialchars($_GET['form_element']) : null;
$rdn = isset($_GET['rdn']) ? htmlspecialchars($_GET['rdn']) : null;
$entry['container'] = get_request('container','GET');
$entry['element'] = get_request('form_element','GET');
$entry['rdn'] = get_request('rdn','GET');
include "./header.php";
printf('<h3 class="subtitle">%s</h3>',$lang['entry_chooser_title']);
flush();
echo '<body>';
echo '<div class="entry_chooser">';
printf('<h3>%s</h3>',_('Entry Chooser'));
?>
<script language="javascript">
function returnDN( dn ) {
opener.document.<?php echo $return_form_element; ?>.value = dn;
<script type="text/javascript" language="javascript">
function returnDN(dn) {
opener.document.<?php echo $entry['element']; ?>.value = dn;
close();
}
</script>
<?php
if ($container) {
printf('%s<b>%s</b>',$lang['server_colon_pare'],htmlspecialchars($ldapserver->name));
print '<br />';
printf('%s<b>%s</b>',$lang['look_in'],htmlspecialchars($container));
print '<br />';
echo '<table class="entry_chooser" border=0>';
if ($entry['container']) {
printf('<tr><td class="head" colspan=3>%s:</td><td class="value">%s</td></tr>',_('Server'),htmlspecialchars($ldapserver->name));
printf('<tr><td class="head" colspan=3>%s:</td><td class="value">%s</td></tr>',_('Looking in'),htmlspecialchars($entry['container']));
echo '<tr><td class="spacer" colspan=4>&nbsp;</td></tr>';
}
/* Has the use already begun to descend into a specific server tree? */
if (isset($ldapserver) && $container !== false) {
if (isset($ldapserver) && ! is_null($entry['container'])) {
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
pla_error(_('Not enough information to login to server. Please check your configuration.'));
$dn_list = get_container_contents($ldapserver,$container,0,'(objectClass=*)',$config->GetValue('deref','tree'));
sort($dn_list);
$entry['children'] = $ldapserver->getContainerContents($entry['container'],0,'(objectClass=*)',$_SESSION[APPCONFIG]->GetValue('deref','tree'));
sort($entry['children']);
foreach ($ldapserver->getBaseDN() as $base_dn) {
if (DEBUG_ENABLED)
debug_log('entry_chooser.php: Comparing BaseDN [%s] with container [%s]',9,$base_dn,$container);
if (DEBUG_ENABLED)
debug_log('Comparing BaseDN [%s] with container [%s]',64,__FILE__,__LINE__,__METHOD__,$base_dn,$entry['container']);
if (! pla_compare_dns($container,$base_dn)) {
if (! pla_compare_dns($entry['container'],$base_dn)) {
$parent_container = false;
$up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s',$return_form_element,$rdn);
$href['up'] = htmlspecialchars(sprintf('entry_chooser.php?form_element=%s&rdn=%s',$entry['element'],$entry['rdn']));
break;
} else {
$parent_container = get_container($container);
$up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s&amp;server_id=%s&amp;container=%s',
$return_form_element,$rdn,$ldapserver->server_id,rawurlencode($parent_container));
$parent_container = get_container($entry['container']);
$href['up'] = htmlspecialchars(sprintf('entry_chooser.php?form_element=%s&rdn=%s&server_id=%s&container=%s',
$entry['element'],$entry['rdn'],$ldapserver->server_id,rawurlencode($parent_container)));
}
}
print '&nbsp;';
printf('<a href="%s" style="text-decoration:none"><img src="images/up.png"> %s</a>',$up_href,$lang['back_up_p']);
print '<br />';
echo '<tr>';
echo '<td class="spacer">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="images/up.png" alt="Up" /></a></td>',$href['up']);
printf('<td class="value" colspan=2><a href="%s">%s</a></td>',$href['up'],_('Back Up...'));
echo '</tr>';
if (! count($dn_list))
printf('&nbsp;&nbsp;&nbsp;(%s)<br />',$lang['no_entries']);
if (! count($entry['children']))
printf('<td class="spacer" colspan=2>&nbsp;</td><td class="body" colspan=2">(%s)</td>',_('no entries'));
else
foreach ($dn_list as $dn) {
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
print '&nbsp;&nbsp;&nbsp;';
printf('<a href="entry_chooser.php?server_id=%s&amp;form_element=%s&rdn=%s&amp;container=%s"><img src="images/plus.png" /></a>',
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
foreach ($entry['children'] as $dn) {
$href['return'] = sprintf("javascript:returnDN('%s%s')",($entry['rdn'] ? sprintf('%s,',$entry['rdn']) : ''),rawurlencode($dn));
$href['expand'] = htmlspecialchars(sprintf('entry_chooser.php?server_id=%s&form_element=%s&rdn=%s&container=%s',
$ldapserver->server_id,$entry['element'],$entry['rdn'],rawurlencode($dn)));
printf('<a href="%s">%s</a>',$href,htmlspecialchars($dn));
print '<br />';
echo '<tr>';
echo '<td class="spacer">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="images/plus.png" alt="Plus" /></a></td>',$href['expand']);
printf('<td colspan=2 class="body"><a href="%s">%s</a></td>',$href['return'],htmlspecialchars($dn));
echo '</tr>';
echo "\n\n";
}
/* draw the root of the selection tree (ie, list all the servers) */
} else {
foreach ($ldapservers->GetServerList() as $id) {
foreach ($_SESSION[APPCONFIG]->ldapservers->GetServerList() as $id) {
$ldapserver = $ldapservers->Instance($id);
$ldapserver = $_SESSION[APPCONFIG]->ldapservers->Instance($id);
if ($ldapserver->isVisible()) {
@@ -91,25 +95,30 @@ if (isset($ldapserver) && $container !== false) {
continue;
else {
printf('<b>%s</b>',htmlspecialchars($ldapserver->name));
print '<br />';
printf('<tr><td class="head" colspan=3>%s:</td><td class="value">%s</td></tr>',_('Server'),htmlspecialchars($ldapserver->name));
foreach ($ldapserver->getBaseDN() as $dn) {
if (! $dn) {
printf('<small>&nbsp;&nbsp;&nbsp;(%s)</small><br />',$lang['could_not_det_base_dn']);
printf('<tr><td class="spacer">&nbsp;</td><td class="body" colspan=3>(%s)</td></tr>',_('Could not determine base DN'));
} else {
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
$href['return'] = sprintf("javascript:returnDN('%s%s')",($entry['rdn'] ? sprintf('%s,',$entry['rdn']) : ''),rawurlencode($dn));
$href['expand'] = htmlspecialchars(sprintf('entry_chooser.php?server_id=%s&form_element=%s&rdn=%s&container=%s',
$ldapserver->server_id,$entry['element'],$entry['rdn'],rawurlencode($dn)));
print '&nbsp;&nbsp;&nbsp;';
printf('<a href="entry_chooser.php?server_id=%s&amp;form_element=%s&rdn=%s&amp;container=%s"><img src="images/plus.png" /></a> ',
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
printf('<a href="%s">%s</a>',$href,htmlspecialchars($dn));
print '<br />';
echo '<tr>';
echo '<td class="spacer">&nbsp;</td>';
printf('<td colspan=2 class="icon"><a href="%s"><img src="images/plus.png" alt="Plus" /></a></td>',$href['expand']);
printf('<td colspan=2 class="body"><a href="%s">%s</a></td>',$href['return'],htmlspecialchars($dn));
}
}
echo '<tr><td class="spacer" colspan=4>&nbsp;</td></tr>';
}
}
}
}
echo '</table>';
echo '</div>';
echo '</body></html>';
?>

View File

@@ -1,15 +1,10 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/expand.php,v 1.22 2005/07/22 05:47:44 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/expand.php,v 1.26 2007/12/15 07:50:30 wurley Exp $
/**
* This script alters the session variable 'tree', expanding it
* at the dn specified in the query string.
*
* Variables that come in via common.php
* - server_id
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
* Note: this script is equal and opposite to collapse.php
* @package phpLDAPadmin
* @see collapse.php
@@ -19,51 +14,13 @@
require './common.php';
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
$dn = get_request('dn','GET',true);
$tree = get_cached_item($ldapserver->server_id,'tree');
$entry = $tree->getEntry($dn);
$entry->open();
set_cached_item($ldapserver->server_id,'tree','null',$tree);
# no expire header stuff
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
# This allows us to display large sub-trees without running out of time.
@set_time_limit( 0 );
$dn = $_GET['dn'];
$encoded_dn = rawurlencode( $dn );
initialize_session_tree();
$tree = $_SESSION['tree'];
$tree_icons = $_SESSION['tree_icons'];
$contents = get_container_contents( $ldapserver, $dn, 0, '(objectClass=*)', $config->GetValue('deref','tree'));
usort( $contents, 'pla_compare_dns' );
$tree[$ldapserver->server_id][$dn] = $contents;
foreach( $contents as $dn )
$tree_icons[$ldapserver->server_id][$dn] = get_icon( $ldapserver, $dn );
$_SESSION['tree'] = $tree;
$_SESSION['tree_icons'] = $tree_icons;
// This is for Opera. By putting "random junk" in the query string, it thinks
// that it does not have a cached version of the page, and will thus
// fetch the page rather than display the cached version
$time = gettimeofday();
$random_junk = md5( strtotime( 'now' ) . $time['usec'] );
// If cookies were disabled, build the url parameter for the session id.
// It will be append to the url to be redirect
$id_session_param="";
if( SID != "" )
$id_session_param = "&".session_name()."=".session_id();
session_write_close();
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,$encoded_dn,$id_session_param));
header(sprintf('Location:index.php?server_id=%s&junk=%s#%s%s',
$ldapserver->server_id,random_junk(),htmlid($ldapserver->server_id,$dn),pla_session_param()));
die();
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.15 2005/09/25 16:11:44 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.18.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* @package phpLDAPadmin
@@ -7,100 +7,107 @@
/**
*/
require './common.php';
# Fix a bug with IE:
ini_set('session.cache_limiter','');
require './common.php';
require LIBDIR.'export_functions.php';
// get the POST parameters
$server_id = (isset($_POST['server_id']) ? $_POST['server_id'] : '');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('export'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('export')));
if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$entry['base_dn'] = get_request('dn');
$entry['format'] = get_request('format','POST',false,'unix');
$entry['scope'] = get_request('scope','POST',false,'base');
$entry['filter'] = get_request('filter','POST',false,'objectclass=*');
$entry['attr'] = get_request('attributes');
$entry['sys_attr'] = get_request('sys_attr');
$entry['file'] = get_request('save_as_file') ? true : false;
$entry['exporter_id'] = get_request('exporter_id');
$base_dn = isset($_POST['dn']) ? $_POST['dn']:NULL;
$format = isset( $_POST['format'] ) ? $_POST['format'] : "unix";
$scope = isset($_POST['scope']) ? $_POST['scope'] : 'base';
$filter = isset($_POST['filter']) ? $_POST['filter'] : 'objectclass=*';
$target = isset($_POST['target']) ? $_POST['target'] : 'display';
$save_as_file = isset( $_POST['save_as_file'] ) && $_POST['save_as_file'] == 'on';
if ($entry['filter']) {
$entry['filter'] = preg_replace('/\s+/','',$entry['filter']);
$attributes = split(',',preg_replace('/\s+/','',$entry['attr']));
// add system attributes if needed
$attributes = array();
if( isset( $_POST['sys_attr'] ) ){
array_push($attributes,'*');
array_push($attributes,'+');
} else {
$attributes = array();
}
isset($_POST['exporter_id']) or pla_error( $lang['must_choose_export_format'] );
$exporter_id = $_POST['exporter_id'];
isset($exporters[$exporter_id]) or pla_error( $lang['invalid_export_format'] );
// Initialisation of other variables
$rdn = get_rdn( $base_dn );
$friendly_rdn = get_rdn( $base_dn, 1 );
$extension = $exporters[$exporter_id]['extension'];
//set the default CRLN to Unix format
$br = "\n";
// default case not really needed
switch( $format ) {
case 'win':
$br = "\r\n";
break;
case 'mac':
$br = "\r";
break;
case 'unix':
default:
$br = "\n";
# Add system attributes if needed
if ($entry['sys_attr']) {
array_push($attributes,'*');
array_push($attributes,'+');
}
// get the decoree,ie the source
$plaLdapExporter = new PlaLdapExporter($server_id,$filter,$base_dn,$scope,$attributes);
(! is_null($entry['exporter_id'])) or pla_error(_('You must choose an export format.'));
isset($exporters[$entry['exporter_id']]) or pla_error(_('Invalid export format'));
// the decorator
// do it that way for the moment
$exporter = NULL;
# Initialisation of other variables
$friendly_rdn = get_rdn($entry['base_dn'],1);
$extension = $exporters[$entry['exporter_id']]['extension'];
switch($exporter_id){
case 0:
$exporter = new PlaLdifExporter($plaLdapExporter);
break;
case 1:
$exporter = new PlaDsmlExporter($plaLdapExporter);
break;
case 2:
$exporter = new PlaVcardExporter($plaLdapExporter);
break;
case 3:
$exporter = new PlaCSVExporter($plaLdapExporter);
break;
default:
// truly speaking,this default case will never be reached. See check at the bottom.
$plaLdapExporter->pla_close();
pla_error( $lang['no_exporter_found'] );
# default case not really needed
switch ($entry['format']) {
case 'win':
$br = "\r\n";
break;
case 'mac':
$br = "\r";
break;
case 'unix':
default:
$br = "\n";
}
// set the CLRN
# get the decoree,ie the source
$plaLdapExporter = new PlaLdapExporter($ldapserver->server_id,$entry['filter'],$entry['base_dn'],$entry['scope'],$attributes);
# the decorator do it that way for the moment
$exporter = null;
switch ($entry['exporter_id']) {
case 0:
$exporter = new PlaLdifExporter($plaLdapExporter);
break;
case 1:
$exporter = new PlaDsmlExporter($plaLdapExporter);
break;
case 2:
$exporter = new PlaVcardExporter($plaLdapExporter);
break;
case 3:
$exporter = new PlaCSVExporter($plaLdapExporter);
break;
default:
# truly speaking,this default case will never be reached. See check at the bottom.
pla_error(_('No available exporter found.'));
}
# set the CLRN
$exporter->setOutputFormat($br);
// prevent script from bailing early for long search
@set_time_limit( 0 );
if (isset($_REQUEST['compress']) && $_REQUEST['compress'] = 'on')
$exporter->compress(true);
# prevent script from bailing early for long search
@set_time_limit(0);
// send the header
if( $save_as_file )
header( "Content-type: application/download" );
else
header( "Content-type: text/plain" );
header( "Content-Disposition: filename=$friendly_rdn.".$exporters[$exporter_id]['extension'] );
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: post-check=0, pre-check=0", false );
# send the header
if ($entry['file']) {
if (ob_get_level()) ob_end_clean();
header('Content-type: application/download');
header(sprintf('Content-Disposition: filename="%s.%s"',$friendly_rdn,$exporters[$entry['exporter_id']]['extension'].($exporter->isCompressed()?'.gz':'')));
$exporter->export();
die();
// and export
$exporter->export();
} else {
print '<span style="font-size: 14px; font-family: courier;"><pre>';
$exporter->export();
print '</pre></span>';
}
?>

View File

@@ -1,150 +1,161 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.22 2005/09/25 16:11:44 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.26 2007/12/15 07:50:30 wurley Exp $
/**
* export_form.php
* --------------------
*
* Html form to choose an export format(ldif,...)
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
require LIBDIR.'export_functions.php';
$server_id = isset( $_GET['server_id'] ) ? $_GET['server_id']:NULL ;
$format = isset( $_GET['format'] ) ? $_GET['format'] : get_line_end_format();
$scope = isset( $_GET['scope'] ) ? $_GET['scope'] : 'base' ;
$exporter_id = isset( $_GET['exporter_id'] ) ? $_GET['exporter_id'] : 0 ;
$dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null;
$filter = isset( $_GET['filter'] ) ? $_GET['filter'] : '(objectClass=*)';
$attributes = isset( $_GET['attributes'] ) ? $_GET['attributes'] : '*';
$sys_attr = isset( $_GET['sys_attr'] ) && $_GET['sys_attr'] == 'true' ? true : false;
$entry['format'] = get_request('format','GET',false,get_line_end_format());
$entry['scope'] = get_request('scope','GET',false,'base');
$entry['id'] = get_request('exporter_id','GET',false,0);
$entry['dn'] = get_request('dn','GET');
$entry['filter'] = get_request('filter','GET',false,'(objectClass=*)');
$entry['attr'] = get_request('attributes','GET',false,'*');
$entry['sys_attr'] = get_request('sys_attr','GET') ? true: false;
$available_formats = array(
'unix' => 'UNIX (Linux, BSD)',
'mac' => 'Macintosh',
$available_formats = array (
'unix' => 'UNIX (Linux, BSD)',
'mac' => 'Macintosh',
'win' => 'Windows'
);
$available_scopes = array(
'base' => $lang['scope_base'],
'one' => $lang['scope_one'],
'sub' => $lang['scope_sub']
$available_scopes = array (
'base' => _('Base (base dn only)'),
'one' => _('One (one level beneath base)'),
'sub' => _('Sub (entire subtree)')
);
printf('<h3 class="title">%s</h3>',_('Export'));
echo '<br />';
echo '<center>';
echo '<form name="export_form" action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="export" />';
echo '<table class="export">';
echo '<tr>';
echo '<td>';
include './header.php'; ?>
echo '<fieldset>';
printf('<legend>%s</legend>',_('Export'));
<body>
<h3 class="title"><?php echo $lang['export']; ?></h3>
<br />
<center>
<form name="export_form" action="export.php" method="POST">
<table class="export_form">
<tr>
<td>
<fieldset>
<legend><?php echo $lang['export']; ?></legend>
<table>
<tr>
<td><?php echo $lang['server']; ?></td>
<td><?php print server_select_list(); ?></td>
</tr>
<tr>
<td style="white-space:nowrap"><?php echo $lang['base_dn']; ?></td>
<td><nobr><input type="text" name="dn" id="dn" style="width:230px" value="<?php echo htmlspecialchars( $dn ); ?>" /> <?php draw_chooser_link( 'export_form.dn' ); ?></nobr></td>
</tr>
<tr>
<td><span style="white-space: nowrap"><?php echo $lang['search_scope']; ?></span></td>
<td>
<?php foreach( $available_scopes as $id => $desc ) {
$id = htmlspecialchars( $id );
$desc = htmlspecialchars( $desc ); ?>
echo '<table>';
printf('<tr><td>%s</td><td>%s</td></tr>',_('Server'),server_select_list($ldapserver->server_id));
<input type="radio" name="scope" value="<?php echo $id; ?>" id="<?php echo $id; ?>"<?php if($id==$scope) echo ' checked="true"';?> /><label for="<?php echo $id; ?>"><?php echo $desc; ?></label><br />
echo '<tr>';
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($entry['dn']));
draw_chooser_link('export_form.dn');
echo '</span></td>';
echo '</tr>';
<?php } ?>
</td>
</tr>
<tr>
<td><?php echo $lang['search_filter']; ?></td>
<td><input type="text" name="filter" style="width:300px" value="<?php echo htmlspecialchars($filter); ?>" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" name="sys_attr" id="sys_attr" <?php if( $sys_attr ) echo 'checked="true" '; ?>/> <label for="sys_attr"><?php echo $lang['include_system_attrs']; ?></label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" id="save_as_file" name="save_as_file" /><label for="save_as_file"><?php echo $lang['save_as_file']; ?></label></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr><td style="width: 50%">
<fieldset style="height: 100px">
<legend><?php echo $lang['export_format']; ?></legend>
echo '<tr>';
printf('<td><span style="white-space: nowrap">%s</span></td>',_('Search Scope'));
<?php foreach($exporters as $index => $exporter){?>
echo '<td>';
<input type="radio" name="exporter_id" value="<?php echo htmlspecialchars($index); ?>" id="<?php echo htmlspecialchars($index); ?>" <?php if($index==$exporter_id) echo ' checked="true"'; ?> />
<label for="<?php echo htmlspecialchars( $index ); ?>"><?php echo htmlspecialchars( $exporter['desc'] ); ?></label><br />
foreach ($available_scopes as $id => $desc)
printf('<input type="radio" name="scope" value="%s" id="%s"%s /><label for="%s">%s</label><br />',
htmlspecialchars($id),htmlspecialchars($id),($id == $entry['scope']) ? 'checked="true"' : '',
htmlspecialchars($id),htmlspecialchars($desc));
<?php } ?>
echo '</td>';
echo '</tr>';
</fieldset>
</td>
<td style="width: 50%">
<fieldset style="height: 100px">
<legend><?php echo $lang['line_ends']; ?></legend>
<?php foreach( $available_formats as $id => $desc ) {
$id = htmlspecialchars( $id );
$desc = htmlspecialchars( $desc );
?>
<input type="radio" name="format" value="<?php echo $id; ?>" id="<?php echo $id; ?>"<?php if($format==$id) echo ' checked="true"'; ?> /><label for="<?php echo $id; ?>"><?php echo $desc; ?></label><br />
printf('<tr><td>%s</td><td><input type="text" name="filter" style="width:300px" value="%s" /></td></tr>',
_('Search Filter'),htmlspecialchars($entry['filter']));
<?php } ?>
</fieldset>
</td></tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<center>
<input type="submit" name="target" value="<?php echo $lang['proceed_gt']; ?>" />
</center>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
printf('<tr><td>%s</td><td><input type="text" name="attributes" style="width:300px" value="%s" /></td></tr>',
_('Show Attributtes'),htmlspecialchars($entry['attr']));
<?php
printf('<tr><td>&nbsp;</td><td><input type="checkbox" name="sys_attr" id="sys_attr" %s/> <label for="sys_attr">%s</label></td></tr>',
$entry['sys_attr'] ? 'checked="true" ' : '',_('Include system attributes'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="save_as_file" name="save_as_file" onclick="toggle_disable_field_saveas(this)" /> <label for="save_as_file">%s</label></td></tr>',
_('Save as file'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="compress" name="compress" disabled /> <label for="compress">%s</label></td></tr>',
_('Compress'));
echo '</table>';
echo '</fieldset>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<table style="width: 100%">';
echo '<tr><td style="width: 50%">';
echo '<fieldset style="height: 100px">';
printf('<legend>%s</legend>',_('Export format'));
foreach ($exporters as $index => $exporter) {
printf('<input type="radio" name="exporter_id" id="exporter_id_%s" value="%s"%s />',
htmlspecialchars($index),htmlspecialchars($index),($index==$entry['id']) ? ' checked="true"' : '');
printf('<label for="%s">%s</label><br />',
htmlspecialchars($index),htmlspecialchars($exporter['desc']));
}
echo '</fieldset>';
echo '</td>';
echo '<td style="width: 50%">';
echo '<fieldset style="height: 100px">';
printf('<legend>%s</legend>',_('Line ends'));
foreach ($available_formats as $id => $desc)
printf('<input type="radio" name="format" value="%s" id="%s"%s /><label for="%s">%s</label><br />',
htmlspecialchars($id),htmlspecialchars($id),($entry['format']==$id) ? ' checked="true"' : '',
htmlspecialchars($id),htmlspecialchars($desc));
echo '</fieldset>';
echo '</td></tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td colspan="2">';
printf('<center><input type="submit" name="target" value="%s" /></center>',
htmlspecialchars(_('Proceed >>')));
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</form>';
echo '</center>';
/**
* Helper functoin for fetching the line end format.
* @return String 'win', 'unix', or 'mac' based on the user's browser..
*/
function get_line_end_format()
{
if( is_browser_os_windows() )
return 'win';
elseif( is_browser_os_unix() )
return 'unix';
elseif( is_browser_os_mac() )
return 'mac';
else
return 'unix';
function get_line_end_format() {
if (is_browser_os_windows())
return 'win';
elseif (is_browser_os_unix())
return 'unix';
elseif (is_browser_os_mac())
return 'mac';
else
return 'unix';
}
?>
<script type="text/javascript" language="javascript">
<!--
function toggle_disable_field_saveas(id) {
if (id.checked) {
id.form.compress.disabled = false;
} else {
id.form.compress.disabled = true;
id.form.compress.checked = false;
}
}
-->
</script>

View File

@@ -1,49 +1,69 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.19.2.2 2005/10/25 20:21:15 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.27.2.1 2007/12/26 09:26:32 wurley Exp $
/**
* @package phpLDAPadmin
*/
// We want to get $language into scope in case we were included
// from within a function
global $config;
$language = isset($config) ? $language = $config->GetValue('appearance','language') : 'auto';
require_once LIBDIR.'./common.php';
// text/xml won't work with MSIE, but is very useful for debugging xhtml code.
//@header( "Content-type: text/xml; charset=\"UTF-8\"" );
@header( "Content-type: text/html; charset=\"UTF-8\"" );
/* We want to get $language into scope in case we were included
from within a function */
$language = isset($_SESSION[APPCONFIG]) ? $language = $_SESSION[APPCONFIG]->GetValue('appearance','language') : 'auto';
// XML version and encoding for well-behaved browsers
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
# text/xml won't work with MSIE, but is very useful for debugging xhtml code.
# header('Content-type: text/xml; charset="UTF-8"');
@header('Content-type: text/html; charset="UTF-8"');
# XML version and encoding for well-behaved browsers
echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'."\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);
echo "\n\n";
echo '<head>';
if (isset($_SESSION[APPCONFIG]) && $pagetitle = $_SESSION[APPCONFIG]->GetValue('appearance','page_title'))
printf('<title>phpLDAPadmin - %s</title>',$pagetitle);
else
echo '<title>phpLDAPadmin</title>';
if (isset($_SESSION[APPCONFIG]))
$css = $_SESSION[APPCONFIG]->GetValue('appearance','stylesheet');
else
$css = 'style.css';
printf('<link type="text/css" rel="stylesheet" href="%s%s" media="screen" />','../htdocs/'.CSSDIR,$css);
if (isset($server_id)) {
$custom_file = get_custom_file($server_id,'style.css','../htdocs/'.CSSDIR);
if (strcmp($custom_file,'style.css') != 0)
printf('<link type="text/css" rel="stylesheet" href="%s" media="screen" />',$custom_file);
}
printf('<script type="text/javascript" src="%sentry_chooser.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sie_png_work_around.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sgeneric_utils.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sto_ascii.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%smodify_member.js"></script>','../htdocs/'.JSDIR);
printf('<link type="text/css" rel="stylesheet" media="all" href="%s/jscalendar/calendar-blue.css" title="blue" />','../htdocs/'.JSDIR);
echo "\n<!--\n";
printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/lang/calendar-en.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar-setup.js"></script>','../htdocs/'.JSDIR);
printf('<script type="text/javascript" src="%sdate_selector.js"></script>','../htdocs/'.JSDIR);
echo "\n-->\n";
printf('<link type="text/css" rel="stylesheet" href="%s/phplayersmenu/layerstreemenu.css"></link>','../htdocs/'.JSDIR);
if (isset($meta_refresh_variable))
printf('<meta http-equiv="refresh" content="%s" />',$meta_refresh_variable);
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
echo '</head>';
echo "\n\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $language; ?>" lang="<?php echo $language; ?>" dir="ltr">
<head>
<?php if (isset($config) && $pagetitle = $config->GetValue('appearance','page_title')) { ?>
<title>phpLDAPadmin - <?php echo $pagetitle; ?></title>
<?php } else { ?>
<title>phpLDAPadmin</title>
<?php } ?>
<link rel="stylesheet" href="<?php echo CSSDIR ?>style.css" media="screen" />
<?php if( isset( $server_id ) ) {
$custom_file = get_custom_file( $server_id, 'style.css',CSSDIR );
if( strcmp( $custom_file, 'style.css' ) != 0 ) { ?>
<link rel="stylesheet" href="<?php echo $custom_file ?>" media="screen" />
<?php }
} ?>
<script src="<?php echo JSDIR; ?>entry_chooser.js" type="text/javascript"></script>
<script src="<?php echo JSDIR; ?>ie_png_work_around.js" type="text/javascript"></script>
<script src="<?php echo JSDIR; ?>search_util.js" type="text/javascript"></script>
<script src="<?php echo JSDIR; ?>generic_utils.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="all" href="js/jscalendar/calendar-blue.css" title="blue" />
<script type="text/javascript" src="js/jscalendar/calendar.js"></script>
<script type="text/javascript" src="js/jscalendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
<script type="text/javascript" src="<?php echo JSDIR; ?>date_selector.js"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
htdocs/images/bug-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

BIN
htdocs/images/export.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
htdocs/images/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

BIN
htdocs/images/help-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
htdocs/images/home-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
htdocs/images/import.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
htdocs/images/info-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

BIN
htdocs/images/key.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

BIN
htdocs/images/light-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
htdocs/images/logout.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

BIN
htdocs/images/nogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

BIN
htdocs/images/notice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
htdocs/images/schema.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

BIN
htdocs/images/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
htdocs/images/smile-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
htdocs/images/trash-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,9 +1,8 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.39.2.3 2005/10/17 10:03:38 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.49.2.3 2007/12/30 02:06:15 wurley Exp $
/**
* @package phpLDAPadmin
* @todo: Move config.php syntax error processing to earlier.
*/
/*******************************************
@@ -17,235 +16,92 @@ PHP is not installed on your web server!!!
/**
* We will perform some sanity checking here, since this file is normally loaded first when users
* first setup PLA.
* first access the application.
*/
define('LIBDIR','../lib/');
define('LIBDIR',sprintf('%s/',realpath('../lib/')));
ini_set('display_errors',1);
error_reporting(E_ALL);
# General functions needed to proceed (pla_ldap_search(), pla_error(), get_object_attrs(), etc.)
# General functions needed to proceed.
ob_start();
if (! file_exists(LIBDIR.'functions.php')) {
ob_end_clean();
die("Fatal error: Required file 'functions.php' does not exist.");
if (ob_get_level()) ob_end_clean();
die(sprintf("Fatal error: Required file '<b>%sfunctions.php</b>' does not exist.",LIBDIR));
}
if (! is_readable(LIBDIR.'functions.php')) {
ob_end_clean();
die("Cannot read the file 'functions.php' its permissions are too strict.");
if (ob_get_level()) ob_end_clean();
die(sprintf("Cannot read the file '<b>%sfunctions.php</b>' its permissions may be too strict.",LIBDIR));
}
require LIBDIR.'functions.php';
$config_file = CONFDIR.'config.php';
ob_end_clean();
/* Helper functions.
if (ob_get_level())
ob_end_clean();
require LIBDIR.'functions.php';
# Define the path to our configuration file.
if (defined('CONFDIR'))
$app['config_file'] = CONFDIR.'config.php';
else
$app['config_file'] = 'config.php';
# Make sure this PHP install has gettext, we use it for language translation
if (! extension_loaded('gettext'))
pla_error('<p>Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>');
/**
* Helper functions.
* Our required helper functions are defined in functions.php
*/
foreach ($pla_function_files as $file_name ) {
if (! file_exists($file_name))
pla_error("Fatal error: Required file '$file_name' does not exist.");
if (isset($app['function_files']) && is_array($app['function_files']))
foreach ($app['function_files'] as $file_name ) {
if (! file_exists($file_name))
pla_error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name));
if (! is_readable($file_name))
pla_error( "Fatal error: Cannot read the file '$file_name', its permissions are too strict." );
if (! is_readable($file_name))
pla_error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name));
ob_start();
require $file_name;
ob_end_clean();
}
ob_start();
require $file_name;
if (ob_get_level()) ob_end_clean();
}
# Configuration File check
if (! file_exists($config_file)) {
?>
if (! file_exists($app['config_file'])) {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"';
echo '"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">';
<html>
<head>
<title>phpLDAPadmin - <?php echo pla_version(); ?></title>
<link rel="stylesheet" href="style.css" />
</head>
echo '<html>';
echo '<head>';
printf('<title>%s - %s</title>','phpLDAPadmin',pla_version());
echo '<link type="text/css" rel="stylesheet" href="css/style.css" />';
echo '</head>';
<body>
<h3 class="title">Configure phpLDAPadmin</h1>
<br />
<br />
echo '<body>';
printf('<h3 class="title">Configure %s</h3>','phpLDAPadmin');
echo '<br /><br />';
<center><?php echo $lang['need_to_configure']; ?></center>
</body>
</html>
echo '<center>';
printf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),'phpLDAPadmin',$app['config_file'],$app['config_file']);
echo '</center>';
<?php
echo '</body>';
echo '</html>';
die();
} elseif (! is_readable($config_file)) {
pla_error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions are too strict.',$config_file));
} elseif (! is_readable($app['config_file'])) {
pla_error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']));
}
# Now read in config_default.php, which also reads in config.php
require LIBDIR.'config_default.php';
# If our config file fails the sanity check, then stop now.
if (! check_config($app['config_file'])) {
$www['page'] = new page();
$www['body'] = new block();
$www['page']->block_add('body',$www['body']);
$www['page']->display();
if (check_config()) {
print '<?xml version="1.0" encoding="utf-8"?>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="no-NO">
<?php if ($pagetitle = $config->GetValue('appearance','page_title')) { ?>
<head><title>phpLDAPadmin (<?php echo pla_version(); ?>) - <?php echo $pagetitle; ?></title></head>
<?php } else { ?>
<head><title>phpLDAPadmin - <?php echo pla_version(); ?></title></head>
<?php } ?>
<frameset cols="<?php echo $config->GetValue('appearance','tree_width'); ?>,*">
<frame src="tree.php" name="left_frame" id="left_frame" />
<frame src="welcome.php" name="right_frame" id="right_frame" />
</frameset>
</html>
<?php }
/*
* Makes sure that the config file is properly setup and
* that your install of PHP can handle LDAP stuff.
*/
function check_config() {
global $lang, $config_file;
# Make sure their PHP version is current enough
if (strcmp(phpversion(),REQUIRED_PHP_VERSION) < 0) {
pla_error(sprintf('phpLDAPadmin requires PHP version %s or greater. You are using %s',
REQUIRED_PHP_VERSION,phpversion()));
}
# Make sure this PHP install has all our required extensions
if (! extension_loaded('ldap')) {
pla_error( "Your install of PHP appears to be missing LDAP support. Please install " .
"LDAP support before using phpLDAPadmin. (Don't forget to restart your web server afterwards)");
return false;
}
# Make sure that we have php-xml loaded.
if (! function_exists('xml_parser_create')) {
pla_error( "Your install of PHP appears to be missing XML support. Please install " .
"XML support before using phpLDAPadmin. (Don't forget to restart your web server afterwards)");
return false;
}
# Make sure their session save path is writable, if they are using a file system session module, that is.
if ( ! strcasecmp("Files",session_module_name() && ! is_writable(realpath(session_save_path())))) {
pla_error( "Your PHP session configuration is incorrect. Please check the value of session.save_path
in your php.ini to ensure that the directory specified there exists and is writable.
The current setting of \"". session_save_path() . "\" is un-writable by the web server.");
return false;
}
/* check for syntax errors in config.php */
# capture the result of including the file with output buffering
ob_start();
include $config_file;
$str = ob_get_contents();
ob_end_clean();
if( $str && false !== strpos( $str, 'error' ) ) {
$str = strip_tags( $str );
$matches = array();
preg_match( "/on line (\d+)/", $str, $matches );
$line_num = $matches[1];
$file = file($config_file);
?>
<html>
<head>
<title>phpLDAPadmin Config File Error</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h3 class="title">Config file error</h3>
<h3 class="subtitle">Syntax error on line <?php echo $line_num; ?></h3>
<center>
Looks like your config file has a syntax error on line <?php echo $line_num; ?>.
Here is a snippet around that line
<br />
<br />
<div style="text-align: left; margin-left: 80px; margin-right: 80px; border: 1px solid black; padding: 10px;">
<tt>
<?php for( $i=$line_num-9; $i<$line_num+5; $i++ ) {
if( $i+1 == $line_num )
echo "<div style=\"color:red;background:#fdd\">";
if( $i < 0 )
continue;
echo "<b>" . ($i+1) . "</b>: " . htmlspecialchars($file[ $i ]) . "<br />";
if( $i+1 == $line_num )
echo "</div>";
}
?>
</tt>
</div>
<br />
Hint: Sometimes these errors are caused by lines <b>preceding</b> the line reported.
</body>
</html>
<?php return false;
}
/* check the existence of the servers array */
require $config_file;
if( ! isset($ldapservers) || count($ldapservers->GetServerList()) == 0) {
pla_error( "Your config.php is missing Server Definitions
Please see the sample file config.php.example ", false );
return false;
}
# @todo: Implement this and fix all the tests.
/*
if ( ! count($ldapservers->GetServerList())) {
pla_error( "None of the " . count($servers) . " servers in your \$servers configuration is
active in config.php. At least one of your servers must set the 'host' directive.
Example: <br><pre>\$servers['host'] = \"ldap.example.com\";<br></pre>
phpLDAPadmin cannot proceed util you correct this.", false );
return false;
}
// Check that 'base' is present on all serve entries
foreach( $servers as $id => $server ) {
if( isset( $server['host'] ) && isset( $server['name'] ) )
isset( $server['base'] )
or pla_error ( "Your configuration has an error. You omitted the 'base' directive
on server number $id. Your server entry must have a 'base' directive
even if it's empty ('')." );
}
// Check each of the servers in the servers array
foreach( $servers as $id => $server ) {
if( isset( $server['host'] ) ) {
// Make sure they specified an auth_type
if( ! isset( $server['auth_type'] ) ) {
pla_error( "Your configuration has an error. You omitted the 'auth_type' directive on server number $id
'auth_type' must be set, and it must be one of 'config', 'cookie', or 'session'.", false );
return false;
}
// Make sure they specified a correct auth_type
if( ! in_array( $server['auth_type'], array( 'config', 'cookie', 'session' ) ) ) {
global $lang;
pla_error( sprintf( $lang['error_auth_type_config'], htmlspecialchars( $server['auth_type'] ) ) );
return false;
}
}
}
*/
return true;
exit;
}
include './cmd.php';
?>

View File

@@ -1,11 +1,17 @@
function dateSelector(id) {
var el = document.getElementById('f_date_'+id);
var el = document.getElementById('f_date_'+id);
var format = gettype(el.id);
var epoch;
var parse = false;
var cal = new Calendar(0, null, onSelect, onClose);
cal.showsTime = false;
var cal = new Calendar(0, null, onSelect, onClose);
if (defaults['f_time_'+id]) {
cal.showsTime = true;
} else {
cal.showsTime = false;
}
cal.weekNumbers = true;
cal.showsOtherMonths = true;
cal.create();

View File

@@ -19,7 +19,7 @@
* than modifying calendar.js itself).
*/
// $Id: calendar-setup.js,v 1.1.2.1 2005/10/09 05:45:23 wurley Exp $
// $Id: calendar-setup.js,v 1.2 2005/10/09 11:16:50 wurley Exp $
/**
* This function "patches" an input field (or other element) to use a calendar

View File

@@ -12,7 +12,7 @@
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
*/
// $Id: calendar.js,v 1.1.2.1 2005/10/09 05:45:23 wurley Exp $
// $Id: calendar.js,v 1.2 2005/10/09 11:16:50 wurley Exp $
/** The Calendar object constructor. */
Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {

View File

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

View File

@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -0,0 +1,24 @@
Copyright (C) 2001-2004 Marco Pratesi
PHP Layers Menu is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
PHP Layers Menu is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A copy of version 2.1 of the GNU Lesser General Public License
is available in the file COPYING.
Marco Pratesi
http://www.marcopratesi.it/
This is taken from phplayersmenu-3.2.0-rc

View File

@@ -0,0 +1,81 @@
table.tree .treemenudiv {
display: block;
white-space: nowrap;
padding-top: 1px;
padding-bottom: 1px;
}
table.tree .phplmnormal {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplmnormal:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}
table.tree a.phplmselected:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplmselected:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}

View File

@@ -0,0 +1,567 @@
<?php
// vim: set expandtab tabstop=4 shiftwidth=4:
// This code that was derived from the original PHPLIB Template class
// is copyright by Kristian Koehntopp, NetUSE AG and was released
// under the LGPL.
//
// Authors: Kristian Koehntopp <kris@koehntopp.de> (original from PHPLIB)
// Bjoern Schotte <bjoern@rent-a-phpwizard.de> (PEARification)
// Martin Jansen <mj@php.net> (PEAR conformance)
//
// $Id: PHPLIB.php,v 1.3 2006/09/17 06:22:04 wurley Exp $
//
//require_once "PEAR.php";
/**
* Converted PHPLIB Template class
*
* For those who want to use PHPLIB's fine template class,
* here's a PEAR conforming class with the original PHPLIB
* template code from phplib-stable CVS. Original author
* was Kristian Koehntopp <kris@koehntopp.de>
*
* @author Bjoern Schotte <bjoern@rent-a-phpwizard.de>
* @author Martin Jansen <mj@php.net> (PEAR conformance)
* @version 1.0
*/
class Template_PHPLIB
{
/**
* If set, echo assignments
* @var bool
*/
public $debug = false;
/**
* $file[handle] = "filename";
* @var array
*/
public $file = array();
/**
* fallback paths that should be defined in a child class
* @var array
*/
public $file_fallbacks = array();
/**
* Relative filenames are relative to this pathname
* @var string
*/
public $root = "";
/*
* $_varKeys[key] = "key"
* @var array
*/
public $_varKeys = array();
/**
* $_varVals[key] = "value";
* @var array
*/
public $_varVals = array();
/**
* "remove" => remove undefined variables
* "comment" => replace undefined variables with comments
* "keep" => keep undefined variables
* @var string
*/
public $unknowns = "remove";
/**
* "yes" => halt, "report" => report error, continue, "no" => ignore error quietly
* @var string
*/
public $haltOnError = "report";
/**
* The last error message is retained here
* @var string
* @see halt
*/
public $_lastError = "";
/**
* Constructor
*
* @access public
* @param string template root directory
* @param string how to handle unknown variables
* @param array fallback paths
*/
function Template_PHPLIB($root = ".", $unknowns = "remove", $fallback="")
{
$this->setRoot($root);
$this->setUnknowns($unknowns);
if (is_array($fallback)) $this->file_fallbacks = $fallback;
}
/**
* Sets the template directory
*
* @access public
* @param string new template directory
* @return bool
*/
function setRoot($root)
{
if (!is_dir($root)) {
$this->halt("setRoot: $root is not a directory.");
return false;
}
$this->root = $root;
return true;
}
/**
* What to do with unknown variables
*
* three possible values:
*
* - "remove" will remove unknown variables
* (don't use this if you define CSS in your page)
* - "comment" will replace undefined variables with comments
* - "keep" will keep undefined variables as-is
*
* @access public
* @param string unknowns
*/
function setUnknowns($unknowns = "keep")
{
$this->unknowns = $unknowns;
}
/**
* Set appropriate template files
*
* With this method you set the template files you want to use.
* Either you supply an associative array with key/value pairs
* where the key is the handle for the filname and the value
* is the filename itself, or you define $handle as the file name
* handle and $filename as the filename if you want to define only
* one template.
*
* @access public
* @param mixed handle for a filename or array with handle/name value pairs
* @param string name of template file
* @return bool
*/
function setFile($handle, $filename = "")
{
if (!is_array($handle)) {
if ($filename == "") {
$this->halt("setFile: For handle $handle filename is empty.");
return false;
}
$this->file[$handle] = $this->_filename($filename);
} else {
reset($handle);
while (list($h, $f) = each($handle)) {
$this->file[$h] = $this->_filename($f);
}
}
}
/**
* Set a block in the appropriate template handle
*
* By setting a block like that:
*
* &lt;!-- BEGIN blockname --&gt;
* html code
* &lt;!-- END blockname --&gt;
*
* you can easily do repeating HTML code, i.e. output
* database data nice formatted into a HTML table where
* each DB row is placed into a HTML table row which is
* defined in this block.
* It extracts the template $handle from $parent and places
* variable {$name} instead.
*
* @access public
* @param string parent handle
* @param string block name handle
* @param string variable substitution name
*/
function setBlock($parent, $handle, $name = "")
{
if (!$this->_loadFile($parent)) {
$this->halt("setBlock: unable to load $parent.");
return false;
}
if ($name == "") {
$name = $handle;
}
$str = $this->getVar($parent);
$reg = "/[ \t]*<!--\s+BEGIN $handle\s+-->\s*?\n?(\s*.*?\n?)\s*<!--\s+END $handle\s+-->\s*?\n?/sm";
preg_match_all($reg, $str, $m);
$str = preg_replace($reg, "{" . "$name}", $str);
if (isset($m[1][0])) $this->setVar($handle, $m[1][0]);
$this->setVar($parent, $str);
}
/**
* Set corresponding substitutions for placeholders
*
* @access public
* @param string name of a variable that is to be defined or an array of variables with value substitution as key/value pairs
* @param string value of that variable
* @param boolean if true, the value is appended to the variable's existing value
*/
function setVar($varname, $value = "", $append = false)
{
if (!is_array($varname)) {
if (!empty($varname))
if ($this->debug) print "scalar: set *$varname* to *$value*<br>\n";
$this->_varKeys[$varname] = $this->_varname($varname);
($append) ? $this->_varVals[$varname] .= $value : $this->_varVals[$varname] = $value;
} else {
reset($varname);
while (list($k, $v) = each($varname)) {
if (!empty($k))
if ($this->debug) print "array: set *$k* to *$v*<br>\n";
$this->_varKeys[$k] = $this->_varname($k);
($append) ? $this->_varVals[$k] .= $v : $this->_varVals[$k] = $v;
}
}
}
/**
* Substitute variables in handle $handle
*
* @access public
* @param string name of handle
* @return mixed string substituted content of handle
*/
function subst($handle)
{
if (!$this->_loadFile($handle)) {
$this->halt("subst: unable to load $handle.");
return false;
}
return @str_replace($this->_varKeys, $this->_varVals, $this->getVar($handle));
}
/**
* Same as subst but printing the result
*
* @access public
* @brother subst
* @param string handle of template
* @return bool always false
*/
function pSubst($handle)
{
print $this->subst($handle);
return false;
}
/**
* Parse handle into target
*
* Parses handle $handle into $target, eventually
* appending handle at $target if $append is defined
* as TRUE.
*
* @access public
* @param string target handle to parse into
* @param string which handle should be parsed
* @param boolean append it to $target or not?
* @return string parsed handle
*/
function parse($target, $handle, $append = false)
{
if (!is_array($handle)) {
$str = $this->subst($handle);
($append) ? $this->setVar($target, $this->getVar($target) . $str) : $this->setVar($target, $str);
} else {
reset($handle);
while (list(, $h) = each($handle)) {
$str = $this->subst($h);
$this->setVar($target, $str);
}
}
return $str;
}
/**
* Same as parse, but printing it.
*
* @access public
* @brother parse
* @param string target to parse into
* @param string handle which should be parsed
* @param should $handle be appended to $target?
* @return bool
*/
function pParse($target, $handle, $append = false)
{
print $this->finish($this->parse($target, $handle, $append));
return false;
}
/**
* Return all defined variables and their values
*
* @access public
* @return array with all defined variables and their values
*/
function getVars()
{
reset($this->_varKeys);
while (list($k, ) = each($this->_varKeys)) {
$result[$k] = $this->getVar($k);
}
return $result;
}
/**
* Return one or more specific variable(s) with their values.
*
* @access public
* @param mixed array with variable names or one variable name as a string
* @return mixed array of variable names with their values or value of one specific variable
*/
function getVar($varname)
{
if (!is_array($varname)) {
if (isset($this->_varVals[$varname])) {
return $this->_varVals[$varname];
} else {
return "";
}
} else {
reset($varname);
while (list($k, ) = each($varname)) {
$result[$k] = (isset($this->_varVals[$k])) ? $this->_varVals[$k] : "";
}
return $result;
}
}
/**
* Get undefined values of a handle
*
* @access public
* @param string handle name
* @return mixed false if an error occured or the undefined values
*/
function getUndefined($handle)
{
if (!$this->_loadFile($handle)) {
$this->halt("getUndefined: unable to load $handle.");
return false;
}
preg_match_all("/{([^ \t\r\n}]+)}/", $this->getVar($handle), $m);
$m = $m[1];
if (!is_array($m)) {
return false;
}
reset($m);
while (list(, $v) = each($m)) {
if (!isset($this->_varKeys[$v])) {
$result[$v] = $v;
}
}
if (isset($result) && count($result)) {
return $result;
} else {
return false;
}
}
/**
* Finish string
*
* @access public
* @param string string to finish
* @return finished, i.e. substituted string
*/
function finish($str)
{
switch ($this->unknowns) {
case "remove":
$str = preg_replace('/{[^ \t\r\n}]+}/', "", $str);
break;
case "comment":
$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
break;
}
return $str;
}
/**
* Print variable to the browser
*
* @access public
* @param string name of variable to print
*/
function p($varname)
{
print $this->finish($this->getVar($varname));
}
/**
* Get finished variable
*
* @access public public
* @param string variable to get
* @return string string with finished variable
*/
function get($varname)
{
return $this->finish($this->getVar($varname));
}
/**
* Complete filename
*
* Complete filename, i.e. testing it for slashes
*
* @access private
* @param string filename to be completed
* @return string completed filename
*/
function _filename($filename)
{
// if (substr($filename, 0, 1) != "/") {
// $filename = $this->root."/".$filename;
// }
if (file_exists($filename)) return $filename;
if (is_array($this->file_fallbacks) && count($this->file_fallbacks) > 0) {
reset($this->file_fallbacks);
while (list(,$v) = each($this->file_fallbacks)) {
if (file_exists($v.basename($filename))) return $v.basename($filename);
}
$this->halt(sprintf("filename: file %s does not exist in the fallback paths %s.",$filename,implode(",",$this->file_fallbacks)));
return false;
} else {
$this->halt(sprintf("filename: file %s does not exist.",$filename));
return false;
}
return $filename;
}
/**
* Protect a replacement variable
*
* @access private
* @param string name of replacement variable
* @return string replaced variable
*/
function _varname($varname)
{
return "{".$varname."}";
}
/**
* load file defined by handle if it is not loaded yet
*
* @access private
* @param string handle
* @return bool FALSE if error, true if all is ok
*/
function _loadFile($handle)
{
if (isset($this->_varKeys[$handle]) and !empty($this->_varVals[$handle])) {
return true;
}
if (!isset($this->file[$handle])) {
$this->halt("loadfile: $handle is not a valid handle.");
return false;
}
$filename = $this->file[$handle];
if (function_exists("file_get_contents")) {
$str = file_get_contents($filename);
} else {
if (!$fp = @fopen($filename,"r")) {
$this->halt("loadfile: couldn't open $filename");
return false;
}
$str = fread($fp,filesize($filename));
fclose($fp);
}
if ($str=='') {
$this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
return false;
}
$this->setVar($handle, $str);
return true;
}
/**
* Error function. Halt template system with message to show
*
* @access public
* @param string message to show
* @return bool
*/
function halt($msg)
{
$this->_lastError = $msg;
if ($this->haltOnError != "no") {
// return $this->haltMsg($msg);
$this->haltMsg($msg);
}
if ($this->haltOnError == "yes") {
die("<b>Halted.</b>");
}
return false;
}
/**
* printf error message to show
*
* @access public
* @param string message to show
* @return object PEAR error object
*/
function haltMsg($msg)
{
// PEAR::raiseError(sprintf("<b>Template Error:</b> %s<br>\n", $msg));
printf("<b>Template Error:</b> %s<br>\n", $msg);
}
}
?>

View File

@@ -0,0 +1,959 @@
<?php
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
/**
* This file contains the code of the LayersMenuCommon class.
* @package PHPLayersMenu
*/
/**
* This is the "common" class of the PHP Layers Menu library.
*
* You need to include PEAR.php and DB.php if (and only if) you want to use the DB support provided by ths class.
*
* @version 3.2.0-rc
* @package PHPLayersMenu
*/
class LayersMenuCommon
{
/**
* The name of the package
* @access private
* @var string
*/
public $_packageName;
/**
* The version of the package
* @access private
* @var string
*/
public $version;
/**
* The copyright of the package
* @access private
* @var string
*/
public $copyright;
/**
* The author of the package
* @access private
* @var string
*/
public $author;
/**
* URL to be prepended to the menu hrefs
* @access private
* @var string
*/
public $prependedUrl = '';
/**
* Do you want that code execution halts on error?
* @access private
* @var string
*/
public $haltOnError = 'yes';
/**
* The base directory where the package is installed
* @access private
* @var string
*/
public $dirroot;
/**
* The "libjs" directory of the package
* @access private
* @var string
*/
public $libjsdir;
/**
* The directory where images related to the menu can be found
* @access private
* @var string
*/
public $imgdir;
/**
* The http path corresponding to imgdir
* @access private
* @var string
*/
public $imgwww;
/**
* The directory where icons of menu items can be found
* @access private
* @var string
*/
public $icondir;
/**
* The http path corresponding to icondir
* @access private
* @var string
*/
public $iconwww;
/**
* This array may contain width and height of all icons
* @access private
* @var integer
*/
public $iconsize = array();
/**
* If this var is false, width and height of icons have to be detected; if this var is true, width and height of icons are not detected and are retrieved from the iconsize array
* @access private
* @var boolean
*/
public $issetIconsize = false;
/**
* The directory where templates can be found
* @access private
* @var string
*/
public $tpldir;
/**
* The string containing the menu structure
* @access private
* @var string
*/
public $menuStructure;
/**
* It counts nodes for all menus
* @access private
* @var integer
*/
public $_nodesCount;
/**
* A multi-dimensional array to store informations for each menu entry
* @access private
* @var array
*/
public $tree;
/**
* A multi-dimensional array used only with the DB support; for each $menu_name, it stores the $cnt associated to each item id
*
* This array is needed for selection of the current item
* through the corresponding id (see the DB table structure)
* as, internally, items are stored, sorted and addressed in terms of $cnt
*
* @access private
* @var array
*/
public $treecnt;
/**
* The maximum hierarchical level of menu items
* @access private
* @var integer
*/
public $_maxLevel;
/**
* An array that counts the number of first level items for each menu
* @access private
* @var array
*/
public $_firstLevelCnt;
/**
* An array containing the number identifying the first item of each menu
* @access private
* @var array
*/
public $_firstItem;
/**
* An array containing the number identifying the last item of each menu
* @access private
* @var array
*/
public $_lastItem;
/**
* Data Source Name: the connection string for PEAR DB
* @access private
* @var string
*/
public $dsn = 'pgsql://dbuser:dbpass@dbhost/dbname';
/**
* DB connections are either persistent or not persistent
* @access private
* @var boolean
*/
public $persistent = false;
/**
* Name of the table storing data describing the menu
* @access private
* @var string
*/
public $tableName = 'phplayersmenu';
/**
* Name of the i18n table corresponding to $tableName
* @access private
* @var string
*/
public $tableName_i18n = 'phplayersmenu_i18n';
/**
* Names of fields of the table storing data describing the menu
*
* default field names correspond to the same field names foreseen
* by the menu structure format
*
* @access private
* @var array
*/
public $tableFields = array(
'id' => 'id',
'parent_id' => 'parent_id',
'text' => 'text',
'href' => 'href',
'title' => 'title',
'icon' => 'icon',
'target' => 'target',
'orderfield' => 'orderfield',
'expanded' => 'expanded'
);
/**
* Names of fields of the i18n table corresponding to $tableName
* @access private
* @var array
*/
public $tableFields_i18n = array(
'language' => 'language',
'id' => 'id',
'text' => 'text',
'title' => 'title'
);
/**
* A temporary array to store data retrieved from the DB and to perform the depth-first search
* @access private
* @var array
*/
public $_tmpArray = array();
/**
* The constructor method; it initializates the menu system
* @return void
*/
function LayersMenuCommon()
{
$this->_packageName = 'PHP Layers Menu';
$this->version = '3.2.0-rc';
$this->copyright = '(C) 2001-2004';
$this->author = 'Marco Pratesi - http://www.marcopratesi.it/';
$this->prependedUrl = '';
$this->dirroot = './';
$this->libjsdir = './libjs/';
$this->imgdir = './menuimages/';
$this->imgwww = 'menuimages/';
$this->icondir = './menuicons/';
$this->iconwww = 'menuicons/';
$this->tpldir = './templates/';
$this->menuStructure = '';
$this->separator = '|';
$this->_nodesCount = 0;
$this->tree = array();
$this->treecnt = array();
$this->_maxLevel = array();
$this->_firstLevelCnt = array();
$this->_firstItem = array();
$this->_lastItem = array();
}
/**
* The method to set the prepended URL
* @access public
* @return boolean
*/
function setPrependedUrl($prependedUrl)
{
// We do not perform any check
$this->prependedUrl = $prependedUrl;
return true;
}
/**
* The method to set the dirroot directory
* @access public
* @return boolean
*/
function setDirrootCommon($dirroot)
{
if (!is_dir($dirroot)) {
$this->error("setDirroot: $dirroot is not a directory.");
return false;
}
if (substr($dirroot, -1) != '/') {
$dirroot .= '/';
}
$oldlength = strlen($this->dirroot);
$foobar = strpos($this->libjsdir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->libjsdir = $dirroot . substr($this->libjsdir, $oldlength);
}
$foobar = strpos($this->imgdir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->imgdir = $dirroot . substr($this->imgdir, $oldlength);
}
$foobar = strpos($this->icondir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->icondir = $dirroot . substr($this->icondir, $oldlength);
}
$foobar = strpos($this->tpldir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->tpldir = $dirroot . substr($this->tpldir, $oldlength);
}
$this->dirroot = $dirroot;
return true;
}
/**
* The method to set the libjsdir directory
* @access public
* @return boolean
*/
function setLibjsdir($libjsdir)
{
if ($libjsdir != '' && substr($libjsdir, -1) != '/') {
$libjsdir .= '/';
}
if ($libjsdir == '' || (substr($libjsdir, 0, 1) != '/' && substr($libjsdir, 1, 1) != ':')) {
// libjsdir != /.../...
// and libjsdir != C:\...\...
$foobar = strpos($libjsdir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$libjsdir = $this->dirroot . $libjsdir;
}
}
if (!is_dir($libjsdir)) {
$this->error("setLibjsdir: $libjsdir is not a directory.");
return false;
}
$this->libjsdir = $libjsdir;
return true;
}
/**
* The method to set the imgdir directory
* @access public
* @return boolean
*/
function setImgdir($imgdir)
{
if ($imgdir != '' && substr($imgdir, -1) != '/') {
$imgdir .= '/';
}
if ($imgdir == '' || (substr($imgdir, 0, 1) != '/' && substr($imgdir, 1, 1) != ':')) {
$foobar = strpos($imgdir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$imgdir = $this->dirroot . $imgdir;
}
}
if (!is_dir($imgdir)) {
$this->error("setImgdir: $imgdir is not a directory.");
return false;
}
$this->imgdir = $imgdir;
return true;
}
/**
* The method to set imgwww
* @access public
* @return void
*/
function setImgwww($imgwww)
{
if ($imgwww != '' && substr($imgwww, -1) != '/') {
$imgwww .= '/';
}
$this->imgwww = $imgwww;
}
/**
* The method to set the icondir directory
* @access public
* @return boolean
*/
function setIcondir($icondir)
{
if ($icondir != '' && substr($icondir, -1) != '/') {
$icondir .= '/';
}
if ($icondir == '' || (substr($icondir, 0, 1) != '/' && substr($icondir, 1, 1) != ':')) {
$foobar = strpos($icondir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$icondir = $this->dirroot . $icondir;
}
}
if (!is_dir($icondir)) {
$this->error("setIcondir: $icondir is not a directory.");
return false;
}
$this->icondir = $icondir;
return true;
}
/**
* The method to set iconwww
* @access public
* @return void
*/
function setIconwww($iconwww)
{
if ($iconwww != '' && substr($iconwww, -1) != '/') {
$iconwww .= '/';
}
$this->iconwww = $iconwww;
}
/**
* The method to set the iconsize array
* @access public
* @return void
*/
function setIconsize($width, $height)
{
$this->iconsize['width'] = ($width == (int) $width) ? $width : 0;
$this->iconsize['height'] = ($height == (int) $height) ? $height : 0;
$this->issetIconsize = true;
}
/**
* The method to unset the iconsize array
* @access public
* @return void
*/
function unsetIconsize()
{
unset($this->iconsize['width']);
unset($this->iconsize['height']);
$this->issetIconsize = false;
}
/**
* The method to set the tpldir directory
* @access public
* @return boolean
*/
function setTpldirCommon($tpldir)
{
if ($tpldir != '' && substr($tpldir, -1) != '/') {
$tpldir .= '/';
}
if ($tpldir == '' || (substr($tpldir, 0, 1) != '/' && substr($tpldir, 1, 1) != ':')) {
$foobar = strpos($tpldir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$tpldir = $this->dirroot . $tpldir;
}
}
if (!is_dir($tpldir)) {
$this->error("setTpldir: $tpldir is not a directory.");
return false;
}
$this->tpldir = $tpldir;
return true;
}
/**
* The method to read the menu structure from a file
* @access public
* @param string $tree_file the menu structure file
* @return boolean
*/
function setMenuStructureFile($tree_file)
{
if (!($fd = fopen($tree_file, 'r'))) {
$this->error("setMenuStructureFile: unable to open file $tree_file.");
return false;
}
$this->menuStructure = '';
while ($buffer = fgets($fd, 4096)) {
$buffer = ereg_replace(chr(13), '', $buffer); // Microsoft Stupidity Suppression
$this->menuStructure .= $buffer;
}
fclose($fd);
if ($this->menuStructure == '') {
$this->error("setMenuStructureFile: $tree_file is empty.");
return false;
}
return true;
}
/**
* The method to set the menu structure passing it through a string
* @access public
* @param string $tree_string the menu structure string
* @return boolean
*/
function setMenuStructureString($tree_string)
{
$this->menuStructure = ereg_replace(chr(13), '', $tree_string); // Microsoft Stupidity Suppression
if ($this->menuStructure == '') {
$this->error('setMenuStructureString: empty string.');
return false;
}
return true;
}
/**
* The method to set the value of separator
* @access public
* @return void
*/
function setSeparator($separator)
{
$this->separator = $separator;
}
/**
* The method to set parameters for the DB connection
* @access public
* @param string $dns Data Source Name: the connection string for PEAR DB
* @param bool $persistent DB connections are either persistent or not persistent
* @return boolean
*/
function setDBConnParms($dsn, $persistent=false)
{
if (!is_string($dsn)) {
$this->error('initdb: $dsn is not an string.');
return false;
}
if (!is_bool($persistent)) {
$this->error('initdb: $persistent is not a boolean.');
return false;
}
$this->dsn = $dsn;
$this->persistent = $persistent;
return true;
}
/**
* The method to set the name of the table storing data describing the menu
* @access public
* @param string
* @return boolean
*/
function setTableName($tableName)
{
if (!is_string($tableName)) {
$this->error('setTableName: $tableName is not a string.');
return false;
}
$this->tableName = $tableName;
return true;
}
/**
* The method to set the name of the i18n table corresponding to $tableName
* @access public
* @param string
* @return boolean
*/
function setTableName_i18n($tableName_i18n)
{
if (!is_string($tableName_i18n)) {
$this->error('setTableName_i18n: $tableName_i18n is not a string.');
return false;
}
$this->tableName_i18n = $tableName_i18n;
return true;
}
/**
* The method to set names of fields of the table storing data describing the menu
* @access public
* @param array
* @return boolean
*/
function setTableFields($tableFields)
{
if (!is_array($tableFields)) {
$this->error('setTableFields: $tableFields is not an array.');
return false;
}
if (count($tableFields) == 0) {
$this->error('setTableFields: $tableFields is a zero-length array.');
return false;
}
reset ($tableFields);
while (list($key, $value) = each($tableFields)) {
$this->tableFields[$key] = ($value == '') ? "''" : $value;
}
return true;
}
/**
* The method to set names of fields of the i18n table corresponding to $tableName
* @access public
* @param array
* @return boolean
*/
function setTableFields_i18n($tableFields_i18n)
{
if (!is_array($tableFields_i18n)) {
$this->error('setTableFields_i18n: $tableFields_i18n is not an array.');
return false;
}
if (count($tableFields_i18n) == 0) {
$this->error('setTableFields_i18n: $tableFields_i18n is a zero-length array.');
return false;
}
reset ($tableFields_i18n);
while (list($key, $value) = each($tableFields_i18n)) {
$this->tableFields_i18n[$key] = ($value == '') ? "''" : $value;
}
return true;
}
/**
* The method to parse the current menu structure and correspondingly update related variables
* @access public
* @param string $menu_name the name to be attributed to the menu
* whose structure has to be parsed
* @return void
*/
function parseStructureForMenu(
$menu_name = '' // non consistent default...
)
{
$this->_maxLevel[$menu_name] = 0;
$this->_firstLevelCnt[$menu_name] = 0;
$this->_firstItem[$menu_name] = $this->_nodesCount + 1;
$cnt = $this->_firstItem[$menu_name];
$menuStructure = $this->menuStructure;
/* *********************************************** */
/* Partially based on a piece of code taken from */
/* TreeMenu 1.1 - Bjorge Dijkstra (bjorge@gmx.net) */
/* *********************************************** */
while ($menuStructure != '') {
$before_cr = strcspn($menuStructure, "\n");
$buffer = substr($menuStructure, 0, $before_cr);
$menuStructure = substr($menuStructure, $before_cr+1);
if (substr($buffer, 0, 1) == '#') {
continue; // commented item line...
}
$tmp = rtrim($buffer);
$node = explode($this->separator, $tmp);
for ($i=count($node); $i<=7; $i++) {
$node[$i] = '';
}
$this->tree[$cnt]['level'] = strlen($node[0]);
$this->tree[$cnt]['text'] = $node[1];
$this->tree[$cnt]['href'] = $node[2];
$this->tree[$cnt]['title'] = $node[3];
$this->tree[$cnt]['icon'] = $node[4];
$this->tree[$cnt]['target'] = $node[5];
$this->tree[$cnt]['expanded'] = $node[6];
$this->tree[$cnt]['children'] = $node[7];
$cnt++;
}
/* *********************************************** */
$this->_lastItem[$menu_name] = count($this->tree);
$this->_nodesCount = $this->_lastItem[$menu_name];
$this->tree[$this->_lastItem[$menu_name]+1]['level'] = 0;
$this->_postParse($menu_name);
}
/**
* The method to parse the current menu table and correspondingly update related variables
* @access public
* @param string $menu_name the name to be attributed to the menu
* whose structure has to be parsed
* @param string $language i18n language; either omit it or pass
* an empty string ('') if you do not want to use any i18n table
* @return void
*/
function scanTableForMenu(
$menu_name = '', // non consistent default...
$language = ''
)
{
$this->_maxLevel[$menu_name] = 0;
$this->_firstLevelCnt[$menu_name] = 0;
unset($this->tree[$this->_nodesCount+1]);
$this->_firstItem[$menu_name] = $this->_nodesCount + 1;
/* BEGIN BENCHMARK CODE
$time_start = $this->_getmicrotime();
/* END BENCHMARK CODE */
$db = DB::connect($this->dsn, $this->persistent);
if (DB::isError($db)) {
$this->error('scanTableForMenu: ' . $db->getMessage());
}
$dbresult = $db->query('
SELECT ' .
$this->tableFields['id'] . ' AS id, ' .
$this->tableFields['parent_id'] . ' AS parent_id, ' .
$this->tableFields['text'] . ' AS text, ' .
$this->tableFields['href'] . ' AS href, ' .
$this->tableFields['title'] . ' AS title, ' .
$this->tableFields['icon'] . ' AS icon, ' .
$this->tableFields['target'] . ' AS target, ' .
$this->tableFields['expanded'] . ' AS expanded
FROM ' . $this->tableName . '
WHERE ' . $this->tableFields['id'] . ' <> 1
ORDER BY ' . $this->tableFields['orderfield'] . ', ' . $this->tableFields['text'] . ' ASC
');
$this->_tmpArray = array();
while ($dbresult->fetchInto($row, DB_FETCHMODE_ASSOC)) {
$this->_tmpArray[$row['id']]['parent_id'] = $row['parent_id'];
$this->_tmpArray[$row['id']]['text'] = $row['text'];
$this->_tmpArray[$row['id']]['href'] = $row['href'];
$this->_tmpArray[$row['id']]['title'] = $row['title'];
$this->_tmpArray[$row['id']]['icon'] = $row['icon'];
$this->_tmpArray[$row['id']]['target'] = $row['target'];
$this->_tmpArray[$row['id']]['expanded'] = $row['expanded'];
}
if ($language != '') {
$dbresult = $db->query('
SELECT ' .
$this->tableFields_i18n['id'] . ' AS id, ' .
$this->tableFields_i18n['text'] . ' AS text, ' .
$this->tableFields_i18n['title'] . ' AS title
FROM ' . $this->tableName_i18n . '
WHERE ' . $this->tableFields_i18n['id'] . ' <> 1
AND ' . $this->tableFields_i18n['language'] . ' = ' . "'$language'" . '
');
while ($dbresult->fetchInto($row, DB_FETCHMODE_ASSOC)) {
if (isset($this->_tmpArray[$row['id']])) {
$this->_tmpArray[$row['id']]['text'] = $row['text'];
$this->_tmpArray[$row['id']]['title'] = $row['title'];
}
}
}
unset($dbresult);
unset($row);
$this->_depthFirstSearch($menu_name, $this->_tmpArray, 1, 1);
/* BEGIN BENCHMARK CODE
$time_end = $this->_getmicrotime();
$time = $time_end - $time_start;
print "TIME ELAPSED = $time\n<br>";
/* END BENCHMARK CODE */
$this->_lastItem[$menu_name] = count($this->tree);
$this->_nodesCount = $this->_lastItem[$menu_name];
$this->tree[$this->_lastItem[$menu_name]+1]['level'] = 0;
$this->_postParse($menu_name);
}
function _getmicrotime()
{
list($usec, $sec) = explode(' ', microtime());
return ((float) $usec + (float) $sec);
}
/**
* Recursive method to perform the depth-first search of the tree data taken from the current menu table
* @access private
* @param string $menu_name the name to be attributed to the menu
* whose structure has to be parsed
* @param array $tmpArray the temporary array that stores data to perform
* the depth-first search
* @param integer $parent_id id of the item whose children have
* to be searched for
* @param integer $level the hierarchical level of children to be searched for
* @return void
*/
function _depthFirstSearch($menu_name, $tmpArray, $parent_id=1, $level=1)
{
reset ($tmpArray);
while (list($id, $foobar) = each($tmpArray)) {
if ($foobar['parent_id'] == $parent_id) {
unset($tmpArray[$id]);
unset($this->_tmpArray[$id]);
$cnt = count($this->tree) + 1;
$this->tree[$cnt]['level'] = $level;
$this->tree[$cnt]['text'] = $foobar['text'];
$this->tree[$cnt]['href'] = $foobar['href'];
$this->tree[$cnt]['title'] = $foobar['title'];
$this->tree[$cnt]['icon'] = $foobar['icon'];
$this->tree[$cnt]['target'] = $foobar['target'];
$this->tree[$cnt]['expanded'] = $foobar['expanded'];
$this->tree[$cnt]['children'] = $foobar['children'];
$this->treecnt[$menu_name][$id] = $cnt;
unset($foobar);
if ($id != $parent_id) {
$this->_depthFirstSearch($menu_name, $this->_tmpArray, $id, $level+1);
}
}
}
}
/**
* A method providing parsing needed after both file/string parsing and DB table parsing
* @access private
* @param string $menu_name the name of the menu for which the parsing
* has to be performed
* @return void
*/
function _postParse(
$menu_name = '' // non consistent default...
)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
$this->tree[$cnt]['child_of_root_node'] = ($this->tree[$cnt]['level'] == 1);
$this->tree[$cnt]['parsed_text'] = stripslashes($this->tree[$cnt]['text']);
$this->tree[$cnt]['parsed_href'] = (ereg_replace(' ', '', $this->tree[$cnt]['href']) == '') ? '#' : $this->prependedUrl . $this->tree[$cnt]['href'];
$this->tree[$cnt]['parsed_title'] = ($this->tree[$cnt]['title'] == '') ? '' : ' title="' . stripslashes($this->tree[$cnt]['title']) . '"';
$fooimg = $this->icondir . $this->tree[$cnt]['icon'];
if ($this->tree[$cnt]['icon'] != '' && (substr($this->tree[$cnt]['icon'], 0, 7) == 'http://' || substr($this->tree[$cnt]['icon'], 0, 8) == 'https://')) {
$this->tree[$cnt]['parsed_icon'] = $this->tree[$cnt]['icon'];
if ($this->issetIconsize) {
$this->tree[$cnt]['iconwidth'] = $this->iconsize['width'];
$this->tree[$cnt]['iconheight'] = $this->iconsize['height'];
} else {
$foobar = getimagesize($this->tree[$cnt]['icon']);
$this->tree[$cnt]['iconwidth'] = $foobar[0];
$this->tree[$cnt]['iconheight'] = $foobar[1];
}
} elseif ($this->tree[$cnt]['icon'] != '' && file_exists($fooimg)) {
$this->tree[$cnt]['parsed_icon'] = $this->iconwww . $this->tree[$cnt]['icon'];
if ($this->issetIconsize) {
$this->tree[$cnt]['iconwidth'] = $this->iconsize['width'];
$this->tree[$cnt]['iconheight'] = $this->iconsize['height'];
} else {
$foobar = getimagesize($fooimg);
$this->tree[$cnt]['iconwidth'] = $foobar[0];
$this->tree[$cnt]['iconheight'] = $foobar[1];
}
} else {
$this->tree[$cnt]['parsed_icon'] = '';
}
$this->tree[$cnt]['parsed_target'] = ($this->tree[$cnt]['target'] == '') ? '' : ' target="' . $this->tree[$cnt]['target'] . '"';
// $this->tree[$cnt]['expanded'] = ($this->tree[$cnt]['expanded'] == '') ? 0 : $this->tree[$cnt]['expanded'];
$this->_maxLevel[$menu_name] = max($this->_maxLevel[$menu_name], $this->tree[$cnt]['level']);
if ($this->tree[$cnt]['level'] == 1) {
$this->_firstLevelCnt[$menu_name]++;
}
}
}
/**
* A method to replace strings in all URLs (hrefs) of a menu
* @access public
* @param string $menu_name the name of the menu for which the replacement
* has to be performed
* @param string $string the string to be replaced
* @param string $value the replacement string
* @return void
*/
function replaceStringInUrls($menu_name, $string, $value)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
$this->tree[$cnt]['parsed_href'] = str_replace($string, $value, $this->tree[$cnt]['parsed_href']);
}
}
/**
* A method to set the same target for all links of a menu
* @access public
* @param string $menu_name the name of the menu for which the targets
* have to be set
* @param string $target the target to be set for all links
* of the $menu_name menu
* @return void
*/
function setLinksTargets($menu_name, $target)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
$this->tree[$cnt]['parsed_target'] = ' target="' . $target . '"';
}
}
/**
* A method to select the current item of $menu_name in terms of $cnt, i.e., very likely, in terms of its line number in the corresponding menu structure file (excluding from the count commented out lines, if any)
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param integer $count the line number of the current item
* in the corresponding menu structure file
* (excluding from the count commented out lines, if any)
* @return void
*/
function setSelectedItemByCount($menu_name, $count)
{
if ($count < 1) {
$this->error("setSelectedItemByCount: the \$count argument is $count, but \$count can not be lower than 1");
return;
}
if ($count > $this->_lastItem[$menu_name] - $this->_firstItem[$menu_name] + 1) {
$this->error("setSelectedItemByCount: the \$count argument is $count and is larger than the number of items of the '$menu_name' menu");
return;
}
$cnt = $this->_firstItem[$menu_name] + $count - 1;
$this->tree[$cnt]['selected'] = true;
}
/**
* A method to select the current item of $menu_name in terms of the corresponding id (see the DB table structure); obviously, this method can be used only together with the DB support
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param integer $id the id of the current item in the corresponding DB table
* @return void
*/
function setSelectedItemById($menu_name, $id)
{
if (!isset($this->treecnt[$menu_name][$id])) {
$this->error("setSelectedItemById: there is not any item with \$id = $id in the '$menu_name' menu");
return;
}
$cnt = $this->treecnt[$menu_name][$id];
$this->tree[$cnt]['selected'] = true;
}
/**
* A method to select the current item of $menu_name specifying a string that occurs in the current URL
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param string $url a string that occurs in the current URL
* @return void
*/
function setSelectedItemByUrl($menu_name, $url)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
if (!(strpos($this->tree[$cnt]['parsed_href'], $url) === false)) {
$this->tree[$cnt]['selected'] = true;
break;
}
}
}
/**
* A method to select the current item of $menu_name specifying a regular expression that matches (a substring of) the current URL; just the same as the setSelectedItemByUrl() method, but using eregi() instead of strpos()
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param string $url_eregi the regular expression that matches
* (a substring of) the current URL
* @return void
*/
function setSelectedItemByUrlEregi($menu_name, $url_eregi)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
if (eregi($url_eregi, $this->tree[$cnt]['parsed_href'])) {
$this->tree[$cnt]['selected'] = true;
break;
}
}
}
/**
* Method to handle errors
* @access private
* @param string $errormsg the error message
* @return void
*/
function error($errormsg)
{
print "<b>LayersMenu Error:</b> $errormsg<br />\n";
if ($this->haltOnError == 'yes') {
die("<b>Halted.</b><br />\n");
}
}
} /* END OF CLASS */
?>

View File

@@ -0,0 +1,398 @@
<?php
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
/**
* This file contains the code of the TreeMenu class.
* @package PHPLayersMenu
*/
/**
* This is the TreeMenu class of the PHP Layers Menu library.
*
* This class depends on the LayersMenuCommon class and on the PEAR conforming version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
*
* @version 3.2.0-rc
* @package PHPLayersMenu
*/
class TreeMenu extends LayersMenuCommon
{
/**
* Type of images used for the Tree Menu
* @access private
* @var string
*/
public $treeMenuImagesType;
/**
* Prefix for filenames of images of a theme
* @access private
* @var string
*/
public $treeMenuTheme;
/**
* An array where we store the Tree Menu code for each menu
* @access private
* @var array
*/
public $_treeMenu;
/**
* The constructor method; it initializates the menu system
* @return void
*/
function TreeMenu()
{
$this->LayersMenuCommon();
$this->treeMenuImagesType = 'png';
$this->treeMenuTheme = '';
$this->_treeMenu = array();
$this->_nodesCount = 0;
$this->tree = array();
$this->_maxLevel = array();
$this->_firstLevelCnt = array();
$this->_firstItem = array();
$this->_lastItem = array();
}
/**
* The method to set the dirroot directory
* @access public
* @return boolean
*/
function setDirroot($dirroot)
{
return $this->setDirrootCommon($dirroot);
}
/**
* The method to set the type of images used for the Tree Menu
* @access public
* @return void
*/
function setTreeMenuImagesType($treeMenuImagesType)
{
$this->treeMenuImagesType = $treeMenuImagesType;
}
/**
* The method to set the prefix for filenames of images of a theme
* @access public
* @return void
*/
function setTreeMenuTheme($treeMenuTheme)
{
$this->treeMenuTheme = $treeMenuTheme;
}
/**
* Method to prepare a new Tree Menu.
*
* This method processes items of a menu to prepare and return
* the corresponding Tree Menu code.
*
* @access public
* @param string $menu_name the name of the menu whose items have to be processed
* @return string
*/
function newTreeMenu(
$menu_name = '' // non consistent default...
)
{
/* If cookies were disabled, build the url parameter for the session id.
It will be append to the url to be redirect */
$id_session_param = '';
if (SID != '')
$id_session_param = sprintf('&%s=%s',session_name(),session_id());
global $ldapserver;
if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) {
$this->error("newTreeMenu: the first/last item of the menu '$menu_name' is not defined; please check if you have parsed its menu data.");
return 0;
}
$this->_treeMenu[$menu_name] = '';
$img_collapse = $this->imgwww . $this->treeMenuTheme . 'tree_collapse.' . $this->treeMenuImagesType;
$alt_collapse = '--';
$img_collapse_corner = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_corner.' . $this->treeMenuImagesType;
$alt_collapse_corner = '--';
$img_collapse_corner_first = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_corner_first.' . $this->treeMenuImagesType;
$alt_collapse_corner_first = '--';
$img_collapse_first = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_first.' . $this->treeMenuImagesType;
$alt_collapse_first = '--';
$img_corner = $this->imgwww . $this->treeMenuTheme . 'tree_corner.' . $this->treeMenuImagesType;
$alt_corner = '`-';
$img_expand = $this->imgwww . $this->treeMenuTheme . 'tree_expand.' . $this->treeMenuImagesType;
$alt_expand = '+-';
$img_expand_corner = $this->imgwww . $this->treeMenuTheme . 'tree_expand_corner.' . $this->treeMenuImagesType;
$alt_expand_corner = '+-';
$img_expand_corner_first = $this->imgwww . $this->treeMenuTheme . 'tree_expand_corner_first.' . $this->treeMenuImagesType;
$alt_expand_corner_first = '+-';
$img_expand_first = $this->imgwww . $this->treeMenuTheme . 'tree_expand_first.' . $this->treeMenuImagesType;
$alt_expand_first = '+-';
$img_folder_closed = $this->imgwww . $this->treeMenuTheme . 'tree_folder_closed.' . $this->treeMenuImagesType;
$alt_folder_closed = '->';
$img_folder_open = $this->imgwww . $this->treeMenuTheme . 'tree_folder_open.' . $this->treeMenuImagesType;
$alt_folder_open = '->';
$img_leaf = $this->imgwww . $this->treeMenuTheme . 'tree_leaf.' . $this->treeMenuImagesType;
$alt_leaf = '->';
$img_space = $this->imgwww . $this->treeMenuTheme . 'tree_space.' . $this->treeMenuImagesType;
$alt_space = ' ';
$img_split = $this->imgwww . $this->treeMenuTheme . 'tree_split.' . $this->treeMenuImagesType;
$alt_split = '|-';
$img_split_first = $this->imgwww . $this->treeMenuTheme . 'tree_split_first.' . $this->treeMenuImagesType;
$alt_split_first = '|-';
$img_vertline = $this->imgwww . $this->treeMenuTheme . 'tree_vertline.' . $this->treeMenuImagesType;
$alt_vertline = '| ';
for ($i=0; $i<=$this->_maxLevel[$menu_name]; $i++) {
$levels[$i] = 0;
}
// Find last nodes of subtrees
$last_level = $this->_maxLevel[$menu_name];
for ($i=$this->_lastItem[$menu_name]; $i>=$this->_firstItem[$menu_name]; $i--) {
if ($this->tree[$i]['level'] < $last_level) {
for ($j=$this->tree[$i]['level']+1; $j<=$this->_maxLevel[$menu_name]; $j++) {
$levels[$j] = 0;
}
}
if ($levels[$this->tree[$i]['level']] == 0) {
$levels[$this->tree[$i]['level']] = 1;
$this->tree[$i]['last_item'] = 1;
} else {
$this->tree[$i]['last_item'] = 0;
}
$last_level = $this->tree[$i]['level'];
}
$toggle = '';
$toggle_function_name = 'toggle' . $menu_name;
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
if ($this->tree[$cnt]['text'] == '---') {
continue; // separators are significant only for layers-based menus
}
if (isset($this->tree[$cnt]['selected']) && $this->tree[$cnt]['selected']) {
$linkstyle = 'phplmselected';
} else {
$linkstyle = 'phplm';
}
$this->_treeMenu[$menu_name] .= '<div id="jt' . $cnt . '" class="treemenudiv">' . "\n";
// vertical lines from higher levels
for ($i=0; $i<$this->tree[$cnt]['level']-1; $i++) {
if ($levels[$i] == 1) {
$img = $img_vertline;
$alt = $alt_vertline;
} else {
$img = $img_space;
$alt = $alt_space;
}
$this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" />';
}
$not_a_leaf = ($cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt+1]['level']>$this->tree[$cnt]['level']) || (isset($this->tree[$cnt]['children']) && $this->tree[$cnt]['children']);
if ($this->tree[$cnt]['last_item'] == 1) {
// corner at end of subtree or t-split
if ($not_a_leaf) {
if ($cnt == $this->_firstItem[$menu_name]) {
if ($this->tree[$cnt]['last_item'] && $this->tree[$cnt]['children']) {
// Xavier Bruyet : 2006.09.28
// Display for the first time the tree without the root node expanded
$img = $img_expand_corner_first;
$alt = $alt_expand_corner_first;
// @todo: nasty hack, should really do this better.
$parsed_href = preg_replace('/template_engine/','expand',$this->tree[$cnt]['parsed_href']);
$this->_treeMenu[$menu_name] .= '<a href="' . $parsed_href . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
$img = $img_collapse_corner_first;
$alt = $alt_collapse_corner_first;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "')" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
}
} else {
if ($this->tree[$cnt]['last_item'] && $this->tree[$cnt]['children']) {
$img = $img_expand_corner;
$alt = $alt_expand_corner;
// @todo: nasty hack, should really do this better.
$parsed_href = preg_replace('/template_engine/','expand',$this->tree[$cnt]['parsed_href']);
$this->_treeMenu[$menu_name] .= '<a href="' . $parsed_href . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
$img = $img_collapse_corner;
$alt = $alt_collapse_corner;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "')" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
}
}
} else {
$this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img_corner . '" alt="' . $alt_corner . '" />';
}
$levels[$this->tree[$cnt]['level']-1] = 0;
} else {
if ($not_a_leaf) {
if ($cnt == $this->_firstItem[$menu_name]) {
$img = $img_collapse_first;
$alt = $alt_collapse_first;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "');" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
if (! $this->tree[$cnt]['last_item'] && $this->tree[$cnt]['children']) {
$img = $img_expand;
$alt = $alt_expand;
// @todo: nasty hack, should really do this better.
$parsed_href = preg_replace('/template_engine/','expand',$this->tree[$cnt]['parsed_href']);
$this->_treeMenu[$menu_name] .= '<a href="' . $parsed_href . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
$img = $img_collapse;
$alt = $alt_collapse;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "');" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
}
}
} else {
if ($cnt == $this->_firstItem[$menu_name]) {
$img = $img_split_first;
$alt = $alt_split_first;
} else {
$img = $img_split;
$alt = $alt_split;
}
$this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" />';
}
$levels[$this->tree[$cnt]['level']-1] = 1;
}
if ($this->tree[$cnt]['parsed_href'] == '' || $this->tree[$cnt]['parsed_href'] == '#') {
$a_href_open_img = '';
$a_href_close_img = '';
$a_href_open = '<a class="phplmnormal">';
$a_href_close = '</a>';
} else {
$a_href_open_img = '<a href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . '>';
$a_href_close_img = '</a>';
$a_href_open = '<a name="' . sprintf('%s_%s%s',$ldapserver->server_id,rawurlencode($this->tree[$cnt]['title']),$id_session_param) . '" href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . ' class="' . $linkstyle . '">';
$a_href_close = '</a>';
}
if ($not_a_leaf) {
// $this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'folder" src="' . $img_folder_open . '" alt="' . $alt_folder_open . '" />' . $a_href_close_img;
$this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'folder" src="' . ($this->tree[$cnt]['parsed_icon'] ? $this->tree[$cnt]['parsed_icon'] : $img_folder_open) . '" alt="' . $alt_folder_open . '" />' . $a_href_close_img;
} else {
if ($this->tree[$cnt]['parsed_icon'] != '') {
// $this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" src="' . $this->tree[$cnt]['parsed_icon'] . '" width="' . $this->tree[$cnt]['iconwidth'] . '" height="' . $this->tree[$cnt]['iconheight'] . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
$this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" src="' . $this->tree[$cnt]['parsed_icon'] . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
} else {
$this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" src="' . $img_leaf . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
}
}
$this->_treeMenu[$menu_name] .= '&nbsp;' . $a_href_open . $this->tree[$cnt]['text'] . $a_href_close . "\n";
$this->_treeMenu[$menu_name] .= '</div>' . "\n";
if ($cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt]['level']<$this->tree[$cnt+1]['level']) {
$this->_treeMenu[$menu_name] .= '<div id="jt' . $cnt . 'son" class="treemenudiv">' . "\n";
if ($this->tree[$cnt]['expanded'] != 1) {
$toggle .= 'if (phplm_expand[' . $cnt . '] != 1) ' . $toggle_function_name . "('" . $cnt . "');\n";
} else {
$toggle .= 'if (phplm_collapse[' . $cnt . '] == 1) ' . $toggle_function_name . "('" . $cnt . "');\n";
}
}
if ($cnt>$this->_firstItem[$menu_name] && $this->tree[$cnt]['level']>$this->tree[$cnt+1]['level']) {
for ($i=max(1, $this->tree[$cnt+1]['level']); $i<$this->tree[$cnt]['level']; $i++) {
$this->_treeMenu[$menu_name] .= '</div>' . "\n";
}
}
}
/*
$this->_treeMenu[$menu_name] =
'<div class="phplmnormal">' . "\n" .
$this->_treeMenu[$menu_name] .
'</div>' . "\n";
*/
// Some (old) browsers do not support the "white-space: nowrap;" CSS property...
$this->_treeMenu[$menu_name] =
'<table cellspacing="0" cellpadding="0" border="0">' . "\n" .
'<tr>' . "\n" .
'<td class="phplmnormal" nowrap="nowrap">' . "\n" .
$this->_treeMenu[$menu_name] .
'</td>' . "\n" .
'</tr>' . "\n" .
'</table>' . "\n";
$t = new Template_PHPLIB();
$t->setFile('tplfile', $this->libjsdir . 'layerstreemenu.ijs');
$t->setVar(array(
'toggle_function_name' => $toggle_function_name,
'img_collapse' => $img_collapse,
'img_collapse_corner' => $img_collapse_corner,
'img_collapse_corner_first' => $img_collapse_corner_first,
'img_collapse_first' => $img_collapse_first,
'img_expand' => $img_expand,
'img_expand_corner' => $img_expand_corner,
'img_expand_corner_first' => $img_expand_corner_first,
'img_expand_first' => $img_expand_first,
'img_folder_closed' => $img_folder_closed,
'img_folder_open' => $img_folder_open
));
$inc = '<!-- # PHP layers menu. -->
<script type="text/javascript" language="javascript" src="js/phplayersmenu/libjs/layersmenu-browser_detection.js"></script>
<script type="text/javascript" language="javascript" src="js/phplayersmenu/libjs/layerstreemenu-cookies.js"></script>';
$toggle_function = $t->parse('out', 'tplfile');
$toggle_function =
'<script language="JavaScript" type="text/javascript">' . "\n" .
'<!--' . "\n" .
$toggle_function .
'// -->' . "\n" .
'</script>' . "\n";
$toggle =
'<script language="JavaScript" type="text/javascript">' . "\n" .
'<!--' . "\n" .
'if ((DOM && !Opera56 && !Konqueror22) || IE4) {' . "\n" .
$toggle .
'}' . "\n" .
'if (NS4) alert("Only the accessibility is provided to Netscape 4 on the JavaScript Tree Menu.\nWe *strongly* suggest you to upgrade your browser.");' . "\n" .
'// -->' . "\n" .
'</script>' . "\n";
$this->_treeMenu[$menu_name] = $inc . "\n" . $toggle_function . "\n" . $this->_treeMenu[$menu_name] . "\n" . $toggle;
return $this->_treeMenu[$menu_name];
}
/**
* Method that returns the code of the requested Tree Menu
* @access public
* @param string $menu_name the name of the menu whose Tree Menu code
* has to be returned
* @return string
*/
function getTreeMenu($menu_name)
{
return $this->_treeMenu[$menu_name];
}
/**
* Method that prints the code of the requested Tree Menu
* @access public
* @param string $menu_name the name of the menu whose Tree Menu code
* has to be printed
* @return void
*/
function printTreeMenu($menu_name)
{
print $this->_treeMenu[$menu_name];
}
} /* END OF CLASS */
?>

View File

@@ -0,0 +1,33 @@
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
DOM = (document.getElementById) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
// We need to explicitly detect Konqueror
// because Konqueror 3 sets IE = 1 ... AAAAAAAAAARGHHH!!!
Konqueror = (navigator.userAgent.indexOf('Konqueror') > -1) ? 1 : 0;
// We need to detect Konqueror 2.2 as it does not handle the window.onresize event
Konqueror22 = (navigator.userAgent.indexOf('Konqueror 2.2') > -1 || navigator.userAgent.indexOf('Konqueror/2.2') > -1) ? 1 : 0;
Konqueror30 =
(
navigator.userAgent.indexOf('Konqueror 3.0') > -1
|| navigator.userAgent.indexOf('Konqueror/3.0') > -1
|| navigator.userAgent.indexOf('Konqueror 3;') > -1
|| navigator.userAgent.indexOf('Konqueror/3;') > -1
|| navigator.userAgent.indexOf('Konqueror 3)') > -1
|| navigator.userAgent.indexOf('Konqueror/3)') > -1
)
? 1 : 0;
Konqueror31 = (navigator.userAgent.indexOf('Konqueror 3.1') > -1 || navigator.userAgent.indexOf('Konqueror/3.1') > -1) ? 1 : 0;
// We need to detect Konqueror 3.2 and 3.3 as they are affected by the see-through effect only for 2 form elements
Konqueror32 = (navigator.userAgent.indexOf('Konqueror 3.2') > -1 || navigator.userAgent.indexOf('Konqueror/3.2') > -1) ? 1 : 0;
Konqueror33 = (navigator.userAgent.indexOf('Konqueror 3.3') > -1 || navigator.userAgent.indexOf('Konqueror/3.3') > -1) ? 1 : 0;
Opera = (navigator.userAgent.indexOf('Opera') > -1) ? 1 : 0;
Opera5 = (navigator.userAgent.indexOf('Opera 5') > -1 || navigator.userAgent.indexOf('Opera/5') > -1) ? 1 : 0;
Opera6 = (navigator.userAgent.indexOf('Opera 6') > -1 || navigator.userAgent.indexOf('Opera/6') > -1) ? 1 : 0;
Opera56 = Opera5 || Opera6;
IE = (navigator.userAgent.indexOf('MSIE') > -1) ? 1 : 0;
IE = IE && !Opera;
IE5 = IE && DOM;
IE4 = (document.all) ? 1 : 0;
IE4 = IE4 && IE && !DOM;

View File

@@ -0,0 +1,70 @@
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
function setLMCookie(name, value)
{
document.cookie = name + '=' + value + ';path=/';
}
function getLMCookie(name)
{
foobar = document.cookie.split(name + '=');
if (foobar.length < 2) {
return null;
}
tempString = foobar[1];
if (tempString.indexOf(';') == -1) {
return tempString;
}
yafoobar = tempString.split(';');
return yafoobar[0];
}
function parseExpandString()
{
expandString = getLMCookie('phplm_expand');
phplm_expand = new Array();
if (expandString) {
expanded = expandString.split('|');
for (i=0; i<expanded.length-1; i++) {
phplm_expand[expanded[i]] = 1;
}
}
}
function parseCollapseString()
{
collapseString = getLMCookie('phplm_collapse');
phplm_collapse = new Array();
if (collapseString) {
collapsed = collapseString.split('|');
for (i=0; i<collapsed.length-1; i++) {
phplm_collapse[collapsed[i]] = 1;
}
}
}
parseExpandString();
parseCollapseString();
function saveExpandString()
{
expandString = '';
for (i=0; i<phplm_expand.length; i++) {
if (phplm_expand[i] == 1) {
expandString += i + '|';
}
}
setLMCookie('phplm_expand', expandString);
}
function saveCollapseString()
{
collapseString = '';
for (i=0; i<phplm_collapse.length; i++) {
if (phplm_collapse[i] == 1) {
collapseString += i + '|';
}
}
setLMCookie('phplm_collapse', collapseString);
}

View File

@@ -0,0 +1,52 @@
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
function {toggle_function_name}(nodeid)
{
if ((!DOM || Opera56 || Konqueror22) && !IE4) {
return;
}
layersMoved = 0;
parseExpandString();
parseCollapseString();
if (!IE4) {
sonLayer = document.getElementById('jt' + nodeid + 'son');
nodeLayer = document.getElementById('jt' + nodeid + 'node');
//folderLayer = document.getElementById('jt' + nodeid + 'folder');
} else {
sonLayer = document.all('jt' + nodeid + 'son');
nodeLayer = document.all('jt' + nodeid + 'node');
//folderLayer = document.all('jt' + nodeid + 'folder');
}
if (sonLayer.style.display == 'none') {
sonLayer.style.display = 'block';
if (nodeLayer.src.indexOf('{img_expand}') > -1) {
nodeLayer.src = '{img_collapse}';
} else if (nodeLayer.src.indexOf('{img_expand_first}') > -1) {
nodeLayer.src = '{img_collapse_first}';
} else if (nodeLayer.src.indexOf('{img_expand_corner}') > -1) {
nodeLayer.src = '{img_collapse_corner}';
} else {
nodeLayer.src = '{img_collapse_corner_first}';
}
//folderLayer.src = '{img_folder_open}';
phplm_expand[nodeid] = 1;
phplm_collapse[nodeid] = 0;
} else {
sonLayer.style.display = 'none';
if (nodeLayer.src.indexOf('{img_collapse}') > -1) {
nodeLayer.src = '{img_expand}';
} else if (nodeLayer.src.indexOf('{img_collapse_first}') > -1) {
nodeLayer.src = '{img_expand_first}';
} else if (nodeLayer.src.indexOf('{img_collapse_corner}') > -1) {
nodeLayer.src = '{img_expand_corner}';
} else {
nodeLayer.src = '{img_expand_corner_first}';
}
//folderLayer.src = '{img_folder_closed}';
phplm_expand[nodeid] = 0;
phplm_collapse[nodeid] = 1;
}
saveExpandString();
saveCollapseString();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

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