diff --git a/INSTALL b/INSTALL index cec0dba..d9f1c87 100644 --- a/INSTALL +++ b/INSTALL @@ -28,10 +28,10 @@ in the "doc" directory. # mkdir /var/www/tmp, and then # chown root:daemon /var/www/tmp # chmod 1755 /var/www/tmp - Where tmp is the $jpeg_temp_dir configured in config.php + Where tmp is the $config->custom->tmpdir['jpeg'] configured in config.php * Windows - For jpeg photos to work properly, be sure to change $jpeg_temp_dir + For jpeg photos to work properly, be sure to change $config->custom->tmpdir['jpeg'] from "/tmp" to "c:\\temp" or similar. diff --git a/VERSION b/VERSION index b0bb878..c81aa44 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.5 +0.9.7 diff --git a/add_attr.php b/add_attr.php index dadd99b..861b4a4 100644 --- a/add_attr.php +++ b/add_attr.php @@ -1,141 +1,163 @@ isReadOnly() ) + pla_error( $lang['no_updates_in_read_only_mode'] ); +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); -$server_id = $_POST['server_id']; $attr = $_POST['attr']; $val = isset( $_POST['val'] ) ? $_POST['val'] : false;; $dn = $_POST['dn'] ; +$is_binary_val = isset( $_POST['binary'] ) ? true : false; + $encoded_dn = rawurlencode( $dn ); $encoded_attr = rawurlencode( $attr ); -$is_binary_val = isset( $_POST['binary'] ) ? true : false; if( ! $is_binary_val && $val == "" ) { pla_error( $lang['left_attr_blank'] ); } -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); - -// special case for binary attributes (like jpegPhoto and userCertificate): +// special case for binary attributes (like jpegPhoto and userCertificate): // we must go read the data from the file and override $val with the binary data // Secondly, we must check if the ";binary" option has to be appended to the name // of the attribute. // Check to see if this is a unique Attribute -if( $badattr = checkUniqueAttr( $server_id, $dn, $attr, array($val) ) ) { - $search_href='search.php?search=true&form=advanced&server_id=' . $server_id . '&filter=' . $attr . '=' . $badattr; - pla_error(sprintf( $lang['unique_attr_failed'] , $attr,$badattr,$dn,$search_href ) ); +if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, array($val) ) ) { + $search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',$ldapserver->server_id,$attr,$badattr); + pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) ); } if( $is_binary_val ) { - if( 0 == $_FILES['val']['size'] ) - pla_error( $lang['file_empty'] ); - if( ! is_uploaded_file( $_FILES['val']['tmp_name'] ) ) { - if( isset( $_FILES['val']['error'] ) ) - switch($_FILES['val']['error']){ - case 0: //no error; possible file attack! - pla_error( $lang['invalid_file'] ); - case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini - pla_error( $lang['uploaded_file_too_big'] ); - case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form - pla_error( $lang['uploaded_file_too_big'] ); - case 3: //uploaded file was only partially uploaded - pla_error( $lang['uploaded_file_partial'] ); - case 4: //no file was uploaded - pla_error( $lang['left_attr_blank'] ); - default: //a default error, just in case! :) - pla_error( $lang['invalid_file'] ); - break; - } - else - pla_error( $lang['invalid_file'] ); - } - $file = $_FILES['val']['tmp_name']; - $f = fopen( $file, 'r' ); - $binary_data = fread( $f, filesize( $file ) ); - fclose( $f ); - $val = $binary_data; + if( 0 == $_FILES['val']['size'] ) + pla_error( $lang['file_empty'] ); - if( is_binary_option_required( $server_id, $attr ) ) - $attr .=";binary"; + if( ! is_uploaded_file( $_FILES['val']['tmp_name'] ) ) { + + if( isset( $_FILES['val']['error'] ) ) + + switch($_FILES['val']['error']) { + case 0: //no error; possible file attack! + pla_error( $lang['invalid_file'] ); + break; + + case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini + pla_error( $lang['uploaded_file_too_big'] ); + break; + + case 2: //uploaded file exceeds the MAX_FILE_SIZE directive specified in the html form + pla_error( $lang['uploaded_file_too_big'] ); + break; + + case 3: //uploaded file was only partially uploaded + pla_error( $lang['uploaded_file_partial'] ); + break; + + case 4: //no file was uploaded + pla_error( $lang['left_attr_blank'] ); + break; + + default: //a default error, just in case! :) + pla_error( $lang['invalid_file'] ); + break; + } + + else + pla_error( $lang['invalid_file'] ); + } + + $file = $_FILES['val']['tmp_name']; + $f = fopen( $file, 'r' ); + $binary_data = fread( $f, filesize( $file ) ); + fclose( $f ); + + $val = $binary_data; + + if( is_binary_option_required( $ldapserver, $attr ) ) + $attr .= ";binary"; } -// Automagically hash new userPassword attributes according to the -// chosen in config.php. -if( 0 == strcasecmp( $attr, 'userpassword' ) ) -{ - if( isset( $servers[$server_id]['default_hash'] ) && - $servers[$server_id]['default_hash'] != '' ) - { - $enc_type = $servers[$server_id]['default_hash']; +/* Automagically hash new userPassword attributes according to the + chosen in config.php. */ +if( 0 == strcasecmp( $attr, 'userpassword' ) ) { + if (trim($ldapserver->default_hash) != '' ) { + $enc_type = $ldapserver->default_hash; $val = password_hash( $val, $enc_type ); } } -elseif( ( 0 == strcasecmp( $attr , 'sambantpassword' ) || 0 == strcasecmp( $attr , 'sambalmpassword') ) ){ - $mkntPassword = new MkntPasswdUtil(); - $mkntPassword->createSambaPasswords( $val ); - $val = $mkntPassword->valueOf($attr); + +elseif( in_array( $attr,array('sambantpassword','sambalmpassword') ) ){ + $mkntPassword = new MkntPasswdUtil(); + $mkntPassword->createSambaPasswords( $val ); + $val = $mkntPassword->valueOf($attr); } -$ds = pla_ldap_connect( $server_id ) or pla_error( $lang['could_not_connect'] ); $new_entry = array( $attr => $val ); -$result = @ldap_mod_add( $ds, $dn, $new_entry ); +$result = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry ); + +if ($result) + header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=%s', + $ldapserver->server_id,$encoded_dn,$encoded_attr)); -if( $result ) - header( "Location: edit.php?server_id=$server_id&dn=$encoded_dn&modified_attrs[]=$encoded_attr" ); else - pla_error( $lang['failed_to_add_attr'], ldap_error( $ds ) , ldap_errno( $ds ) ); + pla_error( $lang['failed_to_add_attr'],ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()) ); -// check if we need to append the ;binary option to the name -// of some binary attribute +/** + * Check if we need to append the ;binary option to the name + * of some binary attribute + * + * @param object $ldapserver Server Object that the attribute is in. + * @param attr $attr Attribute to test to see if it requires ;binary added to it. + * @return bool + */ -function is_binary_option_required( $server_id, $attr ){ +function is_binary_option_required( $ldapserver, $attr ) { - // list of the binary attributes which need the ";binary" option - $binary_attributes_with_options = array( - // Superior: Ldapv3 Syntaxes (1.3.6.1.4.1.1466.115.121.1) - '1.3.6.1.4.1.1466.115.121.1.8' => "userCertificate", - '1.3.6.1.4.1.1466.115.121.1.8' => "caCertificate", - '1.3.6.1.4.1.1466.115.121.1.10' => "crossCertificatePair", - '1.3.6.1.4.1.1466.115.121.1.9' => "certificateRevocationList", - '1.3.6.1.4.1.1466.115.121.1.9' => "authorityRevocationList", - // Superior: Netscape Ldap attributes types (2.16.840.1.113730.3.1) - '2.16.840.1.113730.3.1.40' => "userSMIMECertificate" - ); - - // quick check by attr name (short circuits the schema check if possible) - //foreach( $binary_attributes_with_options as $oid => $name ) - //if( 0 == strcasecmp( $attr, $name ) ) + // list of the binary attributes which need the ";binary" option + $binary_attributes_with_options = array( + // Superior: Ldapv3 Syntaxes (1.3.6.1.4.1.1466.115.121.1) + '1.3.6.1.4.1.1466.115.121.1.8' => "userCertificate", + '1.3.6.1.4.1.1466.115.121.1.8' => "caCertificate", + '1.3.6.1.4.1.1466.115.121.1.10' => "crossCertificatePair", + '1.3.6.1.4.1.1466.115.121.1.9' => "certificateRevocationList", + '1.3.6.1.4.1.1466.115.121.1.9' => "authorityRevocationList", + // Superior: Netscape Ldap attributes types (2.16.840.1.113730.3.1) + '2.16.840.1.113730.3.1.40' => "userSMIMECertificate" + ); + + // quick check by attr name (short circuits the schema check if possible) + //foreach( $binary_attributes_with_options as $oid => $name ) + //if( 0 == strcasecmp( $attr, $name ) ) //return true; - $schema_attr = get_schema_attribute( $server_id, $attr ); - if( ! $schema_attr ) - return false; + $schema_attr = get_schema_attribute( $ldapserver, $attr ); + if( ! $schema_attr ) + return false; - $syntax = $schema_attr->getSyntaxOID(); - if( isset( $binary_attributes_with_options[ $syntax ] ) ) - return true; + $syntax = $schema_attr->getSyntaxOID(); + if( isset( $binary_attributes_with_options[ $syntax ] ) ) + return true; - return false; + return false; } - ?> diff --git a/add_attr_form.php b/add_attr_form.php index ed0eef8..3826902 100644 --- a/add_attr_form.php +++ b/add_attr_form.php @@ -1,29 +1,30 @@ isReadOnly() ) + pla_error( $lang['no_updates_in_read_only_mode'] ); +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); + $dn = $_GET['dn']; $encoded_dn = rawurlencode( $dn ); -$server_id = $_GET['server_id']; $rdn = get_rdn( $dn ); -$server_name = $servers[$server_id]['name']; -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); $friendly_attrs = process_friendly_attr_table(); include './header.php'; ?> @@ -31,22 +32,24 @@ include './header.php'; ?>

-

:     :

+

: name; ?>     :

-getMustAttrNames( $schema_oclasses ), - $schema_oclass->getMayAttrNames( $schema_oclasses ), - $avail_attrs ); + $schema_oclass->getMayAttrNames( $schema_oclasses ), + $avail_attrs ); } $avail_attrs = array_unique( $avail_attrs ); @@ -55,99 +58,117 @@ sort( $avail_attrs ); $avail_binary_attrs = array(); foreach( $avail_attrs as $i => $attr ) { - if( is_attr_binary( $server_id, $attr ) ) { + + if( is_attr_binary( $ldapserver, $attr ) ) { $avail_binary_attrs[] = $attr; unset( $avail_attrs[ $i ] ); } } - ?>
+
+ +if( is_array( $avail_attrs ) && count( $avail_attrs ) > 0 ) { ?> - 0 ) { ?> +
+
-
-
-
- - + + + - - - -
- - -
-
- () -
-
- - - - 0 ) { ?> + } else { + $attr_display = htmlspecialchars( $a ); + } + + echo $attr_display; + $attr_select_html .= "\n"; + echo ""; + } ?> + + + + + + + + + +
+
+ () +
+
+ + + + 0 ) { ?> +
- +
+ + - " . $lang['warning_file_uploads_disabled'] . "
"; - else - echo "
" . sprintf( $lang['max_file_size'], ini_get( 'upload_max_filesize' ) ) . "
"; - ?> + + " . $lang['warning_file_uploads_disabled'] . "
"; + + else + echo "
" . sprintf( $lang['max_file_size'], ini_get( 'upload_max_filesize' ) ) . "
"; + ?> +
+ - +

() - +
@@ -159,16 +180,18 @@ foreach( $avail_attrs as $i => $attr ) { /** * Given an attribute $x, this returns true if it is NOT already specified * in the current entry, returns false otherwise. + * + * @param attr $x + * @return bool + * @ignore */ -function not_an_attr( $x ) -{ +function not_an_attr( $x ) { global $attrs; + //return ! isset( $attrs[ strtolower( $x ) ] ); foreach( $attrs as $attr => $values ) if( 0 == strcasecmp( $attr, $x ) ) return false; return true; } - - ?> diff --git a/add_oclass.php b/add_oclass.php index 502a691..ac4f123 100644 --- a/add_oclass.php +++ b/add_oclass.php @@ -1,36 +1,39 @@ isReadOnly() ) + pla_error( $lang['no_updates_in_read_only_mode'] ); +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); + $dn = rawurldecode( $_POST['dn'] ); -$encoded_dn = rawurlencode( $dn ); -$new_oclass = $_POST['new_oclass']; -$server_id = $_POST['server_id']; +$new_oclass = unserialize( rawurldecode( $_POST['new_oclass'] ) ); $new_attrs = $_POST['new_attrs']; -if( is_attr_read_only( $server_id, 'objectClass' ) ) - pla_error( "ObjectClasses are flagged as read only in the phpLDAPadmin configuration." ); -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); +$encoded_dn = rawurlencode( $dn ); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); +if( is_attr_read_only( $ldapserver, 'objectClass' ) ) + pla_error( "ObjectClasses are flagged as read only in the phpLDAPadmin configuration." ); $new_entry = array(); $new_entry['objectClass'] = $new_oclass; @@ -42,29 +45,20 @@ if( is_array( $new_attrs ) && count( $new_attrs ) > 0 ) foreach( $new_attrs as $attr => $val ) { // Check to see if this is a unique Attribute - if( $badattr = checkUniqueAttr( $server_id, $dn, $attr, array($val) ) ) { - $search_href='search.php?search=true&form=advanced&server_id=' . $server_id . '&filter=' . $attr . '=' . $badattr; - pla_error(sprintf( $lang['unique_attr_failed'] , $attr,$badattr,$dn,$search_href ) ); + if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, array($val) ) ) { + $search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s', + $ldapserver->server_id,$attr,$badattr); + pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) ); } $new_entry[ $attr ] = $val; } -//echo "
"; 
-//print_r( $new_entry );
-//exit;
+$add_res = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry );
 
-$ds = pla_ldap_connect( $server_id );
-pla_ldap_connection_is_error( $ds );
-$add_res = @ldap_mod_add( $ds, $dn, $new_entry );
+if (! $add_res)
+	pla_error($lang['could_not_perform_ldap_mod_add'],ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect()));
 
-if( ! $add_res )
-{
-	pla_error( $lang['could_not_perform_ldap_mod_add'], ldap_error( $ds ), ldap_errno( $ds ) );
-}
 else
-{
-	header( "Location: edit.php?server_id=$server_id&dn=$encoded_dn&modified_attrs[]=objectclass" );
-}
-
+	header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=objectclass',$ldapserver->server_id,$encoded_dn));
 ?>
diff --git a/add_oclass_form.php b/add_oclass_form.php
index cbe624f..2b62009 100644
--- a/add_oclass_form.php
+++ b/add_oclass_form.php
@@ -1,9 +1,7 @@
 isReadOnly() )
 	pla_error( $lang['no_updates_in_read_only_mode'] );
+if( ! $ldapserver->haveAuthInfo())
+	pla_error( $lang['not_enough_login_info'] );
 
-check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] );
-have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] );
+$new_oclass = $_REQUEST['new_oclass'];
+$dn = rawurldecode( $_REQUEST['dn'] );
+$encoded_dn = rawurlencode( $dn );
 
 /* Ensure that the object has defined all MUST attrs for this objectClass.
  * If it hasn't, present a form to have the user enter values for all the
  * newly required attrs. */
 
-$entry = get_object_attrs( $server_id, $dn, true );
+$entry = get_object_attrs( $ldapserver, $dn, true );
+
 $current_attrs = array();
 foreach( $entry as $attr => $junk )
 	$current_attrs[] = strtolower($attr);
 
 // grab the required attributes for the new objectClass
-$oclass = get_schema_objectclass( $server_id, $new_oclass );
-if( $oclass )
-	$must_attrs = $oclass->getMustAttrs();
-else
-	$must_attrs = array();
+$schema_oclasses = get_schema_objectclasses( $ldapserver );
+$must_attrs = array();
+foreach( $new_oclass as $oclass_name ) {
+	$oclass = get_schema_objectclass( $ldapserver, $oclass_name  );
+	if( $oclass )
+		$must_attrs = array_merge( $must_attrs, $oclass->getMustAttrNames( $schema_oclasses ) );
+}
+$must_attrs = array_unique( $must_attrs );
 
 // We don't want any of the attr meta-data, just the string
 //foreach( $must_attrs as $i => $attr )
@@ -54,52 +58,57 @@ else
 // but that the object does not currently contain
 $needed_attrs = array();
 foreach( $must_attrs as $attr ) {
-    $attr = get_schema_attribute( $server_id, $attr->getName() );
-    //echo "
"; var_dump( $attr ); echo "
"; - // First, check if one of this attr's aliases is already an attribute of this entry - foreach( $attr->getAliases() as $alias_attr_name ) - if( in_array( strtolower( $alias_attr_name ), $current_attrs ) ) - // Skip this attribute since it's already in the entry - continue; - if( in_array( strtolower($attr->getName()), $current_attrs ) ) - continue; + $attr = get_schema_attribute( $ldapserver, $attr ); - // We made it this far, so the attribute needs to be added to this entry in order - // to add this objectClass - $needed_attrs[] = $attr; + //echo "
"; var_dump( $attr ); echo "
"; + + // First, check if one of this attr's aliases is already an attribute of this entry + foreach( $attr->getAliases() as $alias_attr_name ) + if( in_array( strtolower( $alias_attr_name ), $current_attrs ) ) + + // Skip this attribute since it's already in the entry + continue; + + if( in_array( strtolower($attr->getName()), $current_attrs ) ) + continue; + + // We made it this far, so the attribute needs to be added to this entry in order + // to add this objectClass + $needed_attrs[] = $attr; } -if( count( $needed_attrs ) > 0 ) -{ +if( count( $needed_attrs ) > 0 ) { include './header.php'; ?> - +

-

+

- +

- +
- + - - + + $attr ) { ?> + - - + +
getName()); ?>

@@ -110,18 +119,15 @@ if( count( $needed_attrs ) > 0 ) - $new_oclass ) ); - if( ! $add_res ) - pla_error( "Could not perform ldap_mod_add operation.", ldap_error( $ds ), ldap_errno( $ds ) ); +connect(), $dn, array( 'objectClass' => $new_oclass ) ); + if (! $add_res) + pla_error("Could not perform ldap_mod_add operation.", + ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect())); else - header( "Location: edit.php?server_id=$server_id&dn=$encoded_dn&modified_attrs[]=objectClass" ); + header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=objectClass', + $ldapserver->server_id,$encoded_dn)); } - ?> diff --git a/add_value.php b/add_value.php index 681cece..46c41d4 100644 --- a/add_value.php +++ b/add_value.php @@ -1,71 +1,74 @@ isReadOnly() ) + pla_error( $lang['no_updates_in_read_only_mode'] ); +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); + $attr = $_POST['attr']; -$encoded_attr = rawurlencode( $attr ); -$server_id = $_POST['server_id']; $new_value = $_POST['new_value']; +$dn = rawurldecode( $_POST['dn'] ); $is_binary_val = isset( $_POST['binary'] ) ? true : false; -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); -if( is_attr_read_only( $server_id, $attr ) ) - pla_error( "The attribute '" . htmlspecialchars( $attr ) . "' is flagged as read only in the phpLDAPadmin configuration." ); +$encoded_dn = rawurlencode( $dn ); +$encoded_attr = rawurlencode( $attr ); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); +if( is_attr_read_only( $ldapserver, $attr ) ) + pla_error(sprintf($lang['attr_is_read_only'],htmlspecialchars( $attr ))); -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); - -// special case for binary attributes: +// special case for binary attributes: // we must go read the data from the file. -if( $is_binary_val ) -{ +if( $is_binary_val ) { $file = $_FILES['new_value']['tmp_name']; + $f = fopen( $file, 'r' ); $binary_value = fread( $f, filesize( $file ) ); fclose( $f ); + $new_value = $binary_value; } -$new_entry = array( $attr => $new_value ); +$new_entry = array( $attr => $new_value ); // Check to see if this is a unique Attribute -if( $badattr = checkUniqueAttr( $server_id, $dn, $attr, $new_entry ) ) { - $search_href='search.php?search=true&form=advanced&server_id=' . $server_id . '&filter=' . $attr . '=' . $badattr; - pla_error(sprintf( $lang['unique_attr_failed'] , $attr,$badattr,$dn,$search_href ) ); +if( $badattr = checkUniqueAttr( $ldapserver, $dn, $attr, $new_entry ) ) { + $search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',$ldapserver->server_id,$attr,$badattr); + pla_error(sprintf( $lang['unique_attr_failed'],$attr,$badattr,$dn,$search_href ) ); } // Call the custom callback for each attribute modification // and verify that it should be modified. -if( preAttrAdd( $server_id, $dn, $attr, $new_entry ) ) { +if( run_hook ( 'pre_attr_add', array ( 'server_id' => $ldapserver->server_id, 'dn' => $dn, 'attr_name' => $attr, + 'new_value' => $new_entry ) ) ) { -$add_result = @ldap_mod_add( $ds, $dn, $new_entry ); + $add_result = @ldap_mod_add( $ldapserver->connect(), $dn, $new_entry ); -if( ! $add_result ) - pla_error( $lang['could_not_perform_ldap_mod_add'], ldap_error( $ds ), ldap_errno( $ds ) ); + if (! $add_result) + pla_error($lang['could_not_perform_ldap_mod_add'], + ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect())); } -header( "Location: edit.php?server_id=$server_id&dn=$encoded_dn&modified_attrs[]=$encoded_attr" ); - +header(sprintf('Location: edit.php?server_id=%s&dn=%s&modified_attrs[]=%s', + $ldapserver->server_id,$encoded_dn,$encoded_attr)); ?> diff --git a/add_value_form.php b/add_value_form.php index 6c9d429..3e06798 100644 --- a/add_value_form.php +++ b/add_value_form.php @@ -1,49 +1,53 @@ isReadOnly() ) + pla_error( $lang['no_updates_in_read_only_mode'] ); +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); + +$attr = $_GET['attr']; $dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null; $encoded_dn = rawurlencode( $dn ); -$server_id = $_GET['server_id']; -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); -if( null != $dn ) { - $rdn = get_rdn( $dn ); -} else { - $rdn = null; -} -$server_name = $servers[$server_id]['name']; -$attr = $_GET['attr']; $encoded_attr = rawurlencode( $attr ); -$current_values = get_object_attr( $server_id, $dn, $attr ); -$num_current_values = ( is_array($current_values) ? count($current_values) : 1 ); + +if (! is_null($dn)) + $rdn = get_rdn( $dn ); + +else + $rdn = null; + +$current_values = get_object_attr( $ldapserver, $dn, $attr ); +$num_current_values = ( is_array($current_values) ? count($current_values) : 0 ); $is_object_class = ( 0 == strcasecmp( $attr, 'objectClass' ) ) ? true : false; -$is_jpeg_photo = is_jpeg_photo( $server_id, $attr ); //( 0 == strcasecmp( $attr, 'jpegPhoto' ) ) ? true : false; +$is_jpeg_photo = is_jpeg_photo( $ldapserver, $attr ); //( 0 == strcasecmp( $attr, 'jpegPhoto' ) ) ? true : false; -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - - -if( $is_object_class ) { +if( $is_object_class ) { // fetch all available objectClasses and remove those from the list that are already defined in the entry - $schema_oclasses = get_schema_objectclasses( $server_id ); + $schema_oclasses = get_schema_objectclasses( $ldapserver ); + foreach( $current_values as $oclass ) unset( $schema_oclasses[ strtolower( $oclass ) ] ); + } else { - $schema_attr = get_schema_attribute( $server_id, $attr ); + $schema_attr = get_schema_attribute( $ldapserver, $attr ); } include './header.php'; ?> @@ -52,62 +56,77 @@ include './header.php'; ?>

- +

+

- : -     + : + name; ?>     :

- + : - - - -
- -
- + + + +
+ +
+ +

- - + + - +

- + - + +
+
+
@@ -116,53 +135,58 @@ include './header.php'; ?> - + - $oclass ) { // exclude any structural ones, as they'll only generate an LDAP_OBJECT_CLASS_VIOLATION - if ($oclass->type == "structural") continue; -?> + if ($oclass->type == "structural") continue; ?> - - +
- + + +
+ GetValue('appearance','show_hints')) { ?>
- + +} else { ?> - > - + > + + - - - - - - - - getMaxLength() ) - echo "maxlength=\"" . $schema_attr->getMaxLength() . "\" "; - ?>name="new_value" size="40" value="" /> - - + + + + + server_id ) ) { ?> + + + + + getMaxLength() ) echo "maxlength=\"" . $schema_attr->getMaxLength() . "\" "; ?>name="new_value" size="40" value="" /> + + + +
@@ -176,7 +200,7 @@ include './header.php'; ?> getMaxLength() ) { ?> - : getMaxLength() ); ?>
+ : getMaxLength() ); ?>
diff --git a/blowfish.php b/blowfish.php index 4848c57..de6dfb6 100644 --- a/blowfish.php +++ b/blowfish.php @@ -1,4 +1,5 @@ - * @version $Revision: 1.1 $ + * @version $Revision: 1.3 $ * @since Horde 2.2 * @package horde.cipher */ +/** + * @package horde.cipher + */ // Change for phpMyAdmin by lem9: //class Horde_Cipher_blowfish extends Horde_Cipher { @@ -386,7 +390,7 @@ class Horde_Cipher_blowfish { $parts = $this->_encryptBlock($L, $R); return pack("NN", $parts['L'], $parts['R']); } - + /** * Encrypt a block on data. * diff --git a/check_lang_files.php b/check_lang_files.php index 9422a40..bc97df0 100644 --- a/check_lang_files.php +++ b/check_lang_files.php @@ -1,10 +1,15 @@ -phpldapadmin - check of translation"; +$CHECKLANG=$_REQUEST['CHECKLANG']; include realpath( './lang/en.php' ); $english_lang = $lang; @@ -39,6 +44,8 @@ if( false === $unused_keys ) echo "\n"; echo "

Incomplete or Erroneous Language Files

\n\n"; +if ($CHECKLANG) + printf("

Checking language files %s

\n\n",$CHECKLANG); echo "

check all languages

\n"; flush(); while( ( $file = readdir( $dir ) ) !== false ) { @@ -48,13 +55,13 @@ while( ( $file = readdir( $dir ) ) !== false ) { // Sanity check. Is this really a PHP file? if( ! preg_match( "/\.php$/", $file ) ) continue; - echo "

$file

\n"; - echo "
    \n"; unset( $lang ); $lang = array(); include realpath( $lang_dir.'/'.$file ); $has_errors = false; if ($CHECKLANG=="" || $file===$CHECKLANG ){ + echo "

    $file

    \n"; + echo "
      \n"; foreach( $english_lang as $key => $string ) if( ! isset( $lang[ $key ] ) ) { $has_errors = true; diff --git a/collapse.php b/collapse.php index 498bde5..e4bb7c9 100644 --- a/collapse.php +++ b/collapse.php @@ -1,44 +1,42 @@ 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 +/* 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'] ); +$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(); -} +/* 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( "Location:tree.php?foo=$random_junk#{$server_id}_{$encoded_dn}$id_session_param" ); +header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,$encoded_dn,$id_session_param)); ?> diff --git a/common.php b/common.php index 03a7dad..b92ed07 100644 --- a/common.php +++ b/common.php @@ -1,157 +1,140 @@ = "5" ) - ini_set( "zend.ze1_compatibility_mode", 1 ); +@DEFINE(LIBDIR,'./'); -// Turn on all notices and warnings. This helps us write cleaner code (we hope at least) -if( phpversion() >= "5" ) - // E_DEBUG is PHP5 specific and prevents warnings about using 'var' to declar class members - error_reporting( 'E_DEBUG' ); -else - // For PHP4 - error_reporting( E_ALL ); +# Turn on all notices and warnings. This helps us write cleaner code (we hope at least) +if (phpversion() >= "5") { + # Work-around to get PLA to work in PHP5 + ini_set( "zend.ze1_compatibility_mode", 1 ); + # E_DEBUG is PHP5 specific and prevents warnings about using 'var' to declar class members + error_reporting( 'E_DEBUG' ); +} else + # For PHP4 + error_reporting( E_ALL ); -// For PHP5 backward/forward compatibility -if( ! defined( 'E_STRICT' ) ) { - define( 'E_STRICT', 2048 ); -} +# For PHP5 backward/forward compatibility +if (! defined('E_STRICT')) + define('E_STRICT',2048); -/** The minimum version of PHP required to run phpLDAPadmin. */ -@define( 'REQUIRED_PHP_VERSION', '4.1.0' ); -/** The default setting for $search_deref if unspecified or misconfigured by user. */ -@define( 'DEFAULT_SEARCH_DEREF_SETTING', LDAP_DEREF_ALWAYS ); -/** The default setting for $tree_deref if unspecified or misconfigured by user. */ -@define( 'DEFAULT_TREE_DEREF_SETTING', LDAP_DEREF_NEVER ); -/** The default setting for $export_deref if unspecified or misconfigured by user. */ -@define( 'DEFAULT_EXPORT_DEREF_SETTING', LDAP_DEREF_NEVER ); -/** The default setting for $view_deref if unspecified or misconfigured by user. */ -@define( 'DEFAULT_VIEW_DEREF_SETTING', LDAP_DEREF_NEVER ); - -// General functions needed to proceed (pla_ldap_search(), pla_error(), get_object_attrs(), etc.) +# General functions needed to proceed (pla_ldap_search(), pla_error(), get_object_attrs(), etc.) ob_start(); -if( ! file_exists( realpath( './functions.php' ) ) ) { - ob_end_clean(); - die( "Fatal error: Required file 'functions.php' does not exist." ); -} -if( ! is_readable( realpath( './functions.php' ) ) ) { - ob_end_clean(); - die( "Cannot read the file 'functions.php' its permissions are too strict." ); -} -require_once realpath( './functions.php' ); +require_once realpath(LIBDIR.'functions.php'); ob_end_clean(); -// Our custom error handler receives all error notices that pass the error_reporting() -// level set above. -set_error_handler( 'pla_error_handler' ); +/* 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. +/* Creates the language array which will be populated with localized strings + based on the user-configured language. */ $lang = array(); -// 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' ) ) ) { - ob_start(); - is_readable( realpath( './config.php' ) ) or pla_error( "Could not read config.php, its permissions are too strict." ); - include realpath( './config.php' ); - ob_end_clean(); +/* + * functions.php should have defined our pla_function_files array, listing all our + * required functions (order IS important). + * index.php should have checked they exist and are usable - we'll assume that the user + * has been via index.php, and fixed any problems already. + */ +ob_start(); +foreach ($pla_function_files as $file_name) { + require_once realpath ($file_name); } -$required_files = array( - // The base English language strings - './lang/recoded/en.php', - // Functions for managing the session (pla_session_start(), etc.) - './session_functions.php', - // Functions for reading the server schema (get_schema_object_classes(), etc.) - './schema_functions.php', - // Functions that can be defined by the user (preEntryDelete(), postEntryDelete(), etc.) - './custom_functions.php', - // Functions for hashing passwords with OpenSSL binary (only if mhash not present) - './emuhash_functions.php' ); +# Now read in config_default.php, which also reads in config.php +require_once realpath(LIBDIR.'config_default.php'); +ob_end_clean(); +/** + * At this point we have read all our additional function PHP files and our configuration. + */ -// Include each required file and check for sanity. -foreach( $required_files as $file_name ) { - file_exists( realpath( $file_name ) ) - or pla_error( "Fatal error: Required file '$file_name' does not exist." ); - is_readable( realpath( $file_name ) ) - or pla_error( "Fatal error: Cannot read the file '$file_name', its permissions are too strict." ); - ob_start(); - require_once realpath( $file_name ); - ob_end_clean(); -} +# Check our custom variables. +$config->CheckCustom(); -if( pla_session_start() ) - postSessionInit(); +if (pla_session_start()) + run_hook('post_session_init',array()); -// Language configuration. Auto or specified? -// Shall we attempt to auto-determine the language? -if( isset( $language ) ) { - if( 0 == strcasecmp( $language, "auto" ) ) { +/* + * Language configuration. Auto or specified? + * Shall we attempt to auto-determine the language? + */ +$language = $config->GetValue('appearance','language'); +if ($language == "auto") { - // Make sure their browser correctly reports language. If not, skip this. - if( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) { + # Make sure their browser correctly reports language. If not, skip this. + if( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) { - // 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" ) ) ) { - ob_start(); - include realpath( "lang/recoded/$HTTP_LANG.php" ); - ob_end_clean(); - break; - } + # 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" ) ) ) { + ob_start(); + include realpath( "lang/recoded/$HTTP_LANG.php" ); + ob_end_clean(); + 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" ) ) ) { - ob_start(); - include realpath( "lang/recoded/$language.php" ); - ob_end_clean(); - } else { - pla_error( "Could not read language file 'lang/recoded/$language.php'. Either the file - does not exist, or its permissions do not allow phpLDAPadmin to read it." ); - } + } + +} 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" ) ) ) { + ob_start(); + include realpath( "lang/recoded/$language.php" ); + ob_end_clean(); + } else { + pla_error( "Could not read language file 'lang/recoded/$language.php'. Either the file + does not exist, or its 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 ) ) +# If config.php doesn't create the templates array, create it here. +if (! isset($templates) || ! is_array($templates)) $templates = array(); -// Always including the 'custom' template (the most generic and flexible) -$templates['custom'] = - array( 'desc' => 'Custom', - 'icon' => 'images/object.png', - 'handler' => 'custom.php' ); +# Always including the 'custom' template (the most generic and flexible) +$templates['custom'] = + array('desc' => 'Custom', + 'icon' => 'images/object.png', + 'handler' => 'custom.php' ); -// Strip slashes from GET, POST, and COOKIE variables if this -// PHP install is configured to automatically addslashes() -if ( get_magic_quotes_gpc() && ( ! isset( $slashes_stripped ) || ! $slashes_stripped ) ) { +/* + * Strip slashes from GET, POST, and COOKIE variables if this + * PHP install is configured to automatically addslashes() + */ +if (get_magic_quotes_gpc() && (! isset($slashes_stripped) || ! $slashes_stripped)) { + array_stripslashes($_REQUEST); array_stripslashes($_GET); array_stripslashes($_POST); array_stripslashes($_COOKIE); @@ -159,4 +142,13 @@ if ( get_magic_quotes_gpc() && ( ! isset( $slashes_stripped ) || ! $slashes_stri $slashes_stripped = true; } +/* + * Update $_SESSION['activity'] + * for timeout and automatic logout feature + */ +if (isset($_REQUEST['server_id'])) { + $ldapserver = $ldapservers->Instance($_REQUEST['server_id']); + if ($ldapserver->haveAuthInfo()) + set_lastactivity($ldapserver); +} ?> diff --git a/compare.php b/compare.php new file mode 100644 index 0000000..2801bae --- /dev/null +++ b/compare.php @@ -0,0 +1,579 @@ +Instance($server_id_src); +if ( ! $ldapserver_src->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); + +$ldapserver_dst = $ldapservers->Instance($server_id_dst); +if ( ! $ldapserver_src->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); + +dn_exists($ldapserver_src,$dn_src) or pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn_src))); +dn_exists($ldapserver_dst,$dn_dst) or pla_error(sprintf($lang['no_such_entry'],pretty_print_dn($dn_dst))); + +$friendly_attrs = process_friendly_attr_table(); + +$attrs_src = get_object_attrs($ldapserver_src,$dn_src,false,$config->GetValue('deref','view')); +$attrs_dst = get_object_attrs($ldapserver_dst,$dn_dst,false,$config->GetValue('deref','view')); + +# Get a list of all attributes. +$attrs_all = array_keys($attrs_src); +foreach ($attrs_dst as $key => $val) + if (! in_array($key,$attrs_all)) + $attrs_all[] = $key; + +include './header.php'; +?> + + + + + + + + + + + + + + + +',$lang['no_attributes']); + print '
      +

      +
      +


       

      +
      +

      : name; ?>
      :

      +
      +

      : name; ?>
      :

      +
      +
      + + + + + +
      +
      (%s)
      '; + print ''; + die(); +} + +sort($attrs_all); + +# Work through each of the attributes. +foreach ($attrs_all as $attr) { + flush(); + + # If this is the DN, get the next attribute. + if (! strcasecmp($attr,'dn')) + continue; + + # Has the config.php specified that this attribute is to be hidden or shown? + if (is_attr_hidden($ldapserver_src,$attr) || is_attr_hidden($ldapserver_dst,$attr)) + continue; +?> + + + + + + + isReadOnly()) { ?> + +
      + + + + alias',sprintf($lang['alias_for'],$attr_display,$attr)); + + } else { + $attr_note = ''; + $attr_display = $attr; + } + + # is this attribute required by an objectClass? + $required_by = ''; + switch ($side) { + case 'src': + $ldapserver = $ldapserver_src; + if ($schema_attr_src) + foreach ($schema_attr_src->getRequiredByObjectClasses() as $required) + if (isset($attrs_src['objectClass']) && in_array(strtolower($required),arrayLower($attrs_src['objectClass']))) + $required_by .= $required . ' '; + + # It seems that some LDAP servers (Domino) returns attributes in lower case? + elseif( isset($attrs_src['objectclass']) && in_array(strtolower($required),arrayLower($attrs_src['objectclass']))) + $required_by .= $required . ' '; + + break; + + case 'dst': + $ldapserver = $ldapserver_dst; + if ($schema_attr_dst) + foreach ($schema_attr_dst->getRequiredByObjectClasses() as $required) + if (isset($attrs_dst['objectClass']) && in_array(strtolower($required),arrayLower($attrs_dst['objectClass']))) + $required_by .= $required . ' '; + + # It seems that some LDAP servers (Domino) returns attributes in lower case? + elseif (isset($attrs_dst['objectclass']) && in_array(strtolower($required),arrayLower($attrs_dst['objectclass']))) + $required_by .= $required . ' '; + break; + } + + if ($side == 'src') { ?> + + + + + + + + + %s',sprintf($lang['required_for'],$required_by),$lang['required']); + ?> + + + + +   + + + + () + + + + + + + + + + + + + + +  '; + + if (! isset($attrs_src[$attr])) { + echo "<". $lang['no_value'].">"; + $toJump = 1; + continue; + } else + $vals = $attrs_src[$attr]; + + $ldapserver = $ldapserver_src; + break; + + case 'dst': + print ' '; + + if (! isset($attrs_dst[$attr])) { + echo "<". $lang['no_value'].">"; + $toJump = 1; + continue; + } else + $vals = $attrs_dst[$attr]; + + $ldapserver = $ldapserver_dst; + break; + } + + if ($toJump) continue; + + /* + * Is this attribute a jpegPhoto? + */ + if (is_jpeg_photo($ldapserver,$attr)) { + + switch ($side) { + case 'src': + // Don't draw the delete buttons if there is more than one jpegPhoto + // (phpLDAPadmin can't handle this case yet) + draw_jpeg_photos( $ldapserver, $dn_src, $attr, false ); + break; + + case 'dst': + if( $ldapserver_dst->isReadOnly() || is_attr_read_only( $ldapserver_dst, $attr ) ) + draw_jpeg_photos( $ldapserver, $dn_dst, $attr, false ); + else + draw_jpeg_photos( $ldapserver, $dn_dst, $attr, true ); + + break; + } + + // proceed to the next attribute + echo "\n"; + continue; + } + + /* + * Is this attribute binary? + */ + if( is_attr_binary( $ldapserver, $attr ) ) { + switch ($side) { + case 'src': + $href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_src,$attr); + break; + + case 'dst': + $href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_dst,$attr); + break; + } + ?> + + + +
      + + 1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?> + "> ()
      + + +
      + + isReadOnly() && ! is_attr_read_only( $ldapserver, $attr ) ) { ?> + + + + + +
      + + + isReadOnly() || is_attr_read_only( $ldapserver, $attr )) ) { + if( is_array( $vals ) ) { + foreach( $vals as $i => $val ) { + if( trim( $val ) == "" ) + echo "[" . $lang['empty'] . "]
      \n"; + + elseif( 0 == strcasecmp( $attr, 'userPassword' ) && $config->GetValue('appearance','obfuscate_password_display')) + echo preg_replace( '/./', '*', $val ) . "
      "; + + else + echo htmlspecialchars( $val ) . "
      "; + } + + } else { + if( 0 == strcasecmp( $attr, 'userPassword' ) && $config->GetValue('appearance','obfuscate_password_display')) + echo preg_replace( '/./', '*', $vals ) . "
      "; + else + echo $vals . "
      "; + } + echo ""; + continue; + } + + /* + * Is this a userPassword attribute? + */ + if( ! strcasecmp( $attr, 'userpassword' ) ) { + $user_password = $vals[0]; + $enc_type = get_enc_type( $user_password ); + + // Set the default hashing type if the password is blank (must be newly created) + if( $user_password == '' ) { + $enc_type = get_default_hash( $server_id ); + } + + if ($side == 'dst') { ?> + + + + + + + GetValue('appearance','obfuscate_password_display') || is_null( $enc_type ) ) { + echo htmlspecialchars( preg_replace( "/./", "*", $user_password ) ); + } else { + echo htmlspecialchars( $user_password ); + } ?> + +
      + + + + + + + +
      + + + + + + + + + + + + + + + + + + $val ) { + + if ($side == 'dst') { + $input_name = "new_values[" . htmlspecialchars( $attr ) . "][$i]"; + // We smack an id="..." tag in here that doesn't have [][] in it to allow the + // draw_chooser_link() to identify it after the user clicks. + $input_id = "new_values_" . htmlspecialchars($attr) . "_" . $i; ?> + + + + + + + + type == 'structural') { + echo "$val (" . $lang['structural'] . ")
      "; + + if ($side == 'dst') {?> + + + + + + + + + + + + + + + + server_id ) ) { + + if ($side == 'dst') {?> + + + + + + + + +
      + + + + + + + + + isReadOnly()) { + + // First check if the required objectClass is in this DN + $isOK = 0; + $src_oclass = array(); + $attr_object = get_schema_attribute( $ldapserver_dst, $attr, $dn_dst ); + foreach ($attr_object->used_in_object_classes as $oclass) { + if (in_array(strtolower($oclass),arrayLower($attrs_dst['objectClass']))) { + $isOK = 1; + break; + } else { + // Find oclass that the source has that provides this attribute. + if (in_array($oclass,$attrs_src['objectClass'])) + $src_oclass[] = $oclass; + } + } + + print "  "; + if (! $isOK) { + + if (count($src_oclass) == 1) { + $add_href = "add_oclass_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&new_oclass=$src_oclass[0]"; + } else { + $add_href = "add_value_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&attr=objectClass"; + } + + if ($attr == 'objectClass') + printf('
      (%s)
      ',$add_href,$lang['add_oclass_and_attrs'],$lang['add_value']); + else + printf('
      (%s)
      ',$add_href,sprintf($lang['need_oclass'], implode(" ",$src_oclass)),$lang['add_new_objectclass']); + + } else { + if(! $schema_attr_dst->getIsSingleValue() || (! isset($vals))) { + + $add_href = "add_value_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&attr=" . rawurlencode( $attr ); + + printf('
      (%s)
      ', + $add_href,sprintf($lang['add_value_tooltip'],$attr),$lang['add_value']); + } + } + } + + print ""; ?> + + + + + + + + $vals ) */ + +if( ! $ldapserver_dst->isReadOnly( ) ) { ?> + +  
      + + + + + + + + + +
      + + + +
      + + + diff --git a/compare_form.php b/compare_form.php new file mode 100644 index 0000000..9c915bc --- /dev/null +++ b/compare_form.php @@ -0,0 +1,79 @@ +haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); + +$dn = (isset($_GET['dn']) ? $_GET['dn'] : ''); + +$encoded_dn = rawurlencode( $dn ); +$rdn = get_rdn( $dn ); +$container = get_container( $dn ); + +$attrs = get_object_attrs( $ldapserver, $dn ); +$select_server_html = server_select_list($ldapserver->server_id,true,'server_id_dst'); + +include './header.php'; ?> + + + +

      +

      : name; ?> + +     : + +

      + +
      + :
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      : + +
      : + +
      :
      +
      +
      + + diff --git a/config.php.example b/config.php.example index 6a63f3c..566c9c7 100644 --- a/config.php.example +++ b/config.php.example @@ -1,389 +1,340 @@ custom variable to do so. + * For example, the default for defining the language in config_default.php + * + * $this->default->appearance['lang'] = array( + * 'desc'=>'Language', + * 'default'=>'auto'); + * + * to override this, use $config->custom->appearance['lang'] = 'en'; + * + * This file is also used to configure your LDAP server connections. + * + * You must specify at least one LDAP server there. You may add + * as many as you like. You can also specify your language, and + * many other options. */ -$blowfish_secret = ''; -// Your LDAP servers +/** **/ +/** Miscellaneous Configuration overrides **/ +/** **/ + +/* If you are asked to put pla in debug mode, this is how you do it: */ +// $config->custom->debug['level'] = 2; +// $config->custom->debug['syslog'] = true; + +/* phpLDAPadmin can encrypt the content of sensitive cookies if you set this + to a big random string. */ +$config->custom->session['blowfish'] = ''; + +/* 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/en.php for an example. */ +// $config->custom->appearance['language'] = 'auto'; + +/* The temporary storage directory where we will put jpegPhoto data + This directory must be readable and writable by your web server. */ +// $config->custom->jpeg['tmpdir'] = "c:\\temp"; // Example for Windows systems +$config->custom->jpeg['tmpdir'] = "/tmp"; // Example for Unix systems + +/** **/ +/** Your LDAP servers **/ +/** **/ + $i=0; -$servers = array(); -$servers[$i]['name'] = 'My LDAP Server'; /* A convenient name that will appear in - the tree viewer and throughout phpLDAPadmin to - identify this LDAP server to users. */ -$servers[$i]['host'] = 'ldap.example.com'; /* Examples: - 'ldap.example.com', - 'ldaps://ldap.example.com/', - 'ldapi://%2fusr%local%2fvar%2frun%2fldapi' - (Unix socket at /usr/local/var/run/ldap) - Note: Leave 'host' blank to make phpLDAPadmin - ignore this server. */ -$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). 389 is standard. */ -$servers[$i]['auth_type'] = 'config'; /* Three 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 login will be - required to use phpLDAPadmin for this server. - Choose wisely to protect your authentication - information appropriately for your situation. If - you choose 'cookie', your cookie contents will be - encrypted using blowfish and the secret your specify - above as $blowfish_secret. */ -$servers[$i]['login_dn'] = 'cn=Manager,dc=example,dc=com'; - /* The DN of the user for phpLDAPadmin to bind with. - For anonymous binds or 'cookie' or 'session' auth_types, - leave the login_dn and login_pass blank. If you specify a - login_attr in conjunction with a cookie or session auth_type, - then you can also specify the login_dn/login_pass here for - searching the directory for users (ie, if your LDAP server - does not allow anonymous binds. */ -$servers[$i]['login_pass'] = 'secret'; /* Your LDAP password. If you specified an empty login_dn above, this - MUST also be blank. */ -$servers[$i]['tls'] = false; /* Use TLS (Transport Layer Security) to connect to the LDAP - server. */ -$servers[$i]['low_bandwidth'] = false; /* 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 cause phpLDAPadmin to forego some "fancy" features - to conserve bandwidth. */ -$servers[$i]['default_hash'] = 'crypt'; /* Default password hashing algorithm. - One of md5, ssha, sha, md5crpyt, smd5, blowfish, crypt or - leave blank for now default algorithm. */ -$servers[$i]['login_attr'] = 'dn'; /* If you specified 'cookie' or 'session' as the auth_type above, - you can optionally specify here an attribute - to use when logging in. If you enter 'uid' - and login as 'dsmith', phpLDAPadmin will - search for (uid=dsmith) and log in as that user. Leave - blank or specify 'dn' to use full DN for - logging in. Note also that if your LDAP server requires - you to login to perform searches, you can enter - the DN to use when searching in 'login_dn' and - 'login_pass' above. You may also specify 'string', in which case - you can provide a string to use for logging users - in. See 'login_string' directly below. */ -$servers[$i]['login_string'] = 'uid=,ou=People,dc=example,dc=com'; - /* 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 - I have a lot of user entries with DNs like - "uid=dsmith,ou=People,dc=example,dc=com", then I can specify a string - "uid=,ou=People,dc=example,dc=com" and my users can login with - their user names alone, i.e., "dsmith" in this case. */ -$servers[$i]['login_class'] = ''; /* 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. E.g., set this to 'posixAccount' or - 'inetOrgPerson', depending upon your setup. */ -$servers[$i]['read_only'] = false; /* Specify true If you want phpLDAPadmin to not - display or permit any modification to the - LDAP server. */ -$servers[$i]['show_create'] = true; /* Specify false if you do not want phpLDAPadmin to - draw the 'Create new' links in the tree viewer. */ -$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_min'] = 1000; - /* The minimum number to use when searching for the next - available UID number (only when 'search' is used for - auto_uid_number_mechanism' */ -$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. */ -$servers[$i]['auto_uid_number_search_dn'] = ''; - /* 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. */ -$servers[$i]['auto_uid_number_search_dn_pass'] = ''; - /* The password for the dn above. */ -$servers[$i]['disable_anon_bind'] = false; - /* Disable the anonymous login. */ -$servers[$i]['custom_pages_prefix'] = 'custom_'; - /* Use customized page with prefix when available. */ +$ldapservers = new LDAPServers; -$servers[$i]['unique_attrs_dn'] = ''; - /* 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) */ -$servers[$i]['unique_attrs_dn_pass'] = ''; - /* The password for the dn above */ +/* A convenient name that will appear in the tree viewer and throughout phpLDAPadmin to + identify this LDAP server to users. */ +$ldapservers->SetValue($i,'server','name','My LDAP Server'); + +/* Examples: + 'ldap.example.com', + 'ldaps://ldap.example.com/', + 'ldapi://%2fusr%local%2fvar%2frun%2fldapi' (Unix socket at /usr/local/var/run/ldap) */ +// $ldapservers->SetValue($i,'server','host','127.0.0.1'); + +/* The port your LDAP server listens on (no quotes). 389 is standard. */ +// $ldapservers->SetValue($i,'server','port','389'); + +/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin auto-detect it for you. */ +// $ldapservers->SetValue($i,'server','base',array('')); + +/* Three 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 login will be + required to use phpLDAPadmin for this server. + + Choose wisely to protect your authentication information appropriately for your situation. If + you choose 'cookie', your cookie contents will be encrypted using blowfish and the secret your specify + above as session['blowfish']. */ +// $ldapservers->SetValue($i,'server','auth_type','cookie'); + +/* The DN of the user for phpLDAPadmin to bind with. For anonymous binds or 'cookie' or 'session' auth_types, + leave the login_dn and login_pass blank. If you specify a login_attr in conjunction with a cookie or + session auth_type, then you can also specify the login_dn/login_pass here for searching the directory for + users (ie, if your LDAP server does not allow anonymous binds. */ +// $ldapservers->SetValue($i,'login','dn','cn=Manager,dc=example,dc=com'); + +/* Your LDAP password. If you specified an empty login_dn above, this MUST also be blank. */ +// $ldapservers->SetValue($i,'login','pass','secret'); + +/* Use TLS (Transport Layer Security) to connect to the LDAP server. */ +// $ldapservers->SetValue($i,'server','tls',false); + +/* 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 cause phpLDAPadmin to forego some "fancy" features to conserve bandwidth. */ +// $ldapservers->SetValue($i,'server','low_bandwidth',false); + +/* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5, blowfish, crypt or + leave blank for now default algorithm. */ +// $ldapservers->SetValue($i,'appearance','password_hash','md5'); + +/* If you specified 'cookie' or 'session' as the auth_type above, you can optionally specify here an attribute + to use when logging in. If you enter 'uid' and login as 'dsmith', phpLDAPadmin will search for (uid=dsmith) + and log in as that user. Leave blank or specify 'dn' to use full DN for logging in. Note also that if your + LDAP server requires you to login to perform searches, you can enter the DN to use when searching in 'login_dn' + and 'login_pass' above. You may also specify 'string', in which case you can provide a string to use for + logging users in. See 'login_string' directly below. */ +// $ldapservers->SetValue($i,'login','attr','uid'); + +/* 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 "uid=dsmith,ou=People,dc=example,dc=com", then I can specify a string + "uid=,ou=People,dc=example,dc=com" and my users can login with their user names alone, ie: "dsmith" + in this case. */ +// $ldapservers->SetValue($i,'login','string','uid=,ou=People,dc=example,dc=com'); + +/* 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. E.g., set this to 'posixAccount' or 'inetOrgPerson', depending upon your setup. */ +// $ldapservers->SetValue($i,'login','class',''); + +/* Specify true If you want phpLDAPadmin to not display or permit any modification to the LDAP server. */ +// $ldapservers->SetValue($i,'server','read_only',false); + +/* Specify false if you do not want phpLDAPadmin to draw the 'Create new' links in the tree viewer. */ +// $ldapservers->SetValue($i,'appearance','show_create',true); + +/* This feature allows phpLDAPadmin to automatically determine the next available uidNumber for a new entry. */ +// $ldapservers->SetValue($i,'auto_number','enable',true); + +/* 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). */ +// $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'); + +/* 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'; + +/* 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',''); + +/* The password for the dn above. */ +// $ldapservers->SetValue($i,'auto_number','pass',''); + +/* Disable the anonymous login. */ +// $ldapservers->SetValue($i,'login','anon_bind',true); + +/* Use customized page with prefix when available. */ +// $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',''); + +/* The password for the dn above */ +// $ldapservers->SetValue($i,'unique_attrs','pass',''); + +/* 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')); + +/* Set this if you dont want this LDAP server to show in the tree */ +// $ldapservers->SetValue($i,'appearance','visible',true); + +/* This is the time out value in minutes for the server. After as many minutes of inactivity you will be + automatically logged out. If not set, the default value will be ( session_cache_expire()-1 ) */ +// $ldapservers->SetValue($i,'login','timeout',30); + +/* Set this if you want phpldapadmin to perform rename operation on entry which has children. Certain servers are known + to allow it, certain are not */ +// $ldapservers->SetValue($i,'server','branch_rename',false); + +/* 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'] = ''; -$servers[$i]['base'] = 'dc=example,dc=com'; -$servers[$i]['port'] = 389; -$servers[$i]['auth_type'] = 'config'; -$servers[$i]['login_dn'] = ''; -$servers[$i]['login_pass'] = ''; -$servers[$i]['tls'] = false; -$servers[$i]['low_bandwidth'] = false; -$servers[$i]['default_hash'] = 'crypt'; -$servers[$i]['login_attr'] = 'dn'; -$servers[$i]['login_class'] = ''; -$servers[$i]['read_only'] = false; -$servers[$i]['show_create'] = true; -$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_min'] = 1000; -$servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com'; +$ldapservers->SetValue($i,'server','name','LDAP Server'); +$ldapservers->SetValue($i,'server','host','127.0.0.1'); +$ldapservers->SetValue($i,'server','port','389'); +$ldapservers->SetValue($i,'server','base',array('')); +$ldapservers->SetValue($i,'server','auth_type','cookie'); +$ldapservers->SetValue($i,'login','dn',''); +$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,'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','min','1000'); +$ldapservers->SetValue($i,'auto_number','dn',''); +$ldapservers->SetValue($i,'auto_number','pass',''); +$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,'appearance','visible',false); -// If you want to configure more LDAP servers, copy and paste the above (including the "$i++;") - -// The temporary storage directory where we will put jpegPhoto data -// This directory must be readable and writable by your web server -$jpeg_temp_dir = "/tmp"; // Example for Unix systems -//$jpeg_temp_dir = "c:\\temp"; // Example for Windows systems - -/** **/ -/** Appearance and Behavior **/ -/** **/ - -// Set this to true if you want to hide the Request New Feature and Report bugs. -$hide_configuration_management = false; - - -// A format string used to display enties in the tree viewer (left-hand side) -// You can use special tokens to draw the entries as you wish. You can even mix in HTML to format the string -// Here are all the tokens you can use: -// %rdn - draw the RDN of the entry (ie, "cn=Dave") -// %dn - draw the DN of the entry (ie, "cn=Dave,ou=People,dc=example,dc=com" -// %rdnValue - draw the value of the RDN (ie, instead of "cn=Dave", just draw "Dave") -// %[attrname]- draw the value (or values) of the specified attribute. -// examle: %gidNumber -$tree_display_format = '%rdn'; -// -// Examples: -// -// To draw the gidNumber and uidNumber to the right of the RDN in a small, gray font: -//$tree_display_format = '%rdn ( %gidNumber / %uidNumber )'; -// To draw the full DN of each entry: -//$tree_display_format = '%dn'; -// To draw the objectClasses to the right in parenthesis: -//$tree_display_format = '%rdn ( %objectClass )'; -// To draw the user-friendly RDN value (ie, instead of "cn=Dave", just draw "Dave"): -//$tree_display_format = '%rdnValue'; - - -// Aliases and Referrrals -// -// Similar to ldapsearh's -a option, the following options allow you to configure -// how phpLDAPadmin will treat aliases and referrals in the LDAP tree. -// For the following four settings, avaialable options include: -// -// LDAP_DEREF_NEVER - aliases are never dereferenced (eg, the contents of -// the alias itself are shown and not the referenced entry). -// LDAP_DEREF_SEARCHING - aliases should be dereferenced during the search but -// not when locating the base object of the search. -// LDAP_DEREF_FINDING - aliases should be dereferenced when locating the base -// object but not during the search. -// LDAP_DEREF_ALWAYS - aliases should be dereferenced always (eg, the contents -// of the referenced entry is shown and not the aliasing entry) - -// How to handle references and aliases in the search form. See above for options. -$search_deref = LDAP_DEREF_ALWAYS; - -// How to handle references and aliases in the tree viewer. See above for options. -$tree_deref = LDAP_DEREF_NEVER; - -// How to handle references and aliases for exports. See above for options. -$export_deref = LDAP_DEREF_NEVER; - -// How to handle references and aliases when viewing entries. See above for options. -$view_deref = LDAP_DEREF_NEVER; - - -// 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/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 -$anonymous_bind_implies_read_only = true; - -// Set to true if you want phpLDAPadmin to redirect anonymous -// users to a search form with no tree viewer on the left after -// logging in. -$anonymous_bind_redirect_no_tree = false; - -// If you used auth_type 'form' in the servers list, you can adjust how long the cookie will last -// (default is 0 seconds, which expires when you close the browser) -$cookie_time = 0; // seconds - -// How many pixels wide do you want your left frame view (for the tree browser) -$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; - -// By default, when searching you may display a list or a table of results. -// Set this to 'table' to see table formatted results. -// Set this to 'list' to see "Google" style formatted search results. -$default_search_display = 'list'; - -// If true, display all password hash values as "******". Note that clear-text -// passwords will always be displayed as "******", regardless of this setting. -$obfuscate_password_display = false; - -/** **/ -/** Simple Search Form Config **/ -/** **/ - -// 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 corresponding -// list below ($search_attributes_display) -$search_attributes = "uid, cn, gidNumber, objectClass, telephoneNumber, mail, street"; - -// This list corresponds 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, Object Class, Phone Number, Email, Address"; - -// The list of attributes to display in each search result entry. -// Note that you can add * to the list to display all attributes -$search_result_attributes = "cn, sn, uid, postalAddress, telephoneNumber"; - -// You can re-arrange the order of the search criteria on the simple search form by modifying this array -// You cannot however change the names of the criteria. Criteria names will be translated at run-time. -$search_criteria_options = array( "equals", "starts with", "contains", "ends with", "sounds like" ); - -// If you want certain attributes to be editable as multi-line, include them in this list -// A multi-line textarea will be drawn instead of a single-line text field -$multi_line_attributes = array( "postalAddress", "homePostalAddress", "personalSignature" ); - -// A list of syntax OIDs which support multi-line attribute values: -$multi_line_syntax_oids = array( - // octet string syntax OID: - "1.3.6.1.4.1.1466.115.121.1.40", - // postal address syntax OID: - "1.3.6.1.4.1.1466.115.121.1.41" ); +/* If you want to configure more LDAP servers, copy and paste the above (including the "$i++;") + Dont forget to change 'visible' to true! */ /** **/ /** User-friendly attribute translation **/ /** **/ -$friendly_attrs = array(); +/* Use this array to map attribute names to user friendly names. For example, if you + don't want to see "facsimileTelephoneNumber" but rather "Fax". */ -// Use this array to map attribute names to user friendly names. For example, if you -// don't want to see "facsimileTelephoneNumber" but rather "Fax". +$friendly_attrs = array(); $friendly_attrs[ 'facsimileTelephoneNumber' ] = 'Fax'; $friendly_attrs[ 'telephoneNumber' ] = 'Phone'; +/** **/ +/** Support for attrs display order **/ +/** **/ + +/* Use this array if you want to have your attributes displayed in a specific order. + You can use default attribute names or their fridenly names. + For example, "sn" will be displayed right after "givenName". All the other 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" +// ); + /** **/ /** Hidden attributes **/ /** **/ -// You may want to hide certain attributes from being displayed in the editor screen -// Do this by adding the desired attributes to this list (and uncomment it). This -// only affects the editor screen. Attributes will still be visible in the schema -// browser and elsewhere. An example is provided below: -// NOTE: The user must be able to read the hidden_except_dn entry to be excluded. +/* You may want to hide certain attributes from being displayed in the editor screen + Do this by adding the desired attributes to this list (and uncomment it). This + only affects the editor screen. Attributes will still be visible in the schema + browser and elsewhere. An example is provided below: + NOTE: The user must be able to read the hidden_except_dn entry to be excluded. */ //$hidden_attrs = array( 'jpegPhoto', 'objectClass' ); //$hidden_except_dn = "cn=PLA UnHide,ou=Groups,c=AU"; -// 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' ); +/* 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'); /** **/ /** Read-only attributes **/ /** **/ -// You may want to phpLDAPadmin to display certain attributes as read only, meaning -// that users will not be presented a form for modifying those attributes, and they -// will not be allowed to be modified on the "back-end" either. You may configure -// this list here: -// NOTE: The user must be able to read the read_only_except_dn entry to be excluded. +/* You may want to phpLDAPadmin to display certain attributes as read only, meaning + that users will not be presented a form for modifying those attributes, and they + will not be allowed to be modified on the "back-end" either. You may configure + this list here: + NOTE: The user must be able to read the read_only_except_dn entry to be excluded. */ //$read_only_attrs = array( 'objectClass' ); //$read_only_except_dn = "cn=PLA ReadWrite,ou=Groups,c=AU"; -// An example of how to specify multiple read-only attributes: +/* An example of how to specify multiple read-only attributes: */ // $read_only_attrs = array( 'jpegPhoto', 'objectClass', 'someAttribute' ); /** **/ /** Unique attributes **/ /** **/ -// You may want phpLDAPadmin to enforce some attributes to have unique values (ie: -// not belong to other entries in your tree. This (together with "unique_attrs_dn" -// and "unique_attrs_dn_pass" option will not let updates to occur with other attributes -// have the same value. -// NOTE: Currently the unique_attrs is NOT enforced when copying a dn. (Need to present a user with -// the option of changing the unique attributes. + +/* You may want phpLDAPadmin to enforce some attributes to have unique values (ie: + not belong to other entries in your tree. This (together with "unique_attrs_dn" + and "unique_attrs_dn_pass" option will not let updates to occur with other attributes + have the same value. + NOTE: Currently the unique_attrs is NOT enforced when copying a dn. (Need to present a user with + the option of changing the unique attributes. */ //$unique_attrs = array('uid','uidNumber','mail'); /** **/ /** Predefined Queries (canned views) **/ /** **/ -// To make searching easier, you may setup predefined queries below (activate the lines by removing "//") +/* To make searching easier, you may setup predefined queries below: */ $q=0; $queries = array(); -$queries[$q]['name'] = 'Samba Users'; /* The name that will appear in the simple search form */ -$queries[$q]['server'] = '0'; /* The ldap server to query, must be defined in the $servers list above */ -$queries[$q]['base'] = 'dc=example,dc=com'; /* The base to search on */ -$queries[$q]['scope'] = 'sub'; /* The search scope (sub, base, one) */ -$queries[$q]['filter'] = '(&(|(objectClass=sambaAccount)(objectClass=sambaSamAccount))(objectClass=posixAccount)(!(uid=*$)))'; - /* The LDAP filter to use */ -$queries[$q]['attributes'] = 'uid, smbHome, uidNumber'; - /* The attributes to return */ -// Add more pre-defined queries by copying the text below +/* The name that will appear in the simple search form */ +$queries[$q]['name'] = 'User List'; + +/* The base to search on */ +$queries[$q]['base'] = 'dc=example,dc=com'; + +/* The search scope (sub, base, one) */ +$queries[$q]['scope'] = 'sub'; + +/* The LDAP filter to use */ +$queries[$q]['filter'] = '(&(objectClass=posixAccount)(uid=*))'; + +/* The attributes to return */ +$queries[$q]['attributes'] = 'cn, uid, homeDirectory'; + +/* If you want to configure more pre-defined queries, copy and paste the above (including the "$q++;") */ +$q++; +$queries[$q]['name'] = 'Samba Users'; +$queries[$q]['base'] = 'dc=example,dc=com'; +$queries[$q]['scope'] = 'sub'; +$queries[$q]['filter'] = '(&(|(objectClass=sambaAccount)(objectClass=sambaSamAccount))(objectClass=posixAccount)(!(uid=*$)))'; +$queries[$q]['attributes'] = 'uid, smbHome, uidNumber'; + $q++; $queries[$q]['name'] = 'Samba Computers'; -$queries[$q]['server'] = '0'; $queries[$q]['base'] = 'dc=example,dc=com'; $queries[$q]['scope'] = 'sub'; $queries[$q]['filter'] = '(&(objectClass=sambaAccount)(uid=*$))'; $queries[$q]['attributes'] = 'uid, homeDirectory'; - - ?> diff --git a/config_default.php b/config_default.php new file mode 100644 index 0000000..7a5bf7b --- /dev/null +++ b/config_default.php @@ -0,0 +1,376 @@ +custom = new stdClass; + $this->default = new stdClass; + + ## Appearance Attributes + /** Anonymous implies read only + * 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 + */ + $this->default->appearance['anonymous_bind_implies_read_only'] = array( + 'desc'=>'Display as read only if user logs in with anonymous bind', + 'default'=>true); +//$anonymous_bind_implies_read_only = true; + + /* Anonymous redirect + * Set to true if you want phpLDAPadmin to redirect anonymous + * users to a search form with no tree viewer on the left after + * logging in. + */ + $this->default->appearance['anonymous_bind_redirect_no_tree'] = array( + 'desc'=>'Redirect user to search form if anonymous', + 'default'=>false); +//$anonymous_bind_redirect_no_tree = false; + + $this->default->appearance['date'] = array( + 'desc'=>'Date format whenever dates are shown', + 'default'=>'%A %e %B %Y'); +//$date_format = "%A %e %B %Y"; + + $this->default->appearance['hide_configuration_management'] = array( + 'desc'=>'Hide the Sourceforge related links', + 'default'=>false); +//$hide_configuration_management = false; + + /** Language + * 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/en.php for an example. + */ + $this->default->appearance['language'] = array( + 'desc'=>'Language', + 'default'=>'auto'); +//$language = 'auto'; + + /** Mass Delete + * 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 + */ + $this->default->appearance['mass_delete'] = array( + 'desc'=>'Enable mass delete in tree viewer', + 'default'=>false); +//$enable_mass_delete = false; + + /** + * If you want certain attributes to be editable as multi-line, include them in this list + * A multi-line textarea will be drawn instead of a single-line text field + */ + $this->default->appearance['multi_line_attributes'] = array( + 'desc'=>'Attributes to show as multiline attributes', + 'default'=>array("postalAddress","homePostalAddress","personalSignature")); +//$multi_line_attributes = array( "postalAddress", "homePostalAddress", "personalSignature" ); + + /** + * A list of syntax OIDs which support multi-line attribute values: + */ + $this->default->appearance['multi_line_syntax_oids'] = array( + 'desc'=>'Attributes to show as multiline attributes', + 'default'=>array( + // octet string syntax OID: + "1.3.6.1.4.1.1466.115.121.1.40", + // postal address syntax OID: + "1.3.6.1.4.1.1466.115.121.1.41")); +//$multi_line_syntax_oids ... + + /** Obfuscate Password + * If true, display all password hash values as "******". Note that clear-text + * passwords will always be displayed as "******", regardless of this setting. + */ + $this->default->appearance['obfuscate_password_display'] = array( + 'desc'=>'Obfuscate the display of passwords', + 'default'=>false); +//$obfuscate_password_display = false; + + $this->default->appearance['show_clear_password'] = array( + 'desc'=>'Whether to show clear passwords if we dont obfuscate them', + 'default'=>false); + + $this->default->appearance['page_title'] = array( + 'desc'=>'Change the page title to this text', + 'default'=>''); + + $this->default->appearance['show_hints'] = array( + 'desc'=>'Show helpful hints', + 'default'=>true); +//$show_hints = true; // set to false to disable hints + + /** Tree display + * A format string used to display enties in the tree viewer (left-hand side) + * You can use special tokens to draw the entries as you wish. You can even mix in HTML to format the string + * Here are all the tokens you can use: + * %rdn - draw the RDN of the entry (ie, "cn=Dave") + * %dn - draw the DN of the entry (ie, "cn=Dave,ou=People,dc=example,dc=com" + * %rdnValue - draw the value of the RDN (ie, instead of "cn=Dave", just draw "Dave") + * %[attrname]- draw the value (or values) of the specified attribute. + * example: %gidNumber + * + * Examples: + * + * To draw the gidNumber and uidNumber to the right of the RDN in a small, gray font: + * '%rdn ( %gidNumber / %uidNumber )' + * To draw the full DN of each entry: + * '%dn' + * To draw the objectClasses to the right in parenthesis: + * '%rdn ( %objectClass )' + * To draw the user-friendly RDN value (ie, instead of "cn=Dave", just draw "Dave"): + * '%rdnValue' + */ + $this->default->appearance['tree_display_format'] = array( + 'desc'=>'LDAP attribute to show in the tree', + 'default'=>'%rdn'); +//$tree_display_format = '%rdn'; + + $this->default->appearance['tree_width'] = array( + 'desc'=>'Pixel width of the left frame view (tree browser)', + 'default'=>320); +//$tree_width = 320; // pixels + + /** Caching + */ + $this->default->cache['schema'] = array( + 'desc'=>'Cache schema activity', + 'default'=>true); + + $this->default->cache['template'] = array( + 'desc'=>'Cache Template configuration', + 'default'=>true); + + /** Aliases and Referrrals + * Similar to ldapsearch's -a option, the following options allow you to configure + * how phpLDAPadmin will treat aliases and referrals in the LDAP tree. + * For the following four settings, avaialable options include: + * + * LDAP_DEREF_NEVER - aliases are never dereferenced (eg, the contents of + * the alias itself are shown and not the referenced entry). + * LDAP_DEREF_SEARCHING - aliases should be dereferenced during the search but + * not when locating the base object of the search. + * LDAP_DEREF_FINDING - aliases should be dereferenced when locating the base + * object but not during the search. + * LDAP_DEREF_ALWAYS - aliases should be dereferenced always (eg, the contents + * of the referenced entry is shown and not the aliasing entry) + */ + $this->default->deref['export'] = array( + 'desc'=>'', + 'default'=>LDAP_DEREF_NEVER); +//$export_deref = LDAP_DEREF_NEVER; + + $this->default->deref['search'] = array( + 'desc'=>'', + 'default'=>LDAP_DEREF_ALWAYS); +//$search_deref = LDAP_DEREF_ALWAYS; + + $this->default->deref['tree'] = array( + 'desc'=>'', + 'default'=>LDAP_DEREF_NEVER); +//$tree_deref = LDAP_DEREF_NEVER; + + $this->default->deref['view'] = array( + 'desc'=>'', + 'default'=>LDAP_DEREF_NEVER); +//$view_deref = LDAP_DEREF_NEVER; + + ## Debug Attributes + $this->default->debug['level'] = array( + 'desc'=>'Debug level verbosity', + 'default'=>0); +//$debug_level + + $this->default->debug['syslog'] = array( + 'desc'=>'Whether to send debug messages to syslog', + 'default'=>false); +//$use_syslog + + /** Temp Directories + * This directory must be readable and writable by your web server + */ + $this->default->jpeg['tmpdir'] = array( + 'desc'=>'Temporary directory for jpegPhoto data', + 'default'=>'/tmp'); +//$jpeg_temp_dir = "/tmp"; + + $this->default->jpeg['tmp_keep_time'] = array( + 'desc'=>'Time in seconds to keep jpegPhoto temporary files in the temp directory', + 'default'=>120); +//$jpeg_tmp_keep_time = 120; // seconds + + ## Session Attributes + /** Cookie Encryption + * phpLDAPadmin can encrypt the content of sensitive cookies if you set this to a big random string. + */ + $this->default->session['blowfish'] = array( + 'desc'=>'Blowfish key to encrypt cookie details', + 'default'=>null); +//$blowfish_secret = ''; + + /** Cookie Time + * If you used auth_type 'form' in the servers list, you can adjust how long the cookie will last + * (default is 0 seconds, which expires when you close the browser) + */ + $this->default->session['cookie_time'] = array( + 'desc'=>'Time in seconds for the life of cookies', + 'default'=>0); +//$cookie_time = 0; + + ## Password Generation + $this->default->password['length'] = array( + 'desc'=>'Length of autogenerated password', + 'default'=>8); + + $this->default->password['numbers'] = array( + 'desc'=>'Number of numbers required in the password', + 'default'=>2); + + $this->default->password['lowercase'] = array( + 'desc'=>'Number of lowercase letters required in the password', + 'default'=>2); + + $this->default->password['uppercase'] = array( + 'desc'=>'Number of uppercase letters required in the password', + 'default'=>2); + + $this->default->password['punctuation'] = array( + 'desc'=>'Number of punctuation letters required in the password', + 'default'=>2); + + $this->default->password['use_similar'] = array( + 'desc'=>'Whether to use similiar characters', + 'default'=>true); + + ## Template Engine Configuration + $this->default->template_engine['enable'] = array( + 'desc'=>'Use templates from parsed by the template engine', + 'default'=>true); + + $this->default->template_engine['disable_old'] = array( + 'desc'=>'Disable access to old templates', + 'default'=>true); + + /** Search display + * By default, when searching you may display a list or a table of results. + * Set this to 'table' to see table formatted results. + * Set this to 'list' to see "Google" style formatted search results. + */ + $this->default->search['display'] = array( + 'desc'=>'Display a list or table of search results', + 'default'=>'list'); +//$default_search_display = 'list'; + + $this->default->search['size_limit'] = array( + 'desc'=>'Limit the size of searchs on the search page', + 'default'=>50); +//$search_result_size_limit = 50; + + /** + * 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 corresponding + * list below ($search_attributes_display) + */ + $this->default->search['attributes'] = array( + 'desc'=>'Attributes to include in the drop down menu of the simple search form (comma separated)', + 'default'=>array('uid','cn','gidNumber','objectClass','telephoneNumber','mail','street')); +//$search_attributes ... + + /** + * You can re-arrange the order of the search criteria on the simple search form by modifying this array + * You cannot however change the names of the criteria. Criteria names will be translated at run-time. + */ + $this->default->search['criteria_options'] = array( + 'desc'=>'Rearrange the order of the search criteria', + 'default'=>array("equals","starts with","contains","ends with","sounds like")); +//$search_criteria_options ... + + /** + * The list of attributes to display in each search result entry. + * Note that you can add * to the list to display all attributes + */ + $this->default->search['result_attributes'] = array( + 'desc'=>'List of attributes to display in each search result entry', + 'default'=>array('cn','sn','uid','postalAddress','telephoneNumber')); +//$search_result_attributes ... + } + + function GetValue($key,$index) { + + $value = null; + + if (! isset($this->default->$key)) + pla_error("A call was made to GetValue requesting [$key] that isnt predefined."); + else + $default = $this->default->$key; + + if (! isset($default[$index])) + pla_error("Requesting a index [$index] that isnt predefined."); + else + $default = $default[$index]; + + if (isset($default['default'])) + $value = $default['default']; + + if (isset($this->custom->$key)) { + $custom = $this->custom->$key; + + if (isset($custom[$index])) + $value = $custom[$index]; + } + + //print "Returning [$value] for key [$key], index [$index]
      "; + return $value; + } + + /** + * Function to check and warn about any unusual defined variables. + */ + function CheckCustom() { + if (isset($this->custom)) { + foreach ($this->custom as $masterkey => $masterdetails) { + + if (isset($this->default->$masterkey)) { + + if (! is_array($masterdetails)) + pla_error("Error in configuration file, [$masterdetails] should be an ARRAY."); + + foreach ($masterdetails as $key => $value) { + # Test that the key is correct. + if (! in_array($key,array_keys($this->default->$masterkey))) + pla_error("Error in configuration file, [$key] has not been defined as a PLA configurable variable."); + + # Test if its should be an array or not. + if (is_array($this->default->{$masterkey}[$key]['default']) && ! is_array($value)) + pla_error("Error in configuration file, {$masterkey}['$key'] SHOULD be an array of values."); + + if (! is_array($this->default->{$masterkey}[$key]['default']) && is_array($value)) + pla_error("Error in configuration file, {$masterkey}['$key'] should NOT be an array of values."); + } + + } else { + pla_error("Error in configuration file, [$masterkey] has not been defined as a PLA MASTER configurable variable."); + } + } + } + } +} + +# Define our configuration variable. +$config = new Config; +require (CONFDIR.'config.php'); +?> diff --git a/copy.php b/copy.php index a5db1b5..babd0f4 100644 --- a/copy.php +++ b/copy.php @@ -1,186 +1,220 @@ Instance($server_id_src); +$ldapserver_dst = $ldapservers->Instance($server_id_dst); -check_server_id( $source_server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $source_server_id ) or pla_error( $lang['not_enough_login_info'] ); -check_server_id( $dest_server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $dest_server_id ) or pla_error( $lang['not_enough_login_info'] ); +if ($ldapserver_dst->isReadOnly()) + pla_error($lang['copy_server_read_only']); + +if (! $ldapserver_src->haveAuthInfo() || ! $ldapserver_dst->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); + +$dn_src = $_POST['old_dn']; +$dn_dst = $_POST['new_dn']; +$do_recursive = (isset($_POST['recursive']) && $_POST['recursive'] == 'on') ? true : false; +$do_remove = (isset($_POST['remove']) && $_POST['remove'] == 'yes') ? true : false; +$encoded_dn = rawurlencode($dn_src); include './header.php'; -/* Error checking */ -if( 0 == strlen( trim( $dest_dn ) ) ) - pla_error( $lang['copy_dest_dn_blank'] ); -if( pla_compare_dns( $source_dn,$dest_dn ) == 0 && $source_server_id == $dest_server_id ) - pla_error( $lang['copy_source_dest_dn_same'] ); -if( dn_exists( $dest_server_id, $dest_dn ) ) - pla_error( sprintf( $lang['copy_dest_already_exists'], pretty_print_dn( $dest_dn ) ) ); -if( ! dn_exists( $dest_server_id, get_container( $dest_dn ) ) ) - pla_error( sprintf( $lang['copy_dest_container_does_not_exist'], pretty_print_dn( get_container($dest_dn) ) ) ); +# Error checking +if (0 == strlen(trim($dn_dst))) + pla_error($lang['copy_dest_dn_blank']); -if( $do_recursive ) { - $filter = isset( $_POST['filter'] ) ? $_POST['filter'] : '(objectClass=*)'; - // build a tree similar to that of the tree browser to give to r_copy_dn +if (pla_compare_dns($dn_src,$dn_dst) == 0 && $server_id_src == $server_id_dst) + pla_error($lang['copy_source_dest_dn_same']); + +if (dn_exists($ldapserver_dst,$dn_dst)) + pla_error(sprintf($lang['copy_dest_already_exists'],pretty_print_dn($dn_dst))); + +if (! dn_exists($ldapserver_dst,get_container($dn_dst))) + pla_error(sprintf($lang['copy_dest_container_does_not_exist'],pretty_print_dn(get_container($dn_dst)))); + +if ($do_recursive) { + $filter = isset($_POST['filter']) ? $_POST['filter'] : '(objectClass=*)'; + + # Build a tree similar to that of the tree browser to give to r_copy_dn $snapshot_tree = array(); - echo "\n"; - echo "

      ". $lang['copy_copying'] . htmlspecialchars( $source_dn ) . "

      \n"; - echo "

      " . $lang['copy_recursive_copy_progress'] ."

      \n"; - echo "

      "; - echo "\n"; - echo $lang['copy_building_snapshot']; - flush(); - build_tree( $source_server_id, $source_dn, $snapshot_tree, $filter ); - echo " " . $lang['success'] . "
      \n"; + print ''; + printf('

      %s%s

      ',$lang['copy_copying'],htmlspecialchars($dn_src)); + printf('

      %s

      ',$lang['copy_recursive_copy_progress']); + print '

      '; + print ''; + print $lang['copy_building_snapshot']; + flush(); - // prevent script from bailing early on a long delete - @set_time_limit( 0 ); + $snapshot_tree = build_tree($ldapserver_src,$dn_src,array(),$filter); + printf('%s
      ',$lang['success']); + flush(); + + # Prevent script from bailing early on a long delete + @set_time_limit(0); + + $copy_result = r_copy_dn($ldapserver_src,$ldapserver_dst,$snapshot_tree,$dn_src,$dn_dst); + print '
      '; - $copy_result = r_copy_dn( $source_server_id, $dest_server_id, $snapshot_tree, $source_dn, $dest_dn ); - echo "
      \n"; } else { - $copy_result = copy_dn( $source_server_id, $source_dn, $dest_server_id, $dest_dn ); + $copy_result = copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst); } -if( $copy_result ) -{ - $edit_url="edit.php?server_id=$dest_server_id&dn=" . rawurlencode( $dest_dn ); - $new_rdn = get_rdn( $dest_dn ); - $container = get_container( $dest_dn ); +if ($copy_result) { + $edit_url = sprintf('edit.php?server_id=%s&dn=%s',$server_id_dst,rawurlencode($dn_dst)); + $new_rdn = get_rdn($dn_dst); + $container = get_container($dn_dst); - if( array_key_exists( 'tree', $_SESSION ) ) - { - // do we not have a tree and tree icons yet? Build a new ones. - initialize_session_tree(); + if (array_key_exists('tree',$_SESSION)) { + # do we not have a tree and tree icons yet? Build a new ones. + initialize_session_tree(); $tree = $_SESSION['tree']; $tree_icons = $_SESSION['tree_icons']; - if( isset( $tree[$dest_server_id][$container] ) ) - { - $tree[$dest_server_id][$container][] = $dest_dn; - sort( $tree[ $dest_server_id ][ $container ] ); - $tree_icons[$dest_server_id][$dest_dn] = get_icon( $dest_server_id, $dest_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(); } } +?> - ?> - +
      + %s',$lang['copy_successful_like_to'],$edit_url,$lang['copy_view_new_entry']) ?> +
      + + + + + + + + -
      -
      - " . $lang['copy_view_new_entry'] .""?> -
      -
      -
      -
      -
      - - - server_id,$ldapserver_dst->server_id,serialize($tree),$root_dn,$dn_dst),2); + global $lang; - echo "". $lang['copy_copying'] . htmlspecialchars( $root_dn ) . "..."; - flush(); - $copy_result = copy_dn( $source_server_id, $root_dn, $dest_server_id, $dest_dn ); - if( ! $copy_result ) { + printf('%s %s...',$lang['copy_copying'],htmlspecialchars($root_dn)); + flush(); + + $copy_result = copy_dn($ldapserver_src,$ldapserver_dst,$root_dn,$dn_dst); + + if (! $copy_result) return false; - } - echo "".$lang['success']."
      \n"; + printf('%s
      ',$lang['success']); flush(); - $children = isset( $tree[ $root_dn ] ) ? $tree[ $root_dn ] : null; - if( is_array( $children ) && count( $children ) > 0 ) - { - foreach( $children as $child_dn ) { - $child_rdn = get_rdn( $child_dn ); - $new_dest_dn = $child_rdn . ',' . $dest_dn; - r_copy_dn( $source_server_id, $dest_server_id, $tree, $child_dn, $new_dest_dn ); + $children = isset($tree[$root_dn]) ? $tree[$root_dn] : null; + if (is_array($children) && count($children) > 0) { + foreach($children as $child_dn) { + $child_rdn = get_rdn($child_dn); + $new_dest_dn = sprintf('%s,%s',$child_rdn,$dn_dst); + r_copy_dn($ldapserver_src,$ldapserver_dst,$tree,$child_dn,$new_dest_dn); } - } - else - { + + } else { return true; } return true; } -function copy_dn( $source_server_id, $source_dn, $dest_server_id, $dest_dn ) -{ - global $ds, $lang; +function copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst) { + debug_log(sprintf('copy_dn: Entered with (%s,%s,%s,%s)', + $ldapserver_src->server_id,$ldapserver_dst->server_id,$dn_src,$dn_dst),2); - $ds = pla_ldap_connect( $dest_server_id ); - pla_ldap_connection_is_error( $ds ); + global $lang; - $attrs = get_object_attrs( $source_server_id, $source_dn ); - $new_entry = $attrs; - // modify the prefix-value (ie "bob" in cn=bob) to match the destination DN's value. - $rdn_attr = substr( $dest_dn, 0, strpos( $dest_dn, '=' ) ); - $rdn_value = get_rdn( $dest_dn ); - $rdn_value = substr( $rdn_value, strpos( $rdn_value, '=' ) + 1 ); - $new_entry[ $rdn_attr ] = $rdn_value; - // don't need a dn attribute in the new entry - unset( $new_entry['dn'] ); + $new_entry = get_object_attrs($ldapserver_src,$dn_src); - // Check the user-defined custom call back first - if( true === preEntryCreate( $dest_server_id, $dest_dn, $new_entry ) ) { - $add_result = @ldap_add( $ds, $dest_dn, $new_entry ); - if( ! $add_result ) { - postEntryCreate( $dest_server_id, $dest_dn, $new_entry ); - echo "


      "; - pla_error( $lang['copy_failed'] . $dest_dn, ldap_error( $ds ), ldap_errno( $ds ) ); - } + # modify the prefix-value (ie "bob" in cn=bob) to match the destination DN's value. + $rdn_attr = substr($dn_dst,0,strpos($dn_dst,'=')); + $rdn_value = get_rdn($dn_dst); + $rdn_value = substr($rdn_value,strpos($rdn_value,'=') + 1); + $new_entry[$rdn_attr] = $rdn_value; + + # don't need a dn attribute in the new entry + unset($new_entry['dn']); + + # Check the user-defined custom call back first + if (true === run_hook('pre_entry_create', + array ('server_id'=>$ldapserver_dst->server_id,'dn'=>$dn_dst,'attrs'=>$new_entry))) { + + $add_result = @ldap_add($ldapserver_dst->connect(),$dn_dst,$new_entry); + if (! $add_result) { + run_hook('post_entry_create',array('server_id'=>$ldapserver_dst->server_id, + 'dn'=>$dn_dst,'attrs'=>$new_entry)); + + print '


      '; + pla_error($lang['copy_failed'] . $dn_dst,ldap_error($ldapserver_dst->connect()),ldap_errno($ldapserver_dst->connect())); + } + + return $add_result; - return $add_result; } else { - return false; + return false; } } -function build_tree( $source_server_id, $root_dn, &$tree, $filter='(objectClass=*)' ) -{ - $children = get_container_contents( $source_server_id, $root_dn, 0, $filter ); - if( is_array( $children ) && count( $children ) > 0 ) - { - $tree[ $root_dn ] = $children; - foreach( $children as $child_dn ) - build_tree( $source_server_id, $child_dn, $tree, $filter ); +/** + * @param object $ldapserver + * @param dn $dn + * @param array $tree + * @param string $filter + */ +function build_tree($ldapserver,$dn,$tree,$filter='(objectClass=*)') { + debug_log(sprintf('build_tree: Entered with (%s,%s,%s,%s)', + $ldapserver->server_id,$dn,serialize($tree),$filter),2); + + $children = get_container_contents($ldapserver,$dn,0,$filter); + + if (is_array($children) && count($children) > 0) { + $tree[$dn] = $children; + foreach ($children as $child_dn) + $tree = build_tree($ldapserver,$child_dn,$tree,$filter); } + + debug_log(sprintf('build_tree: Returning (%s)',serialize($tree)),1); + return $tree; } +?> diff --git a/copy_form.php b/copy_form.php index 555537e..07a45ee 100644 --- a/copy_form.php +++ b/copy_form.php @@ -1,81 +1,78 @@ isReadOnly()) + pla_error($lang['no_updates_in_read_only_mode']); +if (! $ldapserver->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); + $dn = $_GET['dn'] ; + $encoded_dn = rawurlencode( $dn ); -$server_id = $_GET['server_id']; $rdn = get_rdn( $dn ); $container = get_container( $dn ); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id_underline'] . htmlspecialchars( $server_id ) ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); +$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 ); -$attrs = get_object_attrs( $server_id, $dn ); -$server_name = $servers[$server_id]['name']; - -$select_server_html = ""; -if (count($servers)>1){ - $select_server_html .= ''; -} else { - $server = reset($servers); - if( $server['host'] ) - $select_server_html .= '' . - '' . $server['name'] . ''; -} - -$children = get_container_contents( $server_id, $dn ); - -include './header.php'; +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 ) { ?> - + //--> + +

      -

      :     :

      +

      : name; ?>     :

      :

      +
      - + + @@ -94,8 +91,17 @@ if( is_array( $children ) && count( $children ) > 0 ) { ?> + + + + + + + + - @@ -103,14 +109,13 @@ if( is_array( $children ) && count( $children ) > 0 ) { ?> - +GetValue('appearance','show_hints')) {?> diff --git a/create.php b/create.php index 36aee34..6c46765 100644 --- a/create.php +++ b/create.php @@ -1,11 +1,11 @@ isReadOnly()) + pla_error($lang['no_updates_in_read_only_mode']); +if (! $ldapserver->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); $new_dn = isset( $_POST['new_dn'] ) ? $_POST['new_dn'] : null; -$encoded_dn = rawurlencode( $new_dn ); -$server_id = $_POST['server_id']; -$vals = isset( $_POST['vals'] ) ? $_POST['vals'] : array(); -$attrs = isset( $_POST['attrs'] ) ? $_POST['attrs'] : array(); $required_attrs = isset( $_POST['required_attrs'] ) ? $_POST['required_attrs'] : false; $object_classes = unserialize( rawurldecode( $_POST['object_classes'] ) ); $redirect = isset( $_POST['redirect'] ) ? $_POST['redirect'] : false; + +$encoded_dn = rawurlencode( $new_dn ); $container = get_container( $new_dn ); -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); +// 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']); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); + foreach ($_POST['presubmit'] as $attr) { + $_POST['attrs'][] = $attr; + $_POST['form'][$attr] = $templates->EvaluateDefault($ldapserver,$template['attribute'][$attr]['presubmit'],$_POST['container']); + $_POST['vals'][] = $_POST['form'][$attr]; + } + + # @todo: This section needs to be cleaned up, and will be when the old templates are removed. In the mean time... + # Rebuild the $_POST['attrs'] & $_POST['vals'], as they can be inconsistent. + unset($_POST['attrs']); + unset($_POST['vals']); + foreach ($_POST['form'] as $attr => $val) { + $_POST['attrs'][] = $attr; + $_POST['vals'][] = $val; + } +} + +$vals = isset( $_POST['vals'] ) ? $_POST['vals'] : array(); +$attrs = isset( $_POST['attrs'] ) ? $_POST['attrs'] : array(); // build the new entry $new_entry = array(); @@ -40,26 +65,40 @@ 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; + $new_entry[ $attr ][] = $val; } } if( isset( $attrs ) && is_array( $attrs ) ) { foreach( $attrs as $i => $attr ) { - if( is_attr_binary( $server_id, $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 { - $val = isset( $vals[$i] ) ? $vals[$i] : ''; - if( '' !== trim($val) ) - $new_entry[ $attr ][] = $val; + 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; + } } } } @@ -71,78 +110,81 @@ if( ! in_array( 'top', $new_entry['objectClass'] ) ) foreach( $new_entry as $attr => $vals ) { // Check to see if this is a unique Attribute - if( $badattr = checkUniqueAttr( $server_id, $new_dn, $attr, $vals ) ) { - $search_href='search.php?search=true&form=advanced&server_id=' . $server_id . '&filter=' . $attr . '=' . $badattr; - pla_error(sprintf( $lang['unique_attr_failed'] , $attr,$badattr,$new_dn,$search_href ) ); + if( $badattr = checkUniqueAttr( $ldapserver, $new_dn, $attr, $vals ) ) { + $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,$new_dn,$search_href ) ); } - if( ! is_attr_binary( $server_id, $attr ) ) + 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; + $new_entry[ $attr ][ $i ] = $v; + + else + $new_entry[ $attr ] = $vals; } //echo "
      "; var_dump( $new_dn );print_r( $new_entry ); echo "
      "; -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); - // Check the user-defined custom call back first -if( true === preEntryCreate( $server_id, $new_dn, $new_entry ) ) - $add_result = @ldap_add( $ds, $new_dn, $new_entry ); -else - exit; -if( $add_result ) -{ - postEntryCreate( $server_id, $new_dn, $new_entry ); - if( $redirect ) - $redirect_url = $redirect; - else - $redirect_url = "edit.php?server_id=$server_id&dn=" . rawurlencode( $new_dn ); +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( array_key_exists( 'tree', $_SESSION ) ) - { +else { + pla_error( $lang['create_could_not_add'] ); + exit; +} + +if( $add_result ) { + run_hook ( 'post_entry_create', array ( 'server_id' => $ldapserver->server_id, 'dn' => $new_dn, 'attrs' => $new_entry ) ); + + if ($redirect) + $redirect_url = $redirect; + + else + $redirect_url = sprintf('edit.php?server_id=%s&dn=%s',$ldapserver->server_id,rawurlencode($new_dn)); + + if( array_key_exists( 'tree', $_SESSION ) ) { $tree = $_SESSION['tree']; $tree_icons = $_SESSION['tree_icons']; - if( isset( $tree[$server_id][$container] ) ) { - $tree[$server_id][$container][] = $new_dn; - sort( $tree[$server_id][$container] ); - $tree_icons[$server_id][$new_dn] = get_icon( $server_id, $new_dn ); + 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(); } - ?> + - - - + server_id][$container]) || in_array($new_dn,$ldapserver->getBaseDN())) { ?> - + + - + + + + . + - connect() ), ldap_errno( $ldapserver->connect() ) ); +} ?> diff --git a/create_form.php b/create_form.php index 12c420f..f2444b9 100644 --- a/create_form.php +++ b/create_form.php @@ -1,49 +1,32 @@ isReadOnly() ) + pla_error( $lang['no_updates_in_read_only_mode'] ); +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); -$server_id = $_REQUEST['server_id']; $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : 1; // defaults to 1 $container = $_REQUEST['container']; -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - -check_server_id( $server_id ) or pla_error( $lang['bad_server_id_underline'] . htmlspecialchars( $server_id ) ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); -$server_name = $servers[$server_id]['name']; - -// build the server drop-down html -$server_menu_html = ''; -if (count($servers)>1){ - $server_menu_html .= ''; -} else { - $server = reset($servers); - if( $server['host'] ) - $server_menu_html .= '' . - '' . $server['name'] . ''; -} +$server_menu_html = server_select_list($ldapserver->server_id,true); include './header.php'; ?> @@ -51,76 +34,142 @@ include './header.php'; ?>

      -

      - +

      + +
      : -
      :
      + () +
      - - - + + + - + + + +
      :
      - : - - - - - -
      - - $template ) { - $i++; - // Balance the columns properly - if( ( count( $templates ) % 2 == 0 && $i == intval( $count / 2 ) ) || - ( count( $templates ) % 2 == 1 && $i == intval( $count / 2 ) + 1 ) ) - echo "
      "; - // 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; - } - - ?> - - - - - - -
      /> - -
      -
      +
      : + + + + - - - - -
      + + +GetValue('template_engine','enable')) { + $template_xml = new Templates($ldapserver->server_id); + + if ($config->GetValue('template_engine','disable_old')) + $templates = $template_xml->_template; + + else + $templates = array_merge($template_xml->_template,$templates); + } + + # Remove non-visable templates. + foreach ($templates as $index => $template) + if (isset($template['visible']) && (! $template['visible'])) + unset ($templates[$index]); + +$templates['custom']['title'] = 'Custom'; +$templates['custom']['icon'] = 'images/object.png'; + +$count = count( $templates ); +foreach( $templates as $name => $template ) { + $i++; + + # If the template doesnt have a title, we'll use the desc field. + $template['desc'] = isset($template['title']) ? $template['title'] : $template['desc']; + + # Balance the columns properly + if( ( count( $templates ) % 2 == 0 && $i == intval( $count / 2 ) ) || + ( count( $templates ) % 2 == 1 && $i == intval( $count / 2 ) + 1 ) ) + + echo "
      "; + + # 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; + } ?> + + + + + + + + + + + + + + + + + + + +
      + + + /> + + + + + +
      +
      + diff --git a/creation_template.php b/creation_template.php index 6bda774..fa6c24d 100644 --- a/creation_template.php +++ b/creation_template.php @@ -1,62 +1,71 @@ GetValue('template_engine','enable') && (! is_numeric($_REQUEST['template']))) { + require './template_engine.php'; + die(); +} -if( $template == 'custom' ) { - foreach( $templates as $id => $template ) { - if( $template['handler'] == 'custom.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']); + +$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 ) ) ); +isset($templates[$template]) or pla_error(sprintf($lang['invalid_template'], htmlspecialchars($template))); $template_id = $template; -$template = isset( $templates[$template] ) ? $templates[$template_id] : null; -$server_id = http_get_value( 'server_id' ); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); -$server_name = $servers[ $server_id ][ 'name' ]; - -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - -include './header.php'; +$template = isset($templates[$template]) ? $templates[$template_id] : null; +if (! array_key_exists('no_header',$template)) { + include './header.php'; ?>

      -

      '', ''

      +

      'name); ?>', ''

      -\n"; - +if (! array_key_exists('no_header',$template)) + echo "\n"; ?> diff --git a/custom_functions.php b/custom_functions.php index 4df7f34..1a032ff 100644 --- a/custom_functions.php +++ b/custom_functions.php @@ -1,9 +1,12 @@ diff --git a/delete.php b/delete.php index ca18830..76cf2d8 100644 --- a/delete.php +++ b/delete.php @@ -1,72 +1,69 @@ isReadOnly()) + pla_error($lang['no_updates_in_read_only_mode']); +if (! $ldapserver->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); $dn = $_POST['dn']; -$encoded_dn = rawurlencode( $dn ); -$server_id = $_POST['server_id']; +$encoded_dn = rawurlencode($dn); -if( $dn === null ) - pla_error( $lang['you_must_specify_a_dn'] ); +if (is_null($dn)) + pla_error($lang['you_must_specify_a_dn']); -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); -dn_exists( $server_id, $dn ) or pla_error( sprintf( $lang['no_such_entry'], '' . pretty_print_dn( $dn ) . '' ) ); - -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); +dn_exists($ldapserver,$dn) or pla_error(sprintf($lang['no_such_entry'], '' . pretty_print_dn($dn) . '')); // Check the user-defined custom callback first. -if( true === preEntryDelete( $server_id, $dn ) ) { - $del_result = @ldap_delete( $ds, $dn ); -} else { - exit; -} +if (run_hook('pre_entry_delete',array('server_id' => $ldapserver->server_id,'dn' => $dn))) + $del_result = @ldap_delete($ldapserver->connect(), $dn); -if( $del_result ) -{ - // Custom callback - postEntryDelete( $server_id, $dn ); +else + pla_error(sprintf($lang['could_not_delete_entry'],''.pretty_print_dn($dn).'')); - // kill the DN from the tree browser session variable and - // refresh the tree viewer frame (left_frame) +if ($del_result) { - if( array_key_exists( 'tree', $_SESSION ) ) - { + # Custom callback + run_hook('post_entry_delete',array('server_id' => $ldapserver->server_id,'dn' => $dn)); + + # kill the DN from the tree browser session variable and + # refresh the tree viewer frame (left_frame) + if (array_key_exists('tree', $_SESSION)) { $tree = $_SESSION['tree']; - if( isset( $tree[$server_id] ) && is_array( $tree[$server_id] ) ) { - // does it have children? (it shouldn't, but hey, you never know) - if( isset( $tree[$server_id][$dn] ) ) - unset( $tree[$server_id][$dn] ); - - // search and destroy - foreach( $tree[$server_id] as $tree_dn => $subtree ) - foreach( $subtree as $key => $sub_tree_dn ) - if( 0 == strcasecmp( $sub_tree_dn, $dn ) ) - unset( $tree[$server_id][$tree_dn][$key] ); + 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'; - - ?> + include './header.php'; ?> " . htmlspecialchars( $servers[ $server_id ][ 'name' ] ) . "
      \n"; - echo $lang['look_in'] . "" . htmlspecialchars( $container ) . "
      \n"; +if ($container) { + printf('%s%s',$lang['server_colon_pare'],htmlspecialchars($ldapserver->name)); + print '
      '; + printf('%s%s',$lang['look_in'],htmlspecialchars($container)); + print '
      '; } /* Has the use already begun to descend into a specific server tree? */ -if( $server_id !== false && $container !== false ) -{ - check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); - have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); +if (isset($ldapserver) && $container !== false) { - $ds = pla_ldap_connect( $server_id ); - pla_ldap_connection_is_error( $ds ); + if (! $ldapserver->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); - $dn_list = get_container_contents( $server_id, $container, 0, '(objectClass=*)', get_tree_deref_setting() ); - sort( $dn_list ); + $dn_list = get_container_contents($ldapserver,$container,0,'(objectClass=*)',$config->GetValue('deref','tree')); + sort($dn_list); - $base_dn = $servers[ $server_id ][ 'base' ]; - if( ! $base_dn ) - $base_dn = try_to_get_root_dn( $server_id ); + foreach ($ldapserver->getBaseDN() as $base_dn) { + debug_log(sprintf('%s: Comparing BaseDN [%s] with container [%s]','entry_chooser.php',$base_dn,$container),9); - if( 0 == pla_compare_dns( $container, $base_dn ) ) { - $parent_container = false; - $up_href = "entry_chooser.php?form_element=$return_form_element"; - } else { - $parent_container = get_container( $container ); - $up_href = "entry_chooser.php?form_element=$return_form_element&server_id=$server_id&container=" . - rawurlencode( $parent_container ); - } - echo " " . - " ". $lang['back_up_p'] ."
      \n"; + if (! pla_compare_dns($container,$base_dn)) { + $parent_container = false; + $up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s',$return_form_element,$rdn); + break; - if( count( $dn_list ) == 0 ) - echo "   (". $lang['no_entries'] .")
      \n"; - else - foreach( $dn_list as $dn ) { - $href = "javascript:returnDN( '$dn' )"; - echo "    " . - "" . htmlspecialchars( $dn ) . "
      \n"; + } else { + $parent_container = get_container($container); + $up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s&server_id=%s&container=%s', + $return_form_element,$rdn,$ldapserver->server_id,rawurlencode($parent_container)); } -} + } + + print ' '; + printf(' %s',$up_href,$lang['back_up_p']); + print '
      '; + + if (! count($dn_list)) + printf('   (%s)
      ',$lang['no_entries']); + + else + foreach ($dn_list as $dn) { + $href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn); + print '   '; + printf('', + $ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn)); + + printf('%s',$href,htmlspecialchars($dn)); + print '
      '; + } + /* draw the root of the selection tree (ie, list all the servers) */ -else -{ - foreach( $servers as $id => $server ) { - if( $server['host'] ) { - echo "" . htmlspecialchars( $server['name'] ) . "
      \n"; - if( ! have_auth_info( $id ) ) - echo "   (" . $lang['not_logged_in'] . ")
      "; +} else { + foreach ($ldapservers->GetServerList() as $id) { + + $ldapserver = $ldapservers->Instance($id); + + if ($ldapserver->isVisible()) { + + if (! $ldapserver->haveAuthInfo()) + continue; + else { - $dn = ( $server['base'] ? $server['base'] : try_to_get_root_dn( $id ) ); - if( ! $dn ) { - echo "   (". $lang['could_not_det_base_dn'] .")
      "; - } else { - $href = "javascript:returnDN( '$dn' )"; - echo "    " . - "" . htmlspecialchars( $dn ) . "
      \n"; + printf('%s',htmlspecialchars($ldapserver->name)); + print '
      '; + foreach ($ldapserver->getBaseDN() as $dn) { + if (! $dn) { + printf('   (%s)
      ',$lang['could_not_det_base_dn']); + + } else { + $href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn); + + print '   '; + printf(' ', + $ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn)); + + printf('%s',$href,htmlspecialchars($dn)); + print '
      '; + } } } } } } - -// added by PD. 14082003, -// adding the element access allows it to work with javascript arrays - -// the name of the form extracted from the first part of the URL variable. -$formpart=substr($return_form_element,0,strpos($return_form_element,".")); - -// the name of the element extracted from the last part of the URL variable (after the dot) -$elmpart =substr($return_form_element,strpos($return_form_element,".")+1); - -// rebuilt return value -$return_form_element = $formpart . ".elements[\"" . $elmpart . "\"]"; - ?> diff --git a/expand.php b/expand.php index 6073185..c24ebaa 100644 --- a/expand.php +++ b/expand.php @@ -1,56 +1,52 @@ haveAuthInfo()) + pla_error($lang['not_enough_login_info']); + +# no expire header stuff header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); -// This allows us to display large sub-trees without running out of time. +# This allows us to display large sub-trees without running out of time. @set_time_limit( 0 ); $dn = $_GET['dn']; $encoded_dn = rawurlencode( $dn ); -$server_id = $_GET['server_id']; - -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); initialize_session_tree(); $tree = $_SESSION['tree']; $tree_icons = $_SESSION['tree_icons']; -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); -$contents = get_container_contents( $server_id, $dn, 0, '(objectClass=*)', get_tree_deref_setting() ); +$contents = get_container_contents( $ldapserver, $dn, 0, '(objectClass=*)', $config->GetValue('deref','tree')); usort( $contents, 'pla_compare_dns' ); -$tree[$server_id][$dn] = $contents; - -//echo "
      ";
      -//var_dump( $contents );
      -//exit;
      +$tree[$ldapserver->server_id][$dn] = $contents;
       
       foreach( $contents as $dn )
      -	$tree_icons[$server_id][$dn] = get_icon( $server_id, $dn );
      +	$tree_icons[$ldapserver->server_id][$dn] = get_icon( $ldapserver, $dn );
       
       $_SESSION['tree'] = $tree;
       $_SESSION['tree_icons'] = $tree_icons;
      @@ -64,11 +60,10 @@ $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 != "" ){
      +if( SID != "" )
       	$id_session_param = "&".session_name()."=".session_id();
      -}
       
       session_write_close();
       
      -header( "Location:tree.php?foo=$random_junk#{$server_id}_{$encoded_dn}$id_session_param" );
      +header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,$encoded_dn,$id_session_param));
       ?>
      diff --git a/export.php b/export.php
      index 9b684f9..4bfcea3 100755
      --- a/export.php
      +++ b/export.php
      @@ -1,30 +1,42 @@
       haveAuthInfo())
      +	pla_error( $lang['not_enough_login_info'] );
      +
       $base_dn = isset($_POST['dn']) ? $_POST['dn']:NULL;
      -$server_id = isset($_POST['server_id']) ? $_POST['server_id']: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';
      -$attributes = array();
      +
       // add system attributes if needed
      +$attributes = array();
       if( isset( $_POST['sys_attr'] ) ){
         array_push($attributes,'*');
         array_push($attributes,'+');
       }
      +
       isset($_POST['exporter_id']) or pla_error( $lang['must_choose_export_format'] );
       $exporter_id = $_POST['exporter_id'];
       isset($exporters[$exporter_id]) or  pla_error( $lang['invalid_export_format'] );
       
      -// do some check
      -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] );
      -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] );
      -
       // Initialisation of other variables
       $rdn = get_rdn( $base_dn );
       $friendly_rdn = get_rdn( $base_dn, 1 );
      @@ -78,6 +90,7 @@ $exporter->setOutputFormat($br);
       // prevent script from bailing early for long search
       @set_time_limit( 0 );
       
      +
       // send the header
       if( $save_as_file ) 
         header( "Content-type: application/download" );
      diff --git a/export_form.php b/export_form.php
      index e5e7a11..8439ba6 100755
      --- a/export_form.php
      +++ b/export_form.php
      @@ -1,5 +1,5 @@
       
                     
      -                  
      +                  
      diff --git a/export_functions.php b/export_functions.php
      index cca436f..b1a7be4 100755
      --- a/export_functions.php
      +++ b/export_functions.php
      @@ -1,5 +1,5 @@
       'ldif',
      -			     'desc' => 'LDIF',
      -			     'extension' => 'ldif'
      -			     );
      +$exporters[] = array(
      +	'output_type'=>'ldif',
      +	'desc' => 'LDIF',
      +	'extension' => 'ldif'
      +);
             
      -$exporters[] = array('output_type'=>'dsml',
      -			     'desc' => 'DSML V.1',
      -			     'extension' => 'xml'
      -			     );
      +$exporters[] = array(
      +	'output_type'=>'dsml',
      +	'desc' => 'DSML V.1',
      +	'extension' => 'xml'
      +);
       
      -$exporters[] = array('output_type'=>'vcard',
      -			     'desc' => 'VCARD 2.1',
      -			     'extension' => 'vcf'
      -			     );
      -$exporters[] = array('output_type'=>'csv',
      -			     'desc' => $lang['csv_spreadsheet'],
      -			     'extension' => 'csv'
      -			     );
      +$exporters[] = array(
      +	'output_type'=>'vcard',
      +	'desc' => 'VCARD 2.1',
      +	'extension' => 'vcf'
      +);
      +
      +$exporters[] = array(
      +	'output_type'=>'csv',
      +	'desc' => $lang['csv_spreadsheet'],
      +	'extension' => 'csv'
      +);
       
       /**
        * This class encapsulate informations about the ldap server 
      @@ -47,36 +54,33 @@ $exporters[] = array('output_type'=>'csv',
        *                 it indicates the query filter for the search.
        * $scope: if the source of the export is the ldap server,
        *         it indicates the scope of the search.
      - * $server_host: the host name of the server.
      - * $server_name: the name of the server.
      + *
      + * @package phpLDAPadmin
        */
       
      -class LdapInfo{
      +class LdapExportInfo {
       
         var $base_dn;
         var $query_filter;
         var $scope;
      -  var $server_host = NULL;
      -  var $server_name = NULL;
      -  var $server_id = NULL;
       
         /**
      -   * Create a new LdapInfo object
      +   * Create a new LdapExportInfo object
          *
          * @param int $server_id the server id
          * @param String $base_dn the base_dn for the search in a ldap server
          * @param String $query_filter the query filter for the search
      -   * @param String scope the scope of the search in a ldap server
      +   * @param String $scope the scope of the search in a ldap server
          */
       
      -  function LdapInfo($server_id,$base_dn = NULL,$query_filter = NULL,$scope = NULL){
      -    global $servers;
      -    $this->base_dn = $base_dn;
      -    $this->query_filter = $query_filter;
      -    $this->scope = $scope;
      -    $this->server_name = $servers[ $server_id ][ 'name' ];
      -    $this->server_host = $servers[ $server_id ][ 'host' ];
      -    $this->server_id = $server_id;
      +  function LdapExportInfo($server_id,$base_dn = NULL,$query_filter = NULL,$scope = NULL){
      +	global $ldapservers;
      +
      +	$this->ldapserver = $ldapservers->Instance($server_id);
      +
      +	$this->ldapserver->base_dn = $base_dn;
      +	$this->ldapserver->query_filter = $query_filter;
      +	$this->ldapserver->scope = $scope;
         }
       }
       
      @@ -91,6 +95,7 @@ class LdapInfo{
        * the PlaExporter
        *
        * @see PlaExporter
      + * @package phpLDAPadmin
        */
       
       class PlaAbstractExporter{
      @@ -139,6 +144,8 @@ class PlaAbstractExporter{
       /**
        * PlaExporter acts a wrapper around another exporter.
        * In other words, it will act as a decorator for another decorator
      + *
      + * @package phpLDAPadmin
        */
       
       class PlaExporter extends PlaAbstractExporter{
      @@ -238,6 +245,7 @@ class PlaExporter extends PlaAbstractExporter{
       /**
        * Export data from a ldap server
        * @extends PlaAbstractExporter
      + * @package phpLDAPadmin
        */
       
       class PlaLdapExporter extends PlaAbstractExporter{
      @@ -250,7 +258,6 @@ class PlaLdapExporter extends PlaAbstractExporter{
         var $ldap_info;
         var $queryFilter;
         var $hasNext;
      -  var $connection_open_state;
         var $attributes;
         /**
          * Create a PlaLdapExporter object.
      @@ -260,34 +267,33 @@ class PlaLdapExporter extends PlaAbstractExporter{
          * @param String $scope the scope for export
          */
         function PlaLdapExporter( $server_id , $queryFilter , $base_dn , $scope, $attributes){
      -    global $lang;
      +    global $lang, $config;
           $this->scope = $scope;
           $this->base_dn = $base_dn;
           $this->server_id = $server_id;
           $this->queryFilter = $queryFilter;
           // infos for the server
      -    $this->ldap_info = new LdapInfo($server_id,$base_dn,$queryFilter,$scope);
      +    $this->ldap_info = new LdapExportInfo($server_id,$base_dn,$queryFilter,$scope);
           // boolean to check if there is more entries
           $this->hasNext = 0;
           // boolean to check the state of the connection
      -    $this->connection_open_state = 0;
       
           $this->attributes = $attributes;
           // connect to the server
      -    $this->ds = @pla_ldap_connect( $this->server_id );
      -    pla_ldap_connection_is_error( $this->ds );
      -    $this->connection_open_state = 1;
      +    $this->ds = $this->ldap_info->ldapserver->connect();
      +    // @todo test whether we need to call pla_ldap_connection_is_error here.
      +    //pla_ldap_connection_is_error( $this->ds );
       
           // get the data to be exported
           if( $this->scope == 'base' )
             $this->results = @ldap_read( $this->ds, $this->base_dn, $this->queryFilter,$this->attributes, 
      -				   0, 0, 0, get_export_deref_setting() );
      +				   0, 0, 0, $config->GetValue('deref','export'));
           elseif( $this->scope == 'one' )
             $this->results = @ldap_list( $this->ds, $this->base_dn, $this->queryFilter, $this->attributes, 
      -				   0, 0, 0, get_export_deref_setting() );
      +				   0, 0, 0, $config->GetValue('deref','export'));
           else // scope == 'sub'
             $this->results = @ldap_search( $this->ds, $this->base_dn, $this->queryFilter, $this->attributes, 
      -				     0, 0, 0, get_export_deref_setting() );
      +				     0, 0, 0, $config->GetValue('deref','export'));
           
           // if no result, there is a something wrong
           if( ! $this->results ) 
      @@ -322,7 +328,7 @@ class PlaLdapExporter extends PlaAbstractExporter{
          * @return LdapInfo Object with info from the ldap serveur
          */
         function pla_get_ldap_info(){
      -    return $this->ldap_info;
      +    return $this->ldap_info->ldapserver;
         }
       
         /**
      @@ -349,7 +355,7 @@ class PlaLdapExporter extends PlaAbstractExporter{
       	
       	//iterate over the attributes
       	while( $attr ){
      -	  if( is_attr_binary( $this->server_id,$attr ) ){
      +	  if( is_attr_binary( $this,$attr ) ){
       	    $this->entry_array[$attr] = @ldap_get_values_len( $this->ds,$this->entry_id,$attr );
       	  }
       	  else{
      @@ -375,20 +381,22 @@ class PlaLdapExporter extends PlaAbstractExporter{
          * May be call when the processing is finished
          * and to free some ressources.
          * @return bool true or false if any errors is encountered
      +   * @todo This could break something, so need to add a method to LDAPServer to close connection and reset $connected.
          */
         function pla_close(){
      -    if($this->connection_open_state){
      -      return @ldap_close( $this->ds );
      -    }
      -    else{
      -      return true;
      -    }
      +//    if($this->ldap_info->connected){
      +//      return @ldap_close( $this->ds );
      +//    }
      +//    else{
      +//      return true;
      +//    }
         }
       } // end PlaLdapExporter
       
       /**
        * Export entries to ldif format
        * @extends PlaExporter
      + * @package phpLDAPadmin
        */
       
       class PlaLdifExporter extends PlaExporter{
      @@ -428,7 +436,7 @@ class PlaLdifExporter extends PlaExporter{
       
             // display dn
             if( $this->is_safe_ascii( $entry['dn'] ))
      -	$this->multi_lines_display("dn:". $entry['dn']);
      +	$this->multi_lines_display("dn: ". $entry['dn']);
             else
       	$this->multi_lines_display("dn:: " . base64_encode( $entry['dn'] ));
             array_shift($entry);
      @@ -436,7 +444,7 @@ class PlaLdifExporter extends PlaExporter{
             // display the attributes
             foreach( $entry as $key => $attr ){
       	foreach( $attr as $value ){
      -	  if(  !$this->is_safe_ascii($value) || is_attr_binary($pla_ldap_info->server_id,$key ) ){
      +	  if(  !$this->is_safe_ascii($value) || is_attr_binary($pla_ldap_info,$key ) ){
       	    $this->multi_lines_display( $key.":: " . base64_encode( $value ) );
       	  }
       	  else{
      @@ -458,8 +466,9 @@ class PlaLdifExporter extends PlaExporter{
           echo "version: 1$this->br$this->br";
           echo "# " . sprintf( $lang['ldif_export_for_dn'],  $pla_ldap_info->base_dn  ) . $this->br;
           echo "# " . sprintf( $lang['generated_on_date'], date("F j, Y g:i a") ) . $this->br;
      -    echo "# " . $lang['server'] . ": " .$pla_ldap_info->server_name  . " (" . $pla_ldap_info->server_host . ")" . $this->br;
      +    echo "# " . $lang['server'] . ": " .$pla_ldap_info->name  . " (" . $pla_ldap_info->host . ")" . $this->br;
           echo "# " . $lang['search_scope'] . ": " . $pla_ldap_info->scope . $this->br;
      +    echo "# " . $lang['search_filter'] . ": " . $pla_ldap_info->query_filter . $this->br;
           echo "# " . $lang['total_entries'] . ": " . $this->pla_num_entries() . $this->br; 
           echo $this->br;
         }
      @@ -491,6 +500,7 @@ class PlaLdifExporter extends PlaExporter{
       /**
        * Export entries to DSML v.1
        * @extends PlaExporter
      + * @package phpLDAPadmin
        */
       
       class PlaDsmlExporter extends PlaExporter{
      @@ -529,8 +539,9 @@ class PlaDsmlExporter extends PlaExporter{
            echo "" . $this->br;
       
      @@ -560,7 +571,7 @@ class PlaDsmlExporter extends PlaExporter{
       	  echo $attr_indent."".$this->br;
       	  
       	  // if the attribute is binary, set the flag $binary_mode to true
      -	  $binary_mode = is_attr_binary($pla_ldap_info->server_id,$key)?1:0;
      +	  $binary_mode = is_attr_binary($pla_ldap_info,$key)?1:0;
       	  
       	  foreach($attr as $value){
       	    echo $attr_value_indent."".($binary_mode?base64_encode( $value):  htmlspecialchars( $value ) )."".$this->br;
      @@ -579,6 +590,9 @@ class PlaDsmlExporter extends PlaExporter{
       }
       
       
      +/**
      + * @package phpLDAPadmin
      + */
       class PlaVcardExporter extends PlaExporter{
       
         // mappping one to one attribute
      @@ -621,8 +635,8 @@ class PlaVcardExporter extends PlaExporter{
           $base_dn = $ldap_info->base_dn;
           $server_id = $ldap_info->server_id;
           $scope = $ldap_info->scope;
      -    $server_name = $ldap_info->server_name;
      -    $server_host = $ldap_info->server_host;
      +    $server_name = $ldap_info->name;
      +    $server_host = $ldap_info->host;
       
           while( $this->pla_has_entry() ){
             $entry = $this->pla_fetch_entry_array();
      @@ -696,6 +710,7 @@ class PlaVcardExporter extends PlaExporter{
        * Export to cvs format
        *
        * @author Glen Ogilvie
      + * @package phpLDAPadmin
        */
       
       class PlaCSVExporter extends PlaExporter{
      @@ -723,8 +738,8 @@ class PlaCSVExporter extends PlaExporter{
           $base_dn = $ldap_info->base_dn;
           $server_id = $ldap_info->server_id;
           $scope = $ldap_info->scope;
      -    $server_name = $ldap_info->server_name;
      -    $server_host = $ldap_info->server_host;
      +    $server_name = $ldap_info->name;
      +    $server_host = $ldap_info->host;
           
           $entries = array();
           $headers = array();
      @@ -769,7 +784,7 @@ class PlaCSVExporter extends PlaExporter{
       
       	echo $this->qualifier;
       	if (key_exists($attr_name, $entry)) {
      -	  $binary_attribute = is_attr_binary( $server_id, $attr_name )?1:0;
      +	  $binary_attribute = is_attr_binary( $ldap_info, $attr_name )?1:0;
       	  
       	  $attr_values = $entry[$attr_name];
       	  
      @@ -803,6 +818,9 @@ class PlaCSVExporter extends PlaExporter{
       
       
       
      +/**
      + * @package phpLDAPadmin
      + */
       
       class MyCustomExporter extends PlaExporter{
       
      @@ -825,8 +843,8 @@ class MyCustomExporter extends PlaExporter{
           $base_dn = $ldap_info->base_dn;
           $server_id = $ldap_info->server_id;
           $scope = $ldap_info->scope;
      -    $server_name = $ldap_info->server_name;
      -    $server_host = $ldap_info->server_host;
      +    $server_name = $ldap_info->name;
      +    $server_host = $ldap_info->host;
       
       
           // Just a simple loop. For each entry 
      diff --git a/functions.php b/functions.php
      index 1321faa..2e52a05 100644
      --- a/functions.php
      +++ b/functions.php
      @@ -1,127 +1,110 @@
       custom->appearance['multi_line_attributes'];
        *
        * Usage example:
        * 
        *  if( is_muli_line_attr( "postalAddress" ) )
        *      echo "";
      - *  else 
      + *  else
        *      echo "";
        * 
        *
        * @param string $attr_name The name of the attribute of interestd (case insensivite)
      - * @param string $val (optional) The current value of the attribute (speeds up the 
      + * @param string $val (optional) The current value of the attribute (speeds up the
        *               process by searching for carriage returns already in the attribute value)
      - * @param int $server_id (optional) The ID of the server of interest. If specified, 
      - *               is_multi_line_attr() will read the schema from the server to determine if 
      - *               the attr is multi-line capable. (note that schema reads can be expensive, 
      + * @param int $server_id (optional) The ID of the server of interest. If specified,
      + *               is_multi_line_attr() will read the schema from the server to determine if
      + *               the attr is multi-line capable. (note that schema reads can be expensive,
        *               but that impact is lessened due to PLA's new caching mechanism)
        * @return bool
      + * @todo Move this to an LDAPServer object method.
        */
      -function is_multi_line_attr( $attr_name, $val=null, $server_id=null )
      -{
      -    // First, check the optional val param for a \n or a \r
      -    if( null != $val && 
      -        ( false !== strpos( $val, "\n" ) || 
      -          false !== strpos( $val, "\r" ) ) )
      -        return true;
      +function is_multi_line_attr( $attr_name, $val=null, $server_id=null ) {
      +	debug_log(sprintf('is_multi_line_attr(): Entered with (%s,%s,%s)',$attr_name,$val,$server_id),2);
       
      -    // Next, compare strictly by name first
      -    global $multi_line_attributes;
      -    if( isset( $multi_line_attributes ) && is_array( $multi_line_attributes ) )
      -        foreach( $multi_line_attributes as $multi_line_attr_name )
      -            if( 0 == strcasecmp( $multi_line_attr_name, $attr_name ) )
      -                return true;
      +	global $config, $ldapservers;
      +	$multi_line_attributes = $config->GetValue('appearance','multi_line_attributes');
      +	$multi_line_syntax_oids = $config->GetValue('appearance','multi_line_syntax_oids');
       
      -    // If unfound, compare by syntax OID
      -    if( null !== $server_id ) {
      -        global $multi_line_syntax_oids;
      -        if( isset( $multi_line_syntax_oids ) && is_array( $multi_line_syntax_oids ) ) {
      -            $schema_attr = get_schema_attribute( $server_id, $attr_name );
      -            if( ! $schema_attr )
      -                return false;
      +	# Set default return
      +	$return = false;
      +
      +	// First, check the optional val param for a \n or a \r
      +	if (! is_null($val) && (false !== strpos($val,"\n") || false !== strpos($val,"\r")))
      +		$return = true;
      +
      +	// Next, compare strictly by name first
      +	else
      +		foreach ($multi_line_attributes as $multi_line_attr_name)
      +			if (strcasecmp($multi_line_attr_name,$attr_name) == 0) {
      +				$return = true;
      +				break;
      +			}
      +
      +	// If unfound, compare by syntax OID
      +	if (! $return && ! is_null($server_id)) {
      +		$ldapserver = $ldapservers->Instance($server_id);
      +
      +		$schema_attr = get_schema_attribute($ldapserver,$attr_name);
      +		if ($schema_attr) {
                   $syntax_oid = $schema_attr->getSyntaxOID();
      -            if( ! $syntax_oid )
      -                return false;
      -            foreach( $multi_line_syntax_oids as $multi_line_syntax_oid )
      -                if( $multi_line_syntax_oid == $syntax_oid )
      -                    return true;
      -        }
      +
      +            if ($syntax_oid)
      +				foreach($multi_line_syntax_oids as $multi_line_syntax_oid)
      +					if ($multi_line_syntax_oid == $syntax_oid) {
      +						$return = true;
      +						break;
      +					}
      +		}
           }
       
      -    return false;
      -
      -}
      -
      -/**
      - * Fetches the user setting for $search_deref from config.php. The returned value
      - * will be one of the four LDAP_DEREF_* constancts defined by the PHP LDAP API. If
      - * the user has failed to configure this setting or configured an inappropriate
      - * value, the constant DEFAULT_SEARCH_DEREF_SETTING is returned.
      - *
      - * @see DEFAULT_SEARCH_DEREF_SETTING
      - * @see is_valid_deref_setting()
      - * @return int
      - */
      -function get_search_deref_setting()
      -{
      -    global $search_deref;
      -    if( ! isset( $search_deref ) || ! is_valid_deref_setting( $search_deref ) )
      -        return DEFAULT_SEARCH_DEREF_SETTING;
      -    else
      -        return $search_deref;
      -}
      -
      -/**
      - * Fetches the user setting for $tree_deref from config.php. The returned value
      - * will be one of the four LDAP_DEREF_* constancts defined by the PHP LDAP API. If
      - * the user has failed to configure this setting or configured an inappropriate
      - * value, the constant DEFAULT_TREE_DEREF_SETTING is returned.
      - *
      - * @see DEFAULT_TREE_DEREF_SETTING
      - * @see is_valid_deref_setting()
      - * @return int
      - */
      -function get_tree_deref_setting()
      -{
      -    global $tree_deref;
      -    if( ! isset( $tree_deref ) || ! is_valid_deref_setting( $tree_deref ) )
      -        return DEFAULT_TREE_DEREF_SETTING;
      -    else
      -        return $tree_deref;
      -}
      -
      -/**
      - * Fetches the user setting for $export_deref from config.php. The returned value
      - * will be one of the four LDAP_DEREF_* constancts defined by the PHP LDAP API. If
      - * the user has failed to configure this setting or configured an inappropriate
      - * value, the constant DEFAULT_EXPORT_DEREF_SETTING is returned.
      - *
      - * @see DEFAULT_EXPORT_DEREF_SETTING
      - * @see is_valid_deref_setting()
      - * @return int
      - */
      -function get_export_deref_setting()
      -{
      -    global $export_deref;
      -    if( ! isset( $export_deref ) || ! is_valid_deref_setting( $export_deref ) )
      -        return DEFAULT_EXPORT_DEREF_SETTING;
      -    else
      -        return $export_deref;
      +	debug_log(sprintf('is_multi_line_attr(): Returning (%s)',$return),1);
      +	return $return;
       }
       
       /**
      @@ -130,197 +113,56 @@ function get_export_deref_setting()
        * the user has failed to configure this setting or configured an inappropriate
        * value, the constant DEFAULT_VIEW_DEREF_SETTING is returned.
        *
      - * @see DEFAULT_VIEW_DEREF_SETTING
      - * @see is_valid_deref_setting()
        * @return int
      + * @deprecated
        */
      -function get_view_deref_setting()
      -{
      -    global $view_deref;
      -    if( ! isset( $view_deref ) || ! is_valid_deref_setting( $view_deref ) )
      -        return DEFAULT_VIEW_DEREF_SETTING;
      -    else
      -        return $view_deref;
      -}
      -
      -/** 
      - * Checks the user-configured parameter for sanity. For the various *_deref settings, users
      - * may only use one of LDAP_DEREF_NEVER, LDAP_DEREF_SEARCHING, LDAP_DEREF_FINDING, or
      - * LDAP_DEREF_ALWAYS. This function can be used to conveniently enforce this.
      - *
      - * @param int $deref_setting The deref setting to validate.
      - * @return bool
      - */
      -function is_valid_deref_setting( $deref_setting )
      -{
      -    if( $deref_setting == LDAP_DEREF_NEVER ||
      -        $deref_setting == LDAP_DEREF_SEARCHING ||
      -        $deref_setting == LDAP_DEREF_FINDING ||
      -        $deref_setting == LDAP_DEREF_ALWAYS )
      -        return true;
      -    else
      -        return false;
      -
      +function get_view_deref_setting() {
      +    global $config;
      +	return $config->GetValue('deref','view');
       }
       
       /**
      - * Fetch whether the user has configured a certain server as "low bandwidth". Users may
      - * choose to configure a server as "low bandwidth" in config.php thus:
      - * 
      - *   $servers[$i]['low_bandwidth'] = true;
      - * 
      - * @param int $server_id The ID of the server of interest from config.php.
      - * @return bool
      - */
      -function is_server_low_bandwidth( $server_id )
      -{
      -    global $servers;
      -    if( isset( $servers[$server_id]['low_bandwidth'] ) && true == $servers[$server_id]['low_bandwidth'] )
      -        return true;
      -    else
      -        return false;
      -}
      -
      -/**
      - * Fetch whether the user has configured a certain server login to be non anonymous
      - *
      - * 
      - *   $servers[$i]['disable_anon_bind'] = true;
      - * 
      - * @param int $server_id The ID of the server of interest from config.php.
      - * @return bool 
      - */
      -function is_anonymous_bind_allowed( $server_id )
      -{
      -	global $servers;
      -	
      -	return ( ! isset( $servers[$server_id]['disable_anon_bind'] )
      -		|| false == $servers[$server_id]['disable_anon_bind'] )
      -		? true
      -		: false;
      -}
      -
      -/** 
      - * Fetches whether TLS has been configured for use with a certain server.
      - * Users may configure phpLDAPadmin to use TLS in config,php thus:
      - * 
      - *   $servers[$i]['tls'] = true;
      - * 
      - * @param int $server_id The ID of the server of interest from config.php.
      - * @return bool
      - */
      -function tls_enabled( $server_id )
      -{
      -    global $servers;
      -    if( isset( $servers[$server_id]['tls'] ) && true == $servers[$server_id]['tls'] )
      -        return true;
      -    else
      -        return false;
      -}
      -
      -/**
      - * Fetches whether phpLDAPadmin has been configured to redirect anonymously bound users
      - * to a search form with no tree displayed.
      - * This is configured in config.php thus:
      - * 
      - *  $anonymous_bind_redirect_no_tree = true;
      - * 
      - * @return bool
      - */
      -function anon_bind_tree_disabled()
      -{
      -	global $anonymous_bind_redirect_no_tree;
      -	if( isset( $anonymous_bind_redirect_no_tree ) && true == $anonymous_bind_redirect_no_tree )
      -		return true;
      -	else
      -		return false;
      -}
      -
      -/**
      - * Fetches whether phpLDAPadmin has been configured to display configuration
      - * management links (report bug, request feature, etc)
      - * @return bool
      - */
      -function hide_configuration_management()
      -{
      -    global $hide_configuration_management;
      -    if( isset( $hide_configuration_management ) &&
      -        $hide_configuration_management == true )
      -        return true;
      -    else
      -        return false;
      -}
      -
      -/** 
        * Fetches whether the user has configured phpLDAPadmin to obfuscate passwords
      - * with "*********" when displaying them. This is configured in config.php thus:
      + * with "*********" when displaying them.
      + *
      + * This is configured in config.php thus:
        * 
        *  $obfuscate_password_display = true;
        * 
      - * @return bool
      - */
      -function obfuscate_password_display()
      -{
      -	global $obfuscate_password_display;
      -	if( isset( $obfuscate_password_display ) && true == $obfuscate_password_display )
      -		return true;
      -	else
      -		return false;
      -}
      -
      -/** 
      - * Fetches whether the login_attr feature is enabled for a specified server. 
      - * This is configured in config.php thus:
      - * 
      - *  $servers[$server_id]['login_attr'] = 'uid';
      - * 
      - * By virtue of the fact that the login_attr is not blank and not 'dn', the 
      - * feature is configured to be enabled.
        *
      + * @param string $enc Password encoding type
        * @return bool
        */
      -function login_attr_enabled( $server_id )
      -{
      -	global $servers;
      -	if(	isset( $servers[$server_id]['login_attr'] ) && 
      -		0 != strcasecmp( $servers[$server_id]['login_attr'], "dn" ) && 
      -		trim( $servers[$server_id]['login_attr'] != "" ) )
      -		return true;
      +function obfuscate_password_display($enc=null) {
      +	debug_log(sprintf('obfuscate_password_display(): Entered with ()'),2);
      +	global $config;
      +
      +	if ($config->GetValue('appearance','obfuscate_password_display'))
      +		$return = true;
      +
      +	elseif (! $config->GetValue('appearance','show_clear_password') && (is_null($enc) || $enc == 'clear'))
      +		$return = true;
      +
       	else
      -		return false;
      +		$return = false;
      +
      +	debug_log(sprintf('obfuscate_password_display(): Returning (%s)',$return),1);
      +	return $return;
       }
       
      -function login_string_enabled( $server_id )
      -{
      -	global $servers;
      -	if(	isset( $servers[$server_id]['login_attr'] ) && 
      -		0 == strcasecmp( $servers[$server_id]['login_attr'], "string" ) )
      -		return true;
      -	else
      -		return false;
      -}
      -
      -function get_login_string( $server_id )
      -{
      -	global $servers;
      -	if(	isset( $servers[$server_id]['login_string'] ) )
      -		return $servers[$server_id]['login_string'];
      -	else
      -		return false;
      -}
      -
      -/** 
      +/**
        * Returns an HTML-beautified version of a DN.
      - * Internally, this function makes use of pla_explode_dn() to break the 
      + * Internally, this function makes use of pla_explode_dn() to break the
        * the DN into its components. It then glues them back together with
      - * "pretty" HTML. The returned HTML is NOT to be used as a real DN, but 
      + * "pretty" HTML. The returned HTML is NOT to be used as a real DN, but
        * simply displayed.
      - * 
      + *
        * @param string $dn The DN to pretty-print.
        * @return string
        */
      -function pretty_print_dn( $dn )
      -{
      +function pretty_print_dn( $dn ) {
      +	debug_log(sprintf('pretty_print_dn(): Entered with (%s)',$dn),2);
      +
       	$dn = pla_explode_dn( $dn );
       	foreach( $dn as $i => $element ) {
       		$element = htmlspecialchars( $element );
      @@ -336,31 +178,36 @@ function pretty_print_dn( $dn )
       /**
        * Returns true if the attribute specified is required to take as input a DN.
        * Some examples include 'distinguishedName', 'member' and 'uniqueMember'.
      - * @param int $server_id The ID of the server of interest 
      + * @param int $server_id The ID of the server of interest
        *            (required since this operation demands a schema lookup)
        * @param string $attr_name The name of the attribute of interest (case insensitive)
        * @return bool
      + * @todo Move this to an LDAPServer object method.
        */
      -function is_dn_attr( $server_id, $attr_name )
      -{
      -    // Simple test first
      -    $dn_attrs = array( "aliasedObjectName" );
      -    foreach( $dn_attrs as $dn_attr )
      -        if( 0 == strcasecmp( $attr_name, $dn_attr ) )
      -            return true;
      +function is_dn_attr( $ldapserver, $attr_name ) {
      +	debug_log(sprintf('is_dn_attr(): Entered with (%s,%s)',$ldapserver->server_id,$attr_name),2);
       
      -    // Now look at the schema OID
      -	$attr_schema = get_schema_attribute( $server_id, $attr_name );
      +	// Simple test first
      +	$dn_attrs = array( "aliasedObjectName" );
      +	foreach( $dn_attrs as $dn_attr )
      +		if( 0 == strcasecmp( $attr_name, $dn_attr ) )
      +			return true;
      +
      +	// Now look at the schema OID
      +	$attr_schema = get_schema_attribute( $ldapserver, $attr_name );
       	if( ! $attr_schema )
       		return false;
      +
       	$syntax_oid = $attr_schema->getSyntaxOID();
       	if( '1.3.6.1.4.1.1466.115.121.1.12' == $syntax_oid )
       		return true;
       	if( '1.3.6.1.4.1.1466.115.121.1.34' == $syntax_oid )
       		return true;
      -	$syntaxes = get_schema_syntaxes( $server_id );
      +
      +	$syntaxes = get_schema_syntaxes( $ldapserver );
       	if( ! isset( $syntaxes[ $syntax_oid ] ) )
       		return false;
      +
       	$syntax_desc = $syntaxes[ $syntax_oid ]->getDescription();
       	if( false !== strpos( strtolower($syntax_desc), 'distinguished name' ) )
       		return true;
      @@ -379,8 +226,9 @@ function is_dn_attr( $server_id, $attr_name )
        * @see unit_test.php
        * @return bool
        */
      -function is_dn_string( $str )
      -{
      +function is_dn_string( $str ) {
      +	debug_log(sprintf('is_dn_string(): Entered with (%s)',$str),2);
      +
           // Try to break the string into its component parts if it can be done
           // ie, "uid=Manager" "dc=example" and "dc=com"
           $parts = pla_explode_dn( $str );
      @@ -407,15 +255,16 @@ function is_dn_string( $str )
           return true;
       }
       
      -/** 
      +/**
        * Get whether a string looks like an email address (user@example.com).
      - * 
      + *
        * @param string $str The string to analyze.
      - * @return bool Returns true if the specified string looks like 
      + * @return bool Returns true if the specified string looks like
        *   an email address or false otherwise.
        */
      -function is_mail_string( $str )
      -{
      +function is_mail_string( $str ) {
      +	debug_log(sprintf('is_mail_string(): Entered with (%s)',$str),2);
      +
           $mail_regex = "/^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*$/";
           if( preg_match( $mail_regex, $str ) )
               return true;
      @@ -423,190 +272,203 @@ function is_mail_string( $str )
               return false;
       }
       
      -/** 
      +/**
        * Get whether a string looks like a web URL (http://www.example.com/)
      - * 
      + *
        * @param string $str The string to analyze.
      - * @return bool Returns true if the specified string looks like 
      + * @return bool Returns true if the specified string looks like
        *   a web URL or false otherwise.
        */
      -function is_url_string( $str )
      -{
      +function is_url_string( $str ) {
      +	debug_log(sprintf('is_url_string(): Entered with (%s)',$str),2);
      +
           $url_regex = '/(ftp|https?):\/\/+[\w\.\-\/\?\=\&]*\w+/';
           if( preg_match( $url_regex, $str ) )
               return true;
           else
               return false;
      -
       }
       
      -
       /**
        * Utility wrapper for setting cookies, which takes into consideration
      - * phpLDAPadmin configuration values. On success, true is returned. On 
      + * phpLDAPadmin configuration values. On success, true is returned. On
        * failure, false is returned.
        *
        * @param string $name The name of the cookie to set.
        * @param string $val The value of the cookie to set.
      - * @param int $expire (optional) The duration in seconds of this cookie. If unspecified, $cookie_time 
      + * @param int $expire (optional) The duration in seconds of this cookie. If unspecified, $cookie_time
        *            is used from config.php
        * @param string $dir (optional) The directory value of this cookie (see php.net/setcookie)
        *
        * @see setcookie
        * @return bool
        */
      -function pla_set_cookie( $name, $val, $expire=null, $dir=null )
      -{
      -	if( $expire == null ) {
      -		global $cookie_time;
      -		if( ! isset( $cookie_time ) )
      -				$cookie_time = 0;
      +function pla_set_cookie( $name, $val, $expire=null, $dir=null ) {
      +	debug_log(sprintf('pla_set_cookie(): Entered with (%s,%s,%s,%s)',$name,$val,$expire,$dir),2);
      +
      +	global $config;
      +
      +	# Set default return
      +	$return = false;
      +
      +	if ($expire == null) {
      +		$cookie_time = $config->GetValue('session','cookie_time');
       		$expire = $cookie_time == 0 ? null : time() + $cookie_time;
       	}
       
      -	if( $dir == null ) {
      +	if ($dir == null)
       		$dir = dirname( $_SERVER['PHP_SELF'] );
      +
      +	if (@setcookie($name,$val,$expire,$dir)) {
      +		$_COOKIE[$name] = $val;
      +		$return = true;
       	}
       
      -	if( @setcookie( $name, $val, $expire, $dir ) ) {
      -		$_COOKIE[ $name ] = $val;
      -		return true;
      -	} else {
      -		return false;
      -	}
      +	debug_log(sprintf('pla_set_cookie(): Returning (%s)',$return),1);
      +	return $return;
       }
       
       /**
        * Responsible for setting two cookies/session-vars to indicate that a user has logged in,
      - * one for the logged in DN and one for the logged in password. Cookies  
      - * are stored unencrypted in the client's browser's cookie cache. Use caution!
      + * one for the logged in DN and one for the logged in password.
        *
        * This function is only used if 'auth_type' is set to 'cookie' or 'session'. The values
      - * written have the name "pla_login_dn_X" and "pla_login_pass_X" where X is the 
      + * written have the name "pla_login_dn_X" and "pla_login_pass_X" where X is the
        * ID of the server to which the user is attempting login.
        *
      - * Note that as with all cookie/session operations this function must be called BEFORE 
      + * Note that as with all cookie/session operations this function must be called BEFORE
        * any output is sent to the browser.
        *
        * On success, true is returned. On failure, false is returned.
      - * 
      - * @param int $server_id The ID of the server to which the user is logged in.
      - * @param string $dn The DN with which the user has logged in. 
      + *
      + * @param object $ldapserver The LDAPServer object of the server which the user hsa logged in.
      + * @param string $dn The DN with which the user has logged in.
        * @param string $password The password of the user logged in.
        * @param bool $anon_bind Indicates that this is an anonymous bind such that
        *             a password of "0" is stored.
        * @return bool
        * @see unset_login_dn
        */
      -function set_login_dn( $server_id, $dn, $password, $anon_bind )
      -{
      -	global $servers;
      +function set_login_dn($ldapserver,$dn,$password,$anon_bind) {
      +	debug_log(sprintf('set_login_dn(): Entered with (%s,%s,%s,%s)',
      +		$ldapserver->server_id,$dn,$password,$anon_bind),2);
       
      -	if( ! check_server_id( $server_id ) )
      +	if (! $ldapserver->auth_type)
       		return false;
      -	if( ! isset( $servers[ $server_id ][ 'auth_type' ] ) )
      -		return false;
      -	$auth_type = $servers[ $server_id ][ 'auth_type' ]; 
       
      -    switch( $auth_type ) 
      -    {
      -        case 'cookie':
      -            $cookie_dn_name = "pla_login_dn_$server_id";
      -            $cookie_pass_name = "pla_login_pass_$server_id";
      -            if( $anon_bind ) {
      -                // we set the cookie password to 0 for anonymous binds.
      -                $dn = 'anonymous';
      -                $password = '0';
      -            }
      -            $res1 = pla_set_cookie( $cookie_dn_name, pla_blowfish_encrypt( $dn ) );
      -            $res2 = pla_set_cookie( $cookie_pass_name, pla_blowfish_encrypt( $password ) );
      -            if( $res1 && $res2 )
      -                return true;
      -            else
      -                return false;
      -            break;
      -        case 'session':
      -            $sess_var_dn_name = "pla_login_dn_$server_id";
      -            $sess_var_pass_name = "pla_login_pass_$server_id";
      -            if( $anon_bind ) {
      -                $dn = 'anonymous';
      -                $password = '0';
      -            } 
      -            $_SESSION[ $sess_var_dn_name ] = $dn;
      -            $_SESSION[ $sess_var_pass_name ] = $password;
      -            return true;
      -            break;
      -        default:
      -            global $lang;
      -			pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $auth_type ) ) );
      -            break;
      -    }
      +	switch( $ldapserver->auth_type )
      +	{
      +		case 'cookie':
      +			$cookie_dn_name = sprintf("pla_login_dn_%s",$ldapserver->server_id);
      +			$cookie_pass_name = sprintf("pla_login_pass_%s",$ldapserver->server_id);
      +
      +			// we set the cookie password to 0 for anonymous binds.
      +			if( $anon_bind ) {
      +				$dn = 'anonymous';
      +				$password = '0';
      +			}
      +
      +			$res1 = pla_set_cookie( $cookie_dn_name, pla_blowfish_encrypt( $dn ) );
      +			$res2 = pla_set_cookie( $cookie_pass_name, pla_blowfish_encrypt( $password ) );
      +			if( $res1 && $res2 )
      +				return true;
      +			else
      +				return false;
      +			break;
      +
      +		case 'session':
      +			$sess_var_dn_name = sprintf("pla_login_dn_%s",$ldapserver->server_id);
      +			$sess_var_pass_name = sprintf("pla_login_pass_%s",$ldapserver->server_id);
      +
      +			// we set the cookie password to 0 for anonymous binds.
      +			if( $anon_bind ) {
      +				$dn = 'anonymous';
      +				$password = '0';
      +			}
      +
      +			$_SESSION[ $sess_var_dn_name ] = pla_blowfish_encrypt( $dn );
      +			$_SESSION[ $sess_var_pass_name ] = pla_blowfish_encrypt ( $password );
      +			return true;
      +			break;
      +		default:
      +			global $lang;
      +			pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $ldapserver->auth_type ) ) );
      +			break;
      +	}
       }
       
       /**
      - * Effectively logs a user out from a server. 
      - * Removes the cookies/session-vars set by set_login_dn() 
      + * Log a user out of the LDAP server.
      + *
      + * Removes the cookies/session-vars set by set_login_dn()
        * after a user logs out using "auth_type" of "session" or "cookie".
        * Returns true on success, false on failure.
        *
      - * @param int $server_id The ID of the server from which the user is logging out.
      + * @param object $ldapserver The LDAPServer object of the server which the user hsa logged in.
        * @return bool True on success, false on failure.
        * @see set_login_dn
        */
      -function unset_login_dn( $server_id )
      -{
      -	global $servers;
      +function unset_login_dn( $ldapserver ) {
      +	debug_log(sprintf('unset_login_dn(): Entered with (%s)',$ldapserver->server_id),2);
       
      -	if( ! check_server_id( $server_id ) )
      +	if (! $ldapserver->auth_type)
       		return false;
      -	if( ! isset( $servers[ $server_id ][ 'auth_type' ] ) )
      -		return false;
      -	$auth_type = $servers[ $server_id ][ 'auth_type' ]; 
      -    switch( $auth_type ) 
      -    {
      -        case 'cookie':
      -            $logged_in_dn = get_logged_in_dn( $server_id );
      -            if( ! $logged_in_dn )
      -                return false;
      -            $logged_in_pass = get_logged_in_pass( $server_id );
      -            $anon_bind = $logged_in_dn == 'anonymous' ? true : false;
       
      -            // set cookie with expire time already passed to erase cookie from client
      -            $expire = time()-3600;
      -            $cookie_dn_name = "pla_login_dn_$server_id";
      -            $cookie_pass_name = "pla_login_pass_$server_id";
      -            if( $anon_bind ) {
      -                $res1 = pla_set_cookie( $cookie_dn_name, 'anonymous', $expire );
      -                $res2 = pla_set_cookie( $cookie_pass_name, '0', $expire );
      -            } else {
      -                $res1 = pla_set_cookie( $cookie_dn_name, pla_blowfish_encrypt( $logged_in_dn ), $expire );
      -                $res2 = pla_set_cookie( $cookie_pass_name, pla_blowfish_encrypt( $logged_in_pass ), $expire );
      -            }
      +	switch( $ldapserver->auth_type )
      +	{
      +		case 'cookie':
      +			$logged_in_dn = get_logged_in_dn( $ldapserver );
      +			if( ! $logged_in_dn )
      +				return false;
       
      -            if( ! $res1 || ! $res2 )
      -                return false;
      -            else
      -                return true;
      -            break;
      -       case 'session':
      -            // unset session variables
      -            $session_var_dn_name = "pla_login_dn_$server_id";
      -            $session_var_pass_name = "pla_login_pass_$server_id";
      -            if( array_key_exists( $session_var_dn_name, $_SESSION ) )
      -                unset( $_SESSION[ $session_var_dn_name ] );
      -            if( array_key_exists( $session_var_pass_name, $_SESSION ) )
      -                unset( $_SESSION[ "$session_var_pass_name" ] );
      -            session_write_close();
      -            return true;
      -            break;
      -      default:
      -            global $lang;
      +			$logged_in_pass = get_logged_in_pass( $ldapserver );
      +			$anon_bind = $logged_in_dn == 'anonymous' ? true : false;
      +
      +			// set cookie with expire time already passed to erase cookie from client
      +			$expire = time()-3600;
      +			$cookie_dn_name = sprintf("pla_login_dn_%s",$ldapserver->server_id);
      +			$cookie_pass_name = sprintf("pla_login_pass_%s",$ldapserver->server_id);
      +
      +			if( $anon_bind ) {
      +				$res1 = pla_set_cookie( $cookie_dn_name, 'anonymous', $expire );
      +				$res2 = pla_set_cookie( $cookie_pass_name, '0', $expire );
      +			} else {
      +				$res1 = pla_set_cookie( $cookie_dn_name, pla_blowfish_encrypt( $logged_in_dn ), $expire );
      +				$res2 = pla_set_cookie( $cookie_pass_name, pla_blowfish_encrypt( $logged_in_pass ), $expire );
      +			}
      +
      +			# Need to unset the cookies too, since they are still set if further processing occurs (eg: Timeout)
      +			unset($_COOKIE[$cookie_dn_name]);
      +			unset($_COOKIE[$cookie_pass_name]);
      +
      +			if( ! $res1 || ! $res2 )
      +				return false;
      +			else
      +				return true;
      +			break;
      +
      +		case 'session':
      +			// unset session variables
      +			$session_var_dn_name = sprintf("pla_login_dn_%s",$ldapserver->server_id);
      +			$session_var_pass_name = sprintf("pla_login_pass_%s",$ldapserver->server_id);
      +
      +			if( array_key_exists( $session_var_dn_name, $_SESSION ) )
      +				unset( $_SESSION[ $session_var_dn_name ] );
      +
      +			if( array_key_exists( $session_var_pass_name, $_SESSION ) )
      +				unset( $_SESSION[ "$session_var_pass_name" ] );
      +
      +			session_write_close();
      +			return true;
      +			break;
      +
      +		default:
      +			global $lang;
       			pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $auth_type ) ) );
      -            break;
      -    }
      +			break;
      +	}
       }
       
      -
       /**
        * Get a customized file for a server
        * We don't need any caching, because it's done by PHP
      @@ -616,20 +478,20 @@ function unset_login_dn( $server_id )
        *
        * @return string The customized filename, if exists, or the standard one
        */
      -function get_custom_file( $server_id, $filename )
      -{
      -	global $servers;
      +function get_custom_file($server_id,$filename,$path) {
      +	debug_log(sprintf('get_custom_file(): Entered with (%s,%s,%s)',$server_id,$filename,$path),2);
       
      -	if( ! check_server_id( $server_id ) )
      -		return $filename;
      -	
      -	if( isset( $servers[ $server_id ]['custom_pages_prefix'] ) ) {
      -		$custom = $servers[ $server_id ][ 'custom_pages_prefix' ];
      -		if( is_file( realpath( $custom . $filename ) ) )
      -			return ( $custom . $filename );
      -	}
      +	global $ldapservers;
       
      -	return $filename;
      +	# Set default return
      +	$return = $path.$filename;
      +
      +	$custom = $ldapservers->GetValue($server_id,'custom','pages_prefix');
      +	if (! is_null($custom) && is_file(realpath($path.$custom.$filename)))
      +		$return = $path.$custom.$filename;
      +
      +	debug_log(sprintf('get_custom_file(): Returning (%s)',$return),1);
      +	return $return;
       }
       
       /**
      @@ -640,19 +502,20 @@ function get_custom_file( $server_id, $filename )
        *
        * @return any The result of the called function
        */
      -function call_custom_function( $server_id, $function )
      -{
      -	global $servers;
      +function call_custom_function( $server_id, $function ) {
      +	debug_log(sprintf('call_custom_function(): Entered with (%s,%s)',$server_id,$function),2);
       
      -	if( ! check_server_id( $server_id ) )
      -		return $function;
      +	global $ldapservers;
       
      -	if( isset( $servers[$server_id]['custom_pages_prefix'] ) ) {
      -		$custom = $servers[$server_id]['custom_pages_prefix'];
      -		if( function_exists( $custom . $function ) )
      -			return call_user_func ( $custom . $function );
      -	}
      -	return call_user_func( $function );
      +	# Set default return
      +	$return = $function;
      +
      +	$custom = $ldapservers->GetValue($server_id,'custom','pages_prefix');
      +	if (! is_null($custom) && function_exists($custom.$function))
      +		$return = $custom.$filename;
      +
      +	debug_log(sprintf('get_custom_file(): Returning (%s)',$return),1);
      +	return call_user_func($return );
       }
       
       /**
      @@ -661,7 +524,7 @@ function call_custom_function( $server_id, $function )
        *      Returns < 0 if dn1 is less than dn2.
        *      Returns > 0 if dn1 is greater than dn2.
        *
      - * The comparison is performed starting with the top-most element 
      + * The comparison is performed starting with the top-most element
        * of the DN. Thus, the following list:
        *    
        *       ou=people,dc=example,dc=com
      @@ -686,17 +549,18 @@ function call_custom_function( $server_id, $function )
        * @param string $dn2 The second of two DNs to compare
        * @return int
        */
      -function pla_compare_dns( $dn1, $dn2 )
      -{
      +function pla_compare_dns( $dn1, $dn2 ) {
      +	debug_log(sprintf('pla_compare_dns(): Entered with (%s,%s)',$dn1,$dn2),2);
      +
       	// If they are obviously the same, return immediately
       	if( 0 === strcasecmp( $dn1, $dn2 ) )
       		return 0;
      -	
      +
       	$dn1_parts = pla_explode_dn( pla_reverse_dn($dn1) );
       	$dn2_parts = pla_explode_dn( pla_reverse_dn($dn2) );
       	assert( is_array( $dn1_parts ) );
       	assert( is_array( $dn2_parts ) );
      -	
      +
       	// Foreach of the "parts" of the smaller DN
       	for( $i=0; $i
      - *   $enable_mass_delete = true;
      - * 
      - * Notice that mass deletes are not enabled on a per-server basis, but this
      - * function checks that the sever is not in a read-only state as well.
      - *
      - * @param int $server_id The ID of the server of interest.
      - * @return bool
      - */
      -function mass_delete_enabled( $server_id )
      -{
      -	global $enable_mass_delete;
      -
      -	if( check_server_id( $server_id ) && 
      -		! pla_ldap_connection_is_error( pla_ldap_connect( $server_id ), false ) &&
      -		have_auth_info( $server_id ) && 
      -		! is_server_read_only( $server_id ) && 
      -		isset( $enable_mass_delete ) && 
      -		true === $enable_mass_delete )
      -		return true;
      -	else
      -		return false;
      -}
      -
       /**
        * Returns true if the user has configured PLA to show
        * helpful hints with the $show_hints setting.
      @@ -785,12 +623,11 @@ function mass_delete_enabled( $server_id )
        * 
        *
        * @return bool
      + * @deprecated
        */
      -function show_hints()
      -{
      -	global $show_hints;
      -	if( isset( $show_hints ) && $show_hints === true )
      -		return true;
      +function show_hints() {
      +	global $config;
      +	return $config->GetValue('appearance','show_hints');
       }
       
       /**
      @@ -799,14 +636,11 @@ function show_hints()
        * @param int $server_id The id of the server of interest.
        * @return bool True if auto uidNumbers are enabled, false otherwise.
        */
      -function auto_uid_numbers_enabled( $server_id ) 
      -{
      -    global $servers;
      -    if( isset( $servers[$server_id]['enable_auto_uid_numbers'] ) &&
      -        true == $servers[$server_id]['enable_auto_uid_numbers'] )
      -        return true;
      -    else
      -        return false;
      +function auto_uid_numbers_enabled($server_id) {
      +	debug_log(sprintf('auto_uid_numbers_enabled(): Entered with (%s)',$server_id),2);
      +
      +	global $ldapservers;
      +	return $ldapservers->GetValue($server_id,'auto_number','enable');
       }
       
       /**
      @@ -822,123 +656,162 @@ function auto_uid_numbers_enabled( $server_id )
        * returned here has not been used in the mean time. Note that the two different
        * mechanisms may (will!) return different values as they use different algorithms
        * to arrive at their result. Do not be alarmed if (when!) this is the case.
      - * 
      + *
        * Also note that both algorithms are susceptible to a race condition. If two admins
        * are adding users simultaneously, the users may get identical uidNumbers with this
        * function.
        *
        * See config.php.example for more notes on the two auto uidNumber mechanisms.
        *
      - * @param int $server_id The ID of the server of interest.
      + * @param object $ldapserver The LDAP Server Object of interest.
        * @return int
        *
      - * @todo eliminate race condition at create time by re-running this function.
      + * @todo take advantage of multiple connections with new LDAPServer object.
      + * @todo rename this function as its a generic get_next_number function now.
      + * @todo Must turn off auto_uid|gid in template if config is disabled.
        */
      -function get_next_uid_number( $server_id )
      -{
      -	global $servers, $lang;
      -	// Some error checking
      -	if( ! check_server_id( $server_id ) )
      +function get_next_uid_number($ldapserver,$startbase='',$type='uid') {
      +	global $config; $config->custom->debug['level'] = 9; $config->custom->debug['syslog'] = true;
      +	debug_log(sprintf('get_next_uid_number(): Entered with (%s,%s,%s)',$ldapserver->server_id,$startbase,$type),2);
      +
      +	global $ldapservers,$servers,$lang;
      +
      +	if (! auto_uid_numbers_enabled($ldapserver->server_id))
       		return false;
      -    if( ! auto_uid_numbers_enabled( $server_id ) )
      -        return false;
      -	$server_name = isset( $servers[ $server_id ]['name'] ) ?
      -		$servers[$server_id]['name'] :
      -		"Server $server_id";
      -	if( ! isset( $servers[ $server_id ]['enable_auto_uid_numbers'] ) )
      -		return false;
      -	if( ! isset( $servers[ $server_id ]['auto_uid_number_mechanism'] ) )
      -		pla_error( sprintf($lang['auto_update_not_setup'], $server_name));
       
      -	// Based on the configured mechanism, go get the next available uidNumber!
      -	$mechanism = $servers[$server_id]['auto_uid_number_mechanism'];
      +	# Based on the configured mechanism, go get the next available uidNumber!
      +	$mechanism = $ldapservers->GetValue($ldapserver->server_id,'auto_number','mechanism');
       
      -	//
      -	// case 1: uidpool mechanism
      -	//
      -	if( 0 == strcasecmp( $mechanism, 'uidpool' ) ) {
      -		if( ! isset( $servers[ $server_id ][ 'auto_uid_number_uid_pool_dn' ] ) )
      -			pla_error( sprintf( $lang['uidpool_not_set'], $server_name ) );
      -		$uid_pool_dn = $servers[ $server_id ][ 'auto_uid_number_uid_pool_dn' ];
      -		if( ! dn_exists( $server_id, $uid_pool_dn ) )
      -			pla_error( sprintf( $lang['uidpool_not_exist'] , $uid_pool_dn ) );
      +	switch ($mechanism) {
       
      -		$next_uid_number = get_object_attr( $server_id, $uid_pool_dn, 'uidNumber' );
      -		$next_uid_number = intval( $next_uid_number[ 0 ] );
      -		$next_uid_number++;
      +		// @todo: This is being deprecated - unless somebody wants it?
      +		case 'uidpool' :
      +			if( ! isset( $servers[ $ldapserver->server_id ][ 'auto_uid_number_uid_pool_dn' ] ) )
      +				pla_error( sprintf( $lang['uidpool_not_set'], $ldapserver->name ) );
       
      -		return $next_uid_number;
      +			$uid_pool_dn = $servers[ $ldapserver->server_id ][ 'auto_uid_number_uid_pool_dn' ];
      +			if( ! dn_exists( $ldapserver, $uid_pool_dn ) )
      +				pla_error( sprintf( $lang['uidpool_not_exist'] , $uid_pool_dn ) );
       
      -	//
      -	// case 2: search mechanism
      -	//
      -	} elseif( 0 == strcasecmp( $mechanism, 'search' ) ) {
      -		if( ! isset( $servers[ $server_id ][ 'auto_uid_number_search_base' ] ) )
      -			pla_error( sprintf( $lang['specified_uidpool'] , $server_name ) );
      +			$next_uid_number = get_object_attr( $ldapserver, $uid_pool_dn, 'uidNumber' );
      +			$next_uid_number = intval( $next_uid_number[ 0 ] );
      +			$next_uid_number++;
       
      -		$base_dn = $servers[ $server_id ][ 'auto_uid_number_search_base' ];
      -		$filter = "(uidNumber=*)";
      +			return $next_uid_number;
      +			break;
       
      -		// Check see and use our alternate uid_dn and password if we have it.
      -		if ( isset( $servers[ $server_id ][ 'auto_uid_number_search_dn' ] ) &&
      -			isset( $servers[ $server_id ][ 'auto_uid_number_search_dn_pass' ] ) ) {
      -			$con = @ldap_connect( $servers[$server_id]['host'], $servers[$server_id]['port'] );
      -            @ldap_set_option( $con, LDAP_OPT_PROTOCOL_VERSION, 3 );
      -            @ldap_set_option( $con, LDAP_OPT_REFERRALS, 0);
      -
      -			// Bind with the alternate ID.
      -			$res = @ldap_bind( $con,
      -				$servers[ $server_id ][ 'auto_uid_number_search_dn' ],
      -				$servers[ $server_id ][ 'auto_uid_number_search_dn_pass' ] );
      -			if (! $res) pla_error( sprintf( $lang['auto_uid_invalid_credential'] , $server_name ) );
      -			$search = @ldap_search( $con, $base_dn, $filter, array('uidNumber'), 0, 0, 0, get_search_deref_setting() );
      -            if( ! $search ) pla_error( sprintf( $lang['bad_auto_uid_search_base'], $server_name ) );
      -			$search = @ldap_get_entries( $con, $search );
      -			$res = @ldap_unbind( $con );
      +		case 'search' :
      +			if (! $startbase) {
      +				$base_dn = $ldapservers->GetValue($ldapserver->server_id,'auto_number','search_base');
      +				if (is_null($base_dn))
      +					pla_error( sprintf( $lang['specified_uidpool'] , $ldapserver->name ) );
       
      +			} else {
      +				$base_dn = $startbase;
      +			}
      +			$filter = "(|(uidNumber=*)(gidNumber=*))";
       			$results = array();
      -			for( $i=0; $i<$search['count']; $i++ ) {
      -				$entry = $search[$i];
      -				$dn['dn'] = $entry['dn'];
      -				$dn['uidnumber'] = $entry['uidnumber'][0];
      -				$results[] = $dn;
      +
      +			# Check see and use our alternate uid_dn and password if we have it.
      +			if (! is_null($ldapservers->GetValue($ldapserver->server_id,'auto_number','dn')) && 
      +				! is_null($ldapservers->GetValue($ldapserver->server_id,'auto_number','pass'))) {
      +
      +				$con = @ldap_connect($ldapserver->host,$ldapserver->port);
      +				@ldap_set_option($con,LDAP_OPT_PROTOCOL_VERSION,3);
      +				@ldap_set_option($con,LDAP_OPT_REFERRALS,0);
      +
      +				# Bind with the alternate ID.
      +				$res = @ldap_bind($con,
      +					$ldapservers->GetValue($ldapserver->server_id,'auto_number','dn'),
      +					$ldapservers->GetValue($ldapserver->server_id,'auto_number','pass'));
      +
      +				if (! $res)
      +					pla_error(sprintf($lang['auto_uid_invalid_credential'],$ldapserver->name));
      +
      +				$search = @ldap_search($con,$base_dn,$filter,array('uidNumber','gidNumber'),0,0,0,
      +					$config->GetValue('deref','search'));
      +
      +				if (! $search)
      +					pla_error(sprintf($lang['bad_auto_uid_search_base'],$ldapserver->name));
      +
      +				$search = @ldap_get_entries($con,$search);
      +				$res = @ldap_unbind($con);
      +
      +				for ($i = 0;$i < $search['count']; $i++ ) {
      +					$attrs = $search[$i];
      +
      +					switch ($type) {
      +						case 'uid' : 
      +							if (isset($attrs['uidnumber'])) {
      +								$entry['dn'] = $attrs['dn'];
      +								$entry['uniqnumber'] = $attrs['uidnumber'][0];
      +							}
      +							break;
      +
      +						case 'gid' : 
      +							if (isset($attrs['gidnumber'])) {
      +								$entry['dn'] = $attrs['dn'];
      +								$entry['uniqnumber'] = $attrs['gidnumber'][0];
      +							}
      +							break;
      +					}
      +					$results[] = $entry;
      +				}
      +
      +			} else {
      +				$search = pla_ldap_search( $ldapserver, $filter, $base_dn, array('uidNumber','gidNumber'));
      +
      +				foreach ($search as $dn => $attrs) {
      +					switch ($type) {
      +						case 'uid' : 
      +							if (isset($attrs['uidNumber'])) {
      +								$entry['dn'] = $attrs['dn'];
      +								$entry['uniqnumber'] = $attrs['uidNumber'];
      +							}
      +							break;
      +
      +						case 'gid' : 
      +							if (isset($attrs['gidNumber'])) {
      +								$entry['dn'] = $attrs['dn'];
      +								$entry['uniqnumber'] = $attrs['gidNumber'];
      +							}
      +							break;
      +					}
      +					$results[] = $entry;
      +				}
       			}
       
      -		} else {
      -			$results = pla_ldap_search( $server_id, $filter, $base_dn, array('uidNumber'));
      -		}
      -		// lower-case all the inices so we can access them by name correctly
      -		foreach( $results as $dn => $attrs )
      -			foreach( $attrs as $attr => $vals ) {
      -				unset( $results[$dn][$attr] );
      -				$results[$dn][strtolower( $attr )] = $vals;
      -			}
      +			# construct a list of used numbers
      +			$autonum = array();
      +			foreach ($results as $result)
      +				$autonum[] = $result['uniqnumber'];
       
      -		// construct a list of used uidNumbers
      -		$uids = array();
      -		foreach ($results as $result)
      -			$uids[] = $result['uidnumber'];
      -		$uids = array_unique( $uids );
      -		if( count( $uids ) == 0 )
      -			return false;
      -		sort( $uids );
      -		foreach( $uids as $uid )
      -			$uid_hash[ $uid ] = 1;
      -		// start with the least existing uidNumber and add 1
      -		if (isset($servers[$server_id]['auto_uid_number_min'])) {
      -			$uidNumber = $servers[$server_id]['auto_uid_number_min'];
      -		} else {
      -			$uidNumber = intval( $uids[0] ) + 1;
      -		}
      -		// this loop terminates as soon as we encounter the next available uidNumber
      -		while( isset( $uid_hash[ $uidNumber ] ) )
      -			$uidNumber++;
      -		return $uidNumber;
      -	//
      -	// No other cases allowed. The user has an error in the configuration
      -	//
      -	} else {
      -		pla_error( sprintf( $lang['auto_uid_invalid_value'] , $mechanism) );
      +			$autonum = array_unique($autonum);
      +			if (count($autonum) == 0)
      +				return false;
      +
      +			sort($autonum);
      +			foreach($autonum as $uid)
      +				$uid_hash[$uid] = 1;
      +
      +			# start with the least existing autoNumber and add 1
      +			if ($ldapservers->GetValue($ldapserver->server_id,'auto_number','min'))
      +				$minNumber = $ldapservers->GetValue($ldapserver->server_id,'auto_number','min');
      +
      +			else
      +				$minNumber = intval($autonum[0]) + 1;
      +
      +			# this loop terminates as soon as we encounter the next available minNumber
      +			while (isset($uid_hash[$minNumber]))
      +				$minNumber++;
      +
      +			return $minNumber;
      +
      +			break;
      +
      +		# No other cases allowed. The user has an error in the configuration
      +		default :
      +			pla_error( sprintf( $lang['auto_uid_invalid_value'] , $mechanism) );
       	}
       }
       
      @@ -951,17 +824,19 @@ function get_next_uid_number( $server_id )
        * @param string $attr_name The name of the attribute to test.
        * @return bool
        * @see draw_jpeg_photos
      + * @todo Move this to an LDAPServer object method.
        */
      -function is_jpeg_photo( $server_id, $attr_name )
      -{
      +function is_jpeg_photo( $ldapserver, $attr_name ) {
      +	debug_log(sprintf('is_jpeg_photo(): Entered with (%s,%s)',$ldapserver->server_id,$attr_name),2);
      +
       	// easy quick check
       	if( 0 == strcasecmp( $attr_name, 'jpegPhoto' ) ||
       	    0 == strcasecmp( $attr_name, 'photo' ) )
       	    return true;
       
       	// go to the schema and get the Syntax OID
      -	require_once realpath( 'schema_functions.php' );
      -	$schema_attr = get_schema_attribute( $server_id, $attr_name );
      +	// require_once realpath( 'schema_functions.php' );
      +	$schema_attr = get_schema_attribute( $ldapserver, $attr_name );
       	if( ! $schema_attr )
       		return false;
       
      @@ -978,84 +853,92 @@ function is_jpeg_photo( $server_id, $attr_name )
       
       /**
        * Given an attribute name and server ID number, this function returns
      - * whether the attrbiute contains boolean data. This is useful for 
      + * whether the attrbiute contains boolean data. This is useful for
        * developers who wish to display the contents of a boolean attribute
        * with a drop-down.
      - * 
      - * @param int $server_id The ID of the server of interest (required since 
      + *
      + * @param int $server_id The ID of the server of interest (required since
        *            this action requires a schema lookup on the server)
        * @param string $attr_name The name of the attribute to test.
        * @return bool
      + * @todo Move this to an LDAPServer object method.
        */
      -function is_attr_boolean( $server_id, $attr_name )
      -{
      -    $type = ( $schema_attr = get_schema_attribute( $server_id, $attr_name ) ) ? 
      -        $schema_attr->getType() : 
      -        null;
      -    if( 0 == strcasecmp( 'boolean', $type ) ||
      -        0 == strcasecmp( 'isCriticalSystemObject', $attr_name ) ||
      -        0 == strcasecmp( 'showInAdvancedViewOnly', $attr_name ) )
      -        return true;
      -    else
      -        return false;
      +function is_attr_boolean( $ldapserver, $attr_name ) {
      +	debug_log(sprintf('is_attr_boolean(): Entered with (%s,%s)',$ldapserver->server_id,$attr_name),2);
      +
      +	$type = ( $schema_attr = get_schema_attribute( $ldapserver, $attr_name ) ) ?
      +		$schema_attr->getType() : null;
      +
      +	if( 0 == strcasecmp( 'boolean', $type ) ||
      +		0 == strcasecmp( 'isCriticalSystemObject', $attr_name ) ||
      +		0 == strcasecmp( 'showInAdvancedViewOnly', $attr_name ) )
      +		return true;
      +
      +	else
      +		return false;
       }
       
       /**
        * Given an attribute name and server ID number, this function returns
      - * whether the attrbiute may contain binary data. This is useful for 
      + * whether the attrbiute may contain binary data. This is useful for
        * developers who wish to display the contents of an arbitrary attribute
        * but don't want to dump binary data on the page.
      - * 
      - * @param int $server_id The ID of the server of interest (required since 
      + *
      + * @param int $server_id The ID of the server of interest (required since
        *            this action requires a schema lookup on the server)
        * @param string $attr_name The name of the attribute to test.
        * @return bool
        *
        * @see is_jpeg_photo
      + * @todo Move this to an LDAPServer object method.
        */
      -function is_attr_binary( $server_id, $attr_name )
      -{
      -    $attr_name = strtolower( $attr_name );
      -    /** Determining if an attribute is binary can be an expensive
      -       operation. We cache the results for each attr name on each
      -       server in the $attr_cache to speed up subsequent calls. 
      -       The $attr_cache looks like this:
      -       Array 
      -        0 => Array 
      -              'objectclass' => false
      -              'cn' => false
      -              'usercertificate' => true
      -        1 => Array 
      -              'jpegphoto' => true 
      -              'cn' => false
      -    */
      +function is_attr_binary( $ldapserver, $attr_name ) {
      +	debug_log(sprintf('is_attr_binary(): Entered with (%s,%s)',$ldapserver->server_id,$attr_name),2);
       
      -    static $attr_cache;
      -    if( isset( $attr_cache[ $server_id ][ $attr_name ] ) )
      -        return $attr_cache[ $server_id ][ $attr_name ];
      +	$attr_name = strtolower( $attr_name );
      +	/**
      +	 * Determining if an attribute is binary can be an expensive operation.
      +	 * We cache the results for each attr name on each server in the $attr_cache
      +	 * to speed up subsequent calls. The $attr_cache looks like this:
      +	 *
      +	 * Array
      +	 * 0 => Array
      +	 *	'objectclass' => false
      +	 *	'cn' => false
      +	 *	'usercertificate' => true
      +	 * 1 => Array
      +	 *	'jpegphoto' => true
      +	 *	'cn' => false
      +	 */
       
      -    if( $attr_name == 'userpassword' ) {
      -        $attr_cache[ $server_id ][ $attr_name ] = false;
      -        return false;
      -    }
      +	static $attr_cache;
      +	if( isset( $attr_cache[ $ldapserver->server_id ][ $attr_name ] ) )
      +		return $attr_cache[ $ldapserver->server_id ][ $attr_name ];
       
      -    // Quick check: If the attr name ends in ";binary", then it's binary.
      +	if( $attr_name == 'userpassword' ) {
      +		$attr_cache[ $ldapserver->server_id ][ $attr_name ] = false;
      +		return false;
      +	}
      +
      +	// Quick check: If the attr name ends in ";binary", then it's binary.
       	if( 0 == strcasecmp( substr( $attr_name, strlen( $attr_name ) - 7 ), ";binary" ) ) {
      -        $attr_cache[ $server_id ][ $attr_name ] = true;
      +		$attr_cache[ $ldapserver->server_id ][ $attr_name ] = true;
       		return true;
      -    }
      +	}
       
      -    // See what the server schema says about this attribute
      -	$schema_attr = get_schema_attribute( $server_id, $attr_name );
      +	// See what the server schema says about this attribute
      +	$schema_attr = get_schema_attribute( $ldapserver, $attr_name );
       	if( ! $schema_attr ) {
      -        // Strangely, some attributeTypes may not show up in the server
      -        // schema. This behavior has been observed in MS Active Directory.
      -        $type = null;
      -        $syntax = null;
      -    } else {
      -        $type = $schema_attr->getType();
      -        $syntax = $schema_attr->getSyntaxOID();
      -    }
      +
      +		// Strangely, some attributeTypes may not show up in the server
      +		// schema. This behavior has been observed in MS Active Directory.
      +		$type = null;
      +		$syntax = null;
      +
      +	} else {
      +		$type = $schema_attr->getType();
      +		$syntax = $schema_attr->getSyntaxOID();
      +	}
       
       	if(	0 == strcasecmp( $type, 'Certificate' ) ||
       		0 == strcasecmp( $type, 'Binary' ) ||
      @@ -1069,17 +952,19 @@ function is_attr_binary( $server_id, $attr_name )
       		$syntax == '1.3.6.1.4.1.1466.115.121.1.5' ||
       		$syntax == '1.3.6.1.4.1.1466.115.121.1.8' ||
       		$syntax == '1.3.6.1.4.1.1466.115.121.1.9' ) {
      -            $attr_cache[ $server_id ][ $attr_name ] = true;
      -			return true;
      -    } else {
      -            $attr_cache[ $server_id ][ $attr_name ] = false;
      -			return false;
      -    }
      +
      +		$attr_cache[ $ldapserver->server_id ][ $attr_name ] = true;
      +		return true;
      +
      +	} else {
      +		$attr_cache[ $ldapserver->server_id ][ $attr_name ] = false;
      +		return false;
      +	}
       }
       
       /**
        * Returns true if the specified attribute is configured as read only
      - * in config.php with the $read_only_attrs array. 
      + * in config.php with the $read_only_attrs array.
        * Attributes are configured as read-only in config.php thus:
        * 
        *  $read_only_attrs = array( "objectClass", "givenName" );
      @@ -1087,21 +972,23 @@ function is_attr_binary( $server_id, $attr_name )
        *
        * @param string $attr The name of the attribute to test.
        * @return bool
      + * @todo Move this to an LDAPServer object method.
        */
      -function is_attr_read_only( $server_id, $attr )
      -{
      +function is_attr_read_only( $ldapserver, $attr ) {
      +	debug_log(sprintf('is_attr_read_only(): Entered with (%s,%s)',$ldapserver->server_id,$attr),2);
      +
       	global $read_only_attrs, $read_only_except_dn;
       
       	$attr = trim( $attr );
      -	if( '' ===  $attr )
      +	if( '' === $attr )
       		return false;
      -	if( ! isset( $read_only_attrs ) ) 
      +	if( ! isset( $read_only_attrs ) )
       		return false;
       	if( ! is_array( $read_only_attrs) )
       		return false;
       
       	// Is the user excluded?
      -	if (isset($read_only_except_dn) && userIsMember($server_id, get_logged_in_dn( $server_id ),$read_only_except_dn))
      +	if (isset($read_only_except_dn) && userIsMember($ldapserver, get_logged_in_dn( $ldapserver ),$read_only_except_dn))
       		return false;
       
       	foreach( $read_only_attrs as $attr_name )
      @@ -1128,35 +1015,39 @@ function is_attr_read_only( $server_id, $attr )
        * @param string $attr The name of the attribute to test.
        * @return bool
        */
      -function is_attr_hidden( $server_id, $attr )
      -{
      -    global $hidden_attrs, $hidden_attrs_ro, $hidden_except_dn;
      +function is_attr_hidden( $ldapserver, $attr ) {
      +	debug_log(sprintf('is_attr_hidden(): Entered with (%s,%s)',$ldapserver->server_id,$attr),2);
      +
      +	global $hidden_attrs, $hidden_attrs_ro, $hidden_except_dn;
       
       	$attr = trim( $attr );
      -	if( '' ===  $attr )
      +	if( '' === $attr )
       		return false;
      -	if( ! isset( $hidden_attrs ) ) 
      +	if( ! isset( $hidden_attrs ) )
       		return false;
       	if( ! is_array( $hidden_attrs) )
       		return false;
      -    if( ! isset( $hidden_attrs_ro ) )
      -        $hidden_attrs_ro = $hidden_attrs;
      -    if( ! is_array( $hidden_attrs_ro) )
      -        $hidden_attrs_ro = $hidden_attrs;
      +
      +	if( ! isset( $hidden_attrs_ro ) )
      +		$hidden_attrs_ro = $hidden_attrs;
      +	if( ! is_array( $hidden_attrs_ro) )
      +		$hidden_attrs_ro = $hidden_attrs;
       
       	// Is the user excluded?
      -	if (isset($hidden_except_dn) && userIsMember($server_id, get_logged_in_dn( $server_id ),$hidden_except_dn))
      +	if (isset($hidden_except_dn) && userIsMember($ldapserver, get_logged_in_dn( $ldapserver ),$hidden_except_dn))
       		return false;
       
      -     if( is_server_read_only( $server_id ) ) {
      -             foreach( $hidden_attrs_ro as $attr_name )
      -                     if( 0 == strcasecmp( $attr, trim($attr_name) ) )
      -                             return true;
      -     } else {
      -             foreach( $hidden_attrs as $attr_name )
      -                     if( 0 == strcasecmp( $attr, trim($attr_name) ) )
      -                             return true;
      -    }
      +	if( $ldapserver->isReadOnly() ) {
      +		foreach( $hidden_attrs_ro as $attr_name )
      +			if( 0 == strcasecmp( $attr, trim($attr_name) ) )
      +				return true;
      +
      +	} else {
      +		foreach( $hidden_attrs as $attr_name )
      +			if( 0 == strcasecmp( $attr, trim($attr_name) ) )
      +				return true;
      +	}
      +
       	return false;
       }
       
      @@ -1172,9 +1063,9 @@ function is_attr_hidden( $server_id, $attr )
        *
        * @param int $server_id The ID of the server of interest from the $servers array in config.php
        * @return bool
      + * @deprecated
        */
      -function is_server_read_only( $server_id )
      -{
      +function is_server_read_only( $server_id ) {
       	global $servers;
       	if( isset( $servers[$server_id]['read_only'] ) &&
       	    $servers[$server_id]['read_only'] == true )
      @@ -1205,16 +1096,17 @@ function is_server_read_only( $server_id )
        * this function as needed to suit their types of LDAP entries. If the modifications
        * are general to an LDAP audience, the phpLDAPadmin team will gladly accept them
        * as a patch.
      - * 
      + *
        * @param int $server_id The ID of the LDAP server housing the DN of interest.
        * @param string $dn The DN of the entry whose icon you wish to fetch.
        *
        * @return string
        */
      -function get_icon( $server_id, $dn )
      -{
      +function get_icon( $ldapserver, $dn ) {
      +	debug_log(sprintf('get_icon(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2);
      +
       	// fetch and lowercase all the objectClasses in an array
      -	$object_classes = get_object_attr( $server_id, $dn, 'objectClass', true );
      +	$object_classes = get_object_attr( $ldapserver, $dn, 'objectClass', true );
       
       	if( $object_classes === null || $object_classes === false || ! is_array( $object_classes ) )
       		$object_classes = array();
      @@ -1223,114 +1115,161 @@ function get_icon( $server_id, $dn )
       		$object_classes[$i] = strtolower( $class );
       
       	$rdn = get_rdn( $dn );
      -    $rdn_parts = explode( '=', $rdn, 2 );
      -    $rdn_value = isset( $rdn_parts[0] ) ? $rdn_parts[0] : null;
      -    $rdn_attr = isset( $rdn_parts[1] ) ? $rdn_parts[1] : null;
      -    unset( $rdn_parts );
      +	$rdn_parts = explode( '=', $rdn, 2 );
      +	$rdn_value = isset( $rdn_parts[0] ) ? $rdn_parts[0] : null;
      +	$rdn_attr = isset( $rdn_parts[1] ) ? $rdn_parts[1] : null;
      +	unset( $rdn_parts );
       
       	// return icon filename based upon objectClass value
       	if( in_array( 'sambaaccount', $object_classes ) &&
       		'$' == $rdn{ strlen($rdn) - 1 } )
       		return 'nt_machine.png';
      +
       	if( in_array( 'sambaaccount', $object_classes ) )
       		return 'nt_user.png';
      +
       	elseif( in_array( 'person', $object_classes ) ||
      -	    in_array( 'organizationalperson', $object_classes ) ||
      -	    in_array( 'inetorgperson', $object_classes ) ||
      -	    in_array( 'account', $object_classes ) ||
      -   	    in_array( 'posixaccount', $object_classes )  )
      +		in_array( 'organizationalperson', $object_classes ) ||
      +		in_array( 'inetorgperson', $object_classes ) ||
      +		in_array( 'account', $object_classes ) ||
      +		in_array( 'posixaccount', $object_classes )  )
      +
       		return 'user.png';
      +
       	elseif( in_array( 'organization', $object_classes ) )
       		return 'o.png';
      +
       	elseif( in_array( 'organizationalunit', $object_classes ) )
       		return 'ou.png';
      +
       	elseif( in_array( 'organizationalrole', $object_classes ) )
       		return 'uid.png';
      +
       	elseif( in_array( 'dcobject', $object_classes ) ||
       		in_array( 'domainrelatedobject', $object_classes ) ||
       		in_array( 'domain', $object_classes ) ||
      -        in_array( 'builtindomain', $object_classes )) 
      +		in_array( 'builtindomain', $object_classes ))
      +
       		return 'dc.png';
      -    elseif( in_array( 'alias', $object_classes ) )
      -        return 'go.png';
      -    elseif( in_array( 'room', $object_classes ) )
      -        return 'door.png';
      -    elseif( in_array( 'device', $object_classes ) )
      -        return 'device.png';
      -    elseif( in_array( 'document', $object_classes ) )
      -        return 'document.png';
      +
      +	elseif( in_array( 'alias', $object_classes ) )
      +		return 'go.png';
      +
      +	elseif( in_array( 'room', $object_classes ) )
      +		return 'door.png';
      +
      +	elseif( in_array( 'device', $object_classes ) )
      +		return 'device.png';
      +
      +	elseif( in_array( 'document', $object_classes ) )
      +		return 'document.png';
      +
       	elseif( in_array( 'country', $object_classes ) ) {
      -        $tmp = pla_explode_dn( $dn );
      -        $cval = explode( '=', $tmp[0], 2 );
      -        $cval = isset( $cval[1] ) ? $cval[1] : false;
      -        if( $cval && false === strpos( $cval, ".." ) && 
      -            file_exists( realpath( "./images/countries/$cval.png" ) ) )
      -            return "countries/$cval.png";
      -        else
      -            return 'country.png';
      -    }
      +		$tmp = pla_explode_dn( $dn );
      +		$cval = explode( '=', $tmp[0], 2 );
      +		$cval = isset( $cval[1] ) ? $cval[1] : false;
      +		if( $cval && false === strpos( $cval, ".." ) &&
      +			file_exists( realpath( sprintf("./images/countries/%s.png",strtolower($cval)) ) ) )
      +
      +			return sprintf("countries/%s.png",strtolower($cval));
      +
      +		else
      +			return 'country.png';
      +	}
      +
       	elseif( in_array( 'jammvirtualdomain', $object_classes ) )
       		return 'mail.png';
      +
       	elseif( in_array( 'locality', $object_classes ) )
       		return 'locality.png';
      +
       	elseif( in_array( 'posixgroup', $object_classes ) ||
       		in_array( 'groupofnames', $object_classes ) ||
       		in_array( 'group', $object_classes ) )
      +
       		return 'ou.png';
      +
       	elseif( in_array( 'applicationprocess', $object_classes ) )
       		return 'process.png';
      +
       	elseif( in_array( 'groupofuniquenames', $object_classes ) )
       		return 'uniquegroup.png';
      +
       	elseif( in_array( 'iphost', $object_classes ) )
       		return 'host.png';
      +
       	elseif( in_array( 'nlsproductcontainer', $object_classes ) )
      -        return 'n.png';
      +		return 'n.png';
      +
       	elseif( in_array( 'ndspkikeymaterial', $object_classes ) )
      -        return 'lock.png';
      +		return 'lock.png';
      +
       	elseif( in_array( 'server', $object_classes ) )
      -        return 'server-small.png';
      +		return 'server-small.png';
      +
       	elseif( in_array( 'volume', $object_classes ) )
      -        return 'hard-drive.png';
      +		return 'hard-drive.png';
      +
       	elseif( in_array( 'ndscatcatalog', $object_classes ) )
      -        return 'catalog.png';
      +		return 'catalog.png';
      +
       	elseif( in_array( 'resource', $object_classes ) )
      -        return 'n.png';
      +		return 'n.png';
      +
       	elseif( in_array( 'ldapgroup', $object_classes ) )
      -        return 'ldap-server.png';
      +		return 'ldap-server.png';
      +
       	elseif( in_array( 'ldapserver', $object_classes ) )
      -        return 'ldap-server.png';
      +		return 'ldap-server.png';
      +
       	elseif( in_array( 'nisserver', $object_classes ) )
      -        return 'ldap-server.png';
      +		return 'ldap-server.png';
      +
       	elseif( in_array( 'rbscollection', $object_classes ) )
      -        return 'ou.png';
      +		return 'ou.png';
      +
       	elseif( in_array( 'dfsconfiguration', $object_classes ) )
      -        return 'nt_machine.png';
      +		return 'nt_machine.png';
      +
       	elseif( in_array( 'applicationsettings', $object_classes ) )
      -        return 'server-settings.png';
      +		return 'server-settings.png';
      +
       	elseif( in_array( 'aspenalias', $object_classes ) )
      -        return 'mail.png';
      +		return 'mail.png';
      +
       	elseif( in_array( 'container', $object_classes ) )
      -        return 'folder.png';
      +		return 'folder.png';
      +
       	elseif( in_array( 'ipnetwork', $object_classes ) )
      -        return 'network.png';
      +		return 'network.png';
      +
       	elseif( in_array( 'samserver', $object_classes ) )
      -        return 'server-small.png';
      +		return 'server-small.png';
      +
       	elseif( in_array( 'lostandfound', $object_classes ) )
      -        return 'find.png';
      +		return 'find.png';
      +
       	elseif( in_array( 'infrastructureupdate', $object_classes ) )
      -        return 'server-small.png';
      +		return 'server-small.png';
      +
       	elseif( in_array( 'filelinktracking', $object_classes ) )
      -        return 'files.png';
      +		return 'files.png';
      +
       	elseif( in_array( 'automountmap', $object_classes ) ||
      -            in_array( 'automount', $object_classes ) )
      -        return 'hard-drive.png';
      -    elseif( 0 === strpos( $rdn_value, "ipsec" ) || 
      -            0 == strcasecmp( $rdn_value, "IP Security" ) ||
      -            0 == strcasecmp( $rdn_value, "MSRADIUSPRIVKEY Secret" ) ||
      -            0 === strpos( $rdn_value, "BCKUPKEY_" ) )
      -        return 'lock.png';
      +		in_array( 'automount', $object_classes ) )
      +
      +		return 'hard-drive.png';
      +
      +	elseif( 0 === strpos( $rdn_value, "ipsec" ) ||
      +		0 == strcasecmp( $rdn_value, "IP Security" ) ||
      +		0 == strcasecmp( $rdn_value, "MSRADIUSPRIVKEY Secret" ) ||
      +		0 === strpos( $rdn_value, "BCKUPKEY_" ) )
      +
      +		return 'lock.png';
      +
       	elseif( 0 == strcasecmp( $rdn_value, "MicrosoftDNS" ) )
      -        return 'dc.png';
      +		return 'dc.png';
      +
       	// Oh well, I don't know what it is. Use a generic icon.
       	else
       		return 'object.png';
      @@ -1348,17 +1287,19 @@ function get_icon( $server_id, $dn )
        *
        * @see get_icon
        */
      -function get_icon_use_cache( $server_id, $dn )
      -{
      -    initialize_session_tree();
      +function get_icon_use_cache( $ldapserver, $dn ) {
      +	debug_log(sprintf('get_icon_use_cache(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2);
      +
      +	initialize_session_tree();
      +
       	if( array_key_exists( 'tree_icons', $_SESSION ) ) {
      -		if( array_key_exists( $server_id, $_SESSION['tree_icons'] ) &&
      -			array_key_exists( $dn, $_SESSION['tree_icons'][$server_id] ) )
      -		{
      -			return $_SESSION['tree_icons'][ $server_id ][ $dn ];
      +		if( array_key_exists( $ldapserver->server_id, $_SESSION['tree_icons'] ) &&
      +			array_key_exists( $dn, $_SESSION['tree_icons'][$ldapserver->server_id] ) ) {
      +			return $_SESSION['tree_icons'][ $ldapserver->server_id ][ $dn ];
      +
       		} else {
      -			$icon = get_icon( $server_id, $dn );
      -			$_SESSION['tree_icons'][ $server_id ][ $dn ] = $icon;
      +			$icon = get_icon( $ldapserver, $dn );
      +			$_SESSION['tree_icons'][ $ldapserver->server_id ][ $dn ] = $icon;
       			return $icon;
       		}
       	}
      @@ -1372,7 +1313,7 @@ function get_icon_use_cache( $server_id, $dn )
        * is 'session', the $_SESSION array is checked.
        *
        * There are three cases for this function depending on the auth_type configured for
      - * the specified server. If the auth_type is form or http, then get_logged_in_dn() is 
      + * the specified server. If the auth_type is form or http, then get_logged_in_dn() is
        * called to verify that the user has logged in. If the auth_type is config, then the
        * $servers array in config.php is checked to ensure that the user has specified
        * login information. In any case, if phpLDAPadmin has enough information to login
      @@ -1381,13 +1322,12 @@ function get_icon_use_cache( $server_id, $dn )
        * @param int $server_id
        * @return bool
        * @see get_logged_in_dn
      + * @deprecated
        */
       function have_auth_info( $server_id )
       {
      -	global $servers;
      -
      -	if( ! check_server_id( $server_id ) )
      -		return false;
      +	global $servers, $ldapservers;
      +	$ldapserver = $ldapservers->Instance($server_id);
       
       	$server = $servers[$server_id];
       
      @@ -1395,7 +1335,7 @@ function have_auth_info( $server_id )
       	if( isset( $server['auth_type'] ) && ( in_array( $server['auth_type'], array( 'session', 'cookie' ) ) ) ) {
       		// we don't look at get_logged_in_pass() cause it may be null for anonymous binds
       		// get_logged_in_dn() will never return null if someone is really logged in.
      -		if( get_logged_in_dn( $server_id ) )
      +		if( get_logged_in_dn( $ldapserver ) )
       			return true;
       		else
       			return false;
      @@ -1407,7 +1347,7 @@ function have_auth_info( $server_id )
       	}
       	else {
       		global $lang;
      -		pla_error( sprintf( $lang['error_auth_type_config'], 
      +		pla_error( sprintf( $lang['error_auth_type_config'],
       			htmlspecialchars( $server[ 'auth_type' ] ) ) );
       	}
       }
      @@ -1416,113 +1356,115 @@ function have_auth_info( $server_id )
        * Fetches the password of the currently logged in user (for auth_types "form" and "http" only)
        * or false if the current login is anonymous.
        *
      - * @param int $server_id The ID of the server of interest.
      - *
      + * @param object $ldapserver The LDAPServer object of the server which the user hsa logged in.
        * @return string
      - *
        * @see have_auth_info
        * @see get_logged_in_dn
        */
      -function get_logged_in_pass( $server_id )
      -{
      -	global $servers;
      -	if( ! is_numeric( $server_id ) )
      +function get_logged_in_pass( $ldapserver ) {
      +	debug_log(sprintf('get_logged_in_pass(): Entered with (%s)',$ldapserver->server_id),2);
      +
      +	if (! $ldapserver->auth_type)
       		return false;
      -	if( ! isset( $servers[ $server_id ][ 'auth_type' ] ) )
      -		return false;
      -	$auth_type = $servers[ $server_id ][ 'auth_type' ];
      -	switch( $auth_type ) {
      +
      +	switch( $ldapserver->auth_type )
      +	{
       		case 'cookie':
      -			$cookie_name = 'pla_login_pass_' . $server_id;
      +			$cookie_name = sprintf('pla_login_pass_%s',$ldapserver->server_id);
       			$pass = isset( $_COOKIE[ $cookie_name ] ) ? $_COOKIE[ $cookie_name ] : false;
      +
       			if( $pass == '0' )
       				return null;
       			else
       				return pla_blowfish_decrypt( $pass );
       			break;
      -        case 'session':
      -			$session_var_name = 'pla_login_pass_' . $server_id;
      +
      +		case 'session':
      +			$session_var_name = sprintf('pla_login_pass_%s',$ldapserver->server_id);
       			$pass = isset( $_SESSION[ $session_var_name ] ) ? $_SESSION[ $session_var_name ] : false;
      +
       			if( $pass == '0' )
       				return null;
       			else
      -				return $pass;
      +				return pla_blowfish_decrypt ( $pass );
       			break;
      +
       		case 'config':
      -			if( isset( $servers[ $server_id ][ 'login_pass' ] ) )
      -				return ( $servers[ $server_id ][ 'login_pass' ] );
      -			return false;
      +			return $ldapserver->login_pass;
       			break;
      +
       		default:
      -            global $lang;
      -			pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $auth_type ) ) );
      +			global $lang;
      +			pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $ldapserver->auth_type ) ) );
       	}
       }
       
       /**
      - * Returns the DN who is logged in currently to the given server, which may 
      + * Returns the DN who is logged in currently to the given server, which may
        * either be a DN or the string 'anonymous'. This applies only for auth_types
      - * "form" and "http". 
      + * "form" and "http".
        *
        * One place where this function is used is the tree viewer:
        * After a user logs in, the text "Logged in as: " is displayed under the server
        * name. This information is retrieved from this function.
        *
      - * @param int $server_id The ID of the server of interest.
      - *
      + * @param object $ldapserver The LDAPServer object of the server which the user hsa logged in.
        * @return string
      - *
        * @see have_auth_info
        * @see get_logged_in_pass
        */
      -function get_logged_in_dn( $server_id )
      -{
      -	global $servers;
      -	if( ! is_numeric( $server_id ) )
      -		return false;
      -	if( ! isset( $servers[ $server_id ][ 'auth_type' ] ) )
      -		return false;
      -	$auth_type = $servers[ $server_id ][ 'auth_type' ];
      -	switch( $auth_type ) {
      -		case 'cookie':
      -			$cookie_name = 'pla_login_dn_' . $server_id;
      -			if( isset( $_COOKIE[ $cookie_name ] ) ) {
      -				$dn = $_COOKIE[ $cookie_name ];
      -			} else {
      -				return false;
      -			}
      -			return pla_blowfish_decrypt( $dn );
      -			break;
      -		case 'session':
      -			$session_var_name = 'pla_login_dn_' . $server_id;
      -			if( isset( $_SESSION[ $session_var_name ] ) ) {
      -				$dn = $_SESSION[ $session_var_name ];
      -                return $dn;
      -			} else {
      -				return false;
      -			}
      -			break;
      -		case 'config':
      -			if( isset( $servers[ $server_id ][ 'login_dn' ] ) )
      -				return ( $servers[ $server_id ][ 'login_dn' ] );
      -			return false;
      -			break;
      -		default:
      -            global $lang;
      -			pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $auth_type ) ) );
      +function get_logged_in_dn($ldapserver) {
      +	debug_log(sprintf('get_logged_in_dn(): Entered with (%s)',$ldapserver->server_id),2);
      +
      +	# Set default return
      +	$return = false;
      +
      +	if ($ldapserver->auth_type) {
      +		switch ($ldapserver->auth_type) {
      +			case 'cookie':
      +				$cookie_name = sprintf('pla_login_dn_%s',$ldapserver->server_id);
      +
      +				if (isset($_COOKIE[$cookie_name]))
      +					$return = pla_blowfish_decrypt($_COOKIE[$cookie_name]);
      +				else
      +					$return = false;
      +
      +				break;
      +
      +			case 'session':
      +				$session_var_name = sprintf('pla_login_dn_%s',$ldapserver->server_id);
      +
      +				if (isset($_SESSION[$session_var_name]))
      +					$return = pla_blowfish_decrypt($_SESSION[$session_var_name]);
      +				else
      +					$return = false;
      +
      +				break;
      +
      +			case 'config':
      +				$return = $ldapserver->login_dn;
      +				break;
      +
      +			default:
      +				global $lang;
      +				pla_error(sprintf($lang['unknown_auth_type'],htmlspecialchars($auth_type)));
      +		}
       	}
      +
      +	debug_log(sprintf('get_logged_in_dn(): Returning (%s)',$return),1);
      +	return $return;
       }
       
       /**
        * Appends a servers base to a "sub" dn or returns the base.
      + *
        * If $get_base is true, return at least the base, otherwise null.
      + * @param object $ldapserver The LDAPServer object of the server which the user hsa logged in.
      + * @return string|null
      + * @todo This function no longer return the base, since the LDAP server could have multiple bases.
        */
      -function expand_dn_with_base( $server_id, $sub_dn, $conn = null, $get_base = true )
      -{
      -	global $servers;
      -
      -	if( ! check_server_id( $server_id ) )
      -		return false;
      +function expand_dn_with_base( $ldapserver,$sub_dn,$get_base=true ) {
      +	debug_log(sprintf('expand_dn_with_base(): Entered with (%s,%s,%s)',$ldapserver->server_id,$sub_dn,$get_base),2);
       
       	$empty_str = ( is_null($sub_dn) || ( ( $len = strlen( trim( $sub_dn ) ) ) == 0 ) );
       
      @@ -1530,168 +1472,18 @@ function expand_dn_with_base( $server_id, $sub_dn, $conn = null, $get_base = tru
       		// If we have no string and want not base
       		if ( ! $get_base )
       			return null;
      +
       	} elseif ( $sub_dn[$len - 1] != ',' )
      -        // If we have a string which doesn't need a base
      +		// If we have a string which doesn't need a base
       		return $sub_dn;
       
      -	if( ( $empty_str && $get_base ) || ! $empty_str )
      -	{
      -		if( isset($servers[$server_id]['base']) ) {
      -			$base = $servers[$server_id]['base'];
      -			if ( strlen( trim( $base ) ) == 0 )
      -				$base = try_to_get_root_dn( $server_id, $conn );
      -		} else { 
      -            $base = try_to_get_root_dn( $server_id, $conn );
      -        }
      -
      -		if ( $base )
      -			return ( ! $empty_str ) ? $sub_dn . $base : $base;
      +	if( ( $empty_str && $get_base ) || ! $empty_str ) {
      +		if ( $ldapserver->getBaseDN() )
      +			return ( ! $empty_str ) ? $sub_dn . $ldapserver->getBaseDN() : $ldapserver->getBaseDN();
       	}
       	return null;
       }
       
      -/**
      - * Logs into the specified server using the auth_type configured for that server using
      - * ldap_connect() and ldap_bind() from the PHP LDAP API.
      - * If anonymous is true bind information (user / pass) is ignored (= anonymous).
      - * If anonymous is null a new bind is done (i.e. user changed).
      - *
      - * @param int $server_id The ID of the server of interest.
      - * @param bool $anonymous Set to override server config
      - * @return resource The LDAP connection resource or the LDAP errorcode
      - *
      - * @see get_logged_in_dn
      - * @see get_logged_in_pass
      - * @see have_auth_info
      - * @see check_server_id
      - */
      -function pla_ldap_connect( $server_id, $anonymous = false, $use_cache = true)
      -{
      -    //echo "pla_ldap_connect( $server_id, $anonymous, $use_cache )
      \n"; - if( ! check_server_id( $server_id ) ) - return -1; - - if( ! $anonymous && ! have_auth_info( $server_id ) ) - return -2; - - global $servers, $lang; - - // cache the connection, so if we are called multiple - // times, we don't have to reauthenticate with the LDAP server - static $conns; - - // We can reuse connections for multiple binds if we don't ldap_unbind - if( $use_cache && isset( $conns[ $server_id ] ) ) { - $conn = $conns[ $server_id ][ 'conn' ]; - $status = $conns[ $server_id ][ 'stat' ]; - - // Status tells us, if we can use the same bind - if( !is_null($status) && $status == $anonymous ) - return $conn; - } else { - $host = $servers[$server_id]['host']; - - $port = isset( $servers[$server_id]['port'] ) ? $servers[ $server_id ][ 'port' ] : false; - - if( $port ) - $conn = @ldap_connect( $host, $port ); - else - $conn = @ldap_connect( $host ); - - $conn or pla_error( sprintf( $lang['could_not_connect_to_host_on_port'], htmlspecialchars( $host ), htmlspecialchars( $port ) ) ); - - // go with LDAP version 3 if possible (needed for renaming and Novell schema fetching) - @ldap_set_option( $conn, LDAP_OPT_PROTOCOL_VERSION, 3 ); - // Disabling this makes it possible to browse the tree for Active Directory, and seems - // to not affect other LDAP servers (tested with OpenLDAP) as phpLDAPadmin explicitly - // specifies deref behavior for each ldap_search operation. - @ldap_set_option( $conn, LDAP_OPT_REFERRALS, 0); - - // try to fire up TLS is specified in the config - if( tls_enabled( $server_id ) ) { - function_exists( 'ldap_start_tls' ) or pla_error( $lang['php_install_not_supports_tls'] ); - @ldap_start_tls( $conn ) or pla_error( $lang['could_not_start_tls']); - } - - // store the cached connection resource - $conns[$server_id]['conn'] = $conn; - $conns[$server_id]['stat'] = null; - } - - if( $anonymous == true ) { - $login_dn = null; - $login_pass = null; - } // grab the auth info based on the auth_type for this server - elseif( $servers[ $server_id ][ 'auth_type' ] == 'config' ) { - $login_dn = $servers[$server_id]['login_dn']; - $login_pass = $servers[$server_id]['login_pass']; - $login_dn = expand_dn_with_base( $server_id, $login_dn, $conn, false ); - } else { - $login_dn = get_logged_in_dn( $server_id ); - $login_pass = get_logged_in_pass( $server_id ); - - // Was this an anonyous bind (the cookie stores 0 if so)? - if( 'anonymous' == $login_dn ) { - $login_dn = null; - $login_pass = null; - } - } - - $res = @ldap_bind( $conn, $login_dn, $login_pass ); - - if( ! $res ) - return ldap_errno( $conn ); - - // store the bind status - $conns[$server_id]['stat'] = $anonymous; - - return $conn; -} - -/** - * Convenient function to handle pla_ldap_connect results - * @see pla_ldap_connect - * - * @param resource $ds The pla_ldap_connect result - * @param bool $process_error Defines, if you want do run pla_error - * @return Returns false if the connection ($ds) is ok, or true otherwise. - */ -function pla_ldap_connection_is_error( $ds, $process_error = true ) -{ - if ( ! $process_error ) - return ( ! is_resource( $ds ) ); - else { - if ( ! is_resource( $ds ) ) { - global $lang; - - if( is_numeric( $ds ) ) { - switch( $ds ) { - case -1: pla_error( $lang['bad_server_id'] ); break; - case -2: pla_error( $lang['not_enough_login_info'] ); break; - default: pla_error( $lang['ferror_error'] ); break; - } - return true; - } - - switch( $ds ) { - case 0x31: - pla_error( $lang['bad_user_name_or_password'] ); - break; - case 0x32: - pla_error( $lang['insufficient_access_rights'] ); - break; - case 0x5b: - pla_error( $lang['could_not_connect'] ); - break; - default: - pla_error( $lang['could_not_bind'], ldap_err2str( $ds ), $ds ); - break; - } - } - return false; - } -} - /** * Gets a list of child entries for an entry. Given a DN, this function fetches the list of DNs of * child entries one level beneath the parent. For example, for the following tree: @@ -1709,32 +1501,31 @@ function pla_ldap_connection_is_error( $ds, $process_error = true ) * * Calling get_container_contents( $server_id, "ou=people,dc=example,dc=com" ) * would return the following list: - * + * * * cn=Dave * cn=Fred * cn=Joe * ou=More People * - * - * @param int $server_id The ID of the server housing the entry of interest + * + * @param object $ldapserver The LDAP Server Object housing the entry of interest * @param string $dn The DN of the entry whose children to return. - * @param int $size_limit (optional) The maximum number of entries to return. + * @param int $size_limit (optional) The maximum number of entries to return. * If unspecified, no limit is applied to the number of entries in the returned. * @param string $filter (optional) An LDAP filter to apply when fetching children, example: "(objectClass=inetOrgPerson)" * @return array An array of DN strings listing the immediate children of the specified entry. + * @todo Move this to an LDAPServer object method. */ -function get_container_contents( $server_id, $dn, $size_limit=0, $filter='(objectClass=*)', $deref=LDAP_DEREF_ALWAYS ) -{ - $conn = pla_ldap_connect( $server_id ); - if( pla_ldap_connection_is_error( $conn, false ) ) - return false; +function get_container_contents( $ldapserver, $dn, $size_limit=0, $filter='(objectClass=*)', $deref=LDAP_DEREF_ALWAYS ) { + debug_log(sprintf('get_container_contents(): Entered with (%s,%s,%s,%s,%s)', + $ldapserver->server_id,$dn,$size_limit,$filter,$deref),2); -// echo "get_container_contents( $server_id, $dn, $size_limit, $filter, $deref )\n"; - $search = @ldap_list( $conn, $dn, $filter, array( 'dn' ), 1, $size_limit, 0, $deref ); + $search = @ldap_list( $ldapserver->connect(), $dn, $filter, array( 'dn' ), 1, $size_limit, 0, $deref ); if( ! $search ) return array(); - $search = ldap_get_entries( $conn, $search ); + + $search = ldap_get_entries( $ldapserver->connect(), $search ); $return = array(); for( $i=0; $i<$search['count']; $i++ ) { @@ -1752,7 +1543,7 @@ function get_container_contents( $server_id, $dn, $size_limit=0, $filter='(objec * config.php. The structure of the returned array is simple, and looks like * this: * - * Array ( + * Array ( * 0 => Array ( ) * 1 => Array ( ) * ) @@ -1760,19 +1551,21 @@ function get_container_contents( $server_id, $dn, $size_limit=0, $filter='(objec * This function is not meant as a user callable function, but rather a convenient, * automated method for setting up the initial structure for the tree viewer. */ -function build_initial_tree() -{ - global $servers; - $tree = array(); - foreach( $servers as $id => $server ) { - if( $server['host'] == '' ) { - continue; - } +function build_initial_tree() { + debug_log(sprintf('build_initial_tree(): Entered with ()'),2); - $tree[$id] = array(); + global $ldapservers; + $return = array(); + + foreach ($ldapservers->GetServerList() as $id) { + if( $ldapservers->GetValue($id,'server','host') == '' ) + continue; + + $return[$id] = array(); } - return $tree; + debug_log(sprintf('build_initial_tree(): Returning (%s)',serialize($return)),1); + return $return; } /** @@ -1780,35 +1573,41 @@ function build_initial_tree() * array is then stored in the current session. The structure of the returned array is simple, and looks like * this: * - * Array - * ( - * [0] => Array + * Array + * ( + * [0] => Array * ( * [dc=example,dc=com] => "dcobject.png" * ) - * [1] => Array - ( + * [1] => Array + * ( * [o=Corporation] => "o.png" * ) * ) * - * This function is not meant as a user-callable function, but rather a convenient, automated method for + * This function is not meant as a user-callable function, but rather a convenient, automated method for * setting up the initial data structure for the tree viewer's icon cache. */ -function build_initial_tree_icons() -{ - global $servers; - $tree_icons = array(); +function build_initial_tree_icons() { + debug_log(sprintf('build_initial_tree_icons(): Entered with ()'),2); - // initialize an empty array for each server - foreach( $servers as $id => $server ) { - if( $server['host'] == '' ) + global $ldapservers; + $return = array(); + + # initialize an empty array for each server + foreach ($ldapservers->GetServerList() as $id) { + if( $ldapservers->GetValue($id,'server','host') == '' ) continue; - $tree_icons[ $id ] = array(); - $tree_icons[ $id ][ $server['base'] ] = get_icon( $id, $server['base'] ); + + $ldapserver = $ldapservers->Instance($id); + + $return[$id] = array(); + foreach ($ldapserver->getBaseDN() as $base_dn) + $return[$id][$base_dn] = get_icon($ldapserver,$base_dn); } - return $tree_icons; + debug_log(sprintf('build_initial_tree_icons(): Returning (%s)',serialize($return)),1); + return $return; } /* @@ -1817,8 +1616,9 @@ function build_initial_tree_icons() * This function is not meant as a user-callable function, but rather a convenient, * automated method for checking the initial data structure of the session. */ -function initialize_session_tree() -{ +function initialize_session_tree() { + debug_log(sprintf('initialize_session_tree(): Entered with ()'),2); + // From the PHP manual: If you use $_SESSION don't use // session_register(), session_is_registered() or session_unregister()! if( ! array_key_exists( 'tree', $_SESSION ) ) @@ -1826,84 +1626,88 @@ function initialize_session_tree() if( ! array_key_exists( 'tree_icons', $_SESSION ) ) $_SESSION['tree_icons'] = build_initial_tree_icons(); - // Make sure that the tree index is indeed well formed. - if( ! is_array( $_SESSION['tree'] ) ) + // Make sure that the tree index is indeed well formed. + if( ! is_array( $_SESSION['tree'] ) ) $_SESSION['tree'] = build_initial_tree(); - if( ! is_array( $_SESSION['tree_icons'] ) ) + if( ! is_array( $_SESSION['tree_icons'] ) ) $_SESSION['tree_icons'] = build_initial_tree_icons(); - } -/** +/** * Gets the operational attributes for an entry. Given a DN, this function fetches that entry's - * operational (ie, system or internal) attributes. These attributes include "createTimeStamp", + * operational (ie, system or internal) attributes. These attributes include "createTimeStamp", * "creatorsName", and any other attribute that the LDAP server sets automatically. The returned * associative array is of this form: * - * Array + * Array * ( - * [creatorsName] => Array + * [creatorsName] => Array * ( * [0] => "cn=Admin,dc=example,dc=com" * ) - * [createTimeStamp]=> Array + * [createTimeStamp]=> Array * ( * [0] => "10401040130" * ) - * [hasSubordinates] => Array + * [hasSubordinates] => Array * ( * [0] => "FALSE" * ) * ) * * - * @param int $server_id the ID of the server of interest. + * @param object $ldapserver The LDAP Server Object of interest * @param string $dn The DN of the entry whose interal attributes are desired. - * @param int $deref For aliases and referrals, this parameter specifies whether to + * @param int $deref For aliases and referrals, this parameter specifies whether to * follow references to the referenced DN or to fetch the attributes for * the referencing DN. See http://php.net/ldap_search for the 4 valid * options. * @return array An associative array whose keys are attribute names and whose values * are arrays of values for the aforementioned attribute. + * @todo Move this to an LDAPServer object method. */ -function get_entry_system_attrs( $server_id, $dn, $deref=LDAP_DEREF_NEVER ) -{ - $conn = pla_ldap_connect( $server_id ); - if( pla_ldap_connection_is_error( $conn, false ) ) - return false; +function get_entry_system_attrs( $ldapserver, $dn, $deref=LDAP_DEREF_NEVER ) { + debug_log(sprintf('get_entry_system_attrs(): Entered with (%s,%s,%s)',$ldapserver->server_id,$dn,$deref),2); - $attrs = array( 'creatorsname', 'createtimestamp', 'modifiersname', - 'structuralObjectClass', 'entryUUID', 'modifytimestamp', + $attrs = array( 'creatorsname', 'createtimestamp', 'modifiersname', + 'structuralObjectClass', 'entryUUID', 'modifytimestamp', 'subschemaSubentry', 'hasSubordinates', '+' ); - $search = @ldap_read( $conn, $dn, '(objectClass=*)', $attrs, 0, 0, 0, $deref ); + + $search = @ldap_read( $ldapserver->connect(), $dn, '(objectClass=*)', $attrs, 0, 0, 0, $deref ); if( ! $search ) return false; - $entry = ldap_first_entry( $conn, $search ); + + $entry = ldap_first_entry( $ldapserver->connect(), $search ); if( ! $entry) return false; - $attrs = ldap_get_attributes( $conn, $entry ); + + $attrs = ldap_get_attributes( $ldapserver->connect(), $entry ); if( ! $attrs ) return false; + if( ! isset( $attrs['count'] ) ) return false; + $count = $attrs['count']; unset( $attrs['count'] ); $return_attrs = array(); + for( $i=0; $i<$count; $i++ ) { $attr_name = $attrs[$i]; unset( $attrs[$attr_name]['count'] ); $return_attrs[$attr_name] = $attrs[$attr_name]; } + return $return_attrs; } /** * Gets the attributes/values of an entry. Returns an associative array whose * keys are attribute value names and whose values are arrays of values for - * said attribute. Optionally, callers may specify true for the parameter - * $lower_case_attr_names to force all keys in the associate array (attribute - * names) to be lower case. - * + * said attribute. Optionally, callers may specify true for the parameter + * $lower_case_attr_names to force all keys in the associate array (attribute + * names) to be lower case. + * * Sample return value of get_object_attrs( 0, "cn=Bob,ou=pepole,dc=example,dc=com" ) * * @@ -1929,38 +1733,33 @@ function get_entry_system_attrs( $server_id, $dn, $deref=LDAP_DEREF_NEVER ) * ) * * - * @param int $server_id The ID of the server of interest + * @param object $ldapserver The LDAP Server Object of interest * @param string $dn The distinguished name (DN) of the entry whose attributes/values to fetch. * @param bool $lower_case_attr_names (optional) If true, all keys of the returned associative * array will be lower case. Otherwise, they will be cased as the LDAP server returns * them. - * @param int $deref For aliases and referrals, this parameter specifies whether to + * @param int $deref For aliases and referrals, this parameter specifies whether to * follow references to the referenced DN or to fetch the attributes for * the referencing DN. See http://php.net/ldap_search for the 4 valid * options. * @return array * @see get_entry_system_attrs * @see get_object_attr + * @todo Move this to an LDAPServer object method. */ -function get_object_attrs( $server_id, $dn, $lower_case_attr_names=false, $deref=LDAP_DEREF_NEVER ) -{ - //echo "get_object_attrs( $server_id, $dn, $lower_case_attr_names )
      "; - $conn = pla_ldap_connect( $server_id ); - if( pla_ldap_connection_is_error( $conn, false ) ) - return false; - - $search = @ldap_read( $conn, $dn, '(objectClass=*)', array( ), 0, 0, 0, $deref ); +function get_object_attrs( $ldapserver, $dn, $lower_case_attr_names=false, $deref=LDAP_DEREF_NEVER ) { + debug_log(sprintf('get_object_attrs(): Entered with (%s,%s,%s,%s)', + $ldapserver->server_id,$dn,$lower_case_attr_names,$deref),2); + $search = @ldap_read( $ldapserver->connect(), $dn, '(objectClass=*)', array( ), 0, 0, 0, $deref ); if( ! $search ) return false; - $entry = ldap_first_entry( $conn, $search ); - + $entry = ldap_first_entry( $ldapserver->connect(), $search ); if( ! $entry ) return false; - - $attrs = ldap_get_attributes( $conn, $entry ); + $attrs = ldap_get_attributes( $ldapserver->connect(), $entry ); if( ! $attrs || $attrs['count'] == 0 ) return false; @@ -1975,14 +1774,15 @@ function get_object_attrs( $server_id, $dn, $lower_case_attr_names=false, $deref foreach( $attrs as $attr => $vals ) { if( $lower_case_attr_names ) $attr = strtolower( $attr ); - if( is_attr_binary( $server_id, $attr ) ) - $vals = ldap_get_values_len( $conn, $entry, $attr ); + + if( is_attr_binary( $ldapserver, $attr ) ) + $vals = ldap_get_values_len( $ldapserver->connect(), $entry, $attr ); + unset( $vals['count'] ); $return_array[ $attr ] = $vals; } ksort( $return_array ); - return $return_array; } @@ -1992,7 +1792,10 @@ function get_object_attrs( $server_id, $dn, $lower_case_attr_names=false, $deref * returns false. */ function is_printable_str($temp) { + debug_log(sprintf('is_printable_str(): Entered with (%s)',$temp),2); + $len = strlen($temp); + for ($i=0; $i<$len; $i++) { $ascii_val = ord( substr( $temp,$i,1 ) ); if( $ascii_val < 32 || $ascii_val > 126 ) @@ -2009,84 +1812,83 @@ function is_printable_str($temp) { * * print_r( get_object_attr( 0, "cn=Bob,ou=people,dc=example,dc=com", "sn" ) ); * // prints: - * // Array - * // ( + * // Array + * // ( * // [0] => "Smith" * // ) * * print_r( get_object_attr( 0, "cn=Bob,ou=people,dc=example,dc=com", "objectClass" ) ); * // prints: - * // Array - * // ( + * // Array + * // ( * // [0] => "top" * // [1] => "person" * // ) * - * + * * @param int $server_id The ID of the server of interest * @param string $dn The distinguished name (DN) of the entry whose attributes/values to fetch. * @param string $attr The attribute whose value(s) to return (ie, "objectClass", "cn", "userPassword") * @param bool $lower_case_attr_names (optional) If true, all keys of the returned associative * array will be lower case. Otherwise, they will be cased as the LDAP server returns * them. - * @param int $deref For aliases and referrals, this parameter specifies whether to + * @param int $deref For aliases and referrals, this parameter specifies whether to * follow references to the referenced DN or to fetch the attributes for * the referencing DN. See http://php.net/ldap_search for the 4 valid * options. * @see get_object_attrs + * @todo Move this to an LDAPServer object method. */ -function get_object_attr( $server_id, $dn, $attr, $deref=LDAP_DEREF_NEVER ) -{ - /** - $attr = strtolower( $attr ); - $attrs = get_object_attrs( $server_id, $dn, true ); +function get_object_attr( $ldapserver, $dn, $attr, $lower_case_attr_names=false, $deref=LDAP_DEREF_NEVER ) { + debug_log(sprintf('get_object_attr(): Entered with (%s,%s,%s,%s,%s)', + $ldapserver->server_id,$dn,$attr,$lower_case_attr_names,$deref),2); + + if ($lower_case_attr_names) + $attr = strtolower( $attr ); + + $attrs = get_object_attrs( $ldapserver, $dn, $lower_case_attr_names, $deref ); if( isset( $attrs[$attr] ) ) return $attrs[$attr]; else return false; - */ //echo "get_object_attr( $server_id, $dn, $attr )
      "; - $conn = pla_ldap_connect( $server_id ); - if( pla_ldap_connection_is_error( $conn, false ) ) - return false; - - $search = @ldap_read( $conn, $dn, '(objectClass=*)', array( $attr ), 0, 0, 0, $deref ); + /* + $search = @ldap_read( $ldapesrver->connect(), $dn, '(objectClass=*)', array( $attr ), 0, 0, 0, $deref ); if( ! $search ) return false; - $entry = ldap_first_entry( $conn, $search ); - + $entry = ldap_first_entry( $ldapesrver->connect(), $search ); if( ! $entry ) return false; - - $attrs = ldap_get_attributes( $conn, $entry ); + $attrs = ldap_get_attributes( $ldapesrver->connect(), $entry ); if( ! $attrs || $attrs['count'] == 0 ) return false; - if( is_attr_binary( $server_id, $attr ) ) - $vals = ldap_get_values_len( $conn, $entry, $attr ); + if( is_attr_binary( $ldapserver, $attr ) ) + $vals = ldap_get_values_len( $ldapesrver->connect(), $entry, $attr ); else - $vals = ldap_get_values( $conn, $entry, $attr ); + $vals = ldap_get_values( $ldapesrver->connect(), $entry, $attr ); unset( $vals['count'] ); return $vals; + */ } /** - * A handy ldap searching function very similar to PHP's ldap_search() with the - * following exceptions: Callers may specify a search scope and the return value + * A handy ldap searching function very similar to PHP's ldap_search() with the + * following exceptions: Callers may specify a search scope and the return value * is an array containing the search results rather than an LDAP result resource. * * Example usage: * - * $samba_users = ldap_search( 0, "(&(objectClass=sambaAccount)(objectClass=posixAccount))", + * $samba_users = ldap_search( 0, "(&(objectClass=sambaAccount)(objectClass=posixAccount))", * "ou=People,dc=example,dc=com", array( "uid", "homeDirectory" ) ); * print_r( $samba_users ); - * // prints (for example): - * // Array - * // ( + * // prints (for example): + * // Array + * // ( * // [uid=jsmith,ou=People,dc=example,dc=com] => Array * // ( * // [dn] => "uid=jsmith,ou=People,dc=example,dc=com" @@ -2101,45 +1903,39 @@ function get_object_attr( $server_id, $dn, $attr, $deref=LDAP_DEREF_NEVER ) * // ) * // ) * - * + * * WARNING: This function will use a lot of memory on large searches since the entire result set is - * stored in a single array. For large searches, you should consider sing the less memory intensive + * stored in a single array. For large searches, you should consider sing the less memory intensive * PHP LDAP API directly (ldap_search(), ldap_next_entry(), ldap_next_attribute(), etc). * * @param int $server_id The ID of the server to search on. * @param string $filter The LDAP filter to use when searching (example: "(objectClass=*)") (see RFC 2254) - * @param string $base_dn The DN of the base of search. + * @param string $base_dn The DN of the base of search. * @param array $attrs An array of attributes to include in the search result (example: array( "objectClass", "uid", "sn" )). * @param string $scope The LDAP search scope. Must be one of "base", "one", or "sub". Standard LDAP search scope. - * @param bool $sort_results Specify false to not sort results by DN or true to have the + * @param bool $sort_results Specify false to not sort results by DN or true to have the * returned array sorted by DN (uses ksort) - * @param int $deref When handling aliases or referrals, this specifies whether to follow referrals. Must be one of + * @param int $deref When handling aliases or referrals, this specifies whether to follow referrals. Must be one of * LDAP_DEREF_ALWAYS, LDAP_DEREF_NEVER, LDAP_DEREF_SEARCHING, or LDAP_DEREF_FINDING. See the PHP LDAP API for details. + * @todo Move this to an LDAPServer object method. */ -function pla_ldap_search( $server_id, $filter, $base_dn=null, $attrs=array(), $scope='sub', $sort_results=true, $deref=LDAP_DEREF_ALWAYS ) -{ - global $servers; +function pla_ldap_search( $ldapserver, $filter, $base_dn=null, $attrs=array(), $scope='sub', $sort_results=true, $deref=LDAP_DEREF_ALWAYS ) { + debug_log(sprintf('pla_ldap_search(): Entered with (%s,%s,%s,%s,%s,%s,%s)', + $ldapserver->server_id,$filter,$base_dn,count($attrs),$scope,$sort_results,$deref),2); - if( ! check_server_id( $server_id ) ) - return false; - - if( $base_dn == null ) - $base_dn = $servers[$server_id]['base']; - - $ds = pla_ldap_connect( $server_id ); - if( pla_ldap_connection_is_error( $ds, false ) ) - return false; + if( is_null($base_dn)) + $base_dn = $ldapserver->getBaseDN(); switch( $scope ) { case 'base': - $search = @ldap_read( $ds, $base_dn, $filter, $attrs, 0, 0, 0, $deref ); + $search = @ldap_read( $ldapserver->connect(false), $base_dn, $filter, $attrs, 0, 0, 0, $deref ); break; case 'one': - $search = @ldap_list( $ds, $base_dn, $filter, $attrs, 0, 0, 0, $defef ); + $search = @ldap_list( $ldapserver->connect(false), $base_dn, $filter, $attrs, 0, 0, 0, $defef ); break; case 'sub': default: - $search = @ldap_search( $ds, $base_dn, $filter, $attrs, 0, 0, 0, $deref ); + $search = @ldap_search( $ldapserver->connect(false), $base_dn, $filter, $attrs, 0, 0, 0, $deref ); break; } @@ -2147,28 +1943,29 @@ function pla_ldap_search( $server_id, $filter, $base_dn=null, $attrs=array(), $s return array(); $return = array(); + //get the first entry identifier - if( $entry_id = ldap_first_entry($ds,$search) ) + if( $entry_id = ldap_first_entry($ldapserver->connect(false),$search) ) //iterate over the entries while($entry_id) { //get the distinguished name of the entry - $dn = ldap_get_dn($ds,$entry_id); + $dn = ldap_get_dn($ldapserver->connect(false),$entry_id); //get the attributes of the entry - $attrs = ldap_get_attributes($ds,$entry_id); + $attrs = ldap_get_attributes($ldapserver->connect(false),$entry_id); $return[$dn]['dn'] = $dn; //get the first attribute of the entry - if($attr = ldap_first_attribute($ds,$entry_id,$attrs)) + if($attr = ldap_first_attribute($ldapserver->connect(false),$entry_id,$attrs)) //iterate over the attributes - while($attr){ - if( is_attr_binary($server_id,$attr)) - $values = ldap_get_values_len($ds,$entry_id,$attr); + while($attr) { + if( is_attr_binary($ldapserver,$attr)) + $values = ldap_get_values_len($ldapserver->connect(false),$entry_id,$attr); else - $values = ldap_get_values($ds,$entry_id,$attr); + $values = ldap_get_values($ldapserver->connect(false),$entry_id,$attr); //get the number of values for this attribute $count = $values['count']; @@ -2178,10 +1975,10 @@ function pla_ldap_search( $server_id, $filter, $base_dn=null, $attrs=array(), $s else $return[$dn][$attr] = $values; - $attr = ldap_next_attribute($ds,$entry_id,$attrs); + $attr = ldap_next_attribute($ldapserver->connect(false),$entry_id,$attrs); }// end while attr - $entry_id = ldap_next_entry($ds,$entry_id); + $entry_id = ldap_next_entry($ldapserver->connect(false),$entry_id); } // end while entry_id @@ -2195,12 +1992,14 @@ function pla_ldap_search( $server_id, $filter, $base_dn=null, $attrs=array(), $s * Reads the query, checks all values and sets defaults. * * @param int $query_id The ID of the predefined query. - * * @return array The fixed query or null on error + * @todo Fix base_dn processing and use getBaseDN() + * @todo expand_dn_with_base no longer knows what the base_dn is, so you need to pass it the base, need to fix this function. */ -function get_cleaned_up_predefined_search( $query_id ) -{ - global $queries; +function get_cleaned_up_predefined_search( $query_id ) { + debug_log(sprintf('get_cleaned_up_predefined_search(): Entered with (%s)',$query_id),2); + + global $ldapservers,$queries; if( ! isset( $queries[$query_id] ) ) return null; @@ -2211,13 +2010,15 @@ function get_cleaned_up_predefined_search( $query_id ) $server_id = $query['server']; else $server_id = 0; + $ldapserver = $ldapservers->Instance($server_id); + $base = ( isset( $query['base'] ) ) ? $query['base'] : null; - $base = expand_dn_with_base( $server_id, $base ); + $base = expand_dn_with_base( $ldapserver, $base ); if( isset( $query['filter'] ) && strlen( trim( $query['filter'] ) ) > 0 ) $filter = $query['filter']; else - $filter = 'objectclass=*'; + $filter = 'objectclass=*'; $scope = isset( $query['scope'] ) && ( in_array( $query['scope'], array( 'base', 'sub', 'one' ) ) ) @@ -2225,71 +2026,34 @@ function get_cleaned_up_predefined_search( $query_id ) if( isset( $query['attributes'] ) && strlen( trim( $query['filter'] ) ) > 0 ) $attrib = $query['attributes']; - else - $attrib = "dn, cn, sn, objectClass"; + else + $attrib = "dn, cn, sn, objectClass"; - return array ( 'server' => $server_id, 'base' => $base, + return array ( + 'server' => $server_id, 'base' => $base, 'filter' => $filter, 'scope' => $scope, 'attributes' => $attrib ); } /** - * Transforms the user-configured search lists into arrays for use by other components of phpLDAPadmin. - * This may seem a little strange, and that's because it is strange. - * - * The function takes the comma-separated lists (like the search result attribute list) in config.php - * and turns them into arrays. Only call this ONCE per script. Any subsequent call will - * mess up the arrays. This function operates on global variables defined in config.php and is currently - * only used by search_form_simple.php - * - * For more details, just read the function's code. It's short and pretty straightforward. - */ -function process_config() -{ - global $search_result_attributes; - $search_result_attributes = explode( ",", $search_result_attributes ); - array_walk( $search_result_attributes, "trim_it" ); - - global $search_attributes_display; - $search_attributes_display = explode( ",", $search_attributes_display ); - array_walk( $search_attributes_display, "trim_it" ); - - global $search_attributes; - $search_attributes= explode( ",", $search_attributes); - array_walk( $search_attributes, "trim_it" ); - - if( count( $search_attributes ) != count( $search_attributes_display ) ) - pla_error( $lang['search_Attrs_wrong_count'] ); -} - -/** - * Trim a string in place (call by reference) Used to filter empty entries out of the arrays - * that we generate in process_config(). - * - * @see process_config - */ -function trim_it( &$str ) -{ - $str = trim($str); -} - -/** - * Checks the specified server id for sanity. Ensures that the server is indeed in the configured - * list and active. This is used by many many scripts to ensure that valid server ID values + * Checks the specified server id for sanity. Ensures that the server is indeed in the configured + * list and active. This is used by many many scripts to ensure that valid server ID values * are passed in POST and GET. + * @deprecated */ -function check_server_id( $server_id ) -{ - global $servers; - if( ! is_numeric( $server_id ) || ! isset( $servers[$server_id] ) || ! isset( $servers[$server_id]['host'] ) || $servers[$server_id]['host'] == '' ) +function check_server_id( $server_id ) { + global $ldapservers; + + $ldapserver = $ldapservers->Instance($server_id); + if(! isset( $ldapserver->host ) || $ldapserver->host == '' ) return false; else return true; } /** - * Used to generate a random salt for crypt-style passwords. Salt strings are used - * to make pre-built hash cracking dictionaries difficult to use as the hash algorithm uses - * not only the user's password but also a randomly generated string. The string is + * Used to generate a random salt for crypt-style passwords. Salt strings are used + * to make pre-built hash cracking dictionaries difficult to use as the hash algorithm uses + * not only the user's password but also a randomly generated string. The string is * stored as the first N characters of the hash for reference of hashing algorithms later. * * --- added 20021125 by bayu irawan --- @@ -2298,42 +2062,26 @@ function check_server_id( $server_id ) * @param int $length The length of the salt string to generate. * @return string The generated salt string. */ -function random_salt( $length ) -{ - $possible = '0123456789'. - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - './'; - $str = ""; - mt_srand((double)microtime() * 1000000); +function random_salt( $length ) { + debug_log(sprintf('random_salt(): Entered with (%s)',$length),2); + + $possible = '0123456789'. + 'abcdefghijklmnopqrstuvwxyz'. + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. + './'; + $str = ""; + mt_srand((double)microtime() * 1000000); + while( strlen( $str ) < $length ) - { $str .= substr( $possible, ( rand() % strlen( $possible ) ), 1 ); - } + /** * Commented out following line because of problem * with crypt function in update.php * --- 20030625 by S C Rigler --- */ - //$str = "\$1\$".$str."\$"; - return $str; -} - -/** - * Goes through the user-configured server list and looks for an available server_id, - * one that has specified enough information to login. This is for choosing the - * server to display in the drop-down box in search.php. - * - * @return int The first available server ID found. - */ -function get_avail_server_id() -{ - global $servers; - - for( $i=0; $i $value) { + if ($value == '..') { + if (get_container($container)) + $container = get_container($container); + + } else { + break; + } + } + + return $container; + } +} + /** * Given an LDAP error number, returns a verbose description of the error. * This function parses ldap_error_codes.txt and looks up the specified @@ -2390,30 +2192,31 @@ function get_container( $dn ) * @param string $err_no The hex error number (ie, "0x42") of the LDAP error of interest. * @return array An associative array contianing the error title and description like so: * - * Array + * Array * ( * [title] => "Invalid Credentials" * [description] => "An invalid username and/or password was supplied to the LDAP server." * ) * */ -function pla_verbose_error( $err_no ) -{ +function pla_verbose_error( $err_no ) { + debug_log(sprintf('pla_verbose_error(): Entered with (%s)',$err_no),2); + static $err_codes; if( count($err_codes) > 0 ) { if( isset( $err_codes[ $err_no ] ) ) return $err_codes[ $err_no ]; else return array( 'title' => null, 'desc' => null ); - } + } - $err_codes_file = 'ldap_error_codes.txt'; + $err_codes_file = LIBDIR.'ldap_error_codes.txt'; - if( ! file_exists( realpath( $err_codes_file ) ) ) + if( ! file_exists($err_codes_file)) return false; - if( ! is_readable( realpath( $err_codes_file ) ) ) + if( ! is_readable($err_codes_file)) return false; - if( ! ($f = fopen( realpath( $err_codes_file ), 'r' ) ) ) + if( ! ($f = fopen($err_codes_file,'r'))) return false; $contents = fread( $f, filesize( $err_codes_file ) ); @@ -2438,25 +2241,73 @@ function pla_verbose_error( $err_no ) return array( 'title' => null, 'desc' => null ); } +// @todo: describe this function +function support_oid_to_text($oid_id) { + debug_log(sprintf('support_oid_to_text(): Entered with (%s)',$oid_id),2); + + static $oid; + if( count($oid) > 0 ) { + if( isset( $oid[ $oid_id ] ) ) + return $oid[ $oid_id ]; + + else + return null; + } + + $oid_codes_file = LIBDIR.'ldap_supported_oids.txt'; + + if( ! file_exists($oid_codes_file)) + return false; + if( ! is_readable($oid_codes_file)) + return false; + if( ! ($f = fopen($oid_codes_file,'r'))) + return false; + + $contents = fread( $f, filesize( $oid_codes_file ) ); + fclose( $f ); + $entries = array(); + preg_match_all( "/[0-9]\..+\s+\"[^\"]*\"\n/", $contents, $entries ); + $err_codes = array(); + foreach( $entries[0] as $e ) { + $entry = array(); + preg_match( "/([0-9]\.([0-9]+\.)*[0-9]+)(\s+\"([^\"]*)\")?(\s+\"([^\"]*)\")?(\s+\"([^\"]*)\")?/", $e, $entry ); + $oid_id_a = isset( $entry[1] ) ? $entry[1] : null; + + if ($oid_id_a) { + $oid[$oid_id_a]['title'] = isset( $entry[4] ) ? $entry[4] : null; + $oid[$oid_id_a]['ref'] = isset( $entry[6] ) ? $entry[6] : null; + $desc = isset( $entry[8] ) ? $entry[8] : null; + $oid[$oid_id_a]['desc'] = preg_replace( "/\s+/", " ", $desc ); + } + } + + // Sanity check + if( isset( $oid[ $oid_id ] ) ) + return $oid[ $oid_id ]; + else + return null; +} + /** * Prints an HTML-formatted error string. If you specify the optional - * parameters $ldap_err_msg and $ldap_err_no, this function will - * lookup the error number and display a verbose message in addition + * parameters $ldap_err_msg and $ldap_err_no, this function will + * lookup the error number and display a verbose message in addition * to the message you pass it. - * + * * @param string $msg The error message to display. - * @param string $ldap_err_msg (optional) The error message supplied by the LDAP server - * @param string $ldap_err_no (optional) The hexadecimal error number string supplied by the LDAP server + * @param string $ldap_err_msg (optional) The error message supplied by the LDAP server + * @param string $ldap_err_no (optional) The hexadecimal error number string supplied by the LDAP server * @param bool $fatal (optional) If true, phpLDAPadmin will terminate execution with the PHP die() function. * * @see die * @see ldap_errno * @see pla_verbose_error */ -function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) -{ - @include_once 'header.php'; - global $lang; +function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) { + debug_log(sprintf('pla_error(): Entered with (%s,%s,%s,%s)',$msg,$ldap_err_msg,$ldap_err_no,$fatal),2); + + @include_once './header.php'; + global $lang, $config; ?>
      @@ -2467,6 +2318,8 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true )
      '; @@ -2485,6 +2338,8 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) echo '
      '; echo $lang['ferror_discription_short']; } + + syslog_err ( sprintf($lang['ferror_number_short'], $ldap_err_no) ); } ?>
      @@ -2493,8 +2348,8 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true )
      - @@ -2504,14 +2359,15 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true )
      \n"; die(); + } } /** * phpLDAPadmin's custom error handling function. When a PHP error occurs, - * PHP will call this function rather than printing the typical PHP error string. + * PHP will call this function rather than printing the typical PHP error string. * This provides phpLDAPadmin the ability to format an error message more "pretty" * and provide a link for users to submit a bug report. This function is not to * be called by users. It is exclusively for the use of PHP internally. If this @@ -2526,8 +2382,9 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) * * @see set_error_handler */ -function pla_error_handler( $errno, $errstr, $file, $lineno ) -{ +function pla_error_handler( $errno, $errstr, $file, $lineno ) { + debug_log(sprintf('pla_error_handler(): Entered with (%s,%s,%s,%s)',$errno,$errstr,$file,$lineno),2); + global $lang; // error_reporting will be 0 if the error context occurred @@ -2535,7 +2392,7 @@ function pla_error_handler( $errno, $errstr, $file, $lineno ) // So, don't report errors if the caller has specifically // disabled them with '@' if( 0 == ini_get( 'error_reporting' ) || 0 == error_reporting() ) - return; + return; $file = basename( $file ); $caller = basename( $_SERVER['PHP_SELF'] ); @@ -2557,18 +2414,19 @@ function pla_error_handler( $errno, $errstr, $file, $lineno ) default: $errtype = $lang['ferror_unrecognized_num'] . $errno; } + $errstr = preg_replace("/\s+/"," ",$errstr); if( $errno == E_NOTICE ) { echo sprintf($lang['ferror_nonfatil_bug'], $errstr, $errtype, $file, - $lineno, $caller, pla_version(), phpversion(), php_sapi_name(), - $_SERVER['SERVER_SOFTWARE'], get_href('add_bug')); + $lineno, $caller, pla_version(), phpversion(), php_sapi_name(), + $_SERVER['SERVER_SOFTWARE'], get_href('search_bug',"&summary_keyword=".htmlspecialchars($errstr)),get_href('add_bug')); return; } $server = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'undefined'; $phpself = isset( $_SERVER['PHP_SELF'] ) ? basename( $_SERVER['PHP_SELF'] ) : 'undefined'; - pla_error( sprintf($lang['ferror_congrats_found_bug'], $errstr, $errtype, $file, - $lineno, $phpself, pla_version(), - phpversion(), php_sapi_name(), $server )); + pla_error( sprintf($lang['ferror_congrats_found_bug'], $errstr, $errtype, $file, + $lineno, $phpself, pla_version(), + phpversion(), php_sapi_name(), $server )); } /** @@ -2577,9 +2435,10 @@ function pla_error_handler( $errno, $errstr, $file, $lineno ) * in config.php. This is simply used so we can more easily lookup user-friendly * attributes configured by the admin. */ -function process_friendly_attr_table() -{ - require 'config.php'; +function process_friendly_attr_table() { + debug_log(sprintf('process_friendly_attr_table(): Entered with ()'),2); + + // require 'config.php'; global $friendly_attrs; $attrs_table = array(); if( isset( $friendly_attrs ) && is_array( $friendly_attrs ) ) @@ -2592,38 +2451,55 @@ function process_friendly_attr_table() } /** - * Gets whether an entry exists based on its DN. If the entry exists, - * returns true. Otherwise returns false. - * - * @param int $server_id The ID of the server of interest - * @param string $dn The DN\of the entry of interest. - * - * @return bool + * Show friendly attribute. */ -function dn_exists( $server_id, $dn ) -{ - if( ! check_server_id( $server_id ) ) - return false; +function show_friendly_attribute($attr) { + debug_log(sprintf('show_friendly_attribute(): Entered with (%s)',$attr),2); - $ds = pla_ldap_connect( $server_id ); - if( pla_ldap_connection_is_error( $ds, false ) ) - return false; + $friendly_attrs = process_friendly_attr_table(); - $search_result = @ldap_read( $ds, $dn, 'objectClass=*', array('dn') ); - - if( ! $search_result ) - return false; - - $num_entries = ldap_count_entries( $ds, $search_result ); - - if( $num_entries > 0 ) - return true; + if (isset($friendly_attrs[strtolower($attr)])) + $return = $friendly_attrs[strtolower($attr)]; else - return false; + $return = $attr; + + debug_log(sprintf('show_friendly_attribute(): Returning (%s)',$return),1); + return $return; } /** - * Draw the jpegPhoto image(s) for an entry wrapped in HTML. Many options are available to + * Gets whether an entry exists based on its DN. If the entry exists, + * returns true. Otherwise returns false. + * + * @param object $ldapserver The LDAP Server Object of interest + * @param string $dn The DN\of the entry of interest. + * + * @return bool + * @todo Move this to an LDAPServer object method. + */ +function dn_exists($ldapserver,$dn) { + debug_log(sprintf('dn_exists(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2); + + $search_result = @ldap_read($ldapserver->connect(false),$dn,'objectClass=*',array('dn')); + + # Set default return + $return = false; + + if ($search_result) { + $num_entries = ldap_count_entries($ldapserver->connect(false),$search_result); + + if ($num_entries > 0) + $return = true; + else + $return = false; + } + + debug_log(sprintf('dn_exists(): Returning (%s)',$return),1); + return $return; +} + +/** + * Draw the jpegPhoto image(s) for an entry wrapped in HTML. Many options are available to * specify how the images are to be displayed. * * Usage Examples: @@ -2643,38 +2519,47 @@ function dn_exists( $server_id, $dn ) * * @return void */ -function draw_jpeg_photos( $server_id, $dn, $attr_name='jpegPhoto', $draw_delete_buttons=false, - $draw_bytes_and_size=true, $table_html_attrs='align="left"', $img_html_attrs='' ) -{ - global $jpeg_temp_dir; - global $jpeg_tmp_keep_time; - global $lang; +function draw_jpeg_photos( $ldapserver, $dn, $attr_name='jpegPhoto', $draw_delete_buttons=false, + $draw_bytes_and_size=true, $table_html_attrs='align="left"', $img_html_attrs='' ) { + debug_log(sprintf('draw_jpeg_photos(): Entered with (%s,%s,%s,%s,%s,%s,%s)', + $ldapserver->server_id,$dn,$attr_name,$draw_delete_buttons,$draw_bytes_and_size, + $table_html_attrs,$img_html_attrs),2); - $conn = pla_ldap_connect( $server_id ); - if( pla_ldap_connection_is_error( $conn, false ) ) - return; - $search_result = ldap_read( $conn, $dn, 'objectClass=*', array( $attr_name ) ); - $entry = ldap_first_entry( $conn, $search_result ); + global $config, $lang; + + $fixed_width = false; + $fixed_height = false; + if (eregi(" width",$img_html_attrs) || eregi("^width",$img_html_attrs)) + $fixed_width = true; + if (eregi(" height=",$img_html_attrs) || eregi("^height=",$img_html_attrs)) + $fixed_height = true; + + $search_result = ldap_read( $ldapserver->connect(), $dn, 'objectClass=*', array( $attr_name ) ); + $entry = ldap_first_entry( $ldapserver->connect(), $search_result ); + + if (isset($table_html_attrs) && $table_html_attrs != "" ) + echo "
      - 1 ){ - echo ''; - } else { - $server = reset($servers); - if( $server['host'] ) - echo '' . - '' . $server['name'] . ''; - } - ?> -
      \n\n"; - echo "
      \n\n"; // for each jpegPhoto in the entry, draw it (there may be only one, and that's okay) - $jpeg_data = @ldap_get_values_len( $conn, $entry, $attr_name ); - if( ! is_array( $jpeg_data ) ) { - echo "Could not fetch jpeg data from LDAP server for attribute " . htmlspecialchars( $attr_name ); - return; - } - for( $i=0; $i<$jpeg_data['count']; $i++ ) - { - // ensures that the photo is written to the specified jpeg_temp_dir - $jpeg_temp_dir = realpath($jpeg_temp_dir.'/'); - if( ! is_writable( $jpeg_temp_dir ) ) - pla_error( 'Please set $jpeg_temp_dir to a writable directory in the phpLDAPadmin config.php' ); + $jpeg_data = @ldap_get_values_len( $ldapserver->connect(), $entry, $attr_name ); + if( ! is_array( $jpeg_data ) ) { + printf( $lang['jpeg_unable_toget'], htmlspecialchars( $attr_name )); + return; + } + + for( $i=0; $i<$jpeg_data['count']; $i++ ) { + // ensures that the photo is written to the specified jpeg['tmpdir'] + $jpeg_temp_dir = realpath($config->GetValue('jpeg','tmpdir').'/'); + if( ! is_writable( $jpeg_temp_dir ) ) + pla_error( $lang['jpeg_dir_not_writable'] ); + $jpeg_filename = tempnam($jpeg_temp_dir.'/', 'pla'); $outjpeg = @fopen($jpeg_filename, "wb"); - if( ! $outjpeg ) - pla_error( 'Could not write to the $jpeg_temp_dir directory (' . $jpeg_temp_dir . '). Please verify that your web server can write files there.' ); + if( ! $outjpeg ) + pla_error( sprintf( $lang['jpeg_dir_not_writable_error'],$jpeg_temp_dir )); fwrite($outjpeg, $jpeg_data[$i]); fclose ($outjpeg); + $jpeg_data_size = filesize( $jpeg_filename ); if( $jpeg_data_size < 6 && $draw_delete_buttons ) { echo $lang['jpeg_contains_errors']; @@ -2682,44 +2567,44 @@ function draw_jpeg_photos( $server_id, $dn, $attr_name='jpegPhoto', $draw_delete continue; } - if( function_exists( 'getimagesize' ) ) { - $jpeg_dimensions = @getimagesize( $jpeg_filename ); - $width = $jpeg_dimensions[0]; - $height = $jpeg_dimensions[1]; - } else { - $width = 0; - $height = 0; - } + if( function_exists( 'getimagesize' ) ) { + $jpeg_dimensions = @getimagesize( $jpeg_filename ); + $width = $jpeg_dimensions[0]; + $height = $jpeg_dimensions[1]; + + } else { + $width = 0; + $height = 0; + } + if( $width > 300 ) { $scale_factor = 300 / $width; $img_width = 300; $img_height = $height * $scale_factor; + } else { $img_width = $width; $img_height = $height; } - echo "
      \n"; + + print "
      \n"; + if( $draw_bytes_and_size ) { echo "" . number_format($jpeg_data_size) . " bytes. "; echo "$width x $height pixels.
      \n\n"; } - if( $draw_delete_buttons ) - { ?> + if( $draw_delete_buttons ) { ?> - Delete Photo +
      \n\n"; - // If they have misconfigured their config.php, use default values - if( ! isset( $jpeg_tmp_keep_time ) ) - $jpeg_tmp_keep_time = 120; - - // If they set keep time to 0, we up it to 10 to allow the browser to fetch it before it is deleted. - if( $jpeg_tmp_keep_time == 0 ) - $jpeg_tmp_keep_time = 10; + if (isset($table_html_attrs) && $table_html_attrs != "" ) + echo "
      \n\n"; // delete old jpeg files. $jpegtmp_wildcard = "/^pla/"; @@ -2727,7 +2612,7 @@ function draw_jpeg_photos( $server_id, $dn, $attr_name='jpegPhoto', $draw_delete while( ($file = readdir($handle) ) != false ) { if( preg_match( $jpegtmp_wildcard, $file ) ) { $file = "$jpeg_temp_dir/$file"; - if( (time() - filemtime($file) ) > $jpeg_tmp_keep_time ) + if ((time() - filemtime($file)) > $config->GetValue('jpeg','tmp_keep_time')) @unlink( $file ); } } @@ -2735,107 +2620,92 @@ function draw_jpeg_photos( $server_id, $dn, $attr_name='jpegPhoto', $draw_delete } /** - * Gets the root DN of the specified server_id, or false if it - * can't find it (ie, the server won't give it to us). This is - * used when the user leaves the $servers[$i]['base'] value empty - * to auto-determine the root DN. - * - * Tested with OpenLDAP 2.0, Netscape iPlanet, and Novell eDirectory 8.7 (nldap.com) - * Please report any and all bugs!! - * - * @param int $server_id The ID of the server whose root DN to fetch. - * @return mixed The root DN of the server on success (string) or false on error. - */ -function try_to_get_root_dn( $server_id, $ds = null ) -{ - if( is_null( $ds ) ) { - if( ! check_server_id( $server_id ) ) - return false; - - if( isset( $_SESSION[ "pla_root_dn_$server_id" ] ) ) - return $_SESSION[ "pla_root_dn_$server_id" ]; - - if( ! have_auth_info( $server_id ) ) - return false; - - $ds = pla_ldap_connect( $server_id ); - if ( pla_ldap_connection_is_error( $ds, false ) ) - return false; - } - - $r = @ldap_read( $ds, '', 'objectClass=*', array( 'namingContexts' ) ); - if( ! $r ) - return false; - - $r = @ldap_get_entries( $ds, $r ); - if( isset( $r[0]['namingcontexts'][0] ) ) { - $root_dn = $r[0]['namingcontexts'][0]; - $_SESSION[ "pla_root_dn_$server_id" ] = $root_dn; - return $root_dn; - } else { - return false; - } -} - -/** - * Hashes a password and returns the hash based on the specified enc_type. + * Hashes a password and returns the hash based on the specified enc_type. * * @param string $password_clear The password to hash in clear text. * @param string $enc_type Standard LDAP encryption type which must be one of - * crypt, md5, md5crypt, sha, smd5, ssha, or clear. + * crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear. * @return string The hashed password. */ -function password_hash( $password_clear, $enc_type ) -{ +function password_hash( $password_clear, $enc_type ) { + debug_log(sprintf('password_hash(): Entered with (%s,%s)',$password_clear,$enc_type),2); + global $lang; - $enc_type = strtolower( $enc_type ); - switch( $enc_type ) - { - case 'crypt': - $new_value = '{CRYPT}' . crypt( $password_clear, random_salt(2) ); - break; - case 'md5': - $new_value = '{MD5}' . base64_encode( pack( 'H*' , md5( $password_clear) ) ); - break; - case 'md5crypt': - if( ! defined( 'CRYPT_MD5' ) || 0 == CRYPT_MD5 ) - pla_error( $lang['install_not_support_md5crypt'] ); - $new_value = '{CRYPT}' . crypt( $password_clear , '$1$' . random_salt(9) ); - break; - case 'blowfish': - if( ! defined( 'CRYPT_BLOWFISH' ) || 0 == CRYPT_BLOWFISH ) - pla_error( $lang['install_not_support_blowfish'] ); - $new_value = '{CRYPT}' . crypt( $password_clear , '$2$' . random_salt(13) ); - break; - case 'sha': - if( function_exists( 'mhash' ) ) { - $new_value = '{SHA}' . base64_encode( mhash( MHASH_SHA1, $password_clear) ); - } else { - pla_error( $lang['install_no_mash'] ); - } - break; - case 'ssha': - if( function_exists( 'mhash' ) && function_exists( 'mhash_keygen_s2k' ) ) { - mt_srand( (double) microtime() * 1000000 ); - $salt = mhash_keygen_s2k( MHASH_SHA1, $password_clear, substr( pack( "h*", md5( mt_rand() ) ), 0, 8 ), 4 ); - $new_value = "{SSHA}".base64_encode( mhash( MHASH_SHA1, $password_clear.$salt ).$salt ); - } else { - pla_error( $lang['install_no_mash'] ); - } - break; - case 'smd5': - if( function_exists( 'mhash' ) && function_exists( 'mhash_keygen_s2k' ) ) { - mt_srand( (double) microtime() * 1000000 ); - $salt = mhash_keygen_s2k( MHASH_MD5, $password_clear, substr( pack( "h*", md5( mt_rand() ) ), 0, 8 ), 4 ); - $new_value = "{SMD5}".base64_encode( mhash( MHASH_MD5, $password_clear.$salt ).$salt ); - } else { - pla_error( $lang['install_no_mash'] ); - } - break; - case 'clear': - default: - $new_value = $password_clear; + + $enc_type = strtolower( $enc_type ); + + switch( $enc_type ) { + case 'crypt': + $new_value = '{CRYPT}' . crypt( $password_clear, random_salt(2) ); + break; + + case 'ext_des': + // extended des crypt. see OpenBSD crypt man page. + if ( ! defined( 'CRYPT_EXT_DES' ) || CRYPT_EXT_DES == 0 ) + pla_error( $lang['install_not_support_ext_des'] ); + + $new_value = '{CRYPT}' . crypt( $password_clear, '_' . random_salt(8) ); + break; + + case 'md5crypt': + if( ! defined( 'CRYPT_MD5' ) || CRYPT_MD5 == 0 ) + pla_error( $lang['install_not_support_md5crypt'] ); + + $new_value = '{CRYPT}' . crypt( $password_clear , '$1$' . random_salt(9) ); + break; + + case 'blowfish': + if( ! defined( 'CRYPT_BLOWFISH' ) || CRYPT_BLOWFISH == 0 ) + pla_error( $lang['install_not_support_blowfish'] ); + + // hardcoded to second blowfish version and set number of rounds + $new_value = '{CRYPT}' . crypt( $password_clear , '$2a$12$' . random_salt(13) ); + break; + + case 'md5': + $new_value = '{MD5}' . base64_encode( pack( 'H*' , md5( $password_clear) ) ); + break; + + case 'sha': + if( function_exists('sha1') ) { + // use php 4.3.0+ sha1 function, if it is available. + $new_value = '{SHA}' . base64_encode( pack( 'H*' , sha1( $password_clear) ) ); + + } elseif( function_exists( 'mhash' ) ) { + $new_value = '{SHA}' . base64_encode( mhash( MHASH_SHA1, $password_clear) ); + + } else { + pla_error( $lang['install_no_mash'] ); + } + break; + + case 'ssha': + if( function_exists( 'mhash' ) && function_exists( 'mhash_keygen_s2k' ) ) { + mt_srand( (double) microtime() * 1000000 ); + $salt = mhash_keygen_s2k( MHASH_SHA1, $password_clear, substr( pack( "h*", md5( mt_rand() ) ), 0, 8 ), 4 ); + $new_value = "{SSHA}".base64_encode( mhash( MHASH_SHA1, $password_clear.$salt ).$salt ); + + } else { + pla_error( $lang['install_no_mash'] ); + } + break; + + case 'smd5': + if( function_exists( 'mhash' ) && function_exists( 'mhash_keygen_s2k' ) ) { + mt_srand( (double) microtime() * 1000000 ); + $salt = mhash_keygen_s2k( MHASH_MD5, $password_clear, substr( pack( "h*", md5( mt_rand() ) ), 0, 8 ), 4 ); + $new_value = "{SMD5}".base64_encode( mhash( MHASH_MD5, $password_clear.$salt ).$salt ); + + } else { + pla_error( $lang['install_no_mash'] ); + } + break; + + case 'clear': + default: + $new_value = $password_clear; } + return $new_value; } @@ -2847,111 +2717,179 @@ function password_hash( $password_clear, $enc_type ) * @param String $clear The password in clear text to test. * @return Boolean True if the clear password matches the hash, and false otherwise. */ -function password_check( $cryptedpassword, $plainpassword ) -{ - //echo "password_check( $cryptedpassword, $plainpassword )\n"; - if( preg_match( "/{([^}]+)}(.*)/", $cryptedpassword, $cypher ) ) { - $cryptedpassword = $cypher[2]; - $_cypher = strtolower($cypher[1]); - } else { - $_cypher = NULL; - } +function password_check( $cryptedpassword, $plainpassword ) { + debug_log(sprintf('password_check(): Entered with (%s,%s)',$cryptedpassword,$plainpassword),2); - switch( $_cypher ) - { - // SSHA crypted passwords - case 'ssha': - $hash = base64_decode($cryptedpassword); - $salt = substr($hash, -4); - $new_hash = base64_encode( mhash( MHASH_SHA1, $plainpassword.$salt).$salt ); - if( strcmp( $cryptedpassword, $new_hash ) == 0 ) - return true; - else - return false; - break; - // Salted MD5 - case 'smd5': - $hash = base64_decode($cryptedpassword); - $salt = substr($hash, -4); - $new_hash = base64_encode( mhash( MHASH_MD5, $plainpassword.$salt).$salt ); - if( strcmp( $cryptedpassword, $new_hash ) == 0) - return true; - else - return false; - break; - // SHA crypted passwords - case 'sha': - if( 0 == strcasecmp( password_hash($plainpassword,'sha' ), "{SHA}".$cryptedpassword ) ) - return true; - else - return false; - break; - // MD5 cryped passwords - case 'md5': - if( 0 == strcasecmp( password_hash( $plainpassword,'md5' ), "{MD5}".$cryptedpassword ) ) - return true; - else - return false; - break; - // Crypt passwords - case 'crypt': - // Check if it's an crypted md5 - if( strstr( $cryptedpassword, '$1$' ) ) { - list(,$type,$salt,$hash) = explode('$',$cryptedpassword); - if( crypt( $plainpassword, '$1$' .$salt ) == $cryptedpassword ) - return true; - else - return false; - } - // Password is plain crypt - else { - if( crypt($plainpassword, $cryptedpassword ) == $cryptedpassword ) - return true; - else - return false; - } - break; - // No crypt is given assume plaintext passwords are used - default: - if( $plainpassword == $cryptedpassword ) - return true; - else - return false; - break; - } + global $lang; + + //echo "password_check( $cryptedpassword, $plainpassword )\n"; + if( preg_match( "/{([^}]+)}(.*)/", $cryptedpassword, $cypher ) ) { + $cryptedpassword = $cypher[2]; + $_cypher = strtolower($cypher[1]); + + } else { + $_cypher = NULL; + } + + switch( $_cypher ) { + // SSHA crypted passwords + case 'ssha': + // check php mhash support before using it + if( function_exists( 'mhash' ) ) { + $hash = base64_decode($cryptedpassword); + $salt = substr($hash, -4); + $new_hash = base64_encode( mhash( MHASH_SHA1, $plainpassword.$salt).$salt ); + + if( strcmp( $cryptedpassword, $new_hash ) == 0 ) + return true; + else + return false; + + } else { + pla_error( $lang['install_no_mash'] ); + } + break; + + // Salted MD5 + case 'smd5': + // check php mhash support before using it + if( function_exists( 'mhash' ) ) { + $hash = base64_decode($cryptedpassword); + $salt = substr($hash, -4); + $new_hash = base64_encode( mhash( MHASH_MD5, $plainpassword.$salt).$salt ); + + if( strcmp( $cryptedpassword, $new_hash ) == 0) + return true; + else + return false; + + } else { + pla_error( $lang['install_no_mash'] ); + } + break; + + // SHA crypted passwords + case 'sha': + if( strcasecmp( password_hash($plainpassword,'sha' ), "{SHA}".$cryptedpassword ) == 0 ) + return true; + else + return false; + break; + + // MD5 crypted passwords + case 'md5': + if( strcasecmp( password_hash( $plainpassword,'md5' ), "{MD5}".$cryptedpassword ) == 0 ) + return true; + else + return false; + break; + + // Crypt passwords + case 'crypt': + // Check if it's blowfish crypt + if( preg_match("/^\\$2+/",$cryptedpassword ) ) { + + // make sure that web server supports blowfish crypt + if( ! defined( 'CRYPT_BLOWFISH' ) || CRYPT_BLOWFISH == 0 ) + pla_error( $lang['install_not_support_blowfish'] ); + + list(,$version,$rounds,$salt_hash) = explode('$',$cryptedpassword); + + if( crypt( $plainpassword, '$'. $version . '$' . $rounds . '$' .$salt_hash ) == $cryptedpassword ) + return true; + else + return false; + } + + // Check if it's an crypted md5 + elseif( strstr( $cryptedpassword, '$1$' ) ) { + + // make sure that web server supports md5 crypt + if( ! defined( 'CRYPT_MD5' ) || CRYPT_MD5 == 0 ) + pla_error( $lang['install_not_support_md5crypt'] ); + + list(,$type,$salt,$hash) = explode('$',$cryptedpassword); + + if( crypt( $plainpassword, '$1$' .$salt ) == $cryptedpassword ) + return true; + else + return false; + } + + // Check if it's extended des crypt + elseif (strstr( $cryptedpassword, '_' ) ) { + + // make sure that web server supports ext_des + if ( ! defined( 'CRYPT_EXT_DES' ) || CRYPT_EXT_DES == 0 ) + pla_error( $lang['install_not_support_ext_des'] ); + + if( crypt($plainpassword, $cryptedpassword ) == $cryptedpassword ) + return true; + else + return false; + } + + // Password is plain crypt + else { + + if( crypt($plainpassword, $cryptedpassword ) == $cryptedpassword ) + return true; + else + return false; + } + break; + + // No crypt is given assume plaintext passwords are used + default: + if( $plainpassword == $cryptedpassword ) + return true; + else + return false; + + break; + } } -function get_enc_type( $user_password ) -{ - /* Capture the stuff in the { } to determine if this is crypt, md5, etc. */ - $enc_type = null; - if( preg_match( "/{([^}]+)}/", $user_password, $enc_type) ) - $enc_type = strtolower( $enc_type[1] ); - else - return null; +/** + * Detects password encryption type + * + * Returns crypto string listed in braces. If it is 'crypt' password, + * returns crypto detected in password hash. Function should detect + * md5crypt, blowfish and extended DES crypt. If function fails to detect + * encryption type, it returns NULL. + * @param string hashed password + * @return string + */ +function get_enc_type( $user_password ) { + debug_log(sprintf('get_enc_type(): Entered with (%s)',$user_password),2); - /* handle crypt types */ - if( 0 == strcasecmp( $enc_type, 'crypt') ) { - $salt = null; - if( preg_match( "/{[^}]+}\\$(.)\\$/", $user_password, $salt) ) - $salt = $salt[1]; - else - $salt = null; - switch( $salt ) { - case '': // CRYPT_STD_DES - $enc_type = "crypt"; - break; - case '1': // CRYPT_MD5 - $enc_type = "md5crypt"; - break; - case '2': // CRYPT_BLOWFISH - $enc_type = "blowfish"; - break; - default: - $enc_type = "crypt"; - } - } - return $enc_type; + /* Capture the stuff in the { } to determine if this is crypt, md5, etc. */ + $enc_type = null; + + if( preg_match( "/{([^}]+)}/", $user_password, $enc_type) ) + $enc_type = strtolower( $enc_type[1] ); + else + return null; + + /* handle crypt types */ + if( strcasecmp( $enc_type, 'crypt') == 0 ) { + + if( preg_match( "/{[^}]+}\\$1\\$+/", $user_password) ) { + $enc_type = "md5crypt"; + + } elseif ( preg_match( "/{[^}]+}\\$2+/", $user_password) ) { + $enc_type = "blowfish"; + + } elseif ( preg_match( "/{[^}]+}_+/", $user_password) ) { + $enc_type = "ext_des"; + } + + /* + * No need to check for standard crypt, + * because enc_type is already equal to 'crypt'. + */ + } + return $enc_type; } /** @@ -2959,13 +2897,11 @@ function get_enc_type( $user_password ) * @param int $server_id The ID of the server of interest. * @return String The enc_type, like 'sha', 'md5', 'ssha', 'md5crypt', for example. */ -function get_default_hash( $server_id ) -{ - global $servers; - if( isset( $servers[$server_id]['default_hash'] ) ) - return $servers[$server_id]['default_hash']; - else - return null; +function get_default_hash($server_id) { + debug_log(sprintf('get_default_hash(): Entered with (%s)',$server_id),2); + + global $ldapservers; + return $ldapservers->GetValue($server_id,'appearance','password_hash'); } /** @@ -2974,35 +2910,47 @@ function get_default_hash( $server_id ) * * @return string The current version as read from the VERSION file. */ -function pla_version() -{ - if( ! file_exists( realpath( 'VERSION' ) ) ) +function pla_version() { + debug_log(sprintf('pla_version(): Entered with ()'),2); + + $version_file = realpath('./VERSION'); + if (! file_exists($version_file)) return 'unknown version'; - $f = fopen( realpath( 'VERSION' ), 'r' ); - $version = fread( $f, filesize( realpath( 'VERSION' ) ) ); - fclose( $f ); - return $version; + $f = fopen($version_file,'r'); + $version = fread($f, filesize($version_file)); + fclose($f); + return trim($version); } -/** +/** * Draws an HTML browse button which, when clicked, pops up a DN chooser dialog. * @param string $form_element The name of the form element to which this chooser * dialog will publish the user's choice. The form element must be a member * of a form with the "name" or "id" attribute set in the form tag, and the element * must also define "name" or "id" for JavaScript to uniquely identify it. - * Example $form_element values may include "creation_form.container" or + * Example $form_element values may include "creation_form.container" or * "edit_form.member_uid". See /templates/modification/default.php for example usage. * @param bool $include_choose_text (optional) If true, the function draws the localized text "choose" to the right of the button. */ -function draw_chooser_link( $form_element, $include_choose_text=true ) -{ +function draw_chooser_link( $form_element, $include_choose_text=true, $rdn="none" ) { + debug_log(sprintf('draw_chooser_link(): Entered with (%s,%s,%s)',$form_element,$include_choose_text,$rdn),2); + global $lang; - $href = "javascript:dnChooserPopup('$form_element');"; + + if ($rdn == "none") { + $href = "javascript:dnChooserPopup('$form_element', '');"; + + } else { + $href = "javascript:dnChooserPopup('$form_element', '$rdn');"; + } + $title = $lang['chooser_link_tooltip']; - echo ""; - if( $include_choose_text ) - echo "". $lang['fbrowse'] .""; + + printf('',$href,$title); + if ($include_choose_text) + printf('%s',$href,$title,$lang['fbrowse']); + echo ""; } @@ -3025,43 +2973,46 @@ function draw_chooser_link( $form_element, $include_choose_text=true ) * ) * */ -function pla_explode_dn( $dn, $with_attributes=0 ) -{ +function pla_explode_dn( $dn, $with_attributes=0 ) { + debug_log(sprintf('pla_explode_dn(): Entered with (%s,%s)',$dn,$with_attributes),2); + // replace "\," with the hexadecimal value for safe split $var = preg_replace("/\\\,/","\\\\\\\\2C",$dn); // split the dn $result = explode(",",$var); - + //translate hex code into ascii for display foreach( $result as $key => $value ) $result[$key] = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $value); - + return $result; } /** - * Fetches the URL for the specified item. This is a convenience function for + * Fetches the URL for the specified item. This is a convenience function for * fetching project HREFs (like bugs) * * @param string $type One of "open_bugs", "add_bug", "donate", or "add_rfe" * (rfe = request for enhancement) * @return string The URL to the requested item. */ -function get_href( $type ) -{ - /* We don't use SourceForge IDs any more +function get_href( $type, $extra_info='' ) { + debug_log(sprintf('get_href(): Entered with (%s,%s)',$type,$extra_info),2); + $group_id = "61828"; $bug_atid = "498546"; $rfe_atid = "498549"; - */ + $forum_id = "34809"; switch( $type ) { - case 'open_bugs': return "http://www.phpldapadmin.com/bugs/"; - case 'add_bug': return "http://www.phpldapadmin.com/bugs/bug_report_page.php"; - case 'add_rfe': return get_href( 'add_bug' ); - case 'donate': return "donate.php"; - case 'help': return "help.php"; - default: return null; + case 'open_bugs': return "https://sourceforge.net/tracker/?group_id=$group_id&atid=$bug_atid"; + case 'add_bug': return "https://sourceforge.net/tracker/?func=add&group_id=$group_id&atid=$bug_atid"; + case 'add_rfe': return "https://sourceforge.net/tracker/?func=add&group_id=$group_id&atid=$rfe_atid"; + case 'forum': return "http://sourceforge.net/mailarchive/forum.php?forum_id=$forum_id"; + case 'search_bug': return "https://sourceforge.net/tracker/?func=search&group_id=$group_id&atid=$bug_atid&set=custom&_status=100&_group=100&order=summary$extra_info"; + case 'donate': return "donate.php"; + case 'help': return "help.php"; + default: return null; } } @@ -3070,8 +3021,9 @@ function get_href( $type ) * * @return double The current time in seconds since the beginning of the UNIX epoch (Midnight Jan. 1, 1970) */ -function utime () -{ +function utime () { + debug_log(sprintf('utime(): Entered with ()'),2); + $time = explode( " ", microtime()); $usec = (double)$time[0]; $sec = (double)$time[1]; @@ -3079,12 +3031,12 @@ function utime () } /** - * Converts an array to a query-string with the option to exclude certain variables + * Converts an array to a query-string with the option to exclude certain variables * from the returned query string. This is convenient if callers want to convert the - * current GET query string or POST array into a string and replace certain + * current GET query string or POST array into a string and replace certain * variables with their own. - * - * @param array $array The associate array to convert whose form is such that the keys are the + * + * @param array $array The associate array to convert whose form is such that the keys are the * names of the variables and the values are said variables' values like this: * * Array @@ -3102,8 +3054,10 @@ function utime () * not be encoded. * @return string The string created from the array. */ -function array_to_query_string( $array, $exclude_vars=array(), $url_encode_ampersands=true ) -{ +function array_to_query_string( $array, $exclude_vars=array(), $url_encode_ampersands=true ) { + debug_log(sprintf('array_to_query_string(): Entered with (%s,%s,%s)', + count($array),count($exclude_vars),$url_encode_ampersands),2); + if( ! is_array( $array ) ) return ''; if( ! $array ) @@ -3124,30 +3078,13 @@ function array_to_query_string( $array, $exclude_vars=array(), $url_encode_amper return $str; } -/** - * Gets whether the admin has configured phpLDAPadmin to show the "Create New" link in the tree viewer. - * If $servers[$server_id]['show_create'] is NOT set, then default to show the Create New item. - * If $servers[$server_id]['show_create'] IS set, then return the value (it should be true or false). - * - * @param int $server_id The ID of the server of interest - * @return bool True if the feature is enabled and false otherwise. - */ -function show_create_enabled( $server_id ) -{ - global $servers; - if( isset( $servers[$server_id]['show_create'] )) - return $servers[$server_id]['show_create']; - else - return true; -} - /** * Reverses a DN such that the top-level RDN is first and the bottom-level RDN is last * For example: * * cn=Brigham,ou=People,dc=example,dc=com * - * Becomes: + * Becomes: * * dc=com,dc=example,ou=People,cn=Brigham * @@ -3159,8 +3096,9 @@ function show_create_enabled( $server_id ) * * @see pla_compare_dns */ -function pla_reverse_dn($dn) -{ +function pla_reverse_dn($dn) { + debug_log(sprintf('pla_reverse_dn(): Entered with (%s)',$dn),2); + foreach (pla_explode_dn($dn) as $key => $branch) { // pla_expode_dn returns the array with an extra count attribute, we can ignore that. @@ -3181,8 +3119,9 @@ function pla_reverse_dn($dn) * @return Bool True if the specified attribute is in the $unique_attrs list and false * otherwise. */ -function is_unique_attr( $attr_name ) -{ +function is_unique_attr( $attr_name ) { + debug_log(sprintf('is_unique_attr(): Entered with (%s)',$attr_name),2); + global $unique_attrs; if( isset( $unique_attrs ) && is_array( $unique_attrs ) ) { foreach( $unique_attrs as $attr ) @@ -3192,22 +3131,25 @@ function is_unique_attr( $attr_name ) return false; } -/* +/** * This function will check whether the value for an attribute being changed * is already assigned to another DN. * * Inputs: - * - server_id - * - dn that is being changed - * - attribute being changed - * - new values for the attribute + * @param object $ldapserver The LDAP Server Object of interest + * @param dn $dn DN that is being changed + * @param string $attr_name Attribute being changed + * @param string|array $new values New values for the attribute * * Returns the bad value, or null if all values are OK + * @todo Implement alternate conection with LDAPserver object + * @todo Move this to an LDAPServer object method. */ -function checkUniqueAttr( $server_id, $dn, $attr_name, $new_value ) -{ - global $servers, $lang; - $server_name = $servers[ $server_id ][ 'name' ]; +function checkUniqueAttr( $ldapserver, $dn, $attr_name, $new_value ) { + debug_log(sprintf('checkUniqueAttr(): Entered with (%s,%s,%s,%s)', + $ldapserver->server_id,$dn,$attr_name,count($new_value)),2); + + global $ldapservers,$lang; // Is this attribute in the unique_attrs list? if ( is_unique_attr( $attr_name ) ) { @@ -3215,52 +3157,67 @@ function checkUniqueAttr( $server_id, $dn, $attr_name, $new_value ) // Search the tree and make sure that attribute doesnt already exist to somebody else. // Check see and use our alternate uid_dn and password if we have it. - $unique_attrs_dn = $servers[ $server_id ][ 'unique_attrs_dn' ]; - $unique_attrs_pass = $servers[ $server_id ][ 'unique_attrs_dn_pass' ]; + $unique_attrs_dn = $ldapservers->GetValue($ldapserver->server_id,'unique_attrs','dn'); + $unique_attrs_pass = $ldapservers->GetValue($ldapserver->server_id,'unique_attrs','pass'); $need_to_unbind = false; if ( isset( $unique_attrs_dn ) && $unique_attrs_dn != '' && isset( $uniqe_attrs_pass ) ) { - $con = @ldap_connect( $servers[$server_id]['host'], $servers[$server_id]['port'] ); + $con = @ldap_connect( $ldapserver->host, $ldapserver->port ); @ldap_set_option( $con, LDAP_OPT_PROTOCOL_VERSION, 3 ); // Bind with the alternate ID. $res = @ldap_bind( $con, $unuque_attrs_dn, $unique_attrs_pass ); - if (! $res) pla_error( sprintf( $lang['unique_attrs_invalid_credential'] , $server_name ) ); + if (! $res) pla_error( sprintf( $lang['unique_attrs_invalid_credential'] , $ldapserver->name ) ); $need_to_unbind = true; } else { - $con = pla_ldap_connect($server_id); + $con = $ldapserver->connect(); } - // Should this be in a function? - $base_dn = $servers[ $server_id ][ 'base' ]; - if( ! $base_dn ) - $base_dn = try_to_get_root_dn( $server_id ); - // Build our search filter to double check each attribute. $searchfilter = "(|"; - foreach ($new_value as $val) { - $searchfilter .= "($attr_name=$val)"; + + if ( is_array( $new_value ) ) { + foreach ($new_value as $val) { + $searchfilter .= sprintf("($attr_name=%s)",clean_search_vals($val)); + } + + } elseif ( $new_value ) { + $searchfilter .= sprintf("($attr_name=%s)",clean_search_vals($new_value)); } + $searchfilter .= ")"; // Do we need a sanity check to just in case $new_value was null and hence the search string is bad? - // Do the search - $search = @ldap_search( $con, $base_dn, $searchfilter, array('dn'), 0, 0, 0, LDAP_DEREF_ALWAYS); - $search = ldap_get_entries( $con, $search ); + foreach ($ldapserver->getBaseDN() as $base_dn) { - foreach ($search as $result) { - // Skip the count result and go to the array. - if (! is_array($result)) continue; + // Do the search + $search = @ldap_search( $con, $base_dn, $searchfilter, array('dn',$attr_name), 0, 0, 0, LDAP_DEREF_ALWAYS); + if (! $search) + continue; - // If one of the attributes is owned to somebody else, then we may as well die here. - if ($result['dn'] != $dn) { - return $val; + $search = ldap_get_entries( $con, $search ); + + foreach ($search as $result) { + // Skip the count result and go to the array. + if (! is_array($result)) continue; + + // If one of the attributes is owned to somebody else, then we may as well die here. + if ($result['dn'] != $dn) { + + // Find which attribute matched. + foreach ($result[strtolower($attr_name)] as $attr) { + foreach ($new_value as $new_value_attr) { + if ($attr == $new_value_attr) + return $attr; + } + } + } } } @@ -3276,181 +3233,257 @@ function checkUniqueAttr( $server_id, $dn, $attr_name, $new_value ) } } +/** + * + */ + function sortAttrs($a,$b) { - global $friendly_attrs; + debug_log(sprintf('sortAttrs(): Entered with (%s,%s)',$a,$b),2); - $a = strtolower( (isset($friendly_attrs[ strtolower( $a ) ]) ? $friendly_attrs[ strtolower( $a ) ] : $a)); - $b = strtolower( (isset($friendly_attrs[ strtolower( $b ) ]) ? $friendly_attrs[ strtolower( $b ) ] : $b)); - return strcmp ($a, $b); + global $friendly_attrs, $attrs_display_order; + + // If $attrs_display_order is not set, make it a blank array. + if (! isset($attrs_display_order)) + $attrs_display_order = array(); + + if ( $a == $b ) return 0; + + // Check if $a is in $attrs_display_order, get its key + $a_key = array_search($a, $attrs_display_order); + // If not, check if its friendly name is $attrs_display_order, get its key + // If not, assign one greater than number of elements. + if ( $a_key == '' ) { + if (isset($friendly_attrs[ strtolower( $a ) ])) { + $a_key = array_search( $friendly_attrs[ strtolower( $a ) ], $attrs_display_order); + if ( $a_key == '' ) $a_key = count($attrs_display_order)+1; + } + else { + $a_key = count($attrs_display_order)+1; + } + } + + $b_key = array_search($b, $attrs_display_order); + if ( $b_key == '' ) { + if (isset($friendly_attrs[ strtolower( $b ) ])) { + $b_key = array_search( $friendly_attrs[ strtolower( $b ) ], $attrs_display_order); + if ( $b_key == '' ) $b_key = count($attrs_display_order)+1; + } + else { + $b_key = count($attrs_display_order)+1; + } + } + + // Case where neither $a, nor $b are in $attrs_display_order, $a_key = $b_key = one greater than num elements. + // So we sort them alphabetically + if ( $a_key == $b_key ) { + $a = strtolower( (isset($friendly_attrs[ strtolower( $a ) ]) ? $friendly_attrs[ strtolower( $a ) ] : $a)); + $b = strtolower( (isset($friendly_attrs[ strtolower( $b ) ]) ? $friendly_attrs[ strtolower( $b ) ] : $b)); + return strcmp ($a, $b); + } + + // Case where at least one attribute or its friendly name is in $attrs_display_order + // return -1 if $a before $b in $attrs_display_order + return ( $a_key < $b_key ) ? -1 : 1; } -function userIsMember($server_id,$user,$group) { - $group = get_object_attrs( $server_id, $group, $deref=LDAP_DEREF_NEVER ); - return (is_array($group) ? (in_array($user,$group['uniqueMember'])) : false); +/** + * @todo Move this to an LDAPServer object method. + */ +function userIsMember($ldapserver,$user,$group) { + debug_log(sprintf('userIsMember(): Entered with (%s,%s,%s)',$ldapserver->server_id,$user,$group),2); + + $group = get_object_attrs( $ldapserver, $group, false, $deref=LDAP_DEREF_NEVER ); + + if( is_array($group) ) { + // If you are using groupOfNames objectClass + if ( array_key_exists('member',$group) and in_array(strtolower($user),arrayLower($group['member'])) ) + return true; + // If you are using groupOfUniqueNames objectClass + if ( array_key_exists('uniqueMember',$group) and in_array(strtolower($user),arrayLower($group['uniqueMember'])) ) + return true; + + return false; + } } +/** + * @todo Move this to an LDAPServer object method. + */ +function userIsAllowedLogin($ldapserver,$user) { + debug_log(sprintf('userIsAllowedLogin(): Entered with (%s,%s)',$ldapserver->server_id,$user),2); + + global $ldapservers; + + $user = strtolower($user); + + if (! $ldapservers->GetValue($ldapserver->server_id,'login','allowed_dns')) + return true; + + foreach ($ldapservers->GetValue($ldapserver->server_id,'login','allowed_dns') as $login_allowed_dn) { + debug_log(sprintf('userIsAllowedLogin: Working through (%s)',$login_allowed_dn),9); + + // Check if $login_allowed_dn is an ldap search filter + // Is first occurence of 'filter=' (case ensitive) at position 0 ? + if ( preg_match('/^\([&|]\(/',$login_allowed_dn) ) { + $filter = $login_allowed_dn; + + foreach($ldapserver->getBaseDN() as $base_dn) { + $results = array(); + $results = pla_ldap_search( $ldapserver, $filter, $base_dn, array('dn') ); + debug_log(sprintf('userIsAllowedLogin: Search, Filter [%s], BaseDN [%s] Results [%s]', + $filter, $base_dn, is_array($results)),9); + $dn_array = array(); + + if ($results) { + foreach ($results as $result) + $dn_array[] = $result['dn']; + $dn_array = array_unique( $dn_array ); + + if( count( $dn_array ) !== 0 ) + foreach($dn_array as $result_dn) { + debug_log(sprintf('userIsAllowedLogin: Comparing with [%s]', + $result_dn),9); + + // Check if $result_dn is a user DN + if ( 0 == strcasecmp( trim($user), trim(strtolower($result_dn)) ) ) + return true; + + // Check if $result_dn is a group DN + if ( userIsMember($ldapserver,$user,$result_dn) ) + return true; + } + } + } + } + + // Check if $login_allowed_dn is a user DN + if ( 0 == strcasecmp( trim($user), trim(strtolower($login_allowed_dn)) ) ) + return true; + + // Check if $login_allowed_dn is a group DN + if ( userIsMember($ldapserver,$user,$login_allowed_dn) ) + return true; + } + return false; +} + +/** + * Reads an array and returns the array values back in lower case + * @param array $array The array to convert the values to lowercase. + * @returns array Array with values converted to lowercase. + */ function arrayLower($array) { + debug_log(sprintf('arrayLower(): Entered with (%s)',serialize($array)),2); + + if (! is_array($array)) + return $array; + + $newarray = array(); foreach ($array as $key => $value) { $newarray[$key] = strtolower($value); } + return $newarray; } /** * Strips all slashes from the specified array in place (pass by ref). - * @param Array $array The array to strip slashes from, typically one of + * @param Array $array The array to strip slashes from, typically one of * $_GET, $_POST, or $_COOKIE. */ -function array_stripslashes(&$array) -{ - if( is_array( $array ) ) - while ( list( $key ) = each( $array ) ) - if ( is_array( $array[$key] ) && $key != $array ) - array_stripslashes( $array[$key] ); - else - $array[$key] = stripslashes( $array[$key] ); -} +function array_stripslashes(&$array) { + debug_log(sprintf('array_stripslashes(): Entered with (%s)',serialize($array)),2); -/** - * Gets a HTTP value via $_GET or $_POST - * - * @param string $val The HTTP value too look for - * @param any $default The default return value, if failed to get (default = false) - * @param bool $trim Trim a string value (default = true) - * @return string The HTTP value or the $default - */ -function http_get_value( $val, $default = false, $trim = true ) -{ - $result = $default; - if( array_key_exists( $val, $_GET ) ) - $result = $_GET[ $val ]; - elseif( array_key_exists( $val, $_POST ) ) - $result = $_POST[ $val ]; - if( ( $result !== $default ) && ( $trim === true ) && is_string( $result ) ) - $result = trim( $result ); - return $result; + if (is_array($array)) + while (list($key) = each($array)) + if (is_array($array[$key]) && $key != $array) + array_stripslashes($array[$key]); + else + $array[$key] = stripslashes($array[$key]); } /** * Gets the USER_AGENT string from the $_SERVER array, all in lower case in * an E_NOTICE safe manner. - * @return String The user agent string as reported by the browser. + * @return string|false The user agent string as reported by the browser. */ -function get_user_agent_string() -{ +function get_user_agent_string() { + debug_log(sprintf('get_user_agent_string(): Entered with ()'),2); + if( isset( $_SERVER['HTTP_USER_AGENT'] ) ) - return strtolower( $_SERVER['HTTP_USER_AGENT'] ); + $return = strtolower( $_SERVER['HTTP_USER_AGENT'] ); else - return false; + $return = false; + + debug_log(sprintf('get_user_agent_string(): Returning (%s)',$return),1); + return $return; } /** * Determines whether the browser's operating system is UNIX (or something like UNIX). * @return boolean True if the brower's OS is UNIX, false otherwise. */ -function is_browser_os_unix() -{ - $agent = get_user_agent_string(); - if( ! $agent ) - return false; - $unix_agent_strs = array( - 'sunos', - 'sunos 4', - 'sunos 5', - 'i86', - 'irix', - 'irix 5', - 'irix 6', - 'irix6', - 'hp-ux', - '09.', - '10.', - 'aix', - 'aix 1', - 'aix 2', - 'aix 3', - 'aix 4', - 'inux', - 'sco', - 'unix_sv', - 'unix_system_v', - 'ncr', - 'reliant', - 'dec', - 'osf1', - 'dec_alpha' , - 'alphaserver' , - 'ultrix' , - 'alphastation', - 'sinix', - 'freebsd', - 'bsd', - 'x11', - 'vax', - 'openvms' - ); - foreach( $unix_agent_strs as $agent_str ) - if( strpos( $agent, $agent_str ) !== false ) - return true; - return false; +function is_browser_os_unix() { + debug_log(sprintf('is_browser_os_unix(): Entered with ()'),2); + + $agent_strs = array( + 'sunos','sunos 4','sunos 5', + 'i86', + 'irix','irix 5','irix 6','irix6', + 'hp-ux','09.','10.', + 'aix','aix 1','aix 2','aix 3','aix 4', + 'inux', + 'sco', + 'unix_sv','unix_system_v','ncr','reliant','dec','osf1', + 'dec_alpha','alphaserver','ultrix','alphastation', + 'sinix', + 'freebsd','bsd', + 'x11','vax','openvms' + ); + + $return = string_in_array_value(get_user_agent_string(),$agent_strs); + + debug_log(sprintf('is_browser_os_unix(): Returning (%s)',$return),1); + return $return; } /** * Determines whether the browser's operating system is Windows. * @return boolean True if the brower's OS is Windows, false otherwise. */ -function is_browser_os_windows() -{ - $agent = get_user_agent_string(); - if( ! $agent ) - return false; - $win_agent_strs = array( - 'win', - 'win95', - 'windows 95', - 'win16', - 'windows 3.1', - 'windows 16-bit', - 'windows', - 'win31', - 'win16', - 'winme', - 'win2k', - 'winxp', - 'win98', - 'windows 98', - 'win9x', - 'winnt', - 'windows nt', - 'win32', - 'win32', - '32bit' - ); - foreach( $win_agent_strs as $agent_str ) - if( strpos( $agent, $agent_str ) !== false ) - return true; - return false; +function is_browser_os_windows() { + debug_log(sprintf('is_browser_os_windows(): Entered with ()'),2); + + $agent_strs = array( + 'win','win95','windows 95', + 'win16','windows 3.1','windows 16-bit','windows','win31','win16','winme', + 'win2k','winxp', + 'win98','windows 98','win9x', + 'winnt','windows nt','win32', + '32bit' + ); + + $return = string_in_array_value(get_user_agent_string(),$agent_strs); + + debug_log(sprintf('is_browser_os_windows(): Returning (%s)',$return),1); + return $return; } /** * Determines whether the browser's operating system is Macintosh. * @return boolean True if the brower's OS is mac, false otherwise. */ -function is_browser_os_mac() -{ - $agent = get_user_agent_string(); - if( ! $agent ) - return false; - $mac_agent_strs = array( - 'mac', - '68000', - 'ppc', - 'powerpc' - ); - foreach( $mac_agent_strs as $agent_str ) - if( strpos( $agent, $agent_str ) !== false ) - return true; - return false; +function is_browser_os_mac() { + debug_log(sprintf('is_browser_os_mac(): Entered with ()'),2); + + $agent_strs = array( + 'mac','68000','ppc','powerpc' + ); + + $return = string_in_array_value(get_user_agent_string(),$agent_strs); + + debug_log(sprintf('is_browser_os_windows(): Returning (%s)',$return),1); + return $return; } /** @@ -3458,61 +3491,106 @@ function is_browser_os_mac() * @return Array An associative array of posix group entries with attributes as keys, and values as values. * @param int $server_id The ID of the server to search. * @param string $base_dn The base of the search. + * @deprecated */ -function get_posix_groups( $server_id , $base_dn = NULL ){ - global $servers; - if( is_null( $base_dn ) ) - $base_dn = isset( $servers[$server_id]['base'] ) ? $servers[$server_id]['base'] : try_to_get_root_dn( $server_id ); - - $results = pla_ldap_search( $server_id, "objectclass=posixGroup", $base_dn, array() ); - if( !$results ) - return array(); - else - return $results; +function get_posix_groups($ldapserver,$base_dn=null) { + debug_log(sprintf('get_posix_groups(): Entered with (%s,%s)',$ldapserver->server_id,$base_dn),2); + + if (is_null($base_dn)) + $base_dn = $ldapserver->getBaseDN(); + + $results = pla_ldap_search($ldapserver,"objectclass=posixGroup",$base_dn,array()); + + if (!$results) + return array(); + else + return $results; } -function get_default_search_display() -{ - global $default_search_display; - if( ! isset( $default_search_display ) || is_null( $default_search_display ) ) - return 'list'; - elseif( 0 == strcasecmp( $default_search_display, 'list' ) ) - return 'list'; - elseif( 0 == strcasecmp( $default_search_display, 'table' ) ) - return 'table'; - else - pla_error( sprintf( $lang['bad_search_display'], htmlspecialchars( $default_search_display ) ) ); -} +/** + * Return the default format for search results. + * + * @return string The format to use. + */ +function get_default_search_display() { + debug_log(sprintf('get_default_search_display(): Entered with ()'),2); + global $default_search_display, $lang; + + if( ! isset( $default_search_display ) || is_null( $default_search_display ) ) + return 'list'; + + elseif( 0 == strcasecmp( $default_search_display, 'list' ) ) + return 'list'; + + elseif( 0 == strcasecmp( $default_search_display, 'table' ) ) + return 'table'; + + else + pla_error( sprintf( $lang['bad_search_display'], htmlspecialchars( $default_search_display ) ) ); +} /** * Checks if a string exists in an array, ignoring case. + * + * @param string $needle What you are looking for + * @param array $haystack The array that you think it is in. + * @return bool True if its there, false if its not. */ -function in_array_ignore_case( $needle, $haystack ) -{ - if( ! is_array( $haystack ) ) - return false; - if( ! is_string( $needle ) ) - return false; - foreach( $haystack as $element ) - if( is_string( $element ) && 0 == strcasecmp( $needle, $element ) ) - return true; - return false; +function in_array_ignore_case( $needle, $haystack ) { + debug_log(sprintf('in_array_ignore_case(): Entered with (%s,%s)',$needle,serialize($haystack)),2); + + if( ! is_array( $haystack ) ) + return false; + if( ! is_string( $needle ) ) + return false; + + foreach( $haystack as $element ) + if( is_string( $element ) && 0 == strcasecmp( $needle, $element ) ) + return true; + + return false; +} + +/** + * Checks if a string exists in part in an array value, ignoring case. + * + * @param string $needle What you are looking for + * @param array $haystack The array that you think it is in. + * @return bool True if its there, false if its not. + */ +function string_in_array_value( $needle, $haystack ) { + debug_log(sprintf('string_in_array_value(): Entered with (%s,%s)',$needle,serialize($haystack)),2); + + # Set default return + $return = false; + + if (! is_string($needle)) return $return; + if (! is_array($haystack)) return $return; + + foreach ($haystack as $element) + if (is_string($element) && (strpos($needle,$element) !== false)) { + $return = true; + break; + } + + debug_log(sprintf('string_in_array_value(): Returning (%s)',$return),1); + return $return; } /** * String padding * - * @param string input string - * @param integer length of the result - * @param string the filling string - * @param integer padding mode + * @param string input string + * @param integer length of the result + * @param string the filling string + * @param integer padding mode * - * @return string the padded string - * - * @access public (taken from the phpMyAdmin source) + * @return string the padded string */ function full_str_pad($input, $pad_length, $pad_string = '', $pad_type = 0) { + debug_log(sprintf('full_str_pad(): Entered with (%s,%s,%s,%s)',$input,$pad_length,$pad_string,$pad_type),2); + $str = ''; $length = $pad_length - strlen($input); if ($length > 0) { // str_repeat doesn't like negatives @@ -3532,18 +3610,23 @@ function full_str_pad($input, $pad_length, $pad_string = '', $pad_type = 0) { } /** - * Gets the user configured $blowfish_secret from config.php. + * Gets the user configured session blowfish secret from config.php. + * + * @return string|error Return the blowfish secret, or jump to an error. */ -function get_blowfish_secret() -{ - global $blowfish_secret; - if( isset( $blowfish_secret ) ) { - if( trim( $blowfish_secret ) == '' ) - return null; - else - return $blowfish_secret; - } else - return null; +function get_blowfish_secret() { + debug_log(sprintf('get_blowfish_secret(): Entered with ()'),2); + + global $config, $lang; + + $return = $config->GetValue('session','blowfish'); + + # If our default is blank, then generate an error. + if (! trim($return)) + pla_error( $lang['no_blowfish_secret'] ); + + debug_log(sprintf('get_blowfish_secret(): Returned (%s)',is_null($return)),2); + return $return; } /** @@ -3558,24 +3641,27 @@ function get_blowfish_secret() * * @author lem9 (taken from the phpMyAdmin source) */ -function pla_blowfish_encrypt( $data, $secret=null ) -{ - include_once './blowfish.php'; - if( null === $secret ) { - $secret = get_blowfish_secret(); - if( null === $secret ) - pla_error( 'phpLDAPadmin cannot safely encrypt your sensitive information, because $blowfish_secret is not set in config.php. You need to edit config.php and set $blowfish_secret to some secret string now.' ); - } - $pma_cipher = new Horde_Cipher_blowfish; - $encrypt = ''; - for ($i=0; $iencryptBlock($block, $secret); - } - return base64_encode($encrypt); +function pla_blowfish_encrypt( $data, $secret=null ) { + debug_log(sprintf('pla_blowfish_encrypt(): Entered with (%s,%s)',$data,$secret),2); + + # If our secret is null or blank, get the default. + if( $secret === null || ! trim($secret)) + $secret = get_blowfish_secret(); + + require_once LIBDIR.'blowfish.php'; + + $pma_cipher = new Horde_Cipher_blowfish; + $encrypt = ''; + + for ($i=0; $iencryptBlock($block, $secret); + } + return base64_encode($encrypt); } /** @@ -3590,47 +3676,43 @@ function pla_blowfish_encrypt( $data, $secret=null ) * * @author lem9 (taken from the phpMyAdmin source) */ -function pla_blowfish_decrypt( $encdata, $secret=null ) -{ - // This cache gives major speed up for stupid callers :) - static $cache = array(); - if( isset( $cache[$encdata] ) ) - return $cache[$encdata]; +function pla_blowfish_decrypt( $encdata, $secret=null ) { + debug_log(sprintf('pla_blowfish_decrypt(): Entered with (%s,%s)',$encdata,$secret),2); - include_once './blowfish.php'; - if( null === $secret ) { - $secret = get_blowfish_secret(); - if( null === $secret ) - pla_error( 'phpLDAPadmin cannot safely decrypt your sensitive information, because $blowfish_secret is not set in config.php. You need to edit config.php and set $blowfish_secret to some secret string now.' ); - } - $pma_cipher = new Horde_Cipher_blowfish; - $decrypt = ''; - $data = base64_decode($encdata); - for ($i=0; $idecryptBlock(substr($data, $i, 8), $secret); - } - $return = trim($decrypt); - $cache[$encdata] = $return; - return $return; -} + // This cache gives major speed up for stupid callers :) + static $cache = array(); -/** - * Gets the user configured $tree_display_format from config.php - */ -function get_tree_display_format() -{ - global $tree_display_format; - if( ! isset( $tree_display_format ) || '' == trim( $tree_display_format ) ) - $tree_display_format = "%rdn"; - return $tree_display_format; + if( isset( $cache[$encdata] ) ) + return $cache[$encdata]; + + # If our secret is null or blank, get the default. + if( $secret === null || ! trim($secret)) + $secret = get_blowfish_secret(); + + require_once LIBDIR.'blowfish.php'; + + $pma_cipher = new Horde_Cipher_blowfish; + $decrypt = ''; + $data = base64_decode($encdata); + + for ($i=0; $idecryptBlock(substr($data, $i, 8), $secret); + } + + $return = trim($decrypt); + $cache[$encdata] = $return; + return $return; } /** * Gets a DN string using the user-configured tree_display_format string to format it. */ -function draw_formatted_dn( $server_id, $dn ) -{ - $format = get_tree_display_format(); +function draw_formatted_dn( $ldapserver, $dn ) { + debug_log(sprintf('draw_formatted_dn(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2); + + global $config; + + $format = $config->GetValue('appearance','tree_display_format'); preg_match_all( "/%[a-zA-Z_0-9]+/", $format, $tokens ); $tokens = $tokens[0]; foreach( $tokens as $token ) { @@ -3645,7 +3727,7 @@ function draw_formatted_dn( $server_id, $dn ) $format = str_replace( $token, $rdn_value, $format ); } else { $attr_name = str_replace( '%', '', $token ); - $attr_values = get_object_attr( $server_id, $dn, $attr_name ); + $attr_values = get_object_attr( $ldapserver, $dn, $attr_name ); if( null == $attr_values ) $display = 'none'; elseif( is_array( $attr_values ) ) @@ -3658,4 +3740,493 @@ function draw_formatted_dn( $server_id, $dn ) echo $format; } +/** + * Gets the date format from the config - default locale if none. + * @deprecated + */ +function get_date_format() { + debug_log(sprintf('get_date_format(): Entered with ()'),2); + + global $config; + + return $config->GetValue('appearance','date'); +} + +/** + * Takes a shadow* attribute and returns the date as an integer. + */ +function shadow_date( $attrs, $attr) { + debug_log(sprintf('shadow_date(): Entered with (%s,%s)',serialize($attrs),$attr),2); + + $shadowLastChange = isset($attrs['shadowLastChange']) ? $attrs['shadowLastChange'][0] : null; + $shadowMax = isset($attrs['shadowMax']) ? $attrs['shadowMax'][0] : null; + + if( 0 == strcasecmp( $attr, 'shadowLastChange' ) && $shadowLastChange) + $shadow_date = $shadowLastChange; + + elseif ( 0 == strcasecmp( $attr, 'shadowMax' ) && ($shadowMax > 0) && $shadowLastChange ) + $shadow_date = $shadowLastChange+$shadowMax; + + elseif ( 0 == strcasecmp( $attr, 'shadowWarning' ) && ($attrs[$attr][0] > 0) && $shadowLastChange && $shadowMax && $shadowMax > 0) + $shadow_date = $shadowLastChange+$shadowMax-$attrs[$attr][0]; + + elseif ( 0 == strcasecmp( $attr, 'shadowInactive' ) && ($attrs[$attr][0] > 0) && $shadowLastChange && $shadowMax && $shadowMax > 0) + $shadow_date = $shadowLastChange+$shadowMax+$attrs[$attr][0]; + + elseif ( 0 == strcasecmp( $attr, 'shadowMin' ) && ($attrs[$attr][0] > 0) && $shadowLastChange) + $shadow_date = $shadowLastChange+$attrs[$attr][0]; + + elseif ( 0 == strcasecmp( $attr, 'shadowExpire' ) && ($attrs[$attr][0] > 0)) + $shadow_date = $attrs[$attr][0]; + + else // Couldn't interpret the shadow date (could be 0 or -1 or something) + return false; + + return $shadow_date*24*3600; +} + +/** + * This function will clean up the values use during a search - namely, values that have brackets + * as that messes up the search filter. + * @param string $val String that will be used in the search filter. + * @return string $result String that is ready for the search filter. + */ +function clean_search_vals( $val ) { + debug_log(sprintf('clean_search_vals(): Entered with (%s)',$val),2); + + # Remove any escaped brackets already. + $val = preg_replace("/\\\\([\(\)])/","$1",$val); + + # The string might be a proper search filter + if (preg_match("/^\([&\|]\(/",$val)) + return $val; + + else + return preg_replace("/([\(\)])/","\\\\$1",$val); +} + +/** + * Server html select list + */ +function server_select_list ($select_id=null,$only_logged_on=true,$select_name='server_id',$js_script=null) { + debug_log(sprintf('server_select_list(): Entered with (%s,%s,%s,%s)', + $select_id,$only_logged_on,$select_name,$js_script),2); + + global $ldapservers; + + $count = 0; + $server_menu_html = sprintf(''; + + if ($count > 1) + return $server_menu_html; + + elseif ($count) + return sprintf('%s ', + $server->name,$select_name,$server->server_id); + + else + return null; +} + +function server_info_list() { + debug_log(sprintf('server_info_list(): Entered with ()'),2); + + global $ldapservers; + + $server_info_list = array(); + + foreach ($ldapservers->GetServerList() as $id) { + $ldapserver = $ldapservers->Instance($id); + + if (! $ldapserver->haveAuthInfo() || ! $ldapserver->isValidServer($id)) + continue; + + $server_info_list[$id]['id'] = $id; + $server_info_list[$id]['name'] = $ldapserver->name; + $server_info_list[$id]['base_dn'] = $ldapserver->getBaseDN(); + } + + debug_log(sprintf('server_info_list(): Returning (%s)',serialize($server_info_list)),1); + return $server_info_list; +} + +/** + * Debug Logging to Syslog + * + * If the log level of the message is less than the log level of the debug setting in the config file + * then log the message to syslog. + * + * Suggested logging level messages: + * 1 = Return results from function calls. + * 2 = Entry parameters to function calls. + * 3 = CACHE returning indications + * 4 = High level processing + * 5 = 2nd level processing + * 9 = Very verbose (describing what the code is doing) + * @param string $msg Message to send to syslog + * @param int $level Log level of this message. + * @see syslog.php + */ + +function debug_log($msg,$level=0) { + global $config; + + # In case we are called before we are fully initialised. + if (! isset($config)) + return false; + + $debug_level = $config->GetValue('debug','level'); + + $caller = basename( $_SERVER['PHP_SELF'] ); + if (! $debug_level) + $debug_level = -1; + + if ($level <= $debug_level) + return syslog_notice( sprintf('%s(%s): %s',$caller,$level,$msg) ); +} + +function enc_type_select_list($enc_type) { + debug_log(sprintf('enc_type_select_list(): Entered with (%s)',$enc_type),2); + + $html = '"; + + return $html; +} + +// Converts a little-endia hex-number to one, that 'hexdec' can convert +function littleEndian($hex) { + debug_log(sprintf('littleEndian(): Entered with (%s)',$hex),2); + + $result = ''; + + for ($x=strlen($hex)-2; $x >= 0; $x=$x-2) + $result .= substr($hex,$x,2); + + return $result; +} + +function binSIDtoText($binsid) { + debug_log(sprintf('binSIDtoText(): Entered with (%s)',$binsid),2); + + $hex_sid=bin2hex($binsid); + $rev = hexdec(substr($hex_sid,0,2)); // Get revision-part of SID + $subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries + $auth = hexdec(substr($hex_sid,4,12)); // SECURITY_NT_AUTHORITY + + $result = "$rev-$auth"; + + for ($x=0;$x < $subcount; $x++) { + $subauth[$x] = + hexdec(littleEndian(substr($hex_sid,16+($x*8),8))); // get all SECURITY_NT_AUTHORITY + $result .= "-".$subauth[$x]; + } + + return $result; +} + +if (! function_exists('session_cache_expire')) { + + /** + * session_cache_expire is a php 4.2.0 function, we'll emulate it if we are using php <4.2.0 + */ + + function session_cache_expire() { + debug_log(sprintf('session_cache_expire(): Entered with ()'),2); + + return 180; + } +} + +/** + * Sort a multi dimensional array. + * @param array $data Multi demension array passed by reference + * @param string $sortby Comma delimited string of sort keys. + * @param bool $rev Whether to reverse sort. + * @returnn array $data Sorted multi demension array. + */ +function masort(&$data, $sortby, $rev=0) { + debug_log(sprintf('masort(): Entered with (%s,%s,%s)',serialize($data),$sortby,$rev),2); + + static $sort_funcs = array(); + + if (empty($sort_funcs[$sortby])) { + $code = "\$c=0;\n"; + foreach (split(',', $sortby) as $key) { + $code .= "if ((! isset(\$a['$key'])) && (! isset(\$b['$key']))) return 0;\n"; + $code .= "if ((! isset(\$a['$key'])) && isset(\$b['$key'])) return -1;\n"; + $code .= "if (isset(\$a['$key']) && (! isset(\$b['$key']))) return 1;\n"; + $code .= "if (is_numeric(\$a['$key']) && is_numeric(\$b['$key'])) {\n"; + + $code .= " if (\$a['$key'] != \$b['$key'])\n"; + if ($rev) + $code .= " return (\$a['$key'] < \$b['$key'] ? -1 : 1);\n"; + else + $code .= " return (\$a['$key'] > \$b['$key'] ? -1 : 1);\n"; + + $code .= "} else {\n"; + + if ($rev) + $code .= " if ( (\$c = strcasecmp(\$b['$key'],\$a['$key'])) != 0 ) return \$c;\n"; + else + $code .= " if ( (\$c = strcasecmp(\$a['$key'],\$b['$key'])) != 0 ) return \$c;\n"; + $code .= "}\n"; + } + $code .= 'return $c;'; + $sort_func = $sort_funcs[$sortby] = create_function('$a, $b', $code); + } else { + $sort_func = $sort_funcs[$sortby]; + } + $sort_func = $sort_funcs[$sortby]; + uasort($data, $sort_func); +} + +/** + * Query LDAP and return a hash. + * @param object $ldapserver The LDAPServer object of the server which the user hsa logged in. + * @param string $base_dn The base DN to use. + * @param string $filter LDAP Query filter. + * @param string $key LDAP attribute to use as key. + * @param array $attrs LDAP attributes to use as values. + * @return array $results Array of values keyed by $key. + */ +function return_ldap_hash($ldapserver,$base_dn,$filter,$key,$attrs) { + debug_log(sprintf('return_ldap_hash(): Entered with (%s,%s,%s,%s,%s)', + $ldapserver->server_id,$base_dn,$filter,$key,count($attrs)),2); + + $ldapquery = pla_ldap_search($ldapserver,$filter,$base_dn,$attrs); + + $results = array(); + + foreach ($ldapquery as $dn => $dnattrs) { + foreach ($attrs as $attr) { + if (isset($dnattrs[$attr])) + $results[$dnattrs[$key]][$attr] = $dnattrs[$attr]; + } + } + return $results; +} + +// @todo: document this function +function debug_dump($variable,$die=false) { + print "
      ";
      +	print_r($variable);
      +	if ($die)
      +		die();
      +}
      +
      +/**
      + * This function returns a string automatically generated 
      + * based on the criteria defined in the array $criteria in config.php
      + */
      +function password_generate() {
      +	debug_log(sprintf('password_generate(): Entered with ()'),2);
      +
      +	global $config;
      +
      +	$no_use_similiar = ! $config->GetValue('password','use_similar');
      +	$lowercase = $config->GetValue('password','lowercase');
      +	$uppercase = $config->GetValue('password','uppercase');
      +	$digits = $config->GetValue('password','numbers');
      +	$punctuation = $config->GetValue('password','punctuation');
      +	$length = $config->GetValue('password','length');
      +
      +	$outarray = array();
      +
      +	if ($no_use_similiar) {
      +		$raw_lower = "a b c d e f g h k m n p q r s t u v w x y z";
      +		$raw_numbers = "2 3 4 5 6 7 8 9";
      +		$raw_punc = "# $ % ^ & * ( ) _ - + = . , [ ] { } :";
      +
      +	} else {
      +		$raw_lower = "a b c d e f g h i j k l m n o p q r s t u v w x y z";
      +		$raw_numbers = "1 2 3 4 5 6 7 8 9 0";
      +		$raw_punc = "# $ % ^ & * ( ) _ - + = . , [ ] { } : |";
      +	}
      +
      +	$llower = explode(" ", $raw_lower);
      +	shuffle($llower);
      +	$lupper = explode(" ", strtoupper($raw_lower));
      +	shuffle($lupper);
      +	$numbers = explode(" ", $raw_numbers);
      +	shuffle($numbers);
      +	$punc = explode(" ", $raw_punc);
      +	shuffle($punc);
      +
      +	if ($lowercase > 0)
      +		$outarray = array_merge($outarray,a_array_rand($llower,$lowercase));
      +
      +	if ($uppercase > 0)
      +		$outarray = array_merge($outarray,a_array_rand($lupper,$uppercase));
      +
      +	if ($digits > 0)
      +		$outarray = array_merge($outarray,a_array_rand($numbers,$digits));
      +
      +	if ($punctuation > 0)
      +		$outarray = array_merge($outarray,a_array_rand($punc,$punctuation));
      +
      +	$num_spec = $lowercase + $uppercase + $digits + $punctuation;
      +
      +	if ($num_spec < $length) {
      +		$leftover = array();
      +		if ($lowercase > 0)
      +			$leftover = array_merge($leftover, $llower);
      +		if ($uppercase > 0)
      +			$leftover = array_merge($leftover, $lupper);
      +		if ($digits > 0)
      +			$leftover = array_merge($leftover, $numbers);
      +		if ($punctuation > 0)
      +			$leftover = array_merge($leftover, $punc);
      +
      +		if (count($leftover) == 0)
      +			$leftover = array_merge($leftover,$llower,$lupper,$numbers,$punc);
      +
      +		shuffle($leftover);
      +		$outarray = array_merge($outarray, a_array_rand($leftover, $criteria['num'] - $num_spec));
      +	}
      +
      +	shuffle($outarray);
      +	$return = implode('', $outarray);
      +
      +	debug_log(sprintf('password_generate(): Returning (%s)',$return),1);
      +	return $return;
      +}
      +
      +/**
      + * This function returns an array of $num_req values
      + * randomly picked from the $input array
      + *
      + * @param   array of values 
      + * @param   integer, number of values in returned array
      + * @return string the padded string
      + */
      +function a_array_rand($input,$num_req) {
      +	debug_log(sprintf('a_array_rand(): Entered with (%s,%s)',serialize($input),$num_req),2);
      +
      +	if (count($input) == 0)
      +		return array();
      +
      +	if ($num_req < 1)
      +		return array();
      +
      +	$return = array();
      +	if ($num_req > count($input)) {
      +		for($i = 0; $i < $num_req; $i++) {
      +			$idx = array_rand($input, 1);
      +			$return[] = $input[$idx];
      +		}
      +
      +	} else {
      +		$idxlist = array_rand($input, $num_req);
      +		if ($num_req == 1)
      +			$idxlist = array($idxlist);
      +
      +		for($i = 0; $i < count($idxlist); $i++)
      +			$return[] = $input[$idxlist[$i]];
      +	}
      +
      +	debug_log(sprintf('a_array_rand(): Returning (%s)',serialize($return)),1);
      +	return $return;
      +}
      +
      +/**
      + * Returns the cached array of LDAP resources.
      + *
      + * Note that internally, this function utilizes a two-layer cache, 
      + * one in memory using a static variable for multiple calls within
      + * the same page load, and one in a session for multiple calls within
      + * the same user session (spanning multiple page loads).
      + *
      + * @return Returns the cached attributed requested, 
      + *         or null if there is nothing cached..
      + */
      +function get_cached_item($server_id,$item,$subitem='null') {
      +	debug_log(sprintf('get_cached_item(): Entered with (%s,%s,%s)',$server_id,$item,$subitem),2);
      +
      +	global $config;
      +
      +	# Set default return
      +	$return = null;
      +
      +	# Check config to make sure session-based caching is enabled.
      +	if ($config->GetValue('cache',$item)) {
      +
      +		static $cache;
      +		if (isset($cache[$server_id][$item][$subitem])) {
      +			debug_log(sprintf('get_cached_item(): Returning MEMORY cached [%s] (%s)',$item,$subitem),3);
      +			$return = $cache[$server_id][$item][$subitem];
      +
      +		} elseif (isset($_SESSION['cache'][$server_id][$item][$subitem])) {
      +				debug_log(sprintf('get_cached_item(): Returning SESSION cached [%s] (%s)',$item,$subitem),3);
      +				$return = $_SESSION['cache'][$server_id][$item][$subitem];
      +				$cache[$server_id][$item][$subitem] = $return;
      +
      +   		} 
      +    }
      +
      +	debug_log(sprintf('get_cached_item(): Returning (%s)',serialize($return)),1);
      +	return $return;
      +}
      +
      +/**
      + * Caches the specified $item for the specified $server_id.
      + *
      + * Returns true on success of false on failure.
      + */
      +function set_cached_item($server_id,$item,$subitem='null',$data) {
      +    debug_log(sprintf('set_cached_item(): Entered with (%s,%s,%s,%s)',$server_id,$item,$subitem,serialize($data)),2);
      +
      +	global $config;
      +
      +	# Check config to make sure session-based caching is enabled.
      +	if ($config->GetValue('cache',$item)) {
      +
      +		static $cache;
      +		$cache[$server_id][$item][$subitem] = $data;
      +	    $_SESSION['cache'][$server_id][$item][$subitem] = $data;
      +		return true;
      +
      +	} else
      +		return false;
      +}
      +
      +/**
      + * Get the LDAP base DN for a named DN.
      + *
      + * @param string $dn DN in question
      + * @param object $ldapserver Server ID where DN is located
      + * @return string $base_dn
      + */
      +function dn_get_base($ldapserver,$dn) {
      +	foreach ($ldapserver->getBaseDN() as $base_dn) {
      +		if (preg_match("/".$base_dn."$/",$dn))
      +			return $base_dn;
      +	}
      +
      +	return null;
      +}
       ?>
      diff --git a/header.php b/header.php
      index dee700e..34449be 100644
      --- a/header.php
      +++ b/header.php
      @@ -1,33 +1,44 @@
       \n"; 
      +// We want to get $language into scope in case we were included
      +// from within a function
      +global $config;
      +$language = isset($config) ? $language =  $config->GetValue('appearance','language') : 'auto';
      +
      +// text/xml won't work with MSIE, but is very useful for debugging xhtml code.
      +//@header( "Content-type: text/xml; charset=\"UTF-8\"" );
      +@header( "Content-type: text/html; charset=\"UTF-8\"" );
      +
      +// XML version and encoding for well-behaved browsers
      +echo "\n";
       ?>
       
       
       
       
      +GetValue('appearance','page_title')) { ?>
      +	phpLDAPadmin - <?php echo $pagetitle; ?>
      +
       	phpLDAPadmin
      -	
      -
      +
      +	
      +
      +
       	
      -
      -	
      -	
      -	
      -	
      +
      +	
      +	
      +	
      +	
       	
       
      diff --git a/help.php b/help.php
      index 9fdbae8..8152b8a 100644
      --- a/help.php
      +++ b/help.php
      @@ -1,8 +1,16 @@
       
       
       
      @@ -12,9 +20,8 @@ include 'header.php';
       

      Do you have a problem or question?

      Perhaps you are new to LDAP and need a little guidance?

      -

      Help is only one click away. Visit the online phpLDAPadmin support forum.

      +

      Help is only one click away. Visit the online phpLDAPadmin support forum.


      -

      (Note that paying members will receive priority support, so buy your membership today.)

      diff --git a/hooks.php b/hooks.php new file mode 100644 index 0000000..43e93f4 --- /dev/null +++ b/hooks.php @@ -0,0 +1,186 @@ + and Alcôve + * @package phpLDAPadmin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +if ( ! isset($hooks) ) { + /** This variable contains all hooks that are defined. */ + $hooks = array(); +} + +/** + * Compares two arrays by numerically comparing their 'prority' + * value. Standard `cmp-like' function. + * + * @param a First element to compare. + * @param b Second element to compare. + * + * @return -1 if priority of first element is smaller than second + * element priority. 1 otherwise. + */ +function sort_array_by_priority ( $a, $b ) { + return ( ( $a['priority'] < $b['priority'] ) ? -1 : 1 ); +} + +/** + * Runs procedures attached to a hook. + * + * @param hook_name Name of hook to run. + * @param args Array of optional arguments set by + * phpldapadmin. It is normally in a form known + * by call_user_func_array() : + *
      [ 'server_id' => 0,
      + *   'dn' => 'uid=epoussa,ou=tech,o=corp,o=fr' ]
      + * + * @return true if all procedures returned true, false otherwise. + */ +function run_hook ( $hook_name, $args ) { + global $hooks; + + $debug = 0; + syslog_debug ( "Running hook $hook_name." ); + + if ( ! array_key_exists ( $hook_name, $hooks ) ) { + syslog_notice ( "Hook '$hook_name' not defined !\n" ); + return true; + } + + unset ( $rollbacks ); + $rollbacks = array (); + reset ( $hooks[$hook_name] ); + + /** Execution of procedures attached is done using a numeric order + * since all procedures have been attached to the hook with a + * numerical weight. */ + while ( list ( $key, $hook ) = each ( $hooks[$hook_name] ) ) { + array_push ( $rollbacks, $hook['rollback_function'] ); + syslog_debug ( "Calling " . $hook['hook_function'] . "\n" ); + $result = call_user_func_array ( $hook['hook_function'], $args ); + syslog_notice ( "Called " . $hook['hook_function'] . "\n" ); + + /** If a procedure fails, its optional rollback is executed with + * the same arguments. After that, all rollbacks from + * previously executed procedures are executed in the reverse + * order. */ + if ( $result != true ) { + syslog_debug ( "Function " . $hook['hook_function'] . " returned $result\n" ); + + while ( $rollbacks ) { + $rollback = array_pop ( $rollbacks ); + + if ( $rollback != false ) { + syslog_debug ( "Executing rollback $rollback\n" ); + call_user_func_array ( $rollback, $args ); + } + } + + return false; + } + } + + return true; +} + +/** + * Adds a procedure to a hook for later execution. + * + * @param hook_name Name of the hook. + * @param priority Numeric priority. Lowest means + * procedure will be executed before. + * @param hook_function Name of the php function called upon + * hook trigger. + * @param rollback_function Name of the php rollback function + * called upon failure. + */ +function add_hook ( $hook_name, $priority, $hook_function, $rollback_function ) { + global $hooks; + + if ( ! array_key_exists ( $hook_name, $hooks ) ) { + $hooks[$hook_name] = array(); + } + + array_push ( $hooks[$hook_name], array ( 'priority' => $priority, 'hook_function' => $hook_function, + 'rollback_function' => $rollback_function ) ); + + uasort ( $hooks[$hook_name], "sort_array_by_priority" ); +} + +/** + * Removes a procedure from a hook, based on a filter. + * + * @param hook_name Name of the hook. + * @param priority Numeric priority. If set, all + * procedures of that priority will be + * removed. + * @param hook_function Name of the procedure function. If + * set, all procedures that call this + * function will be removed. + * @param rollback_function Name of the php rollback function + * called upon failure. If set, all + * procedures that call this function + * as a rollback will be removed. + */ +function remove_hook ( $hook_name, $priority, $hook_function, $rollback_function ) { + global $hooks; + + if ( array_key_exists ( $hook_name, $hooks ) ) { + reset ( $hooks[$hook_name] ); + + while ( list ( $key, $hook ) = each ( $hooks[$hook_name] ) ) { + if ( ( $priority >= 0 && $priority == $hook['priority'] ) || + ( $hook_function && $hook_function == $hook['hook_function'] ) || + ( $rollback_function && $rollback_function == $hook['rollback_function'] ) ) { + unset ( $hooks[$hook_name][$key] ); + } + + } + } +} + +/** + * Removes all procedures from a hook. + * + * @param hook_name Name of hook to clear. + */ +function clear_hooks ( $hook_name ) { + global $hooks; + + if ( array_key_exists ( $hook_name, $hooks ) ) { + unset ( $hooks[$hook_name] ); + } +} + +/* Evaluating user-made hooks */ +if ( is_dir('hooks') ) { + $dir = dir ('hooks'); + + while (false !== ($entry = $dir -> read() ) ) { + if ( is_file ("hooks/$entry") and eregi ('php[0-9]?$', $entry) ) { + require_once "hooks/$entry"; + } + } + + $dir -> close(); +} + +?> diff --git a/images/compare.png b/images/compare.png new file mode 100644 index 0000000..e2f48bc Binary files /dev/null and b/images/compare.png differ diff --git a/images/error.png b/images/error.png new file mode 100644 index 0000000..1c427c0 Binary files /dev/null and b/images/error.png differ diff --git a/images/index.php b/images/index.php index 9d533fc..d9a07a1 100644 --- a/images/index.php +++ b/images/index.php @@ -1,6 +1,15 @@ + + + +

      phpLDAPadmin icons


      @@ -9,7 +18,6 @@ $dir = opendir( '.' ); while( ( $file = readdir( $dir ) ) !== false ) { - $counter++; if( $file == '.' || $file == '..' ) continue; if( ! preg_match( '/\.png$/', $file ) ) @@ -19,15 +27,22 @@ while( ( $file = readdir( $dir ) ) !== false ) { $files[ filesize( $file ) . '_' . $file ] = $file; } -ksort( $files ); +sort( $files ); +$cell_style = "color: #888; text-align:center; padding: 10px; padding-bottom: 20px; vertical-align: bottom;"; $counter = 0; +print "
      The " . count( $files ) . " icons used by phpLDAPadmin
      "; +echo ""; +echo ""; foreach( $files as $file ) { + if( $counter % 6 == 0 ) { + echo "\n"; + flush(); + echo ""; + } $counter++; - echo '  '; - if( $counter % 15 == 0 ) - echo '

      '; - flush(); + echo '\n"; } ?> diff --git a/images/logo.jpg b/images/logo.jpg index 845dcd4..6eadc24 100644 Binary files a/images/logo.jpg and b/images/logo.jpg differ diff --git a/images/logo_small.jpg b/images/logo_small.jpg new file mode 100644 index 0000000..583ec4e Binary files /dev/null and b/images/logo_small.jpg differ diff --git a/images/rfc.png b/images/rfc.png new file mode 100644 index 0000000..531caee Binary files /dev/null and b/images/rfc.png differ diff --git a/images/timeout.png b/images/timeout.png new file mode 100644 index 0000000..c3fc126 Binary files /dev/null and b/images/timeout.png differ diff --git a/index.php b/index.php index 860732f..3f29dc0 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,10 @@ @@ -11,158 +15,200 @@ PHP is not installed on your web server!!! *******************************************/ -require './common.php'; +/** + * We will perform some sanity checking here, since this file is normally loaded first when users + * first setup PLA. + */ +@DEFINE(LIBDIR,'./'); +ini_set('display_errors',1); +error_reporting(E_ALL); -if( ! file_exists(realpath( 'config.php' )) ) { +# General functions needed to proceed (pla_ldap_search(), pla_error(), get_object_attrs(), etc.) +ob_start(); +if (! file_exists(LIBDIR.'functions.php')) { + ob_end_clean(); + die("Fatal error: Required file 'functions.php' does not exist."); +} +if (! is_readable(LIBDIR.'functions.php')) { + ob_end_clean(); + die("Cannot read the file 'functions.php' its permissions are too strict."); +} +require LIBDIR.'functions.php'; +$config_file = CONFDIR.'config.php'; +ob_end_clean(); + +/* 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 (! is_readable($file_name)) + pla_error( "Fatal error: Cannot read the file '$file_name', its permissions are too strict." ); + + ob_start(); + require $file_name; + ob_end_clean(); +} + +# Configuration File check +if (! file_exists($config_file)) { ?> phpLDAPadmin - <?php echo pla_version(); ?> - +

      Configure phpLDAPadmin



      -
      - -
      + +
      -\n"; +} elseif (! is_readable($config_file)) { + pla_error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions are too strict.',$config_file)); +} +# Now read in config_default.php, which also reads in config.php +require LIBDIR.'config_default.php'; + +if (check_config()) { + print ''; ?> - + -phpLDAPadmin - <?php echo pla_version(); ?> - +GetValue('appearance','page_title')) { ?> +phpLDAPadmin (<?php echo pla_version(); ?>) - <?php echo $pagetitle; ?> + +phpLDAPadmin - <?php echo pla_version(); ?> + + + - - - - - - - - - phpLDAPadmin Config File Error - - - -

      Config file error

      -

      Syntax error on line

      - -
      - Looks like your config file has a syntax error on line . - Here is a snippet around that line -
      -
      -
      - - "; - if( $i < 0 ) - continue; - echo "" . ($i+1) . ": " . htmlspecialchars($file[ $i ]) . "
      "; - if( $i+1 == $line_num ) - echo "
      "; - } - ?> - - -
      - Hint: Sometimes these errors are caused by lines preceding the line reported. - - + + + phpLDAPadmin Config File Error + + - +

      Config file error

      +

      Syntax error on line

      + +
      + Looks like your config file has a syntax error on line . + Here is a snippet around that line +
      +
      +
      + + + "; + + if( $i < 0 ) + continue; + echo "" . ($i+1) . ": " . htmlspecialchars($file[ $i ]) . "
      "; + + if( $i+1 == $line_num ) + echo "
      "; + } + ?> + + + + +
      + Hint: Sometimes these errors are caused by lines preceding the line reported. + + + + GetServerList()) == 0) { + pla_error( "Your config.php is missing Server Definitions + Please see the sample file config.php.example ", false ); return false; } - /* Make sure there is at least one server in the array */ - $count = 0; - foreach( $servers as $i => $server ) - if( isset( $server['host'] ) ) - $count++; - if( $count == 0 ) { + # @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:
      \$servers['host'] = \"ldap.example.com\";
      @@ -170,13 +216,14 @@ function check_config() 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 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 ) { @@ -184,7 +231,7 @@ function check_config() // Make sure they specified an auth_type if( ! isset( $server['auth_type'] ) ) { - pla_error( "Your configuratoin has an error. You omitted the 'auth_type' directive on server number $id + 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; } @@ -197,8 +244,8 @@ function check_config() } } } +*/ return true; } - ?> diff --git a/lang/Makefile b/lang/Makefile index 7d24b7a..6311af2 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -1,7 +1,7 @@ # # This Makefile (lang/Makefile) converts the source lang files to UTF8 # coding. You need iconv installed to use it. -# $Header: /cvsroot/phpldapadmin/phpldapadmin/lang/Makefile,v 1.24 2004/12/09 14:12:16 uugdave Exp $ +# $Header: /cvsroot/phpldapadmin/phpldapadmin/lang/Makefile,v 1.25 2005/02/06 00:21:30 wurley Exp $ # ToDo: detect the encoding in the "source" # # posible detect of the language @@ -34,10 +34,10 @@ TARGETS=${DESTDIR}/auto.php \ ${DESTDIR}/pt-br.php \ ${DESTDIR}/ru.php \ ${DESTDIR}/sv.php \ + ${DESTDIR}/zh-cn.php \ + ${DESTDIR}/zh-tw.php \ ${DESTDIR}/zz.php \ ${DESTDIR}/zzz.php -# OFF zh-tw.php -# ${DESTDIR}/zh-tw.php \ default: @echo "usage:" @@ -129,11 +129,16 @@ ${DESTDIR}/ru.php: ru.php @echo "Fixing encoding ru.php to UTF8 "${DESTDIR}/ru.php @iconv -f utf8 -t utf8 ru.php > ${DESTDIR}/ru.php -#${DESTDIR}/zh-tw.php: zh-tw.php -# @echo "Copying only the zh-tw.php" - # @iconv -f utf8 -t utf8 zh-tw.php ${DESTDIR}/zh-tw.php +${DESTDIR}/zh-cn.php: zh-cn.php + @echo "Copying only the zh-cn.php" + @cp zh-cn.php ${DESTDIR}/zh-cn.php + +${DESTDIR}/zh-tw.php: zh-tw.php + @echo "Copying only the zh-tw.php" + @cp zh-tw.php ${DESTDIR}/zh-tw.php + # @iconv -f utf8 -t utf8 zh-tw.php ${DESTDIR}/zh-tw.php # INTERNAL BUG COULDN CONVERT IT, SO WE COPY IT - # cp zh-tw.php ${DESTDIR}/zh-tw.php + ${DESTDIR}/zz.php: zz.php @echo "Copying only the zz.php" @cp zz.php ${DESTDIR}/. diff --git a/lang/auto.php b/lang/auto.php index abc98fc..b13e1d4 100644 --- a/lang/auto.php +++ b/lang/auto.php @@ -1,8 +1,8 @@ "ca" // catalan ," ru-"=>"ru" // ru- exits? ," sv "=>"sv" //swedish ," sv-"=>"sv" // swedisch to + ," zh-cn"=>"zh-cn" // simplified chinese + ," zh-tw"=>"zh-tw" // taiwan? );// all supported languages in this array // test diff --git a/lang/en.php b/lang/en.php index d80ede9..c52717a 100644 --- a/lang/en.php +++ b/lang/en.php @@ -1,5 +1,5 @@ %s'; $lang['could_not_set_cookie'] = 'Could not set cookie.'; $lang['ldap_said'] = 'LDAP said: %s'; $lang['ferror_error'] = 'Error'; $lang['fbrowse'] = 'browse'; $lang['delete_photo'] = 'Delete Photo'; -$lang['install_not_support_blowfish'] = 'Your PHP install does not support blowfish encryption.'; -$lang['install_not_support_md5crypt'] = 'Your PHP install does not support md5crypt encryption.'; +$lang['install_not_support_ext_des'] = 'Your system crypt library does not support extended DES encryption.'; +$lang['install_not_support_blowfish'] = 'Your system crypt library does not support blowfish encryption.'; +$lang['install_not_support_md5crypt'] = 'Your system crypt library does not support md5crypt encryption.'; $lang['install_no_mash'] = 'Your PHP install does not have the mhash() function. Cannot do SHA hashes.'; $lang['jpeg_contains_errors'] = 'jpegPhoto contains errors
      '; $lang['ferror_number'] = 'Error number: %s (%s)'; @@ -457,8 +457,10 @@ $lang['ferror_unrecognized_num'] = 'Unrecognized error number: '; $lang['ferror_nonfatil_bug'] = '

      '; + echo "$file
      You found a non-fatal phpLDAPadmin bug!
      Error:%s (%s)
      File: %s line %s, caller %s
      Versions:PLA: %s, PHP: %s, SAPI: %s -
      Web server:%s
      - Please report this bug by clicking here.

      '; + Web server:%s +
      Please check and see if this bug has been reported here.
      +
      If it hasnt been reported, you may report this bug by clicking here.
      +
      '; $lang['ferror_congrats_found_bug'] = 'Congratulations! You found a bug in phpLDAPadmin.

      @@ -514,16 +516,14 @@ $lang['searching'] = 'Searching...'; $lang['size_limit_exceeded'] = 'Notice, search size limit exceeded.'; $lang['entry'] = 'Entry'; $lang['ldif_export_for_dn'] = 'LDIF Export for: %s'; -$lang['generated_on_date'] = 'Generated by phpLDAPadmin ( http://www.phpldapadmin.com/ ) on %s'; +$lang['generated_on_date'] = 'Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on %s'; $lang['total_entries'] = 'Total Entries'; $lang['dsml_export_for_dn'] = 'DSLM Export for: %s'; $lang['include_system_attrs'] = 'Include system attributes'; $lang['csv_spreadsheet'] = 'CSV (Spreadsheet)'; // logins -$lang['could_not_find_user'] = 'Could not find a user "%s"'; $lang['password_blank'] = 'You left the password blank.'; -$lang['login_cancelled'] = 'Login cancelled.'; $lang['no_one_logged_in'] = 'No one is logged in to that server.'; $lang['could_not_logout'] = 'Could not logout.'; $lang['unknown_auth_type'] = 'Unknown auth_type: %s'; @@ -535,6 +535,7 @@ $lang['login_dn'] = 'Login DN'; $lang['user_name'] = 'User name'; $lang['password'] = 'Password'; $lang['authenticate'] = 'Authenticate'; +$lang['login_not_allowed'] = 'Sorry, you are not allowed to use phpLDAPadmin with this LDAP server.'; // Entry browser $lang['entry_chooser_title'] = 'Entry Chooser'; @@ -547,7 +548,6 @@ $lang['no_deletes_in_read_only'] = 'Deletes not allowed in read only mode.'; $lang['error_calling_mass_delete'] = 'Error calling mass_delete.php. Missing mass_delete in POST vars.'; $lang['mass_delete_not_array'] = 'mass_delete POST var is not an array.'; $lang['mass_delete_not_enabled'] = 'Mass deletion is not enabled. Please enable it in config.php before proceeding.'; -$lang['search_attrs_wrong_count'] = 'Your config.php has an error. The number of attributes in $search_attributes and $search_attributes_display is different'; $lang['mass_deleting'] = 'Mass Deleting'; $lang['mass_delete_progress'] = 'Deletion progress on server "%s"'; $lang['malformed_mass_delete_array'] = 'Malformed mass_delete array.'; @@ -564,20 +564,14 @@ $lang['no_rdn_change'] = 'You did not change the RDN'; $lang['invalid_rdn'] = 'Invalid RDN value'; $lang['could_not_rename'] = 'Could not rename the entry'; -// General errors -$lang['php5_unsupported'] = 'phpLDAPadmin does not yet support PHP 5. You will likely encounter many weird problems if you continue.'; -$lang['mismatched_search_attr_config'] = 'Your configuration has an error. $search_attributes must have the same number of attributes as $search_attributes_display.'; - // Password checker $lang['passwords_match'] = 'Passwords match!'; $lang['passwords_do_not_match'] = 'Passwords do not match!'; $lang['password_checker_tool'] = 'Password Checker Tool'; -$lang['compare'] = 'Compare'; $lang['to'] = 'To'; // Templates $lang['using'] = 'Using the'; -$lang['template'] = 'template'; $lang['switch_to'] = 'You may switch to the '; $lang['default_template'] = 'default template'; @@ -586,8 +580,9 @@ $lang['user_account'] = 'User Account (posixAccount)'; $lang['address_book_inet'] = 'Address Book Entry (inetOrgPerson)'; $lang['address_book_moz'] = 'Address Book Entry (mozillaOrgPerson)'; $lang['kolab_user'] = 'Kolab User Entry'; -$lang['organizational_unit'] = 'Organizational Unit'; -$lang['organizational_role'] = 'Organizational Role'; +$lang['organizational_unit'] = 'Organisational Unit'; +$lang['new_organizational_unit'] = 'New Organisational Unit'; +$lang['organizational_role'] = 'Organisational Role'; $lang['posix_group'] = 'Posix Group'; $lang['samba_machine'] = 'Samba NT Machine'; $lang['samba3_machine'] = 'Samba 3 NT Machine'; @@ -634,6 +629,7 @@ $lang['t_first_name'] = 'First name'; $lang['t_last_name'] = 'Last name'; $lang['t_first'] = 'first'; $lang['t_last'] = 'last'; +$lang['t_state'] = 'State'; $lang['t_common_name'] = 'Common name'; $lang['t_user_name'] = 'User Name'; $lang['t_password'] = 'Password'; @@ -644,6 +640,7 @@ $lang['t_uid_number'] = 'UID Number'; $lang['t_auto_det'] = '(automatically determined)'; $lang['t_group'] = 'Group'; $lang['t_gid_number'] = 'GID Number'; +$lang['t_uid'] = 'User ID'; $lang['t_err_passwords'] = 'Your passwords don\'t match. Please go back and try again.'; $lang['t_err_field_blank'] = 'You cannot leave the %s blank. Please go back and try again.'; $lang['t_err_field_num'] = 'You can only enter numeric values for the %s field. Please go back and try again.'; @@ -651,10 +648,14 @@ $lang['t_err_bad_container'] = 'The container you specified (%s) does not exist. $lang['t_confirm_account_creation'] = 'Confirm account creation'; $lang['t_secret'] = '[secret]'; $lang['t_create_account'] = 'Create Account'; +$lang['t_verify'] = 'Verify'; + +// New Group (Posix) +$lang['t_new_posixgroup'] = 'New Posix Group'; // New Address Template $lang['t_new_address'] = 'New Address Book Entry'; -$lang['t_organization'] = 'Organization'; +$lang['t_organization'] = 'Organisation'; $lang['t_address'] = 'Address'; $lang['t_city'] = 'City'; $lang['t_postal_code'] = 'Postal code'; @@ -670,5 +671,24 @@ $lang['t_create_address'] = 'Create Address'; // default template $lang['t_check_pass'] = 'Check password...'; +$lang['t_auto_submit'] = '(Auto evalutated on submission.)'; +// compare form +$lang['compare'] = 'Compare'; +$lang['comparing'] = 'Comparing the following DNs'; +$lang['compare_dn'] = 'Compare another DN with'; +$lang['with'] = 'with '; +$lang['compf_source_dn'] = 'Source DN'; +$lang['compf_dn_tooltip'] = 'Compare this DN with another'; +$lang['switch_entry'] = 'Switch Entry'; +$lang['no_value'] = 'No Value'; +$lang['compare_with'] = 'Compare with another entry'; +$lang['need_oclass'] = 'You need one of the following ObjectClass(es) to add this attribute %s.'; + +// Time out page +$lang['session_timed_out_1'] = 'Your Session timed out after'; +$lang['session_timed_out_2'] = 'min. of inactivity. You have been automatically logged out.'; +$lang['log_back_in'] = 'To log back in please click on the following link:'; +$lang['session_timed_out_tree'] = '(Session timed out. Automatically logged out.)'; +$lang['timeout_at'] = 'Inactivity will log you off at %s'; ?> diff --git a/lang/es.php b/lang/es.php index bd682e3..a6f9b49 100644 --- a/lang/es.php +++ b/lang/es.php @@ -1,28 +1,37 @@ + */ // Search form $lang['simple_search_form_str'] = 'Formulario de búsqueda sencilla'; $lang['advanced_search_form_str'] = 'Formulario de búsqueda avanzada'; $lang['server'] = 'Servidor'; -$lang['search_for_entries_whose'] = 'Buscar objetos los cuales'; -$lang['base_dn'] = 'DN Base'; -$lang['search_scope'] = 'Alcance de la búsqueda'; -$lang['search_ filter'] = 'Filtro de Búsqueda'; +$lang['search_for_entries_whose'] = 'Buscar objetos que'; +$lang['base_dn'] = 'DN base'; +$lang['search_scope'] = 'Ámbito de búsqueda'; $lang['show_attributes'] = 'Mostrar atributos'; +$lang['attributes'] = 'Atributos'; $lang['Search'] = 'Buscar'; -$lang['equals'] = 'equivale'; -$lang['starts_with'] = 'comienza con'; -$lang['contains'] = 'contiene'; -$lang['ends_with'] = 'termina con'; -$lang['sounds_like'] = 'suena como'; +$lang['predefined_search_str'] = 'Seleccionar una búsqueda predefinida'; +$lang['predefined_searches'] = 'Búsquedas predefinidas'; +$lang['no_predefined_queries'] = 'No hay ninguna búsqueda predefinida en config.php.'; +$lang['export_results'] = 'exportar resultados'; +$lang['unrecoginzed_search_result_format'] = 'Formato de resultado de búsqueda no reconocido: %s'; +$lang['format'] = 'Formato'; +$lang['list'] = 'lista'; +$lang['table'] = 'tabla'; +$lang['bad_search_display'] = 'Su config.php especifica un valor no válido para $default_search_display: %s. Por favor, arréglelo'; +$lang['page_n'] = 'Página %d'; +$lang['no_results'] = 'La búsqueda no ha encontrado resultados.'; // Tree browser -$lang['request_new_feature'] = 'Pedir funcionalidad'; -$lang['see_open_requests'] = 'Ver las peticiones'; -$lang['report_bug'] = 'Reportar un error'; -$lang['see_open_bugs'] = 'Ver los errores'; +$lang['request_new_feature'] = 'Solicitar una nueva funcionalidad'; +$lang['report_bug'] = 'Informar de un error'; $lang['schema'] = 'esquema'; $lang['search'] = 'buscar'; $lang['create'] = 'crear'; @@ -30,313 +39,617 @@ $lang['info'] = 'info'; $lang['import'] = 'importar'; $lang['refresh'] = 'refrescar'; $lang['logout'] = 'salir'; -$lang['create_new'] = 'Crear Nuevo Objeto'; -$lang['view_schema_for'] = 'Ver esquema para'; -$lang['refresh_expanded_containers'] = 'Refrescar todos los contenedores extendidos para'; -$lang['create_new_entry_on'] = 'Crear nuevo objeto en'; -$lang['view_server_info'] = 'Ver información del servidor'; -$lang['import_from_ldif'] = 'Importar objetos de archivo LDIF'; -$lang['logout_of_this_server'] = 'Salir de este servidor'; +$lang['create_new'] = 'Crear nuevo objeto'; +$lang['view_schema_for'] = 'Ver el esquema del'; +$lang['refresh_expanded_containers'] = 'Refrescar todos los contenedores extendidos del'; +$lang['create_new_entry_on'] = 'Crear un nuevo objeto en el'; +$lang['new'] = 'nuevo'; +$lang['view_server_info'] = 'Ver la información enviada por el servidor'; +$lang['import_from_ldif'] = 'Importar desde un fichero LDIF'; +$lang['logout_of_this_server'] = 'Desconectar del servidor'; $lang['logged_in_as'] = 'Conectado como: '; -$lang['read_only'] = 'inalterable'; -$lang['could_not_determine_root'] = 'No se ha podido determinar la raiz del servidor LDAP.'; -$lang['ldap_refuses_to_give_root'] = 'Parece ser que el servidor LDAP se ha configurado para no revelar su raiz.'; -$lang['please_specify_in_config'] = 'Por favor especifícala en el archivo config.php'; -$lang['create_new_entry_in'] = 'Crear un nuevo objeto en'; -$lang['login_link'] = 'Autenticación...'; +$lang['this_base_dn_is_not_valid'] = 'Esta DN base no es válida.'; +$lang['this_base_dn_does_not_exist'] = 'Este objeto no existe.'; +$lang['read_only'] = 'sólo lectura'; +$lang['read_only_tooltip'] = 'Este atributo ha sido marcado como de sólo lectura por el administrador de phpLDAPadmin'; +$lang['could_not_determine_root'] = 'No se ha podido determinar la raíz de su árbol LDAP.'; +$lang['ldap_refuses_to_give_root'] = 'Parece que el servidor LDAP ha sido configurado para no revelar su raíz.'; +$lang['please_specify_in_config'] = 'Por favór, especifíquela en config.php'; +$lang['create_new_entry_in'] = 'Crear nuevo objeto en'; +$lang['login_link'] = 'Autentificación'; +$lang['login'] = 'conectar'; +$lang['base_entry_does_not_exist'] = 'Este objeto base no existe.'; +$lang['create_it'] = '¿Crearlo?'; // Entry display $lang['delete_this_entry'] = 'Borrar este objeto'; -$lang['delete_this_entry_tooltip'] = 'Se tendrá que confirmar esta decision'; +$lang['delete_this_entry_tooltip'] = 'Se le pedirá confirmación'; $lang['copy_this_entry'] = 'Copiar este objeto'; -$lang['copy_this_entry_tooltip'] = 'Copiar este objeto para otra localización, DN nuevo, o para otro servidor.'; -$lang['export_to_ldif'] = 'Exportar archivo LDIF'; -$lang['export_to_ldif_tooltip'] = 'Guardar archivo LDIF de este objeto'; -$lang['export_subtree_to_ldif_tooltip'] = 'Guardar archivo LDIF de este objeto i todos sus objetos hijos'; -$lang['export_subtree_to_ldif'] = 'Exportar archivo LDIF de sub-estructura'; -$lang['export_mac'] = 'Avance de línea de Macintosh'; -$lang['export_win'] = 'Avance de línea de Windows'; -$lang['export_unix'] = 'Avance de línea de Unix'; -$lang['create_a_child_entry'] = 'Crear objeto como hijo'; -$lang['add_a_jpeg_photo'] = 'Agregar jpegPhoto'; +$lang['copy_this_entry_tooltip'] = 'Copiar este objeto en otro sitio: un nuevo DN u otro servidor'; +$lang['export'] = 'Exportar'; +$lang['export_lcase'] = 'exportar'; +$lang['export_tooltip'] = 'Exportar este objeto'; +$lang['export_subtree_tooltip'] = 'Exportar este objeto y todos sus hijos'; +$lang['export_subtree'] = 'Exportar subárbol'; +$lang['create_a_child_entry'] = 'Crear un objeto hijo'; $lang['rename_entry'] = 'Renombrar objeto'; $lang['rename'] = 'Renombrar'; -$lang['add'] = 'Agregar'; +$lang['add'] = 'Añadir'; $lang['view'] = 'Ver'; -$lang['add_new_attribute'] = 'Agregar nuevo atributo'; -$lang['add_new_attribute_tooltip'] = 'Agregar nuevo atributo/valor a este objeto'; -$lang['internal_attributes'] = 'Atributos Internos'; -$lang['hide_internal_attrs'] = 'ocultar los atributos internos'; -$lang['show_internal_attrs'] = 'mostrar els atributos internos'; -$lang['internal_attrs_tooltip'] = 'Los atributos fijos automaticamente para el servidor'; -$lang['entry_attributes'] = 'Atributos del objeto'; -$lang['attr_name_tooltip'] = 'Haz click para ver la definicion del esquema para tipos de atributo \'%s\''; -$lang['click_to_display'] = 'Haz click para mostrar'; -$lang['hidden'] = 'ocultado'; +$lang['view_one_child'] = 'Ver 1 hijo'; +$lang['view_children'] = 'Ver %s hijos'; +$lang['add_new_attribute'] = 'Añadir atributo'; +$lang['add_new_objectclass'] = 'Añadir ObjectClass'; +$lang['hide_internal_attrs'] = 'Ocultar atributos internos'; +$lang['show_internal_attrs'] = 'Mostrar atributos internos'; +$lang['attr_name_tooltip'] = 'Haga click para ver el esquema del atributo de tipo \'%s\''; $lang['none'] = 'ninguno'; -$lang['save_changes'] = 'Guardar los cambios'; -$lang['add_value'] = 'agregar valor'; -$lang['add_value_tooltip'] = 'Agregar valor adicional a este atributo'; +$lang['no_internal_attributes'] = 'No hay atributos internos'; +$lang['no_attributes'] = 'Este objeto no tiene atributos'; +$lang['save_changes'] = 'Guardar cambios'; +$lang['add_value'] = 'añadir valor'; +$lang['add_value_tooltip'] = 'Añadir un valor al atributo \'%s\''; $lang['refresh_entry'] = 'Refrescar'; $lang['refresh_this_entry'] = 'Refrescar este objeto'; -$lang['delete_hint'] = 'Pista: Para borrar un atributo, vacía el formulario de texto y haz click en Guardar.'; -$lang['attr_schema_hint'] = 'Pista: Para ver el esquema de un atributo, haz click en el nombre del atributo.'; -$lang['attrs_modified'] = 'Algunos atributos (%s) fueron modificados y estan remarcados más abajo.'; -$lang['attr_modified'] = 'Un atributo (%s) fué modificado y está remarcado más abajo.'; -$lang['viewing_read_only'] = 'Mostrando el objeto en modo de no alterar.'; -$lang['change_entry_rdn'] = 'Modificar el RDN de este objeto'; -$lang['no_new_attrs_available'] = 'No hay atributos nuevos disponibles para este objeto'; +$lang['delete_hint'] = 'Nota: para borrar un atributo, borre su atributo y haga click en guardar.'; +$lang['attr_schema_hint'] = 'Nota: Para ver el esquema de un atributo, haga click en su nombre.'; +$lang['attrs_modified'] = 'Se han modificado algunos atributos (%s) que se encuentran destacados mas abajo.'; +$lang['attr_modified'] = 'Se ha modificado algún atributo (%s) que se encuentra destacado más abajo.'; +$lang['viewing_read_only'] = 'Nota: Modo de sólo lectura.'; +$lang['no_new_attrs_available'] = 'no hay nuevos atributos en este objeto'; +$lang['no_new_binary_attrs_available'] = 'no hay nuevos atributos binarios en este objeto'; $lang['binary_value'] = 'Valor binario'; -$lang['add_new_binary_attr'] = 'Agregar valor binario'; -$lang['add_new_binary_attr_tooltip'] = 'Agregar atributo/valor binario de un archivo'; -$lang['alias_for'] = '%s es sinónimo para %s'; -$lang['download_value'] = 'Descargar valor'; -$lang['delete_attribute'] = 'Borrar atributo'; -$lang['true'] = 'verdad'; +$lang['add_new_binary_attr'] = 'Añadir atributo binario'; +$lang['alias_for'] = 'Nota: \'%s\' es un alias de \'%s\''; +$lang['required_for'] = 'Atributo requerido para la(s) clase(s) de objeto %s'; +$lang['download_value'] = 'descargar valor'; +$lang['delete_attribute'] = 'borrar atributo'; +$lang['true'] = 'verdadero'; $lang['false'] = 'falso'; -$lang['none_remove_value'] = 'ningo, borrar valor'; -$lang['really_delete_attribute'] = 'Borrar realmente el atributo?'; +$lang['none_remove_value'] = 'ninguno, borrar valor'; +$lang['really_delete_attribute'] = '¿Borrar realmente el atributo'; +$lang['add_new_value'] = 'Añadir valor'; // Schema browser -$lang['the_following_objectclasses'] = 'Los siguientes ObjectClass están presentes en este servidor LDAP.'; -$lang['the_following_attributes'] = 'Los siguientes attributeTypes están presentes en este servidor LDAP.'; -$lang['the_following_matching'] = 'Los siguientes matching rules están presentes en este servidor LDAP.'; -$lang['the_following_syntaxes'] = 'Los siguientes sintaxis están presentes en este servidor LDAP.'; -$lang['jump_to_objectclass'] = 'Saltar a una ObjectClass'; -$lang['jump_to_attr'] = 'Saltar a un atributo'; -$lang['schema_for_server'] = 'Esquema del servidor '; -$lang['required_attrs'] = 'Atributos Requeridos (MUST)'; -$lang['optional_attrs'] = 'Atributos Opcionales (MAY)'; +$lang['the_following_objectclasses'] = 'El servidor LDAP soporta las siguientes clases de objeto:'; +$lang['the_following_attributes'] = 'El servidor LDAP soporta los siguientes tipos de atributo:'; +$lang['the_following_matching'] = 'El servidor LDAP soporta las siguientes reglas de coincidencia:'; +$lang['the_following_syntaxes'] = 'El servidor LDAP soporta las siguientes sintaxis:'; +$lang['schema_retrieve_error_1']='El servidor LDAP no soporta el protocolo LDAP en su totalidad.'; +$lang['schema_retrieve_error_2']='Su versión de PHP no realiza la petición correctamente.'; +$lang['schema_retrieve_error_3']='O el phpLDAPadmin no sabe como obtener el esquema del servidor.'; +$lang['jump_to_objectclass'] = 'Ir a la clase de objeto'; +$lang['view_schema_for_oclass'] = 'Ver la descripción del esquema para esta clase de objeto.'; +$lang['jump_to_attr'] = 'Ir al tipo de atributo'; +$lang['jump_to_matching_rule'] = 'Ir a la regla de coincidencia'; +$lang['schema_for_server'] = 'Esquema del servidor'; +$lang['required_attrs'] = 'Atributos requeridos'; +$lang['required'] = 'requerido'; +$lang['optional_attrs'] = 'Atributos opcionales'; +$lang['optional_binary_attrs'] = 'Atributos binarios opcionales'; $lang['OID'] = 'OID'; +$lang['aliases']='Alias'; $lang['desc'] = 'Descripción'; -$lang['name'] = 'Nom'; -$lang['is_obsolete'] = 'Esta ObjectClass es obsoleta'; -$lang['inherits'] = 'Hereda'; -$lang['jump_to_this_oclass'] = 'Saltar a esta ObjectClass'; -$lang['matching_rule_oid'] = 'OID de Matching Rule'; -$lang['syntax_oid'] = 'OID de Sintaxi'; -$lang['not_applicable'] = 'no es aplicable'; -$lang['not_specified'] = 'no especificada'; +$lang['no_description']='sin descripción'; +$lang['name'] = 'Nombre'; +$lang['equality']='Igualdad'; +$lang['is_obsolete'] = 'Esta clase de objeto es obsoleta.'; +$lang['inherits'] = 'Hereda de'; +$lang['inherited_from'] = 'Heredado de'; +$lang['parent_to'] = 'Padre de'; +$lang['jump_to_this_oclass'] = 'Ir a la definición de esta clase de objeto'; +$lang['matching_rule_oid'] = 'OID de la regla de coincidencia'; +$lang['syntax_oid'] = 'OID de sintaxis'; +$lang['not_applicable'] = 'no aplicable'; +$lang['not_specified'] = 'no especificado'; +$lang['character'] = 'carácter'; +$lang['characters'] = 'caracteres'; +$lang['used_by_objectclasses'] = 'Usado por la clase de objeto'; +$lang['used_by_attributes'] = 'Usado por los atributos'; +$lang['maximum_length'] = 'Longitud máxima'; +$lang['attribute_types']='Tipos de atributo'; +$lang['syntaxes'] = 'Sintaxis'; +$lang['matchingrules'] = 'Reglas de coincidencia'; +$lang['oid'] = 'OID'; +$lang['obsolete'] = 'Obsoleto'; +$lang['ordering'] = 'Ordenación'; +$lang['substring_rule'] = 'Regla de subcadena'; +$lang['single_valued'] = 'Univaludado'; +$lang['collective'] = 'Colectivo'; +$lang['user_modification'] = 'Modificado por el usuario'; +$lang['usage'] = 'Uso'; +$lang['could_not_retrieve_schema_from'] = 'No se ha podido obtener el esquema de'; +$lang['type'] = 'Tipo'; +$lang['no_such_schema_item'] = 'No hay tal ítem en el esquema: "%s"'; // Deleting entries -$lang['entry_deleted_successfully'] = 'Entrada \'%s\' borrada correctamente.'; -$lang['you_must_specify_a_dn'] = 'Tienes que especificar un DN'; -$lang['could_not_delete_entry'] = 'No he podido borrar la entrada: %s'; +$lang['entry_deleted_successfully'] = 'Objeto %s borrado correctamente.'; +$lang['you_must_specify_a_dn'] = 'Debe especificar un DN'; +$lang['could_not_delete_entry'] = 'No se ha podido borrar el objeto %s'; +$lang['no_such_entry'] = 'No hay tal objeto %s'; +$lang['delete_dn'] = 'Borrar %s'; +$lang['permanently_delete_children'] = '¿Borrar también todos los hijos?'; +$lang['entry_is_root_sub_tree'] = 'Este objeto es la raíz de un subárbol que contiene %s objetos.'; +$lang['view_entries'] = 'ver objetos'; +$lang['confirm_recursive_delete'] = 'phpLDAPadmin puede borrar recursivamente este objeto y sus %s hijos. Vea más abajo la lista de objetos que se borrarán ahora. ¿Todavía quiere hacerlo?'; +$lang['confirm_recursive_delete_note'] = 'Nota: es potencialmente peligroso y debe hacerlo a su cuenta y riesgo. Esta operación NO puede deshacerse. Tome en consideración alias, referencias y otras cosas que puedan causar problemas.'; +$lang['delete_all_x_objects'] = 'Borrar los %s objetos'; +$lang['recursive_delete_progress'] = 'Progreso de la borración recursiva'; +$lang['entry_and_sub_tree_deleted_successfully'] = 'Objeto %s y su subárbol borrado correctamente.'; +$lang['failed_to_delete_entry'] = 'Error al borrar el objeto %s'; +$lang['list_of_entries_to_be_deleted'] = 'Lista de objetos a borrar:'; +$lang['sure_permanent_delete_object']='¿Está seguro de querer borrar este objeto?'; +$lang['dn'] = 'DN'; + +// Deleting attributes +$lang['attr_is_read_only'] = 'El atributo "%s" está marcado como de sólo lectura en la configuración de phpLDAPadmin.'; +$lang['no_attr_specified'] = 'No se ha especificado ningún nombre de atributo.'; +$lang['no_dn_specified'] = 'No se ha especificado ningún DN'; + +// Adding attributes +$lang['left_attr_blank'] = 'Ha dejado en blanco el valor del atributo. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['failed_to_add_attr'] = 'Error al añadir atributo.'; +$lang['file_empty'] = 'El fichero que ha escogido no existe o está vacío. Por favor vuelva atrás e inténtelo de nuevo.'; +$lang['invalid_file'] = 'Error de seguridad: El fichero que está enviando puede ser malicioso.'; +$lang['warning_file_uploads_disabled'] = 'Su configuración del PHP ha desactivado la recepción de ficheros. Por favor revise php.ini antes de continuar.'; +$lang['uploaded_file_too_big'] = 'El fichero que está enviando es demasiado grande. Por favor revise el ajuste "upload_max_size" en php.ini.'; +$lang['uploaded_file_partial'] = 'El fichero que ha seleccionado sólo se ha recibido parcialmente debido a un error de red.'; +$lang['max_file_size'] = 'Tamaño máximo de fichero: %s'; + +// Updating values +$lang['modification_successful'] = '¡Modificación realizada correctamente!'; +$lang['change_password_new_login'] = 'Como ha cambiado su contraseña, debe conectarse de nuevo empleando la nueva.'; // Adding objectClass form $lang['new_required_attrs'] = 'Nuevos atributos requeridos'; -$lang['requires_to_add'] = 'Esta acción exige que se agreguen'; +$lang['requires_to_add'] = 'Esta acción requiere que añada'; $lang['new_attributes'] = 'nuevos atributos'; -$lang['new_required_attrs_instructions'] = 'Instrucciones: Para agregar esta ObjectClass a este objeto, se tiene que especificar'; -$lang['that_this_oclass_requires'] = 'que este ObjectClass requiere. Se puede hacer con este formulario.'; -$lang['add_oclass_and_attrs'] = 'Agregar ObjectClass y Atributos'; +$lang['new_required_attrs_instructions'] = 'Instrucciones: Para poder añadir esta clase a este objeto, debe especificar'; +$lang['that_this_oclass_requires'] = 'que esta clase requiere. Puede hacerlo en este formulario.'; +$lang['add_oclass_and_attrs'] = 'Añadir clase de objeto y atributos'; +$lang['objectclasses'] = 'Clases de objeto'; // General -$lang['chooser_link_tooltip'] = 'Haz click para seleccionar un objeto graficamente'; -$lang['no_updates_in_read_only_mode'] = 'No se puede modificar el objeto si el servidor está operando en modo inalterable.'; -$lang['bad_server_id'] = 'El identificador de servidor está mal'; -$lang['not_enough_login_info'] = 'No tengo suficiente información para conectar al servidor. Por favor configura correctamente el archivo config.php'; -$lang['could_not_connect'] = 'No se ha podido conectar al servidor LDAP'; -$lang['could_not_perform_ldap_mod_add'] = 'No se ha podido ejecutar la operación del ldap_mod_add.'; -$lang['bad_server_id_underline'] = 'El identificador del servidor está mal: '; -$lang['success'] = 'Exito'; +$lang['chooser_link_tooltip'] = 'Haga click en el diálogo emergente para seleccionar un DN de forma gráfica'; +$lang['no_updates_in_read_only_mode'] = 'No puede realizar cambios cuando el servidor está funcionando en modo de sólo lectura'; +$lang['bad_server_id'] = 'Identificador de servidor no válido'; +$lang['not_enough_login_info'] = 'No hay información suficiente para conectar con el servidor. Por favor, revise su configuración.'; +$lang['could_not_connect'] = 'No se ha podido conectar con el servidor LDAP.'; +$lang['could_not_connect_to_host_on_port'] = 'No se ha podido conectar con "%s" en el puerto "%s"'; +$lang['could_not_perform_ldap_mod_add'] = 'No se ha podido realizar la operación "ldap_mod_add".'; +$lang['bad_server_id_underline'] = 'Identificador de servidor no válido: '; +$lang['success'] = 'Éxito'; +$lang['home'] = 'Inicio'; +$lang['help'] = 'Ayuda'; +$lang['success'] = 'Éxito'; $lang['server_colon_pare'] = 'Servidor: '; -$lang['look_in'] = 'Buscando a: '; -$lang['missing_server_id_in_query_string'] = 'No está presente el identificador del servidor en la URL'; -$lang['missing_dn_in_query_string'] = 'No está presente el DN en la URL'; -$lang['back_up_p'] = 'Volver a...'; -$lang['no_entries'] = 'no hay entradas'; -$lang['not_logged_in'] = 'No estás autenticado'; -$lang['could_not_det_base_dn'] = 'No he podido determinar la base DN'; +$lang['look_in'] = 'Buscando en: '; +$lang['missing_server_id_in_query_string'] = '¡No se ha especificado ningún servidor en la petición!'; +$lang['missing_dn_in_query_string'] = '¡No se ha especificado ningún DN en la petición!'; +$lang['back_up_p'] = 'Volver'; +$lang['no_entries'] = 'no hay objetos'; +$lang['not_logged_in'] = 'No está conectado'; +$lang['could_not_det_base_dn'] = 'No se puede determinar el DN base'; +$lang['please_report_this_as_a_bug']='Por favor informe de este error.'; +$lang['reasons_for_error']='Esto puede suceder por varias razones, las más probables son:'; +$lang['yes']='Sí'; +$lang['no']='No'; +$lang['go']='Ir'; +$lang['delete']='Borrar'; +$lang['back']='Atrás'; +$lang['object']='objeto'; +$lang['delete_all']='Borrar todo'; +$lang['url_bug_report']='https://sourceforge.net/tracker/?func=add&group_id=61828&atid=498546'; +$lang['hint'] = 'nota'; +$lang['bug'] = 'error'; +$lang['warning'] = 'aviso'; +$lang['light'] = 'bombilla'; // the word 'light' from 'light bulb' +$lang['proceed_gt'] = 'Proceder >>'; // Add value form -$lang['add_new'] = 'Agregar'; -$lang['value_to'] = 'valor a'; -$lang['server'] = 'Servidor'; +$lang['add_new'] = 'Añadir'; +$lang['value_to'] = 'valor de'; $lang['distinguished_name'] = 'Nombre distinguido'; -$lang['current_list_of'] = 'La lista actual de'; -$lang['values_for_attribute'] = 'valores para el atributo'; -$lang['inappropriate_matching_note'] = 'Nota: Sino has configurado una regla \'EQUALITY\' en el servidor LDAP, recibirás un error \'inappropriate matching\''; -$lang['enter_value_to_add'] = 'Proveer el valor para agregar: '; -$lang['new_required_attrs_note'] = 'Nota: Es posible que se requiera agregar nuevos atributos para satisfacer los requisitos de esta ObjectClass'; -$lang['syntax'] = 'Sintaxi'; +$lang['current_list_of'] = 'Lista actual de'; +$lang['values_for_attribute'] = 'valores del atributo'; +$lang['inappropriate_matching_note'] = 'Nota: Si no ha creado una regla de igualdad en el servidor LDAP para este atributo, obtendrá un error de coincidencia inapropiada ("inappropriate matching").'; +$lang['enter_value_to_add'] = 'Introduzca el valor a añadir:'; +$lang['new_required_attrs_note'] = 'Nota: puede que tenga que introducir nuevos atributos que esta clase de objeto requiera'; +$lang['syntax'] = 'Sintaxis'; //copy.php -$lang['copy_server_read_only'] = 'No se pueden realizar las modificaciones si el servidor está operando en modo inalterable'; -$lang['copy_dest_dn_blank'] = 'No se ha rellenado el formulario de DN.'; -$lang['copy_dest_already_exists'] = 'La entrada de destino (%s) encara existe.'; -$lang['copy_dest_container_does_not_exist'] = 'El contenedor de destino (%s) no existe.'; -$lang['copy_source_dest_dn_same'] = 'El DN de la fuente y el DN de destino son los mismos.'; +$lang['copy_server_read_only'] = 'No puede realizar modificaciones cuando el servidor está en modo de sólo lectura'; +$lang['copy_dest_dn_blank'] = 'Ha dejado el campo DN en blanco.'; +$lang['copy_dest_already_exists'] = 'El objeto destino (%s) ya existe.'; +$lang['copy_dest_container_does_not_exist'] = 'El contenedor destino (%s) no existe.'; +$lang['copy_source_dest_dn_same'] = 'El DN origen y destino son iguales.'; $lang['copy_copying'] = 'Copiando '; -$lang['copy_recursive_copy_progress'] = 'El progreso de la copia recurrente'; -$lang['copy_building_snapshot'] = 'Construyendo la \'foto\' del arbol para copiar... '; -$lang['copy_successful_like_to'] = 'Exito! Deseas '; -$lang['copy_view_new_entry'] = 'Ver el nuevo objeto?'; -$lang['copy_failed'] = 'Error al copiar DN: '; +$lang['copy_recursive_copy_progress'] = 'Progreso de la copia recursiva'; +$lang['copy_building_snapshot'] = 'Creando imagen del árbol a copiar... '; +$lang['copy_successful_like_to'] = '¡Copia correcta! ¿Le gustaría '; +$lang['copy_view_new_entry'] = 'ver el nuevo objeto'; +$lang['copy_failed'] = 'Error al copiar el DN: '; //edit.php -$lang['missing_template_file'] = 'Error: falta la plantilla, '; -$lang['using_default'] = 'Usando el archivo por defecto.'; +$lang['missing_template_file'] = 'Aviso: falta el fichero de plantilla, '; +$lang['using_default'] = 'usando la plantilla por defecto.'; +$lang['template'] = 'Plantilla'; +$lang['must_choose_template'] = 'Debes escoger una plantilla'; +$lang['invalid_template'] = '%s no es una plantilla válida'; +$lang['using_template'] = 'usando plantilla'; +$lang['go_to_dn'] = 'Ir a %s'; +$lang['structural_object_class_cannot_remove'] = 'Esta es una clase de objeto estructural y no se puede eliminar.'; +$lang['structural'] = 'estructural'; //copy_form.php $lang['copyf_title_copy'] = 'Copiar '; $lang['copyf_to_new_object'] = 'a un objeto nuevo'; -$lang['copyf_dest_dn'] = 'DN de destino'; -$lang['copyf_dest_dn_tooltip'] = 'El DN entero de la nueva entrada a ser creada quan se copie la entrada fuente'; -$lang['copyf_dest_server'] = 'Servidor de destino'; -$lang['copyf_note'] = 'Nota: Copiar entre dos servidores funciona solamente si no hay violaciones del esquema.'; -$lang['copyf_recursive_copy'] = 'Borrar todos los hijos recurentemente también?'; +$lang['copyf_dest_dn'] = 'DN destino'; +$lang['copyf_dest_dn_tooltip'] = 'El DN completo del objeto a crear'; +$lang['copyf_dest_server'] = 'Servidor destino'; +$lang['copyf_note'] = 'Nota: Sólo se puede copiar entre servidores diferentes cuando no hay violaciones de esquema'; +$lang['copyf_recursive_copy'] = 'También copiar recursivamente todos los hijos de este objeto.'; +$lang['recursive_copy'] = 'Copia recursiva'; +$lang['filter'] = 'Filtro'; +$lang['search_filter'] = 'Filtro de búsqueda'; +$lang['filter_tooltip'] = 'Cuando se realice una copia recursiva, copiar sólo los objetos que superen el filtrado'; //create.php -$lang['create_required_attribute'] = 'Te has dejado el valor en blanco del atributo requerido %s.'; -$lang['create_redirecting'] = 'Redirigiendo'; -$lang['create_here'] = 'aquí'; -$lang['create_could_not_add'] = 'No he podido agregar el objeto al servidor LDAP.'; +$lang['create_required_attribute'] = 'Ha dejado el valor del atributo requerido (%s) en blanco.'; +$lang['redirecting'] = 'Redirigiendo...'; +$lang['here'] = 'aquí'; +$lang['create_could_not_add'] = 'No se ha podido añadir el objeto al servidor LDAP.'; //create_form.php -$lang['createf_create_object'] = 'Crear Objeto'; -$lang['createf_choose_temp'] = 'Escoge una plantilla'; -$lang['createf_select_temp'] = 'Selecciona una plantilla para al proceso de creación'; -$lang['createf_proceed'] = 'Proceder'; +$lang['createf_create_object'] = 'Crear objeto'; +$lang['createf_choose_temp'] = 'Escoja una plantilla'; +$lang['createf_select_temp'] = 'Seleccione una plantilla para el proceso de creación'; +$lang['save_as_file'] = 'Guardar como fichero'; +$lang['rdn_field_blank'] = 'Ha dejado el campo RDN en blanco.'; +$lang['container_does_not_exist'] = 'El contenedor que ha especificado (%s) no existe. Por favor inténtelo de nuevo.'; +$lang['no_objectclasses_selected'] = 'No ha seleccionado ninguna clase para este objeto. Por favor, vuelva atrás y hágalo ahora.'; +$lang['hint_structural_oclass'] = 'Nota: Debe escoger al menos una clase de objeto estructural'; //creation_template.php -$lang['ctemplate_on_server'] = 'Al servidor'; -$lang['ctemplate_no_template'] = 'No se ha especificado ninguna plantilla en las variables del POST.'; -$lang['ctemplate_config_handler'] = 'Tu configuración especifica un manejador de'; -$lang['ctemplate_handler_does_not_exist'] = 'para esta plantilla. Pero este manejador no existe en el directorio \'templates/creation\'.'; +$lang['ctemplate_on_server'] = 'En el servidor'; +$lang['ctemplate_no_template'] = 'No se ha especificado ninguna plantilla en las variables POST.'; +$lang['template_not_readable'] = 'Su configuración especifica un fichero "%s" para esta plantilla pero dicho fichero no se puede leer debido a que sus permisos son demasiado restrictivos.'; +$lang['template_does_not_exist'] = 'Su configuración especifica un fichero "%s" para esta plantilla pero dicho fichero no existe en el directorio templates/creation.'; +$lang['create_step1'] = 'Paso 1 de 2: Nombre y clase(s) de objeto'; +$lang['create_step2'] = 'Paso 2 de 2: Especifique attributos y valores'; +$lang['relative_distinguished_name'] = 'Nombre Distinguido Relativo (RDN)'; +$lang['rdn'] = 'RDN'; +$lang['rdn_example'] = '(ejemplo: cn=nuevaPersona)'; +$lang['container'] = 'Contenedor'; // search.php -$lang['you_have_not_logged_into_server'] = 'Aún no te has autenticado en ell servidor seleccionado, no puedes hacer ninguna búsqueda.'; -$lang['click_to_go_to_login_form'] = 'Hac click aquí para ir al formulario de autenticación'; -$lang['unrecognized_criteria_option'] = 'Opcion de criterio desconocida: '; -$lang['if_you_want_to_add_criteria'] = 'Si quieres agregar tu propio criterio en la lista. Estate seguro de editar search.php para manejarlo. Saliendo.'; -$lang['entries_found'] = 'Entrades encontradas: '; -$lang['filter_performed'] = 'Filtro realitzado: '; -$lang['search_duration'] = 'Búsqueda realitzada para phpLDAPadmin a'; +$lang['you_have_not_logged_into_server'] = 'Todavía no ha conectado con el servidor, así que no puede realizar búsquedas.'; +$lang['click_to_go_to_login_form'] = 'Pulse aquí para ir al formulario de conexión'; +$lang['unrecognized_criteria_option'] = 'Criterio no reconocido: '; +$lang['if_you_want_to_add_criteria'] = 'Si quiere puede añadir su propios criterios a la lista. Asegúrese de editar search.php para manejarlos. Saliendo...'; +$lang['entries_found'] = 'Objetos encontrados: '; +$lang['filter_performed'] = 'Filtrado realizado: '; +$lang['search_duration'] = 'Búsqueda realizada por phpLDAPadmin en'; $lang['seconds'] = 'segundos'; // search_form_advanced.php -$lang['scope_in_which_to_search'] = 'El alcance en el que buscar'; -$lang['scope_sub'] = 'Sub (todo el sub-arbol)'; -$lang['scope_one'] = 'Uno (un nivel por debajo de la base)'; -$lang['scope_base'] = 'Base (solo base dn)'; -$lang['standard_ldap_search_filter'] = 'Filtro de búsqueda estándar de LDAP. Ejemplo: (&(sn=Smith)(givenname=David))'; +$lang['scope_in_which_to_search'] = 'Ámbito de búsqueda'; +$lang['scope_sub'] = 'Sub (subárbol completo)'; +$lang['scope_one'] = 'One (un nivel bajo la base)'; +$lang['scope_base'] = 'Base (sólo la base)'; +$lang['standard_ldap_search_filter'] = 'Filtro de búsqueda LDAP estándar. Ejemplo: (&(sn=Picapiedra)(givenname=Pedro))'; $lang['search_filter'] = 'Filtro de búsqueda'; -$lang['list_of_attrs_to_display_in_results'] = 'Una lista de atributos para mostrar los resultados (separados por comas)'; +$lang['list_of_attrs_to_display_in_results'] = 'Lista de atributos para mostrar en los resultados (separados por comas)'; $lang['show_attributes'] = 'Mostrar atributos'; // search_form_simple.php -$lang['search_for_entries_whose'] = 'Buscar entradas las cuales:'; -$lang['equals'] = 'sea igual'; -$lang['starts with'] = 'comience con'; +$lang['search_for_entries_whose'] = 'Buscar entradas en las que'; +$lang['equals'] = 'sea igual a'; +$lang['starts with'] = 'comience por'; $lang['contains'] = 'contenga'; -$lang['ends with'] = 'termine con'; +$lang['ends with'] = 'acabe en'; $lang['sounds like'] = 'suene como'; -$lang['predefined_search_str'] = 'o seleccione uno de esta lista'; // server_info.php -$lang['could_not_fetch_server_info'] = 'No se ha podido sacar información LDAP del servidor'; -$lang['server_info_for'] = 'Información del servidor para: '; -$lang['server_reports_following'] = 'El servidor muestra la siguiente información sobre el mismo'; -$lang['nothing_to_report'] = 'Este servidor no tiene nada a mostrar.'; +$lang['could_not_fetch_server_info'] = 'No se ha podido obtener ninguna información del servidor LDAP. Esto puede deberse a este error es su versión de PHP o quizás su servidor LDAP posee controles de acceso que privan a los clientes de acceso al RootDSE.'; +$lang['server_info_for'] = 'Información sobre el servidor: '; +$lang['server_reports_following'] = 'El servidor LDAP envía la siguiente información:'; +$lang['nothing_to_report'] = 'Este servidor no tiene nada sobre lo que informar.'; //update.php -$lang['update_array_malformed'] = 'el update_array está mal formado. Esto podría ser un error del phpLDAPadmin. Por favor reportalo.'; -$lang['could_not_perform_ldap_modify'] = 'No he podido ejecutar la operación ldap_modify.'; +$lang['update_array_malformed'] = 'El array update_array no está bien formado. Esto puede indicar un error de phpLDAPadmin. Por favor, informe de ello.'; +$lang['could_not_perform_ldap_modify'] = 'No se ha podido realizar la operación "ldap_modify".'; // update_confirm.php -$lang['do_you_want_to_make_these_changes'] = 'Quieres hacer estos cambios?'; +$lang['do_you_want_to_make_these_changes'] = '¿Quiere realizar estos cambios?'; $lang['attribute'] = 'Atributo'; -$lang['old_value'] = 'Valor viejo'; -$lang['new_value'] = 'Valor nuevo'; +$lang['old_value'] = 'Valor anterior'; +$lang['new_value'] = 'Nuevo valor'; $lang['attr_deleted'] = '[atributo borrado]'; $lang['commit'] = 'Cometer'; $lang['cancel'] = 'Cancelar'; -$lang['you_made_no_changes'] = 'No has hecho ningún cambio'; +$lang['you_made_no_changes'] = 'No ha realizado cambios'; $lang['go_back'] = 'Volver atrás'; // welcome.php -$lang['welcome_note'] = 'Usa el menú de la izquierda para navegar'; -$lang['credits'] = "Créditos"; -$lang['changelog'] = "Histórico de cambios"; -$lang['documentation'] = "Documentación"; +$lang['welcome_note'] = 'Use el menú de la izquierda para navegar'; +$lang['credits'] = 'Creditos'; +$lang['changelog'] = 'Lista de cambios'; +$lang['donate'] = 'Donar'; +$lang['pla_logo'] = 'logotipo de phpLDAPadmin'; +// Donate.php +$lang['donation_instructions'] = 'Para donar fondos al proyecto phpLDAPadmin, use uno de los botones de abajo.'; +$lang['donate_amount'] = 'Donar %s'; + +$lang['purge_cache'] = 'Borrar cachés'; +$lang['no_cache_to_purge'] = 'No hay que borrar ningún caché.'; +$lang['done_purging_caches'] = 'Se han borrado %s bytes de caché.'; +$lang['purge_cache_tooltip'] = 'Se han borrado todos los datos en el caché de phpLDAPadmin, incluyendo los esquemas del servidor.'; // view_jpeg_photo.php -$lang['unsafe_file_name'] = 'Nombre de archivo inseguro: '; -$lang['no_such_file'] = 'Archivo inexistente: '; +$lang['unsafe_file_name'] = 'Nombre de fichero no seguro: '; +$lang['no_such_file'] = 'No hay tal fichero: '; //function.php -$lang['auto_update_not_setup'] = 'Has activado los auto_uid_numbers para %s en tu configuración, - pero no has especificado el auto_uid_number_mechanism. Por favor soluciona - este problema.'; -$lang['uidpool_not_set'] = 'Has especificado el auto_uid_number_mechanism como uidpool - en tu configuración para el servidor %s, pero no has especificado el - audo_uid_number_uid_pool_dn. Por favor especificalo antes de proceder.'; -$lang['uidpool_not_exist'] = 'Parece ser que el uidPool que has especificado en tu configuración (%s) +$lang['auto_update_not_setup'] = 'Ha activado "auto_uid_numbers" para %s en su configuración, + pero no ha especificado el mecanismo "auto_uid_number_mechanism". Por favor, corrija este problema'; +$lang['uidpool_not_set'] = 'Ha especificado el mecanismo "auto_uid_number_mechanism" como "uidpool" + en su configuración para el servidor %s, pero no ha especificado + "audo_uid_number_uid_pool_dn". Por favor, verifiquelo antes de continuar.'; +$lang['uidpool_not_exist'] = 'Parece ser que el "uidPool" que ha especificado en su configuración ("%s") no existe.'; -$lang['specified_uidpool'] = 'Has especificado el auto_uid_number_mechanism como search en tu - configuración para el servidor %s, pero no has especificado el - auto_uid_number_search_base. Por favor especificalo antes de proceder.'; -$lang['auto_uid_invalid_value'] = 'Has especificado un valor no válido para el auto_uid_number_mechanism (%s) - en tu configuración. Solo uidpool y search son válidos. - Por favor soluciona este problema.'; -$lang['error_auth_type_config'] = 'Error: Tienes un error en tu archivo de configuración. Los dos únicos valores aceptados para - \'auth_type\' en la sección $servers son \'config\' y \'form\'. Tu has puesto \'%s\', - el cual no está aceptado. '; -$lang['php_install_not_supports_tls'] = 'Tu instalación de PHP no soporta TLS'; -$lang['could_not_start_tls'] = 'No he podido iniciar el TLS.
      Revisa tu configuración del servidor LDAP.'; -$lang['auth_type_not_valid'] = 'Tienes un error en el archivo de configuración. auth_type de %s no es válido.'; -$lang['ldap_said'] = 'LDAP dijo: %s

      '; +$lang['specified_uidpool'] = 'Ha especificado "auto_uid_number_mechanism" como "search" en la + configuración del servidor %s, pero no ha especificado + "auto_uid_number_search_base". Por favor, especifíquelo antes de continuar.'; +$lang['auto_uid_invalid_credential'] = 'Imposible conectar con %s con sus credenciales "auto_uid". Por favor, verifique su fichero de configuración.'; +$lang['bad_auto_uid_search_base'] = 'Su configuración de phpLDAPadmin especifica "auto_uid_search_base" como no válida para el servidor %s'; +$lang['auto_uid_invalid_value'] = 'Ha especificado un valor no válido para el mecanismo "auto_uid_number_mechanism" ("%s") + en su configuración. Sólo son válidos "uidpool" y "search". Por favor, corrija este problema.'; +$lang['error_auth_type_config'] = 'Error: Tiene un error en su fichero de configurción. Los tres únicos valores para "auth_type" + en la sección $servers son \'session\', \'cookie\', y \'config\'. Usted ha introducido \'%s\', + que no está permitido. '; +$lang['unique_attrs_invalid_credential'] = 'Imposible conectarse a %s con sus credenciales unique_attr. Por favor, revise su fichero de configuración.'; +$lang['unique_attr_failed'] = 'Su intento de añadir %s (%s) a
      %s
      NO se ha permitido. Tal atributo/valor pertenece a otro objeto.

      Probablemente desee buscar tal objeto.'; +$lang['php_install_not_supports_tls'] = 'Su instalación de PHP no soporta TLS.'; +$lang['could_not_start_tls'] = 'No se ha podido iniciar TLS. Por favor, revise su configuración LDAP.'; +$lang['could_not_bind_anon'] = 'No se ha podido conectar con el servidor de forma anónima.'; +$lang['could_not_bind'] = 'No se ha podido conectar con el servidor LDAP.'; +$lang['anonymous_bind'] = 'Conexión anónima'; +$lang['bad_user_name_or_password'] = 'Nombre de usuario o contraseña incorrectos. Por favor, inténtelo de nuevo.'; +$lang['redirecting_click_if_nothing_happens'] = 'Redirigiendo... Pulse aquí si no sucede nada.'; +$lang['successfully_logged_in_to_server'] = 'Ha conectado con el servidor %s.'; +$lang['could_not_set_cookie'] = 'No se ha podido guardar la cookie.'; +$lang['ldap_said'] = 'LDAP ha dicho: %s'; $lang['ferror_error'] = 'Error'; -$lang['fbrowse'] = 'mostrar'; +$lang['fbrowse'] = 'seleccionar'; $lang['delete_photo'] = 'Borrar foto'; -$lang['install_not_support_blowfish'] = 'Tu instalación de PHP no soporta los tipos de encriptación blowfish.'; -$lang['install_no_mash'] = 'Tu instalación de PHP no tiene la funcion mhash(). No puedo hacer hash SHA.'; -$lang['jpeg_contains_errors'] = 'jpegPhoto contiene errores
      '; -$lang['ferror_number'] = 'Error número: %s (%s)

      '; -$lang['ferror_discription'] = 'Descripción: %s

      '; -$lang['ferror_number_short'] = 'Error número: %s

      '; -$lang['ferror_discription_short'] = 'Descripción: (no hay descripción)
      '; -$lang['ferror_submit_bug'] = 'Es un error del phpLDAPadmin? Si así es, por favor dínoslo.'; -$lang['ferror_unrecognized_num'] = 'Número de error desconocido: '; +$lang['install_not_support_blowfish'] = 'Su instalación de PHP no soporta encriptación blowfish.'; +$lang['install_not_support_md5crypt'] = 'Su instalación de PHP no soporta encriptación md5crypt.'; +$lang['install_no_mash'] = 'Su instalación de PHP no posee la función mhash(). No se pueden realizar hashes SHA.'; +$lang['jpeg_contains_errors'] = 'La foto jpegPhoto contiene errores
      '; +$lang['ferror_number'] = 'Error número: %s (%s)'; +$lang['ferror_discription'] = 'Descripción: %s

      '; +$lang['ferror_number_short'] = 'Error número: %s

      '; +$lang['ferror_discription_short'] = 'Descripción: (no existe descripción disponible)
      '; +$lang['ferror_submit_bug'] = '¿Es éste un error de phpLDAPadmin? Si es así, por favor informe sobre ello.'; +$lang['ferror_unrecognized_num'] = 'Número de error no reconocido: '; $lang['ferror_nonfatil_bug'] = '

      Error:%s
      + ¡Ha encontrado un error no fatal en phpLDAPadmin!
      - Has encontrado un error menor del phpLDAPadmin!
      Error:%s (%s)
      Archivo:
      Error:%s (%s)
      Fichero: %s línea %s, caller %s
      Versiones:PLA: %s, PHP: %s, SAPI: %s -
      Servidor Web:%s
      - Envía este error haciendo click aquí.

      '; -$lang['ferror_congrats_found_bug'] = 'Felicidades! Has encontrado un error en el phpLDAPadmin.

      + Servidor web:%s
      + Por favor, informe de este error pulsando aquí.

      '; +$lang['ferror_congrats_found_bug'] = '¡Felicidades! Ha encontrado un error en phpLDAPadmin.

      - + - - + + - +
      Error:%s
      Nivel:%s
      Archivo:%s
      Fichero:%s
      Línea:%s
      Caller:%s
      Versión PLA:%s
      Caller:%s
      Verisón PLA:%s
      Versión PHP:%s
      PHP SAPI:%s
      Servidor Web:%s
      Servidor web:%s

      - Por favor envía este error haciendo click abajo!'; + Por favor, informe sobre este error haciendo click más abajo!'; + //ldif_import_form -$lang['import_ldif_file_title'] = 'Importar archivo LDIF'; -$lang['select_ldif_file'] = 'Selecciona un archivo LDIF:'; -$lang['select_ldif_file_proceed'] = 'Proceder >>'; +$lang['import_ldif_file_title'] = 'Importar fichero LDIF'; +$lang['select_ldif_file'] = 'Seleccione un fichero LDIF:'; +$lang['dont_stop_on_errors'] = 'Ignorar errores'; //ldif_import $lang['add_action'] = 'Añadiendo...'; $lang['delete_action'] = 'Borrando...'; $lang['rename_action'] = 'Renombrando...'; $lang['modify_action'] = 'Modificando...'; +$lang['warning_no_ldif_version_found'] = 'No se ha encontrado versión. Asumiendo 1.'; +$lang['valid_dn_line_required'] = 'Se requiere una línea válida.'; +$lang['missing_uploaded_file'] = 'Falta el fichero enviado.'; +$lang['no_ldif_file_specified.'] = 'No se ha especificado un fichero LDIF. Por favor, inténtelo de nuevo.'; +$lang['ldif_file_empty'] = 'El fichero LDIF enviado está vacío.'; +$lang['empty'] = 'vacío'; +$lang['file'] = 'Fichero'; +$lang['number_bytes'] = '%s bytes'; -$lang['failed'] = 'fallado'; -$lang['ldif_parse_error'] = 'Error de parseado LDIF'; -$lang['ldif_could_not_add_object'] = 'No he podido añadir el objeto:'; -$lang['ldif_could_not_rename_object'] = 'No he podido renombrar el objeto:'; -$lang['ldif_could_not_delete_object'] = 'No he podido borrar el objeto:'; -$lang['ldif_could_not_modify_object'] = 'No he podido modificar el objeto:'; -$lang['ldif_line_number'] = 'Linea Número:'; -$lang['ldif_line'] = 'Linea:'; +$lang['failed'] = 'Error'; +$lang['ldif_parse_error'] = 'Error al parsear LDIF'; +$lang['ldif_could_not_add_object'] = 'No se ha podido añadir objeto:'; +$lang['ldif_could_not_rename_object'] = 'No se ha podido renombrar el objeto:'; +$lang['ldif_could_not_delete_object'] = 'No se ha podido borrar el objeto:'; +$lang['ldif_could_not_modify_object'] = 'No se ha podido modificar el objeto:'; +$lang['ldif_line_number'] = 'Número de línea:'; +$lang['ldif_line'] = 'Línea:'; + +// Exports +$lang['export_format'] = 'Formato de exportación'; +$lang['line_ends'] = 'Fin de línea'; +$lang['must_choose_export_format'] = 'Debe escoger un formato de exportación.'; +$lang['invalid_export_format'] = 'Formato de exportación no válido'; +$lang['no_exporter_found'] = 'No se ha encontrado ningún exportador válido.'; +$lang['error_performing_search'] = 'Se ha encontrado un error al realizar la búsqueda.'; +$lang['showing_results_x_through_y'] = 'Mostrando los resultados de %s a %s.'; +$lang['searching'] = 'Buscando...'; +$lang['size_limit_exceeded'] = 'Nota: se ha excedido el tiempo de búsqueda.'; +$lang['entry'] = 'Objeto'; +$lang['ldif_export_for_dn'] = 'Exportación LDIF de: %s'; +$lang['generated_on_date'] = 'Generado por phpLDAPadmin el %s'; +$lang['total_entries'] = 'Entradas totales'; +$lang['dsml_export_for_dn'] = 'Exportación DSLM de: %s'; +$lang['include_system_attrs'] = 'Incluir atributos de sistema'; +$lang['csv_spreadsheet'] = 'CSV (Hoja de cálculo)'; + +// logins +$lang['could_not_find_user'] = 'No se ha podido encontrar el usuario "%s"'; +$lang['password_blank'] = 'Ha dejado la contraseña en blanco.'; +$lang['login_cancelled'] = 'Conexión cancelada.'; +$lang['no_one_logged_in'] = 'No hay nadie conectado con el servidor.'; +$lang['could_not_logout'] = 'No se ha podido desconectar.'; +$lang['unknown_auth_type'] = 'Tipo de autentificación "auth_type" desconocido: %s'; +$lang['logged_out_successfully'] = 'Se ha desconectado del servidor %s'; +$lang['authenticate_to_server'] = 'Autentificación del servidor %s'; +$lang['warning_this_web_connection_is_unencrypted'] = 'Aviso: Esta conexión no está encriptada.'; +$lang['not_using_https'] = 'No está usando \'https\'. El navegador web enviará su información sin encriptar.'; +$lang['login_dn'] = 'Login'; +$lang['user_name'] = 'Nombre de usuario'; +$lang['password'] = 'Contraseña'; +$lang['authenticate'] = 'Entrar'; + +// Entry browser +$lang['entry_chooser_title'] = 'Selector de objetos'; + +// Index page +$lang['need_to_configure'] = 'Debe configurar phpLDAPadmin, editando el fichero \'config.php\'. Se proporciona un fichero de configuración de ejemplo en \'config.php.example\''; + +// Mass deletes +$lang['no_deletes_in_read_only'] = 'No se permiten borrados en modo de sólo lectura.'; +$lang['error_calling_mass_delete'] = 'Error al llamar a "mass_delete.php". Falta la variable POST "mass_delete".'; +$lang['mass_delete_not_array'] = 'La variable POST "mass_delete" no es un array.'; +$lang['mass_delete_not_enabled'] = 'No está activado el borrado masivo. Por favor, actívelo en config.php antes de continuar.'; +$lang['search_attrs_wrong_count'] = 'Su config.php tiene un error. El número de atributos en $search_attributes y $search_attributes_display es diferente'; +$lang['mass_deleting'] = 'Efectuando borrado masivo'; +$lang['mass_delete_progress'] = 'Borrado en progreso en el servidor "%s"'; +$lang['malformed_mass_delete_array'] = 'Array de borrado masivo mal formado.'; +$lang['no_entries_to_delete'] = 'No ha seleccionado objetos para borrar.'; +$lang['deleting_dn'] = 'Borrando %s'; +$lang['total_entries_failed'] = 'No han podido borrarse %s de %s objetos.'; +$lang['all_entries_successful'] = 'Todos los objetos han sido borrados.'; +$lang['confirm_mass_delete'] = 'Confirmar borrado masivo de %s objetos en el servidor %s'; +$lang['yes_delete'] = '¡Sí, borrar!'; + +// Renaming entries +$lang['non_leaf_nodes_cannot_be_renamed'] = 'No puede renombrar un objeto que tenga hijos'; +$lang['no_rdn_change'] = 'No ha cambiado el RDN'; +$lang['invalid_rdn'] = 'Valor RDN no válido'; +$lang['could_not_rename'] = 'No se ha podido renombrar el objeto'; + +// General errors +$lang['php5_unsupported'] = 'phpLDAPadmin no soporta todavía PHP 5. Si continúa encontrará probablemente extraños errores.'; +$lang['mismatched_search_attr_config'] = 'Su configuración tiene un error. $search_attributes debe tener el mismo número de atributos que $search_attributes_display.'; + +// Password checker +$lang['passwords_match'] = '¡Las contraseñas coinciden!'; +$lang['passwords_do_not_match'] = '¡Las contraseñas no coinciden!'; +$lang['password_checker_tool'] = 'Herramienta de comprobación de contraseñas'; +$lang['compare'] = 'Comparar'; +$lang['to'] = 'con'; + +// Templates +$lang['using'] = 'Usando la'; +$lang['template'] = 'plantilla'; +$lang['switch_to'] = 'Puede cambair a la '; +$lang['default_template'] = 'plantilla por defecto'; + +// template_config +$lang['user_account'] = 'Cuenta de Usuario (posixAccount)'; +$lang['address_book_inet'] = 'Entrada del libro de direcciones (inetOrgPerson)'; +$lang['address_book_moz'] = 'Entrada del libro de direcciones (mozillaOrgPerson)'; +$lang['kolab_user'] = 'Entrada de Usuario Kolab'; +$lang['organizational_unit'] = 'Unidad Organizativa'; +$lang['organizational_role'] = 'Rol Organizativo'; +$lang['posix_group'] = 'Grupo Posix'; +$lang['samba_machine'] = 'Ordenador con Samba NT'; +$lang['samba3_machine'] = 'Ordenador con Samba 3 NT'; +$lang['samba_user'] = 'Usuario de Samba'; +$lang['samba3_user'] = 'Usuario de Samba 3'; +$lang['samba3_group'] = 'Mapeo de Grupo de Samba 3'; +$lang['dns_entry'] = 'Entrada DNS'; +$lang['simple_sec_object'] = 'Objeto de Seguridad Simple'; +$lang['courier_mail_account'] = 'Cuenta de Correo Courier'; +$lang['courier_mail_alias'] = 'Alias de Correo Courier'; +$lang['ldap_alias'] = 'Alias de LDAP'; +$lang['sendmail_cluster'] = 'Cluster de Sendmail'; +$lang['sendmail_domain'] = 'Dominio de Sendmail'; +$lang['sendmail_alias'] = 'Alias de Sendmail'; +$lang['sendmail_virt_dom'] = 'Dominio Virtual de Sendmail'; +$lang['sendmail_virt_users'] = 'Usuarios Virtuales de Sendmail'; +$lang['sendmail_relays'] = 'Relés de Sendmail'; +$lang['custom'] = 'A medida'; +$lang['samba_domain_name'] = 'Mi Nombre de Dominio de Samba'; +$lang['administrators'] = 'Administradores'; +$lang['users'] = 'Usuarios'; +$lang['guests'] = 'Invitados'; +$lang['power_users'] = 'Usuarios Privilegiados'; +$lang['account_ops'] = 'Administradores de Cuentas'; +$lang['server_ops'] = 'Administradores de Servidor'; +$lang['print_ops'] = 'Administradores de Impresión'; +$lang['backup_ops'] = 'Administradores de Copias de Seguridad'; +$lang['replicator'] = 'Replicador'; +$lang['unable_smb_passwords'] = ' Imposible crear las contraseñas de Samba. Por favor, revise la configuración en template_config.php'; +$lang['err_smb_conf'] = 'Error: Tiene un error en su configuración de Samba.'; +$lang['err_smb_no_name_sid'] = 'Error: Necesita indicar el nombre y el sid de su dominio Samba.'; +$lang['err_smb_no_name'] = 'Error: No se ha indicado el nombre del dominio Samba.'; +$lang['err_smb_no_sid'] = 'Error: No se ha indicado el sid del dominio Samba.'; + +// Samba Account Template +$lang['samba_account'] = 'Cuenta Samba'; +$lang['samba_account_lcase'] = 'cuenta samba'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'Nueva cuenta de usuario'; +$lang['t_hint_customize'] = 'Nota: Para modificar esta plantilla, edite el fichero templates/creation/new_user_template.php'; +$lang['t_name'] = 'Nombre'; +$lang['t_first_name'] = 'Nombre propio'; +$lang['t_last_name'] = 'Apellido'; +$lang['t_first'] = 'nombre propio'; +$lang['t_last'] = 'apellido'; +$lang['t_common_name'] = 'Nombre común'; +$lang['t_user_name'] = 'Nombre de Usuario'; +$lang['t_password'] = 'Contraseña'; +$lang['t_encryption'] = 'Encriptación'; +$lang['t_login_shell'] = 'Shell de entrada'; +$lang['t_home_dir'] = 'Directorio de usuario'; +$lang['t_uid_number'] = 'Número UID'; +$lang['t_auto_det'] = '(determinado automáticamente)'; +$lang['t_group'] = 'Grupo'; +$lang['t_gid_number'] = 'Número GID'; +$lang['t_err_passwords'] = 'Sus contraseñas no coinciden. Por favor, vuelva atrás e inténtelo de nuevon.'; +$lang['t_err_field_blank'] = 'No puede dejar en blanco el %s. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_err_field_num'] = 'Sólo puede introducir valores numéricos en el campo %s. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_err_bad_container'] = 'El contenedor que ha especificado (%s) no existe. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_confirm_account_creation'] = 'Confirmar creación de cuenta'; +$lang['t_secret'] = '[secreta]'; +$lang['t_create_account'] = 'Crear cuenta'; + +// New Address Template +$lang['t_new_address'] = 'Nueva entrada en el libro de direcciones'; +$lang['t_organization'] = 'Organización'; +$lang['t_address'] = 'Dirección'; +$lang['t_city'] = 'Ciudad'; +$lang['t_postal_code'] = 'Código postal'; +$lang['t_street'] = 'Calle'; +$lang['t_work_phone'] = 'Teléfono de trabajo'; +$lang['t_fax'] = 'Fax'; +$lang['t_mobile'] = 'Móvil'; +$lang['t_email'] = 'Email'; +$lang['t_container'] = 'Contenedor'; +$lang['t_err_cn_blank'] = 'No puede dejar el campo "Nombre Común" en blanco. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_confim_creation'] = 'Confirmar creación de entrada:'; +$lang['t_create_address'] = 'Crear dirección'; + +// default template +$lang['t_check_pass'] = 'Compruebe la contraseña...'; ?> + diff --git a/lang/fr.php b/lang/fr.php index 24bb5f4..4fe56a0 100644 --- a/lang/fr.php +++ b/lang/fr.php @@ -11,7 +11,7 @@ * * Thank you! * - * $Header: /cvsroot/phpldapadmin/phpldapadmin/lang/fr.php,v 1.25 2004/05/29 04:07:02 uugdave Exp $ + * $Header: /cvsroot/phpldapadmin/phpldapadmin/lang/fr.php,v 1.29 2005/04/01 22:40:23 xrenard Exp $ */ /* @@ -34,6 +34,14 @@ $lang['contains'] = 'contient'; $lang['predefined_search_str'] = 'Selectionner une recherche prédéfinie'; $lang['predefined_searches'] = 'Recherches prédéfinies'; $lang['no_predefined_queries'] = 'Aucune requête n\' a été définie dans config.php.'; +$lang['export_results'] = 'exporter le resultat'; +$lang['unrecoginzed_search_result_format'] = 'Le format du résultat de la recherche est non reconnu: %s'; +$lang['format'] = 'Format'; +$lang['list'] = 'liste'; +$lang['table'] = 'table'; +$lang['bad_search_display'] = 'Le fichier config.php contient une valeur invalide pour $default_search_display: %s. Veuillez le corriger'; +$lang['page_n'] = 'Page %d'; +$lang['no_results'] = 'Aucun résultat pour cette recherche.'; // Tree browser $lang['request_new_feature'] = 'Demander une nouvelle fonctionnalité'; @@ -54,20 +62,25 @@ $lang['view_server_info'] = 'Voir les informations sur le serveur'; $lang['import_from_ldif'] = 'Importer des entrées à partir d\'un fichier LDIF'; $lang['logout_of_this_server'] = 'Se déconnecter de ce serveur'; $lang['logged_in_as'] = 'Connecté en tant que: '; +$lang['this_base_dn_is_not_valid'] = 'Ceci n\'est pas un DN valide.'; +$lang['this_base_dn_does_not_exist'] = 'Cette entrée n\'existe pas.'; $lang['read_only'] = 'Lecture seule'; +$lang['read_only_tooltip'] = 'Cet attribut a été mis en lecture seule par l\'administrateur de phpLDAPAdmin'; $lang['could_not_determine_root'] = 'La racine de l\'arborescence Ldap n\'a pu être déterminée.'; $lang['ldap_refuses_to_give_root'] = 'Il semble que le serveur LDAP a été configuré de telle sorte que la racine ne soit pas révelée.'; $lang['please_specify_in_config'] = 'Veuillez le spécifier dans le fichier config.php'; $lang['create_new_entry_in'] = 'Créer une nouvelle entrée dans'; $lang['login_link'] = 'Login...'; $lang['login'] = 'login'; - +$lang['base_entry_does_not_exist'] = 'L\'entrée racine n\'existe pas.'; +$lang['create_it'] = 'La créer?'; // Entry display $lang['delete_this_entry'] = 'Supprimer cette entrée'; $lang['delete_this_entry_tooltip'] = 'Il vous sera demandé confirmation'; $lang['copy_this_entry'] = 'Copier cette entrée'; $lang['copy_this_entry_tooltip'] = 'Copier cet objet vers un autre endroit, un nouveau DN ou un autre serveur'; $lang['export'] = 'Exporter'; +$lang['export_lcase'] = 'exporter'; $lang['export_tooltip'] = 'Sauvegarder cet objet'; $lang['export_subtree_tooltip'] = 'Sauvegarder cet objet ainsi que tous les sous-objets'; $lang['export_subtree'] = 'Exporter l\'arborescence'; @@ -84,7 +97,9 @@ $lang['hide_internal_attrs'] = 'Cacher les attributs internes'; $lang['show_internal_attrs'] = 'Montrer les attributs internes'; $lang['attr_name_tooltip'] = 'Cliquer pour voir la définition de schéma pour l\'attribut de type \'%s\''; $lang['none'] = 'aucun'; -$lang['save_changes'] = 'Sauver les modifications'; +$lang['no_internal_attributes'] = 'Aucun attributs internes.'; +$lang['no_attributes'] = 'Cette entrée n\a aucun attributs.'; +$lang['save_changes'] = 'Sauvegarder les modifications'; $lang['add_value'] = 'ajouter une valeur'; $lang['add_value_tooltip'] = 'Ajouter une valeur supplémentaire à cet attribut'; $lang['refresh_entry'] = 'Rafraichir'; @@ -99,6 +114,8 @@ $lang['no_new_binary_attrs_available'] = 'plus d\' attributs binaires disponible $lang['binary_value'] = 'Valeur de type binaire'; $lang['add_new_binary_attr'] = 'Ajouter un nouvel attribut de type binaire'; $lang['alias_for'] = 'Alias pour'; +$lang['required_for'] = 'Attribut requis par le(s) objectClass(es) %s'; +$lang['required_by_entry'] = 'Cet attribut est requis par le RDN.'; $lang['download_value'] = 'Télécharger le contenu'; $lang['delete_attribute'] = 'Supprimer l\'attribut'; $lang['true'] = 'vrai'; @@ -108,18 +125,17 @@ $lang['really_delete_attribute'] = 'Voulez-vous vraiment supprimer l\'attribut'; $lang['add_new_value'] = 'Ajouter une nouvelle valeur'; // Schema browser -$lang['the_following_objectclasses'] = 'Les classes d\'objets (objectClasses) suivantes sont supportés par ce serveur LDAP.'; -$lang['the_following_attributes'] = 'Les types d\'attributs (attributesTypes) suivants sont supportés par ce serveur LDAP.'; -$lang['the_following_matching'] = 'Les opérateurs (matching rules) suivants sont supportés par ce serveur LDAP.'; -$lang['the_following_syntaxes'] = 'Les syntaxes suivantes sont supportés par ce serveur LDAP.'; $lang['schema_retrieve_error_1']='Le serveur ne supporte pas entièrement le protocol LDAP.'; -$lang['schema_retrieve_error_2']='Votre version de PHP ne permet pas d\'exécute correctement la requête.'; -$lang['schema_retrieve_error_3']='Ou tout du moins, phpLDAPadmin ne sait pas comment récupérer le schéma pour votre serveur.'; +$lang['schema_retrieve_error_2']='Votre version de PHP ne permet pas d\'exécuter correctement la requête.'; +$lang['schema_retrieve_error_3']='phpLDAPadmin ne sait pas comment récupérer le schéma pour votre serveur.'; +$lang['schema_retrieve_error_4']='Ou tout du moins, votre serveur LDAP ne procure pas cette information.'; $lang['jump_to_objectclass'] = 'Aller à une classe d\'objet'; +$lang['view_schema_for_oclass'] = 'Voir la description du schema pour cette objectClass'; $lang['jump_to_attr'] = 'Aller à un attribut'; $lang['jump_to_matching_rule'] = 'Aller à une règle d\'égalité'; $lang['schema_for_server'] = 'Schema pour le serveur'; $lang['required_attrs'] = 'Attributs obligatoires'; +$lang['required'] = 'requis'; $lang['optional_attrs'] = 'Attributs optionnels'; $lang['optional_binary_attrs'] = 'Attributs binaires optionnels'; $lang['OID'] = 'OID'; @@ -131,6 +147,7 @@ $lang['equality']='Egalit $lang['is_obsolete'] = 'Cette classe d\'objet est obsolete'; $lang['inherits'] = 'hérite'; $lang['inherited_from']='hérite de'; +$lang['parent_to'] = 'Parent de'; $lang['jump_to_this_oclass'] = 'Aller à la définition de cette classe d\'objet'; $lang['matching_rule_oid'] = 'OID de l\'opérateur'; $lang['syntax_oid'] = 'OID de la syntaxe'; @@ -140,8 +157,7 @@ $lang['character']='caract $lang['characters']='caractères'; $lang['used_by_objectclasses']='Utilisé par les objectClasses'; $lang['used_by_attributes']='Utilisé par les attributes'; -$lang['maximum_length']='Maximum Length'; -$lang['attributes']='Types d\'attribut'; +$lang['attribute_types']='Types d\'attribut'; $lang['syntaxes']='Syntaxes'; $lang['objectclasses']='objectClasses'; $lang['matchingrules']='Règles d\'égalité'; @@ -155,7 +171,12 @@ $lang['user_modification']='Modification Utilisateur'; $lang['usage']='Usage'; $lang['maximum_length']='Longueur maximale'; $lang['could_not_retrieve_schema_from']='Impossible de récupérer le schéma de'; +$lang['the_following_objectclasses'] = 'Les classes d\'objets (objectClasses) suivantes sont supportés par ce serveur LDAP.'; +$lang['the_following_attributes'] = 'Les types d\'attributs (attributesTypes) suivants sont supportés par ce serveur LDAP.'; +$lang['the_following_matching'] = 'Les opérateurs (matching rules) suivants sont supportés par ce serveur LDAP.'; +$lang['the_following_syntaxes'] = 'Les syntaxes suivantes sont supportés par ce serveur LDAP.'; $lang['type']='Type'; +$lang['no_such_schema_item'] = 'No such schema item: "%s"'; // Deleting entries $lang['entry_deleted_successfully'] = 'Suppression de l\'entrée \'%s\' réussie.'; @@ -182,8 +203,14 @@ $lang['no_attr_specified'] = 'Aucun nom d\'attributs sp $lang['no_dn_specified'] = 'Aucun DN specifié'; // Adding attributes -$lang['left_attr_blank'] = 'Vous avez laisser la valeur de l\'attribut vide. Veuillez s\'il vous plaît retourner à la page précédente et recommencer.'; +$lang['left_attr_blank'] = 'Vous avez laissé la valeur de l\'attribut vide. Veuillez s\'il vous plaît retourner à la page précédente et recommencer.'; $lang['failed_to_add_attr'] = 'Echec lors de l\'ajout de l\'attribut.'; +$lang['file_empty'] = 'Le fichier choisi soit est vide soit n\'existe pas. Veuillez recommencez.'; +$lang['invalid_file'] = 'Erreur de sécurité: Le fichier uploadé peut etre dangereux.'; +$lang['warning_file_uploads_disabled'] = 'Votre configuration PHP interdit l\'upload de fichiers. Veuillez vérifier votre fichier php.ini avant de continuer.'; +$lang['uploaded_file_too_big'] = 'Le fichier à uploader est de trop grande taille. Veuillez vérifier votre fichier php.ini et particulièrement la directive upload_max_size setting'; +$lang['uploaded_file_partial'] = 'Le fichier sélectionner a été partiellement uploadé, probablement du à une erreur réseau.'; +$lang['max_file_size'] = 'Taille Maximum du fichier: %s'; // Updating values $lang['modification_successful'] = 'Modification réussie!'; @@ -201,10 +228,12 @@ $lang['add_oclass_and_attrs'] = 'Ajout d\' ObjectClass et d\'attributs'; $lang['chooser_link_tooltip'] = 'Cliquer pour choisir un entré(DN)'; $lang['no_updates_in_read_only_mode'] = 'Vous ne pouvez effectuer des mises à jour si le serveur est en lecture seule'; $lang['bad_server_id'] = 'Id de serveur invalide'; -$lang['not_enough_login_info'] = 'Informations insuffisantes pour se logguer au serveur. Veuillez, s\'il vous plaî, vérifier votre configuration.'; +$lang['not_enough_login_info'] = 'Informations insuffisantes pour se logguer au serveur. Veuillez, s\'il vous plaît, vérifier votre configuration.'; $lang['could_not_connect'] = 'Impossible de se connecter au serveur LDAP.'; $lang['could_not_connect_to_host_on_port'] = 'Impossible de se connecter à "%s" sur le port "%s"'; $lang['could_not_perform_ldap_mod_add'] = 'Echec lors de l\'opération ldap_mod_add.'; +$lang['home'] = 'Home'; +$lang['help'] = 'Aide'; $lang['bad_server_id_underline'] = 'serveur_id invalide: '; $lang['success'] = 'Succès'; $lang['server_colon_pare'] = 'Serveur: '; @@ -230,6 +259,11 @@ $lang['bug'] = 'bogue'; $lang['warning'] = 'Avertissement'; $lang['light'] = 'lumière'; // the word 'light' from 'light bulb' $lang['proceed_gt'] = 'Continuer >>'; +$lang['no_blowfish_secret'] = 'phpLDAPadmin ne peut de façon sur encrypter et décrypter les informations du fait que $blowfish_secret n\'est pas défini dans config.php. Vous devez définir $blowfish_secret avec une chaine de caractère de votre choix.'; +$lang['jpeg_dir_not_writable'] = 'Veuillez assigner à la variable $jpeg_temp_dir le nom d\'un répertoire accessible en écriture dans le fichier config.php'; +$lang['jpeg_dir_not_writable_error'] = 'Impossible d\'écrire dans le répertoire %s défini par la directive $jpeg_temp_dir. Veuillez vérifier que votre serveur web à les droits en écriture pour ce répertoire.'; +$lang['jpeg_unable_toget'] = 'Impossible de trouver la ressource jpeg du serveur LDAP pour l\'attribut %s.'; +$lang['jpeg_delete'] = 'Supprimer la photo'; // Add value form @@ -265,6 +299,8 @@ $lang['must_choose_template'] = 'Vous devez choisir un mod $lang['invalid_template'] = '%s est un modèle non valide'; $lang['using_template'] = 'Utilisation du modèle'; $lang['go_to_dn'] = 'Aller à %s'; +$lang['structural_object_class_cannot_remove'] = 'Ceci est une \'objectclass\' de type structurelle et ne peut etre supprimé.'; +$lang['structural'] = 'structurelle'; @@ -280,13 +316,16 @@ $lang['copyf_recursive_copy'] = 'Copier r $lang['recursive_copy'] = 'Copie récursive'; $lang['filter'] = 'Filtre'; $lang['filter_tooltip'] = 'Lors d\'une copie récursive, seuls les entrées correspondant à ce filtre seront copiés'; +$lang['delete_after_copy'] = 'Suppresion après copie (déplacer):'; +$lang['delete_after_copy_warn'] = 'Soyez certain que votre filtre (ci-dessus) selectionnera tous les enregistrements enfants.'; + //create.php $lang['create_required_attribute'] = 'Une valeur n\'a pas été spécifiée pour l\'attribut requis %s.'; $lang['redirecting'] = 'Redirection'; $lang['here'] = 'ici'; $lang['create_could_not_add'] = 'L\'ajout de l\'objet au serveur LDAP n\'a pu être effectuée.'; -$lang['rdn_field_blank'] = 'Vous avez laisser le champ du RDN vide.'; +$lang['rdn_field_blank'] = 'Vous avez laissé le champ du RDN vide.'; $lang['container_does_not_exist'] = 'Le containeur que vous avez spécifié (%s) n\'existe pas. Veuillez, s\'il vous plaît recommencer.'; $lang['no_objectclasses_selected'] = 'Vous n\'avez sélectionner aucun ObjectClasses pour cet objet. Veuillez s\'il vous plaît retourner à la page précédente et le faire.'; $lang['hint_structural_oclass'] = 'Note: Vous devez choisir au moins une classe d\'objet de type structural'; @@ -295,6 +334,7 @@ $lang['hint_structural_oclass'] = 'Note: Vous devez choisir au moins une classe $lang['createf_create_object'] = 'Creation d\'un objet'; $lang['createf_choose_temp'] = 'Choix d\'un modèle'; $lang['createf_select_temp'] = 'Selectionner un modèle pour la procédure de création'; +$lang['save_as_file'] = 'Sauvegarder en tant que fichier'; $lang['createf_proceed'] = 'Continuer'; $lang['relative_distinguished_name'] = 'Relative Distinguished Name'; $lang['rdn'] = 'RDN'; @@ -306,6 +346,8 @@ $lang['alias_for'] = 'Alias pour %s'; //creation_template.php $lang['ctemplate_on_server'] = 'Sur le serveur'; $lang['ctemplate_no_template'] = 'Aucun modèle spécifié dans les variables POST.'; +$lang['template_not_readable'] = 'Votre fichier de configuration définit un gestionnaire de "%s" pour ce \'template\' mais ce fichier ne possède pas les droits de lecture.'; +$lang['template_does_not_exist'] = 'Votre fichier de configuration définit un gestionnaire de "%s" pour ce \'template\' mais le gestionnaire n\'existe pas dans le répertoire templates/creation.'; $lang['ctemplate_config_handler'] = 'Votre configuration scécifie un gestionnaire de'; $lang['ctemplate_handler_does_not_exist'] = 'pour ce modèle. Cependant, ce gestionnaire n\'existe pas dans le répertoire \'templates/creation\'.'; $lang['create_step1'] = 'Etape 1 de 2: Nom et classes d\'objet'; @@ -358,12 +400,23 @@ $lang['commit'] = 'Valider'; $lang['cancel'] = 'Annuler'; $lang['you_made_no_changes'] = 'Aucun changement n\'a été effectué'; $lang['go_back'] = 'Retour'; +$lang['unable_create_samba_pass'] = 'Impossible de créer le mot de passe samba. Veuillez vérifiez votre configuration dans le fichier template_config.php'; // welcome.php $lang['welcome_note'] = 'Utilisez le menu de gauche pour la navigation'; $lang['credits'] = 'Crédits'; $lang['changelog'] = 'ChangeLog'; $lang['donate'] = 'Donation'; +$lang['pla_logo'] = 'phpLDAPadmin logo'; + + +// Donate.php +$lang['donation_instructions'] = 'Pour effectuer une doantion au projet phpLDAadmin, veuillez utilisez un des boutons PayPal ci-dessous.'; +$lang['donate_amount'] = 'Donner %s'; +$lang['purge_cache'] = 'Vider la cache'; +$lang['no_cache_to_purge'] = 'Aucune cache à vider.'; +$lang['done_purging_caches'] = 'Suppression de %s octets de la cache.'; +$lang['purge_cache_tooltip'] = 'Supprimer toutes les données en cache dans phpLDAPadmin, y compris les schemas serveur.'; // view_jpeg_photo.php $lang['unsafe_file_name'] = 'Nom de fichier non sûr: '; @@ -521,6 +574,70 @@ $lang['non_leaf_nodes_cannot_be_renamed'] = 'Vous ne pouvez pas renommer une ent $lang['no_rdn_change'] = 'Le RDN n\'a pas été modifié'; $lang['invalid_rdn'] = 'Valeur invalide du RDN'; $lang['could_not_rename'] = 'Impossible de renommer l\'entrée'; +$lang['csv_spreadsheet'] = 'CSV (tableur)'; +// Samba Account Template +$lang['samba_account'] = 'Samba Account'; +$lang['samba_account_lcase'] = 'samba account'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'Nouveau compte utilisateur'; +$lang['t_hint_customize'] = 'Astuce: Pour personnaliser ce \'template\', éditez le fichier templates/creation/new_user_template.php'; +$lang['t_name'] = 'Nom'; +$lang['t_first_name'] = 'Prénom'; +$lang['t_last_name'] = 'Nom de famille'; +$lang['t_first'] = 'first'; +$lang['t_last'] = 'last'; +$lang['t_common_name'] = 'Common name'; +$lang['t_user_name'] = 'Nom d\'utilisateur'; +$lang['t_password'] = 'Mot de passe'; +$lang['t_encryption'] = 'Encryption'; +$lang['t_login_shell'] = 'Login Shell'; +$lang['t_home_dir'] = 'Home Directory'; +$lang['t_uid_number'] = 'UID Number'; +$lang['t_auto_det'] = '(déterminé automatiquement)'; +$lang['t_group'] = 'Groupe'; +$lang['t_gid_number'] = 'GID Number'; +$lang['t_err_passwords'] = 'Les mots de passe ne correspondent pas. Veuillez revenir en arrière et recommencez.'; +$lang['t_err_field_blank'] = 'Le champ %s ne peut etre vide. Veuillez revenir en arrière et recommencez.'; +$lang['t_err_field_num'] = 'Seuls des valeurs numériques sont valides pour le champ %s. Veuillez revenir en arrière et recommencez.'; +$lang['t_err_bad_container'] = 'Le conténeur spécifié (%s) n\'existe pas. Veuillez revenir en arrière et recommencez.'; +$lang['t_confirm_account_creation'] = 'Confirmation de la création du compte'; +$lang['t_secret'] = '[secret]'; +$lang['t_create_account'] = 'Créer le compte'; + +// New Address Template +$lang['t_new_address'] = 'New Address Book Entry'; +$lang['t_organization'] = 'Organisation'; +$lang['t_address'] = 'Adresse'; +$lang['t_city'] = 'Ville'; +$lang['t_postal_code'] = 'Code postal'; +$lang['t_street'] = 'rue'; +$lang['t_work_phone'] = 'Work phone'; +$lang['t_fax'] = 'Fax'; +$lang['t_mobile'] = 'Mobile'; +$lang['t_email'] = 'Email'; +$lang['t_container'] = 'Conténeur'; +$lang['t_err_cn_blank'] = 'Le champ \'Common Name\' ne peut etre vide. Veuillez revenir en arrière et recommencer.'; +$lang['t_confim_creation'] = 'Confirmation de la création de l\'entrée:'; +$lang['t_create_address'] = 'Create Address'; + +// compare form +$lang['compare'] = 'Comparer'; +$lang['comparing'] = 'Comparaison des DNs suivant:'; +$lang['compare_dn'] = 'Comparer un autre DN avec'; +$lang['with'] = 'avec '; +$lang['compf_source_dn'] = 'DN Source'; +$lang['compf_dn_tooltip'] = 'Comparer ce DN avec un autre'; +$lang['switch_entry'] = 'Intervertir les entrées'; +$lang['no_value'] = 'Aucune Valeur'; +$lang['compare_with'] = 'Comparer avec une autre entrée'; +$lang['need_oclass'] = 'You need one of the following ObjectClass(es) to add this attribute %s.'; + +// Time out page +$lang['session_timed_out_1'] = 'Votre session a expiré après'; +$lang['session_timed_out_2'] = 'min. d\'inactivité. Vous avez été automatiquement déconnecté.'; +$lang['log_back_in'] = 'Pour vous connecter à nouveau, cliquez sur le lien suivant:'; +$lang['session_timed_out_tree'] = '(Expiration de session. Déconnexion automatique.)'; ?> diff --git a/lang/ja.php b/lang/ja.php index de7e9b7..4db12fd 100644 --- a/lang/ja.php +++ b/lang/ja.php @@ -1,5 +1,5 @@ ä¸éƒ½åˆã«ã‚ˆã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。ã‚ã‚‹ã„ã¯ã€ã‚ãªãŸã® LDAP サーãƒãƒ¼ã¯ã€LDAP クライアント㌠RootDSE ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã®ã‚’防ãアクセス制御指定をã—ã¦ã„ã¾ã™ã€‚'; -$lang['server_info_for'] = 'Server info for: '; -$lang['server_reports_following'] = 'Server reports the following information about itself'; +$lang['server_info_for'] = 'サーãƒãƒ¼æƒ…å ±: '; +$lang['server_reports_following'] = 'サーãƒãƒ¼ã¯è‡ªåˆ†è‡ªèº«ã§æ¬¡ã®æƒ…報を報告ã—ã¾ã—ãŸã€‚'; $lang['nothing_to_report'] = 'ã“ã®ã‚µãƒ¼ãƒãƒ¼ã¯ãªã«ã‚‚報告ã™ã‚‹ã‚‚ã®ã¯ã‚ã‚Šã¾ã›ã‚“。'; //update.php -$lang['update_array_malformed'] = 'update_array ãŒã‚ªã‚«ã‚·ã‚¤ã§ã™ã€‚This might be a phpLDAPadmin bug. Please report it.'; +$lang['update_array_malformed'] = 'update_array ãŒãŠã‹ã—ã„ã§ã™ã€‚ã“れ㯠phpLDAPadmin ã®ãƒã‚°ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“ã®ã§ã€å ±å‘Šã—ã¦ãã ã•ã„。'; $lang['could_not_perform_ldap_modify'] = 'ldap_modify æ“作ãŒå®Ÿè¡Œã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; // update_confirm.php -$lang['do_you_want_to_make_these_changes'] = 'Do you want to make these changes?'; +$lang['do_you_want_to_make_these_changes'] = '変更をã—ãŸã„ã§ã™ã‹?'; $lang['attribute'] = '属性'; $lang['old_value'] = 'å¤ã„値'; $lang['new_value'] = 'æ–°ã—ã„値'; @@ -382,20 +380,19 @@ $lang['attr_deleted'] = '[属性を削除ã—ã¾ã—ãŸ]'; $lang['commit'] = 'コミット'; $lang['cancel'] = 'å–り消ã—'; $lang['you_made_no_changes'] = '変更ã¯ã‚ã‚Šã¾ã›ã‚“'; -$lang['go_back'] = 'Go back'; +$lang['go_back'] = '戻る'; +$lang['unable_create_samba_pass'] = 'samba パスワードを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚template_conf.php ã®è¨­å®šã‚’確èªã—ã¦ãã ã•ã„。'; // welcome.php -$lang['welcome_note'] = 'å·¦ã¸ã®ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’使用ã—ã¦æœæŸ»ã—ã¾ã™'; +$lang['welcome_note'] = 'å·¦ã¸ã®ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’使用ã—ã¦æ“作ã—ã¾ã™'; $lang['credits'] = 'クレジット'; $lang['changelog'] = '変更履歴'; -$lang['donate'] = '寄贈'; +$lang['donate'] = '寄附'; $lang['pla_logo'] = 'phpLDAPadmin ロゴ'; // Donate.php $lang['donation_instructions'] = 'phpLDAPadmin プロジェクトã«è³‡é‡‘を寄贈ã™ã‚‹ãŸã‚ã«ã¯ã€PayPal ボタンã®ã†ã¡ã® 1 ã¤ã‚’下ã«ä½¿ç”¨ã—ã¦ãã ã•ã„。'; $lang['donate_amount'] = '%s を寄贈'; -$lang['wish_list_option'] = 'Or perhaps you would prefer to purchase an gift for a phpLDAPadmin developer.'; -$lang['wish_list'] = 'Dave\'s phpLDAPadmin ã®ã‚ã£ä¸»ãƒªã‚¹ãƒˆã‚’閲覧'; $lang['purge_cache'] = 'キャッシュ破棄'; $lang['no_cache_to_purge'] = '破棄ã™ã‚‹ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã¯ã‚ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚'; @@ -407,44 +404,44 @@ $lang['unsafe_file_name'] = '安全ã§ãªã„ファイルå: '; $lang['no_such_file'] = 'ファイルãŒã‚ã‚Šã¾ã›ã‚“: '; //function.php -$lang['auto_update_not_setup'] = 'You have enabled auto_uid_numbers for %s in your configuration, - but you have not specified the auto_uid_number_mechanism. Please correct - this problem.'; -$lang['uidpool_not_set'] = 'You specified the "auto_uid_number_mechanism" as "uidpool" - in your configuration for server %s, but you did not specify the - audo_uid_number_uid_pool_dn. Please specify it before proceeding.'; +$lang['auto_update_not_setup'] = '設定ファイル㮠%sYou ã® auto_uid_numbers ãŒæœ‰åŠ¹ã§ã™ãŒã€ + auto_uid_number_mechanism ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã›ã‚“。 + ã“ã®å•é¡Œã‚’修正ã—ã¦ãã ã•ã„。.'; +$lang['uidpool_not_set'] = 'サーãƒãƒ¼ %s ã®è¨­å®šã§ã€"auto_uid_number_mechanism" ã‚’ "uidpool" ã«æŒ‡å®šã—ã¦ã„ã¾ã™ãŒã€ + audo_uid_number_uid_pool_dn を指定ã—ã¦ã„ã¾ã›ã‚“。 + 続行ã™ã‚‹å‰ã«ãれを指定ã—ã¦ãã ã•ã„'; $lang['uidpool_not_exist'] = 'It appears that the uidPool you specified in your configuration ("%s") does not exist.'; -$lang['specified_uidpool'] = 'You specified the "auto_uid_number_mechanism" as "search" in your - configuration for server %s, but you did not specify the - "auto_uid_number_search_base". Please specify it before proceeding.'; -$lang['auto_uid_invalid_credential'] = 'Unable to bind to %s with your with auto_uid credentials. Please check your configuration file.'; -$lang['bad_auto_uid_search_base'] = 'Your phpLDAPadmin configuration specifies an invalid auto_uid_search_base for server %s'; -$lang['auto_uid_invalid_value'] = 'You specified an invalid value for auto_uid_number_mechanism ("%s") - in your configration. Only "uidpool" and "search" are valid. - Please correct this problem.'; -$lang['error_auth_type_config'] = 'Error: You have an error in your config file. The only three allowed values - for auth_type in the $servers section are \'session\', \'cookie\', and \'config\'. You entered \'%s\', - which is not allowed. '; -$lang['unique_attrs_invalid_credential'] = 'Unable to bind to %s with your with unique_attrs credentials. Please check your configuration file.'; -$lang['unique_attr_failed'] = 'Your attempt to add %s (%s) to
      %s
      is NOT allowed. That attribute/value belongs to another entry.

      You might like to search for that entry.'; +$lang['specified_uidpool'] = 'サーãƒãƒ¼ %s ã®è¨­å®šã§ã€Œsearchã€ã«ã€Œauto_uid_number_mechanismã€ã‚’指定ã—ã¾ã—ãŸã€‚ + ã—ã‹ã—「auto_uid_number_search_baseã€ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã›ã‚“。 + ã“れを実行å‰ã«æŒ‡å®šã—ã¦ãã ã•ã„。'; +$lang['auto_uid_invalid_credential'] = 'Unable to bind to %s with your with auto_uid credentials. 設定ファイルを確èªã—ã¦ãã ã•ã„。'; +$lang['bad_auto_uid_search_base'] = 'phpLDAPadmin ã®è¨­å®šã§ã€ã‚µãƒ¼ãƒãƒ¼ %s ã«ç„¡åŠ¹ãª auto_uid_search_base ãŒæŒ‡å®šã•ã‚Œã¾ã—ãŸ'; +$lang['auto_uid_invalid_value'] = '設定ファイル㮠auto_uid_number_mechanism ã®æŒ‡å®šãŒé–“é•ã£ãŸå€¤("%s")ã§ã™ã€‚ + "uidpool" 㨠"search" ã®ã¿æœ‰åŠ¹ã§ã™ã€‚ + ã“ã®å•é¡Œã‚’修正ã—ã¦ãã ã•ã„。'; +$lang['error_auth_type_config'] = 'エラー: 設定ファイルã®ã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚$servers セクション㮠auth_type 㯠+ 「sessionã€ã€Œcookieã€ã€Œconfigã€ã®ã¿ã£ã¤ã®å€¤ã®ã¿è¨±å¯ã•ã‚Œã¦ã„ã¾ã™ãŒã€ + 許å¯ã•ã‚Œãªã„「%sã€ãŒå…¥åŠ›ã•ã‚Œã¾ã—ãŸã€‚'; +$lang['unique_attrs_invalid_credential'] = 'Unable to bind to %s with your with unique_attrs credentials. 設定ファイルを確èªã—ã¦ãã ã•ã„。'; +$lang['unique_attr_failed'] = '%s (%s) ã® %s ã¸ã®è¿½åŠ ã®è©¦ã¿ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“。
      ãã®å±žæ€§/値ã¯åˆ¥ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ‰€æœ‰ã—ã¦ã„ã¾ã™ã€‚

      ãã®ã‚¨ãƒ³ãƒˆãƒªã‚’検索ãªã©ã™ã‚‹ã—ょã†ã€‚'; $lang['php_install_not_supports_tls'] = 'インストールã•ã‚Œã¦ã„ã‚‹ PHP 㯠TLS をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。'; $lang['could_not_start_tls'] = 'TLS を開始ã§ãã¾ã›ã‚“。LDAP サーãƒãƒ¼ã®è¨­å®šã‚’確èªã—ã¦ãã ã•ã„。'; $lang['could_not_bind_anon'] = 'サーãƒãƒ¼ã«åŒ¿å接続ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; $lang['could_not_bind'] = 'LDAP サーãƒãƒ¼ã«æŽ¥ç¶šã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; $lang['anonymous_bind'] = '匿å接続'; $lang['bad_user_name_or_password'] = 'ユーザーåã‹ãƒ‘スワードãŒãŠã‹ã—ã„ã§ã™ã€‚ã‚‚ã†ä¸€åº¦è¡Œã£ã¦ãã ã•ã„。'; -$lang['redirecting_click_if_nothing_happens'] = 'Redirecting... Click here if nothing happens.'; -$lang['successfully_logged_in_to_server'] = 'サーãƒãƒ¼ %sã¸ã®ãƒ­ã‚°ã‚¤ãƒ³ã«æˆåŠŸã—ã¾ã—ãŸ'; +$lang['redirecting_click_if_nothing_happens'] = 'リダイレクト中... ã‚‚ã—何も起ã“らãªã‹ã£ãŸã‚‰ã“ã“をクリックã—ã¦ãã ã•ã„。'; +$lang['successfully_logged_in_to_server'] = 'サーãƒãƒ¼ %s ã¸ã®ãƒ­ã‚°ã‚¤ãƒ³ã«æˆåŠŸã—ã¾ã—ãŸ'; $lang['could_not_set_cookie'] = 'cookie を設定ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; -$lang['ldap_said'] = 'LDAP 回答: %s'; +$lang['ldap_said'] = 'LDAP ã®å›žç­”: %s'; $lang['ferror_error'] = 'エラー'; $lang['fbrowse'] = '閲覧'; $lang['delete_photo'] = '写真削除'; $lang['install_not_support_blowfish'] = 'インストールã•ã‚ŒãŸ PHP 㯠blowfish æš—å·åŒ–をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。'; $lang['install_not_support_md5crypt'] = 'インストールã•ã‚ŒãŸ PHP 㯠md5crypt æš—å·åŒ–をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。'; $lang['install_no_mash'] = 'インストールã•ã‚ŒãŸ PHP 㯠mhash() をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。SHA ãƒãƒƒã‚·ãƒ¥ã‚’ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。'; -$lang['jpeg_contains_errors'] = 'jpegPhoto contains errors
      '; +$lang['jpeg_contains_errors'] = 'エラーをå«ã‚€ jpeg 写真
      '; $lang['ferror_number'] = 'エラー番å·: %s (%s)'; $lang['ferror_discription'] = '説明: %s

      '; $lang['ferror_number_short'] = 'エラー番å·: %s

      '; @@ -455,7 +452,9 @@ $lang['ferror_nonfatil_bug'] = '

      致命的ã§ãªã„ phpLDAPadmin ã®ä¸éƒ½åˆã‚’発見ã—ã¾ã—ãŸ!
      エラー:%s (%s)
      ファイル: %s 行 %s, caller %s
      ãƒãƒ¼ã‚¸ãƒ§ãƒ³:PLA: %s, PHP: %s, SAPI: %s
      ウェブサーãƒãƒ¼:%s
      - ã“ã“をクリックã—ã¦å€‹ã®ä¸éƒ½åˆã‚’報告ã—ã¦ãã ã•ã„。.

      '; +
      Please check and see if this bug has been reported here.
      +
      If it hasnt been reported, you may report this bug by clicking here.
      +
      '; $lang['ferror_congrats_found_bug'] = 'ãŠã‚ã§ã¨ã†ã”ã–ã„ã¾ã™! phpLDAPadmin ã§ä¸éƒ½åˆã‚’発見ã—ã¾ã—ãŸã€‚

      @@ -511,27 +510,26 @@ $lang['searching'] = '検索中...'; $lang['size_limit_exceeded'] = '通知ã§ã™ã€‚検索サイズãŒåˆ¶é™ã‚’越ãˆã¾ã—ãŸã€‚'; $lang['entry'] = 'エントリ'; $lang['ldif_export_for_dn'] = 'LDIF エクスãƒãƒ¼ãƒˆ: %s'; -$lang['generated_on_date'] = 'Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on %s'; +$lang['generated_on_date'] = '%s ã« phpLDAPadmin ( http://www.phpldapadmin.com/ ) ã§ç”Ÿæˆã—ã¾ã—ãŸã€‚'; $lang['total_entries'] = 'ç·ã‚¨ãƒ³ãƒˆãƒª'; $lang['dsml_export_for_dn'] = 'DSLM エクスãƒãƒ¼ãƒˆ: %s'; $lang['include_system_attrs'] = 'システム属性をå«ã‚€'; $lang['csv_spreadsheet'] = 'CSV (スプレッドシート)'; // logins -$lang['could_not_find_user'] = 'ユーザー "%s" ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“'; -$lang['password_blank'] = 'You left the password blank.'; -$lang['login_cancelled'] = 'ログインãŒå–り消ã•ã‚Œã¾ã—ãŸã€‚'; +$lang['password_blank'] = 'パスワードãŒç©ºã§ã™ã€‚'; $lang['no_one_logged_in'] = 'No one is logged in to that server.'; $lang['could_not_logout'] = 'ログアウトã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; $lang['unknown_auth_type'] = '未知㮠auth_type: %s'; $lang['logged_out_successfully'] = 'サーãƒãƒ¼ %s ã‹ã‚‰ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã«æˆåŠŸã—ã¾ã—ãŸ'; -$lang['authenticate_to_server'] = 'Authenticate to server %s'; +$lang['authenticate_to_server'] = 'サーãƒãƒ¼ %s ã¸èªè¨¼'; $lang['warning_this_web_connection_is_unencrypted'] = '警告: ã“ã®ã‚¦ã‚§ãƒ–接続ã¯æš—å·åŒ–ã•ã‚Œã¦ã„ã¾ã›ã‚“。'; -$lang['not_using_https'] = 'You are not using \'https\'. Web browser will transmit login information in clear text.'; +$lang['not_using_https'] = 'ã‚ãªãŸã¯ \'https\' を使ã£ã¦ã„ã¾ã›ã‚“。ログイン情報ã¯ãƒ–ラウザã‹ã‚‰ã‚¯ãƒªã‚¢ãƒ†ã‚­ã‚¹ãƒˆã§é€ä¿¡ã•ã‚Œã¾ã™ã€'; $lang['login_dn'] = 'ログイン DN'; $lang['user_name'] = 'ユーザーå'; $lang['password'] = 'パスワード'; $lang['authenticate'] = 'Authenticate'; +$lang['login_not_allowed'] = 'ã™ã¿ã¾ã›ã‚“ã€ã“ã® LDAP サーãƒãƒ¼ã¨ phpLDAPadmin を使用ã™ã‚‹ã“ã¨ã‚’許å¯ã—ã¦ã„ã¾ã›ã‚“。'; // Entry browser $lang['entry_chooser_title'] = 'エントリé¸æŠž'; @@ -562,8 +560,7 @@ $lang['invalid_rdn'] = '無効㪠RDN 値'; $lang['could_not_rename'] = 'エントリã®å称変更ãŒå‡ºæ¥ã¾ã›ã‚“ã§ã—ãŸ'; // General errors -$lang['php5_unsupported'] = 'phpLDAPadmin 㯠PHP 5 をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。You will likely encounter many weird problems if you continue.'; -$lang['mismatched_search_attr_config'] = '設定ã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚$search_attributes must have the same number of attributes as $search_attributes_display.'; +$lang['mismatched_search_attr_config'] = '設定ã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚$search_attributes 㯠$search_attributes_display ã®å±žæ€§ã¨åŒã˜æ•°ã‚’æŒãŸãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“。'; // Password checker $lang['passwords_match'] = 'パスワードãŒä¸€è‡´ã—ã¾ã—ãŸ!'; @@ -572,4 +569,117 @@ $lang['password_checker_tool'] = 'パスワードãƒã‚§ãƒƒã‚¯ãƒ„ール'; $lang['compare'] = '比較'; $lang['to'] = 'To'; +// Templates +$lang['using'] = 'Using the'; +$lang['switch_to'] = 'You may switch to the '; +$lang['default_template'] = 'デフォルトテンプレート'; + +// template_config +$lang['user_account'] = 'ユーザーアカウント (posixAccount)'; +$lang['address_book_inet'] = 'アドレス帳エントリ (inetOrgPerson)'; +$lang['address_book_moz'] = 'アドレス帳エントリ (mozillaOrgPerson)'; +$lang['kolab_user'] = 'Kolab ユーザーエントリ'; +$lang['organizational_unit'] = '所属組織'; +$lang['organizational_role'] = '所属è·å‹™'; +$lang['posix_group'] = 'Posix グループ'; +$lang['samba_machine'] = 'Samba NT マシン'; +$lang['samba3_machine'] = 'Samba 3 NT マシン'; +$lang['samba_user'] = 'Samba ユーザー'; +$lang['samba3_user'] = 'Samba 3 ユーザー'; +$lang['samba3_group'] = 'Samba 3 グループマップ'; +$lang['dns_entry'] = 'DNS エントリ'; +$lang['simple_sec_object'] = '簡易セキュリティオブジェクト'; +$lang['courier_mail_account'] = 'Courier メールアカウント'; +$lang['courier_mail_alias'] = 'Courier メール別å'; +$lang['ldap_alias'] = 'LDAP 別å'; +$lang['sendmail_cluster'] = 'Sendmail クラスター'; +$lang['sendmail_domain'] = 'Sendmail ドメイン'; +$lang['sendmail_alias'] = 'Sendmail エイリアス'; +$lang['sendmail_virt_dom'] = 'Sendmail 仮想ドメイン'; +$lang['sendmail_virt_users'] = 'Sendmail 仮想ユーザー'; +$lang['sendmail_relays'] = 'Sendmail リレー'; +$lang['custom'] = 'カスタム'; +$lang['samba_domain_name'] = '自分㮠Samba ドメインå'; +$lang['administrators'] = 'Administrators'; +$lang['users'] = 'Users'; +$lang['guests'] = 'Guests'; +$lang['power_users'] = 'Power Users'; +$lang['account_ops'] = 'Account Operators'; +$lang['server_ops'] = 'Server Operators'; +$lang['print_ops'] = 'Print Operators'; +$lang['backup_ops'] = 'backup Operators'; +$lang['replicator'] = 'Replicator'; +$lang['unable_smb_passwords'] = ' Samba ã®ãƒ‘スワードを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚template_config.php ã®è¨­å®šã‚’確èªã—ã¦ãã ã•ã„。'; +$lang['err_smb_conf'] = 'エラー: samba ã®è¨­å®šã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚'; +$lang['err_smb_no_name_sid'] = 'エラー: samba ドメインã®åå‰ãŠã‚ˆã³ sid ã‚’æä¾›ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚'; +$lang['err_smb_no_name'] = 'エラー: åå‰ã¯ samba ドメインã«æä¾›ã•ã‚Œã¾ã›ã‚“ã§ã—ãŸã€‚'; +$lang['err_smb_no_sid'] = 'エラー: sid 㯠samba ドメインã«æä¾›ã•ã‚Œã¾ã›ã‚“ã§ã—ãŸã€‚'; + +// Samba Account Template +$lang['samba_account'] = 'Samba アカウント'; +$lang['samba_account_lcase'] = 'samba アカウント'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'æ–°è¦ãƒ¦ãƒ¼ã‚¶ãƒ¼ã‚¢ã‚«ã‚¦ãƒ³ãƒˆ'; +$lang['t_hint_customize'] = 'ヒント: ã“ã®ãƒ†ãƒ³ãƒ—レートをカスタマイズã™ã‚‹å ´åˆã€ãƒ•ã‚¡ã‚¤ãƒ« templates/creation/new_user_template.php を編集ã—ã¾ã™ã€‚'; +$lang['t_name'] = 'åå‰'; +$lang['t_first_name'] = 'åå‰'; +$lang['t_last_name'] = 'è‹—å­—'; +$lang['t_first'] = 'first'; +$lang['t_last'] = 'last'; +$lang['t_common_name'] = '共通å'; +$lang['t_user_name'] = 'ユーザーå'; +$lang['t_password'] = 'パスワード'; +$lang['t_encryption'] = 'æš—å·åŒ–'; +$lang['t_login_shell'] = 'ログインシェル'; +$lang['t_home_dir'] = 'ホームディレクトリ'; +$lang['t_uid_number'] = 'UID 番å·'; +$lang['t_auto_det'] = '(自動採決)'; +$lang['t_group'] = 'グループ'; +$lang['t_gid_number'] = 'GID 番å·'; +$lang['t_err_passwords'] = 'パスワードãŒä¸€è‡´ã—ã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_err_field_blank'] = '%s ブランクを残ã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_err_field_num'] = 'フィールド %s ã¯æ•°å€¤ã®ã¿å…¥åŠ›ã§å‡ºæ¥ã¾ã™ã€‚戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_err_bad_container'] = '指定ã—ãŸå†…容(%s)ã¯å­˜åœ¨ã—ã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_confirm_account_creation'] = 'アカウント作æˆç¢ºèª'; +$lang['t_secret'] = '[secret]'; +$lang['t_create_account'] = 'アカウント作æˆ'; + +// New Address Template +$lang['t_new_address'] = 'æ–°è¦ã‚¢ãƒ‰ãƒ¬ã‚¹å¸³ã‚¨ãƒ³ãƒˆãƒª'; +$lang['t_organization'] = '組織'; +$lang['t_address'] = 'ä½æ‰€'; +$lang['t_city'] = '都市'; +$lang['t_postal_code'] = '郵便番å·'; +$lang['t_street'] = '築町æ‘'; +$lang['t_work_phone'] = '業務電話'; +$lang['t_fax'] = 'Fax'; +$lang['t_mobile'] = 'æºå¸¯é›»è©±'; +$lang['t_email'] = 'é›»å­ãƒ¡ãƒ¼ãƒ«'; +$lang['t_container'] = 'コンテナー'; +$lang['t_err_cn_blank'] = '一般åを空ã«ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_confim_creation'] = 'エントリ作æˆã®ç¢ºèª:'; +$lang['t_create_address'] = 'アドレス作æˆ'; + +// default template +$lang['t_check_pass'] = 'パスワード検査...'; + +// compare form +$lang['compare'] = '比較'; +$lang['comparing'] = '次㮠DN ã¨æ¯”較中'; +$lang['compare_dn'] = 'Compare another DN with'; +$lang['with'] = 'with '; +$lang['compf_source_dn'] = '元㮠DN'; +$lang['compf_dn_tooltip'] = 'ã“ã® DN ã¨åˆ¥ã®ã‚‚ã®ã‚’比較'; +$lang['switch_entry'] = 'エントリã®åˆ‡ã‚Šæ›¿ãˆ'; +$lang['no_value'] = '値ãŒã‚ã‚Šã¾ã›ã‚“'; +$lang['compare_with'] = '別ã®ã‚¨ãƒ³ãƒˆãƒªã¨æ¯”較'; +$lang['need_oclass'] = 'ã“ã®å±žæ€§ %s を追加ã™ã‚‹ã«ã¯æ¬¡ã® ObjectClass ã®ã†ã¡ã²ã¨ã¤ã‚’å¿…è¦ã¨ã—ã¾ã™ã€‚'; + +// Time out page +$lang['session_timed_out_1'] = 'セッションã¯'; +$lang['session_timed_out_2'] = '分活動ã—ãªã‹ã£ãŸã®ã§ã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã§ã™ã€‚自動ã§ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸã€‚'; +$lang['log_back_in'] = 'å†ãƒ­ã‚°ã‚¤ãƒ³ã™ã‚‹ã«ã¯æ¬¡ã®ãƒªãƒ³ã‚¯ã‚’クリックã—ã¦ãã ã•ã„:'; +$lang['session_timed_out_tree'] = '(セッションã¯ã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã§ã™ã€‚自動ã§ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸ)'; +$lang['timeout_at'] = '%s ã¯æ´»å‹•çš„ã§ãªã‹ã£ãŸã®ã§ãƒ­ã‚°ã‚¢ã‚¦ãƒˆ'; ?> diff --git a/lang/pl.php b/lang/pl.php index b40ef9e..d3da041 100644 --- a/lang/pl.php +++ b/lang/pl.php @@ -1,5 +1,5 @@ b³êdem w Twojej wersji PHP albo na przyk³ad tym, ¿e Twój serwer LDAP posiada listê kontroli dostêpu nie zezwalaj±c± na pobranie RootDSE klientom LDAP'; $lang['server_info_for'] = 'Informacja o serwerze: '; $lang['server_reports_following'] = 'Serwer zwróci³ nastêpuj±ce informacje o sobie'; $lang['nothing_to_report'] = 'Ten serwer nie chce nic powiedzieæ o sobie :).'; @@ -369,24 +376,30 @@ $lang['commit'] = 'Zatwierd $lang['cancel'] = 'Anuluj'; $lang['you_made_no_changes'] = 'Nie dokonano ¿adnych zmian'; $lang['go_back'] = 'Powrót'; +$lang['unable_create_samba_pass'] = 'Nie mo¿na utworzyæ has³a dla samby. Sprawd¼ proszê swoj± konfiguracjê w template_config.php'; // welcome.php $lang['welcome_note'] = 'U¿yj menu z lewej strony do nawigacji'; $lang['credits'] = 'Lista p³ac'; $lang['changelog'] = 'Historia zmian'; $lang['donate'] = 'Wesprzyj projekt'; -$lang['purge_cache'] = 'Wyczy¶æ pamiêæ podrêczn±'; +$lang['pla_logo'] = 'phpLDAPadmin logo'; + +// Donate.php +$lang['donation_instructions'] = 'Aby wesprzeæ projekt phpLDAPadmin skorzystaj z jednego z przycisków PayPal umieszczonych poni¿ej'; +$lang['donate_amount'] = 'Wesprzyj kwot± %s'; + +$lang['purge_cache'] = 'Wyczy¶æ cache'; $lang['no_cache_to_purge'] = 'Nie ma czego czy¶ciæ.'; -$lang['done_purging_caches'] = 'Wyczyszczono %s bajtów pamiêci podrêcznej.'; - +$lang['done_purging_caches'] = 'Wyczyszczono %s bajtów pamiêci podrêcznej (cache).'; +$lang['purge_cache_tooltip'] = 'Czy¶ci wszystkie dane podrêczne (cache) w phpLDAPadmin, ³±cznie ze schematami serwera'; + // view_jpeg_photo.php $lang['unsafe_file_name'] = 'Niebezpieczna nazwa pliku: '; $lang['no_such_file'] = 'Nie znaleziono pliku: '; //function.php -$lang['auto_update_not_setup'] = 'Zezwoli³e¶/a¶ na automatyczne nadawanie uid (auto_uid_numbers) - dla %s w konfiguracji, ale nie okre¶li³e¶/a¶ mechanizmu - (auto_uid_number_mechanism). Proszê skorygowaæ ten problem.'; +$lang['auto_update_not_setup'] = 'Zezwoli³e¶/a¶ na automatyczne nadawanie uid (auto_uid_numbers) dla %s w konfiguracji, ale nie okre¶li³e¶/a¶ mechanizmu (auto_uid_number_mechanism). Proszê skorygowaæ ten problem.'; $lang['uidpool_not_set'] = 'Okre¶li³e¶/a¶ mechanizm autonumerowania uid "auto_uid_number_mechanism" jako "uidpool" w konfiguracji Twojego serwera %s, lecz nie okre¶li³e¶/a¶ audo_uid_number_uid_pool_dn. Proszê okre¶l to zanim przejdziesz dalej.'; $lang['uidpool_not_exist'] = 'Wygl±da na to, ¿e uidPool, któr± okre¶li³e¶/a¶ w Twojej konfiguracji ("%s") nie istnieje.'; $lang['specified_uidpool'] = 'Okre¶li³e¶/a¶ "auto_uid_number_mechanism" jako "search" w konfiguracji Twojego serwera %s, ale nie okre¶li³e¶/a¶ bazy "auto_uid_number_search_base". Zrób to zanim przejdziesz dalej.'; @@ -402,15 +415,15 @@ $lang['could_not_bind_anon'] = 'Nie mo $lang['could_not_bind'] = 'Nie mo¿na pod³±czyæ siê do serwera LDAP.'; $lang['anonymous_bind'] = 'Pod³±czenie anonimowe'; $lang['bad_user_name_or_password'] = 'Z³a nazwa u¿ytkownika lub has³o. Spróbuj ponownie.'; -$lang['redirecting_click_if_nothing_happens'] = 'Przekierowujê... Kliknij tutaj je¶li nic siê nie dzieje.'; $lang['successfully_logged_in_to_server'] = 'Pomy¶lnie zalogowano do serwera %s'; $lang['could_not_set_cookie'] = 'Nie mo¿na ustawiæ ciasteczka (cookie).'; $lang['ldap_said'] = 'LDAP odpowiedzia³: %s'; $lang['ferror_error'] = 'B³±d'; $lang['fbrowse'] = 'przegl±daj'; $lang['delete_photo'] = 'Usuñ fotografiê'; -$lang['install_not_support_blowfish'] = 'Twoja instalacja PHP nie wspiera szyfrowania blowfish.'; -$lang['install_not_support_md5crypt'] = 'Twoja instalacja PHP nie wspiera szyfrowania md5crypt.'; +$lang['install_not_support_ext_des'] = 'Twoja systemowa biblioteka crypt nie wspiera rozszerzonego szyfrowania DES'; +$lang['install_not_support_blowfish'] = 'Twoja systemowa biblioteka crypt nie wspiera szyfrowania blowfish.'; +$lang['install_not_support_md5crypt'] = 'Twoja systemowa biblioteka crypt nie wspiera szyfrowania md5crypt.'; $lang['install_no_mash'] = 'Twoja instalacja PHP nie posiada funkcji mhash(). Nie mogê tworzyæ haszy SHA.'; $lang['jpeg_contains_errors'] = 'jpegPhoto zawiera b³êdy
      '; $lang['ferror_number'] = 'B³±d numer: %s (%s)'; @@ -442,7 +455,6 @@ $lang['ferror_congrats_found_bug'] = 'Gratulacje ! Znalaz //ldif_import_form $lang['import_ldif_file_title'] = 'Importuj plik LDIF'; $lang['select_ldif_file'] = 'Wybierz plik LDIF:'; -$lang['select_ldif_file_proceed'] = 'Dalej >>'; $lang['dont_stop_on_errors'] = 'Nie zatrzymuj siê po napotkaniu b³êdów'; //ldif_import @@ -453,7 +465,7 @@ $lang['modify_action'] = 'Modyfikowanie...'; $lang['warning_no_ldif_version_found'] = 'Nie znaleziono numeru wersji. Przyjmujê 1.'; $lang['valid_dn_line_required'] = 'Wymagana jest poprawna linia DN.'; $lang['missing_uploaded_file'] = 'Brak wgrywanego pliku.'; -$lang['no_ldif_file_specified.'] = 'Nie okre¶lono pliku LDIF. Spróbuj ponownie.'; +$lang['no_ldif_file_specified'] = 'Nie okre¶lono pliku LDIF. Spróbuj ponownie.'; $lang['ldif_file_empty'] = 'Wgrany plik LDIF jest pusty.'; $lang['empty'] = 'pusty'; $lang['file'] = 'Plik'; @@ -489,11 +501,10 @@ $lang['generated_on_date'] = 'Wygenerowane przez phpLDAPadmin ( http://phpldapad $lang['total_entries'] = '£±cznie wpisów'; $lang['dsml_export_for_dn'] = 'Eksport DSLM dla: %s'; $lang['include_system_attrs'] = 'Zawiera atrybuty systemowe'; +$lang['csv_spreadsheet'] = 'CVS (arkusz)'; // logins -$lang['could_not_find_user'] = 'Nie mo¿na znale¼æ u¿ytkownika "%s"'; $lang['password_blank'] = 'Pozostawi³e¶/a¶ puste has³o.'; -$lang['login_cancelled'] = 'Logowanie anulowane.'; $lang['no_one_logged_in'] = 'Nikt nie jest zalogowany do tego serwera.'; $lang['could_not_logout'] = 'Nie mo¿na wylogowaæ.'; $lang['unknown_auth_type'] = 'Nieznany auth_type: %s'; @@ -505,6 +516,7 @@ $lang['login_dn'] = 'Login DN'; $lang['user_name'] = 'Nazwa u¿ytkownika'; $lang['password'] = 'Has³o'; $lang['authenticate'] = 'Zaloguj'; +$lang['login_not_allowed'] = 'Przykro mi, ale nie masz uprawnieñ aby korzystaæ z phpLDAPadmin na tym serwerze LDAP.'; // Entry browser $lang['entry_chooser_title'] = 'Wybór wpisu'; @@ -534,15 +546,25 @@ $lang['no_rdn_change'] = 'Nie zmieni $lang['invalid_rdn'] = 'B³êdna warto¶æ RDN'; $lang['could_not_rename'] = 'Nie mo¿na zmieniæ nazwy wpisu'; +// General errors +$lang['mismatched_search_attr_config'] = 'Twoja konfiguracja zawiera b³±d. $search_attributes musi posiadaæ t± sam± ilo¶æ atrybutów co $search_attributes_display.'; + +// Password checker +$lang['passwords_match'] = 'Has³a zgodne !'; +$lang['passwords_do_not_match'] = 'Has³a nie zgadzaj± siê !'; +$lang['password_checker_tool'] = 'Narzêdzie do sprawdzania hase³'; +$lang['compare'] = 'Porównaj'; +$lang['to'] = 'Do'; + // Templates $lang['using'] = 'U¿ywaj±c'; -$lang['template'] = 'szablonu'; $lang['switch_to'] = 'Mo¿esz prze³±czyæ siê do '; $lang['default_template'] = 'domy¶lnego szablonu'; // template_config $lang['user_account'] = 'Konto U¿ytkownika (posixAccount)'; -$lang['address_book'] = 'Wpis Ksi±¿ki Adresowej (inetOrgPerson)'; +$lang['address_book_inet'] = 'Wpis Ksi±¿ki Adresowej (inetOrgPerson)'; +$lang['address_book_moz'] = 'Wpis Ksi±¿ki Adresowej (mozillaOrgPerson)'; $lang['kolab_user'] = 'Wpis U¿ytkownika Kolab'; $lang['organizational_unit'] = 'Jednostka Organizacyjna'; $lang['organizational_role'] = 'Rola w Organizacji'; @@ -557,6 +579,12 @@ $lang['simple_sec_object'] = 'Prosty obiekt bezpiecze $lang['courier_mail_account'] = 'Konto Pocztowe w Courier'; $lang['courier_mail_alias'] = 'Alias Pocztowy w Courier'; $lang['ldap_alias'] = 'Alias w LDAP'; +$lang['sendmail_cluster'] = 'Klaster Sendmail'; +$lang['sendmail_domain'] = 'Domena Sendmail'; +$lang['sendmail_alias'] = 'Alias Sendmail'; +$lang['sendmail_virt_dom'] = 'Wirtualna Domena Sendmail'; +$lang['sendmail_virt_users'] = 'Wirtualni U¿ytkownicy Sendmail'; +$lang['sendmail_relays'] = 'Sendmail Relays'; $lang['custom'] = 'Ogólne'; $lang['samba_domain_name'] = 'Moja nazwa domeny w Samba'; $lang['administrators'] = 'Administratorzy'; @@ -569,6 +597,10 @@ $lang['print_ops'] = 'Operatorzy drukowania'; $lang['backup_ops'] = 'Operatorzy archiwizacji danych'; $lang['replicator'] = 'Replikator'; $lang['unable_smb_passwords'] = ' Nie mo¿na utworzyæ hase³ Samba. Proszê sprawdziæ konfiguracjê w template_config.php'; +$lang['err_smb_conf'] = 'B³±d: masz b³±d w konfiguracji samby'; +$lang['err_smb_no_name_sid'] = 'B³±d: musisz wprowadziæ nazwê oraz sid dla Twojej domeny samby.'; +$lang['err_smb_no_name'] = 'B³±d: brak nazwy dla domeny samby.'; +$lang['err_smb_no_sid'] = 'B³±d: brak sid dla domeny samby'; // Samba Account Template $lang['samba_account'] = 'Konto Samba'; @@ -580,6 +612,8 @@ $lang['t_hint_customize'] = 'Wskaz $lang['t_name'] = 'Nazwa/Nazwisko'; $lang['t_first_name'] = 'Imiê'; $lang['t_last_name'] = 'Nazwisko'; +$lang['t_first'] = 'imiê'; +$lang['t_last'] = 'nazwisko'; $lang['t_common_name'] = 'Nazwa'; $lang['t_user_name'] = 'Nazwa u¿ytkownika'; $lang['t_password'] = 'Has³o'; @@ -614,4 +648,25 @@ $lang['t_err_cn_blank'] = 'Nie mo $lang['t_confim_creation'] = 'Potwierd¼ utworzenie wpisu:'; $lang['t_create_address'] = 'Utwórz adres'; +// default template +$lang['t_check_pass'] = 'Sprawd¼ has³o'; + +// compare form +$lang['compare'] = 'Porównaj'; +$lang['comparing'] = 'Porównujê nastêpuj±ce DN'; +$lang['compare_dn'] = 'Porównaj inny DN z'; +$lang['with'] = 'z'; +$lang['compf_source_dn'] = '¬ród³owa DN'; +$lang['compf_dn_tooltip'] = 'Prównaj t± DN z inn±'; +$lang['switch_entry'] = 'Zamieñ wpisy'; +$lang['no_value'] = 'Brak warto¶ci'; +$lang['compare_with'] = 'Porównaj z innym wpisem'; +$lang['need_oclass'] = 'Musisz posiadaæ jedn± z nastêpuj±cych klas obiektów, aby dodaæ ten atrybut %s '; + +// Time out page +$lang['session_timed_out_1'] = 'Twoja sesja wyga¶nie po'; +$lang['session_timed_out_2'] = 'min. nieaktywno¶ci. Zostaniesz automatycznie wylogowany/a.'; +$lang['log_back_in'] = 'Aby siê zalogowaæ ponownie kliknij w nastêpuj±cy link:'; +$lang['session_timed_out_tree'] = '(Sesja wygas³a. Automatycznie wylogowano)'; +$lang['timeout_at'] = 'Brak aktywno¶ci wyloguje Ciê o %s'; ?> diff --git a/lang/recoded/auto.php b/lang/recoded/auto.php index fdf60ca..512e010 100644 --- a/lang/recoded/auto.php +++ b/lang/recoded/auto.php @@ -1,8 +1,8 @@ "ca" // catalan ," ru-"=>"ru" // ru- exits? ," sv "=>"sv" //swedish ," sv-"=>"sv" // swedisch to + ," zh-cn"=>"zh-cn" // simplified chinese + ," zh-tw"=>"zh-tw" // taiwan? );// all supported languages in this array // test diff --git a/lang/recoded/en.php b/lang/recoded/en.php index 64a5fee..d87ba64 100644 --- a/lang/recoded/en.php +++ b/lang/recoded/en.php @@ -1,5 +1,5 @@ %s'; $lang['could_not_set_cookie'] = 'Could not set cookie.'; $lang['ldap_said'] = 'LDAP said: %s'; $lang['ferror_error'] = 'Error'; $lang['fbrowse'] = 'browse'; $lang['delete_photo'] = 'Delete Photo'; -$lang['install_not_support_blowfish'] = 'Your PHP install does not support blowfish encryption.'; -$lang['install_not_support_md5crypt'] = 'Your PHP install does not support md5crypt encryption.'; +$lang['install_not_support_ext_des'] = 'Your system crypt library does not support extended DES encryption.'; +$lang['install_not_support_blowfish'] = 'Your system crypt library does not support blowfish encryption.'; +$lang['install_not_support_md5crypt'] = 'Your system crypt library does not support md5crypt encryption.'; $lang['install_no_mash'] = 'Your PHP install does not have the mhash() function. Cannot do SHA hashes.'; $lang['jpeg_contains_errors'] = 'jpegPhoto contains errors
      '; $lang['ferror_number'] = 'Error number: %s (%s)'; @@ -457,8 +457,10 @@ $lang['ferror_unrecognized_num'] = 'Unrecognized error number: '; $lang['ferror_nonfatil_bug'] = '
      エラー:%s
      You found a non-fatal phpLDAPadmin bug!
      Error:%s (%s)
      File: %s line %s, caller %s
      Versions:PLA: %s, PHP: %s, SAPI: %s -
      Web server:%s
      - Please report this bug by clicking here.

      '; + Web server:%s +
      Please check and see if this bug has been reported here.
      +
      If it hasnt been reported, you may report this bug by clicking here.
      +
      '; $lang['ferror_congrats_found_bug'] = 'Congratulations! You found a bug in phpLDAPadmin.

      @@ -514,16 +516,14 @@ $lang['searching'] = 'Searching...'; $lang['size_limit_exceeded'] = 'Notice, search size limit exceeded.'; $lang['entry'] = 'Entry'; $lang['ldif_export_for_dn'] = 'LDIF Export for: %s'; -$lang['generated_on_date'] = 'Generated by phpLDAPadmin ( http://www.phpldapadmin.com/ ) on %s'; +$lang['generated_on_date'] = 'Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on %s'; $lang['total_entries'] = 'Total Entries'; $lang['dsml_export_for_dn'] = 'DSLM Export for: %s'; $lang['include_system_attrs'] = 'Include system attributes'; $lang['csv_spreadsheet'] = 'CSV (Spreadsheet)'; // logins -$lang['could_not_find_user'] = 'Could not find a user "%s"'; $lang['password_blank'] = 'You left the password blank.'; -$lang['login_cancelled'] = 'Login cancelled.'; $lang['no_one_logged_in'] = 'No one is logged in to that server.'; $lang['could_not_logout'] = 'Could not logout.'; $lang['unknown_auth_type'] = 'Unknown auth_type: %s'; @@ -535,6 +535,7 @@ $lang['login_dn'] = 'Login DN'; $lang['user_name'] = 'User name'; $lang['password'] = 'Password'; $lang['authenticate'] = 'Authenticate'; +$lang['login_not_allowed'] = 'Sorry, you are not allowed to use phpLDAPadmin with this LDAP server.'; // Entry browser $lang['entry_chooser_title'] = 'Entry Chooser'; @@ -547,7 +548,6 @@ $lang['no_deletes_in_read_only'] = 'Deletes not allowed in read only mode.'; $lang['error_calling_mass_delete'] = 'Error calling mass_delete.php. Missing mass_delete in POST vars.'; $lang['mass_delete_not_array'] = 'mass_delete POST var is not an array.'; $lang['mass_delete_not_enabled'] = 'Mass deletion is not enabled. Please enable it in config.php before proceeding.'; -$lang['search_attrs_wrong_count'] = 'Your config.php has an error. The number of attributes in $search_attributes and $search_attributes_display is different'; $lang['mass_deleting'] = 'Mass Deleting'; $lang['mass_delete_progress'] = 'Deletion progress on server "%s"'; $lang['malformed_mass_delete_array'] = 'Malformed mass_delete array.'; @@ -564,20 +564,14 @@ $lang['no_rdn_change'] = 'You did not change the RDN'; $lang['invalid_rdn'] = 'Invalid RDN value'; $lang['could_not_rename'] = 'Could not rename the entry'; -// General errors -$lang['php5_unsupported'] = 'phpLDAPadmin does not yet support PHP 5. You will likely encounter many weird problems if you continue.'; -$lang['mismatched_search_attr_config'] = 'Your configuration has an error. $search_attributes must have the same number of attributes as $search_attributes_display.'; - // Password checker $lang['passwords_match'] = 'Passwords match!'; $lang['passwords_do_not_match'] = 'Passwords do not match!'; $lang['password_checker_tool'] = 'Password Checker Tool'; -$lang['compare'] = 'Compare'; $lang['to'] = 'To'; // Templates $lang['using'] = 'Using the'; -$lang['template'] = 'template'; $lang['switch_to'] = 'You may switch to the '; $lang['default_template'] = 'default template'; @@ -586,8 +580,9 @@ $lang['user_account'] = 'User Account (posixAccount)'; $lang['address_book_inet'] = 'Address Book Entry (inetOrgPerson)'; $lang['address_book_moz'] = 'Address Book Entry (mozillaOrgPerson)'; $lang['kolab_user'] = 'Kolab User Entry'; -$lang['organizational_unit'] = 'Organizational Unit'; -$lang['organizational_role'] = 'Organizational Role'; +$lang['organizational_unit'] = 'Organisational Unit'; +$lang['new_organizational_unit'] = 'New Organisational Unit'; +$lang['organizational_role'] = 'Organisational Role'; $lang['posix_group'] = 'Posix Group'; $lang['samba_machine'] = 'Samba NT Machine'; $lang['samba3_machine'] = 'Samba 3 NT Machine'; @@ -634,6 +629,7 @@ $lang['t_first_name'] = 'First name'; $lang['t_last_name'] = 'Last name'; $lang['t_first'] = 'first'; $lang['t_last'] = 'last'; +$lang['t_state'] = 'State'; $lang['t_common_name'] = 'Common name'; $lang['t_user_name'] = 'User Name'; $lang['t_password'] = 'Password'; @@ -644,6 +640,7 @@ $lang['t_uid_number'] = 'UID Number'; $lang['t_auto_det'] = '(automatically determined)'; $lang['t_group'] = 'Group'; $lang['t_gid_number'] = 'GID Number'; +$lang['t_uid'] = 'User ID'; $lang['t_err_passwords'] = 'Your passwords don\'t match. Please go back and try again.'; $lang['t_err_field_blank'] = 'You cannot leave the %s blank. Please go back and try again.'; $lang['t_err_field_num'] = 'You can only enter numeric values for the %s field. Please go back and try again.'; @@ -651,10 +648,14 @@ $lang['t_err_bad_container'] = 'The container you specified (%s) does not exist. $lang['t_confirm_account_creation'] = 'Confirm account creation'; $lang['t_secret'] = '[secret]'; $lang['t_create_account'] = 'Create Account'; +$lang['t_verify'] = 'Verify'; + +// New Group (Posix) +$lang['t_new_posixgroup'] = 'New Posix Group'; // New Address Template $lang['t_new_address'] = 'New Address Book Entry'; -$lang['t_organization'] = 'Organization'; +$lang['t_organization'] = 'Organisation'; $lang['t_address'] = 'Address'; $lang['t_city'] = 'City'; $lang['t_postal_code'] = 'Postal code'; @@ -670,5 +671,24 @@ $lang['t_create_address'] = 'Create Address'; // default template $lang['t_check_pass'] = 'Check password...'; +$lang['t_auto_submit'] = '(Auto evalutated on submission.)'; +// compare form +$lang['compare'] = 'Compare'; +$lang['comparing'] = 'Comparing the following DNs'; +$lang['compare_dn'] = 'Compare another DN with'; +$lang['with'] = 'with '; +$lang['compf_source_dn'] = 'Source DN'; +$lang['compf_dn_tooltip'] = 'Compare this DN with another'; +$lang['switch_entry'] = 'Switch Entry'; +$lang['no_value'] = 'No Value'; +$lang['compare_with'] = 'Compare with another entry'; +$lang['need_oclass'] = 'You need one of the following ObjectClass(es) to add this attribute %s.'; + +// Time out page +$lang['session_timed_out_1'] = 'Your Session timed out after'; +$lang['session_timed_out_2'] = 'min. of inactivity. You have been automatically logged out.'; +$lang['log_back_in'] = 'To log back in please click on the following link:'; +$lang['session_timed_out_tree'] = '(Session timed out. Automatically logged out.)'; +$lang['timeout_at'] = 'Inactivity will log you off at %s'; ?> diff --git a/lang/recoded/es.php b/lang/recoded/es.php index 7bb0db5..74fc3a7 100644 --- a/lang/recoded/es.php +++ b/lang/recoded/es.php @@ -1,28 +1,37 @@ + */ // Search form $lang['simple_search_form_str'] = 'Formulario de búsqueda sencilla'; $lang['advanced_search_form_str'] = 'Formulario de búsqueda avanzada'; $lang['server'] = 'Servidor'; -$lang['search_for_entries_whose'] = 'Buscar objetos los cuales'; -$lang['base_dn'] = 'DN Base'; -$lang['search_scope'] = 'Alcance de la búsqueda'; -$lang['search_ filter'] = 'Filtro de Búsqueda'; +$lang['search_for_entries_whose'] = 'Buscar objetos que'; +$lang['base_dn'] = 'DN base'; +$lang['search_scope'] = 'Ãmbito de búsqueda'; $lang['show_attributes'] = 'Mostrar atributos'; +$lang['attributes'] = 'Atributos'; $lang['Search'] = 'Buscar'; -$lang['equals'] = 'equivale'; -$lang['starts_with'] = 'comienza con'; -$lang['contains'] = 'contiene'; -$lang['ends_with'] = 'termina con'; -$lang['sounds_like'] = 'suena como'; +$lang['predefined_search_str'] = 'Seleccionar una búsqueda predefinida'; +$lang['predefined_searches'] = 'Búsquedas predefinidas'; +$lang['no_predefined_queries'] = 'No hay ninguna búsqueda predefinida en config.php.'; +$lang['export_results'] = 'exportar resultados'; +$lang['unrecoginzed_search_result_format'] = 'Formato de resultado de búsqueda no reconocido: %s'; +$lang['format'] = 'Formato'; +$lang['list'] = 'lista'; +$lang['table'] = 'tabla'; +$lang['bad_search_display'] = 'Su config.php especifica un valor no válido para $default_search_display: %s. Por favor, arréglelo'; +$lang['page_n'] = 'Página %d'; +$lang['no_results'] = 'La búsqueda no ha encontrado resultados.'; // Tree browser -$lang['request_new_feature'] = 'Pedir funcionalidad'; -$lang['see_open_requests'] = 'Ver las peticiones'; -$lang['report_bug'] = 'Reportar un error'; -$lang['see_open_bugs'] = 'Ver los errores'; +$lang['request_new_feature'] = 'Solicitar una nueva funcionalidad'; +$lang['report_bug'] = 'Informar de un error'; $lang['schema'] = 'esquema'; $lang['search'] = 'buscar'; $lang['create'] = 'crear'; @@ -30,313 +39,617 @@ $lang['info'] = 'info'; $lang['import'] = 'importar'; $lang['refresh'] = 'refrescar'; $lang['logout'] = 'salir'; -$lang['create_new'] = 'Crear Nuevo Objeto'; -$lang['view_schema_for'] = 'Ver esquema para'; -$lang['refresh_expanded_containers'] = 'Refrescar todos los contenedores extendidos para'; -$lang['create_new_entry_on'] = 'Crear nuevo objeto en'; -$lang['view_server_info'] = 'Ver información del servidor'; -$lang['import_from_ldif'] = 'Importar objetos de archivo LDIF'; -$lang['logout_of_this_server'] = 'Salir de este servidor'; +$lang['create_new'] = 'Crear nuevo objeto'; +$lang['view_schema_for'] = 'Ver el esquema del'; +$lang['refresh_expanded_containers'] = 'Refrescar todos los contenedores extendidos del'; +$lang['create_new_entry_on'] = 'Crear un nuevo objeto en el'; +$lang['new'] = 'nuevo'; +$lang['view_server_info'] = 'Ver la información enviada por el servidor'; +$lang['import_from_ldif'] = 'Importar desde un fichero LDIF'; +$lang['logout_of_this_server'] = 'Desconectar del servidor'; $lang['logged_in_as'] = 'Conectado como: '; -$lang['read_only'] = 'inalterable'; -$lang['could_not_determine_root'] = 'No se ha podido determinar la raiz del servidor LDAP.'; -$lang['ldap_refuses_to_give_root'] = 'Parece ser que el servidor LDAP se ha configurado para no revelar su raiz.'; -$lang['please_specify_in_config'] = 'Por favor especifícala en el archivo config.php'; -$lang['create_new_entry_in'] = 'Crear un nuevo objeto en'; -$lang['login_link'] = 'Autenticación...'; +$lang['this_base_dn_is_not_valid'] = 'Esta DN base no es válida.'; +$lang['this_base_dn_does_not_exist'] = 'Este objeto no existe.'; +$lang['read_only'] = 'sólo lectura'; +$lang['read_only_tooltip'] = 'Este atributo ha sido marcado como de sólo lectura por el administrador de phpLDAPadmin'; +$lang['could_not_determine_root'] = 'No se ha podido determinar la raíz de su árbol LDAP.'; +$lang['ldap_refuses_to_give_root'] = 'Parece que el servidor LDAP ha sido configurado para no revelar su raíz.'; +$lang['please_specify_in_config'] = 'Por favór, especifíquela en config.php'; +$lang['create_new_entry_in'] = 'Crear nuevo objeto en'; +$lang['login_link'] = 'Autentificación'; +$lang['login'] = 'conectar'; +$lang['base_entry_does_not_exist'] = 'Este objeto base no existe.'; +$lang['create_it'] = '¿Crearlo?'; // Entry display $lang['delete_this_entry'] = 'Borrar este objeto'; -$lang['delete_this_entry_tooltip'] = 'Se tendrá que confirmar esta decision'; +$lang['delete_this_entry_tooltip'] = 'Se le pedirá confirmación'; $lang['copy_this_entry'] = 'Copiar este objeto'; -$lang['copy_this_entry_tooltip'] = 'Copiar este objeto para otra localización, DN nuevo, o para otro servidor.'; -$lang['export_to_ldif'] = 'Exportar archivo LDIF'; -$lang['export_to_ldif_tooltip'] = 'Guardar archivo LDIF de este objeto'; -$lang['export_subtree_to_ldif_tooltip'] = 'Guardar archivo LDIF de este objeto i todos sus objetos hijos'; -$lang['export_subtree_to_ldif'] = 'Exportar archivo LDIF de sub-estructura'; -$lang['export_mac'] = 'Avance de línea de Macintosh'; -$lang['export_win'] = 'Avance de línea de Windows'; -$lang['export_unix'] = 'Avance de línea de Unix'; -$lang['create_a_child_entry'] = 'Crear objeto como hijo'; -$lang['add_a_jpeg_photo'] = 'Agregar jpegPhoto'; +$lang['copy_this_entry_tooltip'] = 'Copiar este objeto en otro sitio: un nuevo DN u otro servidor'; +$lang['export'] = 'Exportar'; +$lang['export_lcase'] = 'exportar'; +$lang['export_tooltip'] = 'Exportar este objeto'; +$lang['export_subtree_tooltip'] = 'Exportar este objeto y todos sus hijos'; +$lang['export_subtree'] = 'Exportar subárbol'; +$lang['create_a_child_entry'] = 'Crear un objeto hijo'; $lang['rename_entry'] = 'Renombrar objeto'; $lang['rename'] = 'Renombrar'; -$lang['add'] = 'Agregar'; +$lang['add'] = 'Añadir'; $lang['view'] = 'Ver'; -$lang['add_new_attribute'] = 'Agregar nuevo atributo'; -$lang['add_new_attribute_tooltip'] = 'Agregar nuevo atributo/valor a este objeto'; -$lang['internal_attributes'] = 'Atributos Internos'; -$lang['hide_internal_attrs'] = 'ocultar los atributos internos'; -$lang['show_internal_attrs'] = 'mostrar els atributos internos'; -$lang['internal_attrs_tooltip'] = 'Los atributos fijos automaticamente para el servidor'; -$lang['entry_attributes'] = 'Atributos del objeto'; -$lang['attr_name_tooltip'] = 'Haz click para ver la definicion del esquema para tipos de atributo \'%s\''; -$lang['click_to_display'] = 'Haz click para mostrar'; -$lang['hidden'] = 'ocultado'; +$lang['view_one_child'] = 'Ver 1 hijo'; +$lang['view_children'] = 'Ver %s hijos'; +$lang['add_new_attribute'] = 'Añadir atributo'; +$lang['add_new_objectclass'] = 'Añadir ObjectClass'; +$lang['hide_internal_attrs'] = 'Ocultar atributos internos'; +$lang['show_internal_attrs'] = 'Mostrar atributos internos'; +$lang['attr_name_tooltip'] = 'Haga click para ver el esquema del atributo de tipo \'%s\''; $lang['none'] = 'ninguno'; -$lang['save_changes'] = 'Guardar los cambios'; -$lang['add_value'] = 'agregar valor'; -$lang['add_value_tooltip'] = 'Agregar valor adicional a este atributo'; +$lang['no_internal_attributes'] = 'No hay atributos internos'; +$lang['no_attributes'] = 'Este objeto no tiene atributos'; +$lang['save_changes'] = 'Guardar cambios'; +$lang['add_value'] = 'añadir valor'; +$lang['add_value_tooltip'] = 'Añadir un valor al atributo \'%s\''; $lang['refresh_entry'] = 'Refrescar'; $lang['refresh_this_entry'] = 'Refrescar este objeto'; -$lang['delete_hint'] = 'Pista: Para borrar un atributo, vacía el formulario de texto y haz click en Guardar.'; -$lang['attr_schema_hint'] = 'Pista: Para ver el esquema de un atributo, haz click en el nombre del atributo.'; -$lang['attrs_modified'] = 'Algunos atributos (%s) fueron modificados y estan remarcados más abajo.'; -$lang['attr_modified'] = 'Un atributo (%s) fué modificado y está remarcado más abajo.'; -$lang['viewing_read_only'] = 'Mostrando el objeto en modo de no alterar.'; -$lang['change_entry_rdn'] = 'Modificar el RDN de este objeto'; -$lang['no_new_attrs_available'] = 'No hay atributos nuevos disponibles para este objeto'; +$lang['delete_hint'] = 'Nota: para borrar un atributo, borre su atributo y haga click en guardar.'; +$lang['attr_schema_hint'] = 'Nota: Para ver el esquema de un atributo, haga click en su nombre.'; +$lang['attrs_modified'] = 'Se han modificado algunos atributos (%s) que se encuentran destacados mas abajo.'; +$lang['attr_modified'] = 'Se ha modificado algún atributo (%s) que se encuentra destacado más abajo.'; +$lang['viewing_read_only'] = 'Nota: Modo de sólo lectura.'; +$lang['no_new_attrs_available'] = 'no hay nuevos atributos en este objeto'; +$lang['no_new_binary_attrs_available'] = 'no hay nuevos atributos binarios en este objeto'; $lang['binary_value'] = 'Valor binario'; -$lang['add_new_binary_attr'] = 'Agregar valor binario'; -$lang['add_new_binary_attr_tooltip'] = 'Agregar atributo/valor binario de un archivo'; -$lang['alias_for'] = '%s es sinónimo para %s'; -$lang['download_value'] = 'Descargar valor'; -$lang['delete_attribute'] = 'Borrar atributo'; -$lang['true'] = 'verdad'; +$lang['add_new_binary_attr'] = 'Añadir atributo binario'; +$lang['alias_for'] = 'Nota: \'%s\' es un alias de \'%s\''; +$lang['required_for'] = 'Atributo requerido para la(s) clase(s) de objeto %s'; +$lang['download_value'] = 'descargar valor'; +$lang['delete_attribute'] = 'borrar atributo'; +$lang['true'] = 'verdadero'; $lang['false'] = 'falso'; -$lang['none_remove_value'] = 'ningo, borrar valor'; -$lang['really_delete_attribute'] = 'Borrar realmente el atributo?'; +$lang['none_remove_value'] = 'ninguno, borrar valor'; +$lang['really_delete_attribute'] = '¿Borrar realmente el atributo'; +$lang['add_new_value'] = 'Añadir valor'; // Schema browser -$lang['the_following_objectclasses'] = 'Los siguientes ObjectClass están presentes en este servidor LDAP.'; -$lang['the_following_attributes'] = 'Los siguientes attributeTypes están presentes en este servidor LDAP.'; -$lang['the_following_matching'] = 'Los siguientes matching rules están presentes en este servidor LDAP.'; -$lang['the_following_syntaxes'] = 'Los siguientes sintaxis están presentes en este servidor LDAP.'; -$lang['jump_to_objectclass'] = 'Saltar a una ObjectClass'; -$lang['jump_to_attr'] = 'Saltar a un atributo'; -$lang['schema_for_server'] = 'Esquema del servidor '; -$lang['required_attrs'] = 'Atributos Requeridos (MUST)'; -$lang['optional_attrs'] = 'Atributos Opcionales (MAY)'; +$lang['the_following_objectclasses'] = 'El servidor LDAP soporta las siguientes clases de objeto:'; +$lang['the_following_attributes'] = 'El servidor LDAP soporta los siguientes tipos de atributo:'; +$lang['the_following_matching'] = 'El servidor LDAP soporta las siguientes reglas de coincidencia:'; +$lang['the_following_syntaxes'] = 'El servidor LDAP soporta las siguientes sintaxis:'; +$lang['schema_retrieve_error_1']='El servidor LDAP no soporta el protocolo LDAP en su totalidad.'; +$lang['schema_retrieve_error_2']='Su versión de PHP no realiza la petición correctamente.'; +$lang['schema_retrieve_error_3']='O el phpLDAPadmin no sabe como obtener el esquema del servidor.'; +$lang['jump_to_objectclass'] = 'Ir a la clase de objeto'; +$lang['view_schema_for_oclass'] = 'Ver la descripción del esquema para esta clase de objeto.'; +$lang['jump_to_attr'] = 'Ir al tipo de atributo'; +$lang['jump_to_matching_rule'] = 'Ir a la regla de coincidencia'; +$lang['schema_for_server'] = 'Esquema del servidor'; +$lang['required_attrs'] = 'Atributos requeridos'; +$lang['required'] = 'requerido'; +$lang['optional_attrs'] = 'Atributos opcionales'; +$lang['optional_binary_attrs'] = 'Atributos binarios opcionales'; $lang['OID'] = 'OID'; +$lang['aliases']='Alias'; $lang['desc'] = 'Descripción'; -$lang['name'] = 'Nom'; -$lang['is_obsolete'] = 'Esta ObjectClass es obsoleta'; -$lang['inherits'] = 'Hereda'; -$lang['jump_to_this_oclass'] = 'Saltar a esta ObjectClass'; -$lang['matching_rule_oid'] = 'OID de Matching Rule'; -$lang['syntax_oid'] = 'OID de Sintaxi'; -$lang['not_applicable'] = 'no es aplicable'; -$lang['not_specified'] = 'no especificada'; +$lang['no_description']='sin descripción'; +$lang['name'] = 'Nombre'; +$lang['equality']='Igualdad'; +$lang['is_obsolete'] = 'Esta clase de objeto es obsoleta.'; +$lang['inherits'] = 'Hereda de'; +$lang['inherited_from'] = 'Heredado de'; +$lang['parent_to'] = 'Padre de'; +$lang['jump_to_this_oclass'] = 'Ir a la definición de esta clase de objeto'; +$lang['matching_rule_oid'] = 'OID de la regla de coincidencia'; +$lang['syntax_oid'] = 'OID de sintaxis'; +$lang['not_applicable'] = 'no aplicable'; +$lang['not_specified'] = 'no especificado'; +$lang['character'] = 'carácter'; +$lang['characters'] = 'caracteres'; +$lang['used_by_objectclasses'] = 'Usado por la clase de objeto'; +$lang['used_by_attributes'] = 'Usado por los atributos'; +$lang['maximum_length'] = 'Longitud máxima'; +$lang['attribute_types']='Tipos de atributo'; +$lang['syntaxes'] = 'Sintaxis'; +$lang['matchingrules'] = 'Reglas de coincidencia'; +$lang['oid'] = 'OID'; +$lang['obsolete'] = 'Obsoleto'; +$lang['ordering'] = 'Ordenación'; +$lang['substring_rule'] = 'Regla de subcadena'; +$lang['single_valued'] = 'Univaludado'; +$lang['collective'] = 'Colectivo'; +$lang['user_modification'] = 'Modificado por el usuario'; +$lang['usage'] = 'Uso'; +$lang['could_not_retrieve_schema_from'] = 'No se ha podido obtener el esquema de'; +$lang['type'] = 'Tipo'; +$lang['no_such_schema_item'] = 'No hay tal ítem en el esquema: "%s"'; // Deleting entries -$lang['entry_deleted_successfully'] = 'Entrada \'%s\' borrada correctamente.'; -$lang['you_must_specify_a_dn'] = 'Tienes que especificar un DN'; -$lang['could_not_delete_entry'] = 'No he podido borrar la entrada: %s'; +$lang['entry_deleted_successfully'] = 'Objeto %s borrado correctamente.'; +$lang['you_must_specify_a_dn'] = 'Debe especificar un DN'; +$lang['could_not_delete_entry'] = 'No se ha podido borrar el objeto %s'; +$lang['no_such_entry'] = 'No hay tal objeto %s'; +$lang['delete_dn'] = 'Borrar %s'; +$lang['permanently_delete_children'] = '¿Borrar también todos los hijos?'; +$lang['entry_is_root_sub_tree'] = 'Este objeto es la raíz de un subárbol que contiene %s objetos.'; +$lang['view_entries'] = 'ver objetos'; +$lang['confirm_recursive_delete'] = 'phpLDAPadmin puede borrar recursivamente este objeto y sus %s hijos. Vea más abajo la lista de objetos que se borrarán ahora. ¿Todavía quiere hacerlo?'; +$lang['confirm_recursive_delete_note'] = 'Nota: es potencialmente peligroso y debe hacerlo a su cuenta y riesgo. Esta operación NO puede deshacerse. Tome en consideración alias, referencias y otras cosas que puedan causar problemas.'; +$lang['delete_all_x_objects'] = 'Borrar los %s objetos'; +$lang['recursive_delete_progress'] = 'Progreso de la borración recursiva'; +$lang['entry_and_sub_tree_deleted_successfully'] = 'Objeto %s y su subárbol borrado correctamente.'; +$lang['failed_to_delete_entry'] = 'Error al borrar el objeto %s'; +$lang['list_of_entries_to_be_deleted'] = 'Lista de objetos a borrar:'; +$lang['sure_permanent_delete_object']='¿Está seguro de querer borrar este objeto?'; +$lang['dn'] = 'DN'; + +// Deleting attributes +$lang['attr_is_read_only'] = 'El atributo "%s" está marcado como de sólo lectura en la configuración de phpLDAPadmin.'; +$lang['no_attr_specified'] = 'No se ha especificado ningún nombre de atributo.'; +$lang['no_dn_specified'] = 'No se ha especificado ningún DN'; + +// Adding attributes +$lang['left_attr_blank'] = 'Ha dejado en blanco el valor del atributo. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['failed_to_add_attr'] = 'Error al añadir atributo.'; +$lang['file_empty'] = 'El fichero que ha escogido no existe o está vacío. Por favor vuelva atrás e inténtelo de nuevo.'; +$lang['invalid_file'] = 'Error de seguridad: El fichero que está enviando puede ser malicioso.'; +$lang['warning_file_uploads_disabled'] = 'Su configuración del PHP ha desactivado la recepción de ficheros. Por favor revise php.ini antes de continuar.'; +$lang['uploaded_file_too_big'] = 'El fichero que está enviando es demasiado grande. Por favor revise el ajuste "upload_max_size" en php.ini.'; +$lang['uploaded_file_partial'] = 'El fichero que ha seleccionado sólo se ha recibido parcialmente debido a un error de red.'; +$lang['max_file_size'] = 'Tamaño máximo de fichero: %s'; + +// Updating values +$lang['modification_successful'] = '¡Modificación realizada correctamente!'; +$lang['change_password_new_login'] = 'Como ha cambiado su contraseña, debe conectarse de nuevo empleando la nueva.'; // Adding objectClass form $lang['new_required_attrs'] = 'Nuevos atributos requeridos'; -$lang['requires_to_add'] = 'Esta acción exige que se agreguen'; +$lang['requires_to_add'] = 'Esta acción requiere que añada'; $lang['new_attributes'] = 'nuevos atributos'; -$lang['new_required_attrs_instructions'] = 'Instrucciones: Para agregar esta ObjectClass a este objeto, se tiene que especificar'; -$lang['that_this_oclass_requires'] = 'que este ObjectClass requiere. Se puede hacer con este formulario.'; -$lang['add_oclass_and_attrs'] = 'Agregar ObjectClass y Atributos'; +$lang['new_required_attrs_instructions'] = 'Instrucciones: Para poder añadir esta clase a este objeto, debe especificar'; +$lang['that_this_oclass_requires'] = 'que esta clase requiere. Puede hacerlo en este formulario.'; +$lang['add_oclass_and_attrs'] = 'Añadir clase de objeto y atributos'; +$lang['objectclasses'] = 'Clases de objeto'; // General -$lang['chooser_link_tooltip'] = 'Haz click para seleccionar un objeto graficamente'; -$lang['no_updates_in_read_only_mode'] = 'No se puede modificar el objeto si el servidor está operando en modo inalterable.'; -$lang['bad_server_id'] = 'El identificador de servidor está mal'; -$lang['not_enough_login_info'] = 'No tengo suficiente información para conectar al servidor. Por favor configura correctamente el archivo config.php'; -$lang['could_not_connect'] = 'No se ha podido conectar al servidor LDAP'; -$lang['could_not_perform_ldap_mod_add'] = 'No se ha podido ejecutar la operación del ldap_mod_add.'; -$lang['bad_server_id_underline'] = 'El identificador del servidor está mal: '; -$lang['success'] = 'Exito'; +$lang['chooser_link_tooltip'] = 'Haga click en el diálogo emergente para seleccionar un DN de forma gráfica'; +$lang['no_updates_in_read_only_mode'] = 'No puede realizar cambios cuando el servidor está funcionando en modo de sólo lectura'; +$lang['bad_server_id'] = 'Identificador de servidor no válido'; +$lang['not_enough_login_info'] = 'No hay información suficiente para conectar con el servidor. Por favor, revise su configuración.'; +$lang['could_not_connect'] = 'No se ha podido conectar con el servidor LDAP.'; +$lang['could_not_connect_to_host_on_port'] = 'No se ha podido conectar con "%s" en el puerto "%s"'; +$lang['could_not_perform_ldap_mod_add'] = 'No se ha podido realizar la operación "ldap_mod_add".'; +$lang['bad_server_id_underline'] = 'Identificador de servidor no válido: '; +$lang['success'] = 'Éxito'; +$lang['home'] = 'Inicio'; +$lang['help'] = 'Ayuda'; +$lang['success'] = 'Éxito'; $lang['server_colon_pare'] = 'Servidor: '; -$lang['look_in'] = 'Buscando a: '; -$lang['missing_server_id_in_query_string'] = 'No está presente el identificador del servidor en la URL'; -$lang['missing_dn_in_query_string'] = 'No está presente el DN en la URL'; -$lang['back_up_p'] = 'Volver a...'; -$lang['no_entries'] = 'no hay entradas'; -$lang['not_logged_in'] = 'No estás autenticado'; -$lang['could_not_det_base_dn'] = 'No he podido determinar la base DN'; +$lang['look_in'] = 'Buscando en: '; +$lang['missing_server_id_in_query_string'] = '¡No se ha especificado ningún servidor en la petición!'; +$lang['missing_dn_in_query_string'] = '¡No se ha especificado ningún DN en la petición!'; +$lang['back_up_p'] = 'Volver'; +$lang['no_entries'] = 'no hay objetos'; +$lang['not_logged_in'] = 'No está conectado'; +$lang['could_not_det_base_dn'] = 'No se puede determinar el DN base'; +$lang['please_report_this_as_a_bug']='Por favor informe de este error.'; +$lang['reasons_for_error']='Esto puede suceder por varias razones, las más probables son:'; +$lang['yes']='Sí'; +$lang['no']='No'; +$lang['go']='Ir'; +$lang['delete']='Borrar'; +$lang['back']='Atrás'; +$lang['object']='objeto'; +$lang['delete_all']='Borrar todo'; +$lang['url_bug_report']='https://sourceforge.net/tracker/?func=add&group_id=61828&atid=498546'; +$lang['hint'] = 'nota'; +$lang['bug'] = 'error'; +$lang['warning'] = 'aviso'; +$lang['light'] = 'bombilla'; // the word 'light' from 'light bulb' +$lang['proceed_gt'] = 'Proceder >>'; // Add value form -$lang['add_new'] = 'Agregar'; -$lang['value_to'] = 'valor a'; -$lang['server'] = 'Servidor'; +$lang['add_new'] = 'Añadir'; +$lang['value_to'] = 'valor de'; $lang['distinguished_name'] = 'Nombre distinguido'; -$lang['current_list_of'] = 'La lista actual de'; -$lang['values_for_attribute'] = 'valores para el atributo'; -$lang['inappropriate_matching_note'] = 'Nota: Sino has configurado una regla \'EQUALITY\' en el servidor LDAP, recibirás un error \'inappropriate matching\''; -$lang['enter_value_to_add'] = 'Proveer el valor para agregar: '; -$lang['new_required_attrs_note'] = 'Nota: Es posible que se requiera agregar nuevos atributos para satisfacer los requisitos de esta ObjectClass'; -$lang['syntax'] = 'Sintaxi'; +$lang['current_list_of'] = 'Lista actual de'; +$lang['values_for_attribute'] = 'valores del atributo'; +$lang['inappropriate_matching_note'] = 'Nota: Si no ha creado una regla de igualdad en el servidor LDAP para este atributo, obtendrá un error de coincidencia inapropiada ("inappropriate matching").'; +$lang['enter_value_to_add'] = 'Introduzca el valor a añadir:'; +$lang['new_required_attrs_note'] = 'Nota: puede que tenga que introducir nuevos atributos que esta clase de objeto requiera'; +$lang['syntax'] = 'Sintaxis'; //copy.php -$lang['copy_server_read_only'] = 'No se pueden realizar las modificaciones si el servidor está operando en modo inalterable'; -$lang['copy_dest_dn_blank'] = 'No se ha rellenado el formulario de DN.'; -$lang['copy_dest_already_exists'] = 'La entrada de destino (%s) encara existe.'; -$lang['copy_dest_container_does_not_exist'] = 'El contenedor de destino (%s) no existe.'; -$lang['copy_source_dest_dn_same'] = 'El DN de la fuente y el DN de destino son los mismos.'; +$lang['copy_server_read_only'] = 'No puede realizar modificaciones cuando el servidor está en modo de sólo lectura'; +$lang['copy_dest_dn_blank'] = 'Ha dejado el campo DN en blanco.'; +$lang['copy_dest_already_exists'] = 'El objeto destino (%s) ya existe.'; +$lang['copy_dest_container_does_not_exist'] = 'El contenedor destino (%s) no existe.'; +$lang['copy_source_dest_dn_same'] = 'El DN origen y destino son iguales.'; $lang['copy_copying'] = 'Copiando '; -$lang['copy_recursive_copy_progress'] = 'El progreso de la copia recurrente'; -$lang['copy_building_snapshot'] = 'Construyendo la \'foto\' del arbol para copiar... '; -$lang['copy_successful_like_to'] = 'Exito! Deseas '; -$lang['copy_view_new_entry'] = 'Ver el nuevo objeto?'; -$lang['copy_failed'] = 'Error al copiar DN: '; +$lang['copy_recursive_copy_progress'] = 'Progreso de la copia recursiva'; +$lang['copy_building_snapshot'] = 'Creando imagen del árbol a copiar... '; +$lang['copy_successful_like_to'] = '¡Copia correcta! ¿Le gustaría '; +$lang['copy_view_new_entry'] = 'ver el nuevo objeto'; +$lang['copy_failed'] = 'Error al copiar el DN: '; //edit.php -$lang['missing_template_file'] = 'Error: falta la plantilla, '; -$lang['using_default'] = 'Usando el archivo por defecto.'; +$lang['missing_template_file'] = 'Aviso: falta el fichero de plantilla, '; +$lang['using_default'] = 'usando la plantilla por defecto.'; +$lang['template'] = 'Plantilla'; +$lang['must_choose_template'] = 'Debes escoger una plantilla'; +$lang['invalid_template'] = '%s no es una plantilla válida'; +$lang['using_template'] = 'usando plantilla'; +$lang['go_to_dn'] = 'Ir a %s'; +$lang['structural_object_class_cannot_remove'] = 'Esta es una clase de objeto estructural y no se puede eliminar.'; +$lang['structural'] = 'estructural'; //copy_form.php $lang['copyf_title_copy'] = 'Copiar '; $lang['copyf_to_new_object'] = 'a un objeto nuevo'; -$lang['copyf_dest_dn'] = 'DN de destino'; -$lang['copyf_dest_dn_tooltip'] = 'El DN entero de la nueva entrada a ser creada quan se copie la entrada fuente'; -$lang['copyf_dest_server'] = 'Servidor de destino'; -$lang['copyf_note'] = 'Nota: Copiar entre dos servidores funciona solamente si no hay violaciones del esquema.'; -$lang['copyf_recursive_copy'] = 'Borrar todos los hijos recurentemente también?'; +$lang['copyf_dest_dn'] = 'DN destino'; +$lang['copyf_dest_dn_tooltip'] = 'El DN completo del objeto a crear'; +$lang['copyf_dest_server'] = 'Servidor destino'; +$lang['copyf_note'] = 'Nota: Sólo se puede copiar entre servidores diferentes cuando no hay violaciones de esquema'; +$lang['copyf_recursive_copy'] = 'También copiar recursivamente todos los hijos de este objeto.'; +$lang['recursive_copy'] = 'Copia recursiva'; +$lang['filter'] = 'Filtro'; +$lang['search_filter'] = 'Filtro de búsqueda'; +$lang['filter_tooltip'] = 'Cuando se realice una copia recursiva, copiar sólo los objetos que superen el filtrado'; //create.php -$lang['create_required_attribute'] = 'Te has dejado el valor en blanco del atributo requerido %s.'; -$lang['create_redirecting'] = 'Redirigiendo'; -$lang['create_here'] = 'aquí'; -$lang['create_could_not_add'] = 'No he podido agregar el objeto al servidor LDAP.'; +$lang['create_required_attribute'] = 'Ha dejado el valor del atributo requerido (%s) en blanco.'; +$lang['redirecting'] = 'Redirigiendo...'; +$lang['here'] = 'aquí'; +$lang['create_could_not_add'] = 'No se ha podido añadir el objeto al servidor LDAP.'; //create_form.php -$lang['createf_create_object'] = 'Crear Objeto'; -$lang['createf_choose_temp'] = 'Escoge una plantilla'; -$lang['createf_select_temp'] = 'Selecciona una plantilla para al proceso de creación'; -$lang['createf_proceed'] = 'Proceder'; +$lang['createf_create_object'] = 'Crear objeto'; +$lang['createf_choose_temp'] = 'Escoja una plantilla'; +$lang['createf_select_temp'] = 'Seleccione una plantilla para el proceso de creación'; +$lang['save_as_file'] = 'Guardar como fichero'; +$lang['rdn_field_blank'] = 'Ha dejado el campo RDN en blanco.'; +$lang['container_does_not_exist'] = 'El contenedor que ha especificado (%s) no existe. Por favor inténtelo de nuevo.'; +$lang['no_objectclasses_selected'] = 'No ha seleccionado ninguna clase para este objeto. Por favor, vuelva atrás y hágalo ahora.'; +$lang['hint_structural_oclass'] = 'Nota: Debe escoger al menos una clase de objeto estructural'; //creation_template.php -$lang['ctemplate_on_server'] = 'Al servidor'; -$lang['ctemplate_no_template'] = 'No se ha especificado ninguna plantilla en las variables del POST.'; -$lang['ctemplate_config_handler'] = 'Tu configuración especifica un manejador de'; -$lang['ctemplate_handler_does_not_exist'] = 'para esta plantilla. Pero este manejador no existe en el directorio \'templates/creation\'.'; +$lang['ctemplate_on_server'] = 'En el servidor'; +$lang['ctemplate_no_template'] = 'No se ha especificado ninguna plantilla en las variables POST.'; +$lang['template_not_readable'] = 'Su configuración especifica un fichero "%s" para esta plantilla pero dicho fichero no se puede leer debido a que sus permisos son demasiado restrictivos.'; +$lang['template_does_not_exist'] = 'Su configuración especifica un fichero "%s" para esta plantilla pero dicho fichero no existe en el directorio templates/creation.'; +$lang['create_step1'] = 'Paso 1 de 2: Nombre y clase(s) de objeto'; +$lang['create_step2'] = 'Paso 2 de 2: Especifique attributos y valores'; +$lang['relative_distinguished_name'] = 'Nombre Distinguido Relativo (RDN)'; +$lang['rdn'] = 'RDN'; +$lang['rdn_example'] = '(ejemplo: cn=nuevaPersona)'; +$lang['container'] = 'Contenedor'; // search.php -$lang['you_have_not_logged_into_server'] = 'Aún no te has autenticado en ell servidor seleccionado, no puedes hacer ninguna búsqueda.'; -$lang['click_to_go_to_login_form'] = 'Hac click aquí para ir al formulario de autenticación'; -$lang['unrecognized_criteria_option'] = 'Opcion de criterio desconocida: '; -$lang['if_you_want_to_add_criteria'] = 'Si quieres agregar tu propio criterio en la lista. Estate seguro de editar search.php para manejarlo. Saliendo.'; -$lang['entries_found'] = 'Entrades encontradas: '; -$lang['filter_performed'] = 'Filtro realitzado: '; -$lang['search_duration'] = 'Búsqueda realitzada para phpLDAPadmin a'; +$lang['you_have_not_logged_into_server'] = 'Todavía no ha conectado con el servidor, así que no puede realizar búsquedas.'; +$lang['click_to_go_to_login_form'] = 'Pulse aquí para ir al formulario de conexión'; +$lang['unrecognized_criteria_option'] = 'Criterio no reconocido: '; +$lang['if_you_want_to_add_criteria'] = 'Si quiere puede añadir su propios criterios a la lista. Asegúrese de editar search.php para manejarlos. Saliendo...'; +$lang['entries_found'] = 'Objetos encontrados: '; +$lang['filter_performed'] = 'Filtrado realizado: '; +$lang['search_duration'] = 'Búsqueda realizada por phpLDAPadmin en'; $lang['seconds'] = 'segundos'; // search_form_advanced.php -$lang['scope_in_which_to_search'] = 'El alcance en el que buscar'; -$lang['scope_sub'] = 'Sub (todo el sub-arbol)'; -$lang['scope_one'] = 'Uno (un nivel por debajo de la base)'; -$lang['scope_base'] = 'Base (solo base dn)'; -$lang['standard_ldap_search_filter'] = 'Filtro de búsqueda estándar de LDAP. Ejemplo: (&(sn=Smith)(givenname=David))'; +$lang['scope_in_which_to_search'] = 'Ãmbito de búsqueda'; +$lang['scope_sub'] = 'Sub (subárbol completo)'; +$lang['scope_one'] = 'One (un nivel bajo la base)'; +$lang['scope_base'] = 'Base (sólo la base)'; +$lang['standard_ldap_search_filter'] = 'Filtro de búsqueda LDAP estándar. Ejemplo: (&(sn=Picapiedra)(givenname=Pedro))'; $lang['search_filter'] = 'Filtro de búsqueda'; -$lang['list_of_attrs_to_display_in_results'] = 'Una lista de atributos para mostrar los resultados (separados por comas)'; +$lang['list_of_attrs_to_display_in_results'] = 'Lista de atributos para mostrar en los resultados (separados por comas)'; $lang['show_attributes'] = 'Mostrar atributos'; // search_form_simple.php -$lang['search_for_entries_whose'] = 'Buscar entradas las cuales:'; -$lang['equals'] = 'sea igual'; -$lang['starts with'] = 'comience con'; +$lang['search_for_entries_whose'] = 'Buscar entradas en las que'; +$lang['equals'] = 'sea igual a'; +$lang['starts with'] = 'comience por'; $lang['contains'] = 'contenga'; -$lang['ends with'] = 'termine con'; +$lang['ends with'] = 'acabe en'; $lang['sounds like'] = 'suene como'; -$lang['predefined_search_str'] = 'o seleccione uno de esta lista'; // server_info.php -$lang['could_not_fetch_server_info'] = 'No se ha podido sacar información LDAP del servidor'; -$lang['server_info_for'] = 'Información del servidor para: '; -$lang['server_reports_following'] = 'El servidor muestra la siguiente información sobre el mismo'; -$lang['nothing_to_report'] = 'Este servidor no tiene nada a mostrar.'; +$lang['could_not_fetch_server_info'] = 'No se ha podido obtener ninguna información del servidor LDAP. Esto puede deberse a este error es su versión de PHP o quizás su servidor LDAP posee controles de acceso que privan a los clientes de acceso al RootDSE.'; +$lang['server_info_for'] = 'Información sobre el servidor: '; +$lang['server_reports_following'] = 'El servidor LDAP envía la siguiente información:'; +$lang['nothing_to_report'] = 'Este servidor no tiene nada sobre lo que informar.'; //update.php -$lang['update_array_malformed'] = 'el update_array está mal formado. Esto podría ser un error del phpLDAPadmin. Por favor reportalo.'; -$lang['could_not_perform_ldap_modify'] = 'No he podido ejecutar la operación ldap_modify.'; +$lang['update_array_malformed'] = 'El array update_array no está bien formado. Esto puede indicar un error de phpLDAPadmin. Por favor, informe de ello.'; +$lang['could_not_perform_ldap_modify'] = 'No se ha podido realizar la operación "ldap_modify".'; // update_confirm.php -$lang['do_you_want_to_make_these_changes'] = 'Quieres hacer estos cambios?'; +$lang['do_you_want_to_make_these_changes'] = '¿Quiere realizar estos cambios?'; $lang['attribute'] = 'Atributo'; -$lang['old_value'] = 'Valor viejo'; -$lang['new_value'] = 'Valor nuevo'; +$lang['old_value'] = 'Valor anterior'; +$lang['new_value'] = 'Nuevo valor'; $lang['attr_deleted'] = '[atributo borrado]'; $lang['commit'] = 'Cometer'; $lang['cancel'] = 'Cancelar'; -$lang['you_made_no_changes'] = 'No has hecho ningún cambio'; +$lang['you_made_no_changes'] = 'No ha realizado cambios'; $lang['go_back'] = 'Volver atrás'; // welcome.php -$lang['welcome_note'] = 'Usa el menú de la izquierda para navegar'; -$lang['credits'] = "Créditos"; -$lang['changelog'] = "Histórico de cambios"; -$lang['documentation'] = "Documentación"; +$lang['welcome_note'] = 'Use el menú de la izquierda para navegar'; +$lang['credits'] = 'Creditos'; +$lang['changelog'] = 'Lista de cambios'; +$lang['donate'] = 'Donar'; +$lang['pla_logo'] = 'logotipo de phpLDAPadmin'; +// Donate.php +$lang['donation_instructions'] = 'Para donar fondos al proyecto phpLDAPadmin, use uno de los botones de abajo.'; +$lang['donate_amount'] = 'Donar %s'; + +$lang['purge_cache'] = 'Borrar cachés'; +$lang['no_cache_to_purge'] = 'No hay que borrar ningún caché.'; +$lang['done_purging_caches'] = 'Se han borrado %s bytes de caché.'; +$lang['purge_cache_tooltip'] = 'Se han borrado todos los datos en el caché de phpLDAPadmin, incluyendo los esquemas del servidor.'; // view_jpeg_photo.php -$lang['unsafe_file_name'] = 'Nombre de archivo inseguro: '; -$lang['no_such_file'] = 'Archivo inexistente: '; +$lang['unsafe_file_name'] = 'Nombre de fichero no seguro: '; +$lang['no_such_file'] = 'No hay tal fichero: '; //function.php -$lang['auto_update_not_setup'] = 'Has activado los auto_uid_numbers para %s en tu configuración, - pero no has especificado el auto_uid_number_mechanism. Por favor soluciona - este problema.'; -$lang['uidpool_not_set'] = 'Has especificado el auto_uid_number_mechanism como uidpool - en tu configuración para el servidor %s, pero no has especificado el - audo_uid_number_uid_pool_dn. Por favor especificalo antes de proceder.'; -$lang['uidpool_not_exist'] = 'Parece ser que el uidPool que has especificado en tu configuración (%s) +$lang['auto_update_not_setup'] = 'Ha activado "auto_uid_numbers" para %s en su configuración, + pero no ha especificado el mecanismo "auto_uid_number_mechanism". Por favor, corrija este problema'; +$lang['uidpool_not_set'] = 'Ha especificado el mecanismo "auto_uid_number_mechanism" como "uidpool" + en su configuración para el servidor %s, pero no ha especificado + "audo_uid_number_uid_pool_dn". Por favor, verifiquelo antes de continuar.'; +$lang['uidpool_not_exist'] = 'Parece ser que el "uidPool" que ha especificado en su configuración ("%s") no existe.'; -$lang['specified_uidpool'] = 'Has especificado el auto_uid_number_mechanism como search en tu - configuración para el servidor %s, pero no has especificado el - auto_uid_number_search_base. Por favor especificalo antes de proceder.'; -$lang['auto_uid_invalid_value'] = 'Has especificado un valor no válido para el auto_uid_number_mechanism (%s) - en tu configuración. Solo uidpool y search son válidos. - Por favor soluciona este problema.'; -$lang['error_auth_type_config'] = 'Error: Tienes un error en tu archivo de configuración. Los dos únicos valores aceptados para - \'auth_type\' en la sección $servers son \'config\' y \'form\'. Tu has puesto \'%s\', - el cual no está aceptado. '; -$lang['php_install_not_supports_tls'] = 'Tu instalación de PHP no soporta TLS'; -$lang['could_not_start_tls'] = 'No he podido iniciar el TLS.
      Revisa tu configuración del servidor LDAP.'; -$lang['auth_type_not_valid'] = 'Tienes un error en el archivo de configuración. auth_type de %s no es válido.'; -$lang['ldap_said'] = 'LDAP dijo: %s

      '; +$lang['specified_uidpool'] = 'Ha especificado "auto_uid_number_mechanism" como "search" en la + configuración del servidor %s, pero no ha especificado + "auto_uid_number_search_base". Por favor, especifíquelo antes de continuar.'; +$lang['auto_uid_invalid_credential'] = 'Imposible conectar con %s con sus credenciales "auto_uid". Por favor, verifique su fichero de configuración.'; +$lang['bad_auto_uid_search_base'] = 'Su configuración de phpLDAPadmin especifica "auto_uid_search_base" como no válida para el servidor %s'; +$lang['auto_uid_invalid_value'] = 'Ha especificado un valor no válido para el mecanismo "auto_uid_number_mechanism" ("%s") + en su configuración. Sólo son válidos "uidpool" y "search". Por favor, corrija este problema.'; +$lang['error_auth_type_config'] = 'Error: Tiene un error en su fichero de configurción. Los tres únicos valores para "auth_type" + en la sección $servers son \'session\', \'cookie\', y \'config\'. Usted ha introducido \'%s\', + que no está permitido. '; +$lang['unique_attrs_invalid_credential'] = 'Imposible conectarse a %s con sus credenciales unique_attr. Por favor, revise su fichero de configuración.'; +$lang['unique_attr_failed'] = 'Su intento de añadir %s (%s) a
      %s
      NO se ha permitido. Tal atributo/valor pertenece a otro objeto.

      Probablemente desee buscar tal objeto.'; +$lang['php_install_not_supports_tls'] = 'Su instalación de PHP no soporta TLS.'; +$lang['could_not_start_tls'] = 'No se ha podido iniciar TLS. Por favor, revise su configuración LDAP.'; +$lang['could_not_bind_anon'] = 'No se ha podido conectar con el servidor de forma anónima.'; +$lang['could_not_bind'] = 'No se ha podido conectar con el servidor LDAP.'; +$lang['anonymous_bind'] = 'Conexión anónima'; +$lang['bad_user_name_or_password'] = 'Nombre de usuario o contraseña incorrectos. Por favor, inténtelo de nuevo.'; +$lang['redirecting_click_if_nothing_happens'] = 'Redirigiendo... Pulse aquí si no sucede nada.'; +$lang['successfully_logged_in_to_server'] = 'Ha conectado con el servidor %s.'; +$lang['could_not_set_cookie'] = 'No se ha podido guardar la cookie.'; +$lang['ldap_said'] = 'LDAP ha dicho: %s'; $lang['ferror_error'] = 'Error'; -$lang['fbrowse'] = 'mostrar'; +$lang['fbrowse'] = 'seleccionar'; $lang['delete_photo'] = 'Borrar foto'; -$lang['install_not_support_blowfish'] = 'Tu instalación de PHP no soporta los tipos de encriptación blowfish.'; -$lang['install_no_mash'] = 'Tu instalación de PHP no tiene la funcion mhash(). No puedo hacer hash SHA.'; -$lang['jpeg_contains_errors'] = 'jpegPhoto contiene errores
      '; -$lang['ferror_number'] = 'Error número: %s (%s)

      '; -$lang['ferror_discription'] = 'Descripción: %s

      '; -$lang['ferror_number_short'] = 'Error número: %s

      '; -$lang['ferror_discription_short'] = 'Descripción: (no hay descripción)
      '; -$lang['ferror_submit_bug'] = 'Es un error del phpLDAPadmin? Si así es, por favor dínoslo.'; -$lang['ferror_unrecognized_num'] = 'Número de error desconocido: '; +$lang['install_not_support_blowfish'] = 'Su instalación de PHP no soporta encriptación blowfish.'; +$lang['install_not_support_md5crypt'] = 'Su instalación de PHP no soporta encriptación md5crypt.'; +$lang['install_no_mash'] = 'Su instalación de PHP no posee la función mhash(). No se pueden realizar hashes SHA.'; +$lang['jpeg_contains_errors'] = 'La foto jpegPhoto contiene errores
      '; +$lang['ferror_number'] = 'Error número: %s (%s)'; +$lang['ferror_discription'] = 'Descripción: %s

      '; +$lang['ferror_number_short'] = 'Error número: %s

      '; +$lang['ferror_discription_short'] = 'Descripción: (no existe descripción disponible)
      '; +$lang['ferror_submit_bug'] = '¿Es éste un error de phpLDAPadmin? Si es así, por favor informe sobre ello.'; +$lang['ferror_unrecognized_num'] = 'Número de error no reconocido: '; $lang['ferror_nonfatil_bug'] = '

      Error:%s
      + ¡Ha encontrado un error no fatal en phpLDAPadmin!
      - Has encontrado un error menor del phpLDAPadmin!
      Error:%s (%s)
      Archivo:
      Error:%s (%s)
      Fichero: %s línea %s, caller %s
      Versiones:PLA: %s, PHP: %s, SAPI: %s -
      Servidor Web:%s
      - Envía este error haciendo click aquí.

      '; -$lang['ferror_congrats_found_bug'] = 'Felicidades! Has encontrado un error en el phpLDAPadmin.

      + Servidor web:%s
      + Por favor, informe de este error pulsando aquí.

      '; +$lang['ferror_congrats_found_bug'] = '¡Felicidades! Ha encontrado un error en phpLDAPadmin.

      - + - - + + - +
      Error:%s
      Nivel:%s
      Archivo:%s
      Fichero:%s
      Línea:%s
      Caller:%s
      Versión PLA:%s
      Caller:%s
      Verisón PLA:%s
      Versión PHP:%s
      PHP SAPI:%s
      Servidor Web:%s
      Servidor web:%s

      - Por favor envía este error haciendo click abajo!'; + Por favor, informe sobre este error haciendo click más abajo!'; + //ldif_import_form -$lang['import_ldif_file_title'] = 'Importar archivo LDIF'; -$lang['select_ldif_file'] = 'Selecciona un archivo LDIF:'; -$lang['select_ldif_file_proceed'] = 'Proceder >>'; +$lang['import_ldif_file_title'] = 'Importar fichero LDIF'; +$lang['select_ldif_file'] = 'Seleccione un fichero LDIF:'; +$lang['dont_stop_on_errors'] = 'Ignorar errores'; //ldif_import $lang['add_action'] = 'Añadiendo...'; $lang['delete_action'] = 'Borrando...'; $lang['rename_action'] = 'Renombrando...'; $lang['modify_action'] = 'Modificando...'; +$lang['warning_no_ldif_version_found'] = 'No se ha encontrado versión. Asumiendo 1.'; +$lang['valid_dn_line_required'] = 'Se requiere una línea válida.'; +$lang['missing_uploaded_file'] = 'Falta el fichero enviado.'; +$lang['no_ldif_file_specified.'] = 'No se ha especificado un fichero LDIF. Por favor, inténtelo de nuevo.'; +$lang['ldif_file_empty'] = 'El fichero LDIF enviado está vacío.'; +$lang['empty'] = 'vacío'; +$lang['file'] = 'Fichero'; +$lang['number_bytes'] = '%s bytes'; -$lang['failed'] = 'fallado'; -$lang['ldif_parse_error'] = 'Error de parseado LDIF'; -$lang['ldif_could_not_add_object'] = 'No he podido añadir el objeto:'; -$lang['ldif_could_not_rename_object'] = 'No he podido renombrar el objeto:'; -$lang['ldif_could_not_delete_object'] = 'No he podido borrar el objeto:'; -$lang['ldif_could_not_modify_object'] = 'No he podido modificar el objeto:'; -$lang['ldif_line_number'] = 'Linea Número:'; -$lang['ldif_line'] = 'Linea:'; +$lang['failed'] = 'Error'; +$lang['ldif_parse_error'] = 'Error al parsear LDIF'; +$lang['ldif_could_not_add_object'] = 'No se ha podido añadir objeto:'; +$lang['ldif_could_not_rename_object'] = 'No se ha podido renombrar el objeto:'; +$lang['ldif_could_not_delete_object'] = 'No se ha podido borrar el objeto:'; +$lang['ldif_could_not_modify_object'] = 'No se ha podido modificar el objeto:'; +$lang['ldif_line_number'] = 'Número de línea:'; +$lang['ldif_line'] = 'Línea:'; + +// Exports +$lang['export_format'] = 'Formato de exportación'; +$lang['line_ends'] = 'Fin de línea'; +$lang['must_choose_export_format'] = 'Debe escoger un formato de exportación.'; +$lang['invalid_export_format'] = 'Formato de exportación no válido'; +$lang['no_exporter_found'] = 'No se ha encontrado ningún exportador válido.'; +$lang['error_performing_search'] = 'Se ha encontrado un error al realizar la búsqueda.'; +$lang['showing_results_x_through_y'] = 'Mostrando los resultados de %s a %s.'; +$lang['searching'] = 'Buscando...'; +$lang['size_limit_exceeded'] = 'Nota: se ha excedido el tiempo de búsqueda.'; +$lang['entry'] = 'Objeto'; +$lang['ldif_export_for_dn'] = 'Exportación LDIF de: %s'; +$lang['generated_on_date'] = 'Generado por phpLDAPadmin el %s'; +$lang['total_entries'] = 'Entradas totales'; +$lang['dsml_export_for_dn'] = 'Exportación DSLM de: %s'; +$lang['include_system_attrs'] = 'Incluir atributos de sistema'; +$lang['csv_spreadsheet'] = 'CSV (Hoja de cálculo)'; + +// logins +$lang['could_not_find_user'] = 'No se ha podido encontrar el usuario "%s"'; +$lang['password_blank'] = 'Ha dejado la contraseña en blanco.'; +$lang['login_cancelled'] = 'Conexión cancelada.'; +$lang['no_one_logged_in'] = 'No hay nadie conectado con el servidor.'; +$lang['could_not_logout'] = 'No se ha podido desconectar.'; +$lang['unknown_auth_type'] = 'Tipo de autentificación "auth_type" desconocido: %s'; +$lang['logged_out_successfully'] = 'Se ha desconectado del servidor %s'; +$lang['authenticate_to_server'] = 'Autentificación del servidor %s'; +$lang['warning_this_web_connection_is_unencrypted'] = 'Aviso: Esta conexión no está encriptada.'; +$lang['not_using_https'] = 'No está usando \'https\'. El navegador web enviará su información sin encriptar.'; +$lang['login_dn'] = 'Login'; +$lang['user_name'] = 'Nombre de usuario'; +$lang['password'] = 'Contraseña'; +$lang['authenticate'] = 'Entrar'; + +// Entry browser +$lang['entry_chooser_title'] = 'Selector de objetos'; + +// Index page +$lang['need_to_configure'] = 'Debe configurar phpLDAPadmin, editando el fichero \'config.php\'. Se proporciona un fichero de configuración de ejemplo en \'config.php.example\''; + +// Mass deletes +$lang['no_deletes_in_read_only'] = 'No se permiten borrados en modo de sólo lectura.'; +$lang['error_calling_mass_delete'] = 'Error al llamar a "mass_delete.php". Falta la variable POST "mass_delete".'; +$lang['mass_delete_not_array'] = 'La variable POST "mass_delete" no es un array.'; +$lang['mass_delete_not_enabled'] = 'No está activado el borrado masivo. Por favor, actívelo en config.php antes de continuar.'; +$lang['search_attrs_wrong_count'] = 'Su config.php tiene un error. El número de atributos en $search_attributes y $search_attributes_display es diferente'; +$lang['mass_deleting'] = 'Efectuando borrado masivo'; +$lang['mass_delete_progress'] = 'Borrado en progreso en el servidor "%s"'; +$lang['malformed_mass_delete_array'] = 'Array de borrado masivo mal formado.'; +$lang['no_entries_to_delete'] = 'No ha seleccionado objetos para borrar.'; +$lang['deleting_dn'] = 'Borrando %s'; +$lang['total_entries_failed'] = 'No han podido borrarse %s de %s objetos.'; +$lang['all_entries_successful'] = 'Todos los objetos han sido borrados.'; +$lang['confirm_mass_delete'] = 'Confirmar borrado masivo de %s objetos en el servidor %s'; +$lang['yes_delete'] = '¡Sí, borrar!'; + +// Renaming entries +$lang['non_leaf_nodes_cannot_be_renamed'] = 'No puede renombrar un objeto que tenga hijos'; +$lang['no_rdn_change'] = 'No ha cambiado el RDN'; +$lang['invalid_rdn'] = 'Valor RDN no válido'; +$lang['could_not_rename'] = 'No se ha podido renombrar el objeto'; + +// General errors +$lang['php5_unsupported'] = 'phpLDAPadmin no soporta todavía PHP 5. Si continúa encontrará probablemente extraños errores.'; +$lang['mismatched_search_attr_config'] = 'Su configuración tiene un error. $search_attributes debe tener el mismo número de atributos que $search_attributes_display.'; + +// Password checker +$lang['passwords_match'] = '¡Las contraseñas coinciden!'; +$lang['passwords_do_not_match'] = '¡Las contraseñas no coinciden!'; +$lang['password_checker_tool'] = 'Herramienta de comprobación de contraseñas'; +$lang['compare'] = 'Comparar'; +$lang['to'] = 'con'; + +// Templates +$lang['using'] = 'Usando la'; +$lang['template'] = 'plantilla'; +$lang['switch_to'] = 'Puede cambair a la '; +$lang['default_template'] = 'plantilla por defecto'; + +// template_config +$lang['user_account'] = 'Cuenta de Usuario (posixAccount)'; +$lang['address_book_inet'] = 'Entrada del libro de direcciones (inetOrgPerson)'; +$lang['address_book_moz'] = 'Entrada del libro de direcciones (mozillaOrgPerson)'; +$lang['kolab_user'] = 'Entrada de Usuario Kolab'; +$lang['organizational_unit'] = 'Unidad Organizativa'; +$lang['organizational_role'] = 'Rol Organizativo'; +$lang['posix_group'] = 'Grupo Posix'; +$lang['samba_machine'] = 'Ordenador con Samba NT'; +$lang['samba3_machine'] = 'Ordenador con Samba 3 NT'; +$lang['samba_user'] = 'Usuario de Samba'; +$lang['samba3_user'] = 'Usuario de Samba 3'; +$lang['samba3_group'] = 'Mapeo de Grupo de Samba 3'; +$lang['dns_entry'] = 'Entrada DNS'; +$lang['simple_sec_object'] = 'Objeto de Seguridad Simple'; +$lang['courier_mail_account'] = 'Cuenta de Correo Courier'; +$lang['courier_mail_alias'] = 'Alias de Correo Courier'; +$lang['ldap_alias'] = 'Alias de LDAP'; +$lang['sendmail_cluster'] = 'Cluster de Sendmail'; +$lang['sendmail_domain'] = 'Dominio de Sendmail'; +$lang['sendmail_alias'] = 'Alias de Sendmail'; +$lang['sendmail_virt_dom'] = 'Dominio Virtual de Sendmail'; +$lang['sendmail_virt_users'] = 'Usuarios Virtuales de Sendmail'; +$lang['sendmail_relays'] = 'Relés de Sendmail'; +$lang['custom'] = 'A medida'; +$lang['samba_domain_name'] = 'Mi Nombre de Dominio de Samba'; +$lang['administrators'] = 'Administradores'; +$lang['users'] = 'Usuarios'; +$lang['guests'] = 'Invitados'; +$lang['power_users'] = 'Usuarios Privilegiados'; +$lang['account_ops'] = 'Administradores de Cuentas'; +$lang['server_ops'] = 'Administradores de Servidor'; +$lang['print_ops'] = 'Administradores de Impresión'; +$lang['backup_ops'] = 'Administradores de Copias de Seguridad'; +$lang['replicator'] = 'Replicador'; +$lang['unable_smb_passwords'] = ' Imposible crear las contraseñas de Samba. Por favor, revise la configuración en template_config.php'; +$lang['err_smb_conf'] = 'Error: Tiene un error en su configuración de Samba.'; +$lang['err_smb_no_name_sid'] = 'Error: Necesita indicar el nombre y el sid de su dominio Samba.'; +$lang['err_smb_no_name'] = 'Error: No se ha indicado el nombre del dominio Samba.'; +$lang['err_smb_no_sid'] = 'Error: No se ha indicado el sid del dominio Samba.'; + +// Samba Account Template +$lang['samba_account'] = 'Cuenta Samba'; +$lang['samba_account_lcase'] = 'cuenta samba'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'Nueva cuenta de usuario'; +$lang['t_hint_customize'] = 'Nota: Para modificar esta plantilla, edite el fichero templates/creation/new_user_template.php'; +$lang['t_name'] = 'Nombre'; +$lang['t_first_name'] = 'Nombre propio'; +$lang['t_last_name'] = 'Apellido'; +$lang['t_first'] = 'nombre propio'; +$lang['t_last'] = 'apellido'; +$lang['t_common_name'] = 'Nombre común'; +$lang['t_user_name'] = 'Nombre de Usuario'; +$lang['t_password'] = 'Contraseña'; +$lang['t_encryption'] = 'Encriptación'; +$lang['t_login_shell'] = 'Shell de entrada'; +$lang['t_home_dir'] = 'Directorio de usuario'; +$lang['t_uid_number'] = 'Número UID'; +$lang['t_auto_det'] = '(determinado automáticamente)'; +$lang['t_group'] = 'Grupo'; +$lang['t_gid_number'] = 'Número GID'; +$lang['t_err_passwords'] = 'Sus contraseñas no coinciden. Por favor, vuelva atrás e inténtelo de nuevon.'; +$lang['t_err_field_blank'] = 'No puede dejar en blanco el %s. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_err_field_num'] = 'Sólo puede introducir valores numéricos en el campo %s. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_err_bad_container'] = 'El contenedor que ha especificado (%s) no existe. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_confirm_account_creation'] = 'Confirmar creación de cuenta'; +$lang['t_secret'] = '[secreta]'; +$lang['t_create_account'] = 'Crear cuenta'; + +// New Address Template +$lang['t_new_address'] = 'Nueva entrada en el libro de direcciones'; +$lang['t_organization'] = 'Organización'; +$lang['t_address'] = 'Dirección'; +$lang['t_city'] = 'Ciudad'; +$lang['t_postal_code'] = 'Código postal'; +$lang['t_street'] = 'Calle'; +$lang['t_work_phone'] = 'Teléfono de trabajo'; +$lang['t_fax'] = 'Fax'; +$lang['t_mobile'] = 'Móvil'; +$lang['t_email'] = 'Email'; +$lang['t_container'] = 'Contenedor'; +$lang['t_err_cn_blank'] = 'No puede dejar el campo "Nombre Común" en blanco. Por favor, vuelva atrás e inténtelo de nuevo.'; +$lang['t_confim_creation'] = 'Confirmar creación de entrada:'; +$lang['t_create_address'] = 'Crear dirección'; + +// default template +$lang['t_check_pass'] = 'Compruebe la contraseña...'; ?> + diff --git a/lang/recoded/fr.php b/lang/recoded/fr.php index 546dd2e..cc94a5e 100644 --- a/lang/recoded/fr.php +++ b/lang/recoded/fr.php @@ -11,7 +11,7 @@ * * Thank you! * - * $Header: /cvsroot/phpldapadmin/phpldapadmin/lang/recoded/fr.php,v 1.17 2004/05/29 04:08:58 uugdave Exp $ + * $Header: /cvsroot/phpldapadmin/phpldapadmin/lang/recoded/fr.php,v 1.21 2005/04/01 22:40:57 xrenard Exp $ */ /* @@ -34,6 +34,14 @@ $lang['contains'] = 'contient'; $lang['predefined_search_str'] = 'Selectionner une recherche prédéfinie'; $lang['predefined_searches'] = 'Recherches prédéfinies'; $lang['no_predefined_queries'] = 'Aucune requête n\' a été définie dans config.php.'; +$lang['export_results'] = 'exporter le resultat'; +$lang['unrecoginzed_search_result_format'] = 'Le format du résultat de la recherche est non reconnu: %s'; +$lang['format'] = 'Format'; +$lang['list'] = 'liste'; +$lang['table'] = 'table'; +$lang['bad_search_display'] = 'Le fichier config.php contient une valeur invalide pour $default_search_display: %s. Veuillez le corriger'; +$lang['page_n'] = 'Page %d'; +$lang['no_results'] = 'Aucun résultat pour cette recherche.'; // Tree browser $lang['request_new_feature'] = 'Demander une nouvelle fonctionnalité'; @@ -54,20 +62,25 @@ $lang['view_server_info'] = 'Voir les informations sur le serveur'; $lang['import_from_ldif'] = 'Importer des entrées à partir d\'un fichier LDIF'; $lang['logout_of_this_server'] = 'Se déconnecter de ce serveur'; $lang['logged_in_as'] = 'Connecté en tant que: '; +$lang['this_base_dn_is_not_valid'] = 'Ceci n\'est pas un DN valide.'; +$lang['this_base_dn_does_not_exist'] = 'Cette entrée n\'existe pas.'; $lang['read_only'] = 'Lecture seule'; +$lang['read_only_tooltip'] = 'Cet attribut a été mis en lecture seule par l\'administrateur de phpLDAPAdmin'; $lang['could_not_determine_root'] = 'La racine de l\'arborescence Ldap n\'a pu être déterminée.'; $lang['ldap_refuses_to_give_root'] = 'Il semble que le serveur LDAP a été configuré de telle sorte que la racine ne soit pas révelée.'; $lang['please_specify_in_config'] = 'Veuillez le spécifier dans le fichier config.php'; $lang['create_new_entry_in'] = 'Créer une nouvelle entrée dans'; $lang['login_link'] = 'Login...'; $lang['login'] = 'login'; - +$lang['base_entry_does_not_exist'] = 'L\'entrée racine n\'existe pas.'; +$lang['create_it'] = 'La créer?'; // Entry display $lang['delete_this_entry'] = 'Supprimer cette entrée'; $lang['delete_this_entry_tooltip'] = 'Il vous sera demandé confirmation'; $lang['copy_this_entry'] = 'Copier cette entrée'; $lang['copy_this_entry_tooltip'] = 'Copier cet objet vers un autre endroit, un nouveau DN ou un autre serveur'; $lang['export'] = 'Exporter'; +$lang['export_lcase'] = 'exporter'; $lang['export_tooltip'] = 'Sauvegarder cet objet'; $lang['export_subtree_tooltip'] = 'Sauvegarder cet objet ainsi que tous les sous-objets'; $lang['export_subtree'] = 'Exporter l\'arborescence'; @@ -84,7 +97,9 @@ $lang['hide_internal_attrs'] = 'Cacher les attributs internes'; $lang['show_internal_attrs'] = 'Montrer les attributs internes'; $lang['attr_name_tooltip'] = 'Cliquer pour voir la définition de schéma pour l\'attribut de type \'%s\''; $lang['none'] = 'aucun'; -$lang['save_changes'] = 'Sauver les modifications'; +$lang['no_internal_attributes'] = 'Aucun attributs internes.'; +$lang['no_attributes'] = 'Cette entrée n\a aucun attributs.'; +$lang['save_changes'] = 'Sauvegarder les modifications'; $lang['add_value'] = 'ajouter une valeur'; $lang['add_value_tooltip'] = 'Ajouter une valeur supplémentaire à cet attribut'; $lang['refresh_entry'] = 'Rafraichir'; @@ -99,6 +114,8 @@ $lang['no_new_binary_attrs_available'] = 'plus d\' attributs binaires disponible $lang['binary_value'] = 'Valeur de type binaire'; $lang['add_new_binary_attr'] = 'Ajouter un nouvel attribut de type binaire'; $lang['alias_for'] = 'Alias pour'; +$lang['required_for'] = 'Attribut requis par le(s) objectClass(es) %s'; +$lang['required_by_entry'] = 'Cet attribut est requis par le RDN.'; $lang['download_value'] = 'Télécharger le contenu'; $lang['delete_attribute'] = 'Supprimer l\'attribut'; $lang['true'] = 'vrai'; @@ -108,18 +125,17 @@ $lang['really_delete_attribute'] = 'Voulez-vous vraiment supprimer l\'attribut'; $lang['add_new_value'] = 'Ajouter une nouvelle valeur'; // Schema browser -$lang['the_following_objectclasses'] = 'Les classes d\'objets (objectClasses) suivantes sont supportés par ce serveur LDAP.'; -$lang['the_following_attributes'] = 'Les types d\'attributs (attributesTypes) suivants sont supportés par ce serveur LDAP.'; -$lang['the_following_matching'] = 'Les opérateurs (matching rules) suivants sont supportés par ce serveur LDAP.'; -$lang['the_following_syntaxes'] = 'Les syntaxes suivantes sont supportés par ce serveur LDAP.'; $lang['schema_retrieve_error_1']='Le serveur ne supporte pas entièrement le protocol LDAP.'; -$lang['schema_retrieve_error_2']='Votre version de PHP ne permet pas d\'exécute correctement la requête.'; -$lang['schema_retrieve_error_3']='Ou tout du moins, phpLDAPadmin ne sait pas comment récupérer le schéma pour votre serveur.'; +$lang['schema_retrieve_error_2']='Votre version de PHP ne permet pas d\'exécuter correctement la requête.'; +$lang['schema_retrieve_error_3']='phpLDAPadmin ne sait pas comment récupérer le schéma pour votre serveur.'; +$lang['schema_retrieve_error_4']='Ou tout du moins, votre serveur LDAP ne procure pas cette information.'; $lang['jump_to_objectclass'] = 'Aller à une classe d\'objet'; +$lang['view_schema_for_oclass'] = 'Voir la description du schema pour cette objectClass'; $lang['jump_to_attr'] = 'Aller à un attribut'; $lang['jump_to_matching_rule'] = 'Aller à une règle d\'égalité'; $lang['schema_for_server'] = 'Schema pour le serveur'; $lang['required_attrs'] = 'Attributs obligatoires'; +$lang['required'] = 'requis'; $lang['optional_attrs'] = 'Attributs optionnels'; $lang['optional_binary_attrs'] = 'Attributs binaires optionnels'; $lang['OID'] = 'OID'; @@ -131,6 +147,7 @@ $lang['equality']='Egalité'; $lang['is_obsolete'] = 'Cette classe d\'objet est obsolete'; $lang['inherits'] = 'hérite'; $lang['inherited_from']='hérite de'; +$lang['parent_to'] = 'Parent de'; $lang['jump_to_this_oclass'] = 'Aller à la définition de cette classe d\'objet'; $lang['matching_rule_oid'] = 'OID de l\'opérateur'; $lang['syntax_oid'] = 'OID de la syntaxe'; @@ -140,8 +157,7 @@ $lang['character']='caractère'; $lang['characters']='caractères'; $lang['used_by_objectclasses']='Utilisé par les objectClasses'; $lang['used_by_attributes']='Utilisé par les attributes'; -$lang['maximum_length']='Maximum Length'; -$lang['attributes']='Types d\'attribut'; +$lang['attribute_types']='Types d\'attribut'; $lang['syntaxes']='Syntaxes'; $lang['objectclasses']='objectClasses'; $lang['matchingrules']='Règles d\'égalité'; @@ -155,7 +171,12 @@ $lang['user_modification']='Modification Utilisateur'; $lang['usage']='Usage'; $lang['maximum_length']='Longueur maximale'; $lang['could_not_retrieve_schema_from']='Impossible de récupérer le schéma de'; +$lang['the_following_objectclasses'] = 'Les classes d\'objets (objectClasses) suivantes sont supportés par ce serveur LDAP.'; +$lang['the_following_attributes'] = 'Les types d\'attributs (attributesTypes) suivants sont supportés par ce serveur LDAP.'; +$lang['the_following_matching'] = 'Les opérateurs (matching rules) suivants sont supportés par ce serveur LDAP.'; +$lang['the_following_syntaxes'] = 'Les syntaxes suivantes sont supportés par ce serveur LDAP.'; $lang['type']='Type'; +$lang['no_such_schema_item'] = 'No such schema item: "%s"'; // Deleting entries $lang['entry_deleted_successfully'] = 'Suppression de l\'entrée \'%s\' réussie.'; @@ -182,8 +203,14 @@ $lang['no_attr_specified'] = 'Aucun nom d\'attributs spécifié.'; $lang['no_dn_specified'] = 'Aucun DN specifié'; // Adding attributes -$lang['left_attr_blank'] = 'Vous avez laisser la valeur de l\'attribut vide. Veuillez s\'il vous plaît retourner à la page précédente et recommencer.'; +$lang['left_attr_blank'] = 'Vous avez laissé la valeur de l\'attribut vide. Veuillez s\'il vous plaît retourner à la page précédente et recommencer.'; $lang['failed_to_add_attr'] = 'Echec lors de l\'ajout de l\'attribut.'; +$lang['file_empty'] = 'Le fichier choisi soit est vide soit n\'existe pas. Veuillez recommencez.'; +$lang['invalid_file'] = 'Erreur de sécurité: Le fichier uploadé peut etre dangereux.'; +$lang['warning_file_uploads_disabled'] = 'Votre configuration PHP interdit l\'upload de fichiers. Veuillez vérifier votre fichier php.ini avant de continuer.'; +$lang['uploaded_file_too_big'] = 'Le fichier à uploader est de trop grande taille. Veuillez vérifier votre fichier php.ini et particulièrement la directive upload_max_size setting'; +$lang['uploaded_file_partial'] = 'Le fichier sélectionner a été partiellement uploadé, probablement du à une erreur réseau.'; +$lang['max_file_size'] = 'Taille Maximum du fichier: %s'; // Updating values $lang['modification_successful'] = 'Modification réussie!'; @@ -201,10 +228,12 @@ $lang['add_oclass_and_attrs'] = 'Ajout d\' ObjectClass et d\'attributs'; $lang['chooser_link_tooltip'] = 'Cliquer pour choisir un entré(DN)'; $lang['no_updates_in_read_only_mode'] = 'Vous ne pouvez effectuer des mises à jour si le serveur est en lecture seule'; $lang['bad_server_id'] = 'Id de serveur invalide'; -$lang['not_enough_login_info'] = 'Informations insuffisantes pour se logguer au serveur. Veuillez, s\'il vous plaî, vérifier votre configuration.'; +$lang['not_enough_login_info'] = 'Informations insuffisantes pour se logguer au serveur. Veuillez, s\'il vous plaît, vérifier votre configuration.'; $lang['could_not_connect'] = 'Impossible de se connecter au serveur LDAP.'; $lang['could_not_connect_to_host_on_port'] = 'Impossible de se connecter à "%s" sur le port "%s"'; $lang['could_not_perform_ldap_mod_add'] = 'Echec lors de l\'opération ldap_mod_add.'; +$lang['home'] = 'Home'; +$lang['help'] = 'Aide'; $lang['bad_server_id_underline'] = 'serveur_id invalide: '; $lang['success'] = 'Succès'; $lang['server_colon_pare'] = 'Serveur: '; @@ -230,6 +259,11 @@ $lang['bug'] = 'bogue'; $lang['warning'] = 'Avertissement'; $lang['light'] = 'lumière'; // the word 'light' from 'light bulb' $lang['proceed_gt'] = 'Continuer >>'; +$lang['no_blowfish_secret'] = 'phpLDAPadmin ne peut de façon sur encrypter et décrypter les informations du fait que $blowfish_secret n\'est pas défini dans config.php. Vous devez définir $blowfish_secret avec une chaine de caractère de votre choix.'; +$lang['jpeg_dir_not_writable'] = 'Veuillez assigner à la variable $jpeg_temp_dir le nom d\'un répertoire accessible en écriture dans le fichier config.php'; +$lang['jpeg_dir_not_writable_error'] = 'Impossible d\'écrire dans le répertoire %s défini par la directive $jpeg_temp_dir. Veuillez vérifier que votre serveur web à les droits en écriture pour ce répertoire.'; +$lang['jpeg_unable_toget'] = 'Impossible de trouver la ressource jpeg du serveur LDAP pour l\'attribut %s.'; +$lang['jpeg_delete'] = 'Supprimer la photo'; // Add value form @@ -265,6 +299,8 @@ $lang['must_choose_template'] = 'Vous devez choisir un modèle'; $lang['invalid_template'] = '%s est un modèle non valide'; $lang['using_template'] = 'Utilisation du modèle'; $lang['go_to_dn'] = 'Aller à %s'; +$lang['structural_object_class_cannot_remove'] = 'Ceci est une \'objectclass\' de type structurelle et ne peut etre supprimé.'; +$lang['structural'] = 'structurelle'; @@ -280,13 +316,16 @@ $lang['copyf_recursive_copy'] = 'Copier récursivement les sous-entrées de cet $lang['recursive_copy'] = 'Copie récursive'; $lang['filter'] = 'Filtre'; $lang['filter_tooltip'] = 'Lors d\'une copie récursive, seuls les entrées correspondant à ce filtre seront copiés'; +$lang['delete_after_copy'] = 'Suppresion après copie (déplacer):'; +$lang['delete_after_copy_warn'] = 'Soyez certain que votre filtre (ci-dessus) selectionnera tous les enregistrements enfants.'; + //create.php $lang['create_required_attribute'] = 'Une valeur n\'a pas été spécifiée pour l\'attribut requis %s.'; $lang['redirecting'] = 'Redirection'; $lang['here'] = 'ici'; $lang['create_could_not_add'] = 'L\'ajout de l\'objet au serveur LDAP n\'a pu être effectuée.'; -$lang['rdn_field_blank'] = 'Vous avez laisser le champ du RDN vide.'; +$lang['rdn_field_blank'] = 'Vous avez laissé le champ du RDN vide.'; $lang['container_does_not_exist'] = 'Le containeur que vous avez spécifié (%s) n\'existe pas. Veuillez, s\'il vous plaît recommencer.'; $lang['no_objectclasses_selected'] = 'Vous n\'avez sélectionner aucun ObjectClasses pour cet objet. Veuillez s\'il vous plaît retourner à la page précédente et le faire.'; $lang['hint_structural_oclass'] = 'Note: Vous devez choisir au moins une classe d\'objet de type structural'; @@ -295,6 +334,7 @@ $lang['hint_structural_oclass'] = 'Note: Vous devez choisir au moins une classe $lang['createf_create_object'] = 'Creation d\'un objet'; $lang['createf_choose_temp'] = 'Choix d\'un modèle'; $lang['createf_select_temp'] = 'Selectionner un modèle pour la procédure de création'; +$lang['save_as_file'] = 'Sauvegarder en tant que fichier'; $lang['createf_proceed'] = 'Continuer'; $lang['relative_distinguished_name'] = 'Relative Distinguished Name'; $lang['rdn'] = 'RDN'; @@ -306,6 +346,8 @@ $lang['alias_for'] = 'Alias pour %s'; //creation_template.php $lang['ctemplate_on_server'] = 'Sur le serveur'; $lang['ctemplate_no_template'] = 'Aucun modèle spécifié dans les variables POST.'; +$lang['template_not_readable'] = 'Votre fichier de configuration définit un gestionnaire de "%s" pour ce \'template\' mais ce fichier ne possède pas les droits de lecture.'; +$lang['template_does_not_exist'] = 'Votre fichier de configuration définit un gestionnaire de "%s" pour ce \'template\' mais le gestionnaire n\'existe pas dans le répertoire templates/creation.'; $lang['ctemplate_config_handler'] = 'Votre configuration scécifie un gestionnaire de'; $lang['ctemplate_handler_does_not_exist'] = 'pour ce modèle. Cependant, ce gestionnaire n\'existe pas dans le répertoire \'templates/creation\'.'; $lang['create_step1'] = 'Etape 1 de 2: Nom et classes d\'objet'; @@ -358,12 +400,23 @@ $lang['commit'] = 'Valider'; $lang['cancel'] = 'Annuler'; $lang['you_made_no_changes'] = 'Aucun changement n\'a été effectué'; $lang['go_back'] = 'Retour'; +$lang['unable_create_samba_pass'] = 'Impossible de créer le mot de passe samba. Veuillez vérifiez votre configuration dans le fichier template_config.php'; // welcome.php $lang['welcome_note'] = 'Utilisez le menu de gauche pour la navigation'; $lang['credits'] = 'Crédits'; $lang['changelog'] = 'ChangeLog'; $lang['donate'] = 'Donation'; +$lang['pla_logo'] = 'phpLDAPadmin logo'; + + +// Donate.php +$lang['donation_instructions'] = 'Pour effectuer une doantion au projet phpLDAadmin, veuillez utilisez un des boutons PayPal ci-dessous.'; +$lang['donate_amount'] = 'Donner %s'; +$lang['purge_cache'] = 'Vider la cache'; +$lang['no_cache_to_purge'] = 'Aucune cache à vider.'; +$lang['done_purging_caches'] = 'Suppression de %s octets de la cache.'; +$lang['purge_cache_tooltip'] = 'Supprimer toutes les données en cache dans phpLDAPadmin, y compris les schemas serveur.'; // view_jpeg_photo.php $lang['unsafe_file_name'] = 'Nom de fichier non sûr: '; @@ -521,6 +574,70 @@ $lang['non_leaf_nodes_cannot_be_renamed'] = 'Vous ne pouvez pas renommer une ent $lang['no_rdn_change'] = 'Le RDN n\'a pas été modifié'; $lang['invalid_rdn'] = 'Valeur invalide du RDN'; $lang['could_not_rename'] = 'Impossible de renommer l\'entrée'; +$lang['csv_spreadsheet'] = 'CSV (tableur)'; +// Samba Account Template +$lang['samba_account'] = 'Samba Account'; +$lang['samba_account_lcase'] = 'samba account'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'Nouveau compte utilisateur'; +$lang['t_hint_customize'] = 'Astuce: Pour personnaliser ce \'template\', éditez le fichier templates/creation/new_user_template.php'; +$lang['t_name'] = 'Nom'; +$lang['t_first_name'] = 'Prénom'; +$lang['t_last_name'] = 'Nom de famille'; +$lang['t_first'] = 'first'; +$lang['t_last'] = 'last'; +$lang['t_common_name'] = 'Common name'; +$lang['t_user_name'] = 'Nom d\'utilisateur'; +$lang['t_password'] = 'Mot de passe'; +$lang['t_encryption'] = 'Encryption'; +$lang['t_login_shell'] = 'Login Shell'; +$lang['t_home_dir'] = 'Home Directory'; +$lang['t_uid_number'] = 'UID Number'; +$lang['t_auto_det'] = '(déterminé automatiquement)'; +$lang['t_group'] = 'Groupe'; +$lang['t_gid_number'] = 'GID Number'; +$lang['t_err_passwords'] = 'Les mots de passe ne correspondent pas. Veuillez revenir en arrière et recommencez.'; +$lang['t_err_field_blank'] = 'Le champ %s ne peut etre vide. Veuillez revenir en arrière et recommencez.'; +$lang['t_err_field_num'] = 'Seuls des valeurs numériques sont valides pour le champ %s. Veuillez revenir en arrière et recommencez.'; +$lang['t_err_bad_container'] = 'Le conténeur spécifié (%s) n\'existe pas. Veuillez revenir en arrière et recommencez.'; +$lang['t_confirm_account_creation'] = 'Confirmation de la création du compte'; +$lang['t_secret'] = '[secret]'; +$lang['t_create_account'] = 'Créer le compte'; + +// New Address Template +$lang['t_new_address'] = 'New Address Book Entry'; +$lang['t_organization'] = 'Organisation'; +$lang['t_address'] = 'Adresse'; +$lang['t_city'] = 'Ville'; +$lang['t_postal_code'] = 'Code postal'; +$lang['t_street'] = 'rue'; +$lang['t_work_phone'] = 'Work phone'; +$lang['t_fax'] = 'Fax'; +$lang['t_mobile'] = 'Mobile'; +$lang['t_email'] = 'Email'; +$lang['t_container'] = 'Conténeur'; +$lang['t_err_cn_blank'] = 'Le champ \'Common Name\' ne peut etre vide. Veuillez revenir en arrière et recommencer.'; +$lang['t_confim_creation'] = 'Confirmation de la création de l\'entrée:'; +$lang['t_create_address'] = 'Create Address'; + +// compare form +$lang['compare'] = 'Comparer'; +$lang['comparing'] = 'Comparaison des DNs suivant:'; +$lang['compare_dn'] = 'Comparer un autre DN avec'; +$lang['with'] = 'avec '; +$lang['compf_source_dn'] = 'DN Source'; +$lang['compf_dn_tooltip'] = 'Comparer ce DN avec un autre'; +$lang['switch_entry'] = 'Intervertir les entrées'; +$lang['no_value'] = 'Aucune Valeur'; +$lang['compare_with'] = 'Comparer avec une autre entrée'; +$lang['need_oclass'] = 'You need one of the following ObjectClass(es) to add this attribute %s.'; + +// Time out page +$lang['session_timed_out_1'] = 'Votre session a expiré après'; +$lang['session_timed_out_2'] = 'min. d\'inactivité. Vous avez été automatiquement déconnecté.'; +$lang['log_back_in'] = 'Pour vous connecter à nouveau, cliquez sur le lien suivant:'; +$lang['session_timed_out_tree'] = '(Expiration de session. Déconnexion automatique.)'; ?> diff --git a/lang/recoded/ja.php b/lang/recoded/ja.php index 9732982..a1b93aa 100644 --- a/lang/recoded/ja.php +++ b/lang/recoded/ja.php @@ -1,5 +1,5 @@ ä¸éƒ½åˆã«ã‚ˆã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。ã‚ã‚‹ã„ã¯ã€ã‚ãªãŸã® LDAP サーãƒãƒ¼ã¯ã€LDAP クライアント㌠RootDSE ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã®ã‚’防ãアクセス制御指定をã—ã¦ã„ã¾ã™ã€‚'; -$lang['server_info_for'] = 'Server info for: '; -$lang['server_reports_following'] = 'Server reports the following information about itself'; +$lang['server_info_for'] = 'サーãƒãƒ¼æƒ…å ±: '; +$lang['server_reports_following'] = 'サーãƒãƒ¼ã¯è‡ªåˆ†è‡ªèº«ã§æ¬¡ã®æƒ…報を報告ã—ã¾ã—ãŸã€‚'; $lang['nothing_to_report'] = 'ã“ã®ã‚µãƒ¼ãƒãƒ¼ã¯ãªã«ã‚‚報告ã™ã‚‹ã‚‚ã®ã¯ã‚ã‚Šã¾ã›ã‚“。'; //update.php -$lang['update_array_malformed'] = 'update_array ãŒã‚ªã‚«ã‚·ã‚¤ã§ã™ã€‚This might be a phpLDAPadmin bug. Please report it.'; +$lang['update_array_malformed'] = 'update_array ãŒãŠã‹ã—ã„ã§ã™ã€‚ã“れ㯠phpLDAPadmin ã®ãƒã‚°ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“ã®ã§ã€å ±å‘Šã—ã¦ãã ã•ã„。'; $lang['could_not_perform_ldap_modify'] = 'ldap_modify æ“作ãŒå®Ÿè¡Œã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; // update_confirm.php -$lang['do_you_want_to_make_these_changes'] = 'Do you want to make these changes?'; +$lang['do_you_want_to_make_these_changes'] = '変更をã—ãŸã„ã§ã™ã‹?'; $lang['attribute'] = '属性'; $lang['old_value'] = 'å¤ã„値'; $lang['new_value'] = 'æ–°ã—ã„値'; @@ -382,20 +380,19 @@ $lang['attr_deleted'] = '[属性を削除ã—ã¾ã—ãŸ]'; $lang['commit'] = 'コミット'; $lang['cancel'] = 'å–り消ã—'; $lang['you_made_no_changes'] = '変更ã¯ã‚ã‚Šã¾ã›ã‚“'; -$lang['go_back'] = 'Go back'; +$lang['go_back'] = '戻る'; +$lang['unable_create_samba_pass'] = 'samba パスワードを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚template_conf.php ã®è¨­å®šã‚’確èªã—ã¦ãã ã•ã„。'; // welcome.php -$lang['welcome_note'] = 'å·¦ã¸ã®ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’使用ã—ã¦æœæŸ»ã—ã¾ã™'; +$lang['welcome_note'] = 'å·¦ã¸ã®ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’使用ã—ã¦æ“作ã—ã¾ã™'; $lang['credits'] = 'クレジット'; $lang['changelog'] = '変更履歴'; -$lang['donate'] = '寄贈'; +$lang['donate'] = '寄附'; $lang['pla_logo'] = 'phpLDAPadmin ロゴ'; // Donate.php $lang['donation_instructions'] = 'phpLDAPadmin プロジェクトã«è³‡é‡‘を寄贈ã™ã‚‹ãŸã‚ã«ã¯ã€PayPal ボタンã®ã†ã¡ã® 1 ã¤ã‚’下ã«ä½¿ç”¨ã—ã¦ãã ã•ã„。'; $lang['donate_amount'] = '%s を寄贈'; -$lang['wish_list_option'] = 'Or perhaps you would prefer to purchase an gift for a phpLDAPadmin developer.'; -$lang['wish_list'] = 'Dave\'s phpLDAPadmin ã®ã‚ã£ä¸»ãƒªã‚¹ãƒˆã‚’閲覧'; $lang['purge_cache'] = 'キャッシュ破棄'; $lang['no_cache_to_purge'] = '破棄ã™ã‚‹ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã¯ã‚ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚'; @@ -407,44 +404,44 @@ $lang['unsafe_file_name'] = '安全ã§ãªã„ファイルå: '; $lang['no_such_file'] = 'ファイルãŒã‚ã‚Šã¾ã›ã‚“: '; //function.php -$lang['auto_update_not_setup'] = 'You have enabled auto_uid_numbers for %s in your configuration, - but you have not specified the auto_uid_number_mechanism. Please correct - this problem.'; -$lang['uidpool_not_set'] = 'You specified the "auto_uid_number_mechanism" as "uidpool" - in your configuration for server %s, but you did not specify the - audo_uid_number_uid_pool_dn. Please specify it before proceeding.'; +$lang['auto_update_not_setup'] = '設定ファイル㮠%sYou ã® auto_uid_numbers ãŒæœ‰åŠ¹ã§ã™ãŒã€ + auto_uid_number_mechanism ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã›ã‚“。 + ã“ã®å•é¡Œã‚’修正ã—ã¦ãã ã•ã„。.'; +$lang['uidpool_not_set'] = 'サーãƒãƒ¼ %s ã®è¨­å®šã§ã€"auto_uid_number_mechanism" ã‚’ "uidpool" ã«æŒ‡å®šã—ã¦ã„ã¾ã™ãŒã€ + audo_uid_number_uid_pool_dn を指定ã—ã¦ã„ã¾ã›ã‚“。 + 続行ã™ã‚‹å‰ã«ãれを指定ã—ã¦ãã ã•ã„'; $lang['uidpool_not_exist'] = 'It appears that the uidPool you specified in your configuration ("%s") does not exist.'; -$lang['specified_uidpool'] = 'You specified the "auto_uid_number_mechanism" as "search" in your - configuration for server %s, but you did not specify the - "auto_uid_number_search_base". Please specify it before proceeding.'; -$lang['auto_uid_invalid_credential'] = 'Unable to bind to %s with your with auto_uid credentials. Please check your configuration file.'; -$lang['bad_auto_uid_search_base'] = 'Your phpLDAPadmin configuration specifies an invalid auto_uid_search_base for server %s'; -$lang['auto_uid_invalid_value'] = 'You specified an invalid value for auto_uid_number_mechanism ("%s") - in your configration. Only "uidpool" and "search" are valid. - Please correct this problem.'; -$lang['error_auth_type_config'] = 'Error: You have an error in your config file. The only three allowed values - for auth_type in the $servers section are \'session\', \'cookie\', and \'config\'. You entered \'%s\', - which is not allowed. '; -$lang['unique_attrs_invalid_credential'] = 'Unable to bind to %s with your with unique_attrs credentials. Please check your configuration file.'; -$lang['unique_attr_failed'] = 'Your attempt to add %s (%s) to
      %s
      is NOT allowed. That attribute/value belongs to another entry.

      You might like to search for that entry.'; +$lang['specified_uidpool'] = 'サーãƒãƒ¼ %s ã®è¨­å®šã§ã€Œsearchã€ã«ã€Œauto_uid_number_mechanismã€ã‚’指定ã—ã¾ã—ãŸã€‚ + ã—ã‹ã—「auto_uid_number_search_baseã€ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã›ã‚“。 + ã“れを実行å‰ã«æŒ‡å®šã—ã¦ãã ã•ã„。'; +$lang['auto_uid_invalid_credential'] = 'Unable to bind to %s with your with auto_uid credentials. 設定ファイルを確èªã—ã¦ãã ã•ã„。'; +$lang['bad_auto_uid_search_base'] = 'phpLDAPadmin ã®è¨­å®šã§ã€ã‚µãƒ¼ãƒãƒ¼ %s ã«ç„¡åŠ¹ãª auto_uid_search_base ãŒæŒ‡å®šã•ã‚Œã¾ã—ãŸ'; +$lang['auto_uid_invalid_value'] = '設定ファイル㮠auto_uid_number_mechanism ã®æŒ‡å®šãŒé–“é•ã£ãŸå€¤("%s")ã§ã™ã€‚ + "uidpool" 㨠"search" ã®ã¿æœ‰åŠ¹ã§ã™ã€‚ + ã“ã®å•é¡Œã‚’修正ã—ã¦ãã ã•ã„。'; +$lang['error_auth_type_config'] = 'エラー: 設定ファイルã®ã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚$servers セクション㮠auth_type 㯠+ 「sessionã€ã€Œcookieã€ã€Œconfigã€ã®ã¿ã£ã¤ã®å€¤ã®ã¿è¨±å¯ã•ã‚Œã¦ã„ã¾ã™ãŒã€ + 許å¯ã•ã‚Œãªã„「%sã€ãŒå…¥åŠ›ã•ã‚Œã¾ã—ãŸã€‚'; +$lang['unique_attrs_invalid_credential'] = 'Unable to bind to %s with your with unique_attrs credentials. 設定ファイルを確èªã—ã¦ãã ã•ã„。'; +$lang['unique_attr_failed'] = '%s (%s) ã® %s ã¸ã®è¿½åŠ ã®è©¦ã¿ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“。
      ãã®å±žæ€§/値ã¯åˆ¥ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ‰€æœ‰ã—ã¦ã„ã¾ã™ã€‚

      ãã®ã‚¨ãƒ³ãƒˆãƒªã‚’検索ãªã©ã™ã‚‹ã—ょã†ã€‚'; $lang['php_install_not_supports_tls'] = 'インストールã•ã‚Œã¦ã„ã‚‹ PHP 㯠TLS をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。'; $lang['could_not_start_tls'] = 'TLS を開始ã§ãã¾ã›ã‚“。LDAP サーãƒãƒ¼ã®è¨­å®šã‚’確èªã—ã¦ãã ã•ã„。'; $lang['could_not_bind_anon'] = 'サーãƒãƒ¼ã«åŒ¿å接続ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; $lang['could_not_bind'] = 'LDAP サーãƒãƒ¼ã«æŽ¥ç¶šã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; $lang['anonymous_bind'] = '匿å接続'; $lang['bad_user_name_or_password'] = 'ユーザーåã‹ãƒ‘スワードãŒãŠã‹ã—ã„ã§ã™ã€‚ã‚‚ã†ä¸€åº¦è¡Œã£ã¦ãã ã•ã„。'; -$lang['redirecting_click_if_nothing_happens'] = 'Redirecting... Click here if nothing happens.'; -$lang['successfully_logged_in_to_server'] = 'サーãƒãƒ¼ %sã¸ã®ãƒ­ã‚°ã‚¤ãƒ³ã«æˆåŠŸã—ã¾ã—ãŸ'; +$lang['redirecting_click_if_nothing_happens'] = 'リダイレクト中... ã‚‚ã—何も起ã“らãªã‹ã£ãŸã‚‰ã“ã“をクリックã—ã¦ãã ã•ã„。'; +$lang['successfully_logged_in_to_server'] = 'サーãƒãƒ¼ %s ã¸ã®ãƒ­ã‚°ã‚¤ãƒ³ã«æˆåŠŸã—ã¾ã—ãŸ'; $lang['could_not_set_cookie'] = 'cookie を設定ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; -$lang['ldap_said'] = 'LDAP 回答: %s'; +$lang['ldap_said'] = 'LDAP ã®å›žç­”: %s'; $lang['ferror_error'] = 'エラー'; $lang['fbrowse'] = '閲覧'; $lang['delete_photo'] = '写真削除'; $lang['install_not_support_blowfish'] = 'インストールã•ã‚ŒãŸ PHP 㯠blowfish æš—å·åŒ–をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。'; $lang['install_not_support_md5crypt'] = 'インストールã•ã‚ŒãŸ PHP 㯠md5crypt æš—å·åŒ–をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。'; $lang['install_no_mash'] = 'インストールã•ã‚ŒãŸ PHP 㯠mhash() をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。SHA ãƒãƒƒã‚·ãƒ¥ã‚’ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。'; -$lang['jpeg_contains_errors'] = 'jpegPhoto contains errors
      '; +$lang['jpeg_contains_errors'] = 'エラーをå«ã‚€ jpeg 写真
      '; $lang['ferror_number'] = 'エラー番å·: %s (%s)'; $lang['ferror_discription'] = '説明: %s

      '; $lang['ferror_number_short'] = 'エラー番å·: %s

      '; @@ -455,7 +452,9 @@ $lang['ferror_nonfatil_bug'] = '

      致命的ã§ãªã„ phpLDAPadmin ã®ä¸éƒ½åˆã‚’発見ã—ã¾ã—ãŸ!
      エラー:%s (%s)
      ファイル: %s 行 %s, caller %s
      ãƒãƒ¼ã‚¸ãƒ§ãƒ³:PLA: %s, PHP: %s, SAPI: %s
      ウェブサーãƒãƒ¼:%s
      - ã“ã“をクリックã—ã¦å€‹ã®ä¸éƒ½åˆã‚’報告ã—ã¦ãã ã•ã„。.

      '; +
      Please check and see if this bug has been reported here.
      +
      If it hasnt been reported, you may report this bug by clicking here.
      +
      '; $lang['ferror_congrats_found_bug'] = 'ãŠã‚ã§ã¨ã†ã”ã–ã„ã¾ã™! phpLDAPadmin ã§ä¸éƒ½åˆã‚’発見ã—ã¾ã—ãŸã€‚

      @@ -511,27 +510,26 @@ $lang['searching'] = '検索中...'; $lang['size_limit_exceeded'] = '通知ã§ã™ã€‚検索サイズãŒåˆ¶é™ã‚’越ãˆã¾ã—ãŸã€‚'; $lang['entry'] = 'エントリ'; $lang['ldif_export_for_dn'] = 'LDIF エクスãƒãƒ¼ãƒˆ: %s'; -$lang['generated_on_date'] = 'Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on %s'; +$lang['generated_on_date'] = '%s ã« phpLDAPadmin ( http://www.phpldapadmin.com/ ) ã§ç”Ÿæˆã—ã¾ã—ãŸã€‚'; $lang['total_entries'] = 'ç·ã‚¨ãƒ³ãƒˆãƒª'; $lang['dsml_export_for_dn'] = 'DSLM エクスãƒãƒ¼ãƒˆ: %s'; $lang['include_system_attrs'] = 'システム属性をå«ã‚€'; $lang['csv_spreadsheet'] = 'CSV (スプレッドシート)'; // logins -$lang['could_not_find_user'] = 'ユーザー "%s" ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“'; -$lang['password_blank'] = 'You left the password blank.'; -$lang['login_cancelled'] = 'ログインãŒå–り消ã•ã‚Œã¾ã—ãŸã€‚'; +$lang['password_blank'] = 'パスワードãŒç©ºã§ã™ã€‚'; $lang['no_one_logged_in'] = 'No one is logged in to that server.'; $lang['could_not_logout'] = 'ログアウトã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; $lang['unknown_auth_type'] = '未知㮠auth_type: %s'; $lang['logged_out_successfully'] = 'サーãƒãƒ¼ %s ã‹ã‚‰ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã«æˆåŠŸã—ã¾ã—ãŸ'; -$lang['authenticate_to_server'] = 'Authenticate to server %s'; +$lang['authenticate_to_server'] = 'サーãƒãƒ¼ %s ã¸èªè¨¼'; $lang['warning_this_web_connection_is_unencrypted'] = '警告: ã“ã®ã‚¦ã‚§ãƒ–接続ã¯æš—å·åŒ–ã•ã‚Œã¦ã„ã¾ã›ã‚“。'; -$lang['not_using_https'] = 'You are not using \'https\'. Web browser will transmit login information in clear text.'; +$lang['not_using_https'] = 'ã‚ãªãŸã¯ \'https\' を使ã£ã¦ã„ã¾ã›ã‚“。ログイン情報ã¯ãƒ–ラウザã‹ã‚‰ã‚¯ãƒªã‚¢ãƒ†ã‚­ã‚¹ãƒˆã§é€ä¿¡ã•ã‚Œã¾ã™ã€'; $lang['login_dn'] = 'ログイン DN'; $lang['user_name'] = 'ユーザーå'; $lang['password'] = 'パスワード'; $lang['authenticate'] = 'Authenticate'; +$lang['login_not_allowed'] = 'ã™ã¿ã¾ã›ã‚“ã€ã“ã® LDAP サーãƒãƒ¼ã¨ phpLDAPadmin を使用ã™ã‚‹ã“ã¨ã‚’許å¯ã—ã¦ã„ã¾ã›ã‚“。'; // Entry browser $lang['entry_chooser_title'] = 'エントリé¸æŠž'; @@ -562,8 +560,7 @@ $lang['invalid_rdn'] = '無効㪠RDN 値'; $lang['could_not_rename'] = 'エントリã®å称変更ãŒå‡ºæ¥ã¾ã›ã‚“ã§ã—ãŸ'; // General errors -$lang['php5_unsupported'] = 'phpLDAPadmin 㯠PHP 5 をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。You will likely encounter many weird problems if you continue.'; -$lang['mismatched_search_attr_config'] = '設定ã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚$search_attributes must have the same number of attributes as $search_attributes_display.'; +$lang['mismatched_search_attr_config'] = '設定ã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚$search_attributes 㯠$search_attributes_display ã®å±žæ€§ã¨åŒã˜æ•°ã‚’æŒãŸãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“。'; // Password checker $lang['passwords_match'] = 'パスワードãŒä¸€è‡´ã—ã¾ã—ãŸ!'; @@ -572,4 +569,117 @@ $lang['password_checker_tool'] = 'パスワードãƒã‚§ãƒƒã‚¯ãƒ„ール'; $lang['compare'] = '比較'; $lang['to'] = 'To'; +// Templates +$lang['using'] = 'Using the'; +$lang['switch_to'] = 'You may switch to the '; +$lang['default_template'] = 'デフォルトテンプレート'; + +// template_config +$lang['user_account'] = 'ユーザーアカウント (posixAccount)'; +$lang['address_book_inet'] = 'アドレス帳エントリ (inetOrgPerson)'; +$lang['address_book_moz'] = 'アドレス帳エントリ (mozillaOrgPerson)'; +$lang['kolab_user'] = 'Kolab ユーザーエントリ'; +$lang['organizational_unit'] = '所属組織'; +$lang['organizational_role'] = '所属è·å‹™'; +$lang['posix_group'] = 'Posix グループ'; +$lang['samba_machine'] = 'Samba NT マシン'; +$lang['samba3_machine'] = 'Samba 3 NT マシン'; +$lang['samba_user'] = 'Samba ユーザー'; +$lang['samba3_user'] = 'Samba 3 ユーザー'; +$lang['samba3_group'] = 'Samba 3 グループマップ'; +$lang['dns_entry'] = 'DNS エントリ'; +$lang['simple_sec_object'] = '簡易セキュリティオブジェクト'; +$lang['courier_mail_account'] = 'Courier メールアカウント'; +$lang['courier_mail_alias'] = 'Courier メール別å'; +$lang['ldap_alias'] = 'LDAP 別å'; +$lang['sendmail_cluster'] = 'Sendmail クラスター'; +$lang['sendmail_domain'] = 'Sendmail ドメイン'; +$lang['sendmail_alias'] = 'Sendmail エイリアス'; +$lang['sendmail_virt_dom'] = 'Sendmail 仮想ドメイン'; +$lang['sendmail_virt_users'] = 'Sendmail 仮想ユーザー'; +$lang['sendmail_relays'] = 'Sendmail リレー'; +$lang['custom'] = 'カスタム'; +$lang['samba_domain_name'] = '自分㮠Samba ドメインå'; +$lang['administrators'] = 'Administrators'; +$lang['users'] = 'Users'; +$lang['guests'] = 'Guests'; +$lang['power_users'] = 'Power Users'; +$lang['account_ops'] = 'Account Operators'; +$lang['server_ops'] = 'Server Operators'; +$lang['print_ops'] = 'Print Operators'; +$lang['backup_ops'] = 'backup Operators'; +$lang['replicator'] = 'Replicator'; +$lang['unable_smb_passwords'] = ' Samba ã®ãƒ‘スワードを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚template_config.php ã®è¨­å®šã‚’確èªã—ã¦ãã ã•ã„。'; +$lang['err_smb_conf'] = 'エラー: samba ã®è¨­å®šã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã‚Šã¾ã™ã€‚'; +$lang['err_smb_no_name_sid'] = 'エラー: samba ドメインã®åå‰ãŠã‚ˆã³ sid ã‚’æä¾›ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚'; +$lang['err_smb_no_name'] = 'エラー: åå‰ã¯ samba ドメインã«æä¾›ã•ã‚Œã¾ã›ã‚“ã§ã—ãŸã€‚'; +$lang['err_smb_no_sid'] = 'エラー: sid 㯠samba ドメインã«æä¾›ã•ã‚Œã¾ã›ã‚“ã§ã—ãŸã€‚'; + +// Samba Account Template +$lang['samba_account'] = 'Samba アカウント'; +$lang['samba_account_lcase'] = 'samba アカウント'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'æ–°è¦ãƒ¦ãƒ¼ã‚¶ãƒ¼ã‚¢ã‚«ã‚¦ãƒ³ãƒˆ'; +$lang['t_hint_customize'] = 'ヒント: ã“ã®ãƒ†ãƒ³ãƒ—レートをカスタマイズã™ã‚‹å ´åˆã€ãƒ•ã‚¡ã‚¤ãƒ« templates/creation/new_user_template.php を編集ã—ã¾ã™ã€‚'; +$lang['t_name'] = 'åå‰'; +$lang['t_first_name'] = 'åå‰'; +$lang['t_last_name'] = 'è‹—å­—'; +$lang['t_first'] = 'first'; +$lang['t_last'] = 'last'; +$lang['t_common_name'] = '共通å'; +$lang['t_user_name'] = 'ユーザーå'; +$lang['t_password'] = 'パスワード'; +$lang['t_encryption'] = 'æš—å·åŒ–'; +$lang['t_login_shell'] = 'ログインシェル'; +$lang['t_home_dir'] = 'ホームディレクトリ'; +$lang['t_uid_number'] = 'UID 番å·'; +$lang['t_auto_det'] = '(自動採決)'; +$lang['t_group'] = 'グループ'; +$lang['t_gid_number'] = 'GID 番å·'; +$lang['t_err_passwords'] = 'パスワードãŒä¸€è‡´ã—ã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_err_field_blank'] = '%s ブランクを残ã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_err_field_num'] = 'フィールド %s ã¯æ•°å€¤ã®ã¿å…¥åŠ›ã§å‡ºæ¥ã¾ã™ã€‚戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_err_bad_container'] = '指定ã—ãŸå†…容(%s)ã¯å­˜åœ¨ã—ã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_confirm_account_creation'] = 'アカウント作æˆç¢ºèª'; +$lang['t_secret'] = '[secret]'; +$lang['t_create_account'] = 'アカウント作æˆ'; + +// New Address Template +$lang['t_new_address'] = 'æ–°è¦ã‚¢ãƒ‰ãƒ¬ã‚¹å¸³ã‚¨ãƒ³ãƒˆãƒª'; +$lang['t_organization'] = '組織'; +$lang['t_address'] = 'ä½æ‰€'; +$lang['t_city'] = '都市'; +$lang['t_postal_code'] = '郵便番å·'; +$lang['t_street'] = '築町æ‘'; +$lang['t_work_phone'] = '業務電話'; +$lang['t_fax'] = 'Fax'; +$lang['t_mobile'] = 'æºå¸¯é›»è©±'; +$lang['t_email'] = 'é›»å­ãƒ¡ãƒ¼ãƒ«'; +$lang['t_container'] = 'コンテナー'; +$lang['t_err_cn_blank'] = '一般åを空ã«ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“。戻ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„。'; +$lang['t_confim_creation'] = 'エントリ作æˆã®ç¢ºèª:'; +$lang['t_create_address'] = 'アドレス作æˆ'; + +// default template +$lang['t_check_pass'] = 'パスワード検査...'; + +// compare form +$lang['compare'] = '比較'; +$lang['comparing'] = '次㮠DN ã¨æ¯”較中'; +$lang['compare_dn'] = 'Compare another DN with'; +$lang['with'] = 'with '; +$lang['compf_source_dn'] = '元㮠DN'; +$lang['compf_dn_tooltip'] = 'ã“ã® DN ã¨åˆ¥ã®ã‚‚ã®ã‚’比較'; +$lang['switch_entry'] = 'エントリã®åˆ‡ã‚Šæ›¿ãˆ'; +$lang['no_value'] = '値ãŒã‚ã‚Šã¾ã›ã‚“'; +$lang['compare_with'] = '別ã®ã‚¨ãƒ³ãƒˆãƒªã¨æ¯”較'; +$lang['need_oclass'] = 'ã“ã®å±žæ€§ %s を追加ã™ã‚‹ã«ã¯æ¬¡ã® ObjectClass ã®ã†ã¡ã²ã¨ã¤ã‚’å¿…è¦ã¨ã—ã¾ã™ã€‚'; + +// Time out page +$lang['session_timed_out_1'] = 'セッションã¯'; +$lang['session_timed_out_2'] = '分活動ã—ãªã‹ã£ãŸã®ã§ã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã§ã™ã€‚自動ã§ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸã€‚'; +$lang['log_back_in'] = 'å†ãƒ­ã‚°ã‚¤ãƒ³ã™ã‚‹ã«ã¯æ¬¡ã®ãƒªãƒ³ã‚¯ã‚’クリックã—ã¦ãã ã•ã„:'; +$lang['session_timed_out_tree'] = '(セッションã¯ã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã§ã™ã€‚自動ã§ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸ)'; +$lang['timeout_at'] = '%s ã¯æ´»å‹•çš„ã§ãªã‹ã£ãŸã®ã§ãƒ­ã‚°ã‚¢ã‚¦ãƒˆ'; ?> diff --git a/lang/recoded/pl.php b/lang/recoded/pl.php index b99c111..7403aae 100644 --- a/lang/recoded/pl.php +++ b/lang/recoded/pl.php @@ -1,5 +1,5 @@ bÅ‚Ä™dem w Twojej wersji PHP albo na przykÅ‚ad tym, że Twój serwer LDAP posiada listÄ™ kontroli dostÄ™pu nie zezwalajÄ…cÄ… na pobranie RootDSE klientom LDAP'; $lang['server_info_for'] = 'Informacja o serwerze: '; $lang['server_reports_following'] = 'Serwer zwróciÅ‚ nastÄ™pujÄ…ce informacje o sobie'; $lang['nothing_to_report'] = 'Ten serwer nie chce nic powiedzieć o sobie :).'; @@ -369,24 +376,30 @@ $lang['commit'] = 'Zatwierdź'; $lang['cancel'] = 'Anuluj'; $lang['you_made_no_changes'] = 'Nie dokonano żadnych zmian'; $lang['go_back'] = 'Powrót'; +$lang['unable_create_samba_pass'] = 'Nie można utworzyć hasÅ‚a dla samby. Sprawdź proszÄ™ swojÄ… konfiguracjÄ™ w template_config.php'; // welcome.php $lang['welcome_note'] = 'Użyj menu z lewej strony do nawigacji'; $lang['credits'] = 'Lista pÅ‚ac'; $lang['changelog'] = 'Historia zmian'; $lang['donate'] = 'Wesprzyj projekt'; -$lang['purge_cache'] = 'Wyczyść pamięć podrÄ™cznÄ…'; +$lang['pla_logo'] = 'phpLDAPadmin logo'; + +// Donate.php +$lang['donation_instructions'] = 'Aby wesprzeć projekt phpLDAPadmin skorzystaj z jednego z przycisków PayPal umieszczonych poniżej'; +$lang['donate_amount'] = 'Wesprzyj kwotÄ… %s'; + +$lang['purge_cache'] = 'Wyczyść cache'; $lang['no_cache_to_purge'] = 'Nie ma czego czyÅ›cić.'; -$lang['done_purging_caches'] = 'Wyczyszczono %s bajtów pamiÄ™ci podrÄ™cznej.'; - +$lang['done_purging_caches'] = 'Wyczyszczono %s bajtów pamiÄ™ci podrÄ™cznej (cache).'; +$lang['purge_cache_tooltip'] = 'CzyÅ›ci wszystkie dane podrÄ™czne (cache) w phpLDAPadmin, Å‚Ä…cznie ze schematami serwera'; + // view_jpeg_photo.php $lang['unsafe_file_name'] = 'Niebezpieczna nazwa pliku: '; $lang['no_such_file'] = 'Nie znaleziono pliku: '; //function.php -$lang['auto_update_not_setup'] = 'ZezwoliÅ‚eÅ›/aÅ› na automatyczne nadawanie uid (auto_uid_numbers) - dla %s w konfiguracji, ale nie okreÅ›liÅ‚eÅ›/aÅ› mechanizmu - (auto_uid_number_mechanism). ProszÄ™ skorygować ten problem.'; +$lang['auto_update_not_setup'] = 'ZezwoliÅ‚eÅ›/aÅ› na automatyczne nadawanie uid (auto_uid_numbers) dla %s w konfiguracji, ale nie okreÅ›liÅ‚eÅ›/aÅ› mechanizmu (auto_uid_number_mechanism). ProszÄ™ skorygować ten problem.'; $lang['uidpool_not_set'] = 'OkreÅ›liÅ‚eÅ›/aÅ› mechanizm autonumerowania uid "auto_uid_number_mechanism" jako "uidpool" w konfiguracji Twojego serwera %s, lecz nie okreÅ›liÅ‚eÅ›/aÅ› audo_uid_number_uid_pool_dn. ProszÄ™ okreÅ›l to zanim przejdziesz dalej.'; $lang['uidpool_not_exist'] = 'WyglÄ…da na to, że uidPool, którÄ… okreÅ›liÅ‚eÅ›/aÅ› w Twojej konfiguracji ("%s") nie istnieje.'; $lang['specified_uidpool'] = 'OkreÅ›liÅ‚eÅ›/aÅ› "auto_uid_number_mechanism" jako "search" w konfiguracji Twojego serwera %s, ale nie okreÅ›liÅ‚eÅ›/aÅ› bazy "auto_uid_number_search_base". Zrób to zanim przejdziesz dalej.'; @@ -402,15 +415,15 @@ $lang['could_not_bind_anon'] = 'Nie można anonimowo podÅ‚Ä…czyć do serwera.'; $lang['could_not_bind'] = 'Nie można podÅ‚Ä…czyć siÄ™ do serwera LDAP.'; $lang['anonymous_bind'] = 'PodÅ‚Ä…czenie anonimowe'; $lang['bad_user_name_or_password'] = 'ZÅ‚a nazwa użytkownika lub hasÅ‚o. Spróbuj ponownie.'; -$lang['redirecting_click_if_nothing_happens'] = 'PrzekierowujÄ™... Kliknij tutaj jeÅ›li nic siÄ™ nie dzieje.'; $lang['successfully_logged_in_to_server'] = 'PomyÅ›lnie zalogowano do serwera %s'; $lang['could_not_set_cookie'] = 'Nie można ustawić ciasteczka (cookie).'; $lang['ldap_said'] = 'LDAP odpowiedziaÅ‚: %s'; $lang['ferror_error'] = 'BÅ‚Ä…d'; $lang['fbrowse'] = 'przeglÄ…daj'; $lang['delete_photo'] = 'UsuÅ„ fotografiÄ™'; -$lang['install_not_support_blowfish'] = 'Twoja instalacja PHP nie wspiera szyfrowania blowfish.'; -$lang['install_not_support_md5crypt'] = 'Twoja instalacja PHP nie wspiera szyfrowania md5crypt.'; +$lang['install_not_support_ext_des'] = 'Twoja systemowa biblioteka crypt nie wspiera rozszerzonego szyfrowania DES'; +$lang['install_not_support_blowfish'] = 'Twoja systemowa biblioteka crypt nie wspiera szyfrowania blowfish.'; +$lang['install_not_support_md5crypt'] = 'Twoja systemowa biblioteka crypt nie wspiera szyfrowania md5crypt.'; $lang['install_no_mash'] = 'Twoja instalacja PHP nie posiada funkcji mhash(). Nie mogÄ™ tworzyć haszy SHA.'; $lang['jpeg_contains_errors'] = 'jpegPhoto zawiera bÅ‚Ä™dy
      '; $lang['ferror_number'] = 'BÅ‚Ä…d numer: %s (%s)'; @@ -442,7 +455,6 @@ $lang['ferror_congrats_found_bug'] = 'Gratulacje ! ZnalazÅ‚eÅ› bÅ‚Ä…d w phpLDAPa //ldif_import_form $lang['import_ldif_file_title'] = 'Importuj plik LDIF'; $lang['select_ldif_file'] = 'Wybierz plik LDIF:'; -$lang['select_ldif_file_proceed'] = 'Dalej >>'; $lang['dont_stop_on_errors'] = 'Nie zatrzymuj siÄ™ po napotkaniu bÅ‚Ä™dów'; //ldif_import @@ -453,7 +465,7 @@ $lang['modify_action'] = 'Modyfikowanie...'; $lang['warning_no_ldif_version_found'] = 'Nie znaleziono numeru wersji. PrzyjmujÄ™ 1.'; $lang['valid_dn_line_required'] = 'Wymagana jest poprawna linia DN.'; $lang['missing_uploaded_file'] = 'Brak wgrywanego pliku.'; -$lang['no_ldif_file_specified.'] = 'Nie okreÅ›lono pliku LDIF. Spróbuj ponownie.'; +$lang['no_ldif_file_specified'] = 'Nie okreÅ›lono pliku LDIF. Spróbuj ponownie.'; $lang['ldif_file_empty'] = 'Wgrany plik LDIF jest pusty.'; $lang['empty'] = 'pusty'; $lang['file'] = 'Plik'; @@ -489,11 +501,10 @@ $lang['generated_on_date'] = 'Wygenerowane przez phpLDAPadmin ( http://phpldapad $lang['total_entries'] = 'ÅÄ…cznie wpisów'; $lang['dsml_export_for_dn'] = 'Eksport DSLM dla: %s'; $lang['include_system_attrs'] = 'Zawiera atrybuty systemowe'; +$lang['csv_spreadsheet'] = 'CVS (arkusz)'; // logins -$lang['could_not_find_user'] = 'Nie można znaleźć użytkownika "%s"'; $lang['password_blank'] = 'PozostawiÅ‚eÅ›/aÅ› puste hasÅ‚o.'; -$lang['login_cancelled'] = 'Logowanie anulowane.'; $lang['no_one_logged_in'] = 'Nikt nie jest zalogowany do tego serwera.'; $lang['could_not_logout'] = 'Nie można wylogować.'; $lang['unknown_auth_type'] = 'Nieznany auth_type: %s'; @@ -505,6 +516,7 @@ $lang['login_dn'] = 'Login DN'; $lang['user_name'] = 'Nazwa użytkownika'; $lang['password'] = 'HasÅ‚o'; $lang['authenticate'] = 'Zaloguj'; +$lang['login_not_allowed'] = 'Przykro mi, ale nie masz uprawnieÅ„ aby korzystać z phpLDAPadmin na tym serwerze LDAP.'; // Entry browser $lang['entry_chooser_title'] = 'Wybór wpisu'; @@ -534,15 +546,25 @@ $lang['no_rdn_change'] = 'Nie zmieniÅ‚eÅ›/aÅ› RDN'; $lang['invalid_rdn'] = 'BÅ‚Ä™dna wartość RDN'; $lang['could_not_rename'] = 'Nie można zmienić nazwy wpisu'; +// General errors +$lang['mismatched_search_attr_config'] = 'Twoja konfiguracja zawiera bÅ‚Ä…d. $search_attributes musi posiadać tÄ… samÄ… ilość atrybutów co $search_attributes_display.'; + +// Password checker +$lang['passwords_match'] = 'HasÅ‚a zgodne !'; +$lang['passwords_do_not_match'] = 'HasÅ‚a nie zgadzajÄ… siÄ™ !'; +$lang['password_checker_tool'] = 'NarzÄ™dzie do sprawdzania haseÅ‚'; +$lang['compare'] = 'Porównaj'; +$lang['to'] = 'Do'; + // Templates $lang['using'] = 'UżywajÄ…c'; -$lang['template'] = 'szablonu'; $lang['switch_to'] = 'Możesz przeÅ‚Ä…czyć siÄ™ do '; $lang['default_template'] = 'domyÅ›lnego szablonu'; // template_config $lang['user_account'] = 'Konto Użytkownika (posixAccount)'; -$lang['address_book'] = 'Wpis Książki Adresowej (inetOrgPerson)'; +$lang['address_book_inet'] = 'Wpis Książki Adresowej (inetOrgPerson)'; +$lang['address_book_moz'] = 'Wpis Książki Adresowej (mozillaOrgPerson)'; $lang['kolab_user'] = 'Wpis Użytkownika Kolab'; $lang['organizational_unit'] = 'Jednostka Organizacyjna'; $lang['organizational_role'] = 'Rola w Organizacji'; @@ -557,6 +579,12 @@ $lang['simple_sec_object'] = 'Prosty obiekt bezpieczeÅ„stwa (SSO)'; $lang['courier_mail_account'] = 'Konto Pocztowe w Courier'; $lang['courier_mail_alias'] = 'Alias Pocztowy w Courier'; $lang['ldap_alias'] = 'Alias w LDAP'; +$lang['sendmail_cluster'] = 'Klaster Sendmail'; +$lang['sendmail_domain'] = 'Domena Sendmail'; +$lang['sendmail_alias'] = 'Alias Sendmail'; +$lang['sendmail_virt_dom'] = 'Wirtualna Domena Sendmail'; +$lang['sendmail_virt_users'] = 'Wirtualni Użytkownicy Sendmail'; +$lang['sendmail_relays'] = 'Sendmail Relays'; $lang['custom'] = 'Ogólne'; $lang['samba_domain_name'] = 'Moja nazwa domeny w Samba'; $lang['administrators'] = 'Administratorzy'; @@ -569,6 +597,10 @@ $lang['print_ops'] = 'Operatorzy drukowania'; $lang['backup_ops'] = 'Operatorzy archiwizacji danych'; $lang['replicator'] = 'Replikator'; $lang['unable_smb_passwords'] = ' Nie można utworzyć haseÅ‚ Samba. ProszÄ™ sprawdzić konfiguracjÄ™ w template_config.php'; +$lang['err_smb_conf'] = 'BÅ‚Ä…d: masz bÅ‚Ä…d w konfiguracji samby'; +$lang['err_smb_no_name_sid'] = 'BÅ‚Ä…d: musisz wprowadzić nazwÄ™ oraz sid dla Twojej domeny samby.'; +$lang['err_smb_no_name'] = 'BÅ‚Ä…d: brak nazwy dla domeny samby.'; +$lang['err_smb_no_sid'] = 'BÅ‚Ä…d: brak sid dla domeny samby'; // Samba Account Template $lang['samba_account'] = 'Konto Samba'; @@ -580,6 +612,8 @@ $lang['t_hint_customize'] = 'Wskazówka: Aby dostosować ten szablon, wyedytuj p $lang['t_name'] = 'Nazwa/Nazwisko'; $lang['t_first_name'] = 'ImiÄ™'; $lang['t_last_name'] = 'Nazwisko'; +$lang['t_first'] = 'imiÄ™'; +$lang['t_last'] = 'nazwisko'; $lang['t_common_name'] = 'Nazwa'; $lang['t_user_name'] = 'Nazwa użytkownika'; $lang['t_password'] = 'HasÅ‚o'; @@ -614,4 +648,25 @@ $lang['t_err_cn_blank'] = 'Nie możesz pozostawić pustego pola Nazwa. Wróć i $lang['t_confim_creation'] = 'Potwierdź utworzenie wpisu:'; $lang['t_create_address'] = 'Utwórz adres'; +// default template +$lang['t_check_pass'] = 'Sprawdź hasÅ‚o'; + +// compare form +$lang['compare'] = 'Porównaj'; +$lang['comparing'] = 'PorównujÄ™ nastÄ™pujÄ…ce DN'; +$lang['compare_dn'] = 'Porównaj inny DN z'; +$lang['with'] = 'z'; +$lang['compf_source_dn'] = 'ŹródÅ‚owa DN'; +$lang['compf_dn_tooltip'] = 'Prównaj tÄ… DN z innÄ…'; +$lang['switch_entry'] = 'ZamieÅ„ wpisy'; +$lang['no_value'] = 'Brak wartoÅ›ci'; +$lang['compare_with'] = 'Porównaj z innym wpisem'; +$lang['need_oclass'] = 'Musisz posiadać jednÄ… z nastÄ™pujÄ…cych klas obiektów, aby dodać ten atrybut %s '; + +// Time out page +$lang['session_timed_out_1'] = 'Twoja sesja wygaÅ›nie po'; +$lang['session_timed_out_2'] = 'min. nieaktywnoÅ›ci. Zostaniesz automatycznie wylogowany/a.'; +$lang['log_back_in'] = 'Aby siÄ™ zalogować ponownie kliknij w nastÄ™pujÄ…cy link:'; +$lang['session_timed_out_tree'] = '(Sesja wygasÅ‚a. Automatycznie wylogowano)'; +$lang['timeout_at'] = 'Brak aktywnoÅ›ci wyloguje CiÄ™ o %s'; ?> diff --git a/lang/recoded/ru.php b/lang/recoded/ru.php index cf52b58..1cf4f18 100644 --- a/lang/recoded/ru.php +++ b/lang/recoded/ru.php @@ -1,5 +1,5 @@ "zh-cn" //Simplified Chinese + +*/ + +/* --- ·­ÒëÖ¸µ¼ --- + * + * Èç¹ûÄãÏ뽨Á¢Ò»¸öеÄÓïÑÔÎļþ£¬ + * Çë°ÑËüÌá½»µ½SourceForge£º + * + * https://sourceforge.net/tracker/?func=add&group_id=61828&atid=498548 + * + * ÇëʹÓõײ¿µÄÑ¡Ïî"Check to Upload and Attach a File£¨ÉÏ´«¸½¼þ£©" + * + * ÔĶÁdoc/README-translation.txt ¿ÉÒԵõ½·­ÒëÖ¸µ¼¡£ + * + * лл£¡ + * + */ + +/* + * Êý×é$lang °üº¬ÁËËùÓÐphpLDAPadmin ËùʹÓõÄ×ÖÌå´®¡£ + * ÿһ¸öÓïÑÔÎļþ¶¼Ö»ÐèÒªÔÚÕâ¸öÊý×éÖж¨ÒåÒ»¸ö¸ÃÓïÑÔµÄËù¶ÔÓ¦µÄ + * ×Ö·û´®¡£ + */ + +// Search form +$lang['simple_search_form_str'] = '¼òµ¥ËÑË÷±í¸ñ'; +$lang['advanced_search_form_str '] = '¸ß¼¶ËÑË÷±í¸ñ'; +$lang['server'] = '·þÎñÆ÷'; +$lang['search_for_entries_whose'] = 'ËÑË÷ÌõÄ¿µÄËùÊô'; +$lang['base_dn'] = '»ù±¾DN'; +$lang['search_scope'] = 'ËÑË÷·¶Î§'; +$lang['show_attributes'] = 'ÏÔʾÊôÐÔ'; +//$lang['attributes'] = 'ÊôÐÔ'; +$lang['Search'] = 'ËÑË÷'; +$lang['predefined_search_str'] = 'Ñ¡ÔñÒ»¸öÔ¤¶¨ÒåµÄËÑË÷'; +$lang['predefined_searches'] = 'Ô¤¶¨ÒåµÄËÑË÷'; +$lang['no_predefined_queries'] = 'ÔÚconfig.phpÀïûÓÐÌõÄ¿¶¨Òå¡£'; +$lang['export_results'] = 'µ¼³ö½á¹û'; +$lang['unrecoginzed_search_result_format'] = '²»ÄÜʶ±ðµÄËÑË÷½á¹û¸ñʽ£º %s'; +$lang['format'] = '¸ñʽ'; +$lang['list'] = 'Áбí'; +$lang['table'] = '±í¸ñ'; +$lang['bad_search_display'] = 'ÄãµÄconfig.php ¸ø$default_search_displayÖ¸¶¨ÁËÒ»¸ö·Ç·¨µÄÖµ£º %s£¬Çë¸üÕý'; +$lang['page_n'] = 'µÚ%dÒ³'; +$lang['no_results'] = 'Õâ´ÎËÑË÷ûÕÒµ½½á¹û¡£'; + +// Tree browser +$lang['request_new_feature'] = '¹¦ÄÜÐèÇó'; +$lang['report_bug'] = '±¨¸æ´í©'; +$lang['schema'] = '¸ñʽ'; +$lang['search'] = 'ËÑË÷'; +$lang['create'] = '´´½¨'; +$lang['info'] = 'ÐÅÏ¢'; +$lang['import'] = 'µ¼Èë'; +$lang['refresh'] = 'Ë¢ÐÂ'; +$lang['logout'] = 'Í˳ö'; +$lang['create_new'] = '´´½¨ÐÂÌõÄ¿'; +$lang['view_schema_for'] = '²é¿´¸ñʽ'; +$lang['refresh_expanded_containers'] = 'Ë¢ÐÂËùÓÐÕ¹¿ªµÄÈÝÆ÷£¬À´×Ô'; +$lang['create_new_entry_on'] = '´´½¨ÐÂÌõÄ¿µ½'; +$lang['new'] = 'н¨'; +$lang['view_server_info'] = '²é¿´¸½¼ÓµÄ·þÎñÆ÷ÐÅÏ¢'; +$lang['import_from_ldif'] = '´ÓLDIFÎļþµ¼ÈëÌõÄ¿'; +$lang['logout_of_this_server'] = 'Í˳öÕâ¸ö·þÎñÆ÷'; +$lang['logged_in_as'] = 'µÇ¼Ϊ£º '; +$lang['this_base_dn_is_not_valid'] = '¸ÃDNÊÇÎÞЧ¡£'; +$lang['this_base_dn_does_not_exist'] = '¸ÃÌõÄ¿²»´æÔÚ¡£'; +$lang['read_only'] = 'Ö»¶Á'; +$lang['read_only_tooltip'] = '¸ÃÊôÐÔÒѾ­±»phpLDAPadmin ¹ÜÀíÔ±±êʶΪֻ¶Á'; +$lang['could_not_determine_root'] = '¼ì²â²»µ½ÄãµÄLDAPÊ÷µÄ¸ù¡£'; +$lang['ldap_refuses_to_give_root'] = 'ºÃÏñÄãµÄLDAP·þÎñÆ÷ÅäÖÃÀ´ÏÞÖÆÁ˲»ÒªÏÔ¶ËüµÄ¸ù¡£'; +$lang['please_specify_in_config'] = 'ÇëÔÚconfig.phpÀïÖ¸¶¨Ëü'; +$lang['create_new_entry_in'] = '´´½¨ÐÂÌõÄ¿ÓÚ'; +$lang['login_link'] = 'µÇ¼¡­'; +$lang['login'] = 'µÇ¼'; +$lang['base_entry_does_not_exist'] = '¸Ã»ù×¼ÌõÄ¿²»´æÔÚ¡£'; +$lang['create_it'] = 'Òª´´½¨ËüÂð£¿'; + +// Entry display +$lang['delete_this_entry'] = 'ɾ³ý¸ÃÌõÄ¿'; +$lang['delete_this_entry_tooltip'] = 'Äã»áµÃµ½ÌáʾҪÇóÈ·ÈϸÃÑ¡Ôñ'; +$lang['copy_this_entry'] = '¸´ÖƺÍÒƶ¯¸ÃÌõÄ¿'; +$lang['copy_this_entry_tooltip'] = '°ÑÕâ¸ö¶ÔÏó¸´ÖƵ½ÁíÒ»¸öλÖã¬Ò»¸öÐÂDN»òÁíÒ»¸ö·þÎñÆ÷¡£'; +$lang['export'] = 'µ¼³ö'; +$lang['export_lcase'] = 'µ¼³ö'; +$lang['export_tooltip'] = '±£´æÒ»¸ö¸Ã¶ÔÏóµÄµ¼³ö'; +$lang['export_subtree_tooltip'] = '±£´æÒ»¸ö¸Ã¶ÔÏó¼°ÆäËùÓк¢×ӵĵ¼³ö'; +$lang['export_subtree'] = 'µ¼³ö×ÓÊ÷'; +$lang['create_a_child_entry'] = '´´½¨Ò»¸ö×ÓÌõÄ¿'; +$lang['rename_entry'] = 'ÌõÄ¿¸üÃû'; +$lang['rename'] = '¸üÃû'; +$lang['add'] = 'Ôö¼Ó'; +$lang['view'] = '²é¿´'; +$lang['view_one_child'] = '²é¿´1¸ö×ÓÌõÄ¿'; +$lang['view_children'] = '²é¿´%s¸ö×ÓÌõÄ¿'; +$lang['add_new_attribute'] = 'Ôö¼ÓеÄÊôÐÔ'; +$lang['add_new_objectclass'] = 'Ôö¼ÓеÄObjectClass'; +$lang['hide_internal_attrs'] = 'Òþ²ØÄÚ²¿ÊôÐÔ'; +$lang['show_internal_attrs'] = 'ÏÔʾÄÚ²¿ÊôÐÔ'; +$lang['attr_name_tooltip'] = 'µã»÷²é¿´ÊôÐÔÀàÐÍ\'%s\'µÄ¸ñʽ¶¨Òå'; +$lang['none'] = 'ʲô¶¼Ã»ÓÐ'; +$lang['no_internal_attributes'] = 'ûÓÐÄÚ²¿ÊôÐÔ'; +$lang['no_attributes'] = 'Õâ¸öÌõĿûÓÐÊôÐÔ'; +$lang['save_changes'] = '±£´æ¸ü¸Ä'; +$lang['add_value'] = '¸³Öµ'; +$lang['add_value_tooltip'] = '¸øÊôÐÔ\'%s\'¸³Ò»¸ö¸½¼ÓµÄÖµ'; +$lang['refresh_entry'] = 'Ë¢ÐÂ'; +$lang['refresh_this_entry'] = 'Ë¢ÐÂÕâ¸öÌõÄ¿'; +$lang['delete_hint'] = 'Ìáʾ£º ÏëҪɾ³ýÒ»¸öÊôÐÔ£¬Ç뽫Îı¾×Ö¶ÎÇå¿Õ£¬È»ºóµã»÷±£´æ¡£'; +$lang['attr_schema_hint'] = 'Ìáʾ£º Òª²é¿´Ò»¸öÊôÐԵĸñʽ£¬Çëµã»÷ÊôÐÔµÄÃû³Æ¡£'; +$lang['attrs_modified'] = 'ÏÂÃæÓÐһЩÊôÐÔ(%s) ±»ÐÞ¸ÄÁË£¬¶øÇÒ±»±êʶΪ¸ßÁÁ¡£'; +$lang['attr_modified'] = 'ÏÂÃæÒ»¸öÊôÐÔ(%s) ±»ÐÞ¸ÄÁË£¬¶øÇÒ±»±êʶΪ¸ßÁÁ'; +$lang['viewing_read_only'] = 'ÒÔÖ»¶Áģʽ²é¿´ÌõÄ¿¡£'; +$lang['no_new_attrs_available'] = 'Õâ¸öÌõĿûÓÐÌṩеÄÊôÐÔ'; +$lang['no_new_binary_attrs_available'] = 'Õâ¸öÌõĿûÓÐÌṩеĶþ½øÖÆÊôÐÔ'; +$lang['binary_value'] = '¶þ½øÖÆÖµ'; +$lang['add_new_binary_attr'] = 'Ôö¼ÓеĶþ½øÖÆÖµ'; +$lang['alias_for'] = '×¢Ò⣺ \'%s\'ÊÇ\'%s\'µÄÒ»¸ö±ðÃû'; +$lang['required_for'] = 'objectClass(es) %sËù±ØÐèµÄÊôÐÔ'; +$lang['download_value'] = 'ÏÂÔØÖµ'; +$lang['delete_attribute'] = 'ɾ³ýÊôÐÔ'; +$lang['true'] = 'ÕæµÄ'; +$lang['false'] = '¼ÙµÄ'; +$lang['none_remove_value'] = 'ʲô¶¼Ã»ÓУ¬½«ÖµÒƳý'; +$lang['really_delete_attribute'] = 'ÕæµÄɾ³ýÊôÐÔ'; +$lang['add_new_value'] = 'Ôö¼ÓеÄÖµ'; + +// Schema browser +//$lang['the_following_objectclasses'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐobjectClasses¡£'; +//$lang['the_following_attributes'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐÊôÐÔÀàÐÍ¡£'; +//$lang['the_following_matching'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐÆ¥Åä¹æÔò¡£'; +//$lang['the_following_syntaxes'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐÓï·¨¹æÔò¡£'; +$lang['schema_retrieve_error_1']='Õâ¸ö·þÎñÆ÷²¢²»ÍêÈ«Ö§³ÖLDAP ЭÒé¡£'; +$lang['schema_retrieve_error_2']='ÄãµÄPHP°æ±¾²»ÄÜÕýÈ·µØÍê³É²éѯ¡£'; +$lang['schema_retrieve_error_3']='phpLDAPadmin²»ÖªµÀÈç¹û»ñÈ¡ÄãµÄ·þÎñÆ÷µÄ¸ñʽ¡£'; +$lang['schema_retrieve_error_4']='»òÕß×îºó£¬ÄãµÄLDAP·þÎñÆ÷ûÓÐÌṩ¸ÃÐÅÏ¢¡£'; +$lang['jump_to_objectclass'] = 'Ìøתµ½Ò»¸öobjectClass'; +$lang['view_schema_for_oclass'] = '²é¿´¸ÃobjectClassµÄ¸ñʽÃèÊö'; +$lang['jump_to_attr'] = 'Ìøתµ½Ò»¸öÊôÐÔÀàÐÍ'; +$lang['jump_to_matching_rule'] = 'Ìøתµ½Ò»¸öÆ¥ÅäµÄ¹æÔò'; +$lang['schema_for_server'] = '·þÎñÆ÷µÄ¸ñʽ'; +$lang['required_attrs'] = '±ØÐèµÄÊôÐÔ'; +$lang['required'] = '±ØÐèµÄ'; +$lang['optional_attrs'] = '¿ÉÑ¡µÄÊôÐÔ'; +$lang['optional_binary_attrs'] = '¿ÉÑ¡µÄ¶þ½øÖÆÊôÐÔ'; +$lang['OID'] = 'OID'; +$lang['aliases']='±ðÃû'; +$lang['desc'] = 'ÃèÊö'; +$lang['no_description']='ûÓÐÃèÊö'; +$lang['name'] = 'Ãû³Æ'; +$lang['equality']='ÏàµÈ'; +$lang['is_obsolete'] = '¸ÃobjectClass¹ý¾ÃÁË¡£'; +$lang['inherits'] = '¼Ì³ÐÓÚ'; +$lang['inherited_from'] = '±»¼Ì³ÐÓÚ'; +$lang['parent_to'] = 'Ë«Ç×Ö¸Ïò'; +$lang['jump_to_this_oclass'] = 'Ìøתµ½¸ÃobjectClassµÄ¶¨Òå´¦'; +$lang['matching_rule_oid'] = 'Æ¥Åä¹æÔò OID'; +$lang['syntax_oid'] = 'Óï·¨¹æÔòOID'; +$lang['not_applicable'] = '²»¿ÉÓ¦ÓÃ'; +$lang['not_specified'] = 'δָ¶¨µÄ'; +$lang['character']='µ¥¸ö×Ö·û'; +$lang['characters']='¶à¸ö×Ö·û'; +$lang['used_by_objectclasses']='±»objectClassesËùʹÓõÄ'; +$lang['used_by_attributes']='±»ÊôÐÔËùʹÓõÄ'; +$lang['maximum_length']='×î´ó³¤¶È'; +$lang['attribute_types']='ÊôÐÔÀàÐÍ'; +$lang['syntaxes']='Óï·¨¹æÔò'; +$lang['matchingrules']='Æ¥Åä¹æÔò'; +$lang['oid']='OID'; +$lang['obsolete']='×÷·ÏµÄ'; +$lang['ordering']='ÅÅÐò'; +$lang['substring_rule']='×Ó´®¹æÔò'; +$lang['single_valued']='µ¥¸ö¸³ÖµµÄ'; +$lang['collective']='¼¯ÌåµÄ'; +$lang['user_modification']='Óû§ÐÞ¸Ä'; +$lang['usage']='ʹÓøñʽ'; +$lang['could_not_retrieve_schema_from']='²»ÄÜÕһظñʽµÄµØ·½'; +$lang['type']='ÀàÐÍ'; +$lang['no_such_schema_item'] = 'ûÓÐÕâÑùµÄ¸ñʽÏîÄ¿£º "%s"'; + +// Deleting entries +$lang['entry_deleted_successfully'] = '³É¹¦É¾³ýÌõÄ¿£º%s¡£'; +$lang['you_must_specify_a_dn'] = 'Äã±ØÐëÖ¸¶¨Ò»¸öDN'; +$lang['could_not_delete_entry'] = '²»ÄÜɾ³ý¸ÃÌõÄ¿£º %s'; +$lang['no_such_entry'] = 'ûÓÐÕâÑùµÄÌõÄ¿£º %s'; +$lang['delete_dn'] = 'ɾ³ý£º%s'; +$lang['permanently_delete_children'] = 'Ò²ÒªÓÀ¾Ãɾ³ýËùµÄ×ÓÌõÄ¿Âð£¿'; +$lang['entry_is_root_sub_tree'] = '¸ÃÌõÄ¿ÊǸù£¬Æä×ÓÊ÷Öаüº¬ÓÐÌõÄ¿£º%s¡£'; +$lang['view_entries'] = '²é¿´ÌõÄ¿'; +$lang['confirm_recursive_delete'] = 'phpLDAPadmin¿ÉÒԵݹéµØɾ³ý¸ÃÌõÄ¿¼°ÆäËùÓÐ×ÓÌõÄ¿Öеģº%s¡£ ¹ØÓÚÕâ¸ö¶¯×÷¿ÉÄÜ»áɾ³ýµÄËùÓÐÌõÄ¿ÁÐ±í£¬Çë²é¿´ÏÂÃæ¡£ ÄãÕæµÄÏëÕâÑù×öÂð£¿'; +$lang['confirm_recursive_delete_note'] = '×¢ÊÍ£º Õâ¸ö¿ÉÄÜDZÔÚΣÏÕ£¬ºó¹û×Ô¸º¡£ Õâ¸ö²Ù×÷²»¿É»Ö¸´¡£ Ò»¶¨Òª¿¼Âǵ½aliases£¨±ðÃû£©¡¢ referrals£¨ÌáÃû£©ÒÔ¼°ÆäËü¿ÉÄÜÒýÆðÎÊÌâµÄÊÂÇé¡£'; +$lang['delete_all_x_objects'] = 'ɾ³ýËùÓеĶÔÏó£º%s '; +$lang['recursive_delete_progress'] = 'µÝ¹éʽɾ³ý¹ý³Ì'; +$lang['entry_and_sub_tree_deleted_successfully'] = '³É¹¦É¾³ýÌõÄ¿%s ºÍ×ÓÊ÷¡£'; +$lang['failed_to_delete_entry'] = 'ɾ³ýÌõÄ¿£º%s ʧ°Ü'; +$lang['list_of_entries_to_be_deleted'] = '½«±»É¾³ýµÄÌõÄ¿ÁÐ±í£º'; +$lang['sure_permanent_delete_object']='È·ÈÏÄãÏëÓÀ¾Ãɾ³ýÕâ¸ö¶ÔÏóÂð£¿'; +$lang['dn'] = 'DN'; + +// Deleting attributes +$lang['attr_is_read_only'] = ' ÔÚphpLDAPadminµÄÅäÖÃÖУ¬ÊôÐÔ"%s"±»±êʶΪֻ¶Á¡£'; +$lang['no_attr_specified'] = 'ûÓÐÖ¸¶¨ÊôÐÔÃû³Æ¡£'; +$lang['no_dn_specified'] = 'ûÓÐÖ¸¶¨DN '; + +// Adding attributes +$lang['left_attr_blank'] = 'ÊôÐÔֵΪ¿Õ°×¡£ Çë·µ»ØÔÙÊÔ¡£'; +$lang['failed_to_add_attr'] = 'Ôö¼ÓÊôÐÔʧ°Ü¡£'; +$lang['file_empty'] = 'ÄãÑ¡ÔñµÄÎļþΪ¿Õ»ò²»´æÔÚ¡£ Çë·µ»ØÔÙÊÔ¡£'; +$lang['invalid_file'] = '°²È«´íÎó£º ÉÏ´«µÄÕâ¸öÎļþ¿ÉÄÜ´æÔÚ°²È«Î£ÏÕ¡£'; +$lang['warning_file_uploads_disabled'] = 'ÄãµÄPHPÅäÖò»ÔÊÐíÉÏ´«Îļþ¡£ ÇëÔÚ½øÐÐϲ½Ö®Ç°¼ì²éÒ»ÏÂphp.ini¡£'; +$lang['uploaded_file_too_big'] = 'ÄãÉÏ´«µÄÎļþÌ«´ó¡£ Çë¼ì²éphp.iniÖеÄupload_max_size ÉèÖÃ'; +$lang['uploaded_file_partial'] = 'ÄãÑ¡ÔñµÄÎļþÉÏ´«²»ÍêÕû£¬¿ÉÄÜÊÇÒòΪÍøÂçµÄÔµ¹Ê¡£'; +$lang['max_file_size'] = '×î´óÎļþ³ß´ç£º %s'; + +// Updating values +$lang['modification_successful'] = '³É¹¦Ð޸ģ¡'; +$lang['change_password_new_login'] = 'ÒòΪÄã¸ü¸ÄÁËÃÜÂ룬ÄãÏÖÔÚ±ØÐëʹÓÃеÄÃÜÂëÖØеǼ¡£'; + +// Adding objectClass form +$lang['new_required_attrs'] = 'ÐÂÔö±ØÐèµÄÊôÐÔ'; +$lang['requires_to_add'] = 'Õâ¸ö¶¯×÷ÒªÇóÄãÔö¼Ó'; +$lang['new_attributes'] = 'ÐÂÔöÊôÐÔ'; +$lang['new_required_attrs_instructions'] = 'Ö¸µ¼£º ΪÁËÔö¼ÓÕâ¸öobjectClass µ½¸ÃÌõÄ¿£¬Äã±ØÐëÖ¸¶¨'; +$lang['that_this_oclass_requires'] = 'Õâ¸ÃobjectClassËù±ØÐèµÄ¡£ Äã¿ÉÒÔÔÚÕâ¸ö±íÀïÍê³É¡£'; +$lang['add_oclass_and_attrs'] = 'Ôö¼ÓObjectClass ºÍÊôÐÔ'; +$lang['objectclasses'] = 'ObjectClasses'; + +// General +$lang['chooser_link_tooltip'] = 'µã»÷µ¯³öÒ»¸ö¶Ô»°¿òÀ´ÒÔͼÐη½Ê½Ñ¡ÔñÒ»¸öÌõÄ¿(DN) '; +$lang['no_updates_in_read_only_mode'] = '·þÎñÆ÷ÊÇÒÔÖ»¶Á·½Ê½ÔËÐУ¬Äã²»ÄÜÍê³É¸üÐÂ'; +$lang['bad_server_id'] = '´íÎóµÄ·þÎñÆ÷id'; +$lang['not_enough_login_info'] = 'ûÓÐ×ã¹»µÄÐÅÏ¢À´µÇ¼·þÎñÆ÷¡£ Çë¼ì²éÄãµÄÅäÖá£'; +$lang['could_not_connect'] = '²»ÄÜÁ¬½Óµ½LDAP·þÎñÆ÷¡£'; +$lang['could_not_connect_to_host_on_port'] = '²»ÄÜÁ¬½Óµ½"%s" µÄ"%s"¶Ë¿Ú'; +$lang['could_not_perform_ldap_mod_add'] = '²»ÄÜÍê³Éldap_mod_add ²Ù×÷¡£'; +//$lang['bad_server_id_underline'] = '´íÎóµÄserver_id£º'; +$lang['home'] = 'Ö÷Ò³'; +$lang['help'] = '°ïÖú'; +$lang['success'] = '³É¹¦'; +$lang['server_colon_pare'] = '·þÎñÆ÷£º'; +$lang['look_in'] = 'ÕýÔڲ鿴£º'; +//$lang['missing_server_id_in_query_string'] = 'ÔÚ²éѯ´®ÖÐûÓÐÖ¸¶¨·þÎñÆ÷ID£¡'; +$lang['missing_dn_in_query_string'] = 'ÔÚ²éѯ´®ÖÐûÓÐÖ¸¶¨DN£¡'; +$lang['back_up_p'] = 'ºóÍË...'; +$lang['no_entries'] = 'ûÓÐÌõÄ¿'; +//$lang['not_logged_in'] = 'ûÓеǼ'; +$lang['could_not_det_base_dn'] = '²»ÄÜÈ·¶¨base DN£¨»ùDN£©'; +//$lang['please_report_this_as_a_bug']='Ç뱨¸æÕâ¸ö´í©¡£'; +$lang['reasons_for_error']='³öÏÖÕâÖÖÇé¿ö¿ÉÄÜÓм¸¸öÔ­Òò£¬ÆäÖÐ×îÓпÉÄܵÄÊÇ£º'; +$lang['yes']='ÊÇ'; +$lang['no']='²»'; +$lang['go']='¿ªÊ¼'; +$lang['delete']='ɾ³ý'; +$lang['back']='ºóÍË'; +$lang['object']='¶ÔÏó'; +$lang['delete_all']='ɾ³ýËùÓеÄ'; +//$lang['url_bug_report']='https://sourceforge.net/tracker/?func=add&group_id=61828&atid=498546'; +$lang['hint'] = 'Ìáʾ'; +$lang['bug'] = '´í©'; +$lang['warning'] = '¾¯¸æ'; +$lang['light'] = 'light'; // µ¥´Ê'light' À´×Ô 'light bulb£¨µçµÆÅÝ£©' +$lang['proceed_gt'] = '¼ÌÐø >>'; +$lang['no_blowfish_secret'] = 'phpLDAPadmin²»ÄÜ°²È«µØ¼ÓÃܺͽâÃÜÄãµÄÃô¸ÐÐÅÏ¢£¬ÒòΪÔÚconfig.phpÊÇûÓÐÉèÖÃ$blowfish_secret¡£ÏÖÔÚ£¬ÄãÐèÒª±à¼­config.php£¬²¢ÉèÖÃ$blowfish_secretΪijÖÖÒþÃصÄ×Ö·û´®¡£'; +$lang['jpeg_dir_not_writable'] = 'ÇëÔÚphpLDAPadminµÄconfig.phpÀ½«$jpeg_temp_dirÉèÖõ½Ò»¸ö¿ÉдµÄĿ¼'; +$lang['jpeg_dir_not_writable_error'] = '²»Äܽ«%sдÈë$jpeg_temp_dirĿ¼¡£ÇëÈ·¶¨ÄãµÄweb·þÎñÆ÷Äܹ»ÔÚÄÇÀïдÎļþ¡£'; +$lang['jpeg_unable_toget'] = '²»ÄÜ´ÓLDAP·þÎñÆ÷ΪÊôÐÔ%s»ñµÃjpegÊý¾Ý¡£'; +$lang['jpeg_delete'] = 'ɾ³ýͼƬ'; + + + +// Add value form +$lang['add_new'] = 'ÐÂÔö'; +$lang['value_to'] = '¸³Öµ¸ø'; +$lang['distinguished_name'] = 'ʶ±ðÃû£¨DN£©'; +$lang['current_list_of'] = 'µ±Ç°Áбí'; +$lang['values_for_attribute'] = 'ÊôÐÔÖµ'; +$lang['inappropriate_matching_note'] = '×¢ÊÍ£º Èç¹ûÔÚÄãµÄLDAP·þÎñÆ÷ÉÏûÓÐΪÕâ¸öÊôÐÔÉèÖÃEQUALITY ¹æÔòµÄ»°£¬Äã¿ÉÄÜ»áÅöµ½"inappropriate matching£¨²»ÕýÈ·µÄÆ¥Å䣩"ÕâÑùµÄ´íÎó¡£'; +$lang['enter_value_to_add'] = 'ÊäÈëÄãÏëÔö¼ÓµÄÖµ£º'; +$lang['new_required_attrs_note'] = '×¢ÊÍ£º ¿ÉÄÜ»áÒªÇóÄãÊäÈë¸ÃobjectClassËù±ØÐèµÄÐÂÊôÐÔ¡£'; +$lang['syntax'] = '¹æÔò'; + +//copy.php +$lang['copy_server_read_only'] = '·þÎñÆ÷´¦ÓÚÖ»¶Áģʽ£¬Äã²»ÄÜÍê³É¸üÐÂ'; +$lang['copy_dest_dn_blank'] = ' Ä¿±êDNÏîΪ¿Õ¡£'; +$lang['copy_dest_already_exists'] = 'Ä¿±êÌõÄ¿ (%s) ÒѾ­´æÔÚ¡£'; +$lang['copy_dest_container_does_not_exist'] = 'Ä¿±êÈÝÆ÷ (%s) ²»´æÔÚ¡£'; +$lang['copy_source_dest_dn_same'] = 'Ô´ºÍÄ¿±êDN Ïàͬ¡£'; +$lang['copy_copying'] = 'ÕýÔÚ¸´ÖÆ '; +$lang['copy_recursive_copy_progress'] = 'µÝ¹éÊÖ¸´Öƹý³Ì'; +$lang['copy_building_snapshot'] = 'ÕýÔÚ½¨Á¢ÓÃÓÚ¸´ÖƵÄÊ÷µÄ¿ìÕÕ¡­ '; +$lang['copy_successful_like_to'] = '¸´ÖƳɹ¦£¡ Ä㻹ÏëÒª '; +$lang['copy_view_new_entry'] = '²é¿´ÐÂÌõÄ¿'; +$lang['copy_failed'] = '¸´ÖÆDN²»³É¹¦£º '; + +//edit.php +$lang['missing_template_file'] = '¾¯¸æ£º Ñù°åÎļþ²»´æÔÚ£¬'; +$lang['using_default'] = 'ʹÓÃĬÈϵġ£'; +$lang['template'] = 'Ñù°å'; +$lang['must_choose_template'] = 'Äã±ØÐëÑ¡ÔñÒ»¸öÑù°å'; +$lang['invalid_template'] = '%s ÊÇÒ»¸ö·Ç·¨µÄÑù°å'; +$lang['using_template'] = 'ʹÓÃÑù°å'; +$lang['go_to_dn'] = 'תµ½ %s'; +$lang['structural_object_class_cannot_remove'] = 'ÕâÊǸö½á¹¹»¯µÄObjectClass£¬Òò´Ë²»ÄÜÒƳý¡£'; +$lang['structural'] = '½á¹¹»¯'; + +//copy_form.php +$lang['copyf_title_copy'] = '¸´ÖÆ'; +$lang['copyf_to_new_object'] = '³ÉΪһ¸öеĶÔÏó'; +$lang['copyf_dest_dn'] = 'Ä¿±êDN'; +$lang['copyf_dest_dn_tooltip'] = 'ÔÚ¸´ÖƸÃÔ´ÌõĿʱ£¬½«±»½¨Á¢µÄÐÂÌõÄ¿µÄÍêÕûDN '; +$lang['copyf_dest_server'] = 'Ä¿±ê·þÎñÆ÷'; +$lang['copyf_note'] = 'Ìáʾ£º ÔÚÁ½¸ö²»Í¬µÄ·þÎñÆ÷Ö®¼ä¸´ÖÆʱ£¬ÒªÇóËüÃÇûÓÐ"schema£¨¸ñʽ£©³åÍ»"'; +$lang['copyf_recursive_copy'] = 'ÁíÍ⻹ҪµÝ¹é¸´Öƴ˶ÔÏóµÄËùÓÐ×ÓÄÚÈÝ¡£'; +$lang['recursive_copy'] = 'µÝ¹é¸´ÖÆ'; +$lang['filter'] = '¹ýÂËÆ÷'; +//$lang['search_filter'] = 'ËÑË÷¹ýÂËÆ÷'; +$lang['filter_tooltip'] = 'ÔÚÍê³ÉÒ»¸öµÝ¹é¸´ÖÆʱ£¬Ö»»á¸´ÖÆÄÄЩƥÅäÕâ¸ö¹ýÂËÆ÷µÄÌõÄ¿¡£'; +$lang['delete_after_copy'] = '¸´Öƺóɾ³ý£¨¼´Òƶ¯£©£º'; +$lang['delete_after_copy_warn'] = 'È·ÈÏÄãµÄ¹ýÂËÆ÷£¨¼ûÉÏÃ棩»áÑ¡ÔñËùÓеÄ×ӼǼ¡£'; + +//create.php +$lang['create_required_attribute'] = '±ØÐèÊôÐÔ(%s)µÄֵΪ¿Õ°×¡£'; +$lang['redirecting'] = 'Öض¨Ïò...'; +$lang['here'] = 'ÕâÀï'; +$lang['create_could_not_add'] = '²»ÄÜÔö¼Ó¸Ã¶ÔÏóµ½LDAP·þÎñÆ÷¡£'; + +//create_form.php +$lang['createf_create_object'] = '´´½¨¶ÔÏó'; +$lang['createf_choose_temp'] = 'Ñ¡ÔñÑù°å'; +$lang['createf_select_temp'] = 'Ñ¡ÔñÓÃÓÚ´´½¨¹ý³ÌµÄÑù°å'; +$lang['save_as_file'] = 'Áí´æΪÎļþ'; +$lang['rdn_field_blank'] = 'RDN¶ÎΪ¿Õ°×¡£'; +$lang['container_does_not_exist'] = 'ÄãÖ¸¶¨µÄ(%s)ÈÝÆ÷²»´æÔÚ¡£ ÇëÔÙÊÔÊÔ¡£'; +$lang['no_objectclasses_selected'] = 'ÄãûÓÐΪ¸Ã¶ÔÏóÑ¡ÔñÈκÎObjectClasses¡£ Çë·µ»ØÕÕ×ö¡£'; +$lang['hint_structural_oclass'] = 'Ìáʾ£º Äã±ØÓÐÑ¡ÔñÒ»¸ö½á¹¹»¯µÄobjectClass (ÈçÉÏÃæ´ÖÌåËùÏÔʾµÄ)'; + +//creation_template.php +$lang['ctemplate_on_server'] = 'ÔÚ·þÎñÆ÷ÉÏ'; +$lang['ctemplate_no_template'] = 'ÔÚPOST±äÁ¿ÖÐûÓÐÖ¸¶¨Ñù°å¡£'; +$lang['template_not_readable'] = 'ÄãÔÚÅäÖÃÖÐÖ¸¶¨ÁËÓÃÓÚ¸ÃÑù°åµÄ"%s"µÄÊÖ±ú£¬µ«ÊÇÕâ¸öÎļþÒòΪ½ûֹȨÏÞÌ«Ñϸñ¶ø²»¿É¶Á¡£'; +$lang['template_does_not_exist'] = 'ÄãÔÚÅäÖÃÎļþÖÐÖ¸¶¨ÁËÓÃÓڸà Ñù°åµÄ"%s"µÄÊÖ±ú£¬µ«ÊǸÃÊÖ±úÔÚtemplates/creation Ŀ¼Öв»´æÔÚ¡£'; +$lang['create_step1'] = 'µÚÒ»²½£º Name ºÍ ObjectClass(es)'; +$lang['create_step2'] = 'µÚ¶þ²½£º Ö¸¶¨ÊôÐÔºÍÖµ'; +$lang['relative_distinguished_name'] = 'Relative Distinguished Name£¨Ïà¶Ô±êʶÃû£©'; +$lang['rdn'] = 'RDN'; +$lang['rdn_example'] = '(ÀýÈ磺 cn=MyNewPerson)'; +$lang['container'] = 'Container£¨ÈÝÆ÷£©'; + +// search.php +$lang['you_have_not_logged_into_server'] = 'Ä㻹ûÓеÇÈëËùÑ¡ÔñµÄ·þÎñÆ÷£¬Òò´ËÄã²»ÄÜÔÚËüÉÏÃæÍê³ÉËÑË÷¡£'; +$lang['click_to_go_to_login_form'] = 'µã»÷ÕâÀïתµ½µÇ¼±í¸ñ'; +$lang['unrecognized_criteria_option'] = '²»ÈÏʶµÄcriteria£¨±ê×¼£©Ñ¡Ï '; +$lang['if_you_want_to_add_criteria'] = 'Èç¹ûÄãÏëÔö¼Ó×Ô¼ºµÄcriteria µ½ÁбíÀï¡£ ¼ÇµÃ±à¼­search.php À´´¦ÀíËüÃÇ¡£ Í˳ö¡£'; +$lang['entries_found'] = 'ÕÒµ½µÄÌõÄ¿£º '; +$lang['filter_performed'] = 'Ó¦ÓÃÁ˵ĹýÂËÆ÷£º '; +$lang['search_duration'] = 'phpLDAPadminÍê³ÉËÑË÷£¬ÓÃʱ'; +$lang['seconds'] = 'Ãë'; + +// search_form_advanced.php +$lang['scope_in_which_to_search'] = 'ËÑË÷µÄ·¶Î§'; +$lang['scope_sub'] = 'Sub (Õû¸ö×ÓÊ÷)'; +$lang['scope_one'] = 'One (base֮ϵÄÒ»¼¶)'; +$lang['scope_base'] = 'Base (½öÏÞÓÚbase dn)'; +$lang['standard_ldap_search_filter'] = '±ê×¼µÄLDAPËÑË÷¹ýÂËÆ÷¡£ ÀýÈ磺 (&(sn=Smith)(givenname=David))'; +$lang['search_filter'] = 'ËÑË÷¹ýÂËÆ÷'; +$lang['list_of_attrs_to_display_in_results'] = 'ÓÃÓÚÏÔʾÔÚ½á¹ûÖеÄÊôÐÔÁбí(ÒÔ¶ººÅ¸ô¿ª)'; +//$lang['show_attributes'] = 'ÏÔʾÊôÐÔ'; + +// search_form_simple.php +//$lang['search_for_entries_whose'] = '²éÕÒÊÇË­µÄÌõÄ¿£º'; +$lang['equals'] = 'µÈÓÚ'; +$lang['starts with'] = '¿ªÊ¼ÓÚ'; +$lang['contains'] = '°üº¬'; +$lang['ends with'] = '½áÊøÓÚ'; +$lang['sounds like'] = '¿´ÆðÀ´Ïó'; + +// server_info.php +$lang['could_not_fetch_server_info'] = '²»ÄÜ´Ó·þÎñÆ÷ÉÏÈ¡µÃLDAPÐÅÏ¢¡£ ¿ÉÄÜÊÇÒòΪÄãµÄPHP´æÔÚÕâ¸ö´í©£¬»òÕßÊÇÄãµÄLDAP·þÎñÆ÷ÀïÖ¸¶¨µÄ"·ÃÎÊ¿ØÖÆ"½ûÖ¹LDAP¿Í»§¶Ë·ÃÎÊRootDSE¡£'; +$lang['server_info_for'] = '·þÎñÆ÷ÐÅÏ¢£º '; +$lang['server_reports_following'] = 'ÏÂÁÐÐÅÏ¢ÊÇ·þÎñÆ÷±¨¸æµÄ¹ØÓÚËü×Ô¼ºµÄÐÅÏ¢'; +$lang['nothing_to_report'] = '¸Ã·þÎñÆ÷ûÓб¨¸æÈκÎÐÅÏ¢¡£'; + +//update.php +$lang['update_array_malformed'] = '¿´²»¶®update_array¡£ Õâ¿ÉÄÜÊÇphpLDAPadminµÄ´í©¡£ Ç뱨¸æ¡£'; +$lang['could_not_perform_ldap_modify'] = '²»ÄÜÍê³Éldap_modify ²Ù×÷¡£'; + +// update_confirm.php +$lang['do_you_want_to_make_these_changes'] = 'ÄãÏëÓ¦ÓÃÕâЩ±ä»¯Âð£¿'; +$lang['attribute'] = 'ÊôÐÔ'; +$lang['old_value'] = '¾ÉÖµ'; +$lang['new_value'] = 'ÐÂÖµ'; +$lang['attr_deleted'] = '[ɾ³ýµÄÊôÐÔ]'; +$lang['commit'] = 'Ìá½»'; +$lang['cancel'] = 'È¡Ïû'; +$lang['you_made_no_changes'] = 'ÄãûÓнøÐиü¸Ä'; +$lang['go_back'] = '·µ»Ø'; +$lang['unable_create_samba_pass'] = '²»Äܽ¨Á¢sambaÃÜÂë¡£ÇëÔÚtemplate_config.phpÀï¼ì²éÄãµÄÅäÖÃ'; + +// welcome.php +$lang['welcome_note'] = 'ʹÓÃ×ó±ß²Ëµ¥À´µ¼º½'; +$lang['credits'] = 'ÈÙÓþ'; +$lang['changelog'] = '±ä¸ü¼Ç¼'; +$lang['donate'] = '¾èÔù'; +$lang['pla_logo'] = 'phpLDAPadmin ±êʶ'; + +// Donate.php +$lang['donation_instructions'] = 'Ïë¾è¿î¸øphpLDAPadminÏîÄ¿£¬Çëµã»÷ÏÂÃæPayPal°´Å¥ÖеÄÒ»¸ö¡£'; +$lang['donate_amount'] = '¾èÔù %s'; +//$lang['wish_list_option'] = '»òÐíÄã¿ÉÒÔÂò·ÝÀñÎï¸øphpLDAPadmin¿ª·¢ÈËÔ±¡£'; +//$lang['wish_list'] = '²é¿´DaveµÄphpLDAPadmin Ô¸ÍûÁбí'; + +$lang['purge_cache'] = 'Çå¿Õ»º´æ'; +$lang['no_cache_to_purge'] = 'ûÓлº´æ¿ÉÇå¿Õ¡£'; +$lang['done_purging_caches'] = 'Çå¿Õ»º´æ%s ¸ö×Ö½Ú¡£'; +$lang['purge_cache_tooltip'] = 'Çå¿ÕËùÓÐÔÚphpLDAPadminÖлº´æµÄÊý¾Ý£¬°üÀ¨·þÎñÆ÷schema£¨¸ñʽ£©¡£'; + +// view_jpeg_photo.php +$lang['unsafe_file_name'] = '²»°²È«µÄÎļþÃû£º '; +$lang['no_such_file'] = 'ûÓÐÕâÑùµÄÎļþ£º '; + +//function.php +$lang['auto_update_not_setup'] = 'ÔÚÄãµÄÅäÖÃÖÐΪ %s ÆôÓÃÁËauto_uid_numbers£¬ + µ«ÊÇÄãûÓÐÖ¸¶¨auto_uid_number_mechanism¡£ Çë¸üÕý + Õâ¸öÎÊÌâ'; +$lang['uidpool_not_set'] = 'ÄãÔÚ·þÎñ%sµÄÅäÖÃÖÐÖ¸¶¨"auto_uid_number_mechanism" Ϊ "uidpool"£¬ + µ«ÊÇÄãûÓÐÖ¸¶¨ + audo_uid_number_uid_pool_dn¡£ ÇëÔÚ½øÐÐϲ½Ç°Ö¸¶¨Ëü¡£'; +$lang['uidpool_not_exist'] = 'ºÃÏñÄãÔÚÅäÖÃ("%s")ÖÐÖ¸¶¨µÄuidPool + ²»´æÔÚ¡£'; +$lang['specified_uidpool'] = 'ÄãÔÚ·þÎñÆ÷%sµÄÅäÖÃÎļþÖÐÖ¸¶¨ÁË"auto_uid_number_mechanism" Ϊ "search"£¬ + µ«ÊÇÄãûÓÐÖ¸¶¨ + "auto_uid_number_search_base"¡£ ÇëÔÚ½øÐÐϲ½Ç°Ö¸¶¨Ëü¡£'; +$lang['auto_uid_invalid_credential'] = 'ʹÓÃauto_uid credentials²»Äܰ󶨵½%s¡£ Çë¼ì²éÄãµÄÅäÖÃÎļþ¡£'; +$lang['bad_auto_uid_search_base'] = 'ÄãµÄphpLDAPadminÅäÖÃΪ·þÎñÆ÷%sÖ¸¶¨ÁËÒ»¸ö·Ç·¨µÄauto_uid_search_base '; +$lang['auto_uid_invalid_value'] = 'ÄãÔÚÅäÖÃÎļþÖÐΪauto_uid_number_mechanism ("%s")Ö¸¶¨ÁËÒ»¸ö·Ç·¨µÄÖµ + ¡£ Ö»ÓÐ"uidpool" ºÍ "search" ÊǺϷ¨µÄ¡£ + Çë¸üÕýÕâ¸öÎÊÌâ¡£'; +$lang['error_auth_type_config'] = '´íÎó£º ÔÚÄãµÄÅäÖÃÎļþÖÐÓиö´íÎó¡£ ½öÔÊÐíÓÃÓÚ + $servers²¿·ÖµÄauth_typeµÄֵΪ \'session\', \'cookie\', and \'config\'¡£ ÊäÈë\'%s\'£¬ + ÕâÊDz»ÔÊÐíµÄ¡£ '; +$lang['unique_attrs_invalid_credential'] = '²»ÄÜʹÓÃunique_attrs °ó¶¨µ½%s¡£ Çë¼ì²éÄãµÄÅäÖÃÎļþ¡£'; +$lang['unique_attr_failed'] = 'ÄãÆóͼÔö¼Ó%s (%s) µ½
      %s
      £¬ÕâÊDz»ÔÊÐíµÄ¡£ ¸ÃÊôÐÔ/ÖµÊôÓÚÈκÎÌõÄ¿¡£

      Äã¿ÉÄÜÏëËÑË÷ ¸ÃÌõÌõÄ¿¡£'; +$lang['php_install_not_supports_tls'] = 'Äã°²×°µÄPHP ²»Ö§³ÖTLS¡£'; +$lang['could_not_start_tls'] = '²»ÄÜÆôÓÃTLS¡£ Çë¼ì²éÄãµÄLDAP ·þÎñÆ÷ÅäÖá£'; +$lang['could_not_bind_anon'] = '²»ÄÜÄäÃû°ó¶¨µ½·þÎñÆ÷¡£'; +$lang['could_not_bind'] = '²»Äܰ󶨵½¸ÃLDAP·þÎñÆ÷¡£'; +$lang['anonymous_bind'] = 'ÄäÃû°ó¶¨'; +$lang['bad_user_name_or_password'] = '´íÎóµÄÓû§Ãû»òÃÜÂë¡£ ÇëÔÙÊÔÊÔ¡£'; +//$lang['redirecting_click_if_nothing_happens'] = 'Öض¨Ïò... Èç¹ûûÊ·¢ÉúÇëµã»÷ÕâÀï¡£'; +$lang['successfully_logged_in_to_server'] = '³É¹¦µÇ¼µ½·þÎñÆ÷%s'; +$lang['could_not_set_cookie'] = '²»ÄÜÉèÖÃcookie¡£'; +$lang['ldap_said'] = 'LDAP˵£º %s'; +$lang['ferror_error'] = '³ö´í'; +$lang['fbrowse'] = 'ä¯ÀÀ'; +$lang['delete_photo'] = 'ɾ³ýͼƬ'; +//$lang['install_not_support_blowfish'] = 'Äã°²×°µÄPHP²»Ö§³Öblowfish ¼ÓÃÜ¡£'; +//$lang['install_not_support_md5crypt'] = 'Äã°²×°µÄPHP²»Ö§³Ö md5crypt ¼ÓÃÜ¡£'; +//$lang['install_no_mash'] = 'Äã°²×°µÄPHPûÓÐmhash() º¯Êý¡£ ²»ÄܽøÐÐSHA¹þÏ£¡£'; +$lang['install_not_support_ext_des'] = 'ÄãµÄϵͳ¼ÓÃÜ¿â²»Ö§³ÖÀ©Õ¹µÄDES¼ÓÃÜ¡£'; +$lang['install_not_support_blowfish'] = 'ÄãµÄϵͳ¼ÓÃÜ¿â²»Ö§³Öblowfish¼ÓÃÜ¡£'; +$lang['install_not_support_md5crypt'] = 'ÄãµÄϵͳ¼ÓÃÜ¿â²»Ö§³Ömd5crypt¼ÓÃÜ¡£'; +$lang['jpeg_contains_errors'] = 'jpegPhoto °üº¬Óдí
      '; +$lang['ferror_number'] = '´íÎó´úºÅ %s'; +$lang['ferror_discription'] = 'ÃèÊö£º %s

      '; +$lang['ferror_number_short'] = '´íÎó´úºÅ£º %s

      '; +$lang['ferror_discription_short'] = 'ÃèÊö£º (ûÓÐÃèÊö¿ÉÌṩ)
      '; +$lang['ferror_submit_bug'] = 'ÕâÊǸöphpLDAPadmin ´í©Â𣿠Èç¹ûÊÇ£¬¾ÍÇ뱨¸æÒ»¸ö¡£'; +$lang['ferror_unrecognized_num'] = '²»ÈÏʶµÄ´íÎó´úºÅ£º '; +$lang['ferror_nonfatil_bug'] = '

      エラー:%s
      +
      + Äã·¢ÏÖÁËÒ»¸ö·ÇÖÂʹµÄphpLDAPadmin ´í©£¡
      ´íÎó£º%s (%s)
      Îļþ£º%s ÐÐ %s£¬µ÷Óú¯Êý %s
      °æ±¾£ºPLA: %s, PHP: %s, SAPI: %s +
      Web ·þÎñÆ÷£º%s
      + Çëµã»÷ÕâÀﱨ¸æ¸Ã´í©¡£

      '; +$lang['ferror_congrats_found_bug'] = '¹§Ï²Ä㣡 Äã·¢ÏÖÁËphpLDAPadminµÄÒ»¸ö´í©¡£

      + + + + + + + + + + +
      ´íÎó£º%s
      ¼¶±ð:%s
      Îļþ£º%s
      ÐУº%s
      µ÷ÓÃÕߣº%s
      PLA °æ±¾£º%s
      PHP °æ±¾£º%s
      PHP SAPI:%s
      PHP ·þÎñÆ÷£º%s
      +
      + Çëͨ¹ýµã»÷ÏÂÃæÀ´±¨¸æÕâ¸ö´í©£¡'; + +//ldif_import_form +$lang['import_ldif_file_title'] = 'µ¼ÈëLDIFÎļþ'; +$lang['select_ldif_file'] = 'Ñ¡ÔñÒ»¸öLDIFÎļþ£º'; +$lang['dont_stop_on_errors'] = '·¢Éú´íÎóʱ²»Í£Ö¹'; + +//ldif_import +$lang['add_action'] = 'Ôö¼Ó...'; +$lang['delete_action'] = 'ɾ³ý...'; +$lang['rename_action'] = '¸üÃû...'; +$lang['modify_action'] = 'ÐÞ¸Ä...'; +$lang['warning_no_ldif_version_found'] = 'ûÓÐÕÒµ½°æ±¾ºÅ¡£ ¼ÙÉè 1¡£'; +$lang['valid_dn_line_required'] = 'ÒªÇóÒ»¸öºÏ·¨µÄdnÐС£'; +$lang['missing_uploaded_file'] = '¶ªÊ§ÉÏ´«µÄÎļþ¡£'; +$lang['no_ldif_file_specified'] = 'ûÓÐÖ¸¶¨LDIFÎļþ¡£ ÇëÔÙÊÔÊÔ¡£'; +$lang['ldif_file_empty'] = 'ÉÏ´«µÄLDIF ÎļþΪ¿Õ¡£'; +$lang['empty'] = '¿ÕµÄ'; +$lang['file'] = 'Îļþ'; +$lang['number_bytes'] = '%s ×Ö½Ú'; + +$lang['failed'] = 'ʧ°Ü'; +$lang['ldif_parse_error'] = 'LDIF½âÎö´íÎó'; +$lang['ldif_could_not_add_object'] = '²»ÄÜÔö¼Ó¶ÔÏó£º'; +$lang['ldif_could_not_rename_object'] = '²»ÄܸüÃû¶ÔÏó£º'; +$lang['ldif_could_not_delete_object'] = '²»ÄÜɾ³ý¶ÔÏó£º'; +$lang['ldif_could_not_modify_object'] = '²»ÄÜÐ޸ĶÔÏó£º'; +$lang['ldif_line_number'] = 'Ðкţº'; +$lang['ldif_line'] = 'ÐÐÊý:'; + +// Exports +$lang['export_format'] = 'µ¼³ö¸ñʽ'; +$lang['line_ends'] = 'ÐнáÊø'; +$lang['must_choose_export_format'] = '²»±ØÐëÑ¡ÔñÒ»¸öµ¼³ö¸ñʽ¡£'; +$lang['invalid_export_format'] = '·Ç·¨µÄµ¼³ö¸ñʽ'; +$lang['no_exporter_found'] = 'ûÓÐÕÒµ½¿ÉÓõ¼³öÆ÷¡£'; +$lang['error_performing_search'] = 'ÔÚÖ´ÐÐËÑË÷ʱÅöµ½Ò»¸ö´íÎó¡£'; +$lang['showing_results_x_through_y'] = 'ÏÔʾ½á¹û%s£¬ËüÊÇͨ¹ý%sÀ´Íê³ÉµÄ¡£'; +$lang['searching'] = 'ËÑË÷...'; +$lang['size_limit_exceeded'] = '×¢Ò⣬³¬³öËÑË÷´óСÏÞÖÆ¡£'; +$lang['entry'] = 'ÌõÄ¿'; +$lang['ldif_export_for_dn'] = 'Ϊ£º %s£¬µ¼³öLDIF'; +$lang['generated_on_date'] = 'ÓÉphpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) ÔÚ %sÉÏÉú³ÉµÄ'; +$lang['total_entries'] = 'ÌõÄ¿×ÜÊý'; +$lang['dsml_export_for_dn'] = 'Ϊ£º %s£¬µ¼³öDSLM'; +$lang['include_system_attrs'] = '°üº¬ÏµÍ³ÊôÐÔ'; +$lang['csv_spreadsheet'] = 'CSV (Spreadsheet)'; + +// logins +//$lang['could_not_find_user'] = '²»ÄÜÕÒµ½Óû§"%s"'; +$lang['password_blank'] = 'ÄãµÄÃÜÂëΪ¿Õ¡£'; +//$lang['login_cancelled'] = 'µÇ¼ȡÏûÁË¡£'; +$lang['no_one_logged_in'] = 'ûÈ˵Ǽµ½¸Ã·þÎñÆ÷¡£'; +$lang['could_not_logout'] = '²»ÄÜÍ˳ö¡£'; +$lang['unknown_auth_type'] = '²»ÄÜʶ±ðµÄauth_type£º %s'; +$lang['logged_out_successfully'] = '³É¹¦´Ó%s·þÎñÆ÷Í˳ö'; +$lang['authenticate_to_server'] = 'ÈÏÖ¤µ½·þÎñÆ÷%s'; +$lang['warning_this_web_connection_is_unencrypted'] = '¾¯¸æ£º ´ËwebÁ¬½ÓûÓмÓÃÜ¡£'; +$lang['not_using_https'] = 'ÄãûÓÐʹÓÃ\'https\'¡£ Webä¯ÀÀÆ÷½«»áÒÔÃ÷ÎÄ´«ÊäµÇ¼ÐÅÏ¢¡£'; +$lang['login_dn'] = 'µÇ¼DN'; +$lang['user_name'] = 'Óû§Ãû'; +$lang['password'] = 'ÃÜÂë'; +$lang['authenticate'] = 'ÈÏÖ¤'; +$lang['login_not_allowed'] = '¶Ô²»Æð£¬Õą̂LDAP·þÎñÆ÷²»ÔÊÐíÄãʹÓÃphpLDAPadmin¡£'; + +// Entry browser +$lang['entry_chooser_title'] = 'ÌõÄ¿Ñ¡ÔñÆ÷'; + +// Index page +$lang['need_to_configure'] = 'ÄãÐèÒªÅäÖÃphpLDAPadmin¡£ ±à¼­Îļþ\'config.php\'¾Í¿ÉÒÔ¡£ ÓиöÑùÀýÅäÖÃÎļþÌṩÔÚ \'config.php.example\'Àï'; + +// Mass deletes +$lang['no_deletes_in_read_only'] = 'ÔÚÖ»¶Áģʽϲ»ÔÊÐíɾ³ý¡£'; +$lang['error_calling_mass_delete'] = '´íÎóµ÷ÓÃmass_delete.php¡£ÔÚPOST±äÁ¿ÖжªÊ§ mass_delete¡£'; +$lang['mass_delete_not_array'] = 'mass_delete POST ±äÁ¿²»ÊǸöÊý×é¡£'; +$lang['mass_delete_not_enabled'] = 'Mass deletion(´óÁ¿É¾³ý)ûÓÐÆôÓᣠÇëÔÚ½øÐÐÏÂÒ»²½Ç°ÔÚconfig.phpÖÐÆôÓÃËü¡£'; +$lang['search_attrs_wrong_count'] = 'ÄãµÄconfig.phpÓиö´íÎó¡£ ÔÚ$search_attributes ºÍ $search_attributes_displayÀïµÄÊôÐÔ±àºÅ²»Ò»Ñù'; +$lang['mass_deleting'] = 'ÕýÔÚ´óÁ¿É¾³ý'; +$lang['mass_delete_progress'] = '·þÎñÆ÷"%s"ÉϵÄɾ³ý¹ý³Ì'; +$lang['malformed_mass_delete_array'] = '²»¹æÔòµÄmass_delete Êý×é¡£'; +$lang['no_entries_to_delete'] = 'ÄãûÓÐÑ¡ÔñÈκÎҪɾ³ýµÄÌõÄ¿¡£'; +$lang['deleting_dn'] = 'ÕýÔÚɾ³ý %s'; +$lang['total_entries_failed'] = 'ɾ³ýÌõÄ¿%s£¨ÊôÓÚ%s£©Ê§°Ü¡£'; +$lang['all_entries_successful'] = 'ËùÓÐÌõĿɾ³ý³É¹¦¡£'; +$lang['confirm_mass_delete'] = 'È·ÈÏ´óÁ¿É¾³ýÌõÄ¿%s£¨ÔÚ·þÎñÆ÷%sÉÏ£©'; +$lang['yes_delete'] = 'Êǵģ¬É¾³ý£¡'; + +// Renaming entries +$lang['non_leaf_nodes_cannot_be_renamed'] = 'Äã²»ÄܸüÃûÒ»¸ö´øÓÐ×ÓÌõÄ¿µÄÌõÄ¿£¬¾ÙÀý£¬¸üÃû²Ù×÷ÔÊÐíÔÚ·ÇÒ¶×ÓÌõÄ¿ÉÏÍê³É'; +$lang['no_rdn_change'] = 'Äã²»Äܸü¸ÄRDN'; +$lang['invalid_rdn'] = 'ÎÞЧµÄRDNÖµ'; +$lang['could_not_rename'] = '²»ÄܸüÃû¸ÃÌõÄ¿'; + +// General errors +//$lang['php5_unsupported'] = 'phpLDAPadmin »¹²»Ö§³ÖPHP 5¡£Èç¹ûÄã¼ÌÐø¿ÉÄÜ»áÓöµ½Ðí¶àÒâÏë²»µ½µÄÎÊÌâ¡£'; +$lang['mismatched_search_attr_config'] = 'ÄãµÄÅäÖÃÓиö´íÎó¡£ $search_attributes Óë $search_attributes_display ±ØÐëÒªÓÐÏàͬÊýÄ¿µÄÊôÐÔ¡£'; + +// Password checker +$lang['passwords_match'] = 'ÃÜÂëÆ¥Å䣡'; +$lang['passwords_do_not_match'] = 'ÃÜÂ벻ƥÅ䣡'; +$lang['password_checker_tool'] = 'ÃÜÂë¼ì²é¹¤¾ß'; +$lang['compare'] = '±È½Ï'; +$lang['to'] = 'Óë'; + +// Templates +$lang['using'] = 'ʹÓøÃ'; +//$lang['template'] = 'Ä£°å'; +$lang['switch_to'] = 'Äã¿ÉÒÔת»»µ½'; +$lang['default_template'] = 'ĬÈÏÄ£°å'; + +// template_config +$lang['user_account'] = 'Óû§Õ˺Å(posixAccount)'; +$lang['address_book_inet'] = 'µØÖ·²¾ÌõÄ¿(inetOrgPerson)'; +$lang['address_book_moz'] = 'µØÖ·²¾ÌõÄ¿(mozillaOrgPerson)'; +$lang['kolab_user'] = 'KolabÓû§ÌõÄ¿'; +$lang['organizational_unit'] = '×éÖ¯»¯µ¥Ôª(Organizational Unit)'; +$lang['organizational_role'] = '×éÖ¯»¯½ÇÉ«'; +$lang['posix_group'] = 'Posix×é'; +$lang['samba_machine'] = 'Samba NT Ö÷»ú'; +$lang['samba3_machine'] = 'Samba 3 NT Ö÷»ú'; +$lang['samba_user'] = 'Samba Óû§'; +$lang['samba3_user'] = 'Samba 3 Óû§'; +$lang['samba3_group'] = 'Samba 3 ×éÓ³Ïñ(Mapping)'; +$lang['dns_entry'] = 'DNS ÌõÄ¿'; +$lang['simple_sec_object'] = '¼òµ¥°²È«¶ÔÏó(Simple Security Object)'; +$lang['courier_mail_account'] = 'Courier ÓʼþÕ˺Å'; +$lang['courier_mail_alias'] = 'Courier Óʼþ±ðÃû'; +$lang['ldap_alias'] = 'LDAP ±ðÃû'; +$lang['sendmail_cluster'] = 'Sendmail ¼¯Èº'; +$lang['sendmail_domain'] = 'Sendmail Óò'; +$lang['sendmail_alias'] = 'Sendmail ±ðÃû'; +$lang['sendmail_virt_dom'] = 'Sendmail ÐéÄâÓò'; +$lang['sendmail_virt_users'] = 'Sendmail ÐéÄâÓû§'; +$lang['sendmail_relays'] = 'Sendmail »Ø¸´'; +$lang['custom'] = '×Ô¶¨Òå'; +$lang['samba_domain_name'] = 'ÎÒµÄSambaÓòÃû'; +$lang['administrators'] = '¹ÜÀíÔ±'; +$lang['users'] = 'Óû§'; +$lang['guests'] = 'Ò»°ãÓû§(Guests)'; +$lang['power_users'] = 'ÔöÇ¿Óû§(Power Users)'; +$lang['account_ops'] = 'Õ˺ŹÜÀíÔ±'; +$lang['server_ops'] = '·þÎñÆ÷¹ÜÀíÔ±'; +$lang['print_ops'] = '´òÓ¡¹ÜÀíÔ±'; +$lang['backup_ops'] = '±¸·Ý¹ÜÀíÔ±'; +$lang['replicator'] = '¸´ÖÆÆ÷(Replicator)'; +$lang['unable_smb_passwords'] = '²»Äܽ¨Á¢SambaÃÜÂë¡£Çë¼ì²éÎļþtemplate_config.phpÀïµÄÅäÖá£'; +$lang['err_smb_conf'] = '´íÎó£ºÔÚÄãµÄsambaÅäÖÃÀïÓиö´íÎó¡£'; +$lang['err_smb_no_name_sid'] = '´íÎó£ºÐèҪΪÄãµÄsambaÓòÌṩһ¸öÃû×Ö(name)ºÍÒ»¸ösid¡£'; +$lang['err_smb_no_name'] = '´íÎó£ºÃ»ÓÐΪsambaÓòÌṩÃû×Ö¡£'; +$lang['err_smb_no_sid'] = '´íÎó£ºÃ»ÓÐΪsambaÓòÌṩsid¡£'; + +// Samba Account Template +$lang['samba_account'] = 'Samba Õ˺Å'; +$lang['samba_account_lcase'] = 'samba Õ˺Å'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'н¨Óû§Õ˺Å'; +$lang['t_hint_customize'] = 'Ìáʾ£ºÏëÒª¶¨ÖÆÄ£°åµÄ»°£¬Äã¿ÉÒԱ༭Îļþtemplates/creation/new_user_template.php'; +$lang['t_name'] = 'Ãû×Ö'; +$lang['t_first_name'] = 'µÚÒ»¸öÃû×Ö'; +$lang['t_last_name'] = '×îºóÒ»¸öÃû×Ö'; +$lang['t_first'] = 'µÚÒ»¸ö'; +$lang['t_last'] = '×îºóÒ»¸ö'; +$lang['t_common_name'] = '¹«ÓÐÃû×Ö(Common name)'; +$lang['t_user_name'] = 'Óû§Ãû'; +$lang['t_password'] = 'ÃÜÂë'; +$lang['t_encryption'] = '¼ÓÃÜ·½·¨'; +$lang['t_login_shell'] = 'µÇ¼Shell'; +$lang['t_home_dir'] = 'Ö÷Ŀ¼'; +$lang['t_uid_number'] = 'UIDºÅ'; +$lang['t_auto_det'] = '£¨×Ô¶¯¼ì²âµ½µÄ£©'; +$lang['t_group'] = '×é'; +$lang['t_gid_number'] = 'GIDºÅ'; +$lang['t_err_passwords'] = 'ÄãµÄÃÜÂ벻ƥÅä¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_err_field_blank'] = '%s´¦²»ÄÜΪ¿Õ¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_err_field_num'] = '%s×ֶβ»ÄÜÖ»ÊäÈëÊý×Ö¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_err_bad_container'] = 'ÄãÖ¸¶¨µÄÈÝÆ÷(%s)²»´æÔÚ¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_confirm_account_creation'] = 'È·ÈÏ´´½¨Õ˺Å'; +$lang['t_secret'] = '[ÒþÃØ]'; +$lang['t_create_account'] = '´´½¨Õ˺Å'; + +// New Address Template +$lang['t_new_address'] = 'н¨µØÖ·²¾ÌõÄ¿'; +$lang['t_organization'] = '×éÖ¯'; +$lang['t_address'] = 'µØÖ·'; +$lang['t_city'] = '³ÇÊÐ'; +$lang['t_postal_code'] = 'ÓÊÕþ±àÂë'; +$lang['t_street'] = '½ÖµÀ'; +$lang['t_work_phone'] = '¹¤×÷µç»°'; +$lang['t_fax'] = '´«Õæ(Fax)'; +$lang['t_mobile'] = 'Òƶ¯µç»°(Mobile)'; +$lang['t_email'] = 'µç×ÓÓʼþ'; +$lang['t_container'] = 'ÈÝÆ÷'; +$lang['t_err_cn_blank'] = '¹«ÓÐÃû×Ö(Common Name)²»ÄÜΪ¿Õ¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_confim_creation'] = 'È·ÈÏ´´½¨ÌõÄ¿£º'; +$lang['t_create_address'] = '´´½¨µØÖ·²¾'; + +// default template +$lang['t_check_pass'] = 'ÕýÔÚ¼ì²éÃÜÂë¡­¡­'; + +// compare form +$lang['compare'] = '±È½Ï'; +$lang['comparing'] = '±È½Ï½ô¸ú×ŵÄDN'; +$lang['compare_dn'] = '±È½ÏÁíÒ»¸öDN¸ú'; +$lang['with'] = 'ͬ '; +$lang['compf_source_dn'] = 'Ô´DN'; +$lang['compf_dn_tooltip'] = '½«¸ÃDNÓëÁíÒ»¸ö±È½Ï'; +$lang['switch_entry'] = 'Çл»ÌõÄ¿'; +$lang['no_value'] = 'ûÓÐÖµ'; +$lang['compare_with'] = 'ͬÁíÒ»¸öÌõÄ¿½øÐбȽÏ'; +$lang['need_oclass'] = 'ÒªÐÂÔöÊôÐÔ%s£¬ÄãÐèÒªÏÂÃæµÄObjectClass(es)¡ª¡ª¶ÔÏóÀà¡£'; + +// Time out page +$lang['session_timed_out_1'] = 'ÄãµÄ»á»°ÆÚ½«ÔÚÎ޻µÄ'; +$lang['session_timed_out_2'] = '·ÖÖÓºó¹ýÆÚ¡£Ä㽫×Ô¶¯Í˳ö¡£'; +$lang['log_back_in'] = 'ÏëµÇ¼»ØÀ´£¬Çëµã»÷ÏÂÃæµÄÁ´½Ó£º'; +$lang['session_timed_out_tree'] = '(»á»°³¬Ê±£¬×Ô¶¯Í˳ö¡£)'; +$lang['timeout_at'] = 'ÔÚ%sÈç¹û»î¶¯£¬Ä㽫±»µÇ³ö¡£'; + + +?> diff --git a/lang/recoded/zh-tw.php b/lang/recoded/zh-tw.php new file mode 100644 index 0000000..c5cb810 --- /dev/null +++ b/lang/recoded/zh-tw.php @@ -0,0 +1,490 @@ +>'; + +// Add value form +$lang['add_new']='新增'; +$lang['value_to']='數值至'; +$lang['distinguished_name']='識別å稱'; +$lang['current_list_of']='此屬性有'; +$lang['values_for_attribute']='下列數值:'; +$lang['inappropriate_matching_note']='請注æ„:若您的LDAP伺æœå™¨ä¸­ä¸¦æœªè¨­å®šç­‰å¼è¦å‰‡ï¼Œæ‚¨å°‡æœƒé‡åˆ°\"ç„¡é©åˆçš„比å°\"錯誤'; +$lang['enter_value_to_add']='請輸入您è¦åŠ å…¥çš„數值'; +$lang['new_required_attrs_note']='請注æ„:由於此objectClass定義的'; +$lang['syntax']='語法,您必須輸入新屬性'; + +//copy.php +$lang['copy_server_read_only']='無法在伺æœå™¨ç‚ºå”¯è®€æ¨¡å¼æ™‚更新資料'; +$lang['copy_dest_dn_blank']='目的地識別å稱ä¸èƒ½æ˜¯ç©ºç™½'; +$lang['copy_dest_already_exists']='目的地識別å稱 (%s) 已經存在'; +$lang['copy_dest_container_does_not_exist']='ç›®çš„åœ°é›†åˆ (%s) ä¸å­˜åœ¨'; +$lang['copy_source_dest_dn_same']='來æºè­˜åˆ¥å稱與目的地識別å稱é‡è¤‡'; +$lang['copy_copying']='複製中'; +$lang['copy_recursive_copy_progress']='éžè¿´è¤‡è£½ä½œæ¥­'; +$lang['copy_building_snapshot']='å°è³‡æ–™æ¨¹å»ºç«‹å‰¯æœ¬ä¾†è¤‡è£½'; +$lang['copy_successful_like_to']='複製æˆåŠŸ!!您è¦'; +$lang['copy_view_new_entry']='查閱此新紀錄?'; +$lang['copy_failed']='以下 DN 複製失敗:'; + +//edit.php +$lang['missing_template_file']='警告:找ä¸åˆ°æ¨£ç‰ˆæª”案'; +$lang['using_default']='使用é è¨­å€¼'; +$lang['template']='樣版'; +$lang['must_choose_template']='ä½ å¿…é ˆé¸æ“‡ä¸€å€‹æ¨£ç‰ˆ'; +$lang['invalid_template']='%s 是錯誤的樣版'; +$lang['using_template']='使用樣版'; +$lang['go_to_dn']='到 %s'; + +//copy_form.php +$lang['copyf_title_copy']='複製'; +$lang['copyf_to_new_object']='æˆæ–°ç‰©ä»¶'; +$lang['copyf_dest_dn']='目的地識別å稱'; +$lang['copyf_dest_dn_tooltip']='來æºè³‡æ–™è¤‡è£½å¾Œçš„完整識別å稱'; +$lang['copyf_dest_server']='目的伺æœå™¨'; +$lang['copyf_note']='æ示:åªæœ‰ç•¶ä¸åŒçš„伺æœå™¨é–“çš„schema相容æ‰èƒ½åœ¨ä¸åŒçš„伺æœå™¨ä¹‹é–“進行複製'; +$lang['copyf_recursive_copy']='éžè¿´è¤‡è£½æ‰€æœ‰æ­¤ç‰©ä»¶çš„å­è³‡æ–™'; +$lang['recursive_copy']='éžè¿´è¤‡è£½'; +$lang['filter']='éŽæ¿¾æ¢ä»¶'; +$lang['filter_tooltip']='åªæœ‰ç¬¦åˆéŽæ¿¾æ¢ä»¶çš„資料會被éžè¿´è¤‡è£½'; + +//create.php +$lang['create_required_attribute']='å¿…è¦çš„屬性 (%s) 必須有資料'; +$lang['redirecting']='正在轉æ›è‡³...'; +$lang['here']='這裡'; +$lang['create_could_not_add']='ä¸èƒ½æ–°å¢žç‰©ä»¶åˆ°æ­¤LDAP伺æœå™¨'; + +//create_form.php +$lang['createf_create_object']='創造物件'; +$lang['createf_choose_temp']='é¸æ“‡æ¨£ç‰ˆ'; +$lang['createf_select_temp']='è«‹é¸æ“‡ä¸€å€‹ä½ è¦å»ºç«‹çš„紀錄模æ¿'; +$lang['createf_proceed']='下一步'; +$lang['rdn_field_blank']='相å°è­˜åˆ¥å稱欄ä½ä¸èƒ½æ˜¯ç©ºç™½'; +$lang['container_does_not_exist']='æ‚¨æŒ‡å®šçš„é›†åˆ (%s) ä¸å­˜åœ¨ï¼Œè«‹é‡æ–°æŒ‡å®š'; +$lang['no_objectclasses_selected']='您必須為此物件指定ObjectClasses'; +$lang['hint_structural_oclass']='æ示:您必須在伺æœå™¨ä¸Šè‡³å°‘'; + +//creation_template.php +$lang['ctemplate_on_server']='é¸æ“‡ä¸€å€‹objectClass'; +$lang['ctemplate_no_template']='在POST變數中並未指定模版'; +$lang['ctemplate_config_handler']='您的設定指定了由æŸå€‹ç¨‹å¼ä¾†åŸ·è¡Œæ­¤æ¨¡ç‰ˆ'; +$lang['ctemplate_handler_does_not_exist']='但此程å¼åœ¨ templates/creation 目錄中找ä¸åˆ°'; +$lang['create_step1']='步驟 1 之 2:å稱與ObjectClass(es)'; +$lang['create_step2']='步驟 2 之 2:指定屬性與數值'; +$lang['relative_distinguished_name']='相å°è­˜åˆ¥å稱'; +$lang['rdn']='相å°è­˜åˆ¥å稱'; +$lang['rdn_example']='(範例: cn=MyNewPerson)(範例: cn=MyNewPerson)'; +$lang['container']='集åˆ'; + +// search.php +$lang['you_have_not_logged_into_server']='您必須先登入伺æœå™¨æ‰èƒ½åœ¨ä¼ºæœå™¨åŸ·è¡Œæœå°‹'; +$lang['click_to_go_to_login_form']='點é¸é€™é‚Šå›žåŽ»ç™»å…¥è¡¨å–®'; +$lang['unrecognized_criteria_option']='無法辨識的基準'; +$lang['if_you_want_to_add_criteria']='如果您è¦åŠ å…¥è‡ªå·±çš„基準到項目列表中,請編輯search.php'; +$lang['entries_found']='找到的紀錄:'; +$lang['filter_performed']='執行éŽæ¿¾æ¢ä»¶'; +$lang['search_duration']='phpLDAPadmin將會'; +$lang['seconds']='馬上執行查詢'; + +// search_form_advanced.php +$lang['scope_in_which_to_search']='æœå°‹ç¯„åœ'; +$lang['scope_sub']='Sub (整個å­æ¨¹)'; +$lang['scope_one']='One (單一階層下)'; +$lang['scope_base']='Base (åªæœ‰åŸºç¤Žè­˜åˆ¥å稱)'; +$lang['standard_ldap_search_filter']='標準的LDAPæœå°‹æ¢ä»¶. 如: (&(sn=Smith)(givenname=David))'; +$lang['search_filter']='éŽæ¿¾æœå°‹'; +$lang['list_of_attrs_to_display_in_results']='下列為æœå°‹çµæžœ(以 , å€éš”)'; +$lang['equals']='等於'; +$lang['starts with']='開始於'; +$lang['contains']='å…§å«'; +$lang['ends with']='çµæŸæ–¼'; +$lang['sounds like']='喜愛的è²éŸ³'; + +// server_info.php +$lang['could_not_fetch_server_info']='無法從伺æœå™¨å–å¾— LDAP 資訊'; +$lang['server_info_for']='伺æœå™¨è³‡è¨Š:'; +$lang['server_reports_following']='伺æœå™¨å›žå ±ä¸‹åˆ—資訊:'; +$lang['nothing_to_report']='此伺æœå™¨æ²’有資訊å¯ä»¥å›žå ±'; + +//update.php +$lang['update_array_malformed']='無法更新陣列,å¯èƒ½æ˜¯phpLDAPadminçš„bug,請回報此å•é¡Œ'; +$lang['could_not_perform_ldap_modify']='無法執行ldap_modifyæ“作'; + +// update_confirm.php +$lang['do_you_want_to_make_these_changes']='您確定è¦åšé€™äº›æ›´å‹•?'; +$lang['attribute']='屬性'; +$lang['old_value']='原設定值'; +$lang['new_value']='新設定æ¤'; +$lang['attr_deleted']='[屬性已刪除]'; +$lang['commit']='é€å‡º'; +$lang['cancel']='å–消'; +$lang['you_made_no_changes']='您並沒有åšä»»ä½•æ›´å‹•'; +$lang['go_back']='回上é '; + +// welcome.php +$lang['welcome_note']='請用左邊的é¸å–®ç€è¦½'; +$lang['credits']='æˆå“¡åˆ—表'; +$lang['changelog']='更新紀錄'; +$lang['donate']='æç»'; + +// view_jpeg_photo.php +$lang['unsafe_file_name']='ä¸å®‰å…¨çš„檔案å稱:'; +$lang['no_such_file']='沒有以下檔案:'; + +//function.php +$lang['auto_update_not_setup']='您在設定中開啟 %sçš„auto_uid_numbers功能,但並未指定auto_uid_number_mechanism,請修正此å•é¡Œ'; +$lang['uidpool_not_set']='伺æœå™¨%sçš„auto_uid_number_mechanism指定為uidpool,但並未指定audo_uid_number_uid_pool_dn,請修正此å•é¡Œå†ç¹¼çºŒ'; +$lang['uidpool_not_exist']='您å†è¨­å®šæª”(\"%s\")中指定的uidPool機制並ä¸å­˜åœ¨'; +$lang['specified_uidpool']='伺æœå™¨%sçš„auto_uid_number_mechanism指定為search,但您並未指定auto_uid_number_search_base,請修正此å•é¡Œå†ç¹¼çºŒ'; +$lang['auto_uid_invalid_credential']='無法以您的auto_uid設定登入%s,請檢查您的設定檔'; +$lang['bad_auto_uid_search_base']='您在phpLDAPadmin設定中å°ä¼ºæœå™¨%s指定了無效的auto_uid_search_base'; +$lang['auto_uid_invalid_value']='您的auto_uid_number_mechanism (\"%s\") 設定是無效的,åªæœ‰uidpool與search為有效設定,請修正此å•é¡Œ'; +$lang['error_auth_type_config']='錯誤:您的設定有錯誤,變數auth_typeåªå…許session , cookie與config,您的設定值 '; +$lang['php_install_not_supports_tls']='您安è£çš„ php ä¸¦æ²’æœ‰æ”¯æ´ TLS.'; +$lang['could_not_start_tls']='無法啟動 TLS 請檢查您的 LDAP 伺æœå™¨è¨­å®š.'; +$lang['could_not_bind_anon']='伺æœå™¨ä¸æŽ¥å—匿å登入'; +$lang['anonymous_bind']='匿å登入'; +$lang['bad_user_name_or_password']='錯誤的 使用者å稱 或 密碼.è«‹é‡æ–°è¼¸å…¥ä¸€æ¬¡.'; +$lang['redirecting_click_if_nothing_happens']='正在é‡æ–°å°Žå‘...如果ç€è¦½å™¨æ²’有動作,請點é¸é€™è£¡.'; +$lang['successfully_logged_in_to_server']='æˆåŠŸç™»å…¥ä¼ºæœå™¨ %s'; +$lang['could_not_set_cookie']='ä¸èƒ½è¨­å®š cookie'; +$lang['ldap_said']='伺æœå™¨å›žæ‡‰: %s'; +$lang['ferror_error']='錯誤'; +$lang['fbrowse']='ç€è¦½'; +$lang['delete_photo']='刪除相片'; +$lang['install_not_support_blowfish']='您所安è£çš„ PHP 並ä¸æ”¯æ´ Blowfish 加密'; +$lang['install_no_mash']='您所安è£çš„ PHP 並沒有 mhash() 函數,無法進行 SHA 加密'; +$lang['jpeg_contains_errors']='jpegPhoto 內容發生錯誤
      '; +$lang['ferror_number']='錯誤碼: %s (%s)'; +$lang['ferror_discription']='說明: %s

      '; +$lang['ferror_number_short']='錯誤編號: %s'; +$lang['ferror_discription_short']='說明: (無任何說明內容)
      '; +$lang['ferror_submit_bug']='這是 phpLDAPadmin 的 bug? 如果是,請回報這個Bug.'; +$lang['ferror_unrecognized_num']='無法辨識的錯誤代碼:'; +$lang['ferror_nonfatil_bug']='
      +
      + You found a non-fatal phpLDAPadmin bug!
      Error:%s (%s)
      File:%s line %s, caller %s
      Versions:PLA: %s, PHP: %s, SAPI: %s +
      Web server:%s
      + Please report this bug by clicking here.

      '; +$lang['ferror_congrats_found_bug']='æ­å–œ! 您發ç¾äº†phpLDAPadminçš„bug.

      + + + + + + + + + +
      Error:%s
      Level:%s
      File:%s
      Line:%s
      Caller:%s
      PLA Version:%s
      PHP Version:%s
      PHP SAPI:%s
      Web server:%s
      +
      + Please report this bug by clicking below!'; + +//ldif_import_form +$lang['import_ldif_file_title']='匯入 LDIF 檔案'; +$lang['select_ldif_file']='é¸æ“‡ä¸€å€‹ LDIF 檔案:'; +$lang['select_ldif_file_proceed']='下一步'; + +//ldif_import +$lang['add_action']='增加中...'; +$lang['delete_action']='刪除中...'; +$lang['rename_action']='æ›´å中...'; +$lang['modify_action']='改變中...'; +$lang['warning_no_ldif_version_found']='找ä¸åˆ°ç‰ˆæœ¬è³‡è¨Šï¼Œé è¨­ä½¿ç”¨ç‰ˆæœ¬1'; +$lang['valid_dn_line_required']='需è¦æœ‰æ•ˆçš„識別å稱行'; +$lang['missing_uploaded_file']='找ä¸åˆ°æŒ‡å®šçš„上傳檔案'; +$lang['no_ldif_file_specified.']='沒有指定LDIF檔案請é‡è©¦'; +$lang['ldif_file_empty']='上傳的 LDIF 檔案是空白的'; +$lang['file']='檔案'; +$lang['number_bytes']='%s bytes'; +$lang['failed']='失敗'; +$lang['ldif_parse_error']='LDIF 解æžéŒ¯èª¤'; +$lang['ldif_could_not_add_object']='無法新增 object:'; +$lang['ldif_could_not_rename_object']='無法é‡æ–°å‘½å object:'; +$lang['ldif_could_not_delete_object']='無法刪除 object:'; +$lang['ldif_could_not_modify_object']='無法修改 object:'; +$lang['ldif_line_number']='行數:'; +$lang['ldif_line']='行:'; + +// Exports +$lang['export_format']='匯出格å¼'; +$lang['line_ends']='æ–·è¡Œ'; +$lang['must_choose_export_format']='ä½ å¿…é ˆé¸æ“‡ä¸€ç¨®åŒ¯å‡ºæ ¼å¼'; +$lang['invalid_export_format']='無效的匯出格å¼'; +$lang['no_exporter_found']='沒有å¯ç”¨çš„匯出程å¼'; +$lang['error_performing_search']='在執行æœå°‹æ™‚發生錯誤'; +$lang['showing_results_x_through_y']='é€éŽ %s 顯示çµæžœ %s'; +$lang['searching']='æœç´¢ä¸­...'; +$lang['size_limit_exceeded']='注æ„:到é”æœå°‹å¤§å°ä¸Šé™'; +$lang['entry']='紀錄'; +$lang['ldif_export_for_dn']='匯出 LDIF :'; +$lang['generated_on_date']='ç”±'; +$lang['total_entries']='全部的紀錄'; +$lang['dsml_export_for_dn']='匯出 DSLM :'; + +// logins +$lang['could_not_find_user']='找ä¸åˆ°ä½¿ç”¨è€… \"%s\"'; +$lang['password_blank']='您沒有輸入密碼欄ä½.'; +$lang['login_cancelled']='已經å–消登入.'; +$lang['no_one_logged_in']='在此伺æœå™¨å°šç„¡äººç™»å…¥.'; +$lang['could_not_logout']='無法登出.'; +$lang['unknown_auth_type']='未知的èªè­‰æ¨¡å¼: %s'; +$lang['logged_out_successfully']='æˆåŠŸçš„從 %s 伺æœå™¨ç™»å‡º'; +$lang['authenticate_to_server']='登入伺æœå™¨ %s'; +$lang['warning_this_web_connection_is_unencrypted']='警告: 這個網é é€£ç·šæ˜¯æ²’有加密的.'; +$lang['not_using_https']='您並未使用https加密連線,您的ç€è¦½å™¨å°‡ç›´æŽ¥ä»¥æ˜Žç¢¼å‚³é€æ‚¨çš„帳號與密碼'; +$lang['login_dn']='登入 DN'; +$lang['user_name']='使用者å稱'; +$lang['password']='密碼'; +$lang['authenticate']='é©—è­‰'; + +// Entry browser +$lang['entry_chooser_title']='紀錄é¸æ“‡å™¨'; + +// Index page +$lang['need_to_configure']='您必須先設定phpLDAPadmin,請ä¾ç…§config.php.example編輯config.php'; + +// Mass deletes +$lang['no_deletes_in_read_only']='在唯讀模å¼æ™‚ä¸å…許刪除資料'; +$lang['error_calling_mass_delete']='呼å«mass_delete.php時發生錯誤,mass_deleteä¸åœ¨POST變數中'; +$lang['mass_delete_not_array']='mass_delete POST變數ä¸æ˜¯é™£åˆ—'; +$lang['mass_delete_not_enabled']='大é‡åˆªé™¤åŠŸèƒ½ä¸¦æœªé–‹å•Ÿï¼Œè«‹åœ¨config.php中開啟此功能'; +$lang['mass_deleting']='大é‡åˆªé™¤'; +$lang['mass_delete_progress']='正在 \"%s\" 伺æœå™¨ä¸Šé€²è¡Œåˆªé™¤ç¨‹åº'; +$lang['malformed_mass_delete_array']='錯誤的大é‡åˆªé™¤é™£åˆ—'; +$lang['no_entries_to_delete']='您沒有é¸æ“‡ä»»ä½•è¦åˆªé™¤çš„紀錄'; +$lang['deleting_dn']='刪除 %s'; +$lang['total_entries_failed']='無法刪除紀錄 %s %s'; +$lang['all_entries_successful']='全部刪除完æˆ'; +$lang['confirm_mass_delete']='確èªè¦åˆªé™¤ %s 登入在伺æœå™¨ %s上'; +$lang['yes_delete']='沒錯,刪除å§!'; + +// Renaming entries +$lang['non_leaf_nodes_cannot_be_renamed']='當此記錄有å­ç´€éŒ„時無法é‡æ–°å‘½å'; +$lang['no_rdn_change']='您並沒有改變相å°è­˜åˆ¥å稱'; +$lang['invalid_rdn']='無效的相å°è­˜åˆ¥å稱'; +$lang['could_not_rename']='無法é‡æ–°å‘½å'; + +?> \ No newline at end of file diff --git a/lang/ru.php b/lang/ru.php index ca27538..2bac5ed 100644 --- a/lang/ru.php +++ b/lang/ru.php @@ -1,5 +1,5 @@ "zh-cn" //Simplified Chinese + +*/ + +/* --- ·­ÒëÖ¸µ¼ --- + * + * Èç¹ûÄãÏ뽨Á¢Ò»¸öеÄÓïÑÔÎļþ£¬ + * Çë°ÑËüÌá½»µ½SourceForge£º + * + * https://sourceforge.net/tracker/?func=add&group_id=61828&atid=498548 + * + * ÇëʹÓõײ¿µÄÑ¡Ïî"Check to Upload and Attach a File£¨ÉÏ´«¸½¼þ£©" + * + * ÔĶÁdoc/README-translation.txt ¿ÉÒԵõ½·­ÒëÖ¸µ¼¡£ + * + * лл£¡ + * + */ + +/* + * Êý×é$lang °üº¬ÁËËùÓÐphpLDAPadmin ËùʹÓõÄ×ÖÌå´®¡£ + * ÿһ¸öÓïÑÔÎļþ¶¼Ö»ÐèÒªÔÚÕâ¸öÊý×éÖж¨ÒåÒ»¸ö¸ÃÓïÑÔµÄËù¶ÔÓ¦µÄ + * ×Ö·û´®¡£ + */ + +// Search form +$lang['simple_search_form_str'] = '¼òµ¥ËÑË÷±í¸ñ'; +$lang['advanced_search_form_str '] = '¸ß¼¶ËÑË÷±í¸ñ'; +$lang['server'] = '·þÎñÆ÷'; +$lang['search_for_entries_whose'] = 'ËÑË÷ÌõÄ¿µÄËùÊô'; +$lang['base_dn'] = '»ù±¾DN'; +$lang['search_scope'] = 'ËÑË÷·¶Î§'; +$lang['show_attributes'] = 'ÏÔʾÊôÐÔ'; +//$lang['attributes'] = 'ÊôÐÔ'; +$lang['Search'] = 'ËÑË÷'; +$lang['predefined_search_str'] = 'Ñ¡ÔñÒ»¸öÔ¤¶¨ÒåµÄËÑË÷'; +$lang['predefined_searches'] = 'Ô¤¶¨ÒåµÄËÑË÷'; +$lang['no_predefined_queries'] = 'ÔÚconfig.phpÀïûÓÐÌõÄ¿¶¨Òå¡£'; +$lang['export_results'] = 'µ¼³ö½á¹û'; +$lang['unrecoginzed_search_result_format'] = '²»ÄÜʶ±ðµÄËÑË÷½á¹û¸ñʽ£º %s'; +$lang['format'] = '¸ñʽ'; +$lang['list'] = 'Áбí'; +$lang['table'] = '±í¸ñ'; +$lang['bad_search_display'] = 'ÄãµÄconfig.php ¸ø$default_search_displayÖ¸¶¨ÁËÒ»¸ö·Ç·¨µÄÖµ£º %s£¬Çë¸üÕý'; +$lang['page_n'] = 'µÚ%dÒ³'; +$lang['no_results'] = 'Õâ´ÎËÑË÷ûÕÒµ½½á¹û¡£'; + +// Tree browser +$lang['request_new_feature'] = '¹¦ÄÜÐèÇó'; +$lang['report_bug'] = '±¨¸æ´í©'; +$lang['schema'] = '¸ñʽ'; +$lang['search'] = 'ËÑË÷'; +$lang['create'] = '´´½¨'; +$lang['info'] = 'ÐÅÏ¢'; +$lang['import'] = 'µ¼Èë'; +$lang['refresh'] = 'Ë¢ÐÂ'; +$lang['logout'] = 'Í˳ö'; +$lang['create_new'] = '´´½¨ÐÂÌõÄ¿'; +$lang['view_schema_for'] = '²é¿´¸ñʽ'; +$lang['refresh_expanded_containers'] = 'Ë¢ÐÂËùÓÐÕ¹¿ªµÄÈÝÆ÷£¬À´×Ô'; +$lang['create_new_entry_on'] = '´´½¨ÐÂÌõÄ¿µ½'; +$lang['new'] = 'н¨'; +$lang['view_server_info'] = '²é¿´¸½¼ÓµÄ·þÎñÆ÷ÐÅÏ¢'; +$lang['import_from_ldif'] = '´ÓLDIFÎļþµ¼ÈëÌõÄ¿'; +$lang['logout_of_this_server'] = 'Í˳öÕâ¸ö·þÎñÆ÷'; +$lang['logged_in_as'] = 'µÇ¼Ϊ£º '; +$lang['this_base_dn_is_not_valid'] = '¸ÃDNÊÇÎÞЧ¡£'; +$lang['this_base_dn_does_not_exist'] = '¸ÃÌõÄ¿²»´æÔÚ¡£'; +$lang['read_only'] = 'Ö»¶Á'; +$lang['read_only_tooltip'] = '¸ÃÊôÐÔÒѾ­±»phpLDAPadmin ¹ÜÀíÔ±±êʶΪֻ¶Á'; +$lang['could_not_determine_root'] = '¼ì²â²»µ½ÄãµÄLDAPÊ÷µÄ¸ù¡£'; +$lang['ldap_refuses_to_give_root'] = 'ºÃÏñÄãµÄLDAP·þÎñÆ÷ÅäÖÃÀ´ÏÞÖÆÁ˲»ÒªÏÔ¶ËüµÄ¸ù¡£'; +$lang['please_specify_in_config'] = 'ÇëÔÚconfig.phpÀïÖ¸¶¨Ëü'; +$lang['create_new_entry_in'] = '´´½¨ÐÂÌõÄ¿ÓÚ'; +$lang['login_link'] = 'µÇ¼¡­'; +$lang['login'] = 'µÇ¼'; +$lang['base_entry_does_not_exist'] = '¸Ã»ù×¼ÌõÄ¿²»´æÔÚ¡£'; +$lang['create_it'] = 'Òª´´½¨ËüÂð£¿'; + +// Entry display +$lang['delete_this_entry'] = 'ɾ³ý¸ÃÌõÄ¿'; +$lang['delete_this_entry_tooltip'] = 'Äã»áµÃµ½ÌáʾҪÇóÈ·ÈϸÃÑ¡Ôñ'; +$lang['copy_this_entry'] = '¸´ÖƺÍÒƶ¯¸ÃÌõÄ¿'; +$lang['copy_this_entry_tooltip'] = '°ÑÕâ¸ö¶ÔÏó¸´ÖƵ½ÁíÒ»¸öλÖã¬Ò»¸öÐÂDN»òÁíÒ»¸ö·þÎñÆ÷¡£'; +$lang['export'] = 'µ¼³ö'; +$lang['export_lcase'] = 'µ¼³ö'; +$lang['export_tooltip'] = '±£´æÒ»¸ö¸Ã¶ÔÏóµÄµ¼³ö'; +$lang['export_subtree_tooltip'] = '±£´æÒ»¸ö¸Ã¶ÔÏó¼°ÆäËùÓк¢×ӵĵ¼³ö'; +$lang['export_subtree'] = 'µ¼³ö×ÓÊ÷'; +$lang['create_a_child_entry'] = '´´½¨Ò»¸ö×ÓÌõÄ¿'; +$lang['rename_entry'] = 'ÌõÄ¿¸üÃû'; +$lang['rename'] = '¸üÃû'; +$lang['add'] = 'Ôö¼Ó'; +$lang['view'] = '²é¿´'; +$lang['view_one_child'] = '²é¿´1¸ö×ÓÌõÄ¿'; +$lang['view_children'] = '²é¿´%s¸ö×ÓÌõÄ¿'; +$lang['add_new_attribute'] = 'Ôö¼ÓеÄÊôÐÔ'; +$lang['add_new_objectclass'] = 'Ôö¼ÓеÄObjectClass'; +$lang['hide_internal_attrs'] = 'Òþ²ØÄÚ²¿ÊôÐÔ'; +$lang['show_internal_attrs'] = 'ÏÔʾÄÚ²¿ÊôÐÔ'; +$lang['attr_name_tooltip'] = 'µã»÷²é¿´ÊôÐÔÀàÐÍ\'%s\'µÄ¸ñʽ¶¨Òå'; +$lang['none'] = 'ʲô¶¼Ã»ÓÐ'; +$lang['no_internal_attributes'] = 'ûÓÐÄÚ²¿ÊôÐÔ'; +$lang['no_attributes'] = 'Õâ¸öÌõĿûÓÐÊôÐÔ'; +$lang['save_changes'] = '±£´æ¸ü¸Ä'; +$lang['add_value'] = '¸³Öµ'; +$lang['add_value_tooltip'] = '¸øÊôÐÔ\'%s\'¸³Ò»¸ö¸½¼ÓµÄÖµ'; +$lang['refresh_entry'] = 'Ë¢ÐÂ'; +$lang['refresh_this_entry'] = 'Ë¢ÐÂÕâ¸öÌõÄ¿'; +$lang['delete_hint'] = 'Ìáʾ£º ÏëҪɾ³ýÒ»¸öÊôÐÔ£¬Ç뽫Îı¾×Ö¶ÎÇå¿Õ£¬È»ºóµã»÷±£´æ¡£'; +$lang['attr_schema_hint'] = 'Ìáʾ£º Òª²é¿´Ò»¸öÊôÐԵĸñʽ£¬Çëµã»÷ÊôÐÔµÄÃû³Æ¡£'; +$lang['attrs_modified'] = 'ÏÂÃæÓÐһЩÊôÐÔ(%s) ±»ÐÞ¸ÄÁË£¬¶øÇÒ±»±êʶΪ¸ßÁÁ¡£'; +$lang['attr_modified'] = 'ÏÂÃæÒ»¸öÊôÐÔ(%s) ±»ÐÞ¸ÄÁË£¬¶øÇÒ±»±êʶΪ¸ßÁÁ'; +$lang['viewing_read_only'] = 'ÒÔÖ»¶Áģʽ²é¿´ÌõÄ¿¡£'; +$lang['no_new_attrs_available'] = 'Õâ¸öÌõĿûÓÐÌṩеÄÊôÐÔ'; +$lang['no_new_binary_attrs_available'] = 'Õâ¸öÌõĿûÓÐÌṩеĶþ½øÖÆÊôÐÔ'; +$lang['binary_value'] = '¶þ½øÖÆÖµ'; +$lang['add_new_binary_attr'] = 'Ôö¼ÓеĶþ½øÖÆÖµ'; +$lang['alias_for'] = '×¢Ò⣺ \'%s\'ÊÇ\'%s\'µÄÒ»¸ö±ðÃû'; +$lang['required_for'] = 'objectClass(es) %sËù±ØÐèµÄÊôÐÔ'; +$lang['download_value'] = 'ÏÂÔØÖµ'; +$lang['delete_attribute'] = 'ɾ³ýÊôÐÔ'; +$lang['true'] = 'ÕæµÄ'; +$lang['false'] = '¼ÙµÄ'; +$lang['none_remove_value'] = 'ʲô¶¼Ã»ÓУ¬½«ÖµÒƳý'; +$lang['really_delete_attribute'] = 'ÕæµÄɾ³ýÊôÐÔ'; +$lang['add_new_value'] = 'Ôö¼ÓеÄÖµ'; + +// Schema browser +//$lang['the_following_objectclasses'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐobjectClasses¡£'; +//$lang['the_following_attributes'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐÊôÐÔÀàÐÍ¡£'; +//$lang['the_following_matching'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐÆ¥Åä¹æÔò¡£'; +//$lang['the_following_syntaxes'] = 'Õâ¸öLDAP·þÎñÆ÷Ö§³ÖÏÂÁÐÓï·¨¹æÔò¡£'; +$lang['schema_retrieve_error_1']='Õâ¸ö·þÎñÆ÷²¢²»ÍêÈ«Ö§³ÖLDAP ЭÒé¡£'; +$lang['schema_retrieve_error_2']='ÄãµÄPHP°æ±¾²»ÄÜÕýÈ·µØÍê³É²éѯ¡£'; +$lang['schema_retrieve_error_3']='phpLDAPadmin²»ÖªµÀÈç¹û»ñÈ¡ÄãµÄ·þÎñÆ÷µÄ¸ñʽ¡£'; +$lang['schema_retrieve_error_4']='»òÕß×îºó£¬ÄãµÄLDAP·þÎñÆ÷ûÓÐÌṩ¸ÃÐÅÏ¢¡£'; +$lang['jump_to_objectclass'] = 'Ìøתµ½Ò»¸öobjectClass'; +$lang['view_schema_for_oclass'] = '²é¿´¸ÃobjectClassµÄ¸ñʽÃèÊö'; +$lang['jump_to_attr'] = 'Ìøתµ½Ò»¸öÊôÐÔÀàÐÍ'; +$lang['jump_to_matching_rule'] = 'Ìøתµ½Ò»¸öÆ¥ÅäµÄ¹æÔò'; +$lang['schema_for_server'] = '·þÎñÆ÷µÄ¸ñʽ'; +$lang['required_attrs'] = '±ØÐèµÄÊôÐÔ'; +$lang['required'] = '±ØÐèµÄ'; +$lang['optional_attrs'] = '¿ÉÑ¡µÄÊôÐÔ'; +$lang['optional_binary_attrs'] = '¿ÉÑ¡µÄ¶þ½øÖÆÊôÐÔ'; +$lang['OID'] = 'OID'; +$lang['aliases']='±ðÃû'; +$lang['desc'] = 'ÃèÊö'; +$lang['no_description']='ûÓÐÃèÊö'; +$lang['name'] = 'Ãû³Æ'; +$lang['equality']='ÏàµÈ'; +$lang['is_obsolete'] = '¸ÃobjectClass¹ý¾ÃÁË¡£'; +$lang['inherits'] = '¼Ì³ÐÓÚ'; +$lang['inherited_from'] = '±»¼Ì³ÐÓÚ'; +$lang['parent_to'] = 'Ë«Ç×Ö¸Ïò'; +$lang['jump_to_this_oclass'] = 'Ìøתµ½¸ÃobjectClassµÄ¶¨Òå´¦'; +$lang['matching_rule_oid'] = 'Æ¥Åä¹æÔò OID'; +$lang['syntax_oid'] = 'Óï·¨¹æÔòOID'; +$lang['not_applicable'] = '²»¿ÉÓ¦ÓÃ'; +$lang['not_specified'] = 'δָ¶¨µÄ'; +$lang['character']='µ¥¸ö×Ö·û'; +$lang['characters']='¶à¸ö×Ö·û'; +$lang['used_by_objectclasses']='±»objectClassesËùʹÓõÄ'; +$lang['used_by_attributes']='±»ÊôÐÔËùʹÓõÄ'; +$lang['maximum_length']='×î´ó³¤¶È'; +$lang['attribute_types']='ÊôÐÔÀàÐÍ'; +$lang['syntaxes']='Óï·¨¹æÔò'; +$lang['matchingrules']='Æ¥Åä¹æÔò'; +$lang['oid']='OID'; +$lang['obsolete']='×÷·ÏµÄ'; +$lang['ordering']='ÅÅÐò'; +$lang['substring_rule']='×Ó´®¹æÔò'; +$lang['single_valued']='µ¥¸ö¸³ÖµµÄ'; +$lang['collective']='¼¯ÌåµÄ'; +$lang['user_modification']='Óû§ÐÞ¸Ä'; +$lang['usage']='ʹÓøñʽ'; +$lang['could_not_retrieve_schema_from']='²»ÄÜÕһظñʽµÄµØ·½'; +$lang['type']='ÀàÐÍ'; +$lang['no_such_schema_item'] = 'ûÓÐÕâÑùµÄ¸ñʽÏîÄ¿£º "%s"'; + +// Deleting entries +$lang['entry_deleted_successfully'] = '³É¹¦É¾³ýÌõÄ¿£º%s¡£'; +$lang['you_must_specify_a_dn'] = 'Äã±ØÐëÖ¸¶¨Ò»¸öDN'; +$lang['could_not_delete_entry'] = '²»ÄÜɾ³ý¸ÃÌõÄ¿£º %s'; +$lang['no_such_entry'] = 'ûÓÐÕâÑùµÄÌõÄ¿£º %s'; +$lang['delete_dn'] = 'ɾ³ý£º%s'; +$lang['permanently_delete_children'] = 'Ò²ÒªÓÀ¾Ãɾ³ýËùµÄ×ÓÌõÄ¿Âð£¿'; +$lang['entry_is_root_sub_tree'] = '¸ÃÌõÄ¿ÊǸù£¬Æä×ÓÊ÷Öаüº¬ÓÐÌõÄ¿£º%s¡£'; +$lang['view_entries'] = '²é¿´ÌõÄ¿'; +$lang['confirm_recursive_delete'] = 'phpLDAPadmin¿ÉÒԵݹéµØɾ³ý¸ÃÌõÄ¿¼°ÆäËùÓÐ×ÓÌõÄ¿Öеģº%s¡£ ¹ØÓÚÕâ¸ö¶¯×÷¿ÉÄÜ»áɾ³ýµÄËùÓÐÌõÄ¿ÁÐ±í£¬Çë²é¿´ÏÂÃæ¡£ ÄãÕæµÄÏëÕâÑù×öÂð£¿'; +$lang['confirm_recursive_delete_note'] = '×¢ÊÍ£º Õâ¸ö¿ÉÄÜDZÔÚΣÏÕ£¬ºó¹û×Ô¸º¡£ Õâ¸ö²Ù×÷²»¿É»Ö¸´¡£ Ò»¶¨Òª¿¼Âǵ½aliases£¨±ðÃû£©¡¢ referrals£¨ÌáÃû£©ÒÔ¼°ÆäËü¿ÉÄÜÒýÆðÎÊÌâµÄÊÂÇé¡£'; +$lang['delete_all_x_objects'] = 'ɾ³ýËùÓеĶÔÏó£º%s '; +$lang['recursive_delete_progress'] = 'µÝ¹éʽɾ³ý¹ý³Ì'; +$lang['entry_and_sub_tree_deleted_successfully'] = '³É¹¦É¾³ýÌõÄ¿%s ºÍ×ÓÊ÷¡£'; +$lang['failed_to_delete_entry'] = 'ɾ³ýÌõÄ¿£º%s ʧ°Ü'; +$lang['list_of_entries_to_be_deleted'] = '½«±»É¾³ýµÄÌõÄ¿ÁÐ±í£º'; +$lang['sure_permanent_delete_object']='È·ÈÏÄãÏëÓÀ¾Ãɾ³ýÕâ¸ö¶ÔÏóÂð£¿'; +$lang['dn'] = 'DN'; + +// Deleting attributes +$lang['attr_is_read_only'] = ' ÔÚphpLDAPadminµÄÅäÖÃÖУ¬ÊôÐÔ"%s"±»±êʶΪֻ¶Á¡£'; +$lang['no_attr_specified'] = 'ûÓÐÖ¸¶¨ÊôÐÔÃû³Æ¡£'; +$lang['no_dn_specified'] = 'ûÓÐÖ¸¶¨DN '; + +// Adding attributes +$lang['left_attr_blank'] = 'ÊôÐÔֵΪ¿Õ°×¡£ Çë·µ»ØÔÙÊÔ¡£'; +$lang['failed_to_add_attr'] = 'Ôö¼ÓÊôÐÔʧ°Ü¡£'; +$lang['file_empty'] = 'ÄãÑ¡ÔñµÄÎļþΪ¿Õ»ò²»´æÔÚ¡£ Çë·µ»ØÔÙÊÔ¡£'; +$lang['invalid_file'] = '°²È«´íÎó£º ÉÏ´«µÄÕâ¸öÎļþ¿ÉÄÜ´æÔÚ°²È«Î£ÏÕ¡£'; +$lang['warning_file_uploads_disabled'] = 'ÄãµÄPHPÅäÖò»ÔÊÐíÉÏ´«Îļþ¡£ ÇëÔÚ½øÐÐϲ½Ö®Ç°¼ì²éÒ»ÏÂphp.ini¡£'; +$lang['uploaded_file_too_big'] = 'ÄãÉÏ´«µÄÎļþÌ«´ó¡£ Çë¼ì²éphp.iniÖеÄupload_max_size ÉèÖÃ'; +$lang['uploaded_file_partial'] = 'ÄãÑ¡ÔñµÄÎļþÉÏ´«²»ÍêÕû£¬¿ÉÄÜÊÇÒòΪÍøÂçµÄÔµ¹Ê¡£'; +$lang['max_file_size'] = '×î´óÎļþ³ß´ç£º %s'; + +// Updating values +$lang['modification_successful'] = '³É¹¦Ð޸ģ¡'; +$lang['change_password_new_login'] = 'ÒòΪÄã¸ü¸ÄÁËÃÜÂ룬ÄãÏÖÔÚ±ØÐëʹÓÃеÄÃÜÂëÖØеǼ¡£'; + +// Adding objectClass form +$lang['new_required_attrs'] = 'ÐÂÔö±ØÐèµÄÊôÐÔ'; +$lang['requires_to_add'] = 'Õâ¸ö¶¯×÷ÒªÇóÄãÔö¼Ó'; +$lang['new_attributes'] = 'ÐÂÔöÊôÐÔ'; +$lang['new_required_attrs_instructions'] = 'Ö¸µ¼£º ΪÁËÔö¼ÓÕâ¸öobjectClass µ½¸ÃÌõÄ¿£¬Äã±ØÐëÖ¸¶¨'; +$lang['that_this_oclass_requires'] = 'Õâ¸ÃobjectClassËù±ØÐèµÄ¡£ Äã¿ÉÒÔÔÚÕâ¸ö±íÀïÍê³É¡£'; +$lang['add_oclass_and_attrs'] = 'Ôö¼ÓObjectClass ºÍÊôÐÔ'; +$lang['objectclasses'] = 'ObjectClasses'; + +// General +$lang['chooser_link_tooltip'] = 'µã»÷µ¯³öÒ»¸ö¶Ô»°¿òÀ´ÒÔͼÐη½Ê½Ñ¡ÔñÒ»¸öÌõÄ¿(DN) '; +$lang['no_updates_in_read_only_mode'] = '·þÎñÆ÷ÊÇÒÔÖ»¶Á·½Ê½ÔËÐУ¬Äã²»ÄÜÍê³É¸üÐÂ'; +$lang['bad_server_id'] = '´íÎóµÄ·þÎñÆ÷id'; +$lang['not_enough_login_info'] = 'ûÓÐ×ã¹»µÄÐÅÏ¢À´µÇ¼·þÎñÆ÷¡£ Çë¼ì²éÄãµÄÅäÖá£'; +$lang['could_not_connect'] = '²»ÄÜÁ¬½Óµ½LDAP·þÎñÆ÷¡£'; +$lang['could_not_connect_to_host_on_port'] = '²»ÄÜÁ¬½Óµ½"%s" µÄ"%s"¶Ë¿Ú'; +$lang['could_not_perform_ldap_mod_add'] = '²»ÄÜÍê³Éldap_mod_add ²Ù×÷¡£'; +//$lang['bad_server_id_underline'] = '´íÎóµÄserver_id£º'; +$lang['home'] = 'Ö÷Ò³'; +$lang['help'] = '°ïÖú'; +$lang['success'] = '³É¹¦'; +$lang['server_colon_pare'] = '·þÎñÆ÷£º'; +$lang['look_in'] = 'ÕýÔڲ鿴£º'; +//$lang['missing_server_id_in_query_string'] = 'ÔÚ²éѯ´®ÖÐûÓÐÖ¸¶¨·þÎñÆ÷ID£¡'; +$lang['missing_dn_in_query_string'] = 'ÔÚ²éѯ´®ÖÐûÓÐÖ¸¶¨DN£¡'; +$lang['back_up_p'] = 'ºóÍË...'; +$lang['no_entries'] = 'ûÓÐÌõÄ¿'; +//$lang['not_logged_in'] = 'ûÓеǼ'; +$lang['could_not_det_base_dn'] = '²»ÄÜÈ·¶¨base DN£¨»ùDN£©'; +//$lang['please_report_this_as_a_bug']='Ç뱨¸æÕâ¸ö´í©¡£'; +$lang['reasons_for_error']='³öÏÖÕâÖÖÇé¿ö¿ÉÄÜÓм¸¸öÔ­Òò£¬ÆäÖÐ×îÓпÉÄܵÄÊÇ£º'; +$lang['yes']='ÊÇ'; +$lang['no']='²»'; +$lang['go']='¿ªÊ¼'; +$lang['delete']='ɾ³ý'; +$lang['back']='ºóÍË'; +$lang['object']='¶ÔÏó'; +$lang['delete_all']='ɾ³ýËùÓеÄ'; +//$lang['url_bug_report']='https://sourceforge.net/tracker/?func=add&group_id=61828&atid=498546'; +$lang['hint'] = 'Ìáʾ'; +$lang['bug'] = '´í©'; +$lang['warning'] = '¾¯¸æ'; +$lang['light'] = 'light'; // µ¥´Ê'light' À´×Ô 'light bulb£¨µçµÆÅÝ£©' +$lang['proceed_gt'] = '¼ÌÐø >>'; +$lang['no_blowfish_secret'] = 'phpLDAPadmin²»ÄÜ°²È«µØ¼ÓÃܺͽâÃÜÄãµÄÃô¸ÐÐÅÏ¢£¬ÒòΪÔÚconfig.phpÊÇûÓÐÉèÖÃ$blowfish_secret¡£ÏÖÔÚ£¬ÄãÐèÒª±à¼­config.php£¬²¢ÉèÖÃ$blowfish_secretΪijÖÖÒþÃصÄ×Ö·û´®¡£'; +$lang['jpeg_dir_not_writable'] = 'ÇëÔÚphpLDAPadminµÄconfig.phpÀ½«$jpeg_temp_dirÉèÖõ½Ò»¸ö¿ÉдµÄĿ¼'; +$lang['jpeg_dir_not_writable_error'] = '²»Äܽ«%sдÈë$jpeg_temp_dirĿ¼¡£ÇëÈ·¶¨ÄãµÄweb·þÎñÆ÷Äܹ»ÔÚÄÇÀïдÎļþ¡£'; +$lang['jpeg_unable_toget'] = '²»ÄÜ´ÓLDAP·þÎñÆ÷ΪÊôÐÔ%s»ñµÃjpegÊý¾Ý¡£'; +$lang['jpeg_delete'] = 'ɾ³ýͼƬ'; + + + +// Add value form +$lang['add_new'] = 'ÐÂÔö'; +$lang['value_to'] = '¸³Öµ¸ø'; +$lang['distinguished_name'] = 'ʶ±ðÃû£¨DN£©'; +$lang['current_list_of'] = 'µ±Ç°Áбí'; +$lang['values_for_attribute'] = 'ÊôÐÔÖµ'; +$lang['inappropriate_matching_note'] = '×¢ÊÍ£º Èç¹ûÔÚÄãµÄLDAP·þÎñÆ÷ÉÏûÓÐΪÕâ¸öÊôÐÔÉèÖÃEQUALITY ¹æÔòµÄ»°£¬Äã¿ÉÄÜ»áÅöµ½"inappropriate matching£¨²»ÕýÈ·µÄÆ¥Å䣩"ÕâÑùµÄ´íÎó¡£'; +$lang['enter_value_to_add'] = 'ÊäÈëÄãÏëÔö¼ÓµÄÖµ£º'; +$lang['new_required_attrs_note'] = '×¢ÊÍ£º ¿ÉÄÜ»áÒªÇóÄãÊäÈë¸ÃobjectClassËù±ØÐèµÄÐÂÊôÐÔ¡£'; +$lang['syntax'] = '¹æÔò'; + +//copy.php +$lang['copy_server_read_only'] = '·þÎñÆ÷´¦ÓÚÖ»¶Áģʽ£¬Äã²»ÄÜÍê³É¸üÐÂ'; +$lang['copy_dest_dn_blank'] = ' Ä¿±êDNÏîΪ¿Õ¡£'; +$lang['copy_dest_already_exists'] = 'Ä¿±êÌõÄ¿ (%s) ÒѾ­´æÔÚ¡£'; +$lang['copy_dest_container_does_not_exist'] = 'Ä¿±êÈÝÆ÷ (%s) ²»´æÔÚ¡£'; +$lang['copy_source_dest_dn_same'] = 'Ô´ºÍÄ¿±êDN Ïàͬ¡£'; +$lang['copy_copying'] = 'ÕýÔÚ¸´ÖÆ '; +$lang['copy_recursive_copy_progress'] = 'µÝ¹éÊÖ¸´Öƹý³Ì'; +$lang['copy_building_snapshot'] = 'ÕýÔÚ½¨Á¢ÓÃÓÚ¸´ÖƵÄÊ÷µÄ¿ìÕÕ¡­ '; +$lang['copy_successful_like_to'] = '¸´ÖƳɹ¦£¡ Ä㻹ÏëÒª '; +$lang['copy_view_new_entry'] = '²é¿´ÐÂÌõÄ¿'; +$lang['copy_failed'] = '¸´ÖÆDN²»³É¹¦£º '; + +//edit.php +$lang['missing_template_file'] = '¾¯¸æ£º Ñù°åÎļþ²»´æÔÚ£¬'; +$lang['using_default'] = 'ʹÓÃĬÈϵġ£'; +$lang['template'] = 'Ñù°å'; +$lang['must_choose_template'] = 'Äã±ØÐëÑ¡ÔñÒ»¸öÑù°å'; +$lang['invalid_template'] = '%s ÊÇÒ»¸ö·Ç·¨µÄÑù°å'; +$lang['using_template'] = 'ʹÓÃÑù°å'; +$lang['go_to_dn'] = 'תµ½ %s'; +$lang['structural_object_class_cannot_remove'] = 'ÕâÊǸö½á¹¹»¯µÄObjectClass£¬Òò´Ë²»ÄÜÒƳý¡£'; +$lang['structural'] = '½á¹¹»¯'; + +//copy_form.php +$lang['copyf_title_copy'] = '¸´ÖÆ'; +$lang['copyf_to_new_object'] = '³ÉΪһ¸öеĶÔÏó'; +$lang['copyf_dest_dn'] = 'Ä¿±êDN'; +$lang['copyf_dest_dn_tooltip'] = 'ÔÚ¸´ÖƸÃÔ´ÌõĿʱ£¬½«±»½¨Á¢µÄÐÂÌõÄ¿µÄÍêÕûDN '; +$lang['copyf_dest_server'] = 'Ä¿±ê·þÎñÆ÷'; +$lang['copyf_note'] = 'Ìáʾ£º ÔÚÁ½¸ö²»Í¬µÄ·þÎñÆ÷Ö®¼ä¸´ÖÆʱ£¬ÒªÇóËüÃÇûÓÐ"schema£¨¸ñʽ£©³åÍ»"'; +$lang['copyf_recursive_copy'] = 'ÁíÍ⻹ҪµÝ¹é¸´Öƴ˶ÔÏóµÄËùÓÐ×ÓÄÚÈÝ¡£'; +$lang['recursive_copy'] = 'µÝ¹é¸´ÖÆ'; +$lang['filter'] = '¹ýÂËÆ÷'; +//$lang['search_filter'] = 'ËÑË÷¹ýÂËÆ÷'; +$lang['filter_tooltip'] = 'ÔÚÍê³ÉÒ»¸öµÝ¹é¸´ÖÆʱ£¬Ö»»á¸´ÖÆÄÄЩƥÅäÕâ¸ö¹ýÂËÆ÷µÄÌõÄ¿¡£'; +$lang['delete_after_copy'] = '¸´Öƺóɾ³ý£¨¼´Òƶ¯£©£º'; +$lang['delete_after_copy_warn'] = 'È·ÈÏÄãµÄ¹ýÂËÆ÷£¨¼ûÉÏÃ棩»áÑ¡ÔñËùÓеÄ×ӼǼ¡£'; + +//create.php +$lang['create_required_attribute'] = '±ØÐèÊôÐÔ(%s)µÄֵΪ¿Õ°×¡£'; +$lang['redirecting'] = 'Öض¨Ïò...'; +$lang['here'] = 'ÕâÀï'; +$lang['create_could_not_add'] = '²»ÄÜÔö¼Ó¸Ã¶ÔÏóµ½LDAP·þÎñÆ÷¡£'; + +//create_form.php +$lang['createf_create_object'] = '´´½¨¶ÔÏó'; +$lang['createf_choose_temp'] = 'Ñ¡ÔñÑù°å'; +$lang['createf_select_temp'] = 'Ñ¡ÔñÓÃÓÚ´´½¨¹ý³ÌµÄÑù°å'; +$lang['save_as_file'] = 'Áí´æΪÎļþ'; +$lang['rdn_field_blank'] = 'RDN¶ÎΪ¿Õ°×¡£'; +$lang['container_does_not_exist'] = 'ÄãÖ¸¶¨µÄ(%s)ÈÝÆ÷²»´æÔÚ¡£ ÇëÔÙÊÔÊÔ¡£'; +$lang['no_objectclasses_selected'] = 'ÄãûÓÐΪ¸Ã¶ÔÏóÑ¡ÔñÈκÎObjectClasses¡£ Çë·µ»ØÕÕ×ö¡£'; +$lang['hint_structural_oclass'] = 'Ìáʾ£º Äã±ØÓÐÑ¡ÔñÒ»¸ö½á¹¹»¯µÄobjectClass (ÈçÉÏÃæ´ÖÌåËùÏÔʾµÄ)'; + +//creation_template.php +$lang['ctemplate_on_server'] = 'ÔÚ·þÎñÆ÷ÉÏ'; +$lang['ctemplate_no_template'] = 'ÔÚPOST±äÁ¿ÖÐûÓÐÖ¸¶¨Ñù°å¡£'; +$lang['template_not_readable'] = 'ÄãÔÚÅäÖÃÖÐÖ¸¶¨ÁËÓÃÓÚ¸ÃÑù°åµÄ"%s"µÄÊÖ±ú£¬µ«ÊÇÕâ¸öÎļþÒòΪ½ûֹȨÏÞÌ«Ñϸñ¶ø²»¿É¶Á¡£'; +$lang['template_does_not_exist'] = 'ÄãÔÚÅäÖÃÎļþÖÐÖ¸¶¨ÁËÓÃÓڸà Ñù°åµÄ"%s"µÄÊÖ±ú£¬µ«ÊǸÃÊÖ±úÔÚtemplates/creation Ŀ¼Öв»´æÔÚ¡£'; +$lang['create_step1'] = 'µÚÒ»²½£º Name ºÍ ObjectClass(es)'; +$lang['create_step2'] = 'µÚ¶þ²½£º Ö¸¶¨ÊôÐÔºÍÖµ'; +$lang['relative_distinguished_name'] = 'Relative Distinguished Name£¨Ïà¶Ô±êʶÃû£©'; +$lang['rdn'] = 'RDN'; +$lang['rdn_example'] = '(ÀýÈ磺 cn=MyNewPerson)'; +$lang['container'] = 'Container£¨ÈÝÆ÷£©'; + +// search.php +$lang['you_have_not_logged_into_server'] = 'Ä㻹ûÓеÇÈëËùÑ¡ÔñµÄ·þÎñÆ÷£¬Òò´ËÄã²»ÄÜÔÚËüÉÏÃæÍê³ÉËÑË÷¡£'; +$lang['click_to_go_to_login_form'] = 'µã»÷ÕâÀïתµ½µÇ¼±í¸ñ'; +$lang['unrecognized_criteria_option'] = '²»ÈÏʶµÄcriteria£¨±ê×¼£©Ñ¡Ï '; +$lang['if_you_want_to_add_criteria'] = 'Èç¹ûÄãÏëÔö¼Ó×Ô¼ºµÄcriteria µ½ÁбíÀï¡£ ¼ÇµÃ±à¼­search.php À´´¦ÀíËüÃÇ¡£ Í˳ö¡£'; +$lang['entries_found'] = 'ÕÒµ½µÄÌõÄ¿£º '; +$lang['filter_performed'] = 'Ó¦ÓÃÁ˵ĹýÂËÆ÷£º '; +$lang['search_duration'] = 'phpLDAPadminÍê³ÉËÑË÷£¬ÓÃʱ'; +$lang['seconds'] = 'Ãë'; + +// search_form_advanced.php +$lang['scope_in_which_to_search'] = 'ËÑË÷µÄ·¶Î§'; +$lang['scope_sub'] = 'Sub (Õû¸ö×ÓÊ÷)'; +$lang['scope_one'] = 'One (base֮ϵÄÒ»¼¶)'; +$lang['scope_base'] = 'Base (½öÏÞÓÚbase dn)'; +$lang['standard_ldap_search_filter'] = '±ê×¼µÄLDAPËÑË÷¹ýÂËÆ÷¡£ ÀýÈ磺 (&(sn=Smith)(givenname=David))'; +$lang['search_filter'] = 'ËÑË÷¹ýÂËÆ÷'; +$lang['list_of_attrs_to_display_in_results'] = 'ÓÃÓÚÏÔʾÔÚ½á¹ûÖеÄÊôÐÔÁбí(ÒÔ¶ººÅ¸ô¿ª)'; +//$lang['show_attributes'] = 'ÏÔʾÊôÐÔ'; + +// search_form_simple.php +//$lang['search_for_entries_whose'] = '²éÕÒÊÇË­µÄÌõÄ¿£º'; +$lang['equals'] = 'µÈÓÚ'; +$lang['starts with'] = '¿ªÊ¼ÓÚ'; +$lang['contains'] = '°üº¬'; +$lang['ends with'] = '½áÊøÓÚ'; +$lang['sounds like'] = '¿´ÆðÀ´Ïó'; + +// server_info.php +$lang['could_not_fetch_server_info'] = '²»ÄÜ´Ó·þÎñÆ÷ÉÏÈ¡µÃLDAPÐÅÏ¢¡£ ¿ÉÄÜÊÇÒòΪÄãµÄPHP´æÔÚÕâ¸ö´í©£¬»òÕßÊÇÄãµÄLDAP·þÎñÆ÷ÀïÖ¸¶¨µÄ"·ÃÎÊ¿ØÖÆ"½ûÖ¹LDAP¿Í»§¶Ë·ÃÎÊRootDSE¡£'; +$lang['server_info_for'] = '·þÎñÆ÷ÐÅÏ¢£º '; +$lang['server_reports_following'] = 'ÏÂÁÐÐÅÏ¢ÊÇ·þÎñÆ÷±¨¸æµÄ¹ØÓÚËü×Ô¼ºµÄÐÅÏ¢'; +$lang['nothing_to_report'] = '¸Ã·þÎñÆ÷ûÓб¨¸æÈκÎÐÅÏ¢¡£'; + +//update.php +$lang['update_array_malformed'] = '¿´²»¶®update_array¡£ Õâ¿ÉÄÜÊÇphpLDAPadminµÄ´í©¡£ Ç뱨¸æ¡£'; +$lang['could_not_perform_ldap_modify'] = '²»ÄÜÍê³Éldap_modify ²Ù×÷¡£'; + +// update_confirm.php +$lang['do_you_want_to_make_these_changes'] = 'ÄãÏëÓ¦ÓÃÕâЩ±ä»¯Âð£¿'; +$lang['attribute'] = 'ÊôÐÔ'; +$lang['old_value'] = '¾ÉÖµ'; +$lang['new_value'] = 'ÐÂÖµ'; +$lang['attr_deleted'] = '[ɾ³ýµÄÊôÐÔ]'; +$lang['commit'] = 'Ìá½»'; +$lang['cancel'] = 'È¡Ïû'; +$lang['you_made_no_changes'] = 'ÄãûÓнøÐиü¸Ä'; +$lang['go_back'] = '·µ»Ø'; +$lang['unable_create_samba_pass'] = '²»Äܽ¨Á¢sambaÃÜÂë¡£ÇëÔÚtemplate_config.phpÀï¼ì²éÄãµÄÅäÖÃ'; + +// welcome.php +$lang['welcome_note'] = 'ʹÓÃ×ó±ß²Ëµ¥À´µ¼º½'; +$lang['credits'] = 'ÈÙÓþ'; +$lang['changelog'] = '±ä¸ü¼Ç¼'; +$lang['donate'] = '¾èÔù'; +$lang['pla_logo'] = 'phpLDAPadmin ±êʶ'; + +// Donate.php +$lang['donation_instructions'] = 'Ïë¾è¿î¸øphpLDAPadminÏîÄ¿£¬Çëµã»÷ÏÂÃæPayPal°´Å¥ÖеÄÒ»¸ö¡£'; +$lang['donate_amount'] = '¾èÔù %s'; +//$lang['wish_list_option'] = '»òÐíÄã¿ÉÒÔÂò·ÝÀñÎï¸øphpLDAPadmin¿ª·¢ÈËÔ±¡£'; +//$lang['wish_list'] = '²é¿´DaveµÄphpLDAPadmin Ô¸ÍûÁбí'; + +$lang['purge_cache'] = 'Çå¿Õ»º´æ'; +$lang['no_cache_to_purge'] = 'ûÓлº´æ¿ÉÇå¿Õ¡£'; +$lang['done_purging_caches'] = 'Çå¿Õ»º´æ%s ¸ö×Ö½Ú¡£'; +$lang['purge_cache_tooltip'] = 'Çå¿ÕËùÓÐÔÚphpLDAPadminÖлº´æµÄÊý¾Ý£¬°üÀ¨·þÎñÆ÷schema£¨¸ñʽ£©¡£'; + +// view_jpeg_photo.php +$lang['unsafe_file_name'] = '²»°²È«µÄÎļþÃû£º '; +$lang['no_such_file'] = 'ûÓÐÕâÑùµÄÎļþ£º '; + +//function.php +$lang['auto_update_not_setup'] = 'ÔÚÄãµÄÅäÖÃÖÐΪ %s ÆôÓÃÁËauto_uid_numbers£¬ + µ«ÊÇÄãûÓÐÖ¸¶¨auto_uid_number_mechanism¡£ Çë¸üÕý + Õâ¸öÎÊÌâ'; +$lang['uidpool_not_set'] = 'ÄãÔÚ·þÎñ%sµÄÅäÖÃÖÐÖ¸¶¨"auto_uid_number_mechanism" Ϊ "uidpool"£¬ + µ«ÊÇÄãûÓÐÖ¸¶¨ + audo_uid_number_uid_pool_dn¡£ ÇëÔÚ½øÐÐϲ½Ç°Ö¸¶¨Ëü¡£'; +$lang['uidpool_not_exist'] = 'ºÃÏñÄãÔÚÅäÖÃ("%s")ÖÐÖ¸¶¨µÄuidPool + ²»´æÔÚ¡£'; +$lang['specified_uidpool'] = 'ÄãÔÚ·þÎñÆ÷%sµÄÅäÖÃÎļþÖÐÖ¸¶¨ÁË"auto_uid_number_mechanism" Ϊ "search"£¬ + µ«ÊÇÄãûÓÐÖ¸¶¨ + "auto_uid_number_search_base"¡£ ÇëÔÚ½øÐÐϲ½Ç°Ö¸¶¨Ëü¡£'; +$lang['auto_uid_invalid_credential'] = 'ʹÓÃauto_uid credentials²»Äܰ󶨵½%s¡£ Çë¼ì²éÄãµÄÅäÖÃÎļþ¡£'; +$lang['bad_auto_uid_search_base'] = 'ÄãµÄphpLDAPadminÅäÖÃΪ·þÎñÆ÷%sÖ¸¶¨ÁËÒ»¸ö·Ç·¨µÄauto_uid_search_base '; +$lang['auto_uid_invalid_value'] = 'ÄãÔÚÅäÖÃÎļþÖÐΪauto_uid_number_mechanism ("%s")Ö¸¶¨ÁËÒ»¸ö·Ç·¨µÄÖµ + ¡£ Ö»ÓÐ"uidpool" ºÍ "search" ÊǺϷ¨µÄ¡£ + Çë¸üÕýÕâ¸öÎÊÌâ¡£'; +$lang['error_auth_type_config'] = '´íÎó£º ÔÚÄãµÄÅäÖÃÎļþÖÐÓиö´íÎó¡£ ½öÔÊÐíÓÃÓÚ + $servers²¿·ÖµÄauth_typeµÄֵΪ \'session\', \'cookie\', and \'config\'¡£ ÊäÈë\'%s\'£¬ + ÕâÊDz»ÔÊÐíµÄ¡£ '; +$lang['unique_attrs_invalid_credential'] = '²»ÄÜʹÓÃunique_attrs °ó¶¨µ½%s¡£ Çë¼ì²éÄãµÄÅäÖÃÎļþ¡£'; +$lang['unique_attr_failed'] = 'ÄãÆóͼÔö¼Ó%s (%s) µ½
      %s
      £¬ÕâÊDz»ÔÊÐíµÄ¡£ ¸ÃÊôÐÔ/ÖµÊôÓÚÈκÎÌõÄ¿¡£

      Äã¿ÉÄÜÏëËÑË÷ ¸ÃÌõÌõÄ¿¡£'; +$lang['php_install_not_supports_tls'] = 'Äã°²×°µÄPHP ²»Ö§³ÖTLS¡£'; +$lang['could_not_start_tls'] = '²»ÄÜÆôÓÃTLS¡£ Çë¼ì²éÄãµÄLDAP ·þÎñÆ÷ÅäÖá£'; +$lang['could_not_bind_anon'] = '²»ÄÜÄäÃû°ó¶¨µ½·þÎñÆ÷¡£'; +$lang['could_not_bind'] = '²»Äܰ󶨵½¸ÃLDAP·þÎñÆ÷¡£'; +$lang['anonymous_bind'] = 'ÄäÃû°ó¶¨'; +$lang['bad_user_name_or_password'] = '´íÎóµÄÓû§Ãû»òÃÜÂë¡£ ÇëÔÙÊÔÊÔ¡£'; +//$lang['redirecting_click_if_nothing_happens'] = 'Öض¨Ïò... Èç¹ûûÊ·¢ÉúÇëµã»÷ÕâÀï¡£'; +$lang['successfully_logged_in_to_server'] = '³É¹¦µÇ¼µ½·þÎñÆ÷%s'; +$lang['could_not_set_cookie'] = '²»ÄÜÉèÖÃcookie¡£'; +$lang['ldap_said'] = 'LDAP˵£º %s'; +$lang['ferror_error'] = '³ö´í'; +$lang['fbrowse'] = 'ä¯ÀÀ'; +$lang['delete_photo'] = 'ɾ³ýͼƬ'; +//$lang['install_not_support_blowfish'] = 'Äã°²×°µÄPHP²»Ö§³Öblowfish ¼ÓÃÜ¡£'; +//$lang['install_not_support_md5crypt'] = 'Äã°²×°µÄPHP²»Ö§³Ö md5crypt ¼ÓÃÜ¡£'; +//$lang['install_no_mash'] = 'Äã°²×°µÄPHPûÓÐmhash() º¯Êý¡£ ²»ÄܽøÐÐSHA¹þÏ£¡£'; +$lang['install_not_support_ext_des'] = 'ÄãµÄϵͳ¼ÓÃÜ¿â²»Ö§³ÖÀ©Õ¹µÄDES¼ÓÃÜ¡£'; +$lang['install_not_support_blowfish'] = 'ÄãµÄϵͳ¼ÓÃÜ¿â²»Ö§³Öblowfish¼ÓÃÜ¡£'; +$lang['install_not_support_md5crypt'] = 'ÄãµÄϵͳ¼ÓÃÜ¿â²»Ö§³Ömd5crypt¼ÓÃÜ¡£'; +$lang['jpeg_contains_errors'] = 'jpegPhoto °üº¬Óдí
      '; +$lang['ferror_number'] = '´íÎó´úºÅ %s'; +$lang['ferror_discription'] = 'ÃèÊö£º %s

      '; +$lang['ferror_number_short'] = '´íÎó´úºÅ£º %s

      '; +$lang['ferror_discription_short'] = 'ÃèÊö£º (ûÓÐÃèÊö¿ÉÌṩ)
      '; +$lang['ferror_submit_bug'] = 'ÕâÊǸöphpLDAPadmin ´í©Â𣿠Èç¹ûÊÇ£¬¾ÍÇ뱨¸æÒ»¸ö¡£'; +$lang['ferror_unrecognized_num'] = '²»ÈÏʶµÄ´íÎó´úºÅ£º '; +$lang['ferror_nonfatil_bug'] = '

      +
      + Äã·¢ÏÖÁËÒ»¸ö·ÇÖÂʹµÄphpLDAPadmin ´í©£¡
      ´íÎó£º%s (%s)
      Îļþ£º%s ÐÐ %s£¬µ÷Óú¯Êý %s
      °æ±¾£ºPLA: %s, PHP: %s, SAPI: %s +
      Web ·þÎñÆ÷£º%s
      + Çëµã»÷ÕâÀﱨ¸æ¸Ã´í©¡£

      '; +$lang['ferror_congrats_found_bug'] = '¹§Ï²Ä㣡 Äã·¢ÏÖÁËphpLDAPadminµÄÒ»¸ö´í©¡£

      + + + + + + + + + + +
      ´íÎó£º%s
      ¼¶±ð:%s
      Îļþ£º%s
      ÐУº%s
      µ÷ÓÃÕߣº%s
      PLA °æ±¾£º%s
      PHP °æ±¾£º%s
      PHP SAPI:%s
      PHP ·þÎñÆ÷£º%s
      +
      + Çëͨ¹ýµã»÷ÏÂÃæÀ´±¨¸æÕâ¸ö´í©£¡'; + +//ldif_import_form +$lang['import_ldif_file_title'] = 'µ¼ÈëLDIFÎļþ'; +$lang['select_ldif_file'] = 'Ñ¡ÔñÒ»¸öLDIFÎļþ£º'; +$lang['dont_stop_on_errors'] = '·¢Éú´íÎóʱ²»Í£Ö¹'; + +//ldif_import +$lang['add_action'] = 'Ôö¼Ó...'; +$lang['delete_action'] = 'ɾ³ý...'; +$lang['rename_action'] = '¸üÃû...'; +$lang['modify_action'] = 'ÐÞ¸Ä...'; +$lang['warning_no_ldif_version_found'] = 'ûÓÐÕÒµ½°æ±¾ºÅ¡£ ¼ÙÉè 1¡£'; +$lang['valid_dn_line_required'] = 'ÒªÇóÒ»¸öºÏ·¨µÄdnÐС£'; +$lang['missing_uploaded_file'] = '¶ªÊ§ÉÏ´«µÄÎļþ¡£'; +$lang['no_ldif_file_specified'] = 'ûÓÐÖ¸¶¨LDIFÎļþ¡£ ÇëÔÙÊÔÊÔ¡£'; +$lang['ldif_file_empty'] = 'ÉÏ´«µÄLDIF ÎļþΪ¿Õ¡£'; +$lang['empty'] = '¿ÕµÄ'; +$lang['file'] = 'Îļþ'; +$lang['number_bytes'] = '%s ×Ö½Ú'; + +$lang['failed'] = 'ʧ°Ü'; +$lang['ldif_parse_error'] = 'LDIF½âÎö´íÎó'; +$lang['ldif_could_not_add_object'] = '²»ÄÜÔö¼Ó¶ÔÏó£º'; +$lang['ldif_could_not_rename_object'] = '²»ÄܸüÃû¶ÔÏó£º'; +$lang['ldif_could_not_delete_object'] = '²»ÄÜɾ³ý¶ÔÏó£º'; +$lang['ldif_could_not_modify_object'] = '²»ÄÜÐ޸ĶÔÏó£º'; +$lang['ldif_line_number'] = 'Ðкţº'; +$lang['ldif_line'] = 'ÐÐÊý:'; + +// Exports +$lang['export_format'] = 'µ¼³ö¸ñʽ'; +$lang['line_ends'] = 'ÐнáÊø'; +$lang['must_choose_export_format'] = '²»±ØÐëÑ¡ÔñÒ»¸öµ¼³ö¸ñʽ¡£'; +$lang['invalid_export_format'] = '·Ç·¨µÄµ¼³ö¸ñʽ'; +$lang['no_exporter_found'] = 'ûÓÐÕÒµ½¿ÉÓõ¼³öÆ÷¡£'; +$lang['error_performing_search'] = 'ÔÚÖ´ÐÐËÑË÷ʱÅöµ½Ò»¸ö´íÎó¡£'; +$lang['showing_results_x_through_y'] = 'ÏÔʾ½á¹û%s£¬ËüÊÇͨ¹ý%sÀ´Íê³ÉµÄ¡£'; +$lang['searching'] = 'ËÑË÷...'; +$lang['size_limit_exceeded'] = '×¢Ò⣬³¬³öËÑË÷´óСÏÞÖÆ¡£'; +$lang['entry'] = 'ÌõÄ¿'; +$lang['ldif_export_for_dn'] = 'Ϊ£º %s£¬µ¼³öLDIF'; +$lang['generated_on_date'] = 'ÓÉphpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) ÔÚ %sÉÏÉú³ÉµÄ'; +$lang['total_entries'] = 'ÌõÄ¿×ÜÊý'; +$lang['dsml_export_for_dn'] = 'Ϊ£º %s£¬µ¼³öDSLM'; +$lang['include_system_attrs'] = '°üº¬ÏµÍ³ÊôÐÔ'; +$lang['csv_spreadsheet'] = 'CSV (Spreadsheet)'; + +// logins +//$lang['could_not_find_user'] = '²»ÄÜÕÒµ½Óû§"%s"'; +$lang['password_blank'] = 'ÄãµÄÃÜÂëΪ¿Õ¡£'; +//$lang['login_cancelled'] = 'µÇ¼ȡÏûÁË¡£'; +$lang['no_one_logged_in'] = 'ûÈ˵Ǽµ½¸Ã·þÎñÆ÷¡£'; +$lang['could_not_logout'] = '²»ÄÜÍ˳ö¡£'; +$lang['unknown_auth_type'] = '²»ÄÜʶ±ðµÄauth_type£º %s'; +$lang['logged_out_successfully'] = '³É¹¦´Ó%s·þÎñÆ÷Í˳ö'; +$lang['authenticate_to_server'] = 'ÈÏÖ¤µ½·þÎñÆ÷%s'; +$lang['warning_this_web_connection_is_unencrypted'] = '¾¯¸æ£º ´ËwebÁ¬½ÓûÓмÓÃÜ¡£'; +$lang['not_using_https'] = 'ÄãûÓÐʹÓÃ\'https\'¡£ Webä¯ÀÀÆ÷½«»áÒÔÃ÷ÎÄ´«ÊäµÇ¼ÐÅÏ¢¡£'; +$lang['login_dn'] = 'µÇ¼DN'; +$lang['user_name'] = 'Óû§Ãû'; +$lang['password'] = 'ÃÜÂë'; +$lang['authenticate'] = 'ÈÏÖ¤'; +$lang['login_not_allowed'] = '¶Ô²»Æð£¬Õą̂LDAP·þÎñÆ÷²»ÔÊÐíÄãʹÓÃphpLDAPadmin¡£'; + +// Entry browser +$lang['entry_chooser_title'] = 'ÌõÄ¿Ñ¡ÔñÆ÷'; + +// Index page +$lang['need_to_configure'] = 'ÄãÐèÒªÅäÖÃphpLDAPadmin¡£ ±à¼­Îļþ\'config.php\'¾Í¿ÉÒÔ¡£ ÓиöÑùÀýÅäÖÃÎļþÌṩÔÚ \'config.php.example\'Àï'; + +// Mass deletes +$lang['no_deletes_in_read_only'] = 'ÔÚÖ»¶Áģʽϲ»ÔÊÐíɾ³ý¡£'; +$lang['error_calling_mass_delete'] = '´íÎóµ÷ÓÃmass_delete.php¡£ÔÚPOST±äÁ¿ÖжªÊ§ mass_delete¡£'; +$lang['mass_delete_not_array'] = 'mass_delete POST ±äÁ¿²»ÊǸöÊý×é¡£'; +$lang['mass_delete_not_enabled'] = 'Mass deletion(´óÁ¿É¾³ý)ûÓÐÆôÓᣠÇëÔÚ½øÐÐÏÂÒ»²½Ç°ÔÚconfig.phpÖÐÆôÓÃËü¡£'; +$lang['search_attrs_wrong_count'] = 'ÄãµÄconfig.phpÓиö´íÎó¡£ ÔÚ$search_attributes ºÍ $search_attributes_displayÀïµÄÊôÐÔ±àºÅ²»Ò»Ñù'; +$lang['mass_deleting'] = 'ÕýÔÚ´óÁ¿É¾³ý'; +$lang['mass_delete_progress'] = '·þÎñÆ÷"%s"ÉϵÄɾ³ý¹ý³Ì'; +$lang['malformed_mass_delete_array'] = '²»¹æÔòµÄmass_delete Êý×é¡£'; +$lang['no_entries_to_delete'] = 'ÄãûÓÐÑ¡ÔñÈκÎҪɾ³ýµÄÌõÄ¿¡£'; +$lang['deleting_dn'] = 'ÕýÔÚɾ³ý %s'; +$lang['total_entries_failed'] = 'ɾ³ýÌõÄ¿%s£¨ÊôÓÚ%s£©Ê§°Ü¡£'; +$lang['all_entries_successful'] = 'ËùÓÐÌõĿɾ³ý³É¹¦¡£'; +$lang['confirm_mass_delete'] = 'È·ÈÏ´óÁ¿É¾³ýÌõÄ¿%s£¨ÔÚ·þÎñÆ÷%sÉÏ£©'; +$lang['yes_delete'] = 'Êǵģ¬É¾³ý£¡'; + +// Renaming entries +$lang['non_leaf_nodes_cannot_be_renamed'] = 'Äã²»ÄܸüÃûÒ»¸ö´øÓÐ×ÓÌõÄ¿µÄÌõÄ¿£¬¾ÙÀý£¬¸üÃû²Ù×÷ÔÊÐíÔÚ·ÇÒ¶×ÓÌõÄ¿ÉÏÍê³É'; +$lang['no_rdn_change'] = 'Äã²»Äܸü¸ÄRDN'; +$lang['invalid_rdn'] = 'ÎÞЧµÄRDNÖµ'; +$lang['could_not_rename'] = '²»ÄܸüÃû¸ÃÌõÄ¿'; + +// General errors +//$lang['php5_unsupported'] = 'phpLDAPadmin »¹²»Ö§³ÖPHP 5¡£Èç¹ûÄã¼ÌÐø¿ÉÄÜ»áÓöµ½Ðí¶àÒâÏë²»µ½µÄÎÊÌâ¡£'; +$lang['mismatched_search_attr_config'] = 'ÄãµÄÅäÖÃÓиö´íÎó¡£ $search_attributes Óë $search_attributes_display ±ØÐëÒªÓÐÏàͬÊýÄ¿µÄÊôÐÔ¡£'; + +// Password checker +$lang['passwords_match'] = 'ÃÜÂëÆ¥Å䣡'; +$lang['passwords_do_not_match'] = 'ÃÜÂ벻ƥÅ䣡'; +$lang['password_checker_tool'] = 'ÃÜÂë¼ì²é¹¤¾ß'; +$lang['compare'] = '±È½Ï'; +$lang['to'] = 'Óë'; + +// Templates +$lang['using'] = 'ʹÓøÃ'; +//$lang['template'] = 'Ä£°å'; +$lang['switch_to'] = 'Äã¿ÉÒÔת»»µ½'; +$lang['default_template'] = 'ĬÈÏÄ£°å'; + +// template_config +$lang['user_account'] = 'Óû§Õ˺Å(posixAccount)'; +$lang['address_book_inet'] = 'µØÖ·²¾ÌõÄ¿(inetOrgPerson)'; +$lang['address_book_moz'] = 'µØÖ·²¾ÌõÄ¿(mozillaOrgPerson)'; +$lang['kolab_user'] = 'KolabÓû§ÌõÄ¿'; +$lang['organizational_unit'] = '×éÖ¯»¯µ¥Ôª(Organizational Unit)'; +$lang['organizational_role'] = '×éÖ¯»¯½ÇÉ«'; +$lang['posix_group'] = 'Posix×é'; +$lang['samba_machine'] = 'Samba NT Ö÷»ú'; +$lang['samba3_machine'] = 'Samba 3 NT Ö÷»ú'; +$lang['samba_user'] = 'Samba Óû§'; +$lang['samba3_user'] = 'Samba 3 Óû§'; +$lang['samba3_group'] = 'Samba 3 ×éÓ³Ïñ(Mapping)'; +$lang['dns_entry'] = 'DNS ÌõÄ¿'; +$lang['simple_sec_object'] = '¼òµ¥°²È«¶ÔÏó(Simple Security Object)'; +$lang['courier_mail_account'] = 'Courier ÓʼþÕ˺Å'; +$lang['courier_mail_alias'] = 'Courier Óʼþ±ðÃû'; +$lang['ldap_alias'] = 'LDAP ±ðÃû'; +$lang['sendmail_cluster'] = 'Sendmail ¼¯Èº'; +$lang['sendmail_domain'] = 'Sendmail Óò'; +$lang['sendmail_alias'] = 'Sendmail ±ðÃû'; +$lang['sendmail_virt_dom'] = 'Sendmail ÐéÄâÓò'; +$lang['sendmail_virt_users'] = 'Sendmail ÐéÄâÓû§'; +$lang['sendmail_relays'] = 'Sendmail »Ø¸´'; +$lang['custom'] = '×Ô¶¨Òå'; +$lang['samba_domain_name'] = 'ÎÒµÄSambaÓòÃû'; +$lang['administrators'] = '¹ÜÀíÔ±'; +$lang['users'] = 'Óû§'; +$lang['guests'] = 'Ò»°ãÓû§(Guests)'; +$lang['power_users'] = 'ÔöÇ¿Óû§(Power Users)'; +$lang['account_ops'] = 'Õ˺ŹÜÀíÔ±'; +$lang['server_ops'] = '·þÎñÆ÷¹ÜÀíÔ±'; +$lang['print_ops'] = '´òÓ¡¹ÜÀíÔ±'; +$lang['backup_ops'] = '±¸·Ý¹ÜÀíÔ±'; +$lang['replicator'] = '¸´ÖÆÆ÷(Replicator)'; +$lang['unable_smb_passwords'] = '²»Äܽ¨Á¢SambaÃÜÂë¡£Çë¼ì²éÎļþtemplate_config.phpÀïµÄÅäÖá£'; +$lang['err_smb_conf'] = '´íÎó£ºÔÚÄãµÄsambaÅäÖÃÀïÓиö´íÎó¡£'; +$lang['err_smb_no_name_sid'] = '´íÎó£ºÐèҪΪÄãµÄsambaÓòÌṩһ¸öÃû×Ö(name)ºÍÒ»¸ösid¡£'; +$lang['err_smb_no_name'] = '´íÎó£ºÃ»ÓÐΪsambaÓòÌṩÃû×Ö¡£'; +$lang['err_smb_no_sid'] = '´íÎó£ºÃ»ÓÐΪsambaÓòÌṩsid¡£'; + +// Samba Account Template +$lang['samba_account'] = 'Samba Õ˺Å'; +$lang['samba_account_lcase'] = 'samba Õ˺Å'; + +// New User (Posix) Account +$lang['t_new_user_account'] = 'н¨Óû§Õ˺Å'; +$lang['t_hint_customize'] = 'Ìáʾ£ºÏëÒª¶¨ÖÆÄ£°åµÄ»°£¬Äã¿ÉÒԱ༭Îļþtemplates/creation/new_user_template.php'; +$lang['t_name'] = 'Ãû×Ö'; +$lang['t_first_name'] = 'µÚÒ»¸öÃû×Ö'; +$lang['t_last_name'] = '×îºóÒ»¸öÃû×Ö'; +$lang['t_first'] = 'µÚÒ»¸ö'; +$lang['t_last'] = '×îºóÒ»¸ö'; +$lang['t_common_name'] = '¹«ÓÐÃû×Ö(Common name)'; +$lang['t_user_name'] = 'Óû§Ãû'; +$lang['t_password'] = 'ÃÜÂë'; +$lang['t_encryption'] = '¼ÓÃÜ·½·¨'; +$lang['t_login_shell'] = 'µÇ¼Shell'; +$lang['t_home_dir'] = 'Ö÷Ŀ¼'; +$lang['t_uid_number'] = 'UIDºÅ'; +$lang['t_auto_det'] = '£¨×Ô¶¯¼ì²âµ½µÄ£©'; +$lang['t_group'] = '×é'; +$lang['t_gid_number'] = 'GIDºÅ'; +$lang['t_err_passwords'] = 'ÄãµÄÃÜÂ벻ƥÅä¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_err_field_blank'] = '%s´¦²»ÄÜΪ¿Õ¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_err_field_num'] = '%s×ֶβ»ÄÜÖ»ÊäÈëÊý×Ö¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_err_bad_container'] = 'ÄãÖ¸¶¨µÄÈÝÆ÷(%s)²»´æÔÚ¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_confirm_account_creation'] = 'È·ÈÏ´´½¨Õ˺Å'; +$lang['t_secret'] = '[ÒþÃØ]'; +$lang['t_create_account'] = '´´½¨Õ˺Å'; + +// New Address Template +$lang['t_new_address'] = 'н¨µØÖ·²¾ÌõÄ¿'; +$lang['t_organization'] = '×éÖ¯'; +$lang['t_address'] = 'µØÖ·'; +$lang['t_city'] = '³ÇÊÐ'; +$lang['t_postal_code'] = 'ÓÊÕþ±àÂë'; +$lang['t_street'] = '½ÖµÀ'; +$lang['t_work_phone'] = '¹¤×÷µç»°'; +$lang['t_fax'] = '´«Õæ(Fax)'; +$lang['t_mobile'] = 'Òƶ¯µç»°(Mobile)'; +$lang['t_email'] = 'µç×ÓÓʼþ'; +$lang['t_container'] = 'ÈÝÆ÷'; +$lang['t_err_cn_blank'] = '¹«ÓÐÃû×Ö(Common Name)²»ÄÜΪ¿Õ¡£Çë·µ»ØÔÙÊÔÊÔ¡£'; +$lang['t_confim_creation'] = 'È·ÈÏ´´½¨ÌõÄ¿£º'; +$lang['t_create_address'] = '´´½¨µØÖ·²¾'; + +// default template +$lang['t_check_pass'] = 'ÕýÔÚ¼ì²éÃÜÂë¡­¡­'; + +// compare form +$lang['compare'] = '±È½Ï'; +$lang['comparing'] = '±È½Ï½ô¸ú×ŵÄDN'; +$lang['compare_dn'] = '±È½ÏÁíÒ»¸öDN¸ú'; +$lang['with'] = 'ͬ '; +$lang['compf_source_dn'] = 'Ô´DN'; +$lang['compf_dn_tooltip'] = '½«¸ÃDNÓëÁíÒ»¸ö±È½Ï'; +$lang['switch_entry'] = 'Çл»ÌõÄ¿'; +$lang['no_value'] = 'ûÓÐÖµ'; +$lang['compare_with'] = 'ͬÁíÒ»¸öÌõÄ¿½øÐбȽÏ'; +$lang['need_oclass'] = 'ÒªÐÂÔöÊôÐÔ%s£¬ÄãÐèÒªÏÂÃæµÄObjectClass(es)¡ª¡ª¶ÔÏóÀà¡£'; + +// Time out page +$lang['session_timed_out_1'] = 'ÄãµÄ»á»°ÆÚ½«ÔÚÎ޻µÄ'; +$lang['session_timed_out_2'] = '·ÖÖÓºó¹ýÆÚ¡£Ä㽫×Ô¶¯Í˳ö¡£'; +$lang['log_back_in'] = 'ÏëµÇ¼»ØÀ´£¬Çëµã»÷ÏÂÃæµÄÁ´½Ó£º'; +$lang['session_timed_out_tree'] = '(»á»°³¬Ê±£¬×Ô¶¯Í˳ö¡£)'; +$lang['timeout_at'] = 'ÔÚ%sÈç¹û»î¶¯£¬Ä㽫±»µÇ³ö¡£'; + + +?> diff --git a/lang/zh-tw.php b/lang/zh-tw.php new file mode 100644 index 0000000..c5cb810 --- /dev/null +++ b/lang/zh-tw.php @@ -0,0 +1,490 @@ +>'; + +// Add value form +$lang['add_new']='新增'; +$lang['value_to']='數值至'; +$lang['distinguished_name']='識別å稱'; +$lang['current_list_of']='此屬性有'; +$lang['values_for_attribute']='下列數值:'; +$lang['inappropriate_matching_note']='請注æ„:若您的LDAP伺æœå™¨ä¸­ä¸¦æœªè¨­å®šç­‰å¼è¦å‰‡ï¼Œæ‚¨å°‡æœƒé‡åˆ°\"ç„¡é©åˆçš„比å°\"錯誤'; +$lang['enter_value_to_add']='請輸入您è¦åŠ å…¥çš„數值'; +$lang['new_required_attrs_note']='請注æ„:由於此objectClass定義的'; +$lang['syntax']='語法,您必須輸入新屬性'; + +//copy.php +$lang['copy_server_read_only']='無法在伺æœå™¨ç‚ºå”¯è®€æ¨¡å¼æ™‚更新資料'; +$lang['copy_dest_dn_blank']='目的地識別å稱ä¸èƒ½æ˜¯ç©ºç™½'; +$lang['copy_dest_already_exists']='目的地識別å稱 (%s) 已經存在'; +$lang['copy_dest_container_does_not_exist']='ç›®çš„åœ°é›†åˆ (%s) ä¸å­˜åœ¨'; +$lang['copy_source_dest_dn_same']='來æºè­˜åˆ¥å稱與目的地識別å稱é‡è¤‡'; +$lang['copy_copying']='複製中'; +$lang['copy_recursive_copy_progress']='éžè¿´è¤‡è£½ä½œæ¥­'; +$lang['copy_building_snapshot']='å°è³‡æ–™æ¨¹å»ºç«‹å‰¯æœ¬ä¾†è¤‡è£½'; +$lang['copy_successful_like_to']='複製æˆåŠŸ!!您è¦'; +$lang['copy_view_new_entry']='查閱此新紀錄?'; +$lang['copy_failed']='以下 DN 複製失敗:'; + +//edit.php +$lang['missing_template_file']='警告:找ä¸åˆ°æ¨£ç‰ˆæª”案'; +$lang['using_default']='使用é è¨­å€¼'; +$lang['template']='樣版'; +$lang['must_choose_template']='ä½ å¿…é ˆé¸æ“‡ä¸€å€‹æ¨£ç‰ˆ'; +$lang['invalid_template']='%s 是錯誤的樣版'; +$lang['using_template']='使用樣版'; +$lang['go_to_dn']='到 %s'; + +//copy_form.php +$lang['copyf_title_copy']='複製'; +$lang['copyf_to_new_object']='æˆæ–°ç‰©ä»¶'; +$lang['copyf_dest_dn']='目的地識別å稱'; +$lang['copyf_dest_dn_tooltip']='來æºè³‡æ–™è¤‡è£½å¾Œçš„完整識別å稱'; +$lang['copyf_dest_server']='目的伺æœå™¨'; +$lang['copyf_note']='æ示:åªæœ‰ç•¶ä¸åŒçš„伺æœå™¨é–“çš„schema相容æ‰èƒ½åœ¨ä¸åŒçš„伺æœå™¨ä¹‹é–“進行複製'; +$lang['copyf_recursive_copy']='éžè¿´è¤‡è£½æ‰€æœ‰æ­¤ç‰©ä»¶çš„å­è³‡æ–™'; +$lang['recursive_copy']='éžè¿´è¤‡è£½'; +$lang['filter']='éŽæ¿¾æ¢ä»¶'; +$lang['filter_tooltip']='åªæœ‰ç¬¦åˆéŽæ¿¾æ¢ä»¶çš„資料會被éžè¿´è¤‡è£½'; + +//create.php +$lang['create_required_attribute']='å¿…è¦çš„屬性 (%s) 必須有資料'; +$lang['redirecting']='正在轉æ›è‡³...'; +$lang['here']='這裡'; +$lang['create_could_not_add']='ä¸èƒ½æ–°å¢žç‰©ä»¶åˆ°æ­¤LDAP伺æœå™¨'; + +//create_form.php +$lang['createf_create_object']='創造物件'; +$lang['createf_choose_temp']='é¸æ“‡æ¨£ç‰ˆ'; +$lang['createf_select_temp']='è«‹é¸æ“‡ä¸€å€‹ä½ è¦å»ºç«‹çš„紀錄模æ¿'; +$lang['createf_proceed']='下一步'; +$lang['rdn_field_blank']='相å°è­˜åˆ¥å稱欄ä½ä¸èƒ½æ˜¯ç©ºç™½'; +$lang['container_does_not_exist']='æ‚¨æŒ‡å®šçš„é›†åˆ (%s) ä¸å­˜åœ¨ï¼Œè«‹é‡æ–°æŒ‡å®š'; +$lang['no_objectclasses_selected']='您必須為此物件指定ObjectClasses'; +$lang['hint_structural_oclass']='æ示:您必須在伺æœå™¨ä¸Šè‡³å°‘'; + +//creation_template.php +$lang['ctemplate_on_server']='é¸æ“‡ä¸€å€‹objectClass'; +$lang['ctemplate_no_template']='在POST變數中並未指定模版'; +$lang['ctemplate_config_handler']='您的設定指定了由æŸå€‹ç¨‹å¼ä¾†åŸ·è¡Œæ­¤æ¨¡ç‰ˆ'; +$lang['ctemplate_handler_does_not_exist']='但此程å¼åœ¨ templates/creation 目錄中找ä¸åˆ°'; +$lang['create_step1']='步驟 1 之 2:å稱與ObjectClass(es)'; +$lang['create_step2']='步驟 2 之 2:指定屬性與數值'; +$lang['relative_distinguished_name']='相å°è­˜åˆ¥å稱'; +$lang['rdn']='相å°è­˜åˆ¥å稱'; +$lang['rdn_example']='(範例: cn=MyNewPerson)(範例: cn=MyNewPerson)'; +$lang['container']='集åˆ'; + +// search.php +$lang['you_have_not_logged_into_server']='您必須先登入伺æœå™¨æ‰èƒ½åœ¨ä¼ºæœå™¨åŸ·è¡Œæœå°‹'; +$lang['click_to_go_to_login_form']='點é¸é€™é‚Šå›žåŽ»ç™»å…¥è¡¨å–®'; +$lang['unrecognized_criteria_option']='無法辨識的基準'; +$lang['if_you_want_to_add_criteria']='如果您è¦åŠ å…¥è‡ªå·±çš„基準到項目列表中,請編輯search.php'; +$lang['entries_found']='找到的紀錄:'; +$lang['filter_performed']='執行éŽæ¿¾æ¢ä»¶'; +$lang['search_duration']='phpLDAPadmin將會'; +$lang['seconds']='馬上執行查詢'; + +// search_form_advanced.php +$lang['scope_in_which_to_search']='æœå°‹ç¯„åœ'; +$lang['scope_sub']='Sub (整個å­æ¨¹)'; +$lang['scope_one']='One (單一階層下)'; +$lang['scope_base']='Base (åªæœ‰åŸºç¤Žè­˜åˆ¥å稱)'; +$lang['standard_ldap_search_filter']='標準的LDAPæœå°‹æ¢ä»¶. 如: (&(sn=Smith)(givenname=David))'; +$lang['search_filter']='éŽæ¿¾æœå°‹'; +$lang['list_of_attrs_to_display_in_results']='下列為æœå°‹çµæžœ(以 , å€éš”)'; +$lang['equals']='等於'; +$lang['starts with']='開始於'; +$lang['contains']='å…§å«'; +$lang['ends with']='çµæŸæ–¼'; +$lang['sounds like']='喜愛的è²éŸ³'; + +// server_info.php +$lang['could_not_fetch_server_info']='無法從伺æœå™¨å–å¾— LDAP 資訊'; +$lang['server_info_for']='伺æœå™¨è³‡è¨Š:'; +$lang['server_reports_following']='伺æœå™¨å›žå ±ä¸‹åˆ—資訊:'; +$lang['nothing_to_report']='此伺æœå™¨æ²’有資訊å¯ä»¥å›žå ±'; + +//update.php +$lang['update_array_malformed']='無法更新陣列,å¯èƒ½æ˜¯phpLDAPadminçš„bug,請回報此å•é¡Œ'; +$lang['could_not_perform_ldap_modify']='無法執行ldap_modifyæ“作'; + +// update_confirm.php +$lang['do_you_want_to_make_these_changes']='您確定è¦åšé€™äº›æ›´å‹•?'; +$lang['attribute']='屬性'; +$lang['old_value']='原設定值'; +$lang['new_value']='新設定æ¤'; +$lang['attr_deleted']='[屬性已刪除]'; +$lang['commit']='é€å‡º'; +$lang['cancel']='å–消'; +$lang['you_made_no_changes']='您並沒有åšä»»ä½•æ›´å‹•'; +$lang['go_back']='回上é '; + +// welcome.php +$lang['welcome_note']='請用左邊的é¸å–®ç€è¦½'; +$lang['credits']='æˆå“¡åˆ—表'; +$lang['changelog']='更新紀錄'; +$lang['donate']='æç»'; + +// view_jpeg_photo.php +$lang['unsafe_file_name']='ä¸å®‰å…¨çš„檔案å稱:'; +$lang['no_such_file']='沒有以下檔案:'; + +//function.php +$lang['auto_update_not_setup']='您在設定中開啟 %sçš„auto_uid_numbers功能,但並未指定auto_uid_number_mechanism,請修正此å•é¡Œ'; +$lang['uidpool_not_set']='伺æœå™¨%sçš„auto_uid_number_mechanism指定為uidpool,但並未指定audo_uid_number_uid_pool_dn,請修正此å•é¡Œå†ç¹¼çºŒ'; +$lang['uidpool_not_exist']='您å†è¨­å®šæª”(\"%s\")中指定的uidPool機制並ä¸å­˜åœ¨'; +$lang['specified_uidpool']='伺æœå™¨%sçš„auto_uid_number_mechanism指定為search,但您並未指定auto_uid_number_search_base,請修正此å•é¡Œå†ç¹¼çºŒ'; +$lang['auto_uid_invalid_credential']='無法以您的auto_uid設定登入%s,請檢查您的設定檔'; +$lang['bad_auto_uid_search_base']='您在phpLDAPadmin設定中å°ä¼ºæœå™¨%s指定了無效的auto_uid_search_base'; +$lang['auto_uid_invalid_value']='您的auto_uid_number_mechanism (\"%s\") 設定是無效的,åªæœ‰uidpool與search為有效設定,請修正此å•é¡Œ'; +$lang['error_auth_type_config']='錯誤:您的設定有錯誤,變數auth_typeåªå…許session , cookie與config,您的設定值 '; +$lang['php_install_not_supports_tls']='您安è£çš„ php ä¸¦æ²’æœ‰æ”¯æ´ TLS.'; +$lang['could_not_start_tls']='無法啟動 TLS 請檢查您的 LDAP 伺æœå™¨è¨­å®š.'; +$lang['could_not_bind_anon']='伺æœå™¨ä¸æŽ¥å—匿å登入'; +$lang['anonymous_bind']='匿å登入'; +$lang['bad_user_name_or_password']='錯誤的 使用者å稱 或 密碼.è«‹é‡æ–°è¼¸å…¥ä¸€æ¬¡.'; +$lang['redirecting_click_if_nothing_happens']='正在é‡æ–°å°Žå‘...如果ç€è¦½å™¨æ²’有動作,請點é¸é€™è£¡.'; +$lang['successfully_logged_in_to_server']='æˆåŠŸç™»å…¥ä¼ºæœå™¨ %s'; +$lang['could_not_set_cookie']='ä¸èƒ½è¨­å®š cookie'; +$lang['ldap_said']='伺æœå™¨å›žæ‡‰: %s'; +$lang['ferror_error']='錯誤'; +$lang['fbrowse']='ç€è¦½'; +$lang['delete_photo']='刪除相片'; +$lang['install_not_support_blowfish']='您所安è£çš„ PHP 並ä¸æ”¯æ´ Blowfish 加密'; +$lang['install_no_mash']='您所安è£çš„ PHP 並沒有 mhash() 函數,無法進行 SHA 加密'; +$lang['jpeg_contains_errors']='jpegPhoto 內容發生錯誤
      '; +$lang['ferror_number']='錯誤碼: %s (%s)'; +$lang['ferror_discription']='說明: %s

      '; +$lang['ferror_number_short']='錯誤編號: %s'; +$lang['ferror_discription_short']='說明: (無任何說明內容)
      '; +$lang['ferror_submit_bug']='這是 phpLDAPadmin 的 bug? 如果是,請回報這個Bug.'; +$lang['ferror_unrecognized_num']='無法辨識的錯誤代碼:'; +$lang['ferror_nonfatil_bug']='
      +
      + You found a non-fatal phpLDAPadmin bug!
      Error:%s (%s)
      File:%s line %s, caller %s
      Versions:PLA: %s, PHP: %s, SAPI: %s +
      Web server:%s
      + Please report this bug by clicking here.

      '; +$lang['ferror_congrats_found_bug']='æ­å–œ! 您發ç¾äº†phpLDAPadminçš„bug.

      + + + + + + + + + +
      Error:%s
      Level:%s
      File:%s
      Line:%s
      Caller:%s
      PLA Version:%s
      PHP Version:%s
      PHP SAPI:%s
      Web server:%s
      +
      + Please report this bug by clicking below!'; + +//ldif_import_form +$lang['import_ldif_file_title']='匯入 LDIF 檔案'; +$lang['select_ldif_file']='é¸æ“‡ä¸€å€‹ LDIF 檔案:'; +$lang['select_ldif_file_proceed']='下一步'; + +//ldif_import +$lang['add_action']='增加中...'; +$lang['delete_action']='刪除中...'; +$lang['rename_action']='æ›´å中...'; +$lang['modify_action']='改變中...'; +$lang['warning_no_ldif_version_found']='找ä¸åˆ°ç‰ˆæœ¬è³‡è¨Šï¼Œé è¨­ä½¿ç”¨ç‰ˆæœ¬1'; +$lang['valid_dn_line_required']='需è¦æœ‰æ•ˆçš„識別å稱行'; +$lang['missing_uploaded_file']='找ä¸åˆ°æŒ‡å®šçš„上傳檔案'; +$lang['no_ldif_file_specified.']='沒有指定LDIF檔案請é‡è©¦'; +$lang['ldif_file_empty']='上傳的 LDIF 檔案是空白的'; +$lang['file']='檔案'; +$lang['number_bytes']='%s bytes'; +$lang['failed']='失敗'; +$lang['ldif_parse_error']='LDIF 解æžéŒ¯èª¤'; +$lang['ldif_could_not_add_object']='無法新增 object:'; +$lang['ldif_could_not_rename_object']='無法é‡æ–°å‘½å object:'; +$lang['ldif_could_not_delete_object']='無法刪除 object:'; +$lang['ldif_could_not_modify_object']='無法修改 object:'; +$lang['ldif_line_number']='行數:'; +$lang['ldif_line']='行:'; + +// Exports +$lang['export_format']='匯出格å¼'; +$lang['line_ends']='æ–·è¡Œ'; +$lang['must_choose_export_format']='ä½ å¿…é ˆé¸æ“‡ä¸€ç¨®åŒ¯å‡ºæ ¼å¼'; +$lang['invalid_export_format']='無效的匯出格å¼'; +$lang['no_exporter_found']='沒有å¯ç”¨çš„匯出程å¼'; +$lang['error_performing_search']='在執行æœå°‹æ™‚發生錯誤'; +$lang['showing_results_x_through_y']='é€éŽ %s 顯示çµæžœ %s'; +$lang['searching']='æœç´¢ä¸­...'; +$lang['size_limit_exceeded']='注æ„:到é”æœå°‹å¤§å°ä¸Šé™'; +$lang['entry']='紀錄'; +$lang['ldif_export_for_dn']='匯出 LDIF :'; +$lang['generated_on_date']='ç”±'; +$lang['total_entries']='全部的紀錄'; +$lang['dsml_export_for_dn']='匯出 DSLM :'; + +// logins +$lang['could_not_find_user']='找ä¸åˆ°ä½¿ç”¨è€… \"%s\"'; +$lang['password_blank']='您沒有輸入密碼欄ä½.'; +$lang['login_cancelled']='已經å–消登入.'; +$lang['no_one_logged_in']='在此伺æœå™¨å°šç„¡äººç™»å…¥.'; +$lang['could_not_logout']='無法登出.'; +$lang['unknown_auth_type']='未知的èªè­‰æ¨¡å¼: %s'; +$lang['logged_out_successfully']='æˆåŠŸçš„從 %s 伺æœå™¨ç™»å‡º'; +$lang['authenticate_to_server']='登入伺æœå™¨ %s'; +$lang['warning_this_web_connection_is_unencrypted']='警告: 這個網é é€£ç·šæ˜¯æ²’有加密的.'; +$lang['not_using_https']='您並未使用https加密連線,您的ç€è¦½å™¨å°‡ç›´æŽ¥ä»¥æ˜Žç¢¼å‚³é€æ‚¨çš„帳號與密碼'; +$lang['login_dn']='登入 DN'; +$lang['user_name']='使用者å稱'; +$lang['password']='密碼'; +$lang['authenticate']='é©—è­‰'; + +// Entry browser +$lang['entry_chooser_title']='紀錄é¸æ“‡å™¨'; + +// Index page +$lang['need_to_configure']='您必須先設定phpLDAPadmin,請ä¾ç…§config.php.example編輯config.php'; + +// Mass deletes +$lang['no_deletes_in_read_only']='在唯讀模å¼æ™‚ä¸å…許刪除資料'; +$lang['error_calling_mass_delete']='呼å«mass_delete.php時發生錯誤,mass_deleteä¸åœ¨POST變數中'; +$lang['mass_delete_not_array']='mass_delete POST變數ä¸æ˜¯é™£åˆ—'; +$lang['mass_delete_not_enabled']='大é‡åˆªé™¤åŠŸèƒ½ä¸¦æœªé–‹å•Ÿï¼Œè«‹åœ¨config.php中開啟此功能'; +$lang['mass_deleting']='大é‡åˆªé™¤'; +$lang['mass_delete_progress']='正在 \"%s\" 伺æœå™¨ä¸Šé€²è¡Œåˆªé™¤ç¨‹åº'; +$lang['malformed_mass_delete_array']='錯誤的大é‡åˆªé™¤é™£åˆ—'; +$lang['no_entries_to_delete']='您沒有é¸æ“‡ä»»ä½•è¦åˆªé™¤çš„紀錄'; +$lang['deleting_dn']='刪除 %s'; +$lang['total_entries_failed']='無法刪除紀錄 %s %s'; +$lang['all_entries_successful']='全部刪除完æˆ'; +$lang['confirm_mass_delete']='確èªè¦åˆªé™¤ %s 登入在伺æœå™¨ %s上'; +$lang['yes_delete']='沒錯,刪除å§!'; + +// Renaming entries +$lang['non_leaf_nodes_cannot_be_renamed']='當此記錄有å­ç´€éŒ„時無法é‡æ–°å‘½å'; +$lang['no_rdn_change']='您並沒有改變相å°è­˜åˆ¥å稱'; +$lang['invalid_rdn']='無效的相å°è­˜åˆ¥å稱'; +$lang['could_not_rename']='無法é‡æ–°å‘½å'; + +?> \ No newline at end of file diff --git a/ldap_error_codes.txt b/ldap_error_codes.txt index 03fb07d..3eccc67 100644 --- a/ldap_error_codes.txt +++ b/ldap_error_codes.txt @@ -3,7 +3,7 @@ typically the result of an internal error on your LDAP server." 0x02 LDAP_PROTOCOL_ERROR "A protocol violation was detected." 0x03 LDAP_TIMELIMIT_EXCEEDED "The operation timed out waiting to complete." -0x04 LDAP_SIZELIMIT_EXCEEDED "The LDAP sever refused to serve such a large result set." +0x04 LDAP_SIZELIMIT_EXCEEDED "The LDAP server refused to serve such a large result set." 0x05 LDAP_COMPARE_FALSE "A compare operation returned false." 0x06 LDAP_COMPARE_TRUE "A compare operation returned true." 0x07 LDAP_AUTH_METHOD_NOT_SUPPORTED "The authentication method you specified is not supported by diff --git a/ldap_supported_oids.txt b/ldap_supported_oids.txt new file mode 100644 index 0000000..50e18d5 --- /dev/null +++ b/ldap_supported_oids.txt @@ -0,0 +1,180 @@ +# $Header: /cvsroot/phpldapadmin/phpldapadmin/ldap_supported_oids.txt,v 1.3 2005/09/11 14:59:47 wurley Exp $ + +# If you find some reliable and more meaningful descriptions to this OIDS, +# then please let the phpldapadmin development know so that this file can be +# more descriptive. + +1.2.826.0.1.334810.2.3 "LDAP_CONTROL_VALUESRETURNFILTER" +1.2.826.0.1.3344810.2.3 "Matched Values Control" "RFC 3876" "Describes a control for the LDAP v3 that is used to return a subset of attribute values from an entry. Specifically, only those values that match a 'values return' filter. Without support for this control, a client must retrieve all of an attribute's values and search for specific values locally." +1.2.826.0.1050.11.1.1 "Read-Only LDAP Server" +1.2.826.0.1050.11.2.1 "Read-Write LDAP Server" +1.2.826.0.1050.11.3.1 "White Pages Application LDAP Server" +1.2.826.0.1050.11.4.1 "Certificate Application LDAP Server" +1.2.826.0.1050.11.5.1 "Single Sign On Application LDAP Server" +1.2.840.113549.6.0.0 "Signed Operation" +1.2.840.113549.6.0.1 "Demand Signed Result" +1.2.840.113549.6.0.2 "Signed Result RFC 2649" +1.2.840.113556.1.4.319 "Simple Paged Results Manipulation Control Extension" "RFC 2696" "This control extension allows a client to control the rate at which an LDAP server returns the results of an LDAP search operation. This control may be useful when the LDAP client has limited resources and may not be able to process the entire result set from a given LDAP query, or when the LDAP client is connected over a low-bandwidth connection." +1.2.840.113556.1.4.417 "Show deleted control" "" "The LDAP_SERVER_SHOW_DELETED_OID control is used with an extended LDAP search function to specify that the search results include any deleted objects that match the search filter." +1.2.840.113556.1.4.473 "LDAP Server Sort Result extension" "draft-ietf-ldapext-sorting-01" "This control is included in the searchRequest message as part of the controls field of the LDAPMessage." +1.2.840.113556.1.4.474 "LDAP Server Sort Result extension response control" "" "This control is included in the searchResultDone message as part of the controls field of the LDAPMessage" +1.2.840.113556.1.4.521 "Cross-domain move control" "" "The LDAP_SERVER_CROSSDOM_MOVE_TARGET_OID control is used with an extended LDAP rename function to move an LDAP object from one domain to another. The control specifies the DNS hostname of the domain controller in the destination domain." +1.2.840.113556.1.4.528 "Server search notification control" "" "The LDAP_SERVER_NOTIFICATION_OID control is used with an extended LDAP asynchronous search function to register the client to be notified when changes are made to an object in Active Directory." +1.2.840.113556.1.4.529 "Extended DN control" "" "The LDAP_SERVER_EXTENDED_DN_OID control is used with an extended LDAP search function to request an extended form of an Active Directory object distinguished name. The extended form includes a string representation of the object objectGUID property. For security principal objects such as users, groups, and computers, the extended form also includes a string representation of the object objectSID property." +1.2.840.113556.1.4.616 "LDAP_CONTROL_REFERRALS" +1.2.840.113556.1.4.619 "Lazy commit control" "" "The LDAP_SERVER_LAZY_COMMIT_OID control is used to instruct the server to return the results of a DS modification command, such as add, delete, or replace, after it has been completed in memory, but before it has been committed to disk. The server can then return results quickly, and save the data to disk without holding the client." +1.2.840.113556.1.4.800 "LDAP_CAP_ACTIVE_DIRECTORY_OID" "" "This is an Actrive Directory Server (Win2k and later)." +1.2.840.113556.1.4.801 "Security descriptor flags control" "" "The LDAP_SERVER_SD_FLAGS_OID control is used to pass flags to the server to control various security descriptor results." +1.2.840.113556.1.4.802 "Attribute Range Option" "" "Server supports the Range property enabling clients to incremental retrieve values from multivalue attributes." +1.2.840.113556.1.4.803 "LDAP_MATCHING_RULE_BIT_AND" +1.2.840.113556.1.4.804 "LDAP_MATCHING_RULE_BIT_OR" +1.2.840.113556.1.4.805 "Tree Delete" "" "The LDAP_SERVER_TREE_DELETE_OID control is used with an extended LDAP delete function to delete an entire subtree in the directory." +1.2.840.113556.1.4.841 "Directory synchronization control" "" "The LDAP_SERVER_DIRSYNC_OID control enables an application to search the directory for objects changed from a previous state. It is also used with the extended LDAP search functions such as ldap_search_ext." +1.2.840.113556.1.4.906 "Microsoft Large Integer" +1.2.840.113556.1.4.970 "Get stats control (Stateless)" +1.2.840.113556.1.4.1302 "Microsoft OID used with DEN Attributes" +1.2.840.113556.1.4.1338 "Verify name control" "" "The LDAP_SERVER_VERIFY_NAME_OID control is used with extended LDAP add and modify requests to instruct the DC accepting the update which DC it should verify with, the existence of any DN attribute values." +1.2.840.113556.1.4.1339 "LDAP_SERVER_DOMAIN_SCOPE_OID" "" "The LDAP_SERVER_DOMAIN_SCOPE_OID control is used to instruct the LDAP server not to generate any referrals when completing a request. This control also limits any search using it to a single naming context." +1.2.840.113556.1.4.1340 "Search options control" "" " The LDAP_SERVER_SEARCH_OPTIONS_OID control is used to pass flags to the server to control various search behaviors." +1.2.840.113556.1.4.1413 "LDAP ease modify restrictions" "" "Allows an LDAP modify to work under less restrictive conditions. Without it, a delete will fail if an attribute does not exist, and an add will fail if an attribute already exists." +1.2.840.113556.1.4.1504 "Attribute scoped query control" "" "The LDAP_SERVER_ASQ_OID control is used with an extended LDAP search function to force the query to be based on a specific DN-valued attribute. Only one source attribute can be specified with this control and the search request is limited to base object scoped queries." +1.2.840.113556.1.4.1670 "LDAP_CAP_ACTIVE_DIRECTORY_V51_OID" "" "This server is a Whistler Active Directory server (Win2k3 and later)." +1.2.840.113556.1.4.1781 "Fast concurrent bind extended operation" "" "The Microsoft LDAP API will send an extended request with this name to Active Directory to request that all binds on this connection be processed as 'fast' binds." +1.2.840.113556.1.4.1791 "LDAP_CAP_ACTIVE_DIRECTORY_LDAP_INTEG_OID" "" "LDAP server is capable of doing signing and sealing on an NTLM authenticated connection, and that the server is capable of performing subsequent binds on a signed or sealed connection." +1.2.840.113556.1.4.1852 "LDAP_SERVER_QUOTA_CONTROL_OID" "" "The LDAP_SERVER_QUOTA_CONTROL_OID control is used to pass the SID of a security principal, whose quota is being queried, to the server in a LDAP search operation." +1.3.6.1.1.7.1 "LCUP Sync Request Control. RFC 3928 control" +1.3.6.1.1.7.2 "LCUP Sync Update Control. RFC 3928 control" +1.3.6.1.1.7.3 "LCUP Sync Done Control. RFC 3928 control" +1.3.6.1.1.8 "Cancel Operation. RFC 3909 extension" +1.3.6.1.4.1.42.2.27.8.5.1 "passwordPolicyRequest" +1.3.6.1.4.1.1466.101.119.1 "Dynamic Directory Services Refresh Request RFC2589" +1.3.6.1.4.1.1466.20036 "LDAP_NOTICE_OF_DISCONNECTION" +1.3.6.1.4.1.1466.20037 "Transport Layer Security Extension" "RFC 2830" "This operation provides for TLS establishment in an LDAP association and is defined in terms of an LDAP extended request." +1.3.6.1.4.1.1466.29539.1 "LDAP_CONTROL_ATTR_SIZELIMIT" +1.3.6.1.4.1.1466.29539.2 "LDAP_CONTROL_NO_COPY" +1.3.6.1.4.1.1466.29539.3 "LDAP_CONTROL_PARTIAL_COPY" +1.3.6.1.4.1.1466.29539.5 "LDAP_CONTROL_NO_CHAINING" +1.3.6.1.4.1.1466.29539.7 "LDAP_CONTROL_ALIAS_ON_UPDATE" +1.3.6.1.4.1.1466.29539.10 "LDAP_CONTROL_TRIGGER" +1.3.6.1.4.1.1466.29539.12 "nsTransmittedControl" +1.3.6.1.4.1.4203.1.5.1 "All Operational Attribute" "RFC 3673" "An LDAP extension which clients may use to request the return of all operational attributes." +1.3.6.1.4.1.4203.1.5.2 "Requesting Attributes by Object Class" "draft-zeilenga-ldap-adlist-10.txt" "Extends LDAP to support a mechanism that LDAP clients may use to request the return of all attributes of an object class." +1.3.6.1.4.1.4203.1.5.3 "LDAP Absolute True and False Filters" "draft-zeilenga-ldap-t-f-10.txt" "Implementations of this extension SHALL allow 'and' and 'or' choices with zero filter elements." +1.3.6.1.4.1.4203.1.5.4 "Language Tags" "RFC 3866" "Supports storing attributes with language tag options in the DIT" +1.3.6.1.4.1.4203.1.5.5 "Language Ranges" "RFC 3866" "Supports language range matching of attributes with language tag options stored in the DIT" +1.3.6.1.4.1.4203.1.10.1 "Subentries in LDAP" "RFC 3672" "The subentries control MAY be sent with a searchRequest to control the visibility of entries and subentries which are within scope. Non-visible entries or subentries are not returned in response to the request." +1.3.6.1.4.1.4203.1.10.2 "LDAP No-Op Control" "draft-zeilenga-ldap-noop-02.txt" "The No-Op control can be used to disable the normal effect of an operation. The control can be used to discover how a server might react to a particular update request without updating the directory." +1.3.6.1.4.1.4203.1.11.1 "LDAP Password Modify Extended Operation" "RFC 3062" "An LDAP extended operation to allow modification of user passwords which is not dependent upon the form of the authentication identity nor the password storage mechanism used." +1.3.6.1.4.1.4203.1.11.2 "LDAP Cancel Extended Operation" +1.3.6.1.4.1.4203.1.11.3 "Who Am I? Extended Operation" "draft-zeilenga-ldap-authzid-10.txt" "This specification provides a mechanism for Lightweight Directory Access Protocol (LDAP) clients to obtain the authorization identity which the server has associated with the user or application entity." +1.3.6.1.4.1.4203.666.5.1 "Subentries Control" +1.3.6.1.4.1.4203.666.5.2 "NO OP Control" +1.3.18.0.2.12.1 "The ACL credential controls provide a method to flow a subject's credentials associated with a bind." +1.3.18.0.2.12.5 "tranExtOpInit" +1.3.18.0.2.12.6 "tranExtOpInit" +2.16.840.1.113531.18.2.1 "LDAP_C_SETOPTIONS_OID" +2.16.840.1.113531.18.2.2 "LDAP_C_SETDONTUSECOPY_OID" +2.16.840.1.113531.18.2.3 "LDAP_C_SETLOCALSCOPE_OID" +2.16.840.1.113531.18.2.4 "Return operational attributes as well as user attributes" +2.16.840.1.113531.18.2.5 "Return only subentries" +2.16.840.1.113531.18.2.6 "LDAP_C_SETUSEALIAS_OID" +2.16.840.1.113531.18.2.7 "LDAP_C_SETPREFERCHAIN_OID" +2.16.840.1.113531.18.2.8 "LDAP_C_SETX500DN_OID" +2.16.840.1.113531.18.2.9 "LDAP_C_SETCOPYSHALLDO_OID" +2.16.840.1.113531.18.2.10 "LDAP_C_SETDONTMAPATTRS_OID" +2.16.840.1.113531.18.2.11 "Return normal entries as well as sub-entries" +2.16.840.1.113719.1.27.99.1 "Superior References" +2.16.840.1.113719.1.27.100.1 "ndsToLdapResponse" +2.16.840.1.113719.1.27.100.2 "ndsToLdapRequest" +2.16.840.1.113719.1.27.100.3 "createNamingContextRequest" +2.16.840.1.113719.1.27.100.4 "createNamingContextResponse" +2.16.840.1.113719.1.27.100.5 "mergeNamingContextRequest" +2.16.840.1.113719.1.27.100.6 "mergeNamingContextResponse" +2.16.840.1.113719.1.27.100.7 "addReplicaRequest" +2.16.840.1.113719.1.27.100.8 "addReplicaResponse" +2.16.840.1.113719.1.27.100.9 "refreshLDAPServerRequest" +2.16.840.1.113719.1.27.100.10 "refreshLDAPServerResponse" +2.16.840.1.113719.1.27.100.11 "removeReplicaRequest" +2.16.840.1.113719.1.27.100.12 "removeReplicaResponse" +2.16.840.1.113719.1.27.100.13 "namingContextEntryCountRequest" +2.16.840.1.113719.1.27.100.14 "namingContextEntryCountResponse" +2.16.840.1.113719.1.27.100.15 "changeReplicaTypeRequest" +2.16.840.1.113719.1.27.100.16 "changeReplicaTypeResponse" +2.16.840.1.113719.1.27.100.17 "getReplicaInfoRequest" +2.16.840.1.113719.1.27.100.18 "getReplicaInfoResponse" +2.16.840.1.113719.1.27.100.19 "listReplicaRequest" +2.16.840.1.113719.1.27.100.20 "listReplicaResponse" +2.16.840.1.113719.1.27.100.21 "receiveAllUpdatesRequest" +2.16.840.1.113719.1.27.100.22 "receiveAllUpdatesResponse" +2.16.840.1.113719.1.27.100.23 "sendAllUpdatesRequest" +2.16.840.1.113719.1.27.100.24 "sendAllUpdatesResponse" +2.16.840.1.113719.1.27.100.25 "requestNamingContextSyncRequest" +2.16.840.1.113719.1.27.100.26 "requestNamingContextSyncResponse" +2.16.840.1.113719.1.27.100.27 "requestSchemaSyncRequest" +2.16.840.1.113719.1.27.100.28 "requestSchemaSyncResponse" +2.16.840.1.113719.1.27.100.29 "abortNamingContextOperationRequest" +2.16.840.1.113719.1.27.100.30 "abortNamingContextOperationResponse" +2.16.840.1.113719.1.27.100.31 "Get Bind DN Request" +2.16.840.1.113719.1.27.100.32 "Get Bind DN Response" +2.16.840.1.113719.1.27.100.33 "Get Effective Privileges Request" +2.16.840.1.113719.1.27.100.34 "Get Effective Privileges Response" +2.16.840.1.113719.1.27.100.35 "Set Replication Filter Request" +2.16.840.1.113719.1.27.100.36 "Set Replication Filter Response" +2.16.840.1.113719.1.27.100.37 "Get Replication Filter Request" +2.16.840.1.113719.1.27.100.38 "Get Replication Filter Response" +2.16.840.1.113719.1.27.100.39 "Create Orphan Partition Request" +2.16.840.1.113719.1.27.100.40 "Create Orphan Partition Response" +2.16.840.1.113719.1.27.100.41 "Remove Orphan Partition Request" +2.16.840.1.113719.1.27.100.42 "Remove Orphan Partition Response" +2.16.840.1.113719.1.27.100.43 "Trigger Backlinker Request" +2.16.840.1.113719.1.27.100.44 "Trigger Backlinker Response" +2.16.840.1.113719.1.27.100.47 "Trigger Janitor Request" +2.16.840.1.113719.1.27.100.48 "Trigger Janitor Response" +2.16.840.1.113719.1.27.100.49 "Trigger Limber Request" +2.16.840.1.113719.1.27.100.50 "Trigger Limber Response" +2.16.840.1.113719.1.27.100.51 "Trigger Skulker Request" +2.16.840.1.113719.1.27.100.52 "Trigger Skulker Response" +2.16.840.1.113719.1.27.100.53 "Trigger Schema Synch Request" +2.16.840.1.113719.1.27.100.54 "Trigger Schema Synch Response" +2.16.840.1.113719.1.27.100.55 "Trigger Partition Purge Request" +2.16.840.1.113719.1.27.100.56 "Trigger Partition Purge Response" +2.16.840.1.113719.1.27.100.79 "Monitor Events Request" +2.16.840.1.113719.1.27.100.80 "Monitor Events Response" +2.16.840.1.113719.1.27.100.81 "Event Notification" +2.16.840.1.113719.1.27.101.1 "Duplicate Entry Request" +2.16.840.1.113719.1.27.101.2 "DuplicateSearchResult" +2.16.840.1.113719.1.27.101.3 "DuplicateEntryResponseDone" +2.16.840.1.113719.1.27.101.5 "Simple Password" +2.16.840.1.113719.1.27.101.6 "Forward Reference" +2.16.840.1.113719.1.142.100.1 "startFramedProtocolRequest" +2.16.840.1.113719.1.142.100.2 "startFramedProtocolResponse" +2.16.840.1.113719.1.142.100.3 "ReplicationUpdate" +2.16.840.1.113719.1.142.100.4 "endFramedProtocolRequest" +2.16.840.1.113719.1.142.100.5 "endFramedProtocolResponse" +2.16.840.1.113719.1.142.100.6 "lburpOperationRequest" +2.16.840.1.113719.1.142.100.7 "lburpOperationResponse" +2.16.840.1.113730.3.4 "Netscape LDAPv3 controls" +2.16.840.1.113730.3.4.2 "ManageDsaIT Control" "RFC 3296" "The client may provide the ManageDsaIT control with an operation to indicate that the operation is intended to manage objects within the DSA (server) Information Tree. The control causes Directory-specific entries (DSEs), regardless of type, to be treated as normal entries allowing clients to interrogate and update these entries using LDAP operations." +2.16.840.1.113730.3.4.3 "Persistent Search LDAPv3 control" +2.16.840.1.113730.3.4.4 "Netscape Password Expired LDAPv3 control" +2.16.840.1.113730.3.4.5 "Netscape Password Expiring LDAPv3 control" +2.16.840.1.113730.3.4.6 "Netscape NT Synchronization Client LDAPv3 control" +2.16.840.1.113730.3.4.7 "Entry Change Notification LDAPv3 control" +2.16.840.1.113730.3.4.8 "Transaction ID Request Control" +2.16.840.1.113730.3.4.9 "VLV Request LDAPv3 control" "" "As defined in the 'LDAPv3 Extensions for Virtual List View' IETF document." +2.16.840.1.113730.3.4.10 "VLV Response LDAPv3 control" "" "As defined in the 'LDAPv3 Extensions for Virtual List View' IETF document." +2.16.840.1.113730.3.4.11 "Transaction ID Response Control" +2.16.840.1.113730.3.4.12 "Proxied Authorization (version 1) control" "draft-weltman-ldapv3-proxy-05" "For assuming the identity of another entry for the duration of a request. This has been replaced by a new 'version 2' Proxied Authorization control." +2.16.840.1.113730.3.4.13 "iPlanet Directory Server Replication Update Information Control" +2.16.840.1.113730.3.4.14 "iPlanet Directory Server 'search on specific backend' control" +2.16.840.1.113730.3.4.15 "Authentication Response Control" +2.16.840.1.113730.3.4.16 "Authentication Request Control" +2.16.840.1.113730.3.4.17 "Real Attributes Only Request Control" +2.16.840.1.113730.3.4.18 "LDAP Proxied Authorization Control" "draft-weltman-ldapv3-proxy-06.txt" "The Proxied Authorization Control allows a client to request that an operation be processed under a provided authorization identity [AUTH] instead of as the current authorization identity associated with the connection. " +2.16.840.1.113730.3.4.999 "iPlanet Replication Modrdn Extra Mods Control" +2.16.840.1.113730.3.5.3 "iPlanet Start Replication Request Extended Operation" +2.16.840.1.113730.3.5.4 "iPlanet Replication Response Extended Operation" +2.16.840.1.113730.3.5.5 "iPlanet End Replication Request Extended Operation" +2.16.840.1.113730.3.5.6 "iPlanet Replication Entry Request Extended Operation" +2.16.840.1.113730.3.5.7 "iPlanet Bulk Import Start Extended Operation" +2.16.840.1.113730.3.5.8 "iPlanet Bulk Import Finished Extended Operation" diff --git a/ldif_functions.php b/ldif_functions.php index 2ad6595..42d634a 100644 --- a/ldif_functions.php +++ b/ldif_functions.php @@ -1,6 +1,5 @@ lines = &$lines; - $this->_currentLineNumber = 1; - $this->_error = 0; - } + function LdifEntryReader(){} + + function readLines(&$lines){ + $this->lines = &$lines; + $this->_currentLineNumber = 1; + $this->_error = 0; + } /** * Read the change type action associated with the entry @@ -520,6 +524,7 @@ $arr=array(); /** * Exception which can be raised during processing the ldif file + * @package phpLDAPadmin */ class LdifReaderException{ @@ -545,6 +550,7 @@ class LdifReaderException{ /** * Helper base class to read file. + * @package phpLDAPadmin */ class FileReader{ @@ -615,6 +621,7 @@ class FileReader{ /** * Main parser of the ldif file + * @package phpLDAPadmin */ class LdifReader extends FileReader{ @@ -642,6 +649,7 @@ class LdifReader extends FileReader{ // continuous mode operation flag var $continuous_mode; + var $ldifEntryReader = NULL; /** * Private constructor of the LDIFReader class. * Marked as private as we need to instantiate the class @@ -656,6 +664,7 @@ class LdifReader extends FileReader{ $this->_currentLines = array(); $this->_warningMessage=""; $this->_warningVersion=""; + $this->ldifEntryReader = new LdifEntryReader(); //need to change this one $this->_currentEntry = new LdifEntry(); } @@ -701,14 +710,28 @@ class LdifReader extends FileReader{ } /** - * Return the current entry object + * Return the current entry as an object * * @return Ldap_Ldif_entry the current ldif entry */ - function getCurrentEntry(){ + function fetchEntryObject(){ return $this->_currentEntry; } + /** + * Return the current entry as an array + * + */ + function fetchEntryArray(){} + + /** + * Return the entry as it is. + * + * @return String[] The lines from the entry. + */ + function fetchEntryRaw(){ + return getCurrentLines(); + } /** * Get the lines of the next entry * @@ -877,15 +900,15 @@ class LdifReader extends FileReader{ function readEntry(){ if($lines = $this->nextLines()){ - $ldifEntryReader = new LdifEntryReader($lines); + $this->ldifEntryReader->readLines($lines); //fetch entry - $entry = $ldifEntryReader->getEntry(); + $entry = $this->ldifEntryReader->getEntry(); $this->_currentEntry = $entry; // if any exception has raised, catch it and throw it to the main reader - if($ldifEntryReader->hasRaisedException()){ - $exception = $ldifEntryReader->getLdifEntryReaderException(); - $faultyLineNumber = $this->dnLineNumber + $exception->lineNumber - 1; - $this->setLdapLdifReaderException(new LdifReaderException($faultyLineNumber,$exception->currentLine,$exception->message)); + if($this->ldifEntryReader->hasRaisedException()){ + $exception = $this->ldifEntryReader->getLdifEntryReaderException(); + $faultyLineNumber = $this->dnLineNumber + $exception->lineNumber - 1; + $this->setLdapLdifReaderException(new LdifReaderException($faultyLineNumber,$exception->currentLine,$exception->message)); if ( ! $this->continuous_mode ) return 0; @@ -904,6 +927,7 @@ class LdifReader extends FileReader{ /** * Helper class to write entries into the ldap server + * @package phpLDAPadmin */ class LdapWriter{ diff --git a/ldif_import.php b/ldif_import.php index fbbab30..32d3fce 100644 --- a/ldif_import.php +++ b/ldif_import.php @@ -1,23 +1,29 @@ Instance($server_id); + +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); + $continuous_mode = isset( $_POST['continuous_mode'] ) ?1:0; -$server_name = $servers[$server_id]['name']; $file = $_FILES['ldif_file']['tmp_name']; $remote_file = $_FILES['ldif_file']['name']; $file_len = $_FILES['ldif_file']['size']; @@ -25,8 +31,6 @@ $file_len = $_FILES['ldif_file']['size']; is_array( $_FILES['ldif_file'] ) or pla_error( $lang['missing_uploaded_file'] ); file_exists( $file ) or pla_error( $lang['no_ldif_file_specified'] ); $file_len > 0 or pla_error( $lang['ldif_file_empty'] ); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); include './header.php'; ?> @@ -34,7 +38,7 @@ include './header.php'; ?>

      - : + : name ); ?> : ()

      @@ -64,14 +68,14 @@ $actionErrorMsg['moddn']= $lang['ldif_could_not_rename_object']; $actionErrorMsg['modify']= $lang['ldif_could_not_modify_object']; // get the connection -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); +//$ds = pla_ldap_connect( $server_id ); +//pla_ldap_connection_is_error( $ds ); //instantiate the reader $ldifReader = new LdifReader($file,$continuous_mode); //instantiate the writer -$ldapWriter = new LdapWriter($ds); +$ldapWriter = new LdapWriter($ldapserver->connect()); // if ldif file has no version number, just display a warning if(!$ldifReader->hasVersionNumber()){ @@ -83,7 +87,7 @@ if( $continuous_mode ){ while( $ldifReader->readEntry() ){ $i++; // get the entry. - $currentEntry = $ldifReader->getCurrentEntry(); + $currentEntry = $ldifReader->fetchEntryObject(); $changeType = $currentEntry->getChangeType(); echo "".$actionString[$changeType]." ".$currentEntry->dn; @@ -99,8 +103,8 @@ echo "".$lang['desc'].": ".$exception->message echo " ".$lang['success']."
      "; else{ echo " ".$lang['failed']."

      "; - echo "Error Code: ".ldap_errno($ds)."
      "; - echo "".$lang['desc'].": ".ldap_error($ds)."
      "; + echo "Error Code: ".ldap_errno($ldapserver->connect())."
      "; + echo "".$lang['desc'].": ".ldap_error($ldapserver->connect())."
      "; } } if( 0 == $i % 5 ) @@ -122,14 +126,14 @@ while($entry = $ldifReader->readEntry()){ else{ echo " ".$lang['failed']."

      "; reload_left_frame(); - pla_error( $actionErrorMsg[$changeType]. " " . htmlspecialchars( $entry->dn ), ldap_error( $ds ), ldap_errno( $ds ) ); + pla_error( $actionErrorMsg[$changeType]. " " . htmlspecialchars( $entry->dn ), ldap_error( $ldapserver->connect() ), ldap_errno( $ldapserver->connect() ) ); } } // if any errors occurs during reading file ,"catch" the exception and display it here. if($ldifReader->hasRaisedException()){ //get the entry which raise the exception,quick hack here - $currentEntry = $ldifReader->getCurrentEntry(); + $currentEntry = $ldifReader->fetchEntryObject(); if($currentEntry->dn !=""){ echo "".$actionString[$currentEntry->getChangeType()]." ".$currentEntry->dn." ".$lang['failed']."
      "; diff --git a/ldif_import_form.php b/ldif_import_form.php index 4a06201..ad2f5aa 100644 --- a/ldif_import_form.php +++ b/ldif_import_form.php @@ -1,30 +1,34 @@ Instance($server_id); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); +if( $ldapserver->isReadOnly() ) + pla_error( $lang['no_updates_in_read_only_mode'] ); +if( ! $ldapserver->haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); include './header.php'; ?>

      -

      :

      +

      : name ); ?>



      diff --git a/login.php b/login.php index ba6ccf5..59f6131 100644 --- a/login.php +++ b/login.php @@ -1,6 +1,5 @@ isAnonBindAllowed()) + $anon_bind = isset( $_POST['anonymous_bind'] ) && $_POST['anonymous_bind'] == 'on' ? true : false; +else + $anon_bind = false; -if( ! $anon_bind ) { +if( ! $anon_bind ) strlen($pass) or pla_error( $lang['password_blank'] ); -} -$auth_type = $servers[$server_id]['auth_type']; +$save_auth_type = $ldapserver->auth_type; -if( $anon_bind ) { +if ($anon_bind) { + debug_log(sprintf('Anonymous Login was posted [%s].',$anon_bind),4); $dn = null; $pass = null; -} -// Checks if the login_attr option is enabled for this host, -// which allows users to login with a simple username like 'jdoe' rather -// than the fully qualified DN, 'uid=jdoe,ou=people,,dc=example,dc=com'. -elseif ( login_attr_enabled( $server_id ) ) { - // Is this a login string (printf-style) - if( login_string_enabled( $server_id ) ) { - $dn = str_replace( '', $uid, get_login_string( $server_id ) ); - } else { - // This is a standard login_attr +/* Checks if the login_attr option is enabled for this host, + which allows users to login with a simple username like 'jdoe' rather + than the fully qualified DN, 'uid=jdoe,ou=people,,dc=example,dc=com'. */ +} elseif ($ldapserver->isLoginAttrEnabled()) { - // Fake the auth_type of config to do searching. This way, the admin can specify - // the DN to use when searching for the login_attr user. - $servers[$server_id]['auth_type'] = 'config'; + # Is this a login string (printf-style) + if( $ldapserver->isLoginStringEnabled() ) { + $dn = str_replace( '', $uid, $ldapserver->getLoginString() ); + debug_log(sprintf('LoginStringDN: [%s]',$dn),3); - // search for the "uid" first - set_error_handler( 'temp_login_error_handler' ); - $ds = pla_ldap_connect( $server_id ); - pla_ldap_connection_is_error( $ds ); - restore_error_handler(); - $search_base = isset( $servers[$server_id]['base'] ) && '' != trim( $servers[$server_id]['base'] ) ? - $servers[$server_id]['base'] : - try_to_get_root_dn( $server_id, $ds ); - if (!empty($servers[$server_id]['login_class'])) { - $filter = '(&(objectClass='.$servers[$server_id]['login_class'].')('.$servers[$server_id]['login_attr'].'='.$uid.'))'; - } else { - $filter = $servers[$server_id]['login_attr'].'='.$uid; - } - $sr = @ldap_search($ds, $search_base, $filter, array('dn'), 0, 1); - $result = @ldap_get_entries($ds, $sr); - $dn = isset( $result[0]['dn'] ) ? $result[0]['dn'] : false; - if( ! $dn ) { - pla_error( $lang['bad_user_name_or_password'] ); - } + } else { + # This is a standard login_attr - // restore the original auth_type - $servers[$server_id]['auth_type'] = $auth_type; - } + /* Fake the auth_type of config to do searching. This way, the admin can specify + the DN to use when searching for the login_attr user. */ + $ldapserver->auth_type = 'config'; + + set_error_handler( 'temp_login_error_handler' ); + if ($ldapserver->login_dn) + $ldapserver->connect(true,false); + else + $ldapserver->connect(true,true); + restore_error_handler(); + + if (! empty($ldapserver->login_class)) + $filter = sprintf('(&(objectClass=%s)(%s=%s))',$ldapserver->login_class,$ldapserver->login_attr,$uid); + else + $filter = sprintf('%s=%s',$ldapserver->login_attr,$uid); + + # Got through each of the BASE DNs and test the login. + foreach ($ldapserver->getBaseDN() as $base_dn) { + debug_log(sprintf('Searching LDAP with base [%s]',$base_dn),9); + + $sr = @ldap_search($ldapserver->connect(false), $base_dn, $filter, array('dn'), 0, 1); + $result = @ldap_get_entries($ldapserver->connect(false), $sr); + $dn = isset( $result[0]['dn'] ) ? $result[0]['dn'] : false; + + if ($dn) { + debug_log(sprintf('Got DN [%s] for user ID [%s]',$dn,$uid),5); + break; + } + } + + + # If we got here then we werent able to find a DN for the login filter. + if (! $dn) + pla_error($lang['bad_user_name_or_password']); + + # restore the original auth_type + $ldapserver->auth_type = $save_auth_type; + } } -// We fake a 'config' server auth_type to omit duplicated code -$auth_type = $servers[$server_id]['auth_type']; -$servers[$server_id]['auth_type'] = 'config'; -$servers[$server_id]['login_dn'] = $dn; -$servers[$server_id]['login_pass'] = $pass; +# We fake a 'config' server auth_type to omit duplicated code +debug_log(sprintf('Setting login type to CONFIG with DN [%s]',$dn),9); -// verify that the login is good -if( null == $dn && null == $pass ) - $ds = pla_ldap_connect( $server_id, true, false ); +$save_auth_type = $ldapserver->auth_type; +$ldapserver->auth_type = 'config'; +$ldapserver->login_dn = $dn; +$ldapserver->login_pass = $pass; + +# Verify that dn is allowed to login +if (! userIsAllowedLogin($ldapserver,$dn)) + pla_error( $lang['login_not_allowed'] ); + +debug_log(sprintf('User is not prohibited from logging in - now bind with DN [%s]',$dn),9); + +# verify that the login is good +if( is_null($dn) && is_null($pass)) + $ds = $ldapserver->connect(true,true,true); else - $ds = pla_ldap_connect( $server_id, false, false ); + $ds = $ldapserver->connect(true,false,true); -if( ! is_resource( $ds ) ) { - if( $anon_bind ) - pla_error( $lang['could_not_bind_anon'] ); +debug_log(sprintf('Connection returned [%s]',$ds),9); + +if (! is_resource($ds)) { + if ($anon_bind) + pla_error($lang['could_not_bind_anon']); else - pla_error( $lang['bad_user_name_or_password'] ); -} + pla_error($lang['bad_user_name_or_password']); -$servers[$server_id]['auth_type'] = $auth_type; -set_login_dn( $server_id, $dn, $pass, $anon_bind ) or pla_error( $lang['could_not_set_cookie'] ); + syslog_notice("Authentification FAILED for $dn"); +} + +$ldapserver->auth_type = $save_auth_type; +set_login_dn($ldapserver,$dn,$pass,$anon_bind) or pla_error( $lang['could_not_set_cookie'] ); +set_lastactivity($ldapserver); initialize_session_tree(); -$_SESSION['tree'][$server_id] = array(); -$_SESSION['tree_icons'][$server_id] = array(); +$_SESSION['tree'][$ldapserver->server_id] = array(); +$_SESSION['tree_icons'][$ldapserver->server_id] = array(); + +if(! $anon_bind) { + syslog_notice("Authentification successful for $dn"); +} session_write_close(); -include realpath( 'header.php' ); +include './header.php'; ?> @@ -127,10 +159,9 @@ include realpath( 'header.php' );


      -
      - - () +name)); ?>
      + + ()
      @@ -142,12 +173,11 @@ include realpath( 'header.php' ); /** * Only gets called when we fail to login. */ -function temp_login_error_handler( $errno, $errstr, $file, $lineno ) -{ - global $lang; - if( 0 == ini_get( 'error_reporting' ) || 0 == error_reporting() ) - return; - pla_error( $lang['could_not_connect'] . "

      " . htmlspecialchars( $errstr ) ); +function temp_login_error_handler($errno,$errstr,$file,$lineno) { + global $lang; + if (ini_get('error_reporting') == 0 || error_reporting() == 0) + return; + + pla_error($lang['could_not_connect']."

      ".htmlspecialchars($errstr)); } ?> - diff --git a/login_form.php b/login_form.php index ba40328..ba84627 100644 --- a/login_form.php +++ b/login_form.php @@ -1,46 +1,39 @@ auth_type) + pla_error($lang['error_auth_type_config']); +if (! in_array($ldapserver->auth_type, array('cookie','session'))) + pla_error(sprintf($lang['unknown_auth_type'],htmlspecialchars($ldapserver->auth_type))); include './header.php'; ?> - +isAnonBindAllowed() ) { ?> -

      +

      name); ?>


      - - +
      - -
      -
      - - + +
      + +
      - + + - + +
      - - - + +isAnonBindAllowed() ) { ?> + - - + + + + + diff --git a/logout.php b/logout.php index dca6a6b..f65b5d7 100644 --- a/logout.php +++ b/logout.php @@ -1,32 +1,32 @@ haveAuthInfo()) + pla_error($lang['no_one_logged_in']); -if( ! isset( $servers[ $server_id ][ 'auth_type' ] ) ) - return false; -$auth_type = $servers[ $server_id ][ 'auth_type' ]; -if( 'cookie' == $auth_type || 'session' == $auth_type ) - unset_login_dn( $server_id ) or pla_error( $lang['could_not_logout'] ); -else - pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $auth_type ) ) ); +if (in_array($ldapserver->auth_type, array('cookie','session'))) { + syslog_notice (sprintf("Logout for %s",get_logged_in_dn($ldapserver))); + unset_login_dn($ldapserver) or pla_error($lang['could_not_logout']); + unset_lastactivity($ldapserver); -include realpath( 'header.php' ); +} else + pla_error(sprintf($lang['unknown_auth_type'], htmlspecialchars($ldapserver->auth_type))); +include './header.php'; ?> - " . sprintf( $lang['confirm_mass_delete'], $n, $server_name ) . "\n"; - ?> + echo "

      " . sprintf( $lang['confirm_mass_delete'], $n, $ldapserver->name ) . "

      \n"; ?> +
      - - Do you really want to delete + + Do you really want to delete ? - +
      ',$lang['syntax_oid'],$lang['desc']); + + $counter = 1; + + $schema_syntaxes = get_schema_syntaxes($ldapserver,null,true); + if (! $schema_syntaxes) + pla_error($schema_error_str); + + foreach ($schema_syntaxes as $syntax) { + $counter++; + $oid = htmlspecialchars($syntax->getOID()); + $desc = htmlspecialchars($syntax->getDescription()); + + if ($highlight_oid && $highlight_oid == $oid) + echo ''; + + else + printf('',$counter%2==0?'even':'odd'); + + printf('',$oid,$oid,$desc); + } + + print '
        @@ -148,7 +149,5 @@ if( $confirmed == true ) { - diff --git a/password_checker.php b/password_checker.php index cf925be..43543c5 100644 --- a/password_checker.php +++ b/password_checker.php @@ -1,4 +1,11 @@

        -
        + @@ -33,9 +39,9 @@ $enc_type = get_enc_type( $hash );
        - "; - if( password_check( $hash, $check_password) ) + if( password_check( $hash, $check_password) ) echo "" . $lang['passwords_match'] . ""; else echo "" . $lang['passwords_do_not_match'] . ""; @@ -45,5 +51,3 @@ $enc_type = get_enc_type( $hash );
        - - diff --git a/purge_cache.php b/purge_cache.php index a4b3df1..124d225 100644 --- a/purge_cache.php +++ b/purge_cache.php @@ -1,10 +1,16 @@ @@ -15,21 +21,21 @@ $purge_session_keys = array( 'schema' );
        diff --git a/rdelete.php b/rdelete.php index ba5d9bd..13295d8 100644 --- a/rdelete.php +++ b/rdelete.php @@ -1,126 +1,132 @@ isReadOnly()) + pla_error($lang['no_updates_in_read_only_mode']); +if (! $ldapserver->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); $dn = $_POST['dn']; -$encoded_dn = rawurlencode( $dn ); -$server_id = $_POST['server_id']; -$rdn = get_rdn( $dn ); +$encoded_dn = rawurlencode($dn); +$rdn = get_rdn($dn); -if( ! $dn ) - pla_error( $lang['you_must_specify_a_dn'] ); +if (! $dn) + pla_error($lang['you_must_specify_a_dn']); -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); -dn_exists( $server_id, $dn ) or pla_error( sprintf( $lang['no_such_entry'], htmlspecialchars( $dn ) ) ); +dn_exists($ldapserver,$dn) or pla_error(sprintf($lang['no_such_entry'],htmlspecialchars($dn))); include './header.php'; + echo "\n"; -echo "

        " . sprintf( $lang['deleting_dn'], htmlspecialchars($rdn) ) . "

        \n"; -echo "

        " . $lang['recursive_delete_progress'] . "

        "; +echo "

        ".sprintf($lang['deleting_dn'],htmlspecialchars($rdn))."

        \n"; +echo "

        ".$lang['recursive_delete_progress']."

        "; echo "

        "; echo "\n"; + flush(); // prevent script from bailing early on a long delete -@set_time_limit( 0 ); +@set_time_limit(0); -$del_result = pla_rdelete( $server_id, $dn ); +$del_result = pla_rdelete($ldapserver,$dn); echo "
        \n"; -if( $del_result ) -{ - // kill the DN from the tree browser session variable and - // refresh the tree viewer frame (left_frame) - if( array_key_exists( 'tree', $_SESSION ) ) - { +if ($del_result) { + # 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']; - // does it have children? (it shouldn't, but hey, you never know) - if( isset( $tree[$server_id][$dn] ) ) - unset( $tree[$server_id][$dn] ); - - // Get a tree in the session if not already gotten - initialize_session_tree(); + # 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 from the tree sesssion - foreach( $tree[$server_id] as $tree_dn => $subtree ) - foreach( $subtree as $key => $sub_tree_dn ) - if( 0 == strcasecmp( $sub_tree_dn, $dn ) ) - unset( $tree[$server_id][$tree_dn][$key] ); + # Get a tree in the session if not already gotten + initialize_session_tree(); + + # search and destroy from the tree sesssion + 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(); - ?> +?> - ' . htmlspecialchars( $dn ) . '' ); + echo sprintf($lang['entry_and_sub_tree_deleted_successfully'],''.htmlspecialchars($dn).''); } else { - pla_error( sprintf( $lang['could_not_delete_entry'], htmlspecialchars( $dn ) ), ldap_error( $ds ), ldap_errno( $ds ) ); + pla_error(sprintf($lang['could_not_delete_entry'],htmlspecialchars($dn)), + ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect())); } - exit; - -function pla_rdelete( $server_id, $dn ) -{ +function pla_rdelete($ldapserver,$dn) { global $lang; - $children = get_container_contents( $server_id, $dn ); - global $ds; - $ds = pla_ldap_connect( $server_id ); + $children = get_container_contents($ldapserver,$dn); - if( ! is_array( $children ) || count( $children ) == 0 ) { - echo "" . sprintf( $lang['deleting_dn'], htmlspecialchars( $dn ) ) . "..."; + if (! is_array($children) || count($children) == 0) { + echo "".sprintf($lang['deleting_dn'],htmlspecialchars($dn))."..."; flush(); - if( true === preEntryDelete( $server_id, $dn ) ) - if( @ldap_delete( $ds, $dn ) ) { - postEntryDelete( $server_id, $dn ); - echo " " . $lang['success'] . "
        \n"; - return true; - } else { - pla_error( sprintf( $lang['failed_to_delete_entry'], htmlspecialchars( $dn ) ), - ldap_error( $ds ), ldap_errno( $ds ) ); - } + + if (run_hook('pre_entry_delete',array('server_id' => $ldapserver->server_id,'dn' => $dn))) + + if (@ldap_delete($ldapserver->connect(),$dn)) { + run_hook ('post_entry_delete', + array('server_id' => $ldapserver->server_id,'dn' => $dn)); + echo " ".$lang['success']."
        \n"; + return true; + + } else { + pla_error(sprintf($lang['failed_to_delete_entry'],htmlspecialchars($dn)), + ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect())); + } } else { - foreach( $children as $child_dn ) { - pla_rdelete( $server_id, $child_dn ); + foreach ($children as $child_dn) { + pla_rdelete($ldapserver,$child_dn); } - echo "" . sprintf( $lang['deleting_dn'], htmlspecialchars( $dn ) ) . "..."; - flush(); - if( true === preEntryDelete( $server_id, $dn ) ) - if( @ldap_delete( $ds, $dn ) ) { - postEntryDelete( $server_id, $dn ); - echo " " . $lang['success'] . "
        \n"; - return true; - } else { - pla_error( sprintf( $lang['failed_to_delete_entry'], htmlspecialchars( $dn ) ), - ldap_error( $ds ), ldap_errno( $ds ) ); - } - } + echo "".sprintf($lang['deleting_dn'],htmlspecialchars($dn))."..."; + flush(); + + if (true === run_hook ('pre_entry_delete',array('server_id' => $ldapserver->server_id,'dn' => $dn))) + if (@ldap_delete($ldapserver->connect(),$dn)) { + run_hook ('post_entry_delete', + array('server_id' => $ldapserver->server_id,'dn' => $dn)); + + echo " ".$lang['success']."
        \n"; + return true; + + } else { + pla_error(sprintf($lang['failed_to_delete_entry'],htmlspecialchars($dn)), + ldap_error($ldapserver->connect()),ldap_errno($ldapserver->connect())); + } + } } +?> diff --git a/refresh.php b/refresh.php index 10f55a2..4d1284d 100644 --- a/refresh.php +++ b/refresh.php @@ -1,56 +1,51 @@ getBaseDN() as $base_dn) + $tree_icons[$ldapserver->server_id][$base_dn] = get_icon($ldapserver,$base_dn); -// get all the icons and container contents for all expanded entries -if( isset($tree[$server_id]) && is_array( $tree[$server_id] ) ) -{ - foreach( $tree[$server_id] as $dn => $children ) - { - $tree[$server_id][$dn] = get_container_contents( $server_id, $dn, 0, '(objectClass=*)', get_tree_deref_setting() ); - if( is_array( $tree[$server_id][$dn] ) ) { - foreach( $tree[$server_id][$dn] as $child_dn ) - $tree_icons[$server_id][$child_dn] = get_icon( $server_id, $child_dn ); - sort( $tree[ $server_id ][ $dn ] ); +# get all the icons and container contents for all expanded entries +if (isset($tree[$ldapserver->server_id]) && is_array($tree[$ldapserver->server_id])) { + foreach ($tree[$ldapserver->server_id] as $dn => $children) { + $tree[$ldapserver->server_id][$dn] = get_container_contents($ldapserver,$dn,0,'(objectClass=*)', + $config->GetValue('deref','tree')); + + if (is_array($tree[$ldapserver->server_id][$dn])) { + foreach ($tree[$ldapserver->server_id][$dn] as $child_dn) + $tree_icons[$ldapserver->server_id][$child_dn] = get_icon($ldapserver,$child_dn); + + sort($tree[$ldapserver->server_id][$dn]); } } -} -else -{ - header( "Location: tree.php#$server_id" ); + +} else { + header(sprintf('Location: tree.php#%s',$ldapserver->server_id)); } $_SESSION['tree'] = $tree; $_SESSION['tree_icons'] = $tree_icons; session_write_close(); -header( "Location: tree.php#$server_id" ); - - +header(sprintf('Location: tree.php#%s',$ldapserver->server_id)); ?> diff --git a/rename.php b/rename.php index 236cd5c..c7dcd8b 100644 --- a/rename.php +++ b/rename.php @@ -1,102 +1,104 @@ isReadOnly()) + pla_error($lang['no_updates_in_read_only_mode']); +if (! $ldapserver->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); +$dn = ($_POST['dn']); +$new_rdn = ($_POST['new_rdn']); -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); +if (! $ldapserver->isBranchRenameEnabled()) { + $children = get_container_contents($ldapserver,$dn,1); + if (count($children) > 0) + pla_error($lang['non_leaf_nodes_cannot_be_renamed']); +} -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); +$container = get_container($dn); +$new_dn = sprintf('%s,%s',$new_rdn,$container); -$children = get_container_contents( $server_id, $dn, 1 ); -if( count( $children ) > 0 ) - pla_error( $lang['non_leaf_nodes_cannot_be_renamed'] ); +if ($new_dn == $dn) + pla_error($lang['no_rdn_change']); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); +$old_dn_attr = explode('=',$dn); +$old_dn_attr = $old_dn_attr[0]; -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); - -$container = get_container( $dn ); -$new_dn = $new_rdn . ',' . $container; - -if( $new_dn == $dn ) - pla_error( $lang['no_rdn_change'] ); - -$dn_attr = explode( '=', $dn ); -$dn_attr = $dn_attr[0]; -$old_dn_value = pla_explode_dn( $dn ); -$old_dn_value = explode( '=', $old_dn_value[0], 2 ); +$old_dn_value = pla_explode_dn($dn); +$old_dn_value = explode('=',$old_dn_value[0],2); $old_dn_value = $old_dn_value[1]; -$new_dn_value = explode( '=', $new_rdn, 2 ); -if( count( $new_dn_value ) != 2 || ! isset( $new_dn_value[1] ) ) - pla_error( $lang['invalid_rdn'] ); + +$new_dn_value = explode('=',$new_rdn,2); + +if (count($new_dn_value) != 2 || ! isset($new_dn_value[1])) + pla_error($lang['invalid_rdn']); + +$new_dn_attr = $new_dn_value[0]; $new_dn_value = $new_dn_value[1]; -// Add the new DN attr value to the DN attr (ie, add newName to cn) -$add_new_dn_attr = array( $dn_attr => $new_dn_value ); -// Remove the old DN attr value -$remove_old_dn_attr = array( $dn_attr => $old_dn_value ); +$success = run_hook ('pre_rename_entry', array ('server_id' => $ldapserver->server_id, + 'old_dn' => $dn, 'new_dn' => $new_dn_value ) ); -// attempt to add the new DN attr value (if we can't, die a silent death) -$add_dn_attr_success = @ldap_mod_add( $ds, $dn, $add_new_dn_attr ); -if( ! @ldap_rename( $ds, $dn, $new_rdn, $container, false ) ) -{ - pla_error( $lang['could_not_rename'], ldap_error( $ds ), ldap_errno( $ds ), false ); +if ($success) { + $success = false; - // attempt to undo our changes to the DN attr - if( $add_dn_attr_success ) - @ldap_mod_del( $ds, $dn, $add_new_dn_attr ); + $deleteoldrdn = $old_dn_attr == $new_dn_attr; + + if (! @ldap_rename($ldapserver->connect(), $dn, $new_rdn, $container, $deleteoldrdn ) ) { + pla_error($lang['could_not_rename'], ldap_error($ldapserver->connect() ), + ldap_errno($ldapserver->connect() ), false ); + + } else + $success = true; + +} else { + pla_error($lang['could_not_rename'] ); } -else -{ - // attempt to remove the old DN attr value (if we can't, die a silent death) - @ldap_mod_del( $ds, $new_dn, $remove_old_dn_attr ); - if( array_key_exists( 'tree', $_SESSION ) ) - { +if ($success ) { + run_hook ('post_rename_entry', array ('server_id' => $ldapserver->server_id, 'old_dn' => $dn, + 'new_dn' => $new_dn_value ) ); + + if (array_key_exists('tree', $_SESSION ) ) { $tree = $_SESSION['tree']; $tree_icons = $_SESSION['tree_icons']; $old_dn = $dn; // gotta search the whole tree for the entry (must be a leaf node since RDN changes // cannot occur on parents) - foreach( $tree[$server_id] as $parent_dn => $children ) { - foreach( $children as $i => $child_dn ) { - if( 0 == strcasecmp( $child_dn, $old_dn ) ) { - $tree[$server_id][$parent_dn][$i] = $new_dn; - } + foreach ($tree[$ldapserver->server_id] as $parent_dn => $children ) { + foreach ($children as $i => $child_dn ) { + if (0 == strcasecmp($child_dn, $old_dn ) ) + $tree[$ldapserver->server_id][$parent_dn][$i] = $new_dn; } } + // Update the icon tree to reflect the change (remove the old DN and add the new one) - $tree_icons[ $server_id ][ $new_dn ] = $tree_icons[ $server_id ][ $old_dn ]; - unset( $tree_icons[ $server_id ][ $old_dn ] ); + $tree_icons[ $ldapserver->server_id ][ $new_dn ] = $tree_icons[ $ldapserver->server_id ][ $old_dn ]; + unset($tree_icons[ $ldapserver->server_id ][ $old_dn ] ); $_SESSION['tree'] = $tree; $_SESSION['tree_icons'] = $tree_icons; session_write_close(); - $edit_url="edit.php?server_id=$server_id&dn=" . rawurlencode( "$new_rdn,$container" ); - - ?> + $edit_url = sprintf('edit.php?server_id=%s&dn=%s',$ldapserver->server_id,rawurlencode("$new_rdn,$container")); +?> @@ -115,7 +117,6 @@ else - diff --git a/rename_form.php b/rename_form.php index 1230675..d71a975 100644 --- a/rename_form.php +++ b/rename_form.php @@ -1,41 +1,41 @@ isReadOnly()) + pla_error($lang['no_updates_in_read_only_mode']); +if (! $ldapserver->haveAuthInfo()) + pla_error($lang['not_enough_login_info']); + $dn = $_GET['dn']; $encoded_dn = rawurlencode( $dn ); -$server_id = $_GET['server_id']; $rdn = get_rdn( $dn ); -$server_name = $servers[$server_id]['name']; - -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_in_read_only_mode'] ); - -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); include './header.php'; ?>

        -

        :     :

        +

        : name; ?>     :


        - + @@ -43,4 +43,3 @@ include './header.php'; ?>
        - diff --git a/schema.php b/schema.php index f01d3b1..6f7cb0b 100644 --- a/schema.php +++ b/schema.php @@ -1,446 +1,543 @@ haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); -check_server_id( $server_id ) or - pla_error( $lang['bad_server_id'].": " . htmlspecialchars( $server_id ) ); -have_auth_info( $server_id ) or - pla_error( $lang['not_enough_login_info']); -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); +$view = isset($_GET['view']) ? $_GET['view'] : 'objectClasses'; +$viewvalue = isset($_GET['viewvalue']) ? $_GET['viewvalue'] : null; + +if (trim($viewvalue) == "") + $viewvalue = null; +if (! is_null($viewvalue)) + $viewed = false; include './header.php'; -$schema_error_str = $lang['could_not_retrieve_schema_from']." " - . htmlspecialchars($servers[$server_id]['name']) - . ".

        " - .$lang['reasons_for_error'] - ."
        • " - .$lang['schema_retrieve_error_1'] - . "
        • " - .$lang['schema_retrieve_error_2'] - ."
        • " - .$lang['schema_retrieve_error_3'] - ."
        ".$lang['please_report_this_as_a_bug'].""; - +$schema_error_str = sprintf('%s %s.

        %s
        • %s
        • %s
        • %s
        • %s
        ', + $lang['could_not_retrieve_schema_from'],htmlspecialchars($ldapserver->name), + $lang['reasons_for_error'],$lang['schema_retrieve_error_1'], + $lang['schema_retrieve_error_2'],$lang['schema_retrieve_error_3'], + $lang['schema_retrieve_error_4']); ?> -

        -

        +

        + name); ?>


        +
        '.$lang['objectclasses'].'' ); ?> + sprintf('%s', + $ldapserver->server_id,'objectClasses',$lang['objectclasses'])); ?> | '. $lang['attribute_types'].'' ); ?> + sprintf('%s', + $ldapserver->server_id,'attributes',$lang['attribute_types'])); ?> | '.$lang['syntaxes'].'' ); ?> + sprintf('%s', + $ldapserver->server_id,'syntaxes',$lang['syntaxes'])); ?> | '.$lang['matchingrules'].'' ); ?> + sprintf('%s', + $ldapserver->server_id,'matching_rules',$lang['matchingrules'])); ?>

        - +'; + printf('
      %s%s
      %s%s
      '; + break; + + case 'attributes': + $schema_attrs = get_schema_attributes($ldapserver,null,true); + $schema_object_classes = get_schema_objectclasses($ldapserver,null,true); + + if (! $schema_attrs || ! $schema_object_classes) + pla_error($schema_error_str); +?> + + : + + + + - - - -
      - - - getName() ) ) { - if( ! is_null( $viewvalue ) ) - $viewed = true; - flush(); - echo "\n\n"; - $counter = 0; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - - echo "\n"; - echo '\n"; - echo "\n"; - echo "\n\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; +?> - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; + + - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; +
      +
      getName() ) . "\">"; - echo $attr->getName() . "
      ".$lang['desc']."" . ( $attr->getDescription() == null ? '('.$lang['no_description'].')' : $attr->getDescription() ). "
      ".$lang['oid']."" . $attr->getOID() . "
      '.$lang['obsolete']."?" . ( $attr->getIsObsolete() ? '' . $lang['yes'] . '' : $lang['no'] ) . "
      ".$lang['inherits'].""; - if( $attr->getSupAttribute()==null ) - echo '('.$lang['none'].')'; - else - echo "getSupAttribute() ) . "\">" . $attr->getSupAttribute() . "
      ".$lang['equality']."" . ( $attr->getEquality() == null ? '('.$lang['not_specified'].')' : "getEquality()."\">".$attr->getEquality() ) . "
      ".$lang['ordering']."" . ( $attr->getOrdering()==null? '('.$lang['not_specified'].')' : $attr->getOrdering() ) . "
      ".$lang['substring_rule']."" . ( $attr->getSubstr()==null? '('.$lang['not_specified'].')' : $attr->getSubstr() ) . "
      ".$lang['syntax'].""; - if( null != $attr->getType() ) { - echo "getSyntaxOID() . "#" . $attr->getSyntaxOID(); - echo "\">" . $attr->getType() . " (" . $attr->getSyntaxOID() . ")"; - } else { - echo $attr->getSyntaxOID(); + foreach ($schema_attrs as $attr) { + printf('', + $attr->getName(), + (! strcasecmp($attr->getName(),$viewvalue) ? 'selected' : ''),$attr->getName()); } - echo "
      ".$lang['single_valued']."" . ( $attr->getIsSingleValue() ? $lang['yes'] : $lang['no'] ) . "
      ".$lang['collective']."?" . ( $attr->getIsCollective() ? $lang['yes'] : $lang['no'] ) . "
      - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; +getName())) { + if (! is_null($viewvalue)) + $viewed = true; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; + printf('', + strtolower($attr->getName()),$attr->getName()); - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; + $counter = 0; - echo "\n"; - echo "\n"; - echo ""; - echo "\n\n"; + foreach ( + array('desc','obsolete','inherits','equality','ordering','substring_rule','syntax', + 'single_valued','collective','user_modification','usage','maximum_length', + 'aliases','used_by_objectclasses' + ) + as $item) { - echo "\n"; - echo "\n"; - echo ""; - echo "\n\n"; + printf('',++$counter%2 ? 'odd' : 'even'); + printf('',$lang[$item]); - flush(); - } - } - echo "
      ".$lang['user_modification']."" . ( $attr->getIsNoUserModification() ? $lang['no'] : $lang['yes'] ) . "
      ".$lang['usage']."" . ( $attr->getUsage() ? $attr->getUsage() : '('.$lang['not_specified'].')' ) . "
      %s
      ".$lang['maximum_length'].""; - if ( $attr->getMaxLength() === null ) { echo '('.$lang['not_applicable'].')';} - else { - echo number_format( $attr->getMaxLength() ) ." "; - if ( $attr->getMaxLength()>1) {echo $lang['characters'];} - else { echo $lang['character'] ;} - } - echo "
      ".$lang['aliases'].""; - if( count( $attr->getAliases() ) == 0 ) - echo '('.$lang['none'].')'; - else - foreach( $attr->getAliases() as $alias_attr_name ) - echo "$alias_attr_name "; - echo "
      ".$lang['used_by_objectclasses'].""; - if( count( $attr->getUsedInObjectClasses() ) == 0 ) - echo '('.$lang['none'].')'; - else - foreach( $attr->getUsedInObjectClasses() as $used_in_oclass) - echo "$used_in_oclass "; - echo "
      %s
      \n"; + switch ($item) { + case 'desc': + printf('%s', + is_null($attr->getDescription()) ? + '('.$lang['no_description'].')' : $attr->getDescription()); -} elseif( $view == 'matching_rules' ) { - //echo "
      " . $lang['the_following_matching'] . "

      \n\n"; - $schema_matching_rules = get_schema_matching_rules( $server_id, null, false ); - echo '' . $lang['jump_to_matching_rule'].'
      '; - echo '
      '; - echo ''; - echo ''; - echo ''; - echo ''; - echo '
      '; - echo "\n\n\n"; - echo "\n"; - flush(); - $counter=1; - $schema_matching_rules = get_schema_matching_rules( $server_id, null, false ); - if( ! $schema_matching_rules ) pla_error( $schema_error_str ); - foreach( $schema_matching_rules as $rule ) { - $counter++; - $oid = htmlspecialchars( $rule->getOID() ); - $desc = htmlspecialchars( $rule->getName() ); - if ( $viewvalue==null || $viewvalue==($rule->getName() )) { - if( ! is_null( $viewvalue ) ) - $viewed = true; - if( null != $rule->getDescription() ) - $desc .= ' (' . $rule->getDescription() . ')'; - if( true === $rule->getIsObsolete() ) - $desc .= ' ' . $lang['obsolete'] . ''; - echo ""; - echo ""; - echo ""; - echo "\n"; - } - } - echo "
      " . $lang['matching_rule_oid'] . "" . $lang['name'] . "".$lang['used_by_attributes']."
      $oid$desc"; - if( count( $rule->getUsedByAttrs() ) == 0 ) { - echo "
      (" . $lang['none'] . ")


      \n"; - } else { - echo "
      "; - echo ""; - echo ""; - echo "
      \n"; - } - echo "
      \n"; -} elseif( $view == 'objectClasses' ) { - //echo "
      " . $lang['the_following_objectclasses'] . "

      \n"; - flush(); - $schema_oclasses = get_schema_objectclasses( $server_id, null, false ); - if( ! $schema_oclasses ) pla_error( $schema_error_str ); - ?> + print ''; + break; + + case 'matching_rules': + $schema_matching_rules = get_schema_matching_rules($ldapserver,null,true); + if (! $schema_matching_rules) + pla_error($schema_error_str); + + printf('%s
      ',$lang['jump_to_matching_rule']); + + print '
      '; + printf('',$ldapserver->server_id); + print ''; + + print ''; + + printf('',$lang['go']); + print '
      '; + + print ''; + printf('', + $lang['matching_rule_oid'],$lang['name'],$lang['used_by_attributes']); + + $counter = 1; + + foreach ($schema_matching_rules as $rule) { + $counter++; + $oid = htmlspecialchars($rule->getOID()); + $desc = htmlspecialchars($rule->getName()); + + if ( is_null($viewvalue) || $viewvalue == ($rule->getName())) { + + if (! is_null($viewvalue)) + $viewed = true; + + if (null != $rule->getDescription()) + $desc .= sprintf(' (%s)',$rule->getDescription()); + + if ( $rule->getIsObsolete()) + $desc .= sprintf(' %s',$lang['obsolete']); + + printf('',$counter%2 ? 'odd' : 'even'); + printf('',$oid); + printf('',$desc); + + print ''; + print ''; + } + } + + print '
      %s%s%s
      %s%s'; + + if (count($rule->getUsedByAttrs()) == 0) { + printf('
      (%s)


      ',$lang['none']); + + } else { + print '
      '; + print '
      '; + printf('',$ldapserver->server_id); + print ''; + + print '
      '; + printf('',$lang['go']); + print '
      '; + print '
      '; + } + print '
      '; + break; + + case 'objectClasses': + $schema_oclasses = get_schema_objectclasses($ldapserver,null,true); + if (! $schema_oclasses) + pla_error($schema_error_str); +?> + : -
      - - -
      +
      + + + + +

      - $oclass ) { - if ( $viewvalue==null || 0 == strcasecmp( $viewvalue, $oclass->getName() ) ){ - if( ! is_null( $viewvalue ) ) - $viewed = true; - ?> - + + $oclass) { + foreach ($oclass->getSupClasses() as $parent_name) { + if (isset($schema_oclasses[$parent_name])) + $schema_oclasses[$parent_name]->addChildObjectClass($oclass->getName()); + } + + if ( is_null($viewvalue) || ! strcasecmp($viewvalue,$oclass->getName())) { + if ( ! is_null($viewvalue)) + $viewed = true; +?> +

      getName(); ?>

      : getOID(); ?>

      - getDescription() ) { ?> + + getDescription()) { ?>

      : getDescription(); ?>

      +

      : getType(); ?>

      - getIsObsolete() == true ) { ?> + + getIsObsolete()) { ?>

      -

      : getSupClasses() ) == 0 ) - echo "(" . $lang['none'] . ")"; - else - foreach( $oclass->getSupClasses() as $i => $object_class ) { - echo '' . htmlspecialchars( $object_class ) . ''; - if( $i < count( $oclass->getSupClasses() ) - 1 ) - echo ', '; - } - ?>

      +

      : -

      : getName(), 'top' ) ) - echo "(all)"; - elseif( count( $oclass->getChildObjectClasses() ) == 0 ) - echo "(" . $lang['none'] . ")"; - else - foreach( $oclass->getChildObjectClasses() as $i => $object_class ) { - echo '' . htmlspecialchars( $object_class ) . ''; - if( $i < count( $oclass->getChildObjectClasses() ) - 1 ) - echo ', '; - } - ?>

      +getSupClasses()) == 0) + printf('(%s)',$lang['none']); + + else + foreach ($oclass->getSupClasses() as $i => $object_class) { + printf('%s', + $lang['jump_to_this_oclass'],$ldapserver->server_id,$view,htmlspecialchars($object_class), + htmlspecialchars($object_class)); + + if ($i < count($oclass->getSupClasses()) - 1) + print ', '; + } +?> + +

      + +

      : + +getName(),'top') == 0) + printf('(all)',$ldapserver->server_id); + + elseif (count($oclass->getChildObjectClasses()) == 0) + printf('(%s)',$lang['none']); + + else + foreach ($oclass->getChildObjectClasses() as $i => $object_class) { + printf('%s', + $lang['jump_to_this_oclass'],$ldapserver->server_id,$view,htmlspecialchars($object_class), + htmlspecialchars($object_class)); + + if ( $i < count($oclass->getChildObjectClasses()) - 1) + print ', '; + } +?> + +

      +
      - getMustAttrs($schema_oclasses) ) > 0 ) { - echo '
        '; - foreach( $oclass->getMustAttrs($schema_oclasses) as $attr ) { - echo "
      • getName() ). "\">" . htmlspecialchars($attr->getName()); - echo ""; - if( $attr->getSource() != $oclass->getName() ) - { - echo "
          (".$lang['inherited_from']." "; - echo "getSource() . "\">" . $attr->getSource() . ""; - echo ")"; +getMustAttrs($schema_oclasses)) > 0) { + print '
          '; + + foreach ($oclass->getMustAttrs($schema_oclasses) as $attr) { + print '
        • '; + printf('%s', + $ldapserver->server_id,rawurlencode($attr->getName()),htmlspecialchars($attr->getName())); + + if ($attr->getSource() != $oclass->getName()) { + printf('
            (%s ',$lang['inherited_from']); + printf('%s', + $ldapserver->server_id,$attr->getSource(),$attr->getSource()); + print ')'; + } + + print '
        • '; } - echo "\n"; - } - } else - echo "
          (" . $lang['none'] . ")
          \n"; - ?> -
        + + print '
      '; + + } else + printf('
      (%s)
      ',$lang['none']); + +?> +
      - getMayAttrs($schema_oclasses) ) > 0 ) { - echo '
        '; - foreach( $oclass->getMayAttrs($schema_oclasses) as $attr ) { - echo "
      • getName() ) . "\">" . htmlspecialchars($attr->getName() ); - echo "\n"; - if( $attr->getSource() != $oclass->getName() ) - { - echo "
           (".$lang['inherited_from']." "; - echo "getSource() . "\">" . $attr->getSource() . ""; - echo ")"; - } - echo "
      • "; - } - } - else - echo "
        (" . $lang['none'] . ")
        \n"; - ?> + +getMayAttrs($schema_oclasses)) > 0) { + print '
          '; + + foreach ($oclass->getMayAttrs($schema_oclasses) as $attr) { + print '
        • '; + printf('%s', + $ldapserver->server_id,rawurlencode($attr->getName()),htmlspecialchars($attr->getName())); + + if ($attr->getSource() != $oclass->getName()) { + printf('
             (%s ',$lang['inherited_from']); + printf('%s', + $ldapserver->server_id,$attr->getSource(),$attr->getSource()); + print ')'; + } + + print '
        • '; + } + + print '
        '; + + } else + printf('
        (%s)
        ',$lang['none']); +?>
      - - + - diff --git a/schema_functions.php b/schema_functions.php index 07010ce..65f4b11 100644 --- a/schema_functions.php +++ b/schema_functions.php @@ -1,69 +1,61 @@ oid = null; - $this->description = null; - } + /** The description of this schema item. */ + var $description; - /** Default constructor. */ - function SchemaItem() - { - $this->initVars(); - } + /** Initialize class members to default values. */ + function initVars() { + $this->oid = null; + $this->description = null; + } - function setOID( $new_oid ) - { + /** Default constructor. */ + function SchemaItem() { + $this->initVars(); + } + + function setOID( $new_oid ) { $this->oid = $new_oid; } - function setDescription( $new_desc ) - { + function setDescription( $new_desc ) { $this->description = $new_desc; } - function getOID() - { - return $this->oid; - } + function getOID() { + return $this->oid; + } - function getDescription() - { - return $this->description; - } - } + function getDescription() { + return $this->description; + } +} /** * Represents an LDAP objectClass + * @package phpLDAPadmin */ -class ObjectClass extends SchemaItem -{ +class ObjectClass extends SchemaItem { /** This objectClass' name, ie "inetOrgPerson" */ var $name; /** array of objectClass names from which this objectClass inherits */ @@ -76,13 +68,13 @@ class ObjectClass extends SchemaItem var $may_attrs; /** boolean value indicating whether this objectClass is obsolete */ var $is_obsolete; - /** array of objectClasses which inherit from this one (must be set at runtime explicitly by the caller) */ - var $children_objectclasses; + /** array of objectClasses which inherit from this one (must be set at runtime explicitly by the caller) */ + var $children_objectclasses; /** Initialize the class' member variables */ - function initVars() - { - parent::initVars(); + function initVars() { + parent::initVars(); + $this->oid = null; $this->name = null; $this->description = null; @@ -91,153 +83,207 @@ class ObjectClass extends SchemaItem $this->must_attrs = array(); $this->may_attrs = array(); $this->is_obsolete = false; - $this->children_objectclasses = array(); + $this->children_objectclasses = array(); } /** * Creates a new ObjectClass object given a raw LDAP objectClass string. */ - function ObjectClass( $raw_ldap_schema_string ) - { + function ObjectClass( $raw_ldap_schema_string ) { + debug_log(sprintf('%s::ObjectClass(): Entered with (%s)',get_class($this),$raw_ldap_schema_string),2); + $this->initVars(); $class = $raw_ldap_schema_string; - $strings = preg_split ("/[\s,]+/", $class, -1,PREG_SPLIT_DELIM_CAPTURE); - for($i=0; $iname)==0) $this->name = $strings[$i]; + else + $this->name .= " ".$strings[$i]; + + } while (!preg_match("/\'$/s", $strings[$i])); + + } else { + $i++; + + do { + $i++; + if(strlen($this->name) == 0) + $this->name = $strings[$i]; else $this->name .= " " . $strings[$i]; - }while(!preg_match("/\'$/s", $strings[$i])); + + } while (!preg_match("/\'$/s", $strings[$i])); + + do { + $i++; + } while (! preg_match('/\)+\)?/',$strings[$i])); + } + + $this->name = preg_replace("/^\'/", "", $this->name); + $this->name = preg_replace("/\'$/", "", $this->name); + + debug_log(sprintf('%s::ObjectClass(): Case NAME returned (%s)',get_class($this),$this->name),9); + break; + + case 'DESC': + do { + $i++; + if (strlen($this->description)==0) + $this->description=$this->description . $strings[$i]; + else + $this->description=$this->description . " " . $strings[$i]; + + } while (!preg_match("/\'$/s", $strings[$i])); + + debug_log(sprintf('%s::ObjectClass(): Case DESC returned (%s)',get_class($this),$this->description),9); + break; + + case 'OBSOLETE': + $this->is_obsolete = TRUE; + + debug_log(sprintf('%s::ObjectClass(): Case OBSOLETE returned (%s)',get_class($this),$this->is_obsolete),9); + break; + + case 'SUP': + if ($strings[$i+1]!="(") { + $i++; + array_push($this->sup_classes, preg_replace("/'/","",$strings[$i])); + } else { $i++; do { $i++; - if(strlen($this->name) == 0) - $this->name = $strings[$i]; - else - $this->name .= " " . $strings[$i]; - } while(!preg_match("/\'$/s", $strings[$i])); - do { - $i++; - }while($strings[$i]!=")"); - } - $this->name = preg_replace("/^\'/", "", $this->name); - $this->name = preg_replace("/\'$/", "", $this->name); - break; - case 'DESC': - do { - $i++; - if(strlen($this->description)==0) - $this->description=$this->description . $strings[$i]; - else - $this->description=$this->description . " " . $strings[$i]; - }while(!preg_match("/\'$/s", $strings[$i])); - break; - case 'OBSOLETE': - $this->is_obsolete = TRUE; - break; - case 'SUP': - if($strings[$i+1]!="(") { - $i++; - array_push ($this->sup_classes, $strings[$i]); - }else{ - $i++; - do { - $i++; - if($strings[$i]!="$") - array_push( $this->sup_classes, $strings[$i] ); - }while($strings[$i+1]!=")"); + if ($strings[$i]!="$") + array_push($this->sup_classes,preg_replace("/'/","",$strings[$i])); + + } while (! preg_match('/\)+\)?/',$strings[$i+1])); } + + debug_log(sprintf('%s::ObjectClass(): Case SUP returned (%s)',get_class($this),serialize($this->sup_classes)),9); break; + case 'ABSTRACT': $this->type='abstract'; + + debug_log(sprintf('%s::ObjectClass(): Case ABSTRACT returned (%s)',get_class($this),$this->type),9); break; + case 'STRUCTURAL': $this->type='structural'; + + debug_log(sprintf('%s::ObjectClass(): Case STRUCTURAL returned (%s)',get_class($this),$this->type),9); break; + case 'AUXILIARY': $this->type='auxiliary'; + + debug_log(sprintf('%s::ObjectClass(): Case AUXILIARY returned (%s)',get_class($this),$this->type),9); break; + case 'MUST': - if($strings[$i+1]!="(") - { + if (preg_match("/^\(./",$strings[$i+1])) { + $i++; + $attr = new ObjectClassAttribute(preg_replace("/^\(/","",$strings[$i]), $this->name); + array_push ($this->must_attrs, $attr); + + } elseif ($strings[$i+1]!="(") { $i++; $attr = new ObjectClassAttribute($strings[$i], $this->name); array_push ($this->must_attrs, $attr); - }else{ + + } else { $i++; do { $i++; - if($strings[$i]!="$") - { - $attr = new ObjectClassAttribute($strings[$i], $this->name); - array_push ($this->must_attrs, $attr); + if ($strings[$i]!="$") { + $attr = new ObjectClassAttribute($strings[$i], $this->name); + array_push ($this->must_attrs, $attr); } - }while($strings[$i+1]!=")"); + + } while (! preg_match('/\)+\)?/',$strings[$i+1])); } sort($this->must_attrs); + + debug_log(sprintf('%s::ObjectClass(): Case MUST returned (%s)',get_class($this),serialize($this->must_attrs)),9); break; + case 'MAY': - if($strings[$i+1]!="(") - { + if (preg_match("/^\(./",$strings[$i+1])) { + $i++; + $attr = new ObjectClassAttribute(preg_replace("/^\(/","",$strings[$i]), $this->name); + array_push ($this->may_attrs, $attr); + + } elseif ($strings[$i+1]!="(") { $i++; $attr = new ObjectClassAttribute($strings[$i], $this->name); array_push ($this->may_attrs, $attr); - }else{ + + } else { $i++; - do - { + do { $i++; - if($strings[$i]!="$") - { - $attr = new ObjectClassAttribute($strings[$i], $this->name); - array_push ($this->may_attrs, $attr); + if ($strings[$i]!="$") { + $attr = new ObjectClassAttribute($strings[$i], $this->name); + array_push ($this->may_attrs, $attr); } - }while($strings[$i+1]!=")"); + + } while (! preg_match('/\)+\)?/',$strings[$i+1])); } sort($this->may_attrs); + + debug_log(sprintf('%s::ObjectClass(): Case MUST returned (%s)',get_class($this),serialize($this->may_attrs)),9); break; + default: if(preg_match ("/[\d\.]+/i",$strings[$i]) && $i == 1) $this->oid = $strings[$i]; + + debug_log(sprintf('%s::ObjectClass(): Case default returned (%s)',get_class($this),$this->oid),9); } } $this->description = preg_replace("/^\'/", "", $this->description); $this->description = preg_replace("/\'$/", "", $this->description); + + debug_log(sprintf('%s::ObjectClass(): Returning ()',get_class($this)),1); } - /** - * Gets an array of AttributeType objects that entries of this ObjectClass must define. - * This differs from getMustAttrNames in that it returns an array of AttributeType objects - * - * @param array $oclasses An array of ObjectClass objects to use when traversing - * the inheritance tree. This presents some what of a bootstrapping problem - * as we must fetch all objectClasses to determine through inheritance which - * attributes this objectClass requires. - * @return array The array of required AttributeType objects. - * - * @see getMustAttrNames - * @see getMayAttrs - * @see getMayAttrNames - */ - function getMustAttrs($oclasses = NULL) - { + /** + * Gets an array of AttributeType objects that entries of this ObjectClass must define. + * This differs from getMustAttrNames in that it returns an array of AttributeType objects + * + * @param array $oclasses An array of ObjectClass objects to use when traversing + * the inheritance tree. This presents some what of a bootstrapping problem + * as we must fetch all objectClasses to determine through inheritance which + * attributes this objectClass requires. + * @return array The array of required AttributeType objects. + * + * @see getMustAttrNames + * @see getMayAttrs + * @see getMayAttrNames + */ + function getMustAttrs($oclasses = NULL) { + debug_log(sprintf('%s::getMustAttrs(): Entered with (%s)',get_class($this),serialize($oclasses)),2); + $all_must_attrs = array(); $all_must_attrs = $this->must_attrs; foreach( $this->sup_classes as $sup_class) { if( $oclasses != null - && $sup_class != "top" + && $sup_class != "top" && isset( $oclasses[ strtolower($sup_class) ] ) ) { - $sup_class = $oclasses[ strtolower($sup_class) ]; + $sup_class = $oclasses[ strtolower($sup_class) ]; $sup_class_must_attrs = $sup_class->getMustAttrs( $oclasses ); $all_must_attrs = array_merge( $sup_class_must_attrs, $all_must_attrs ); } @@ -247,159 +293,165 @@ class ObjectClass extends SchemaItem return $all_must_attrs; } - /** - * Gets an array of AttributeType objects that entries of this ObjectClass may define. - * This differs from getMayAttrNames in that it returns an array of AttributeType objects - * - * @param array $oclasses An array of ObjectClass objects to use when traversing - * the inheritance tree. This presents some what of a bootstrapping problem - * as we must fetch all objectClasses to determine through inheritance which - * attributes this objectClass provides. - * @return array The array of allowed AttributeType objects. - * - * @see getMustAttrNames - * @see getMustAttrs - * @see getMayAttrNames - * @see AttributeType - */ - function getMayAttrs($oclasses = NULL) - { + /** + * Gets an array of AttributeType objects that entries of this ObjectClass may define. + * This differs from getMayAttrNames in that it returns an array of AttributeType objects + * + * @param array $oclasses An array of ObjectClass objects to use when traversing + * the inheritance tree. This presents some what of a bootstrapping problem + * as we must fetch all objectClasses to determine through inheritance which + * attributes this objectClass provides. + * @return array The array of allowed AttributeType objects. + * + * @see getMustAttrNames + * @see getMustAttrs + * @see getMayAttrNames + * @see AttributeType + */ + function getMayAttrs($oclasses = NULL) { + debug_log(sprintf('%s::getMayAttrs(): Entered with (%s)',get_class($this),serialize($oclasses)),2); + $all_may_attrs = array(); $all_may_attrs = $this->may_attrs; foreach( $this->sup_classes as $sup_class_name ) { - if( $oclasses != null - && $sup_class_name != "top" + if( $oclasses != null + && $sup_class_name != "top" && isset( $oclasses[ strtolower($sup_class_name) ] ) ) { - $sup_class = $oclasses[ strtolower($sup_class_name) ]; + $sup_class = $oclasses[ strtolower($sup_class_name) ]; $sup_class_may_attrs = $sup_class->getMayAttrs( $oclasses ); $all_may_attrs = array_merge( $sup_class_may_attrs, $all_may_attrs ); - } + } } ksort($all_may_attrs); return $all_may_attrs; } - /** - * Gets an array of attribute names (strings) that entries of this ObjectClass must define. - * This differs from getMustAttrs in that it returns an array of strings rather than - * array of AttributeType objects - * - * @param array $oclasses An array of ObjectClass objects to use when traversing - * the inheritance tree. This presents some what of a bootstrapping problem - * as we must fetch all objectClasses to determine through inheritance which - * attributes this objectClass provides. - * @return array The array of allowed attribute names (strings). - * - * @see getMustAttrs - * @see getMayAttrs - * @see getMayAttrNames - */ - function getMustAttrNames( $oclasses = null ) - { + /** + * Gets an array of attribute names (strings) that entries of this ObjectClass must define. + * This differs from getMustAttrs in that it returns an array of strings rather than + * array of AttributeType objects + * + * @param array $oclasses An array of ObjectClass objects to use when traversing + * the inheritance tree. This presents some what of a bootstrapping problem + * as we must fetch all objectClasses to determine through inheritance which + * attributes this objectClass provides. + * @return array The array of allowed attribute names (strings). + * + * @see getMustAttrs + * @see getMayAttrs + * @see getMayAttrNames + */ + function getMustAttrNames( $oclasses = null ) { + debug_log(sprintf('%s::getMustAttrNames(): Entered with (%s)',get_class($this),serialize($oclasses)),2); + $attrs = $this->getMustAttrs( $oclasses ); $attr_names = array(); + foreach( $attrs as $attr ) $attr_names[] = $attr->getName(); + return $attr_names; } - /** - * Gets an array of attribute names (strings) that entries of this ObjectClass must define. - * This differs from getMayAttrs in that it returns an array of strings rather than - * array of AttributeType objects - * - * @param array $oclasses An array of ObjectClass objects to use when traversing - * the inheritance tree. This presents some what of a bootstrapping problem - * as we must fetch all objectClasses to determine through inheritance which - * attributes this objectClass provides. - * @return array The array of allowed attribute names (strings). - * - * @see getMustAttrs - * @see getMayAttrs - * @see getMustAttrNames - */ - function getMayAttrNames( $oclasses = null ) - { + /** + * Gets an array of attribute names (strings) that entries of this ObjectClass must define. + * This differs from getMayAttrs in that it returns an array of strings rather than + * array of AttributeType objects + * + * @param array $oclasses An array of ObjectClass objects to use when traversing + * the inheritance tree. This presents some what of a bootstrapping problem + * as we must fetch all objectClasses to determine through inheritance which + * attributes this objectClass provides. + * @return array The array of allowed attribute names (strings). + * + * @see getMustAttrs + * @see getMayAttrs + * @see getMustAttrNames + */ + function getMayAttrNames( $oclasses = null ) { + debug_log(sprintf('%s::getMayAttrNames(): Entered with (%s)',get_class($this),serialize($oclasses)),2); + $attrs = $this->getMayAttrs( $oclasses ); $attr_names = array(); + foreach( $attrs as $attr ) $attr_names[] = $attr->getName(); + return $attr_names; } - /** - * Adds an objectClass to the list of objectClasses that inherit - * from this objectClass. - * @param String $object_class_name The name of the objectClass to add - * @return bool Returns true on success or false on failure (objectclass already existed for example) - */ - function addChildObjectClass( $object_class_name ) - { - $object_class_name = trim( $object_class_name ); - if( ! is_array( $this->children_objectclasses ) ) - $this->children_objectclasses = array(); - foreach( $this->children_objectclasses as $existing_objectclass ) - if( 0 == strcasecmp( $object_class_name, $existing_objectclass ) ) - return false; - $this->children_objectclasses[] = $object_class_name; - return true; - } + /** + * Adds an objectClass to the list of objectClasses that inherit + * from this objectClass. + * @param String $object_class_name The name of the objectClass to add + * @return bool Returns true on success or false on failure (objectclass already existed for example) + */ + function addChildObjectClass( $object_class_name ) { + debug_log(sprintf('%s::addChildObjectClass(): Entered with (%s)',get_class($this),$object_class_name),2); - /** - * Returns the array of objectClass names which inherit from this objectClass. - * @return Array Names of objectClasses which inherit from this objectClass. - */ - function getChildObjectClasses() - { - return $this->children_objectclasses; - } + $object_class_name = trim( $object_class_name ); + if( ! is_array( $this->children_objectclasses ) ) + $this->children_objectclasses = array(); - /** - * Gets the name of this objectClass (ie, "inetOrgPerson") - * @return string The name of the objectClass - */ - function getName() - { + foreach( $this->children_objectclasses as $existing_objectclass ) + if( 0 == strcasecmp( $object_class_name, $existing_objectclass ) ) + return false; + + $this->children_objectclasses[] = $object_class_name; + return true; + } + + /** + * Returns the array of objectClass names which inherit from this objectClass. + * @return Array Names of objectClasses which inherit from this objectClass. + */ + function getChildObjectClasses() { + return $this->children_objectclasses; + } + + /** + * Gets the name of this objectClass (ie, "inetOrgPerson") + * @return string The name of the objectClass + */ + function getName() { return $this->name; } - /** - * Gets the objectClass names from which this objectClass inherits. - * - * @return array An array of objectClass names (strings) - */ - function getSupClasses() - { + /** + * Gets the objectClass names from which this objectClass inherits. + * + * @return array An array of objectClass names (strings) + */ + function getSupClasses() { return $this->sup_classes; } - /** - * Gets the type of this objectClass: STRUCTURAL, ABSTRACT, or AUXILIARY. - */ - function getType() - { + /** + * Gets the type of this objectClass: STRUCTURAL, ABSTRACT, or AUXILIARY. + */ + function getType() { return $this->type; } - /** - * Gets whether this objectClass is flagged as obsolete by the LDAP server. - */ - function getIsObsolete() - { + /** + * Gets whether this objectClass is flagged as obsolete by the LDAP server. + */ + function getIsObsolete() { return $this->is_obsolete; } /** - * Adds the specified array of attributes to this objectClass' list of + * Adds the specified array of attributes to this objectClass' list of * MUST attributes. The resulting array of must attributes will contain * unique members. - * - * @param array $new_must_attrs An array of attribute names (strings) to add. + * + * @param array $new_must_attrs An array of attribute names (strings) to add. */ - function addMustAttrs( $new_must_attrs ) - { + function addMustAttrs( $new_must_attrs ) { + debug_log(sprintf('%s::addMustAttrs(): Entered with (%s)',get_class($this),$new_must_attrs),2); + if( ! is_array( $new_must_attrs ) ) return; if( 0 == count( $new_must_attrs ) ) @@ -410,11 +462,12 @@ class ObjectClass extends SchemaItem /** * Behaves identically to addMustAttrs, but it operates on the MAY * attributes of this objectClass. - * - * @param array $new_may_attrs An array of attribute names (strings) to add. + * + * @param array $new_may_attrs An array of attribute names (strings) to add. */ - function addMayAttrs( $new_may_attrs ) - { + function addMayAttrs( $new_may_attrs ) { + debug_log(sprintf('%s::addMayAttrs(): Entered with (%s)',get_class($this),$new_may_attrs),2); + if( ! is_array( $new_may_attrs ) ) return; if( 0 == count( $new_may_attrs ) ) @@ -423,54 +476,51 @@ class ObjectClass extends SchemaItem } } - /** - * A simple class for representing AttributeTypes used only by the ObjectClass class. - * Users should never instantiate this class. It represents an attribute internal to - * an ObjectClass. If PHP supported inner-classes and variable permissions, this would - * be interior to class ObjectClass and flagged private. The reason this class is used - * and not the "real" class AttributeType is because this class supports the notion of - * a "source" objectClass, meaning that it keeps track of which objectClass originally - * specified it. This class is therefore used by the class ObjectClass to determine - * inheritance. - */ - class ObjectClassAttribute - { +/** + * A simple class for representing AttributeTypes used only by the ObjectClass class. + * Users should never instantiate this class. It represents an attribute internal to + * an ObjectClass. If PHP supported inner-classes and variable permissions, this would + * be interior to class ObjectClass and flagged private. The reason this class is used + * and not the "real" class AttributeType is because this class supports the notion of + * a "source" objectClass, meaning that it keeps track of which objectClass originally + * specified it. This class is therefore used by the class ObjectClass to determine + * inheritance. + * @package phpLDAPadmin + */ +class ObjectClassAttribute { /** This Attribute's name */ var $name; + /** This Attribute's root */ var $source; - /** - * Creates a new ObjectClassAttribute with specified name and source objectClass. - * @param string $name the name of the new attribute. - * @param string $source the name of the ObjectClass which - * specifies this attribute. - */ - function ObjectClassAttribute ($name, $source) - { - $this->name=$name; - $this->source=$source; + /** + * Creates a new ObjectClassAttribute with specified name and source objectClass. + * @param string $name the name of the new attribute. + * @param string $source the name of the ObjectClass which + * specifies this attribute. + */ + function ObjectClassAttribute ($name, $source) { + $this->name=$name; + $this->source=$source; } - /** Gets this attribute's name */ - function getName () - { - return $this->name; + /** Gets this attribute's name */ + function getName () { + return $this->name; } - /** Gets the name of the ObjectClass which originally specified this attribute. */ - function getSource () - { - return $this->source; + /** Gets the name of the ObjectClass which originally specified this attribute. */ + function getSource () { + return $this->source; } - } - +} /** - * Represents an LDAP AttributeType + * Represents an LDAP AttributeType + * @package phpLDAPadmin */ -class AttributeType extends SchemaItem -{ +class AttributeType extends SchemaItem { /** The name of this attributeType */ var $name; /** string: the description */ @@ -501,15 +551,15 @@ class AttributeType extends SchemaItem var $type; /** An array of objectClasses which use this attributeType (must be set by caller) */ var $used_in_object_classes; - /** A list of object class names that require this attribute type. */ - var $required_by_object_classes = array(); + /** A list of object class names that require this attribute type. */ + var $required_by_object_classes = array(); - /** - * Initialize the class' member variables + /** + * Initialize the class' member variables */ - function initVars() - { - parent::initVars(); + function initVars() { + parent::initVars(); + $this->oid = null; $this->name = null; $this->description = null; @@ -534,349 +584,386 @@ class AttributeType extends SchemaItem /** * Creates a new AttributeType objcet from a raw LDAP AttributeType string. */ - function AttributeType( $raw_ldap_attr_string ) - { + function AttributeType( $raw_ldap_attr_string ) { + debug_log(sprintf('%s::AttributeType(): Entered with (%s)',get_class($this),$raw_ldap_attr_string),2); + $this->initVars(); $attr = $raw_ldap_attr_string; - $strings = preg_split ("/[\s,]+/", $attr, -1,PREG_SPLIT_DELIM_CAPTURE); + $strings = preg_split("/[\s,]+/",$attr,-1,PREG_SPLIT_DELIM_CAPTURE); + for($i=0; $iname)==0) + if (strlen($this->name)==0) $this->name = $strings[$i]; else $this->name .= " " . $strings[$i]; - }while(!preg_match("/\'$/s", $strings[$i])); + + } while (!preg_match("/\'$/s", $strings[$i])); // this attribute has no aliases $this->aliases = array(); + } else { $i++; do { $i++; - if(strlen($this->name) == 0) + if (strlen($this->name) == 0) $this->name = $strings[$i]; else $this->name .= " " . $strings[$i]; - } while(!preg_match("/\'$/s", $strings[$i])); + + } while (!preg_match("/\'$/s", $strings[$i])); // add alias names for this attribute - while($strings[++$i]!=")") { + + while ($strings[++$i]!=")") { $alias = $strings[$i]; $alias = preg_replace("/^\'/", "", $alias ); $alias = preg_replace("/\'$/", "", $alias ); $this->aliases[] = $alias; } } + + debug_log(sprintf('%s::AttributeType(): Case NAME returned (%s) (%s)',get_class($this),$this->name,serialize($this->aliases)),9); break; + case 'DESC': do { $i++; - if(strlen($this->description)==0) + if (strlen($this->description)==0) $this->description=$this->description . $strings[$i]; else $this->description=$this->description . " " . $strings[$i]; - }while(!preg_match("/\'$/s", $strings[$i])); + } while (!preg_match("/\'$/s", $strings[$i])); + + debug_log(sprintf('%s::AttributeType(): Case DESC returned (%s)',get_class($this),$this->description),9); break; + case 'OBSOLETE': $this->is_obsolete = TRUE; + + debug_log(sprintf('%s::AttributeType(): Case OBSOLETE returned (%s)',get_class($this),$this->is_obsolete),9); break; + case 'SUP': $i++; $this->sup_attribute = $strings[$i]; + + debug_log(sprintf('%s::AttributeType(): Case SUP returned (%s)',get_class($this),$this->sup_attribute),9); break; + case 'EQUALITY': $i++; $this->equality = $strings[$i]; + + debug_log(sprintf('%s::AttributeType(): Case EQUALITY returned (%s)',get_class($this),$this->equality),9); break; + case 'ORDERING': $i++; $this->ordering = $strings[$i]; + + debug_log(sprintf('%s::AttributeType(): Case ORDERING returned (%s)',get_class($this),$this->ordering),9); break; + case 'SUBSTR': $i++; $this->sub_str = $strings[$i]; + + debug_log(sprintf('%s::AttributeType(): Case SUBSTR returned (%s)',get_class($this),$this->sub_str),9); break; + case 'SYNTAX': $i++; $this->syntax = $strings[$i]; - $this->syntax_oid = preg_replace( "/{\d+}$/", "", $this->syntax ); + $this->syntax_oid = preg_replace("/{\d+}$/", "", $this->syntax); + // does this SYNTAX string specify a max length (ie, 1.2.3.4{16}) - if( preg_match( "/{(\d+)}$/", $this->syntax, $this->max_length ) ) + if (preg_match( "/{(\d+)}$/", $this->syntax, $this->max_length)) $this->max_length = $this->max_length[1]; - else + else $this->max_length = null; - if($i < count($strings) - 1 && $strings[$i+1]=="{") { + + if ($i < count($strings) - 1 && $strings[$i+1]=="{") { do { $i++; $this->name .= " " . $strings[$i]; - } while($strings[$i]!="}"); + } while ($strings[$i]!="}"); } + + debug_log(sprintf('%s::AttributeType(): Case SYNTAX returned (%s) (%s) (%s)', + get_class($this),$this->syntax,$this->syntax_oid,$this->max_length),9); break; + case 'SINGLE-VALUE': $this->is_single_value = TRUE; + debug_log(sprintf('%s::AttributeType(): Case SINGLE-VALUE returned (%s)',get_class($this),$this->is_single_value),9); break; + case 'COLLECTIVE': $this->is_collective = TRUE; + + debug_log(sprintf('%s::AttributeType(): Case COLLECTIVE returned (%s)',get_class($this),$this->is_collective),9); break; + case 'NO-USER-MODIFICATION': $this->is_no_user_modification = TRUE; + + debug_log(sprintf('%s::AttributeType(): Case NO-USER-MODIFICATION returned (%s)',get_class($this),$this->is_no_user_modification),9); break; + case 'USAGE': $i++; $this->usage = $strings[$i]; + + debug_log(sprintf('%s::AttributeType(): Case USAGE returned (%s)',get_class($this),$this->usage),9); break; + default: if(preg_match ("/[\d\.]+/i",$strings[$i]) && $i == 1) $this->oid = $strings[$i]; + + debug_log(sprintf('%s::AttributeType(): Case default returned (%s)',get_class($this),$this->oid),9); } } - $this->name = preg_replace("/^\'/", "", $this->name); - $this->name = preg_replace("/\'$/", "", $this->name); + $this->name = preg_replace("/^\'/", "", $this->name); + $this->name = preg_replace("/\'$/", "", $this->name); $this->description = preg_replace("/^\'/", "", $this->description); $this->description = preg_replace("/\'$/", "", $this->description); - $this->syntax_oid = preg_replace("/^\'/", "", $this->syntax_oid ); - $this->syntax_oid = preg_replace("/\'$/", "", $this->syntax_oid ); + $this->syntax = preg_replace("/^\'/", "", $this->syntax ); + $this->syntax = preg_replace("/\'$/", "", $this->syntax ); + $this->syntax_oid = preg_replace("/^\'/", "", $this->syntax_oid ); + $this->syntax_oid = preg_replace("/\'$/", "", $this->syntax_oid ); + $this->sup_attribute = preg_replace("/^\'/", "", $this->sup_attribute ); + $this->sup_attribute = preg_replace("/\'$/", "", $this->sup_attribute ); + + debug_log(sprintf('%s::AttributeType(): Returning ()',get_class($this)),1); } - /** - * Gets this attribute's name - * @return string - */ - function getName() - { + /** + * Gets this attribute's name + * @return string + */ + function getName() { return $this->name; } - /** - * Gets whether this attribute has been flagged as obsolete by the LDAP server - * @return bool - */ - function getIsObsolete() - { + /** + * Gets whether this attribute has been flagged as obsolete by the LDAP server + * @return bool + */ + function getIsObsolete() { return $this->is_obsolete; } - /** - * Gets this attribute's usage string as defined by the LDAP server - * @return string - */ - function getUsage() - { + /** + * Gets this attribute's usage string as defined by the LDAP server + * @return string + */ + function getUsage() { return $this->usage; } - /** - * Gets this attribute's parent attribute (if any). If this attribute does not - * inherit from another attribute, null is returned. - * @return string - */ - function getSupAttribute() - { + /** + * Gets this attribute's parent attribute (if any). If this attribute does not + * inherit from another attribute, null is returned. + * @return string + */ + function getSupAttribute() { return $this->sup_attribute; } - /** - * Gets this attribute's equality string - * @return string - */ - function getEquality() - { + /** + * Gets this attribute's equality string + * @return string + */ + function getEquality() { return $this->equality; } - /** - * Gets this attribute's ordering specification. - * @return string - */ - function getOrdering() - { + /** + * Gets this attribute's ordering specification. + * @return string + */ + function getOrdering() { return $this->ordering; } - /** - * Gets this attribute's substring matching specification - * @return string - */ - function getSubstr() - { + /** + * Gets this attribute's substring matching specification + * @return string + */ + function getSubstr() { return $this->sub_str; } - /** - * Gets the names of attributes that are an alias for this attribute (if any). - * @return array An array of names of attributes which alias this attribute or - * an empty array if no attribute aliases this object. - */ - function getAliases() - { + /** + * Gets the names of attributes that are an alias for this attribute (if any). + * @return array An array of names of attributes which alias this attribute or + * an empty array if no attribute aliases this object. + */ + function getAliases() { return $this->aliases; } - /** - * Returns whether the specified attribute is an alias for this one (based on this attribute's alias list). - * @param string $attr_name The name of the attribute to check. - * @return bool True if the specified attribute is an alias for this one, or false otherwise. - */ - function isAliasFor( $attr_name ) - { - foreach( $this->aliases as $alias_attr_name ) - if( 0 == strcasecmp( $alias_attr_name, $attr_name ) ) - return true; - return false; + /** + * Returns whether the specified attribute is an alias for this one (based on this attribute's alias list). + * @param string $attr_name The name of the attribute to check. + * @return bool True if the specified attribute is an alias for this one, or false otherwise. + */ + function isAliasFor( $attr_name ) { + debug_log(sprintf('%s::isAliasFor(): Entered with (%s)',get_class($this),$attr_name),2); - } + foreach( $this->aliases as $alias_attr_name ) + if( 0 == strcasecmp( $alias_attr_name, $attr_name ) ) + return true; + return false; + } /** * Gets this attribute's raw syntax string (ie: "1.2.3.4{16}"). - * @return string The raw syntax string + * @return string The raw syntax string */ - function getSyntaxString() - { + function getSyntaxString() { return $this->syntax; } /** - * Gets this attribute's syntax OID. Differs from getSyntaxString() in that this - * function only returns the actual OID with any length specification removed. - * Ie, if the syntax string is "1.2.3.4{16}", this function only retruns - * "1.2.3.4". - * @return string The syntax OID string. + * Gets this attribute's syntax OID. Differs from getSyntaxString() in that this + * function only returns the actual OID with any length specification removed. + * Ie, if the syntax string is "1.2.3.4{16}", this function only retruns + * "1.2.3.4". + * @return string The syntax OID string. */ - function getSyntaxOID() - { + function getSyntaxOID() { return $this->syntax_oid; } /** * Gets this attribute's the maximum length. If no maximum is defined by the LDAP server, null is returned. - * @return int The maximum length (in characters) of this attribute or null if no maximum is specified. + * @return int The maximum length (in characters) of this attribute or null if no maximum is specified. */ - function getMaxLength() - { + function getMaxLength() { return $this->max_length; } /** * Gets whether this attribute is single-valued. If this attribute only supports single values, true - * is returned. If this attribute supports multiple values, false is returned. - * @return bool Returns true if this attribute is single-valued or false otherwise. + * is returned. If this attribute supports multiple values, false is returned. + * @return bool Returns true if this attribute is single-valued or false otherwise. */ - function getIsSingleValue() - { + function getIsSingleValue() { return $this->is_single_value; } - /** - * Sets whether this attribute is single-valued. - * @param bool $is_single_value - */ - function setIsSingleValue( $is_single_value ) - { + /** + * Sets whether this attribute is single-valued. + * @param bool $is_single_value + */ + function setIsSingleValue( $is_single_value ) { $this->is_single_value = $is_single_value; } - /** - * Gets whether this attribute is collective. - * @return bool Returns true if this attribute is collective and false otherwise. - */ - function getIsCollective() - { + /** + * Gets whether this attribute is collective. + * @return bool Returns true if this attribute is collective and false otherwise. + */ + function getIsCollective() { return $this->is_collective; } - /** - * Gets whether this attribute is not modifiable by users. - * @return bool Returns true if this attribute is not modifiable by users. - */ - function getIsNoUserModification() - { + /** + * Gets whether this attribute is not modifiable by users. + * @return bool Returns true if this attribute is not modifiable by users. + */ + function getIsNoUserModification() { return $this->is_no_user_modification; } - /** - * Gets this attribute's type - * @return string The attribute's type. - */ - function getType() - { + /** + * Gets this attribute's type + * @return string The attribute's type. + */ + function getType() { return $this->type; } /** * Removes an attribute name from this attribute's alias array. - * @param string $remove_alias_name The name of the attribute to remove. - * @return bool true on success or false on failure (ie, if the specified - * attribute name is not found in this attribute's list of aliases) + * @param string $remove_alias_name The name of the attribute to remove. + * @return bool true on success or false on failure (ie, if the specified + * attribute name is not found in this attribute's list of aliases) */ - function removeAlias( $remove_alias_name ) - { + function removeAlias( $remove_alias_name ) { + debug_log(sprintf('%s::removeAlias(): Entered with (%s)',get_class($this),$remove_alias_name),2); + foreach( $this->aliases as $i => $alias_name ) { + if( 0 == strcasecmp( $alias_name, $remove_alias_name ) ) { unset( $this->aliases[ $i ] ); $this->aliases = array_values( $this->aliases ); return true; } + } return false; } /** * Adds an attribute name to the alias array. - * @param string $new_alias_name The name of a new attribute to add to this attribute's list of aliases. + * @param string $new_alias_name The name of a new attribute to add to this attribute's list of aliases. */ - function addAlias( $new_alias_name ) - { + function addAlias( $new_alias_name ) { $this->aliases[] = $new_alias_name; } - /** - * Sets this attriute's name. - * @param string $new_name The new name to give this attribute. - */ - function setName( $new_name ) - { + /** + * Sets this attriute's name. + * @param string $new_name The new name to give this attribute. + */ + function setName( $new_name ) { $this->name = $new_name; } - /** - * Sets this attriute's SUP attribute (ie, the attribute from which this attribute inherits). - * @param string $new_sup_attr The name of the new parent (SUP) attribute - */ - function setSupAttribute( $new_sup_attr ) - { + /** + * Sets this attriute's SUP attribute (ie, the attribute from which this attribute inherits). + * @param string $new_sup_attr The name of the new parent (SUP) attribute + */ + function setSupAttribute( $new_sup_attr ) { $this->sup_attribute = $new_sup_attr; } - /** - * Sets this attribute's list of aliases. - * @param array $new_aliases The array of alias names (strings) - */ - function setAliases( $new_aliases ) - { + /** + * Sets this attribute's list of aliases. + * @param array $new_aliases The array of alias names (strings) + */ + function setAliases( $new_aliases ) { $this->aliases = $new_aliases; } - /** - * Sets this attribute's type. - * @param string $new_type The new type. - */ - function setType( $new_type ) - { + /** + * Sets this attribute's type. + * @param string $new_type The new type. + */ + function setType( $new_type ) { $this->type = $new_type; } - /** - * Adds an objectClass name to this attribute's list of "used in" objectClasses, - * that is the list of objectClasses which provide this attribute. - * @param string $object_class_name The name of the objectClass to add. - */ - function addUsedInObjectClass( $object_class_name ) - { + /** + * Adds an objectClass name to this attribute's list of "used in" objectClasses, + * that is the list of objectClasses which provide this attribute. + * @param string $object_class_name The name of the objectClass to add. + */ + function addUsedInObjectClass( $object_class_name ) { + debug_log(sprintf('%s::addUsedInObjectClass(): Entered with (%s)',get_class($this),$object_class_name),2); + foreach( $this->used_in_object_classes as $used_in_object_class ) if( 0 == strcasecmp( $used_in_object_class, $object_class_name ) ) return false; @@ -884,23 +971,23 @@ class AttributeType extends SchemaItem return true; } - /** - * Gets the list of "used in" objectClasses, that is the list of objectClasses - * which provide this attribute. - * @return array An array of names of objectclasses (strings) which provide this attribute - */ - function getUsedInObjectClasses() - { + /** + * Gets the list of "used in" objectClasses, that is the list of objectClasses + * which provide this attribute. + * @return array An array of names of objectclasses (strings) which provide this attribute + */ + function getUsedInObjectClasses() { return $this->used_in_object_classes; } - /** - * Adds an objectClass name to this attribute's list of "required by" objectClasses, - * that is the list of objectClasses which must have this attribute. - * @param string $object_class_name The name of the objectClass to add. - */ - function addRequiredByObjectClass( $object_class_name ) - { + /** + * Adds an objectClass name to this attribute's list of "required by" objectClasses, + * that is the list of objectClasses which must have this attribute. + * @param string $object_class_name The name of the objectClass to add. + */ + function addRequiredByObjectClass( $object_class_name ) { + debug_log(sprintf('%s::addRequiredByObjectClass(): Entered with (%s)',get_class($this),$object_class_name),2); + foreach( $this->required_by_object_classes as $required_by_object_class ) if( 0 == strcasecmp( $required_by_object_class, $object_class_name ) ) return false; @@ -908,26 +995,25 @@ class AttributeType extends SchemaItem return true; } - /** - * Gets the list of "required by" objectClasses, that is the list of objectClasses - * which provide must have attribute. - * @return array An array of names of objectclasses (strings) which provide this attribute - */ - function getRequiredByObjectClasses() - { + /** + * Gets the list of "required by" objectClasses, that is the list of objectClasses + * which provide must have attribute. + * @return array An array of names of objectclasses (strings) which provide this attribute + */ + function getRequiredByObjectClasses() { return $this->required_by_object_classes; } } /** * Represents an LDAP Syntax + * @package phpLDAPadmin */ -class Syntax extends SchemaItem -{ +class Syntax extends SchemaItem { /** Initializes the class' member variables */ - function initVars() - { - parent::initVars(); + function initVars() { + parent::initVars(); + $this->oid = null; $this->description = null; } @@ -935,9 +1021,11 @@ class Syntax extends SchemaItem /** * Creates a new Syntax object from a raw LDAP syntax string. */ - function Syntax( $raw_ldap_syntax_string ) - { + function Syntax( $raw_ldap_syntax_string ) { + debug_log(sprintf('%s::Syntax(): Entered with (%s)',get_class($this),$raw_ldap_syntax_string),2); + $this->initVars(); + $class = $raw_ldap_syntax_string; $strings = preg_split ("/[\s,]+/", $class, -1,PREG_SPLIT_DELIM_CAPTURE); for($i=0; $ioid = null; $this->name = null; $this->description = null; @@ -992,14 +1080,17 @@ class MatchingRule extends SchemaItem /** * Creates a new MatchingRule object from a raw LDAP MatchingRule string. */ - function MatchingRule( $raw_ldap_matching_rule_string ) - { + function MatchingRule( $raw_ldap_matching_rule_string ) { + debug_log(sprintf('%s::MatchingRule(): Entered with (%s)',get_class($this),$raw_ldap_matching_rule_string),2); + $this->initVars(); $strings = preg_split ("/[\s,]+/", $raw_ldap_matching_rule_string, -1,PREG_SPLIT_DELIM_CAPTURE); for($i=0; $iname = preg_replace("/^\'/", "", $this->name); - $this->name = preg_replace("/\'$/", "", $this->name); + $this->name = preg_replace("/^\'/", "", $this->name); + $this->name = preg_replace("/\'$/", "", $this->name); break; + case 'DESC': do { $i++; @@ -1034,12 +1126,15 @@ class MatchingRule extends SchemaItem $this->description=$this->description . " " . $strings[$i]; }while(!preg_match("/\'$/s", $strings[$i])); break; + case 'OBSOLETE': $this->is_obsolete = TRUE; break; + case 'SYNTAX': $this->syntax = $strings[++$i]; break; + default: if(preg_match ("/[\d\.]+/i",$strings[$i]) && $i == 1) $this->oid = $strings[$i]; @@ -1051,10 +1146,9 @@ class MatchingRule extends SchemaItem /** * Sets the list of used_by_attrs to the array specified by $attrs; - * @param array $attrs The array of attribute names (strings) which use this MatchingRule + * @param array $attrs The array of attribute names (strings) which use this MatchingRule */ - function setUsedByAttrs( $attrs ) - { + function setUsedByAttrs( $attrs ) { $this->used_by_attrs = $attrs; } @@ -1062,80 +1156,82 @@ class MatchingRule extends SchemaItem * Adds an attribute name to the list of attributes who use this MatchingRule * @return true if the attribute was added and false otherwise (already in the list) */ - function addUsedByAttr( $new_attr_name ) - { + function addUsedByAttr( $new_attr_name ) { + debug_log(sprintf('%s::addUsedByAttr(): Entered with (%s)',get_class($this),$new_attr_name),2); + foreach( $this->used_by_attrs as $attr_name ) if( 0 == strcasecmp( $attr_name, $new_attr_name ) ) return false; $this->used_by_attrs[] = $new_attr_name; + return true; } - /** - * Gets this MatchingRule's name. - * @return string The name. - */ - function getName() - { + /** + * Gets this MatchingRule's name. + * @return string The name. + */ + function getName() { return $this->name; } - /** - * Gets whether this MatchingRule is flagged as obsolete by the LDAP server. - * @return bool True if this MatchingRule is obsolete and false otherwise. - */ - function getIsObsolete() - { + /** + * Gets whether this MatchingRule is flagged as obsolete by the LDAP server. + * @return bool True if this MatchingRule is obsolete and false otherwise. + */ + function getIsObsolete() { return $this->is_obsolete; } - /** - * Gets this MatchingRule's syntax string (an OID). - * @todo Is this function broken? - */ - function getSyntax() - { + /** + * Gets this MatchingRule's syntax string (an OID). + */ + function getSyntax() { return $this->description; } - /** - * Gets an array of attribute names (strings) which use this MatchingRule - * @return array The array of attribute names (strings). - */ - function getUsedByAttrs() - { + /** + * Gets an array of attribute names (strings) which use this MatchingRule + * @return array The array of attribute names (strings). + */ + function getUsedByAttrs() { return $this->used_by_attrs; } } /** * Represents an LDAP schema matchingRuleUse entry - */ -class MatchingRuleUse extends SchemaItem -{ + * @package phpLDAPadmin + */ +class MatchingRuleUse extends SchemaItem { /** The name of the MathingRule this applies to */ var $name; - /** An array of attributeType names who make use of the mathingRule + + /** An array of attributeType names who make use of the mathingRule * identified by $this->oid and $this->name */ var $used_by_attrs; /** Initialize the class' member variables */ - function initVars() - { - parent::initVars(); + function initVars() { + parent::initVars(); + $this->oid = null; $this->name = null; $this->used_by_attrs = array(); } - function MatchingRuleUse( $raw_matching_rule_use_string ) - { - $this->initVars(); + function MatchingRuleUse( $raw_matching_rule_use_string ) { + debug_log(sprintf('%s::MatchingRuleUse(): Entered with (%s)',get_class($this),$raw_matching_rule_use_string),2); + + $this->initVars(); + $strings = preg_split ("/[\s,]+/", $raw_matching_rule_use_string, -1,PREG_SPLIT_DELIM_CAPTURE); for($i=0; $iname = preg_replace("/^\'/", "", $this->name); - $this->name = preg_replace("/\'$/", "", $this->name); + $this->name = preg_replace("/^\'/", "", $this->name); + $this->name = preg_replace("/\'$/", "", $this->name); break; + case 'APPLIES': // TODO if($strings[$i+1]!="(") { @@ -1182,6 +1279,7 @@ class MatchingRuleUse extends SchemaItem } } break; + default: if(preg_match ("/[\d\.]+/i",$strings[$i]) && $i == 1) $this->oid = $strings[$i]; @@ -1190,292 +1288,25 @@ class MatchingRuleUse extends SchemaItem sort( $this->used_by_attrs ); } - /** - * Gets this MatchingRuleUse's name - * @return string The name - */ - function getName() - { + /** + * Gets this MatchingRuleUse's name + * @return string The name + */ + function getName() { return $this->name; } - /** - * Gets an array of attribute names (strings) which use this MatchingRuleUse object. - * @return array The array of attribute names (strings). - */ - function getUsedByAttrs() - { + /** + * Gets an array of attribute names (strings) which use this MatchingRuleUse object. + * @return array The array of attribute names (strings). + */ + function getUsedByAttrs() { return $this->used_by_attrs; } } /** - * Helper for _get_raw_schema() which fetches the DN of the schema object - * in an LDAP server based on a DN. Entries should set the subSchemaSubEntry - * attribute pointing to the DN of the server schema. You can specify the - * DN whose subSchemaSubEntry you wish to retrieve of specify an empty string - * to fetch the subScehamSubEntry from the Root DSE. - * - * @param int $server_id The ID of the server whose schema DN to fetch. - * @param string $dn The DN (may be null) which houses the subschemaSubEntry attribute which - * this function can use to determine the schema entry's DN. - * @param bool $debug Switch to true to see some nice and copious output. :) - * - * @return string The DN of the entry which houses this LDAP server's schema. - */ -function _get_schema_dn( $server_id, $dn, $debug=false ) -{ - if( $debug ) echo "
      ";
      -	$ds = pla_ldap_connect( $server_id );
      -	if( pla_ldap_connection_is_error( $ds, false ) )
      -		return false;
      -
      -	$search = @ldap_read( $ds, $dn, 'objectClass=*', array( 'subschemaSubentry' ) );
      -	if( $debug ) { echo "Search result (ldap_read): "; var_dump( $search ); echo "\n"; }
      -	if( ! $search ) {
      -		if( $debug ) echo "_get_schema_dn() returning false. (search val is false)\n";
      -		return false;
      -	}
      -
      -	if( @ldap_count_entries( $ds, $search ) == 0 ) {
      -		if( $debug ) echo "_get_schema_dn() returning false (ldap_count_entries() == 0).\n";
      -        return false;
      -	}
      -
      -	$entries = @ldap_get_entries( $ds, $search );
      -	if( $debug ) { echo "Entries (ldap_get_entries): "; var_dump( $entries ); echo "\n"; }
      -	if( ! $entries || ! is_array( $entries ) ) {
      -		if( $debug ) echo "_get_schema_dn() returning false (Bad entries val, false or not array).\n";
      -		return false;
      -	}
      -
      -	$entry = isset( $entries[0] ) ? $entries[0] : false;
      -	if( ! $entry ) {
      -		if( $debug ) echo "_get_schema_dn() returning false (entry val is false)\n";
      -		return false;
      -	}
      -
      -	$sub_schema_sub_entry = isset( $entry[0] ) ? $entry[0] : false;
      -	if( ! $sub_schema_sub_entry ) {
      -		if( $debug ) echo "_get_schema_dn() returning false (sub_schema_sub_entry val is false)\n";
      -		return false;
      -	}
      -
      -	$schema_dn = isset( $entry[ $sub_schema_sub_entry ][0] ) ?
      -					$entry[ $sub_schema_sub_entry ][0] :
      -					false;
      -
      -	if( $debug ) echo "_get_schema_dn() returning: \"" . $schema_dn . "\"\n";
      -	return $schema_dn;
      -}
      -
      -/**
      - * Fetches the raw schema array for the subschemaSubentry of the server. Note,
      - * this function has grown many hairs to accomodate more LDAP servers. It is
      - * needfully complicated as it now supports many popular LDAP servers that
      - * don't necessarily expose their schema "the right way".
      - *
      - * @param $server_id - The server ID whose server you want to retrieve
      - * @param $schema_to_fetch - A string indicating which type of schema to 
      - *		fetch. Five valid values: 'objectclasses', 'attributetypes', 
      - *		'ldapsyntaxes', 'matchingruleuse', or 'matchingrules'. 
      - *		Case insensitive.
      - * @param $dn (optional) This paremeter is the DN of the entry whose schema you
      - * 		would like to fetch. Entries have the option of specifying
      - * 		their own subschemaSubentry that points to the DN of the system
      - * 		schema entry which applies to this attribute. If unspecified,
      - *		this will try to retrieve the schema from the RootDSE subschemaSubentry.
      - *		Failing that, we use some commonly known schema DNs. Default 
      - *		value is the Root DSE DN (zero-length string)
      - * @return an array of strings of this form:
      - *    Array (
      - *      [0] => "( 1.3.6.1.4.1.7165.1.2.2.4 NAME 'gidPool' DESC 'Pool ...
      - *      [1] => "( 1.3.6.1.4.1.7165.2.2.3 NAME 'sambaAccount' DESC 'Sa ...
      - *      etc.
      - */
      -function _get_raw_schema( $server_id, $schema_to_fetch, $dn='' )
      -{
      -	global $lang;
      -
      -	// Swith to true to enable verbose output of schema fetching progress
      -	$debug = false;
      -
      -	$ds = pla_ldap_connect( $server_id );
      -	if( pla_ldap_connection_is_error( $ds, false ) )
      -		return false;
      -
      -	// error checking
      -	$schema_to_fetch = strtolower( $schema_to_fetch );
      -	$valid_schema_to_fetch = array( 'objectclasses', 'attributetypes', 'ldapsyntaxes', 
      -					'matchingrules', 'matchingruleuse'  );
      -	if( ! in_array( $schema_to_fetch, $valid_schema_to_fetch ) )
      -        // This error message is not localized as only developers should ever see it
      -		pla_error( "Bad parameter provided to function to _get_raw_schema(). '" 
      -				. htmlspecialchars( $schema_to_fetch ) . "' is 
      -				not valid for the schema_to_fetch parameter." );
      -	
      -	// Try to get the schema DN from the specified entry. 
      -	$schema_dn = _get_schema_dn( $server_id, $dn, $debug );
      -
      -	// Do we need to try again with the Root DSE?
      -	if( ! $schema_dn )
      -		$schema_dn = _get_schema_dn( $server_id, '', $debug );
      -
      -	// Store the eventual schema retrieval in $schema_search
      -	$schema_search = null;
      -
      -	if( $schema_dn ) {
      -		if( $debug ) { echo "Found the schema DN: "; var_dump( $schema_dn ); echo "\n"; }
      -		$schema_search = @ldap_read( $ds, $schema_dn, '(objectClass=*)',
      -							array( $schema_to_fetch ), 0, 0, 0, 
      -							LDAP_DEREF_ALWAYS );
      -
      -        // Were we not able to fetch the schema from the $schema_dn?
      -        $schema_entries = @ldap_get_entries( $ds, $schema_search );
      -		if( $schema_search === false || 
      -            0 == @ldap_count_entries( $ds, $schema_search ) ||
      -            ! isset( $schema_entries[0][$schema_to_fetch] ) ) {
      -                if( $debug ) echo "Did not find the schema with (objectClass=*). Attempting with (objetClass=subschema)\n";
      -
      -                // Try again with a different filter (some servers require (objectClass=subschema) like M-Vault)
      -                $schema_search = @ldap_read( $ds, $schema_dn, '(objectClass=subschema)',
      -                        array( $schema_to_fetch ), 0, 0, 0, 
      -                        LDAP_DEREF_ALWAYS );
      -                $schema_entries = @ldap_get_entries( $ds, $schema_search );
      -
      -                // Still didn't get it?
      -                if( $schema_search === false || 
      -                        0 == @ldap_count_entries( $ds, $schema_search ) ||
      -                        ! isset( $schema_entries[0][$schema_to_fetch] ) ) {
      -                    if( $debug ) echo "Did not find the schema at DN: $schema_dn (with objectClass=* nor objectClass=subschema).\n";
      -                    unset( $schema_entries );
      -                    unset( $schema_dn );
      -                    $schema_search = null;
      -                } else {
      -                    if( $debug ) echo "Found the schema at DN: $schema_dn (with objectClass=subschema).\n";
      -                }
      -		} else {
      -			if( $debug ) echo "Found the schema at DN: $schema_dn (with objectClass=*).\n";
      -		}
      -	} 
      -
      -	// Second chance: If the DN or Root DSE didn't give us the subschemaSubentry, ie $schema_search
      -	// is still null, use some common subSchemaSubentry DNs as a work-around.
      -
      -	if( $debug && $schema_search == null )
      -		echo "Attempting work-arounds for 'broken' LDAP servers...\n";
      -
      -	// cn=subschema for OpenLDAP
      -	if( $schema_search == null ) {
      -		if( $debug ) echo "Attempting with cn=subschema (OpenLDAP)...\n";
      -		// try with the standard DN
      -		$schema_search = @ldap_read($ds, 'cn=subschema', '(objectClass=*)',
      -				array( $schema_to_fetch ), 0, 0, 0, LDAP_DEREF_ALWAYS );
      -	}
      -
      -	// cn=schema for Novell eDirectory
      -	if( $schema_search == null ) {
      -		if( $debug ) echo "Attempting with cn=schema (Novell)...\n";
      -		// try again, with a different schema DN
      -		$schema_search = @ldap_read($ds, 'cn=schema', '(objectClass=*)',
      -				array( $schema_to_fetch ), 0, 0, 0, LDAP_DEREF_ALWAYS );
      -	}
      -
      -	// cn=schema,cn=configuration,dc=example,dc=com for ActiveDirectory
      -	if( $schema_search == null ) {
      -		// try again, with a different schema DN
      -		global $servers;
      -		$base_dn = isset( $servers[ $server_id ][ 'base' ] ) ?
      -				$servers[ $server_id ][ 'base' ] :
      -				null;
      -		if( $debug ) echo "Attempting with cn=schema,cn=configuration,$base_dn (ActiveDirectory)...\n";
      -		if( $base_dn != null )
      -			$schema_search = @ldap_read($ds, 'cn=schema,cn=configuration,' . $base_dn, '(objectClass=*)',
      -				array( $schema_to_fetch ), 0, 0, 0, LDAP_DEREF_ALWAYS );
      -	}
      -
      -	// cn=Schema,ou=Admin,dc=example,dc=com for SiteServer
      -	if( $schema_search == null ) {
      -		// try again, with a different schema DN
      -		global $servers;
      -		$base_dn = isset( $servers[ $server_id ][ 'base' ] ) ?
      -				$servers[ $server_id ][ 'base' ] :
      -				null;
      -		if( $debug ) echo "Attempting with cn=Schema,ou=Admin,$base_dn (ActiveDirectory)...\n";
      -		if( $base_dn != null )
      -			$schema_search = @ldap_read($ds, 'cn=Schema,ou=Admin,' . $base_dn, '(objectClass=*)',
      -				array( $schema_to_fetch ), 0, 0, 0, LDAP_DEREF_ALWAYS );
      -	}
      -
      -	// Attempt to pull schema from Root DSE with scope "base"
      -	if( $schema_search == null ) {
      -		// try again, with a different schema DN
      -		if( $debug ) echo "Attempting to pull schema from Root DSE with scope \"base\"...\n";
      -		if( $base_dn != null )
      -			$schema_search = @ldap_read($ds, '', '(objectClass=*)',
      -				array( $schema_to_fetch ), 0, 0, 0, LDAP_DEREF_ALWAYS );
      -         $schema_entries = @ldap_get_entries( $ds, $schema_search );
      -         if( ! isset( $schema_entries[0][$schema_to_fetch] ) )
      -            $schema_search = null;
      -    }
      -    
      -	// Attempt to pull schema from Root DSE with scope "one" (work-around for Isode M-Vault X.500/LDAP)
      -	if( $schema_search == null ) {
      -		// try again, with a different schema DN
      -		if( $debug ) echo "Attempting to pull schema from Root DSE with scope \"one\"...\n";
      -		if( $base_dn != null )
      -			$schema_search = @ldap_list($ds, '', '(objectClass=*)',
      -				array( $schema_to_fetch ), 0, 0, 0, LDAP_DEREF_ALWAYS );
      -         $schema_entries = @ldap_get_entries( $ds, $schema_search );
      -         if( ! isset( $schema_entries[0][$schema_to_fetch] ) )
      -            $schema_search = null;
      -	}
      -
      -	// Shall we just give up?
      -	if( $schema_search == null ) {
      -        if( $debug ) echo "Returning false since schema_search came back null
      \n"; - set_schema_cache_unavailable( $server_id ); - return false; - } - - // Did we get something unrecognizable? - if( 'resource' != gettype( $schema_search ) ) { - if( $debug ) echo "Returning false since schema_esarch is not of type 'resource'. Dumping schema search:\n"; - if( $debug ) var_dump( $schema_search ); - if( $debug ) echo "
"; - set_schema_cache_unavailable( $server_id ); - return false; - } - - $schema = @ldap_get_entries( $ds, $schema_search ); - if( $schema == false ) { - if( $debug ) echo "Returning false since ldap_get_entries() returned false.\n"; - set_schema_cache_unavailable( $server_id ); - return false; - } - - if( ! isset( $schema[0][$schema_to_fetch] ) ) { - if( $debug ) echo "Returning false since '$schema_to_fetch' isn't in the schema array. Showing schema array:\n"; - if( $debug ) var_dump( $schema ); - if( $debug ) echo ""; - set_schema_cache_unavailable( $server_id ); - return false; - } - - // Make a nice array of this form: - // Array ( - // [0] => "( 1.3.6.1.4.1.7165.1.2.2.4 NAME 'gidPool' DESC 'Pool ... - // [1] => "( 1.3.6.1.4.1.7165.2.2.3 NAME 'sambaAccount' DESC 'Sa ... - // etc. - $schema = $schema[0][$schema_to_fetch]; - unset( $schema['count'] ); - - if( $debug ) echo ""; - return $schema; -} - -/** - * Gets an associative array of ObjectClass objects for the specified + * Gets an associative array of ObjectClass objects for the specified * server. Each array entry's key is the name of the objectClass * in lower-case and the value is an ObjectClass object. * @@ -1488,32 +1319,39 @@ function _get_raw_schema( $server_id, $schema_to_fetch, $dn='' ) * @see ObjectClass * @see get_schema_objectclass */ -function get_schema_objectclasses( $server_id, $dn=null, $use_cache=true ) -{ - if( $use_cache && cached_schema_available( $server_id, 'objectclasses' ) ) { - return get_cached_schema( $server_id, 'objectclasses' ); - } +function get_schema_objectclasses($ldapserver,$dn=null) { + debug_log(sprintf('get_schema_objectclasses(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2); - $raw_oclasses = _get_raw_schema( $server_id, 'objectclasses', $dn ); - if( ! $raw_oclasses ) - return false; + # Set default return + $return = null; - // build the array of objectClasses - $object_classes = array(); - foreach( $raw_oclasses as $class_string ) { - if( $class_string == null || 0 == strlen( $class_string ) ) - continue; - $object_class = new ObjectClass( $class_string ); - $name = $object_class->getName(); - $key = strtolower( $name ); - $object_classes[ $key ] = $object_class; + if ($return = get_cached_item($ldapserver->server_id,'schema','objectclasses')) { + debug_log(sprintf('get_schema_objectclasses(): Returning CACHED [%s] (%s)',$ldapserver->server_id,'objectclasses'),3); + return $return; } - ksort( $object_classes ); + $raw_oclasses = $ldapserver->getRawSchema('objectclasses', $dn); + if ($raw_oclasses) { - // cache the schema to prevent multiple schema fetches from LDAP server - set_cached_schema( $server_id, 'objectclasses', $object_classes ); - return( $object_classes ); + # build the array of objectClasses + $return = array(); + + foreach ($raw_oclasses as $class_string) { + if ($class_string == null || ! strlen($class_string)) + continue; + + $object_class = new ObjectClass($class_string); + $return[strtolower($object_class->getName())] = $object_class; + } + + ksort($return); + + # cache the schema to prevent multiple schema fetches from LDAP server + set_cached_item($ldapserver->server_id,'schema','objectclasses',$return); + } + + debug_log(sprintf('get_schema_objectclasses(): Returning (%s)',serialize($return)),1); + return $return; } /** @@ -1529,10 +1367,12 @@ function get_schema_objectclasses( $server_id, $dn=null, $use_cache=true ) * @see ObjectClass * @see get_schema_objectclasses */ -function get_schema_objectclass( $server_id, $oclass_name, $dn=null, $use_cache=true ) -{ +function get_schema_objectclass( $ldapserver,$oclass_name,$dn=null) { + debug_log(sprintf('get_schema_objectclass(): Entered with (%s,%s,%s)',$ldapserver->server_id,$oclass_name,$dn),2); + $oclass_name = strtolower( $oclass_name ); - $oclasses = get_schema_objectclasses( $server_id, $dn, $use_cache ); + $oclasses = get_schema_objectclasses($ldapserver,$dn); + if( ! $oclasses ) return false; if( isset( $oclasses[ $oclass_name ] ) ) @@ -1554,19 +1394,19 @@ function get_schema_objectclass( $server_id, $oclass_name, $dn=null, $use_cache= * @see AttributeType * @see get_schema_attributes */ -function get_schema_attribute( $server_id, $attr_name, $dn=null, $use_cache=true ) -{ - $attr_name = real_attr_name( $attr_name ); - $schema_attrs = get_schema_attributes( $server_id, $dn, $use_cache ); - $attr_name = strtolower( $attr_name ); - $schema_attr = isset( $schema_attrs[ $attr_name ] ) ? - $schema_attrs[ $attr_name ] : - false; +function get_schema_attribute($ldapserver,$attr_name,$dn=null) { + debug_log(sprintf('get_schema_attribute(): Entered with (%s,%s,%s)',$ldapserver->server_id,$attr_name,$dn),2); + + $attr_name = real_attr_name($attr_name); + $schema_attrs = get_schema_attributes($ldapserver,$dn); + $attr_name = strtolower($attr_name); + $schema_attr = isset($schema_attrs[$attr_name]) ? $schema_attrs[$attr_name] : false; + return $schema_attr; } -/** - * Gets an associative array of AttributeType objects for the specified +/** + * Gets an associative array of AttributeType objects for the specified * server. Each array entry's key is the name of the attributeType * in lower-case and the value is an AttributeType object. * @@ -1576,102 +1416,112 @@ function get_schema_attribute( $server_id, $attr_name, $dn=null, $use_cache=true * * @return array An array of AttributeType objects. */ -function get_schema_attributes( $server_id, $dn = null, $use_cache=true ) -{ - if( $use_cache && cached_schema_available( $server_id, 'attributetypes' ) ) { - return get_cached_schema( $server_id, 'attributetypes' ); - } +function get_schema_attributes($ldapserver,$dn=null) { + debug_log(sprintf('get_schema_attributes(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2); - $raw_attrs = _get_raw_schema( $server_id, 'attributeTypes', $dn ); - if( ! $raw_attrs ) - return false; - - // build the array of attribueTypes - $syntaxes = get_schema_syntaxes( $server_id, $dn ); - $attrs = array(); - /** - * bug 856832: create two arrays - one indexed by name (the standard - * $attrs array above) and one indexed by oid (the new $attrs_oid array - * below). This will help for directory servers, like IBM's, that use OIDs - * in their attribute definitions of SUP, etc - */ - $attrs_oid = array(); - foreach( $raw_attrs as $attr_string ) { - if( $attr_string == null || 0 == strlen( $attr_string ) ) - continue; - $attr = new AttributeType( $attr_string ); - if( isset( $syntaxes[ $attr->getSyntaxOID() ] ) ) { - $syntax = $syntaxes[ $attr->getSyntaxOID() ]; - $attr->setType( $syntax->getDescription() ); - } - $name = $attr->getName(); - $key = strtolower( $name ); - $attrs[ $key ] = $attr; - - /** - * bug 856832: create an entry in the $attrs_oid array too. This - * will be a ref to the $attrs entry for maintenance and performance - * reasons - */ - $oid = $attr->getOID(); - $attrs_oid[ $oid ] = &$attrs[ $key ]; + # Set default return + $return = null; + + if ($return = get_cached_item($ldapserver->server_id,'schema','attributes')) { + debug_log(sprintf('get_schema_attributes(): Returning CACHED [%s] (%s)',$ldapserver->server_id,'attributes'),3); + return $return; } - add_aliases_to_attrs( $attrs ); - /** - * bug 856832: pass the $attrs_oid array as a second (new) parameter - * to add_sup_to_attrs. This will allow lookups by either name or oid. - */ - add_sup_to_attrs( $attrs, $attrs_oid ); + $raw_attrs = $ldapserver->getRawSchema('attributeTypes', $dn); + if ($raw_attrs) { - ksort( $attrs ); + # build the array of attribueTypes + $syntaxes = get_schema_syntaxes($ldapserver,$dn); + $attrs = array(); - // Add the used in and required_by values. - $schema_object_classes = get_schema_objectclasses( $server_id ); + /** + * bug 856832: create two arrays - one indexed by name (the standard + * $attrs array above) and one indexed by oid (the new $attrs_oid array + * below). This will help for directory servers, like IBM's, that use OIDs + * in their attribute definitions of SUP, etc + */ + $attrs_oid = array(); + foreach ($raw_attrs as $attr_string) { + if (is_null($attr_string) || strlen($attr_string) == 0 ) + continue; - foreach( $schema_object_classes as $object_class ) { - $must_attrs = $object_class->getMustAttrNames($schema_object_classes); - $may_attrs = $object_class->getMayAttrNames($schema_object_classes); - $oclass_attrs = array_unique( array_merge( $must_attrs, $may_attrs ) ); - - // Add Used In. - foreach( $oclass_attrs as $attr_name ) { - if( isset( $attrs[ strtolower( $attr_name ) ] ) ) { - $attrs[ strtolower( $attr_name ) ]->addUsedInObjectClass( - $object_class->getName() ); - } else { - //echo "Warning, attr not set: $attr_name
"; + $attr = new AttributeType( $attr_string ); + if (isset($syntaxes[$attr->getSyntaxOID()])) { + $syntax = $syntaxes[$attr->getSyntaxOID()]; + $attr->setType($syntax->getDescription()); } + $attrs[strtolower($attr->getName())] = $attr; + + /** + * bug 856832: create an entry in the $attrs_oid array too. This + * will be a ref to the $attrs entry for maintenance and performance + * reasons + */ + $attrs_oid[$attr->getOID()] = &$attrs[strtolower($attr->getName())]; } - // Add Required By. - foreach( $must_attrs as $attr_name ) { - if( isset( $attrs[ strtolower( $attr_name ) ] ) ) { - $attrs[ strtolower( $attr_name ) ]->addRequiredByObjectClass( - $object_class->getName() ); - } else { - //echo "Warning, attr not set: $attr_name
"; + add_aliases_to_attrs($attrs); + /** + * bug 856832: pass the $attrs_oid array as a second (new) parameter + * to add_sup_to_attrs. This will allow lookups by either name or oid. + */ + add_sup_to_attrs($attrs,$attrs_oid); + + ksort($attrs); + + # Add the used in and required_by values. + $schema_object_classes = get_schema_objectclasses($ldapserver); + if (! is_array($schema_object_classes)) + return array(); + + foreach ($schema_object_classes as $object_class) { + $must_attrs = $object_class->getMustAttrNames($schema_object_classes); + $may_attrs = $object_class->getMayAttrNames($schema_object_classes); + $oclass_attrs = array_unique(array_merge($must_attrs,$may_attrs)); + + # Add Used In. + foreach ($oclass_attrs as $attr_name) { + if (isset($attrs[strtolower($attr_name)])) + $attrs[strtolower($attr_name)]->addUsedInObjectClass($object_class->getName()); + + else { + #echo "Warning, attr not set: $attr_name
"; + } } + + # Add Required By. + foreach ($must_attrs as $attr_name) { + if (isset($attrs[strtolower($attr_name)])) + $attrs[strtolower($attr_name)]->addRequiredByObjectClass($object_class->getName()); + + else { + #echo "Warning, attr not set: $attr_name
"; + } + } + } - } + $return = $attrs; + # cache the schema to prevent multiple schema fetches from LDAP server + set_cached_item($ldapserver->server_id,'schema','attributes',$return); + } - // cache the schema to prevent multiple schema fetches from LDAP server - set_cached_schema( $server_id, 'attributetypes', $attrs ); - return( $attrs ); + debug_log(sprintf('get_schema_attributes(): Returning (%s)',serialize($return)),1); + return $return; } /** - * For each attribute that has multiple names, this function adds unique entries to + * For each attribute that has multiple names, this function adds unique entries to * the attrs array for those names. Ie, attributeType has name 'gn' and 'givenName'. * This function will create a unique entry for 'gn' and 'givenName'. */ -function add_aliases_to_attrs( &$attrs ) -{ +function add_aliases_to_attrs( &$attrs ) { + debug_log(sprintf('add_aliases_to_attrs(): Entered with (%s)',serialize($attrs)),2); + // go back and add data from aliased attributeTypes foreach( $attrs as $name => $attr ) { $aliases = $attr->getAliases(); - if( is_array( $aliases ) && count( $aliases ) > 0 ) { + if( is_array( $aliases ) && count( $aliases ) > 0 ) { // foreach of the attribute's aliases, create a new entry in the attrs array // with its name set to the alias name, and all other data copied foreach( $aliases as $alias_attr_name ) { @@ -1687,17 +1537,18 @@ function add_aliases_to_attrs( &$attrs ) } /** - * Adds inherited values to each attributeType specified by the SUP directive. + * Adds inherited values to each attributeType specified by the SUP directive. * Supports infinite levels of inheritance. * Bug 856832: require a second paramter that has all attributes indexed by OID */ -function add_sup_to_attrs( &$attrs, &$attrs_oid ) -{ +function add_sup_to_attrs( &$attrs, &$attrs_oid ) { + debug_log(sprintf('add_sup_to_attrs(): Entered with (%s,%s)',serialize($attrs),serialize($attrs_oid)),2); + $debug = false; if( $debug ) echo "
";
 
 	if( $debug ) print_r( $attrs );
-	
+
 	// go back and add any inherited descriptions from parent attributes (ie, cn inherits name)
 	foreach( $attrs as $key => $attr ) {
 		if( $debug ) echo "Analyzing inheritance for attribute '" . $attr->getName() . "'\n";
@@ -1725,12 +1576,12 @@ function add_sup_to_attrs( &$attrs, &$attrs_oid )
 					$attr->setSupAttribute( $attrs_oid[$sup_attr_name]->getName() );
 					$sup_attr_name = $attr->getSupAttribute();
 				}
-				
-				if( ! isset( $attrs[ strtolower( $sup_attr_name ) ] ) ){ 
-					pla_error( "Schema error: attributeType '" . $attr->getName() . "' inherits from 
-								'" . $sup_attr_name . "', but attributeType '" . $sup_attr_name . "' does not
-								exist." );
-						return;
+
+				if( ! isset( $attrs[ strtolower( $sup_attr_name ) ] ) ){
+					pla_error( "Schema error: attributeType '" . $attr->getName() . "' inherits from
+						'" . $sup_attr_name . "', but attributeType '" . $sup_attr_name . "' does not
+						exist." );
+					return;
 				}
 
 				if( $debug ) echo " sup_attr_name: $sup_attr_name\n";
@@ -1801,210 +1652,104 @@ function add_sup_to_attrs( &$attrs, &$attrs_oid )
 	if( $debug ) echo "
\n"; } -/** +/** * Returns an array of MatchingRule objects for the specified server. * The key of each entry is the OID of the matching rule. */ -function get_schema_matching_rules( $server_id, $dn=null, $use_cache=true ) -{ - if( $use_cache && cached_schema_available( $server_id, 'matchingrules' ) ) { - return get_cached_schema( $server_id, 'matchingrules' ); - } +function get_schema_matching_rules($ldapserver,$dn=null) { + debug_log(sprintf('get_schema_matching_rules(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2); - // build the array of MatchingRule objects - $raw_matching_rules = _get_raw_schema( $server_id, 'matchingRules', $dn ); - if( ! $raw_matching_rules ) - return false; - $rules = array(); - foreach( $raw_matching_rules as $rule_string ) { - if( $rule_string == null || 0 == strlen( $rule_string ) ) - continue; - $rule = new MatchingRule( $rule_string ); - $key = strtolower( $rule->getName() ); - $rules[ $key ] = $rule; + # Set default return + $return = null; + + if ($return = get_cached_item($ldapserver->server_id,'schema','matchingrules')) { + debug_log(sprintf('get_schema_matching_rules(): Returning CACHED [%s] (%s)', + $ldapserver->server_id,'matchingrules'),3); + return $return; } - ksort( $rules ); + # build the array of MatchingRule objects + $raw_matching_rules = $ldapserver->getRawSchema('matchingRules', $dn); + if ($raw_matching_rules) { - // For each MatchingRuleUse entry, add the attributes who use it to the - // MatchingRule in the $rules array. - $raw_matching_rule_use = _get_raw_schema( $server_id, 'matchingRuleUse' ); - if( $raw_matching_rule_use != false ) { - foreach( $raw_matching_rule_use as $rule_use_string ) { - if( $rule_use_string == null || 0 == strlen( $rule_use_string ) ) + $rules = array(); + foreach( $raw_matching_rules as $rule_string ) { + if( $rule_string == null || 0 == strlen( $rule_string ) ) continue; - $rule_use = new MatchingRuleUse( $rule_use_string ); - $key = strtolower( $rule_use->getName() ); - if( isset( $rules[ $key ] ) ) - $rules[ $key ]->setUsedByAttrs( $rule_use->getUsedByAttrs() ); + $rule = new MatchingRule( $rule_string ); + $key = strtolower( $rule->getName() ); + $rules[ $key ] = $rule; } - } else { - // No MatchingRuleUse entry in the subschema, so brute-forcing - // the reverse-map for the "$rule->getUsedByAttrs()" data. - $attrs = get_schema_attributes( $server_id, $dn ); - if( is_array( $attrs ) ) - foreach( $attrs as $attr ) { - $rule_key = strtolower( $attr->getEquality() ); - if( isset( $rules[ $rule_key ] ) ) - $rules[ $rule_key ]->addUsedByAttr( $attr->getName() ); + + ksort( $rules ); + + // For each MatchingRuleUse entry, add the attributes who use it to the + // MatchingRule in the $rules array. + $raw_matching_rule_use = $ldapserver->getRawSchema('matchingRuleUse'); + if( $raw_matching_rule_use != false ) { + foreach( $raw_matching_rule_use as $rule_use_string ) { + if( $rule_use_string == null || 0 == strlen( $rule_use_string ) ) + continue; + $rule_use = new MatchingRuleUse( $rule_use_string ); + $key = strtolower( $rule_use->getName() ); + if( isset( $rules[ $key ] ) ) + $rules[ $key ]->setUsedByAttrs( $rule_use->getUsedByAttrs() ); } + } else { + // No MatchingRuleUse entry in the subschema, so brute-forcing + // the reverse-map for the "$rule->getUsedByAttrs()" data. + $attrs = get_schema_attributes( $ldapserver, $dn ); + if( is_array( $attrs ) ) + foreach( $attrs as $attr ) { + $rule_key = strtolower( $attr->getEquality() ); + if( isset( $rules[ $rule_key ] ) ) + $rules[ $rule_key ]->addUsedByAttr( $attr->getName() ); + } + } + + $return = $rules; + # cache the schema to prevent multiple schema fetches from LDAP server + set_cached_item($ldapserver->server_id,'schema','matchingrules',$return); } - // cache the schema to prevent multiple schema fetches from LDAP server - set_cached_schema( $server_id, 'matchingrules', $rules ); - return $rules; + debug_log(sprintf('get_schema_attributes(): Returning (%s)',serialize($return)),1); + return $return; } -/** +/** * Returns an array of Syntax objects that this LDAP server uses mapped to * their descriptions. The key of each entry is the OID of the Syntax. */ -function get_schema_syntaxes( $server_id, $dn=null, $use_cache=true ) -{ - if( $use_cache && cached_schema_available( $server_id, 'ldapsyntaxes' ) ) { - return get_cached_schema( $server_id, 'ldapsyntaxes' ); - } +function get_schema_syntaxes($ldapserver,$dn=null) { + debug_log(sprintf('get_schema_syntaxes(): Entered with (%s,%s)',$ldapserver->server_id,$dn),2); - $raw_syntaxes = _get_raw_schema( $server_id, 'ldapSyntaxes', $dn ); - if( ! $raw_syntaxes ) - return false; + # Set default return + $return = null; - // build the array of attributes - $syntaxes = array(); - foreach( $raw_syntaxes as $syntax_string ) { - $syntax = new Syntax( $syntax_string ); - $key = strtolower( trim( $syntax->getOID() ) ); - if( ! $key ) continue; - $syntaxes[$key] = $syntax; + if ($return = get_cached_item($ldapserver->server_id,'schema','syntaxes')) { + debug_log(sprintf('get_schema_syntaxes(): Returning CACHED [%s] (%s)',$ldapserver->server_id,'syntaxes'),3); + return $return; } - ksort( $syntaxes ); + $raw_syntaxes = $ldapserver->getRawSchema('ldapSyntaxes', $dn); + if ($raw_syntaxes) { - // cache the schema to prevent multiple schema fetches from LDAP server - set_cached_schema( $server_id, 'ldapsyntaxes', $syntaxes ); + # build the array of attributes + $return = array(); + foreach ($raw_syntaxes as $syntax_string) { + $syntax = new Syntax($syntax_string); + $key = strtolower(trim($syntax->getOID())); + if (! $key) continue; + $return[$key] = $syntax; + } - return $syntaxes; + ksort($return); + + # cache the schema to prevent multiple schema fetches from LDAP server + set_cached_item($ldapserver->server_id,'schema','syntaxes',$return); + } + + debug_log(sprintf('get_schema_syntaxes(): Returning (%s)',serialize($return)),1); + return $return; } - -// -------------------------------------------------------------------- -// Schema caching functions -// -------------------------------------------------------------------- - -/** - * Returns true if the schema for $schema_type has been cached and - * is availble. $schema_type may be one of (lowercase) the following: - * objectclasses - * attributetypes - * ldapsyntaxes - * matchingrules - * matchingruleuse - * Note that _get_raw_schema() takes a similar parameter. - */ -function cached_schema_available( $server_id, $schema_type ) -{ - // Check config to make sure session-based caching is enabled. - if( ! SCHEMA_SESSION_CACHE_ENABLED ) - return false; - - // Static memory cache available? - // (note: this memory cache buys us a 20% speed improvement over strictly - // checking the session, ie 0.05 to 0.04 secs) - $schema_type = strtolower( $schema_type ); - static $cache_avail; - if( isset( $cache_avail[ $server_id ][ $schema_type ] ) ) { - return true; - } - - // Session cache available? - if( isset( $_SESSION[ 'schema' ][ $server_id ][ $schema_type ] ) ) { - $cache_avail[ $server_id ][ $schema_type ] = true; - return true; - } elseif ( isset( $_SESSION[ 'schema' ][ $server_id ][ 'unavailable'] ) ) { - return true; - } else { - return false; - } -} - -/** - * Returns the cached array of schemaitem objects for the specified - * $schema_type. For list of valid $schema_type values, see above - * schema_cache_available(). Note that internally, this function - * utilizes a two-layer cache, one in memory using a static variable - * for multiple calls within the same page load, and one in a session - * for multiple calls within the same user session (spanning multiple - * page loads). - * - * Returns an array of SchemaItem objects on success or false on failure. - */ -function get_cached_schema( $server_id, $schema_type ) -{ - // Check config to make sure session-based caching is enabled. - if( ! SCHEMA_SESSION_CACHE_ENABLED ) - return false; - - static $cache; - $schema_type = strtolower( $schema_type ); - if( isset( $cache[ $server_id ][ $schema_type ] ) ) { - //echo "Getting memory-cached schema for \"$schema_type\"...
\n"; - return $cache[ $server_id ][ $schema_type ]; - } - - //echo "Getting session-cached schema for \"$schema_type\"...
\n"; - if( cached_schema_available( $server_id, $schema_type ) ) { - $schema = $_SESSION[ 'schema' ][ $server_id ][ $schema_type ]; - $cache[ $server_id ][ $schema_type ] = $schema; - return $schema; - } else { - return false; - } -} - -/** - * Caches the specified $schema_type for the specified $server_id. - * $schema_items should be an array of SchemaItem instances (ie, - * an array of ObjectClass, AttributeType, LDAPSyntax, MatchingRuleUse, - * or MatchingRule objects. - * - * Returns true on success of false on failure. - */ -function set_cached_schema( $server_id, $schema_type, $schema_items ) -{ - // Check config to make sure session-based caching is enabled. - if( ! SCHEMA_SESSION_CACHE_ENABLED ) - return false; - - //echo "Setting cached schema for \"$schema_type\"...
\n"; - // Sanity check. The schema must be in the form of an array - if( ! is_array( $schema_items ) ) { - die( "While attempting to cache schema, passed a non-array for \$schema_items!" ); - return false; - } - // Make sure we are being passed a valid array of schema_items - foreach( $schema_items as $schema_item ) { - if( ! is_subclass_of( $schema_item, 'SchemaItem' ) && - ! 0 == strcasecmp( 'SchemaItem', get_class( $schema_item ) ) ) { - die( "While attempting to cache schema, one of the schema items passed is not a true SchemaItem instance!" ); - return false; - } - } - - $schema_type = strtolower( $schema_type ); - $_SESSION[ 'schema' ][ $server_id ][ $schema_type ] = $schema_items; - return true; -} - -/** - * Sets the schema entry for the server_id to be "unavailable" so that we realize - * that we tried to get the schema but could not, so quit trying next time to - * fetch it from the server. - */ -function set_schema_cache_unavailable( $server_id ) -{ - if( ! SCHEMA_SESSION_CACHE_ENABLED ) - return false; - $_SESSION['schema'][$server_id]['unavailable'] = true; - return true; -} - ?> diff --git a/search.php b/search.php index 2dc3ab7..4ffbd22 100644 --- a/search.php +++ b/search.php @@ -1,253 +1,251 @@ haveAuthInfo()) + pla_error( $lang['not_enough_login_info'] ); // Output format, table or list? $result_formats = array( 'list', 'table' ); -$format = isset( $_GET['format'] ) ? $_GET['format'] : get_default_search_display(); -if( ! in_array( $format, $result_formats ) ) - $format = 'list'; +$format = isset( $_GET['format'] ) ? $_GET['format'] : $config->GetValue('search','display'); -$js_on_change_string =''; -if( isset( $_GET['form'] ) && $_GET['form'] == 'advanced' ) - $js_on_change_string = - 'onChange="document.forms[0].base_dn.value=servers[document.forms[0].server_id.value].getBaseDn()"'; +if( ! in_array( $format, $result_formats ) ) + $format = 'list'; // build the server drop-down html and JavaScript array (for base_dns) +$js_on_change_string = ''; +if( isset( $_GET['form'] ) && $_GET['form'] == 'advanced' ) + $js_on_change_string = + 'onChange="document.forms[0].base_dn.value=servers[document.forms[0].server_id.value].base_dn"'; -$server_info_list =array(); - -$server_menu_html = ''; -if (count($servers)>1){ - $server_menu_html = ''; -} else { - $server = reset($servers); - $id = key($servers); - $base_dn = $server['base'] ? $server['base'] : try_to_get_root_dn( $id ); - $server_info_list[$id]['id'] = $id; - $server_info_list[$id]['name'] = $server['name']; - $server_info_list[$id]['base_dn'] = $base_dn; - if( $server['host'] ) - $server_menu_html .= '' . - '' . $server['name'] . ''; +if (isset($ldapserver)) { +$server_menu_html = server_select_list($ldapserver->server_id,true,'server_id',$js_on_change_string); +$server_info_list = server_info_list(); } - -$filter = isset( $_GET['filter'] ) ? $_GET['filter'] : null; +$filter = isset( $_GET['filter'] ) ? clean_search_vals($_GET['filter']) : null; $attr = isset( $_GET['attribute'] ) ? $_GET['attribute'] : null; // grab the base dn for the search -if( isset( $_GET['base_dn'] ) ) { +if( isset( $_GET['base_dn'] ) && $_GET['base_dn'] ) { $base_dn = $_GET['base_dn']; - $base_dn_is_invalid = false; - $base_dn_does_not_exist = false; - if( trim( $base_dn ) ) - if( ! is_dn_string( $base_dn ) ) - $base_dn_is_invalid = true; - elseif( ! dn_exists( $server_id, $base_dn ) ) - $base_dn_does_not_exist = true; -} elseif( '' != $servers[$server_id]['base'] ) - $base_dn = $servers[$server_id]['base']; -else - $base_dn = try_to_get_root_dn( $server_id ); - + $base_dn_is_invalid = false; + $base_dn_does_not_exist = false; + + if( trim( $base_dn ) ) + if( ! is_dn_string( $base_dn ) ) + $base_dn_is_invalid = true; + + elseif( ! dn_exists( $ldapserver, $base_dn ) ) + $base_dn_does_not_exist = true; + + $base_dns = array($base_dn); +} else + if (isset($ldapserver)) + $base_dns = $ldapserver->getBaseDN(); + $criterion = isset( $_GET['criterion'] ) ? $_GET['criterion'] : null; -$form = isset( $_GET['form'] ) ? $_GET['form'] : null; +if (isset($_GET['form'])) + $_SESSION['form'] = $_GET['form']; +$form = isset( $_SESSION['form'] ) ? $_SESSION['form'] : null; $scope = isset( $_GET['scope'] ) ? $_GET['scope'] : 'sub'; -include './header.php'; ?> +include './header.php'; +?> -
- + require LIBDIR.'search_form_simple.php'; +} +?>
-GetValue('search','result_attributes'); + } +// $search_result_attributes = isset( $_GET['display_attrs'] ) ? +// rawurldecode( $_GET['display_attrs'] ) : ( isset( $search_result_attributes ) ? +// $search_result_attributes : "dn, cn" ); + + //process_config(); + } else { + $search_result_attributes = $config->GetValue('search','result_attributes'); + } // do we have enough authentication information for the specified server_id - if( ! have_auth_info( $server_id ) ) - { - $login_url = "login_form.php?server_id=$server_id&redirect=" . rawurlencode( $_SERVER['REQUEST_URI'] ); - ?> + if( ! $ldapserver->haveAuthInfo() ) { + $login_url = sprintf('login_form.php?server_id=%s&redirect=%s', + $ldapserver->server_id,rawurlencode($_SERVER['REQUEST_URI'])); ?>


.
+ Instance($query['server']); + } + + } else { + $predefined = ''; } - $ds = pla_ldap_connect( $server_id ); - pla_ldap_connection_is_error( $ds ); - - - if( $filter ) - { + + if( $filter ) { // if they are using the simple search form, build an LDAP search filter from their input - if( $form == 'simple' & ! is_numeric( $predefined ) ) - { + if( $form == 'simple' & ! is_numeric( $predefined ) ) { + switch( $criterion ) { case 'starts with': // to fix bug 789113 if( $filter == "*" ) $filter = ""; + $filter = "($attr=$filter*)"; break; + case 'contains': // to fix bug 789113 if( $filter == "*" ) $filter = "($attr=*)"; + else $filter = "($attr=*$filter*)"; + break; + case 'ends with': // to fix bug 789113 if( $filter == "*" ) $filter = ""; + $filter = "($attr=*$filter)"; break; + case 'equals': $filter = "($attr=$filter)"; break; + case 'sounds like': $filter = "($attr~=$filter)"; break; + default: - pla_error( $lang['unrecognized_criteria_option'] . - htmlspecialchars( $criterion ) . - $lang['if_you_want_to_add_criteria'] ); + pla_error( $lang['unrecognized_criteria_option'] . + htmlspecialchars( $criterion ) . + $lang['if_you_want_to_add_criteria'] ); } } - + echo "
" . $lang['searching'] . "
\n"; flush(); // prevent script from bailing early on a long delete @set_time_limit( 0 ); - // grab the size limit set in config.php - $size_limit = isset ( $search_result_size_limit ) && is_numeric( $search_result_size_limit ) ? - $search_result_size_limit : - 50; - // Sanity check - if( $size_limit < 1 ) - $size_limit = 1; + $size_limit = $config->GetValue('search','size_limit'); + // Sanity check + if( $size_limit < 1 ) + $size_limit = 1; $page = isset( $_GET['page'] ) ? $_GET['page'] : 0; $time_start = utime(); + $time_elapsed = 0; + + foreach ($base_dns as $base_dn) { + if (! dn_exists( $ldapserver, $base_dn ) ) { + debug_log(sprintf('BaseDN [%s] skipped as it doesnt exist in [%s].',$base_dn,$ldapserver->server_id),1); + continue; + } else { + debug_log(sprintf('Search with base DN [%s]',$base_dn),9); + } + if( $scope == 'base' ) - $results = @ldap_read( $ds, $base_dn, $filter, $search_result_attributes, - 0, 0, 0, get_search_deref_setting() ); + $results = @ldap_read( $ldapserver->connect(false), $base_dn, $filter, $search_result_attributes, + 0, 0, 0, $config->GetValue('deref','search') ); + elseif( $scope == 'one' ) - $results = @ldap_list( $ds, $base_dn, $filter, $search_result_attributes, - 0, 0, 0, get_search_deref_setting() ); + $results = @ldap_list( $ldapserver->connect(false), $base_dn, $filter, $search_result_attributes, + 0, 0, 0, $config->GetValue('deref','search') ); + else // scope == 'sub' - $results = @ldap_search( $ds, $base_dn, $filter, $search_result_attributes, - 0, 0, 0, get_search_deref_setting() ); - $errno = @ldap_errno( $ds ); + $results = @ldap_search( $ldapserver->connect(false), $base_dn, $filter, $search_result_attributes, + 0, 0, 0, $config->GetValue('deref','search') ); + + $errno = @ldap_errno( $ldapserver->connect(false) ); + if( ! $results ) { - pla_error( $lang['error_performing_search'], ldap_error( $ds ), ldap_errno( $ds ) ); + pla_error( $lang['error_performing_search'], ldap_error( $ldapserver->connect(false) ), ldap_errno( $ldapserver->connect(false) ) ); } $time_end = utime(); - $time_elapsed = round( $time_end - $time_start, 2 ); - $count = @ldap_count_entries( $ds, $results ); + $time_elapsed += round( $time_end - $time_start, 2 ); + $count = @ldap_count_entries( $ldapserver->connect(), $results ); $start_entry = $page * $size_limit; $end_entry = min( $start_entry + $size_limit + 1, $count+1 ); - ?> @@ -260,119 +258,130 @@ if( isset( $_GET['search'] ) ) - " . - $lang['export_results'] . " ]"; ?> - ' . $lang['format'] . ':'; - foreach( $result_formats as $f ) { - echo ' '; - if( $format == $f ) { - echo '' . $lang[$f] . ''; - } else { - $php_self = $_SERVER['PHP_SELF']; - $query_string = array_to_query_string( $_GET, array( 'format' ) ); - $query_string .= "&format=$f"; - echo "" . $lang[$f] . ""; - } - } - ?> + %s ]', + $ldapserver->server_id,$scope,urlencode($base_dn),urlencode($filter),urlencode(join(', ',$search_result_attributes)),$lang['export_results']); + + printf('[ %s:',$lang['format']); + + foreach( $result_formats as $f ) { + echo ' '; + + if( $format == $f ) { + echo '' . $lang[$f] . ''; + + } else { + $php_self = $_SERVER['PHP_SELF']; + $query_string = array_to_query_string( $_GET, array( 'format' ) ); + $query_string .= "&format=$f"; + echo "" . $lang[$f] . ""; + } + } ?> + ] - -
- - - - + +
+ +
-
" . $lang['size_limit_exceeded'] . "

\n"; - } + // The LDAP error code for the size limit exceeded error. + define( 'SIZE_LIMIT_EXCEEDED', 4 ); + if( $errno && $errno == SIZE_LIMIT_EXCEEDED ) { + echo "
" . $lang['size_limit_exceeded'] . "

\n"; + } // Draw the paging links - $pager_html = ''; - $total_pages = $count / $size_limit; - $results_per_page = $size_limit; + $pager_html = ''; + $total_pages = $count / $size_limit; + $results_per_page = $size_limit; + if( $count > $size_limit ) { - echo sprintf( $lang['showing_results_x_through_y'], "" . number_format($start_entry+1) . "", "" . number_format($end_entry-1) . "" ) . "
\n"; + echo sprintf( $lang['showing_results_x_through_y'], "" . number_format($start_entry+1) . "", "" . number_format($end_entry-1) . "" ) . "
\n"; + $php_self = $_SERVER['PHP_SELF']; - if( $page != 0 ) { + if( $page != 0 ) { $query_string = array_to_query_string( $_GET, array( 'page' ) ); $query_string .= '&page=' . ($page-1); $pager_html .= "‹‹"; + } else { $pager_html .= "‹‹"; } + $pager_html .= '  '; - // for large search results where we page beyone the first 20 pages, - // print elipsis instead of making the pager be super wide. - $elipsis_printed = false; + // for large search results where we page beyone the first 20 pages, + // print elipsis instead of making the pager be super wide. + $elipsis_printed = false; for( $i=0; $i<$count; $i+=$size_limit ) { $page_num = $i/$size_limit; - if( $count > $size_limit * 20 && abs( $page_num - $page ) > 10 ) { - if( ! $elipsis_printed ) { - $pager_html .= '...  '; - $elipsis_printed = true; - } - } else if( $page == $page_num ) { + + if( $count > $size_limit * 20 && abs( $page_num - $page ) > 10 ) { + + if( ! $elipsis_printed ) { + $pager_html .= '...  '; + $elipsis_printed = true; + } + + } else if( $page == $page_num ) { $pager_html .= '' . ($page_num + 1) . ''; - $pager_html .= '  '; - $elipsis_printed = false; + $pager_html .= '  '; + $elipsis_printed = false; + } else { $query_string = array_to_query_string( $_GET, array( 'page' ) ); $query_string .= '&page=' . $page_num; $pager_html .= "" . ($page_num+1) . ""; - $pager_html .= '  '; - $elipsis_printed = false; + $pager_html .= '  '; + $elipsis_printed = false; } } + if( $page+1 < $total_pages ) { $query_string = array_to_query_string( $_GET, array( 'page' ) ); $query_string .= '&page=' . ($page+1); $pager_html .= "››"; + } else { $pager_html .= "››"; } - } + } - if( 0 == $count ) - echo '

' . $lang['no_results'] . '

'; - else { - echo '
' . $pager_html . '

'; - flush(); - if( $format == 'list' ) - include realpath( './search_results_list.php' ); - elseif( $format == 'table' ) - include realpath( './search_results_table.php' ); - else - pla_error( sprintf( $lang['unrecoginzed_search_result_format'], htmlspecialchars( $format ) ) ); - echo '
' . $pager_html . '
'; - } + if( 0 == $count ) + echo '

' . $lang['no_results'] . '

'; - ?> + else { + echo '
' . $pager_html . '

'; + flush(); + + if( $format == 'list' ) + // $lang['list'] - this is here so check_lang_files doesnt prompt us to remove this $lang variable. + require LIBDIR.'search_results_list.php'; + + elseif( $format == 'table' ) + // $lang['table'] - this is here so check_lang_files doesnt prompt us to remove this $lang variable. + require LIBDIR.'search_results_table.php'; + + else + pla_error( sprintf( $lang['unrecoginzed_search_result_format'], htmlspecialchars( $format ) ) ); + echo '
' . $pager_html . '
'; + } + } ?>

.
- + - diff --git a/search_form_advanced.php b/search_form_advanced.php index 0f942f8..1a94a79 100644 --- a/search_form_advanced.php +++ b/search_form_advanced.php @@ -1,17 +1,23 @@ + - - diff --git a/search_form_predefined.php b/search_form_predefined.php index 6c48da1..4545dfd 100644 --- a/search_form_predefined.php +++ b/search_form_predefined.php @@ -1,51 +1,68 @@ + + + + + + + + + + +
+ + + +
+ +\n"; +?> diff --git a/template_functions.php b/template_functions.php new file mode 100644 index 0000000..e6123cd --- /dev/null +++ b/template_functions.php @@ -0,0 +1,542 @@ +stack[count($this->stack)] = &$pos; + $this->stack_ref = &$pos; + } + + function pop_pos() { + unset($this->stack[count($this->stack) - 1]); + $this->stack_ref = &$this->stack[count($this->stack) - 1]; + } + + function parse($file) { + $f = fopen($file,'r'); + $strInputXML = fread($f,filesize($file)); + fclose($f); + + $this->resParser = xml_parser_create(); + xml_set_object($this->resParser,$this); + xml_set_element_handler($this->resParser,"tagOpen","tagClosed"); + + xml_set_character_data_handler($this->resParser,"tagData"); + + $this->push_pos($this->arrOutput); + + $this->strXmlData = xml_parse($this->resParser,$strInputXML); + + if (! $this->strXmlData) + die(sprintf("XML error: %s at line %d", + xml_error_string(xml_get_error_code($this->resParser)), + xml_get_current_line_number($this->resParser))); + + xml_parser_free($this->resParser); + + return $this->arrOutput; + } + + function tagOpen($parser,$name,$attrs) { + $name = strtolower($name); + + if (isset($this->stack_ref[$name])) { + if (! isset($this->stack_ref[$name][0])) { + $tmp = $this->stack_ref[$name]; + unset($this->stack_ref[$name]); + $this->stack_ref[$name][0] = $tmp; + } + + $cnt = count($this->stack_ref[$name]); + $this->stack_ref[$name][$cnt] = array(); + if (isset($attrs)) + $this->stack_ref[$name][$cnt] = $attrs; + + $this->push_pos($this->stack_ref[$name][$cnt]); + + } else { + $this->stack_ref[$name]=array(); + + if (isset($attrs)) + $this->stack_ref[$name]=$attrs; + + $this->push_pos($this->stack_ref[$name]); + } + } + + function tagData($parser,$tagData) { + if (trim($tagData) != '') { + + if (isset($this->stack_ref['#text'])) + $this->stack_ref['#text'] .= $tagData; + else + $this->stack_ref['#text'] = $tagData; + } + } + + function tagClosed($parser,$name) { + $this->pop_pos(); + } +} + +class Templates { + + var $_template = array(); + + function Templates($server_id) { + debug_log(sprintf('%s::init(): Entered with ()',get_class($this)),2); + + if ($this->_template = get_cached_item($server_id,'template','all')) { + debug_log(sprintf('%s::init(): Using CACHED [%s]',get_class($this),'templates'),3); + } else { + + $dir = opendir(TMPLDIR); + + $this->template_num = 0; + while( ( $file = readdir( $dir ) ) !== false ) { + if (! preg_match('/.xml$/',$file)) continue; + + $objXML = new xml2array(); + $xmldata = $objXML->parse(TMPLDIR.$file); + + $template_name = preg_replace('/.xml$/','',$file); + + $this->storeTemplate($template_name,$xmldata); + } + masort($this->_template,'title'); + set_cached_item($server_id,'template','all',$this->_template); + } + } + + function storeTemplate($template,$xmldata) { + debug_log(sprintf('%s::storeTemplate(): Entered with (%s,%s)',get_class($this),$template,serialize($xmldata)),2); + + global $ldapserver, $lang; + + foreach ($xmldata['template'] as $xml_key => $xml_value) { + debug_log(sprintf('%s::storeTemplate(): Foreach loop Key [%s] Value [%s]',get_class($this),$xml_key,is_array($xml_value)),9); + + switch ($xml_key) { + # Build our object Classes from the DN and Template. + case ('objectclasses') : + if (isset($xmldata['template']['objectclasses']) && is_array($xmldata['template']['objectclasses'])) { + foreach ($xmldata['template']['objectclasses']['objectclass'] as $index => $details) { + + if (is_numeric($index)) { + if (! isset($this->_template[$template]['objectclass']) || + ! in_array($details['ID'],$this->_template[$template]['objectclass'])) + + $this->_template[$template]['objectclass'][] = $details['ID']; + + } else { + if (! isset($this->_template[$template]['objectclass']) || + ! in_array($xmldata['template']['objectclasses']['objectclass']['ID'],$this->_template[$template]['objectclass'])) + + $this->_template[$template]['objectclass'][] = $xmldata['template']['objectclasses']['objectclass']['ID']; + } + } + } + + break; + + # Build our attribute list from the DN and Template. + case ('attributes') : + debug_log(sprintf('%s::storeTemplate(): Case [%s]',get_class($this),'attributes'),8); + + if (isset($xmldata['template']['attributes']) && is_array($xmldata['template']['attributes'])) { + $this->_template[$template]['attribute'] = array(); + + foreach ($xmldata['template']['attributes'] as $tattrs) { + foreach ($tattrs as $index => $attr_details) { + + debug_log(sprintf('%s::storeTemplate(): Foreach tattrs Key [%s] Value [%s]',get_class($this),$index,is_array($attr_details)),9); + + # Single attribute XML files are not indexed. + if (! is_numeric($index)) { + $this->_template[$template]['attribute'][$tattrs['ID']][$index] = $this->_parseXML($index,$attr_details); + + } else { + foreach ($attr_details as $key => $values) { + if (preg_match('/^@/',$key)) + continue; + + if (isset($values['ID'])) + $key = $values['ID']; + + $this->_template[$template]['attribute'][$attr_details['ID']][$key] = $this->_parseXML($key,$values); + } + } + } + } + + # Do we have an override parameter? + foreach ($this->_template[$template]['attribute'] as $key => $data) { + if (isset($data['override'])) { + $this->_template[$template]['attribute'][$data['override']] = $data; + unset($this->_template[$template]['attribute'][$key]); + $this->_template[$template]['attribute'][$key] = $data['override']; + } + } + #if (isset($this->_template[$template]['attribute']); + } + + break; + + default : + $this->_template[$template][$xml_key] = $xml_value['#text']; + } + } + + # Collect our structural, must & may attributes. + $this->_template[$template]['must'] = array(); + $this->_template[$template]['may'] = array(); + $this->_template[$template]['empty_attrs'] = array(); + + $superclasslist = array(); + foreach ($this->_template[$template]['objectclass'] as $oclass) { + + # If we get some superclasses - then we'll need to go through them too. + $supclass = true; + $enherited = false; + while ($supclass == true) { + $schema_object = get_schema_objectclass( $ldapserver, $oclass); + + # Test that this is a valid objectclass - disable if an invalid one found. + if (! $schema_object) + $this->_template[$template]['invalid'] = 1; + + if ($schema_object->type == 'structural' && (! $enherited)) + $this->_template[$template]['structural'][] = $oclass; + + if ($schema_object->must_attrs ) + foreach ($schema_object->must_attrs as $index => $detail) + if (! in_array($detail->name,$this->_template[$template]['must']) && $detail->name != 'objectClass') { + if (isset($this->_template[$template]['attribute'][$detail->name]) && + ! is_array($this->_template[$template]['attribute'][$detail->name])) + + $this->_template[$template]['must'][] = + $this->_template[$template]['attribute'][$detail->name]; + else + $this->_template[$template]['must'][] = $detail->name; + } + + if ($schema_object->may_attrs ) + foreach ($schema_object->may_attrs as $index => $detail) + if (! in_array($detail->name,$this->_template[$template]['may'])) + $this->_template[$template]['may'][] = $detail->name; + + # Keep a list to objectclasses we have processed, so we dont get into a loop. + $oclass_processed[] = $oclass; + + if ((count($schema_object->sup_classes)) || count($superclasslist)) { + foreach ($schema_object->sup_classes as $supoclass) { + if (! in_array($supoclass,$oclass_processed)) + $supoclasslist[] = $supoclass; + } + + $oclass = array_shift($supoclasslist); + if ($oclass) + $enherited = true; + else + $supclass = false; + + } else { + $supclass = false; + } + } + } + + # Translate anything. + foreach (array('title','description','display','hint') as $transkey) { + if (isset($this->_template[$template][$transkey]) && isset($lang[$this->_template[$template][$transkey]])) + $this->_template[$template][$transkey] = $lang[$this->_template[$template][$transkey]]; + + foreach ($this->_template[$template]['attribute'] as $key => $value) { + if (isset($value[$transkey]) && isset($lang[$value[$transkey]])) + $this->_template[$template]['attribute'][$key][$transkey] = $lang[$value[$transkey]]; + + if (isset($value['helper'][$transkey]) && isset($lang[$value['helper'][$transkey]])) + $this->_template[$template]['attribute'][$key]['helper'][$transkey] = $lang[$value['helper'][$transkey]]; + } + } + + # Remove any must attributes in the may list. + foreach ($this->_template[$template]['may'] as $index => $detail) { + if (in_array($detail,$this->_template[$template]['must'])) { + unset($this->_template[$template]['may'][$index]); + continue; + } + } + + # Remove any attributes not in the xml file and not in the dn. + foreach ($this->_template[$template]['may'] as $index => $detail) { + if (isset($this->_template[$template]['attribute']) + && ! isset($this->_template[$template]['attribute'][$detail])) { + + unset($this->_template[$template]['may'][$index]); + continue; + } + + if (! isset($attrs[$detail])) + if (isset($this->_template[$template]['attribute'][$detail])) + $this->_template[$template]['empty_attrs'][$detail] = $this->_template[$template]['attribute'][$detail]; + else + $this->_template[$template]['empty_attrs'][$detail]['display'] = $detail; + + else + $this->_template[$template]['attrs'][$detail] = $attrs[$detail]; + } + + # Add the must attrs to the attributes key. + foreach ($this->_template[$template]['must'] as $index => $detail) { + + if (! isset($attrs[$detail])) { + if (isset($this->_template[$template]['attribute'][$detail])) + $this->_template[$template]['empty_attrs'][$detail] = $this->_template[$template]['attribute'][$detail]; + else + $this->_template[$template]['empty_attrs'][$detail]['display'] = $detail; + + $this->_template[$template]['empty_attrs'][$detail]['must'] = true; + } else + $this->_template[$template]['attrs'][$detail] = $attrs[$detail]; + } + + # Check if there are any items without a page or order parameter, and make it 1 and 255. + foreach ($this->_template[$template]['empty_attrs'] as $index => $detail) { + if (! isset($detail['page'])) + $this->_template[$template]['empty_attrs'][$index]['page'] = 1; + if (! isset($detail['order'])) + $this->_template[$template]['empty_attrs'][$index]['order'] = 255; + } + + # Check we have some manditory items. + foreach (array('rdn','structural','visible') as $key) { + if (! isset($this->_template[$template][$key]) + || (! is_array($this->_template[$template][$key]) && ! trim($this->_template[$template][$key]))) { + + //unset($this->_template[$template]); + $this->_template[$template]['invalid'] = 1; + break; + } + } + } + + function _parseXML($index,$attr_details) { + debug_log(sprintf('%s::_parseXML(): Entered with (%s,%s)',get_class($this),$index,serialize($attr_details)),2); + + if (! $attr_details) { + return ""; + + } elseif (isset($attr_details['#text'])) { + return $attr_details['#text']; + } + + foreach ($attr_details as $key => $values) { + $parseXML[$key] = $this->_parseXML($index,$values); + } + + return $parseXML; + } + + function getTemplate($template) { + return isset($this->_template[$template]) ? $this->_template[$template] : null; + } + + function OnChangeAdd($function) { + debug_log(sprintf('%s::OnChangeAdd(): Entered with (%s)',get_class($this),$function),2); + + global $js; + + list($command,$arg) = split(':',$function); + + switch ($command) { + #autoFill:attr,string (with %attr%) + #@todo: The autofill mods need to be more flexible, so that multiple can be used eg: /T/l + case 'autoFill' : + list($attr,$string) = split(',',$arg); + preg_match_all('/%(\w+)(\|[0-9]*-[0-9]*)?(\/[lTU])?%/U',$string,$matchall); + //print"
";print_r($matchall); //0 = highlevel match, 1 = attr, 2 = subst, 3 = mod
+
+				$html = sprintf('autoFill%s(this.form)',$attr);
+
+				if (! isset($js["autoFill".$attr]) ) {
+
+					$js["autoFill".$attr] = sprintf("\nfunction autoFill%s( form ) {\n",$attr);
+					$formula = $string;
+					$formula = preg_replace('/^([^%])/','\'$1',$formula);
+					$formula = preg_replace('/([^%])$/','$1\'',$formula);
+
+					foreach ($matchall[0] as $index => $null) {
+						$substrarray = array();
+
+						$js["autoFill".$attr] .= sprintf("	var %s;\n",$matchall[1][$index]);
+
+						if (trim($matchall[2][$index])) {
+							preg_match_all('/([0-9]*)-([0-9]*)/',$matchall[2][$index],$substrarray);
+						}
+
+						if ($matchall[3][$index] == "/T") {
+							$js["autoFill".$attr] .= sprintf("	%s = form.%s.options[form.%s.selectedIndex].text;\n",
+								$matchall[1][$index],$matchall[1][$index],$matchall[1][$index]);
+
+						} else {
+
+							if ((isset($substrarray[1][0]) && $substrarray[1][0]) || (isset($substrarray[2][0]) && $substrarray[2][0])) {
+								$js["autoFill".$attr] .= sprintf("	%s = form.%s.value.substr(%s,%s)",
+									$matchall[1][$index],$matchall[1][$index],
+									$substrarray[1][0] ? $substrarray[1][0] : '0',
+									$substrarray[2][0] ? $substrarray[2][0] : sprintf('form.%s.value.length',$matchall[1][$index]));
+
+							} else {
+								$js["autoFill".$attr] .= sprintf("	%s = form.%s.value",$matchall[1][$index],$matchall[1][$index]);
+							}
+
+							switch ($matchall[3][$index]) {
+								case '/l':
+									$js["autoFill".$attr] .= ".toLowerCase()";
+									break;
+							}
+							$js["autoFill".$attr] .= ";\n";
+						}
+
+						$formula = preg_replace('/^%('.$matchall[1][$index].')(\|[0-9]*-[0-9]*)?(\/[lTU])?%/U','$1 + \'',$formula);
+						$formula = preg_replace('/%('.$matchall[1][$index].')(\|[0-9]*-[0-9]*)?(\/[lTU])?%$/U','\' + $1 ',$formula);
+						$formula = preg_replace('/%('.$matchall[1][$index].')(\|[0-9]*-[0-9]*)?(\/[lTU])?%/U','\' + $1 + \'',$formula);
+					}
+
+					$js["autoFill".$attr] .= sprintf("	form.%s.value = %s;\n",$attr,$formula);
+					$js["autoFill".$attr] .= "}\n";
+				}
+
+				break;
+
+			default: $html = '';
+		}
+		return $html;
+	}
+
+	function OnChangeDisplay() {
+		global $js;
+
+		return (isset($js) ? implode("\n",$js) : '');
+	}
+
+	function EvaluateDefault($ldapserver,$default,$container,$counter='') {
+		debug_log(sprintf('%s::EvaluateDefault(): Entered with (%s,%s,%s,%s)',
+			get_class($this),$ldapserver->server_id,$default,$container,$counter),2);
+
+		global $lang;
+
+		if (preg_match('/^=php\.(\w+)\((.*)\)$/',$default,$matches)) {
+			$args = preg_split('/,/',$matches[2]);
+
+			switch($matches[1]) {
+				case 'GetNextNumber' :
+					$container = get_container_parent ($container, $args[0]);
+
+					$detail['default'] = get_next_uid_number($ldapserver, $container, $args[1]);
+					break;
+
+				case 'PickList' :
+					$container = get_container_parent ($container, $args[0]);
+					preg_match_all('/%(\w+)(\|.+)?(\/[lU])?%/U',$args[3],$matchall);
+					//print_r($matchall); // -1 = highlevel match, 1 = attr, 2 = subst, 3 = mod
+
+					$ldap_attrs = $matchall[1];
+					array_push($ldap_attrs,$args[2]);
+					$picklistvalues = return_ldap_hash($ldapserver,$container,$args[1],$args[2],$ldap_attrs);
+
+					$detail['default'] = sprintf('';
+
+					break;
+
+				case 'RandomPassword' :
+					$detail['default'] = password_generate();
+					printf('',
+						$lang['random_password'],$detail['default']);
+					break;
+
+				case 'DrawChooserLink' :
+					$detail['default'] = draw_chooser_link(sprintf("template_form.%s%s",$args[0],$counter),$args[1]);
+
+					break;
+
+				case 'Function' :
+					# Capture the function name and remove function name from $args
+					$function_name = array_shift($args);
+
+					# Call the PHP function if exists (PHP 4 >= 4.0.4, PHP 5)
+					if (function_exists($function_name))
+						$detail['default'] = call_user_func_array($function_name,$args);
+
+					break;
+
+				default : $detail['default'] = 'UNKNOWN';
+			}
+
+			$return = $detail['default'];
+
+		} else {
+			$return = $default;
+		}
+
+		debug_log(sprintf('%s::EvaluateDefault(): Returning (%s)',get_class($this),serialize($return)),1);
+		return $return;
+	}
+
+	function HelperValue($helper,$id='',$container='',$ldapserver='',$counter='',$default='') {
+		debug_log(sprintf('%s::HelperValue(): Entered with (%s,%s,%s,%s,%s,%s)',
+			get_class($this),count($helper),$id,$container,$ldapserver->server_id,$counter,$default),2);
+
+		$html = '';
+
+		if ($container && $ldapserver && ! is_array($helper)) {
+			return $this->EvaluateDefault($ldapserver,$helper,$container,$counter);
+
+		} else {
+			if (is_array($helper)) {
+
+				$html = sprintf('';
+
+			} else {
+				print "ERROR: HelperValue NOT complete, how did you get HERE?";
+				die();
+			}
+		}
+
+		return $html;
+	}
+}
+?>
diff --git a/templates/alias.xml b/templates/alias.xml
new file mode 100644
index 0000000..f1e20e4
--- /dev/null
+++ b/templates/alias.xml
@@ -0,0 +1,29 @@
+
+
diff --git a/templates/courierMailAccount.xml b/templates/courierMailAccount.xml
new file mode 100644
index 0000000..2840850
--- /dev/null
+++ b/templates/courierMailAccount.xml
@@ -0,0 +1,111 @@
+
+
diff --git a/templates/courierMailAlias.xml b/templates/courierMailAlias.xml
new file mode 100644
index 0000000..ef1e196
--- /dev/null
+++ b/templates/courierMailAlias.xml
@@ -0,0 +1,38 @@
+
diff --git a/templates/creation/custom.php b/templates/creation/custom.php
index 10cbfa6..783748a 100644
--- a/templates/creation/custom.php
+++ b/templates/creation/custom.php
@@ -1,10 +1,11 @@
 Instance($server_id);
 
 // Unique to this template
 $step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
@@ -14,7 +15,7 @@ have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] );
 
 if( $step == 1 )
 {
-	$oclasses = get_schema_objectClasses( $server_id );
+	$oclasses = get_schema_objectClasses( $ldapserver );
     if( ! $oclasses || ! is_array( $oclasses ) ) 
         pla_error( "Unable to retrieve the schema from your LDAP server. Cannot continue with creation." );
 	?>
@@ -77,7 +78,7 @@ if( $step == 2 )
 	strlen( trim( $rdn ) ) != 0 or
 		pla_error( $lang['rdn_field_blank'] );
 
-	strlen( trim( $container ) ) == 0 or dn_exists( $server_id, $container ) or
+	strlen( trim( $container ) ) == 0 or dn_exists( $ldapserver, $container ) or
 		pla_error( sprintf( $lang['container_does_not_exist'],  htmlspecialchars( $container ) ) );
 
 	$friendly_attrs = process_friendly_attr_table();
@@ -87,11 +88,11 @@ if( $step == 2 )
 	$dn = trim( $container ) ? $rdn . ',' . $container : $rdn;
 
 	// incrementally build up the all_attrs and required_attrs arrays
-	$schema_oclasses = get_schema_objectclasses( $server_id );
+	$schema_oclasses = get_schema_objectclasses( $ldapserver );
 	$required_attrs = array();
 	$all_attrs = array();
 	foreach( $oclasses as $oclass_name ) {
-		$oclass = get_schema_objectclass( $server_id, $oclass_name  );
+		$oclass = get_schema_objectclass( $ldapserver, $oclass_name  );
 		if( $oclass ) {
 			$required_attrs = array_merge( $required_attrs, 
 						$oclass->getMustAttrNames( $schema_oclasses ) );
@@ -103,8 +104,8 @@ if( $step == 2 )
 
 	$required_attrs = array_unique( $required_attrs );
 	$all_attrs = array_unique( $all_attrs );
-    remove_aliases( $required_attrs, $server_id );
-    remove_aliases( $all_attrs, $server_id );
+    remove_aliases( $required_attrs, $ldapserver );
+    remove_aliases( $all_attrs, $ldapserver );
 	sort( $required_attrs );
 	sort( $all_attrs );
 
@@ -128,7 +129,7 @@ if( $step == 2 )
 	// remove binary attributes and add them to the binary_attrs array
 	$binary_attrs = array();
 	foreach( $all_attrs as $i => $attr_name ) {
-		if( is_attr_binary( $server_id, $attr_name )  ) {
+		if( is_attr_binary( $ldapserver, $attr_name )  ) {
 			unset( $all_attrs[ $i ] );
 			$binary_attrs[] = $attr_name;
 		}
@@ -183,7 +184,7 @@ if( $step == 2 )
 			
 			?>
             
-		"
+		"
 					name="required_attrs[]"
 					value="" size="40" />
 	
@@ -272,7 +273,7 @@ function get_binary_attr_select_html( $binary_attrs, $friendly_attrs, $highlight
  * Removes attributes from the array that are aliases for eachother 
  * (just removes the second instance of the aliased attr)
  */
-function remove_aliases( &$attribute_list, $server_id )
+function remove_aliases( &$attribute_list, $ldapserver )
 {
     // remove aliases from the attribute_list array
     for( $i=0; $i";
-            $attr1 = get_schema_attribute( $server_id, $attr_name1 );	
+            $attr1 = get_schema_attribute( $ldapserver, $attr_name1 );	
             if( null == $attr1 )
                 continue;
             if( $attr1->isAliasFor( $attr_name2 ) ) {
@@ -298,4 +299,3 @@ function remove_aliases( &$attribute_list, $server_id )
     $attribute_list = array_values( $attribute_list );
 }
 ?>
-
diff --git a/templates/creation/new_alias_template.php b/templates/creation/new_alias_template.php
index 7765be0..622779a 100644
--- a/templates/creation/new_alias_template.php
+++ b/templates/creation/new_alias_template.php
@@ -59,7 +59,7 @@ have_auth_info( $server_id ) or pla_error( "Not enough information to login to s
 	$attribute_name = $attribute_parts[1];
 	$alias_slashed = str_replace(',', '\,', $alias);
 	
-	dn_exists( $server_id, $container ) or
+	dn_exists( $ldapserver, $container ) or
 		pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
 	       		       "Please go back and try again." );
 
diff --git a/templates/creation/new_dns_entry.php b/templates/creation/new_dns_entry.php
index 55faf03..3dcabf0 100755
--- a/templates/creation/new_dns_entry.php
+++ b/templates/creation/new_dns_entry.php
@@ -1,5 +1,5 @@
 
diff --git a/templates/creation/new_nt_machine.php b/templates/creation/new_nt_machine.php
index 8563be0..7aaefec 100644
--- a/templates/creation/new_nt_machine.php
+++ b/templates/creation/new_nt_machine.php
@@ -1,5 +1,5 @@
 
@@ -87,7 +87,7 @@ if( get_schema_objectclass( $server_id, 'sambaAccount' ) == null )
 	$machine_name = trim( $_POST['machine_name'] );
 	$uid_number = trim( $_POST['uid_number'] );
 
-	dn_exists( $server_id, $container ) or
+	dn_exists( $ldapserver, $container ) or
 		pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
 	       		       "Please go back and try again." );
 	?>
diff --git a/templates/creation/new_organizationalRole.php b/templates/creation/new_organizationalRole.php
index c9f52ee..601a8b1 100644
--- a/templates/creation/new_organizationalRole.php
+++ b/templates/creation/new_organizationalRole.php
@@ -174,10 +174,10 @@ if ( !$verify ) {
 	$reg_zip = trim( $_POST['reg_zip'] );
 	$container = trim( $_POST['container'] );
 
-	dn_exists( $server_id, $container ) or
+	dn_exists( $ldapserver, $container ) or
 		pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
 			   "Please go back and try again." );
-	dn_exists( $server_id, $occupant ) or
+	dn_exists( $ldapserver, $occupant ) or
 		pla_error( "The occupant you specified (" . htmlspecialchars( $occupant ) . ") does not exist. " .
 			   "Please go back and try again." );
 	0 != strlen( $or_name ) or
diff --git a/templates/creation/new_ou_template.php b/templates/creation/new_ou_template.php
index c546bc8..922a4de 100644
--- a/templates/creation/new_ou_template.php
+++ b/templates/creation/new_ou_template.php
@@ -1,5 +1,5 @@
 
@@ -111,7 +111,7 @@ if( get_schema_objectclass( $server_id, 'sambaSamAccount' ) == null )
         $samba3_domain_sid =  trim( $_POST['samba3_domain_sid'] );
 	$samba3_computer_rid = trim( $_POST['samba3_rid'] );
 
-	dn_exists( $server_id, $container ) or
+	dn_exists( $ldapserver, $container ) or
 		pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
 	       		       "Please go back and try again." );
 	?>
diff --git a/templates/creation/new_smb3_user_template.php b/templates/creation/new_smb3_user_template.php
index 5197e43..3ee68d7 100644
--- a/templates/creation/new_smb3_user_template.php
+++ b/templates/creation/new_smb3_user_template.php
@@ -1,5 +1,5 @@
 
 
 
@@ -99,7 +99,7 @@ function autoFillSambaGroupRID( form ){ UID Number: - + (automatically determined)"; ?> @@ -232,7 +232,7 @@ function autoFillSambaGroupRID( form ){ - + 0?1:0 );?> : @@ -355,7 +355,7 @@ function autoFillSambaGroupRID( form ){ pla_error( "You cannot leave the UID number blank. Please go back and try again." ); is_numeric( $uid_number ) or pla_error( "You can only enter numeric values for the UID number field. Please go back and try again." ); - dn_exists( $server_id, $container ) or + dn_exists( $ldapserver, $container ) or pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " . "Please go back and try again." ); diff --git a/templates/creation/new_smbgroup_template.php b/templates/creation/new_smbgroup_template.php index 4686d80..a8196bd 100644 --- a/templates/creation/new_smbgroup_template.php +++ b/templates/creation/new_smbgroup_template.php @@ -1,5 +1,5 @@ @@ -200,7 +200,7 @@ function autoFillSambaGroupRID( form ){ if( '' != trim( $uid ) && ! in_array( $uid, $member_uids ) ) $member_uids[] = $uid; - dn_exists( $server_id, $container ) or + dn_exists( $ldapserver, $container ) or pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " . "Please go back and try again." ); diff --git a/templates/creation/new_smbuser_template.php b/templates/creation/new_smbuser_template.php index 9daddaa..687cd66 100644 --- a/templates/creation/new_smbuser_template.php +++ b/templates/creation/new_smbuser_template.php @@ -1,5 +1,5 @@ : - + " . $lang['t_auto_det'] . ""; ?> @@ -210,7 +210,7 @@ function autoFillHomeDir( form ) $base_dn = null; if( isset( $base_posix_groups ) ) $base_dn = $base_posix_groups; - $posix_groups = get_posix_groups( $server_id, $base_dn ); + $posix_groups = get_posix_groups( $ldapserver, $base_dn ); $posix_groups_found = ( count( $posix_groups ) ? true : false ); ?> : @@ -263,7 +263,7 @@ function autoFillHomeDir( form ) pla_error( sprintf( $lang['t_err_field_num'], $lang['t_uid_number'] ) ); is_numeric( $gid_number ) or pla_error( sprintf( $lang['t_err_field_num'], $lang['t_gid_number'] ) ); - dn_exists( $server_id, $container ) or + dn_exists( $ldapserver, $container ) or pla_error( sprintf( $lang['t_err_bad_container'], htmlspecialchars( $container ) ) ); $password = password_hash( $password1, $encryption ); diff --git a/templates/dNSDomain.xml b/templates/dNSDomain.xml new file mode 100644 index 0000000..2e20ee0 --- /dev/null +++ b/templates/dNSDomain.xml @@ -0,0 +1,29 @@ + diff --git a/templates/example.xml b/templates/example.xml new file mode 100644 index 0000000..a91d0ef --- /dev/null +++ b/templates/example.xml @@ -0,0 +1,38 @@ + diff --git a/templates/inetOrgPerson.xml b/templates/inetOrgPerson.xml new file mode 100644 index 0000000..f003404 --- /dev/null +++ b/templates/inetOrgPerson.xml @@ -0,0 +1,109 @@ + diff --git a/templates/kolabPerson.xml b/templates/kolabPerson.xml new file mode 100644 index 0000000..9c50463 --- /dev/null +++ b/templates/kolabPerson.xml @@ -0,0 +1,115 @@ + diff --git a/templates/modification/default.php b/templates/modification/default.php index c46afd2..cf7b663 100644 --- a/templates/modification/default.php +++ b/templates/modification/default.php @@ -1,5 +1,5 @@ Instance($server_id); $show_internal_attrs = isset( $_GET['show_internal_attrs'] ) ? true : false; if( null != $dn ) { $rdn = pla_explode_dn( $dn ); @@ -33,18 +38,18 @@ if( null != $dn ) { check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] . htmlspecialchars( $server_id ) ); have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); -pla_ldap_connect( $server_id ) or pla_error( $lang['could_not_connect'] ); +//pla_ldap_connect( $server_id ) or pla_error( $lang['could_not_connect'] ); $friendly_attrs = process_friendly_attr_table(); if( ! isset( $attrs ) ) - $attrs = get_object_attrs( $server_id, $dn, false, get_view_deref_setting() ); + $attrs = get_object_attrs( $ldapserver, $dn, false, get_view_deref_setting() ); -pla_ldap_connect( $server_id ) or pla_error( $lang['could_not_connect'] ); -$system_attrs = get_entry_system_attrs( $server_id, $dn, get_view_deref_setting() ); -dn_exists( $server_id, $dn ) or pla_error( sprintf( $lang['no_such_entry'], pretty_print_dn( $dn ) ) ); +//pla_ldap_connect( $server_id ) or pla_error( $lang['could_not_connect'] ); +//$system_attrs = get_entry_system_attrs( $ldapserver, $dn, get_view_deref_setting() ); NEVER USED? +dn_exists( $ldapserver, $dn ) or pla_error( sprintf( $lang['no_such_entry'], pretty_print_dn( $dn ) ) ); $server_name = $servers[$server_id]['name']; -include 'header.php'; ?> +include './header.php'; ?>

@@ -91,6 +96,10 @@ include 'header.php'; ?> + + + "> + "> @@ -101,7 +110,7 @@ include 'header.php'; ?> - 0 ) { if( $children_count == $max_children ) @@ -164,7 +173,7 @@ if( ($children_count = count( $children ) ) > 0 ) { $vals ) { + foreach( get_entry_system_attrs( $ldapserver, $dn ) as $attr => $vals ) { $counter++; $schema_href = "schema.php?server_id=$server_id&view=attributes&viewvalue=" . real_attr_name($attr); ?> @@ -176,7 +185,7 @@ if( $show_internal_attrs ) { @@ -228,7 +237,7 @@ foreach( $attrs as $attr => $vals ) { flush(); - $schema_attr = get_schema_attribute( $server_id, $attr, $dn ); + $schema_attr = get_schema_attribute( $ldapserver, $attr, $dn ); if( $schema_attr ) $attr_syntax = $schema_attr->getSyntaxOID(); else @@ -238,7 +247,7 @@ foreach( $attrs as $attr => $vals ) { continue; // has the config.php specified that this attribute is to be hidden or shown? - if( is_attr_hidden( $server_id, $attr)) + if( is_attr_hidden( $ldapserver, $attr)) continue; // Setup the $attr_note, which will be displayed to the right of the attr name (if any) @@ -257,12 +266,26 @@ foreach( $attrs as $attr => $vals ) { $required_by = ''; if( $schema_attr ) foreach( $schema_attr->getRequiredByObjectClasses() as $required ) - if( in_array( strtolower( $required ), arrayLower( $attrs['objectClass'] ) ) ) + if( isset($attrs['objectClass']) && in_array( strtolower( $required ), arrayLower( $attrs['objectClass'] ) ) ) $required_by .= $required . ' '; + + // It seems that some LDAP servers (Domino) returns attributes in lower case? + elseif( isset($attrs['objectclass']) && in_array( strtolower( $required ), arrayLower( $attrs['objectclass'] ) ) ) + $required_by .= $required . ' '; + if( $required_by ) { if( trim( $attr_note ) ) $attr_note .= ', '; - $attr_note .= "" . $lang['required'] . " "; + + $attr_note .= "" . $lang['required'] . " "; + } + + // is this attribute required because its the RDN + if (preg_match("/^${attr}=/",$rdn)) { + if( trim( $attr_note ) ) + $attr_note .= ', '; + + $attr_note .= " " . 'rdn' . " "; } ?> @@ -288,7 +311,7 @@ foreach( $attrs as $attr => $vals ) { - + () @@ -306,14 +329,14 @@ foreach( $attrs as $attr => $vals ) { /* * Is this attribute a jpegPhoto? */ - if( is_jpeg_photo( $server_id, $attr ) ) { + if( is_jpeg_photo( $ldapserver, $attr ) ) { // Don't draw the delete buttons if there is more than one jpegPhoto // (phpLDAPadmin can't handle this case yet) - if( is_server_read_only( $server_id ) || is_attr_read_only( $server_id, $attr ) ) - draw_jpeg_photos( $server_id, $dn, $attr, false ); + if( $ldapserver->isReadOnly() || is_attr_read_only( $ldapserver, $attr ) ) + draw_jpeg_photos( $ldapserver, $dn, $attr, false ); else - draw_jpeg_photos( $server_id, $dn, $attr, true ); + draw_jpeg_photos( $ldapserver, $dn, $attr, true ); // proceed to the next attribute echo "\n"; @@ -326,12 +349,18 @@ foreach( $attrs as $attr => $vals ) { /* * Is this attribute binary? */ - if( is_attr_binary( $server_id, $attr ) ) { + if( is_attr_binary( $ldapserver, $attr ) ) { + + $href = "download_binary_attr.php?server_id=$server_id&dn=$encoded_dn&attr=$attr"; ?> -
+ + +
1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?> "> ()
@@ -339,7 +368,7 @@ foreach( $attrs as $attr => $vals ) {
- + @@ -349,6 +378,7 @@ foreach( $attrs as $attr => $vals ) { '; continue; @@ -359,27 +389,59 @@ foreach( $attrs as $attr => $vals ) { * Note: at this point, the attribute must be text-based (not binary or jpeg) */ + // If we this is the userPassword attribute, add the javascript so we can call check password later. + if (! strcasecmp( $attr, 'userPassword' ) ) { + $user_password = $vals[0]; ?> + + $val ) { if( trim( $val ) == "" ) echo "[" . $lang['empty'] . "]
\n"; elseif( 0 == strcasecmp( $attr, 'userPassword' ) && obfuscate_password_display() ) echo preg_replace( '/./', '*', $val ) . "
"; - else + + elseif( in_array(strtolower($attr), $shadow_format_attrs) ) { + $shadow_date = shadow_date( $attrs, $attr); + echo htmlspecialchars($val)." "; + echo ""; + if( ($today < $shadow_date) && in_array(strtolower($attr), $shadow_before_today_attrs) ) + echo ''.htmlspecialchars("(".strftime(get_date_format(),$shadow_date).")").''; + elseif( $today > $shadow_date && in_array(strtolower($attr), $shadow_after_today_attrs) ) + echo ''.htmlspecialchars("(".strftime(get_date_format(),$shadow_date).")").''; + else + echo htmlspecialchars("(".strftime(get_date_format(),shadow_date( $attrs, $attr)).")"); + echo ""; + } else echo htmlspecialchars( $val ) . "
"; } } else { if( 0 == strcasecmp( $attr, 'userPassword' ) && obfuscate_password_display() ) echo preg_replace( '/./', '*', $vals ) . "
"; else - echo $vals . "
"; - } + echo $vals . "
"; ?> + + + + + "; echo ""; if( $is_modified_attr ) @@ -390,7 +452,7 @@ foreach( $attrs as $attr => $vals ) { /* * Is this a userPassword attribute? */ - if( 0 == strcasecmp( $attr, 'userpassword' ) ) { + if( 0 == strcasecmp( $attr, 'userpassword' ) ) { $user_password = $vals[0]; $enc_type = get_enc_type( $user_password ); @@ -422,30 +484,10 @@ foreach( $attrs as $attr => $vals ) { name="new_values[userpassword]" value="" /> - +
- @@ -454,12 +496,12 @@ foreach( $attrs as $attr => $vals ) { if( $is_modified_attr ) echo ''; continue; - } + } /* * Is this a boolean attribute? */ - if( is_attr_boolean( $server_id, $attr) ) { + if( is_attr_boolean( $ldapserver, $attr) ) { $val = $vals[0]; ?> @@ -515,7 +557,7 @@ foreach( $attrs as $attr => $vals ) { href="schema.php?server_id=&view=objectClasses&viewvalue="> type == 'structural') { echo "$val (" . @@ -532,7 +574,7 @@ foreach( $attrs as $attr => $vals ) { ?> - + $vals ) { 0 ) { echo "
"; $group = array_pop( $group ); @@ -590,9 +632,22 @@ foreach( $attrs as $attr => $vals ) { if( $description ) echo " (" . htmlspecialchars( $description ) . ")"; echo "
"; } - } + } - ?> + // Show the dates for all the shadow attributes. + if( in_array(strtolower($attr), $shadow_format_attrs) ) { + if( ( $shadow_date = shadow_date( $attrs, $attr) ) !== false ) { + echo "
"; + echo ""; + if( ($today < $shadow_date) && in_array(strtolower($attr), $shadow_before_today_attrs) ) + echo ''.htmlspecialchars(strftime(get_date_format(),$shadow_date)).''; + elseif( $today > $shadow_date && in_array(strtolower($attr), $shadow_after_today_attrs) ) + echo ''.htmlspecialchars(strftime(get_date_format(),$shadow_date)).''; + else + echo htmlspecialchars(strftime(get_date_format(),$shadow_date)); + echo ""; + } + } ?>
@@ -602,7 +657,7 @@ foreach( $attrs as $attr => $vals ) { /* Draw the "add value" link under the list of values for this attributes */ if( ! is_server_read_only( $server_id ) && - ( $schema_attr = get_schema_attribute( $server_id, $attr, $dn ) ) && + ( $schema_attr = get_schema_attribute( $ldapserver, $attr, $dn ) ) && ! $schema_attr->getIsSingleValue() ) { $add_href = "add_value_form.php?server_id=$server_id&" . diff --git a/templates/modification/group_of_names.php b/templates/modification/group_of_names.php index 4c0c921..fd0aa1a 100644 --- a/templates/modification/group_of_names.php +++ b/templates/modification/group_of_names.php @@ -1,5 +1,5 @@ "; echo " (
remove)"; - $member_cn = get_object_attr( $server_id, $member, 'cn' ); + $member_cn = get_object_attr( $ldapserver, $member, 'cn' ); $member_cn = @$member_cn[0]; - $member_sn = get_object_attr( $server_id, $member, 'sn' ); + $member_sn = get_object_attr( $ldapserver, $member, 'sn' ); $member_sn = @$member_sn[0]; echo ''; // Don't display the SN if it is a subset of the CN @@ -102,7 +102,7 @@ if( ! is_array( $members ) || 0 == count( $members ) ) { $member_sn = ' '; if( $member_sn && $member_cn ) echo '
  Name: ' . htmlspecialchars( $member_cn . ' ' . $member_sn ); - $object_classes = get_object_attr( $server_id, $member, 'objectClass' ); + $object_classes = get_object_attr( $ldapserver, $member, 'objectClass' ); if( is_array( $object_classes ) ) echo '
  objectClasses: ' . implode( ', ', $object_classes ); echo '
'; diff --git a/templates/modification/samba_account.php b/templates/modification/samba_account.php index bc6c676..5edee3d 100644 --- a/templates/modification/samba_account.php +++ b/templates/modification/samba_account.php @@ -15,11 +15,11 @@ * @author The phpLDAPadmin development team **/ -include 'header.php'; +include './header.php'; $rdn = get_rdn( $dn ); $sambaAccount = explode( '=', $rdn, 2 ); $sambaAccountRdn = $sambaAccount[1]; -$attrs = get_object_attrs( $server_id, $dn, false, get_view_deref_setting()); +$attrs = get_object_attrs( $ldapserver, $dn, false, get_view_deref_setting()); ?>

diff --git a/templates/modification/user.php b/templates/modification/user.php index 1694dac..d323b1b 100644 --- a/templates/modification/user.php +++ b/templates/modification/user.php @@ -1,5 +1,5 @@ diff --git a/templates/mozillaOrgPerson.xml b/templates/mozillaOrgPerson.xml new file mode 100644 index 0000000..bac5b29 --- /dev/null +++ b/templates/mozillaOrgPerson.xml @@ -0,0 +1,139 @@ + diff --git a/templates/organizationalRole.xml b/templates/organizationalRole.xml new file mode 100644 index 0000000..ca0444d --- /dev/null +++ b/templates/organizationalRole.xml @@ -0,0 +1,77 @@ + diff --git a/templates/ou.xml b/templates/ou.xml new file mode 100644 index 0000000..81152d1 --- /dev/null +++ b/templates/ou.xml @@ -0,0 +1,23 @@ + diff --git a/templates/posixAccount.xml b/templates/posixAccount.xml new file mode 100644 index 0000000..da1de4e --- /dev/null +++ b/templates/posixAccount.xml @@ -0,0 +1,111 @@ + diff --git a/templates/posixGroup.xml b/templates/posixGroup.xml new file mode 100644 index 0000000..4a585bc --- /dev/null +++ b/templates/posixGroup.xml @@ -0,0 +1,48 @@ + diff --git a/templates/sendmailMTAAliasObject.xml b/templates/sendmailMTAAliasObject.xml new file mode 100644 index 0000000..7a9e128 --- /dev/null +++ b/templates/sendmailMTAAliasObject.xml @@ -0,0 +1,44 @@ + diff --git a/templates/sendmailMTAClass.xml b/templates/sendmailMTAClass.xml new file mode 100644 index 0000000..74ca13b --- /dev/null +++ b/templates/sendmailMTAClass.xml @@ -0,0 +1,38 @@ + diff --git a/templates/sendmailMTACluster.xml b/templates/sendmailMTACluster.xml new file mode 100644 index 0000000..946b10f --- /dev/null +++ b/templates/sendmailMTACluster.xml @@ -0,0 +1,22 @@ + diff --git a/templates/sendmailMTAMapObject.xml b/templates/sendmailMTAMapObject.xml new file mode 100644 index 0000000..b7488dd --- /dev/null +++ b/templates/sendmailMTAMapObject.xml @@ -0,0 +1,46 @@ + + diff --git a/templates/sendmailVirtualDomain.xml b/templates/sendmailVirtualDomain.xml new file mode 100644 index 0000000..70bb41e --- /dev/null +++ b/templates/sendmailVirtualDomain.xml @@ -0,0 +1,38 @@ + diff --git a/templates/sendmailVirtualUser.xml b/templates/sendmailVirtualUser.xml new file mode 100644 index 0000000..868762b --- /dev/null +++ b/templates/sendmailVirtualUser.xml @@ -0,0 +1,46 @@ + diff --git a/templates/simpleSecurityObject.xml b/templates/simpleSecurityObject.xml new file mode 100644 index 0000000..9d25a32 --- /dev/null +++ b/templates/simpleSecurityObject.xml @@ -0,0 +1,48 @@ + diff --git a/templates/template_config.php b/templates/template_config.php index 3f713c0..4aab932 100644 --- a/templates/template_config.php +++ b/templates/template_config.php @@ -1,17 +1,17 @@ $lang['user_account'], // 'User Account (posixAccount)', + array( 'desc' => $lang['user_account'], // 'User Account (posixAccount)', 'icon' => 'images/user.png', 'handler' => 'new_user_template.php' ); // You can use the 'regexp' directive to restrict where @@ -36,122 +36,122 @@ $templates[] = //'regexp' => '^ou=People,dc=.*,dc=.*$' $templates[] = - array( 'desc' => $lang['address_book_inet'], // 'Address Book Entry (inetOrgPerson)', + array( 'desc' => $lang['address_book_inet'], // 'Address Book Entry (inetOrgPerson)', 'icon' => 'images/user.png', 'handler' => 'new_address_template.php' ); $templates[] = - array( 'desc' => $lang['address_book_moz'], // 'Address Book Entry (mozillaOrgPerson)', + array( 'desc' => $lang['address_book_moz'], // 'Address Book Entry (mozillaOrgPerson)', 'icon' => 'images/user.png', - 'handler' => 'new_mozillaOrgPerson_template.php' ); + 'handler' => 'new_mozillaOrgPerson_template.php' ); $templates[] = - array( 'desc' => $lang['kolab_user'], // 'Kolab User Entry', + array( 'desc' => $lang['kolab_user'], // 'Kolab User Entry', 'icon' => 'images/user.png', 'handler' => 'new_kolab_template.php' ); $templates[] = - array( 'desc' => $lang['organizational_unit'], // 'Organizational Unit', + array( 'desc' => $lang['organizational_unit'], // 'Organizational Unit', 'icon' => 'images/ou.png', 'handler' => 'new_ou_template.php' ); $templates[] = - array( 'desc' => $lang['organizational_role'], // 'Organizational Role', + array( 'desc' => $lang['organizational_role'], // 'Organizational Role', 'icon' => 'images/o.png', - 'handler' => 'new_organizationalRole.php' ); + 'handler' => 'new_organizationalRole.php' ); $templates[] = - array( 'desc' => $lang['posix_group'], // 'Posix Group', + array( 'desc' => $lang['posix_group'], // 'Posix Group', 'icon' => 'images/ou.png', 'handler' => 'new_posix_group_template.php' ); $templates[] = - array( 'desc' => $lang['samba_machine'], // 'Samba NT Machine', + array( 'desc' => $lang['samba_machine'], // 'Samba NT Machine', 'icon' => 'images/nt_machine.png', 'handler' => 'new_nt_machine.php' ); $templates[] = - array( 'desc' => $lang['samba3_machine'], // 'Samba 3 NT Machine', + array( 'desc' => $lang['samba3_machine'], // 'Samba 3 NT Machine', 'icon' => 'images/nt_machine.png', 'handler' => 'new_smb3_nt_machine.php' ); $templates[] = - array( 'desc' => $lang['samba3_user'], // 'Samba 3 User', + array( 'desc' => $lang['samba3_user'], // 'Samba 3 User', 'icon' => 'images/nt_user.png', 'handler' => 'new_smb3_user_template.php' ); $templates[] = - array( 'desc' => $lang['samba_user'], // 'Samba User', + array( 'desc' => $lang['samba_user'], // 'Samba User', 'icon' => 'images/nt_user.png', 'handler' => 'new_smbuser_template.php' ); $templates[] = - array( 'desc' => $lang['samba3_group'], // 'Samba 3 Group Mapping', + array( 'desc' => $lang['samba3_group'], // 'Samba 3 Group Mapping', 'icon' => 'images/ou.png', 'handler' => 'new_smbgroup_template.php' ); $templates[] = - array( 'desc' => $lang['dns_entry'], // 'DNS Entry', + array( 'desc' => $lang['dns_entry'], // 'DNS Entry', 'icon' => 'images/dc.png', 'handler' => 'new_dns_entry.php' ); $templates[] = - array( 'desc' => $lang['simple_sec_object'], // 'Simple Security Object', + array( 'desc' => $lang['simple_sec_object'], // 'Simple Security Object', 'icon' => 'images/user.png', - 'handler' => 'new_security_object_template.php' ); + 'handler' => 'new_security_object_template.php' ); $templates[] = - array( 'desc' => $lang['courier_mail_account'], // 'Courier Mail Account', + array( 'desc' => $lang['courier_mail_account'], // 'Courier Mail Account', 'icon' => 'images/mail_account.png', - 'handler' => 'new_postfix_account_template.php' ); + 'handler' => 'new_postfix_account_template.php' ); $templates[] = - array( 'desc' => $lang['courier_mail_alias'], // 'Courier Mail Alias', + array( 'desc' => $lang['courier_mail_alias'], // 'Courier Mail Alias', 'icon' => 'images/mail_alias.png', - 'handler' => 'new_postfix_alias_template.php' ); + 'handler' => 'new_postfix_alias_template.php' ); $templates[] = - array( 'desc' => $lang['ldap_alias'], // 'LDAP Alias', + array( 'desc' => $lang['ldap_alias'], // 'LDAP Alias', 'icon' => 'images/go.png', - 'handler' => 'new_alias_template.php' ); + 'handler' => 'new_alias_template.php' ); $templates[] = - array( 'desc' => $lang['sendmail_cluster'], // 'Sendmail Cluster', + array( 'desc' => $lang['sendmail_cluster'], // 'Sendmail Cluster', 'icon' => 'images/mail.png', 'handler' => 'new_sendmail_cluster_template.php' ); $templates[] = - array( 'desc' => $lang['sendmail_domain'], // 'Sendmail Domain', + array( 'desc' => $lang['sendmail_domain'], // 'Sendmail Domain', 'icon' => 'images/mail.png', 'handler' => 'new_sendmail_domain_template.php' ); $templates[] = - array( 'desc' => $lang['sendmail_alias'], // 'Sendmail Alias', + array( 'desc' => $lang['sendmail_alias'], // 'Sendmail Alias', 'icon' => 'images/mail.png', 'handler' => 'new_sendmail_alias_template.php' ); $templates[] = - array( 'desc' => $lang['sendmail_virt_dom'], // 'Sendmail Virtual Domain', + array( 'desc' => $lang['sendmail_virt_dom'], // 'Sendmail Virtual Domain', 'icon' => 'images/mail.png', 'handler' => 'new_sendmail_virthost_template.php' ); $templates[] = - array( 'desc' => $lang['sendmail_virt_users'], // 'Sendmail Virtual Users', + array( 'desc' => $lang['sendmail_virt_users'], // 'Sendmail Virtual Users', 'icon' => 'images/mail.png', 'handler' => 'new_sendmail_virtuser_template.php' ); $templates[] = - array( 'desc' => $lang['sendmail_relays'], // 'Sendmail Relays', + array( 'desc' => $lang['sendmail_relays'], // 'Sendmail Relays', 'icon' => 'images/mail.png', 'handler' => 'new_sendmail_relay_template.php' ); $templates[] = - array( 'desc' => $lang['custom'], // 'Custom', + array( 'desc' => $lang['custom'], // 'Custom', 'icon' => 'images/object.png', - 'handler' => 'custom.php' ); + 'handler' => 'custom.php' ); /*##################################################################################### ## POSIX GROUP TEMPLATE CONFIGURATION ## ## ---------------------------------- ## -## ## +## ## #####################################################################################*/ // uncomment to set the base dn of posix groups @@ -159,15 +159,13 @@ $templates[] = //$base_posix_groups="ou=People,dc=example,dc=com"; - - /*###################################################################################### ## SAMBA TEMPLATE CONFIGURATION ## ## ---------------------------- ## ## ## -## In order to use the samba templates, you might edit the following properties: ## +## In order to use the samba templates, you might edit the following properties: ## ## 1 - $mkntpwdCommand : the path to the mkntpwd utility provided with/by Samba. ## -## 2 - $samba3_domains : the domain name and the domain sid. ## +## 2 - $samba3_domains : the domain name and the domain sid. ## ## ## ######################################################################################*/ @@ -175,151 +173,162 @@ $templates[] = $mkntpwdCommand = "/usr/local/bin/mkntpwd"; // Default domains definition (Customize) -// (use `net getlocalsid` on samba server) +// (use `net getlocalsid` on samba server) $samba3_domains = array(); $samba3_domains[] = -array( 'name' => $lang['samba_domain_name'], // 'My Samba domain Name', - 'sid' => 'S-1-5-21-4147564533-719371898-3834029857' ); +array( + 'name' => $lang['samba_domain_name'], // 'My Samba domain Name', + 'sid' => 'S-1-5-21-4147564533-719371898-3834029857' +); // The base dn of samba group. (CUSTOMIZE) //$samba_base_groups = "ou=Groups,ou=samba,dc=example,dc=org"; //Definition of built-in local groups -$built_in_local_groups = array( "S-1-5-32-544" => $lang['administrators'], // "Administrators", - "S-1-5-32-545" => $lang['users'], // "Users", - "S-1-5-32-546" => $lang['guests'], // "Guests", - "S-1-5-32-547" => $lang['power_users'], // "Power Users", - "S-1-5-32-548" => $lang['account_ops'], // "Account Operators", - "S-1-5-32-549" => $lang['server_ops'], // "Server Operators", - "S-1-5-32-550" => $lang['print_ops'], // "Print Operators", - "S-1-5-32-551" => $lang['backup_ops'], // "backup Operators", - "S-1-5-32-552" => $lang['replicator'] ); // "Replicator" ); +$built_in_local_groups = array( + "S-1-5-32-544" => $lang['administrators'], // Administrators + "S-1-5-32-545" => $lang['users'], // Users + "S-1-5-32-546" => $lang['guests'], // Guests + "S-1-5-32-547" => $lang['power_users'], // Power Users + "S-1-5-32-548" => $lang['account_ops'], // Account Operators + "S-1-5-32-549" => $lang['server_ops'], // Server Operators + "S-1-5-32-550" => $lang['print_ops'], // Print Operators + "S-1-5-32-551" => $lang['backup_ops'], // backup Operators + "S-1-5-32-552" => $lang['replicator'] // Replicator +); /*###################################################################################### -## Methods used in/by templates ## -## ---------------------------- ## +## Methods used in/by templates ## +## ---------------------------- ## ######################################################################################*/ -/* - * Returns the name of the template to use based on the DN and - * objectClasses of an entry. If no specific modification - * template is available, simply return 'default'. The caller - * should append '.php' and prepend 'templates/modification/' +/** + * Return the name of the template to be used based on the object being edited. + * + * Returns the name of the template to use based on the DN and objectClasses of + * an entry. If no specific modification template is available, simply return + * 'default'. The caller should append '.php' and prepend 'templates/modification/' * to the returned string to get the file name. + * + * @param object $ldapserver Server Object the entry is in. + * @param dn $dn Entry we will need a template for. */ -function get_template( $server_id, $dn ) -{ - // fetch and lowercase all the objectClasses in an array - $object_classes = get_object_attr( $server_id, $dn, 'objectClass', true ); +function get_template( $ldapserver, $dn ) { + // fetch and lowercase all the objectClasses in an array + $object_classes = get_object_attr( $ldapserver, $dn, 'objectClass', true ); - if( $object_classes === null || $object_classes === false) - return 'default'; + if( $object_classes === null || $object_classes === false) + return 'default'; - foreach( $object_classes as $i => $class ) - $object_classes[$i] = strtolower( $class ); + foreach( $object_classes as $i => $class ) + $object_classes[$i] = strtolower( $class ); - $rdn = get_rdn( $dn ); - if( in_array( 'groupofnames', $object_classes ) || - in_array( 'groupofuniquenames', $object_classes ) ) - return 'group_of_names'; - /* - if( in_array( 'person', $object_classes ) && - in_array( 'posixaccount', $object_classes ) ) - return 'user'; - */ - // TODO: Write other templates and criteria therefor - // else if ... - // return 'some other template'; - // else if ... - // return 'some other template'; - // etc. + $rdn = get_rdn( $dn ); - return 'default'; + if( in_array( 'groupofnames', $object_classes ) || + in_array( 'groupofuniquenames', $object_classes ) ) + return 'group_of_names'; + + /* + if( in_array( 'person', $object_classes ) && + in_array( 'posixaccount', $object_classes ) ) + return 'user'; + */ + // TODO: Write other templates and criteria therefor + // else if ... + // return 'some other template'; + // else if ... + // return 'some other template'; + // etc. + + return 'default'; } /** * Return the domains info - * + * */ function get_samba3_domains(){ - global $samba3_domains; - - // do the search for the sambadomainname object here - // In the meantime, just return the domains defined in this config file - check_samba_setting(); - return $samba3_domains; -} + global $samba3_domains; + // do the search for the sambadomainname object here + // In the meantime, just return the domains defined in this config file + check_samba_setting(); + return $samba3_domains; +} /** * Utily class to get the samba passwords. + * @package phpLDAPadmin */ class MkntPasswdUtil{ + var $clearPassword = NULL; + var $sambaPassword ; - var $clearPassword = NULL; - var $sambaPassword ; - function MkntPasswdUtil(){ - $sambaPassword = array("sambaLMPassword" => NULL, - "sambaNTPassword" => NULL); - } - - function createSambaPasswords($password){ - global $mkntpwdCommand, $lang; - $this->clearPassword = $password; - file_exists ( $mkntpwdCommand ) && is_executable ( $mkntpwdCommand ) or pla_error( $lang['unable_smb_passwords'] ); - $sambaPassCommand = $mkntpwdCommand . " " . $password; - if($sambaPassCommandOutput = shell_exec($sambaPassCommand)){ - $this->sambaPassword['sambaLMPassword'] = trim( substr( $sambaPassCommandOutput , 0 , strPos( $sambaPassCommandOutput,':' ) ) ); - $this->sambaPassword['sambaNTPassword'] = trim( substr( $sambaPassCommandOutput, strPos( $sambaPassCommandOutput ,':' ) +1 ) ); - return true; - } - else{ - return false; - } - } + function MkntPasswdUtil(){ + $sambaPassword = array( + "sambaLMPassword" => NULL, + "sambaNTPassword" => NULL + ); + } - function getSambaLMPassword(){ - return $this->sambaPassword['sambaLMPassword']; - } + function createSambaPasswords($password){ + global $mkntpwdCommand, $lang; - function getSambaNTPassword(){ - return $this->sambaPassword['sambaNTPassword']; - } - - function getSambaClearPassword(){ - return $this->clearPassword; - } - - function valueOf($key){ - return $this->sambaPassword[$key]; - } + $this->clearPassword = $password; + file_exists ( $mkntpwdCommand ) && is_executable ( $mkntpwdCommand ) or pla_error( $lang['unable_smb_passwords'] ); + $sambaPassCommand = $mkntpwdCommand . " " . $password; + + if($sambaPassCommandOutput = shell_exec($sambaPassCommand)){ + $this->sambaPassword['sambaLMPassword'] = trim( substr( $sambaPassCommandOutput , 0 , strPos( $sambaPassCommandOutput,':' ) ) ); + $this->sambaPassword['sambaNTPassword'] = trim( substr( $sambaPassCommandOutput, strPos( $sambaPassCommandOutput ,':' ) +1 ) ); + return true; + + } else { + return false; + } + } + + function getSambaLMPassword(){ + return $this->sambaPassword['sambaLMPassword']; + } + + function getSambaNTPassword(){ + return $this->sambaPassword['sambaNTPassword']; + } + + function getSambaClearPassword(){ + return $this->clearPassword; + } + + function valueOf($key){ + return $this->sambaPassword[$key]; + } } function check_samba_setting(){ - global $samba3_domains; - - // check if the samba3_domains exist and is a array - ( isset($samba3_domains ) && is_array( $samba3_domains ) ) or pla_error($lang['err_smb_conf']); - //"Error: You have an error in your samba confguration."); - - // no definition for the samba domain - if(empty($samba3_domains)) - pla_error($lang['err_smb_no_name_sid']); - // "Error: A name and a sid for your samba domain need to be provided."); - else{ - // check if there is name or a sid declared for each domains - foreach($samba3_domains as $samba3_domain){ - isset($samba3_domain['name']) or pla_error($lang['err_smb_no_name']); // "Error: No name provided for samba domain."); - isset($samba3_domain['sid']) or pla_error($lang['err_smb_no_sid']); // "Error: No sid provided for samba domain."); - } - } -} + global $samba3_domains; + // check if the samba3_domains exist and is a array + ( isset($samba3_domains ) && is_array( $samba3_domains ) ) or pla_error($lang['err_smb_conf']); + + // no definition for the samba domain + if(empty($samba3_domains)) + pla_error($lang['err_smb_no_name_sid']); + + else { + // check if there is name or a sid declared for each domains + foreach ($samba3_domains as $samba3_domain) { + isset($samba3_domain['name']) or pla_error($lang['err_smb_no_name']); + isset($samba3_domain['sid']) or pla_error($lang['err_smb_no_sid']); + } + } +} ?> diff --git a/templates/template_header.php b/templates/template_header.php new file mode 100644 index 0000000..4a6d1e8 --- /dev/null +++ b/templates/template_header.php @@ -0,0 +1,212 @@ +server_id,$encoded_dn); + +$export_href_base = sprintf('export_form.php?%s&scope=%s',$url_base,'base'); +$export_href_sub = sprintf('export_form.php?%s&scope=%s',$url_base,'sub'); +$refresh_href = sprintf('edit.php?%s&random=%s',$url_base,$random_junk); +$copy_href = sprintf('copy_form.php?%s',$url_base); +$intattr_href = sprintf('edit.php?%s&show_internal_attrs=true',$url_base); +$delete_href = sprintf('delete_form.php?%s',$url_base); +$rename_href = sprintf('rename_form.php?%s',$url_base); +$compare_href = sprintf('compare_form.php?%s',$url_base); +$create_href = sprintf('create_form.php?server_id=%s&container=%s',$ldapserver->server_id,$encoded_dn); +$addattr_href = sprintf('add_attr_form.php?%s',$url_base); +?> + + + + +

+

: name; ?>     :

+ + + + + + + + + + + + + + + + + + + + + + + + + isReadOnly()) { ?> + + + + + + + + GetValue('appearance','show_hints')) { ?> + + + + + + + + + + + + + + + + + + GetValue('deref','view')); + + if (($children_count = count($children)) > 0) { + if ($children_count == $max_children) + $children_count = $children_count.'+'; + + $child_href = sprintf('search.php?server_id=%s&search=true&filter=%s&base_dn=%s&form=advanced&scope=one', + $ldapserver->server_id,rawurlencode('objectClass=*'),$encoded_dn); +?> + + + + + + + + + + + GetValue('appearance','show_hints')) { ?> + + + + + + + isReadOnly()) { ?> + + + + + + + + + + + 1) { ?> + + + + + + + + + +
+ + + +
+ + + $vals) { + $counter++; + $schema_href = sprintf('schema.php?server_id=%s&view=attributes&viewvalue=%s', + $ldapserver->server_id,real_attr_name($attr)); +?> + + + + + + + + + +\n"; + } + + flush(); ?> + + + + isReadOnly()) { ?> + + + + + +

+

: name; ?>     :

+ + diff --git a/timeout.php b/timeout.php new file mode 100644 index 0000000..e588362 --- /dev/null +++ b/timeout.php @@ -0,0 +1,39 @@ +session_timeout ? $ldapserver->session_timeout : session_cache_expire()-1; +?> + +

name; ?>

+
+
+
+ +
+
+
+ +
+ + + diff --git a/timeout_functions.php b/timeout_functions.php new file mode 100644 index 0000000..a12f9be --- /dev/null +++ b/timeout_functions.php @@ -0,0 +1,92 @@ +server_id),2); + + $_SESSION['activity']['server'][$ldapserver->server_id] = time(); + $_SESSION['activity']['rightframe_server_id'] = $ldapserver->server_id; + return true; +} + +/** + * Remove the session-var "lastactivity_X" set by update_lastactivity() + * where X is the * ID of the server + * + * @param object $ldapserver The LDAPServer object of the server which the user has logged in. + */ +function unset_lastactivity( $ldapserver ) { + debug_log(sprintf('unset_lastactivity(): Entered with (%s)',$ldapserver->server_id),2); + + if (isset($_SESSION['activity']['server'][$ldapserver->server_id])) { + unset($_SESSION['activity']['server'][$ldapserver->server_id]); + session_write_close(); + } +} + + +/** + * Check if custom session timeout has been reached for server $ldapserver. + * If it has: + * - automatically log out user by calling unset_login_dn( $server_id ) + * - if $server_id is equal to right frame $server_id, load timeout.php page in the right frame + * - return true + * + * @param object $ldapserver The LDAPServer object of the server which the user has logged in. + * @return bool true on success, false on failure. + */ +function session_timed_out( $ldapserver ) { + debug_log(sprintf('session_timed_out(): Entered with (%s)',$ldapserver->server_id),2); + + global $lang; + + # If session hasn't expired yet + if( isset( $_SESSION[ 'activity' ]['server'][$ldapserver->server_id] ) ) { + + // If $session_timeout not defined, use ( session_cache_expire() - 1 ) + if (! isset($ldapserver->session_timeout)) + $session_timeout = session_cache_expire()-1; + else + $session_timeout = $ldapserver->session_timeout; + + // Get the $last_activity and $rightframe_server_id value + $last_activity = $_SESSION['activity']['server'][$ldapserver->server_id]; + $rightframe_server_id = $_SESSION['activity']['rightframe_server_id']; + + // If diff between current time and last activity greater than $session_timeout, log out user + if ( ( time()-$last_activity ) > ( $session_timeout*60 ) ) { + + if( in_array($ldapserver->auth_type, array('cookie','session')) ) { + syslog_notice ( "Logout for " . get_logged_in_dn( $ldapserver ) ); + unset_login_dn( $ldapserver ) or pla_error( $lang['could_not_logout'] ); + } + + // If $ldapserver->server_id equal $rightframe_server_id load timeout page on right frame + if ( $ldapserver->server_id == $rightframe_server_id ) { ?> + + + _, so if I wanted to scroll to - * dc=example,dc=com for server 3, the URL would be: + * in config.php. + * + * We read the session variable 'tree' to know which dns are expanded or collapsed. + * No query string parameters are expected, however, you can use a '#' offset to + * scroll to a given dn. The syntax is tree.php#_, so + * if I wanted to scroll to dc=example,dc=com for server 3, the URL would be: + * * tree.php#3_dc%3Dexample%2Cdc%3Dcom + * + * @package phpLDAPadmin + * @author The phpLDAPadmin development team + */ +/** */ require './common.php'; @@ -31,8 +37,36 @@ initialize_session_tree(); $tree = $_SESSION['tree']; $tree_icons = $_SESSION['tree_icons']; -// Close the session for faster page loading (we're done with session data anyway). -pla_session_close(); +// Test to see if any have timedout. +// Initialize array of recently timed out servers +$recently_timed_out_servers = array(); +// Set a default META REFRESH value in sec. before determining it +$meta_refresh_variable = ( session_cache_expire()-1 )*60; + +foreach( $ldapservers->GetServerList() as $server_id ) { + $ldapserver = $ldapservers->Instance($server_id); + + # Test to see if we should log out the user due to the timeout. + if ($ldapserver->haveAuthInfo()) { + + /* If time out value has been reached: + - log out user + - put $server_id in array of recently timed out servers */ + if (session_timed_out($ldapserver)) + array_push($recently_timed_out_servers, $server_id); + + /* if the timeout value is less than the previous $meta_refresh_variable value + set $meta_refresh_variable to $ldapserver->session_timeout */ + if (($ldapserver->session_timeout*60) < $meta_refresh_variable ) + $meta_refresh_variable = $ldapserver->session_timeout*60; + } +} + +/* Close the session for faster page loading (we're done with session data anyway). + Unfortunately, now that we dont show a plus '+' for leafs in a tree, we need to keep + the session open, so that if we create an entry, it'll cause the refresh of the tree view. + Hope this doesnt affect performance...? */ +// pla_session_close(); include './header.php'; ?> @@ -49,24 +83,25 @@ include './header.php';

phpLDAPadmin -

-
+ + + + +
+ 1) { + for ($i = 1; $i <= count($vals); $i++) { ?> + + () +
+ + +
+ \n"; + } + } +?> +
+
(" . $lang['no_internal_attributes'] . ")
- +
- - - - - - - - - - - - - - + + + + + + +GetValue('appearance','hide_configuration_management') ) { ?> + + + + + + + + + @@ -74,34 +109,32 @@ include './header.php';
<?php echo $lang['light']; ?><?php echo $lang['bug']; ?>
<?php echo $lang['donate']; ?><?php echo $lang['purge_cache']; ?>
<?php echo $lang['home']; ?><?php echo $lang['purge_cache']; ?>
<?php echo $lang['light']; ?><?php echo $lang['bug']; ?>
<?php echo $lang['donate']; ?> <?php echo $lang['help']; ?>
- $server_tree ) { +# For each of the configured servers +foreach( $ldapservers->GetServerList() as $server_id ) { + $ldapserver = $ldapservers->Instance($server_id); - $is_visible = ( ! isset( $servers[ $server_id ][ 'visible' ] ) - || ( $servers[ $server_id ][ 'visible' ] === true ) ); - if( isset( $servers[ $server_id ] ) - && trim( $servers[ $server_id ][ 'host' ] ) != '' - && $is_visible ) - { - $filename = get_custom_file( $server_id, 'tree_functions.php' ); - require_once( $filename ); + if ($ldapserver->isVisible()) { + $filename = get_custom_file($server_id,'tree_functions.php',LIBDIR); + require_once($filename); - call_custom_function( $server_id, 'draw_server_tree' ); + call_custom_function($server_id,'draw_server_tree'); } } +# Case where user not logged into any server +if ($meta_refresh_variable == 0) + $meta_refresh_variable = (session_cache_expire()-1)*60; + ?> + +
-"; print_r( $tree ); -?> - @@ -110,21 +143,23 @@ exit; /** * Recursively descend on the given dn and draw the tree in html + * + * @param dn $dn Current dn. + * @param object $LDAPServer LDAPServer object + * @param int $level Level to start drawing (defaults to 0) */ -function draw_tree_html( $dn, $server_id, $level = 0 ) -{ - global $servers, $tree, $tree_icons, $lang, $search_result_size_limit; - $id = $server_id; +function draw_tree_html($dn,$ldapserver,$level=0) { + global $config, $tree, $tree_icons, $lang; $encoded_dn = rawurlencode( $dn ); - $expand_href = "expand.php?server_id=$id&dn=$encoded_dn"; - $collapse_href = "collapse.php?server_id=$id&dn=$encoded_dn"; - $edit_href = "edit.php?server_id=$id&dn=$encoded_dn"; + $expand_href = sprintf("expand.php?server_id=%s&dn=%s",$ldapserver->server_id,$encoded_dn); + $collapse_href = sprintf("collapse.php?server_id=%s&dn=%s",$ldapserver->server_id,$encoded_dn); + $edit_href = sprintf("edit.php?server_id=%s&dn=%s",$ldapserver->server_id,$encoded_dn); // should never happen, but just in case - if( ! isset( $tree_icons[ $server_id ][ $dn ] ) ) - $tree_icons[ $server_id ][ $dn ] = get_icon( $server_id, $dn ); - $img_src = 'images/' . $tree_icons[ $server_id ][ $dn ]; + if( ! isset( $tree_icons[ $ldapserver->server_id ][ $dn ] ) ) + $tree_icons[ $ldapserver->server_id ][ $dn ] = get_icon( $ldapserver, $dn ); + $img_src = 'images/' . $tree_icons[ $ldapserver->server_id ][ $dn ]; $rdn = get_rdn( $dn ); @@ -135,48 +170,72 @@ function draw_tree_html( $dn, $server_id, $level = 0 ) } // Shall we draw the "mass-delete" checkbox? - if( mass_delete_enabled( $server_id ) ) { - echo " - - \n"; + if( $ldapserver->isMassDeleteEnabled() ) { + printf('',htmlspecialchars($dn)); } // is this node expanded? (deciding whether to draw "+" or "-") - if( isset( $tree[$server_id][$dn] ) ) { ?> + if( isset( $tree[$ldapserver->server_id][$dn] ) ) { ?> + server_id][$dn] ) ); + if ((! $child_count) && (! $ldapserver->isShowCreateEnabled())) { ?> + + + - + + + + - - + GetValue('search','size_limit'); + + if( $ldapserver->isLowBandwidth() ) { + $child_count = null; + } else { + $child_count = count( get_container_contents( $ldapserver, $dn, $size_limit+1, + '(objectClass=*)', $config->GetValue('deref','tree'))); + + if( $child_count > $size_limit ) + $child_count = $size_limit . '+'; + } + + if (($child_count === 0) && (! $ldapserver->isShowCreateEnabled())) { + // Since we know the tree is empty, we'll create a $tree object anyway, just incase we + // create something later (otherwise it doesnt cause the tree to get refreshed). + + $_SESSION['tree'][$ldapserver->server_id][$dn] = array(); + $_SESSION['tree_icons'][$ldapserver->server_id][$dn] = get_icon( $ldapserver, $dn ); ?> + + + + - + + + + + - $limit ) - $child_count = $limit . '+'; - } - } ?> + img + name="server_id; ?>_">img + target="right_frame"> () @@ -184,40 +243,52 @@ function draw_tree_html( $dn, $server_id, $level = 0 ) - 10 ) - if( show_create_enabled( $server_id ) ) - draw_create_link( $server_id, $rdn, $level, $encoded_dn ); - foreach( $tree[$server_id][$dn] as $dn ) - draw_tree_html( $dn, $server_id, $level+1 ); - // Always draw the "create new" link at the bottom of the listing - if( show_create_enabled( $server_id ) ) - draw_create_link( $server_id, $rdn, $level, $encoded_dn ); + if( isset( $tree[$ldapserver->server_id][$dn] ) && is_array( $tree[$ldapserver->server_id][$dn] ) ) { + // Draw the "create new" link at the top of the tree list if there are more than 10 + // entries in the listing for this node. + + if(( count( $tree[$ldapserver->server_id][$dn] ) > 10 ) && ( $ldapserver->isShowCreateEnabled() )) + draw_create_link( $ldapserver->server_id, $rdn, $level, $encoded_dn ); + + foreach( $tree[$ldapserver->server_id][$dn] as $dn ) + draw_tree_html( $dn, $ldapserver, $level+1 ); + + // Always draw the "create new" link at the bottom of the listing + if( $ldapserver->isShowCreateEnabled() ) + draw_create_link( $ldapserver->server_id, $rdn, $level, $encoded_dn ); } } +/** + * Print the HTML to show the "create new entry here". + * + * @param int $server_id + * @param dn $rdn + * @param int $level + * @param dn $encoded_dn + */ function draw_create_link( $server_id, $rdn, $level, $encoded_dn ) { - global $lang; - // print the "Create New object" link. - $create_html = ""; - $create_href = "create_form.php?server_id=$server_id&container=$encoded_dn"; - $create_html .= ''; - for( $i=0; $i<=$level; $i++ ) { - $create_html .= ''; - } - $create_html .= ''; - $create_html .= '' . $lang['new'] . ''; - $create_html .= '' . - $lang['create_new'] . ''; - $create_html .= ''; - echo $create_html; + global $lang; + + // print the "Create New object" link. + $create_href = sprintf("create_form.php?server_id=%s&container=%s",$server_id,$encoded_dn); + + $create_html = ''; + for( $i=0; $i<=$level; $i++ ) { + $create_html .= ''; + } + + $create_html .= ''; + $create_html .= '' . $lang['new'] . ''; + $create_html .= '' . + $lang['create_new'] . ''; + $create_html .= ''; + echo $create_html; } ?> diff --git a/tree_functions.php b/tree_functions.php index 90e0b24..9e25210 100644 --- a/tree_functions.php +++ b/tree_functions.php @@ -1,112 +1,146 @@ _, so if I wanted to scroll to - * dc=example,dc=com for server 3, the URL would be: + * dc=example,dc=com for server 3, the URL would be: * tree.php#3_dc%3Dexample%2Cdc%3Dcom */ -function draw_server_tree() -{ - global $server_id; - global $servers; +function draw_server_tree() { + debug_log(sprintf('draw_server_tree(): Entered with ()'),2); + global $lang; global $tree; global $tree_icons; + global $ldapserver; + global $recently_timed_out_servers; + global $config; + + $server_id = $ldapserver->server_id; // Does this server want mass deletion availble? - if( mass_delete_enabled( $server_id ) ) { - echo "\n"; - echo "\n"; + if ($ldapserver->isMassDeleteEnabled()) { + print ''; + printf('',$ldapserver->server_id); } - $server_name = $servers[$server_id]['name']; - echo ''; - echo '' . $lang['server'] . ''; - echo ''; - echo '' . htmlspecialchars( $server_name ) . ''; - echo ''; + print ''; + printf('%s',$lang['server']); + printf('',$ldapserver->server_id); + printf('%s ',htmlspecialchars($ldapserver->name)); + + if ($ldapserver->haveAuthInfo() && $ldapserver->session_timeout) + printf('timeout', + sprintf($lang['timeout_at'],strftime('%H:%M',time()+($ldapserver->session_timeout*60)))); + + print ''; // do we have what it takes to authenticate here, or do we need to // present the user with a login link (for 'cookie' and 'session' auth_types)? - if( have_auth_info( $server_id ) ) { - if( ! pla_ldap_connection_is_error( pla_ldap_connect( $server_id ), false ) ) { - $schema_href = 'schema.php?server_id=' . $server_id . '" target="right_frame'; - $search_href = 'search.php?server_id=' . $server_id . '" target="right_frame'; - $refresh_href = 'refresh.php?server_id=' . $server_id; - $create_href = 'create_form.php?server_id=' . $server_id . '&container=' . - rawurlencode( $servers[$server_id]['base'] ); - $logout_href = get_custom_file( $server_id, 'logout.php') . '?server_id=' . $server_id; - $info_href = 'server_info.php?server_id=' . $server_id; - $import_href = 'ldif_import_form.php?server_id=' . $server_id; - $export_href = 'export_form.php?server_id=' . $server_id; - - // Draw the quick-links below the server name: + if ($ldapserver->haveAuthInfo()) { + if ($ldapserver->connect(false)) { + $schema_href = sprintf('schema.php?server_id=%s" target="right_frame',$ldapserver->server_id); + $search_href = sprintf('search.php?server_id=%s" target="right_frame',$ldapserver->server_id); + $refresh_href = sprintf('refresh.php?server_id=%s',$ldapserver->server_id); + $logout_href = get_custom_file($ldapserver->server_id,'logout.php','').'?server_id='.$ldapserver->server_id; + $info_href = sprintf('server_info.php?server_id=%s',$ldapserver->server_id); + $import_href = sprintf('ldif_import_form.php?server_id=%s',$ldapserver->server_id); + $export_href = sprintf('export_form.php?server_id=%s',$ldapserver->server_id); + + // Draw the quick-links below the server name: // ( schema | search | refresh | create ) echo ''; echo ''; echo '( '; - echo '' . $lang['schema'] . ' | '; - echo '' . $lang['search'] . ' | '; - echo '' . $lang['refresh'] . ' | '; - if (show_create_enabled($server_id)) - echo '' . $lang['create'] . ' | '; + +// if ($ldapserver->isShowCreateEnabled()) +// echo '' . $lang['create'] . ' | '; + echo '' . $lang['info'] . ' | '; echo '' . $lang['import'] . ' | '; - echo '' . $lang['export_lcase'] . ''; - if( $servers[ $server_id ][ 'auth_type' ] != 'config' ) - echo ' | ' . $lang['export_lcase'] . ''; + + if( $ldapserver->auth_type != 'config' ) + echo ' | ' . $lang['logout'] . ''; + echo ' )'; - if( $servers[$server_id]['auth_type'] != 'config' ) { - $logged_in_dn = get_logged_in_dn( $server_id ); + if ($ldapserver->auth_type != 'config') { + $logged_in_dn = get_logged_in_dn( $ldapserver ); echo "" . $lang['logged_in_as']; - if( strcasecmp( "anonymous", $logged_in_dn ) ) - echo "" . - pretty_print_dn( $logged_in_dn ) . ""; - else + + if (dn_get_base($ldapserver,$logged_in_dn) == $logged_in_dn) { + $logged_in_branch = ''; + $logged_in_dn_array = array(); + } else { + $logged_in_branch = preg_replace("/,".dn_get_base($ldapserver,$logged_in_dn)."$/","",$logged_in_dn); + $logged_in_dn_array = explode(',',$logged_in_branch); + } + $logged_in_dn_array[] = dn_get_base($ldapserver,$logged_in_dn); + + $rdn = $logged_in_dn; + + if (strcasecmp("anonymous",$logged_in_dn)) { + foreach ($logged_in_dn_array as $rdn_piece) { + printf('%s', + $server_id,rawurlencode($rdn),pretty_print_dn($rdn_piece)); + + if ($rdn_piece != end($logged_in_dn_array)) + echo ','; + + $rdn = substr($rdn,(1 + strpos($rdn,','))); + } + + } else echo "Anonymous"; + echo ""; } - if( is_server_read_only( $server_id ) ) + + if( $ldapserver->isReadOnly() ) echo "" . "(" . $lang['read_only'] . ")"; - // Fetch and display the base DN for this server - if( null == $servers[ $server_id ]['base'] ) - $base_dn = try_to_get_root_dn( $server_id ); - else - $base_dn = $servers[ $server_id ]['base']; - - // Did we get a base_dn for this server somehow? - if( $base_dn ) { - echo "\n\n\n\n"; + $javascript_forms = ''; + $javascript_id = 0; + foreach ($ldapserver->getBaseDN() as $base_dn) { + // Did we get a base_dn for this server somehow? + if ($base_dn) { + echo "\n\n\n\n"; - // is the root of the tree expanded already? - if( isset( $tree[$server_id][$base_dn] ) ) { - $expand_href = "collapse.php?server_id=$server_id&" . - "dn=" . rawurlencode( $base_dn ); - $expand_img = "images/minus.png"; - $expand_alt = "-"; - $child_count = number_format( count( $tree[$server_id][$base_dn] ) ); - } else { - // Check if the LDAP server is not yet initialized - // (ie, the base DN configured in config.php does not exist) - if( ! dn_exists( $server_id, $base_dn ) ) { - $create_base_href = "creation_template.php?template=custom&server_id=$server_id"; - ?> + // is the root of the tree expanded already? + if( isset( $tree[$ldapserver->server_id][$base_dn] ) ) { + $expand_href = sprintf('collapse.php?server_id=%s&dn=%s', + $ldapserver->server_id,rawurlencode( $base_dn )); + $expand_img = "images/minus.png"; + $expand_alt = "-"; + $child_count = number_format( count( $tree[$ldapserver->server_id][$base_dn] ) ); + + } else { + // Check if the LDAP server is not yet initialized + // (ie, the base DN configured in config.php does not exist) + if( ! dn_exists( $ldapserver, $base_dn ) ) { + $javascript_id++; + ?> @@ -114,114 +148,108 @@ function draw_server_tree() - - - - - - + ',$javascript_id); + $javascript_forms .= sprintf(''); + $javascript_forms .= sprintf('',$ldapserver->server_id); + $javascript_forms .= sprintf(''); + $javascript_forms .= sprintf('',htmlspecialchars($base_dn)); + $javascript_forms .= sprintf(''); ?> - +
+ server_id,rawurlencode( $base_dn )); + $expand_img = "images/plus.png"; + $expand_alt = "+"; + $size_limit = $config->GetValue('search','size_limit'); - return; - } else { - $expand_href = "expand.php?server_id=$server_id&" . - "dn=" . rawurlencode( $base_dn ); - $expand_img = "images/plus.png"; - $expand_alt = "+"; - $limit = isset( $search_result_size_limit ) ? $search_result_size_limit : 50; - if( is_server_low_bandwidth( $server_id ) ) { - $child_count = null; - } else { - $child_count = count( get_container_contents( - $server_id, $base_dn, $limit+1, - '(objectClass=*)', get_tree_deref_setting() ) ); - if( $child_count > $limit ) - $child_count = $limit . '+'; - } - } + if( $ldapserver->isLowBandwidth() ) { + $child_count = null; + + } else { + $child_count = count( get_container_contents( + $ldapserver, $base_dn, $size_limit+1, + '(objectClass=*)', $config->GetValue('deref','tree') ) ); + + if( $child_count > $size_limit ) + $child_count = $size_limit . '+'; + } + } + } + + $create_href = sprintf('create_form.php?server_id=%s&container=%s',$ldapserver->server_id, + rawurlencode( $base_dn )); + + $edit_href = sprintf("edit.php?server_id=%s&dn=%s",$ldapserver->server_id,rawurlencode( $base_dn )); + + $icon = isset( $tree_icons[ $ldapserver->server_id ][ $base_dn ] ) + ? $tree_icons[ $ldapserver->server_id ][ $base_dn ] + : get_icon( $ldapserver, $base_dn ); + + // Shall we draw the "mass-delete" checkbox? + if( $ldapserver->isMassDeleteEnabled() ) { + echo "\n"; + } + + echo ""; + echo "\"$expand_alt\""; + echo ""; + echo "\"img\"\n"; + echo "" . pretty_print_dn( $base_dn ) . ''; + if( $child_count ) + echo " ($child_count)"; + echo "\n"; + echo "\n"; + + if( $ldapserver->isShowCreateEnabled() && isset( $tree[ $ldapserver->server_id ][ $base_dn ]) + && count( $tree[ $ldapserver->server_id ][ $base_dn ] ) > 10 ) + draw_create_link( $ldapserver->server_id, $base_dn, -1, urlencode( $base_dn )); + + } else { // end if( $base_dn ) + + # The server refuses to give out the base dn + printf('%s
%s
%s
', + $lang['could_not_determine_root'],$lang['ldap_refuses_to_give_root'],$lang['please_specify_in_config']); + + # Proceed to the next server. We cannot draw anything else for this server. + continue; } - - $edit_href = "edit.php?server_id=$server_id&dn=" . rawurlencode( $base_dn ); - $icon = isset( $tree_icons[ $server_id ][ $base_dn ] ) - ? $tree_icons[ $server_id ][ $base_dn ] - : get_icon( $server_id, $base_dn ); + flush(); - // Shall we draw the "mass-delete" checkbox? - if( mass_delete_enabled( $server_id ) ) { - echo "\n"; - } - - echo ""; - echo "\"$expand_alt\""; - echo ""; - echo "\"img\"\n"; - echo "" . pretty_print_dn( $base_dn ) . ''; - if( $child_count ) - echo " ($child_count)"; - echo "\n"; - echo "\n"; + // Is the root of the tree expanded already? + if( isset( $tree[$ldapserver->server_id][$base_dn] ) && is_array( $tree[$ldapserver->server_id][$base_dn] ) ) { + foreach( $tree[ $ldapserver->server_id ][ $base_dn ] as $child_dn ) + draw_tree_html( $child_dn, $ldapserver, 0 ); - if( show_create_enabled( $server_id ) && isset( $tree[ $server_id ][ $base_dn ]) - && count( $tree[ $server_id ][ $base_dn ] ) > 10 ) - draw_create_link( $server_id, $base_dn, -1, urlencode( $base_dn )); - - } else { // end if( $base_dn ) - - if( "" === $base_dn || null === $base_dn ) { - // The server refuses to give out the base dn - echo ""; - echo $lang['could_not_determine_root']; - echo '
'; - echo $lang['ldap_refuses_to_give_root']; - echo '
'; - echo $lang['please_specify_in_config']; - echo "
"; - // Proceed to the next server. We cannot draw anything else for this server. - return; - } else { - // For some unknown reason, we couldn't determine the base dn - echo ""; - echo $lang['could_not_determine_root']; - echo '
'; - echo $lang['please_specify_in_config']; - echo "
"; - // Proceed to the next server. We cannot draw anything else for this server. - return; - } - } - - flush(); - - // Is the root of the tree expanded already? - if( isset( $tree[$server_id][$base_dn] ) && is_array( $tree[$server_id][$base_dn] ) ) { - foreach( $tree[ $server_id ][ $base_dn ] as $child_dn ) - draw_tree_html( $child_dn, $server_id, 0 ); - if( ! is_server_read_only( $server_id ) ) { - echo ''; - if( show_create_enabled( $server_id ) ) { - echo '' . 
-							$lang['new'] . ''; - echo '' . $lang['create_new'] . ''; + if( ! $ldapserver->isReadOnly() ) { + echo ''; + if( $ldapserver->isShowCreateEnabled() ) { + echo '' .
+								$lang['new'] . ''; + echo '' . $lang['create_new'] . ''; + } } } } - } else { // end if( pla_ldap_connect( $ds ) ) + } else { // end if( $ldapserver->connect(false) ) // could not connect to LDAP server echo "\n"; echo "\n"; @@ -229,8 +257,8 @@ function draw_server_tree() echo "" . $lang['could_not_connect'] . "\n"; echo "\n"; - if( $servers[ $server_id ][ 'auth_type' ] != 'config' ) { - $logout_href = get_custom_file( $server_id, 'logout.php') . '?server_id=' . $server_id; + if( $ldapserver->auth_type != 'config' ) { + $logout_href = get_custom_file( $ldapserver->server_id, 'logout.php','') . '?server_id=' . $ldapserver->server_id; echo "\n"; echo "\n"; echo "\n"; @@ -242,23 +270,30 @@ function draw_server_tree() return; } - } else { // end if have_auth_info( $server_id ) + } else { // end if $ldapserver->haveAuthInfo() // We don't have enough information to login to this server // Draw the "login..." link - $login_href = get_custom_file( $server_id, 'login_form.php' ) . "?server_id=$server_id"; + $login_href = get_custom_file( $ldapserver->server_id, 'login_form.php','' ) . "?server_id=$server_id"; echo ''; echo ''; echo ''; echo '' . $lang['login'] . ''; echo '' . $lang['login_link'] . ''; echo ''; + // If the server recently timed out display the message + if ( in_array($ldapserver->server_id,$recently_timed_out_servers) ) + echo '' . $lang['session_timed_out_tree'] . ''; } - - if( mass_delete_enabled( $server_id ) ) { + + if( $ldapserver->isMassDeleteEnabled() ) { echo "\n"; echo "\n"; echo "\n"; } + if (isset($javascript_forms) && $javascript_forms) { + echo "\n"; + echo $javascript_forms; + echo "\n"; + } } - ?> diff --git a/unit_test.php b/unit_test.php index e9e5838..1ffc0ef 100644 --- a/unit_test.php +++ b/unit_test.php @@ -1,6 +1,11 @@ \n"; echo "Should be dc=com: "; echo get_rdn( "dc=com" ); @@ -91,7 +96,7 @@ if( false ) { // testing get_container() if( false ) { echo "Should be ou=People-copy1,ou=People-copy2,ou=People2,dc=example,dc=com: "; - var_dump( get_container( "uid=bäb,ou=People-copy1,ou=People-copy2,ou=People2,dc=example,dc=com" ) ); + var_dump( get_container( "uid=bäb,ou=People-copy1,ou=People-copy2,ou=People2,dc=example,dc=com" ) ); echo "
\n"; echo "Should be null: "; var_dump( get_container( "dc=com" ) ); @@ -141,4 +146,5 @@ if( true ) { } } +print password_generate(); ?> diff --git a/update.php b/update.php index 87c312f..74f37fb 100644 --- a/update.php +++ b/update.php @@ -1,11 +1,9 @@ ''. For example, to * delete the 'sn' attribute from an entry, the update array would look like this: * Array ( * sn => '' - * ) + * ) * - * On success, redirect to edit.php - * On failure, echo an error. + * On success, redirect to edit.php. On failure, echo an error. + * + * @package phpLDAPadmin + */ +/** */ -require realpath( 'common.php' ); +require './common.php'; - -$server_id = $_POST['server_id']; - -if( is_server_read_only( $server_id ) ) - pla_error( $lang['no_updates_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']); $dn = $_POST['dn']; -$encoded_dn = rawurlencode( $dn ); -$update_array = $_POST['update_array']; +$encoded_dn = rawurlencode($dn); +$update_array = isset($_POST['update_array']) ? $_POST['update_array'] : array(); +is_array($update_array) or pla_error($lang['update_array_malformed']); -check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); -have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); -is_array( $update_array ) or pla_error( $lang['update_array_malformed'] ); -$ds = pla_ldap_connect( $server_id ); -pla_ldap_connection_is_error( $ds ); +$failed_attrs = array(); -// check for delete attributes (indicated by the attribute entry appearing like this: attr => '' -foreach( $update_array as $attr => $val ) - if( ! is_array( $val ) ) - if( $val == '' ) +run_hook ('pre_update',array ('server_id' => $ldapserver->server_id, + 'dn' => $dn,'update_array' => $update_array)); + +// check for delete attributes (indicated by the attribute entry appearing like this: attr => '' +foreach ($update_array as $attr => $val) + if (! is_array($val)) + if ($val == '') $update_array[ $attr ] = array(); else $update_array[ $attr ] = $val; else - foreach( $val as $i => $v ) + foreach ($val as $i => $v) $update_array[ $attr ][ $i ] = $v; - -// Call the custom callback for each attribute modification + +// Call the custom callback for each attribute modification // and verify that it should be modified. -foreach( $update_array as $attr_name => $val ) { +foreach ($update_array as $attr_name => $val) { // Check to see if this is a unique Attribute - if( $badattr = checkUniqueAttr( $server_id, $dn, $attr_name, $val ) ) { - $search_href='search.php?search=true&form=advanced&server_id=' . $server_id . '&filter=' . $attr_name . '=' . $badattr; - pla_error(sprintf( $lang['unique_attr_failed'] , $attr_name,$badattr,$dn,$search_href ) ); + if ($badattr = checkUniqueAttr($ldapserver,$dn,$attr_name,$val)) { + $search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s',$ldapserver->server_id,$attr_name,$badattr); + pla_error(sprintf($lang['unique_attr_failed'],$attr_name,$badattr,$dn,$search_href)); } - if( true !== preAttrModify( $server_id, $dn, $attr_name, $val ) ) - unset( $update_array[ $attr_name ] ); - elseif( is_attr_read_only( $server_id, $attr ) ) - pla_error( sprintf( $lang['attr_is_read_only'], htmlspecialchars( $attr_name ) ) ); + if (true !== run_hook ('pre_attr_modify',array ('server_id' => $ldapserver->server_id, + 'dn' => $dn,'attr_name' => $attr_name,'new_value' => $val))) { + + unset($update_array[ $attr_name ]); + $failed_attrs[$attr_name] = $val; + } + + elseif (is_attr_read_only($ldapserver,$attr)) + pla_error(sprintf($lang['attr_is_read_only'],htmlspecialchars($attr_name))); } -$ds = pla_ldap_connect( $server_id ); -$res = @ldap_modify( $ds, $dn, $update_array ); -if( $res ) -{ +$res = @ldap_modify($ldapserver->connect(),$dn,$update_array); +if ($res) { // Fire the post modification event to the user's custom // callback function. - foreach( $update_array as $attr_name => $val ) { - postAttrModify( $server_id, $dn, $attr_name, $val ); + foreach ($update_array as $attr_name => $val) { + run_hook ('post_attr_modify',array('server_id' => $ldapserver->server_id, + 'dn' => $dn,'attr_name' => $attr_name,'new_value' => $val)); // Was this a user's password modification who is currently // logged in? If so, they need to logout and log back in // with the new password. - if( 0 === strcasecmp( $attr_name, 'userPassword' ) && - check_server_id( $server_id ) && - isset( $servers[ $server_id ][ 'auth_type' ] ) && - ( $servers[ $server_id ][ 'auth_type' ] == 'cookie' || - $servers[ $server_id ][ 'auth_type' ] == 'session' ) && - 0 === pla_compare_dns( get_logged_in_dn( $server_id ), $dn ) ) - { - unset_login_dn( $server_id ); - include realpath( 'header.php' ); + if (0 === strcasecmp($attr_name,'userPassword') && + in_array($ldapserver->auth_type,array('cookie','session')) && + 0 === pla_compare_dns(get_logged_in_dn($ldapserver),$dn)) { + unset_login_dn($ldapserver); + unset_lastactivity($ldapserver); + include './header.php'; ?>