diff --git a/INSTALL b/INSTALL
index d3a5fcb..4a3e2ce 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,49 +1,21 @@
-These instructions assume that you have a working install of:
- a. A web server (Apache, IIS, etc).
- b. PHP (with LDAP support)
+For install instructions in non-English languages, see the files
+in the "doc" directory.
-* Installing phpLDAPadmin in 4 easy steps:
+* Requirements
- 1. Untar the archive (if you're reading this, you already did that).
+ phpLDAPadmin requires the following:
+ a. A web server (Apache, IIS, etc).
+ b. PHP 4.1.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.
4. Then, point your browser to the phpldapadmin directory.
-* Browser Notes
-
- phpLDAPadmin was developed on Mozilla, and will most likely run best thereon.
- However, testing has been done on Internet Explorer, and it should work
- well also. No testing has been done on either Konqueror (or any khtml-based
- browser like Safari) or Opera. If you find a browser incompatibility,
- please report it.
-
-* Contributors (thank you!)
-
- Project Developers:
-
- - David Smith Maintainer
- - Xavier Renard LDIF master
- - Nate Rotschafer Release manager
-
- 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
- - Chric Jackson Blowfish and md5crypt passwords
- - Marius Rieder Enhanced schema parser
- - Nick Burch Many realpath() fixes
-
- Translators:
-
- - Uwe Ebel German
- - Xavier Renard French
- - Dave Smith English ;)
-
- If you can help translate, please join the phpldapadmin-devel mailing list:
- https://lists.sourceforge.net/mailman/listinfo/phpldapadmin-devel
+* For help
+ See the files in the "doc" directory.
+ Join our mailing list:
+ https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
diff --git a/VERSION b/VERSION
index f374f66..2003b63 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.9.1
+0.9.2
diff --git a/add_oclass_form.php b/add_oclass_form.php
index 80ef6fb..00ba27a 100644
--- a/add_oclass_form.php
+++ b/add_oclass_form.php
@@ -36,10 +36,18 @@ $entry = get_object_attrs( $server_id, $dn, true );
$current_attrs = array();
foreach( $entry as $attr => $junk )
$current_attrs[] = strtolower($attr);
+
// grab the required attributes for the new objectClass
-$must_attrs = get_schema_objectclasses( $server_id );
-$must_attrs = $must_attrs[ strtolower($new_oclass) ]['must_attrs'];
-sort( $must_attrs );
+$oclass = get_schema_objectclass( $server_id, $new_oclass );
+if( $oclass )
+ $must_attrs = $oclass->getMustAttrs();
+else
+ $must_attrs = array();
+
+// 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();
@@ -54,7 +62,7 @@ if( count( $needed_attrs ) > 0 )
";
+ }
+ if( ! $has_errors )
+ echo "(No errors)";
+ echo "";
+}
+
+
+
+
+
+?>
diff --git a/collapse.php b/collapse.php
index 67dbe2e..57b1f64 100644
--- a/collapse.php
+++ b/collapse.php
@@ -47,5 +47,5 @@ if(SID != ""){
$id_session_param = "&".session_name()."=".session_id();
}
-header( "Location:tree.php?foo=$random_junk%23{$server_id}_{$encoded_dn}$id_session_param" );
+header( "Location:tree.php?foo=$random_junk#{$server_id}_{$encoded_dn}$id_session_param" );
?>
diff --git a/common.php b/common.php
index c13714a..ce92ce4 100644
--- a/common.php
+++ b/common.php
@@ -6,23 +6,93 @@
* include this file at the top of every PHP file.
*/
+// Turn on all notices and warnings. This helps us write cleaner code (we hope at least)
+error_reporting( E_ALL );
+
+// We require this version or newer (use @ to surpress errors if we are included twice)
+@define( 'REQUIRED_PHP_VERSION', '4.1.0' );
+
+// config.php might not exist (if the user hasn't configured PLA yet)
+// Only include it if it does exist.
if( file_exists( realpath( 'config.php' ) ) ) {
+ is_readable( realpath( 'config.php' ) ) or pla_error( "Could not read config.php, its permissions are too strict." );
require realpath( 'config.php' );
}
+
+// General functions (pla_ldap_search(), pla_error(), get_object_attrs(), etc.)
+is_readable( realpath( 'functions.php' ) )
+ or pla_error( "Cannot read the file 'functions.php' its permissions are too strict." );
require_once realpath( 'functions.php' );
+
+// Functions for reading the server schema (get_schema_object_classes(), etc.)
+is_readable( realpath( 'schema_functions.php' ) )
+ or pla_error( "Cannot read the file 'schema_functions.php' its permissions are too strict." );
require_once realpath( 'schema_functions.php' );
-// grab the language file configured in config.php
-if( ! isset( $language ) )
- $language = 'english';
-if( file_exists( realpath( "lang/$language.php" ) ) )
- include realpath( "lang/$language.php" );
+// Functions that can be defined by the user (preEntryDelete(), postEntryDelete(), etc.)
+is_readable( realpath( 'custom_functions.php' ) )
+ or pla_error( "Cannot read the file 'custom_functions.php' its permissions are too strict." );
+require_once realpath( 'custom_functions.php' );
-// Turn off notices about referencing arrays and such, but leave everything else on.
-error_reporting( E_ALL ^ E_NOTICE );
+// Our custom error handler receives all error notices that pass the error_reporting()
+// level set above.
+set_error_handler( 'pla_error_handler' );
+// Creates the language array which will be populated with localized strings
+// based on the user-configured language.
+$lang = array();
+
+// Little bit of sanity checking
+if( ! file_exists( realpath( 'lang/recoded' ) ) ) {
+ pla_error( "Your install of phpLDAPadmin is missing the 'lang/recoded' directory. This should not happen. You can try running 'make' in the lang directory" );
+}
+
+// use English as a base-line (in case the selected language is missing strings)
+if( file_exists( realpath( 'lang/recoded/en.php' ) ) )
+ include realpath( 'lang/recoded/en.php' );
+else
+ pla_error( "Error! Missing recoded English language file. Run 'make' in the lang/ directory." );
+
+// Language configuration. Auto or specified?
+// Shall we attempt to auto-determine the language?
+if( isset( $language ) ) {
+ if( 0 == strcasecmp( $language, "auto" ) ) {
+ // get the languages which are spetcified in the HTTP header
+ $HTTP_LANGS1 = preg_split ("/[;,]+/", $_SERVER['HTTP_ACCEPT_LANGUAGE'] );
+ $HTTP_LANGS2 = preg_split ("/[;,]+/", $_SERVER['HTTP_ACCEPT_LANGUAGE'] );
+ foreach( $HTTP_LANGS2 as $key => $value ) {
+ $value=preg_split ("/[-]+/", $value );
+ $HTTP_LANGS2[$key]=$value[0];
+ }
+
+ $HTTP_LANGS = array_merge ($HTTP_LANGS1, $HTTP_LANGS2);
+ foreach( $HTTP_LANGS as $HTTP_LANG) {
+ // try to grab one after the other the language file
+ if( file_exists( realpath( "lang/recoded/$HTTP_LANG.php" ) ) &&
+ is_readable( realpath( "lang/recoded/$HTTP_LANG.php" ) ) ) {
+ include realpath( "lang/recoded/$HTTP_LANG.php" );
+ break;
+ }
+ }
+ } else {
+ // grab the language file configured in config.php
+ if( $language != null ) {
+ if( 0 == strcmp( $language, 'english' ) )
+ $language = 'en';
+ if( file_exists( realpath( "lang/recoded/$language.php" ) ) &&
+ is_readable( realpath( "lang/recoded/$language.php" ) ) ) {
+ include realpath( "lang/recoded/$language.php" );
+ } else {
+ pla_error( "Could not read language file 'lang/recoded/$language.php'. Either the file
+ does not exist, or permissions do not allow phpLDAPadmin to read it." );
+ }
+ }
+ }
+}
+
+// If config.php doesn't create the templates array, create it here.
if( ! isset( $templates ) || ! is_array( $templates ) )
- $tempaltes = array();
+ $templates = array();
// Always including the 'custom' template (the most generic and flexible)
$templates['custom'] =
@@ -44,9 +114,9 @@ if ( get_magic_quotes_gpc() && ( ! isset( $slashes_stripped ) || ! $slashes_stri
}
}
- array_stripslashes($_POST);
array_stripslashes($_GET);
- array_stripslashes($_COOKIES);
+ array_stripslashes($_POST);
+ array_stripslashes($_COOKIE);
$slashes_stripped = true;
}
diff --git a/config.php.example b/config.php.example
index 0830019..ee7d2f1 100644
--- a/config.php.example
+++ b/config.php.example
@@ -14,31 +14,58 @@
// Your LDAP servers
$i=0;
$servers = array();
-$servers[$i]['name'] = 'My LDAP Server'; /* A convenient name that will appear in the tree viewer */
-$servers[$i]['host'] = 'ldap.example.com'; /* Examples: 'ldap.example.com', 'ldaps://ldap.example.com/'
- Note: Leave blank to remove it from the list of servers in the
- tree viewer*/
-$servers[$i]['base'] = 'dc=example,dc=com';/* The base DN of your LDAP server. Leave this blank to have phpLDAPadmin
+$servers[$i]['name'] = 'My LDAP Server'; /* A convenient name that will appear in
+ the tree viewer */
+$servers[$i]['host'] = 'ldap.example.com'; /* Examples: 'ldap.example.com',
+ 'ldaps://ldap.example.com/'
+ Note: Leave blank to remove it from the list
+ of servers in the tree viewer*/
+$servers[$i]['base'] = 'dc=example,dc=com';/* The base DN of your LDAP server. Leave this
+ blank to have phpLDAPadmin
auto-detect it for you. */
-$servers[$i]['port'] = 389; /* The port your LDAP server listens on (no quotes) */
-$servers[$i]['auth_type'] = 'config'; /* 2 options: 'form': you will be prompted, and a cookie stored
- with your login dn and password. 'config': specify your login dn
+$servers[$i]['port'] = 389; /* The port your LDAP server listens on
+ (no quotes) */
+$servers[$i]['auth_type'] = 'config'; /* 2 options: 'form': you will be prompted, and
+ a cookie stored with your login dn and
+ password. 'config': specify your login dn
and password here. In both cases, use caution! */
-$servers[$i]['login_dn'] = 'cn=Manager,dc=example,dc=com'; /* For anonymous binds, leave the login_dn and
- login_pass blank */
-$servers[$i]['login_pass'] = 'secret'; /* Your password (only if you specified 'config' for 'auth_type' */
-$servers[$i]['tls'] = false; /* Use TLS to connect. Requires PHP 4.2 or greater */
-$servers[$i]['default_hash'] = 'crypt'; /* Default password hashing algorith: one of md5, sha, md5crpyt, blowfish or
+$servers[$i]['login_dn'] = 'cn=Manager,dc=example,dc=com'; /* For anonymous binds, leave the
+ login_dn and login_pass blank */
+$servers[$i]['login_pass'] = 'secret'; /* Your password (only if you specified 'config'
+ for 'auth_type' */
+$servers[$i]['tls'] = false; /* Use TLS to connect. Requires PHP 4.2 or newer */
+$servers[$i]['default_hash'] = 'crypt'; /* Default password hashing algorith;
+ One of md5, ssha, sha, md5crpyt, blowfish or
leave blank for now default algorithm. */
-$servers[$i]['login_attr'] = 'dn'; /* If you specified 'form' as the auth_type above, you can optionally
- specify here an attribute to use when logging in. If you enter 'uid',
- then login as 'dsmith', phpLDAPadmin will search for uid=dsmith and
- log in as such. Leave blank or specify 'dn' to use full DN for logging in .*/
-$servers[$i]['read_only'] = false; /* Specify true If you want phpLDAPadmin to not display or permit any
- modification to the LDAP server. */
+$servers[$i]['login_attr'] = 'dn'; /* If you specified 'form' as the auth_type above,
+ you can optionally specify here an attribute
+ to use when logging in. If you enter 'uid',
+ then login as 'dsmith', phpLDAPadmin will
+ search for uid=dsmith and log in as such. Leave
+ blank or specify 'dn' to use full DN for
+ logging in .*/
+$servers[$i]['read_only'] = false; /* Specify true If you want phpLDAPadmin to not
+ display or permit any modification to the
+ LDAP server. */
+$servers[$i]['enable_auto_uid_numbers'] = false; /* This feature allows phpLDAPadmin to
+ automatically determine the next
+ available uidNumber for a new entry. */
+$servers[$i]['auto_uid_number_mechanism'] = 'search';
+ /* The mechanism to use when finding the next available uidNumber.
+ Two possible values: 'uidpool' or 'search'. The 'uidpool'
+ mechanism uses an existing uidPool entry in your LDAP server
+ to blindly lookup the next available uidNumber. The 'search'
+ mechanism searches for entries with a uidNumber value and finds
+ the first available uidNumber (slower). */
+$servers[$i]['auto_uid_number_search_base'] = 'ou=People,dc=example,dc=com';
+ /* The DN of the search base when the 'search'
+ mechanism is used above. */
+$servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com';
+ /* The DN of the uidPool entry when 'uidpool'
+ mechanism is used above. */
-/* If you want to configure additional LDAP servers, do so below. */
+// If you want to configure additional LDAP servers, do so below.
$i++;
$servers[$i]['name'] = 'Another server';
$servers[$i]['host'] = '';
@@ -51,6 +78,10 @@ $servers[$i]['tls'] = false;
$servers[$i]['default_hash'] = 'crypt';
$servers[$i]['login_attr'] = '';
$servers[$i]['read_only'] = false;
+$servers[$i]['enable_auto_uid_numbers'] = false;
+$servers[$i]['auto_uid_number_mechanism'] = 'search';
+$servers[$i]['auto_uid_number_search_base'] = 'ou=People,dc=example,dc=com';
+$servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com';
// If you want to configure more LDAP servers, copy and paste the above (including the "$i++;")
@@ -60,13 +91,19 @@ $jpeg_temp_dir = "/tmp"; // Example for Unix systems
//$jpeg_temp_dir = "c:\\temp"; // Example for Windows systems
/** **/
-/** Appearance and Behavior **/
+/** Appearance and Behavior **/
/** **/
-// The language setting. Right now, 'english', 'german' and 'french' are available
+// The language setting. If you set this to 'auto', phpLDAPadmin will
+// attempt to determine your language automatically. Otherwise, available
+// lanaguages are: 'ct', 'de', 'en', 'es', 'fr', 'it', 'nl', and 'ru'
// Localization is not complete yet, but most strings have been translated.
-// Please help by writing language files. See lang/english.php for an example.
-$language = 'english';
+// Please help by writing language files. See lang/en.php for an example.
+$language = 'auto';
+
+// Set to true if you want to draw a checkbox next to each entry in the tree viewer
+// to be able to delete multiple entries at once
+$enable_mass_delete = false;
// Set to true if you want LDAP data to be displayed read-only (without input fields)
// when a user logs in to a server anonymously
@@ -77,11 +114,17 @@ $anonymous_bind_implies_read_only = true;
$cookie_time = 0; // seconds
// How many pixels wide do you want your left frame view (for the tree browser)
-$tree_width = 300; // pixels
+$tree_width = 320; // pixels
// How long to keep jpegPhoto temporary files in the jpeg_temp_dir directory (in seconds)
$jpeg_tmp_keep_time = 120; // seconds
+// Would you like to see helpful hint text occacsionally?
+$show_hints = true; // set to false to disable hints
+
+// When using the search page, limit result size to this many entries
+$search_result_size_limit = 50;
+
/** **/
/** Simple Search Form Config **/
/** **/
@@ -89,11 +132,11 @@ $jpeg_tmp_keep_time = 120; // seconds
// Which attributes to include in the drop-down menu of the simple search form (comma-separated)
// Change this to suit your needs for convenient searching. Be sure to change the correlating
// list below ($search_attributes_display)
-$search_attributes = "uid, cn, gidNumber, objectClass";
+$search_attributes = "uid, cn, gidNumber, objectClass, telephoneNumber, mail, street";
// This list correlates to the list directly above. If you want to present more readable names
// for your search attributes, do so here. Both lists must have the same number of entries.
-$search_attributes_display = "User Name, Common Name, Group ID, objectClass";
+$search_attributes_display = "User Name, Common Name, Group ID, Object Class, Phone Number, Email, Address";
// The list of attributes to display in each search result entry summary
$search_result_attributes = "dn, cn";
@@ -144,12 +187,6 @@ $templates[] =
'icon' => 'images/dc.png',
'handler' => 'new_dns_entry.php' );
-$templates[] =
- array( 'desc' => 'Posix Group',
- 'icon' => 'images/ou.png',
- 'handler' => 'new_posix_group_template.php' );
-
-
/** **/
/** User-friendly attribute translation **/
/** **/
diff --git a/copy.php b/copy.php
index 008226d..9ce8834 100644
--- a/copy.php
+++ b/copy.php
@@ -1,4 +1,4 @@
-\n";
- echo "