From 5f261ded3877250ce99d735c2bd3011b1ff5e67c Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 30 Jun 2009 20:40:33 +1000 Subject: [PATCH] RELEASE 1.0.1 --- htdocs/compare_form.php | 105 +++++++++---------- htdocs/copy_form.php | 35 +++++-- htdocs/delete_form.php | 191 +++++++++++++++++----------------- htdocs/header.php | 7 +- htdocs/index.php | 13 ++- htdocs/rename_form.php | 4 +- htdocs/search.php | 6 +- htdocs/server_info.php | 9 +- htdocs/template_engine.php | 83 ++++++++------- htdocs/update_confirm.php | 15 ++- lib/createlm.php | 28 ++++- lib/functions.php | 21 ++-- lib/schema_functions.php | 3 +- lib/server_functions.php | 9 +- lib/template_functions.php | 4 +- lib/tree_functions.php | 14 ++- templates/creation/custom.php | 8 +- templates/template_header.php | 32 +++--- 18 files changed, 326 insertions(+), 261 deletions(-) diff --git a/htdocs/compare_form.php b/htdocs/compare_form.php index 4fda703..c95fee6 100644 --- a/htdocs/compare_form.php +++ b/htdocs/compare_form.php @@ -1,5 +1,5 @@ haveAuthInfo()) - pla_error( _('Not enough information to login to server. Please check your configuration.') ); +if (! $ldapserver->haveAuthInfo()) + pla_error(_('Not enough information to login to server. Please check your configuration.')); $dn = (isset($_GET['dn']) ? $_GET['dn'] : ''); - -$encoded_dn = rawurlencode( $dn ); -$rdn = get_rdn( $dn ); -$container = get_container( $dn ); - -$attrs = $ldapserver->getDNAttrs($dn); +$rdn = get_rdn($dn); $select_server_html = server_select_list($ldapserver->server_id,true,'server_id_dst'); -include './header.php'; ?> +include './header.php'; - +echo ''; -

-

: name; ?> - -     : - -

+printf('

%s %s

',_('Compare another DN with'),htmlspecialchars($rdn)); +printf('

%s: %s',_('Server'),$ldapserver->name); +if ($dn) + printf('   %s: %s',_('Distinguished Name'),htmlspecialchars($dn)); +echo '

'; +echo "\n"; -
- :
-
+echo '
'; +printf('%s %s %s
',_('Compare'),htmlspecialchars($rdn),_('with ')); -
- +echo ''; +printf('',$ldapserver->server_id); +echo "\n"; - - - - - - - - - - - - - - - +echo '
: - -
: - -
'; +echo "\n"; +echo ' - - - +if (! $dn) { + printf('%s:',_('Compare this DN with another'),_('Source DN')); + echo ' - - -
'; -
:
'; + printf('',htmlspecialchars($dn)); + draw_chooser_link('compare_form.dn_src','true',$rdn); -
-
-
- - +} else + printf('',htmlspecialchars($dn)); + +echo ''; +echo "\n"; + +echo ''; +printf('%s:',_('Compare this DN with another'),_('Destination DN')); +echo ''; +echo ''; +draw_chooser_link('compare_form.dn_dst','true',''); +echo ''; +echo ''; +echo "\n"; + +printf('%s:%s',_('Destination Server'),$select_server_html); +echo "\n"; + +printf('',_('Compare')); +echo "\n"; + +echo ''; +echo ''; +echo '
'; +echo ''; +echo ''; +?> diff --git a/htdocs/copy_form.php b/htdocs/copy_form.php index 5b3d006..e644cc1 100644 --- a/htdocs/copy_form.php +++ b/htdocs/copy_form.php @@ -1,5 +1,5 @@ 0) { ?> echo ''; -printf('

%s %s

',_('Copy '),$rdn); -printf('

%s: %s     %s: %s

',_('Server'),$ldapserver->name,_('Distinguished Name'),$dn); +printf('

%s %s

',_('Copy'),htmlspecialchars($rdn)); +printf('

%s: %s     %s: %s

',_('Server'),$ldapserver->name, + _('Distinguished Name'),htmlspecialchars($dn)); +echo "\n"; echo '
'; -printf('%s %s %s:

',_('Copy '),htmlspecialchars($rdn),_('to a new object')); +printf('%s %s %s:

',_('Copy'),htmlspecialchars($rdn),_('to a new object')); echo '
'; -printf('',$dn); +printf('',htmlspecialchars($dn)); printf('',$ldapserver->server_id); +echo "\n"; echo ''; +echo "\n"; + echo ''; -printf('',_('The full DN of the new entry to be created when copying the source entry'),_('Destination DN')); +printf('', + _('The full DN of the new entry to be created when copying the source entry'),_('Destination DN')); printf(''; +echo "\n"; printf('',_('Destination Server'),$select_server_html); +echo "\n"; if (is_array($children) && count($children) > 0) { echo ''; printf('',_('Recursive copy')); echo '',_('Recursively copy all children of this object as well.')); - echo ''; + echo ''."\n"; + + echo ''; printf('',_('When performing a recursive copy, only copy those entries which match this filter'),_('Filter')); echo ''; + echo ''."\n"; + + echo ''; printf('',_('Delete after copy (move):')); echo '',_('Delete after copy (move):')); } +echo "\n"; printf('',_('Copy ')); +echo "\n"; echo '
%s:%s:',htmlspecialchars($dn)); -draw_chooser_link('copy_form.new_dn','true',$rdn); +draw_chooser_link('copy_form.new_dn','true',htmlspecialchars($rdn)); echo '
%s%s
:'; printf('(%s)
%s:'; - echo '
%s'; printf('(%s)',_('Make sure your filter (above) will select all child records.')); @@ -89,9 +101,12 @@ if (is_array($children) && count($children) > 0) { } else { printf('
%s
'; +echo "\n"; echo ''; if ($config->GetValue('appearance','show_hints')) - printf('%s',_('Hint: Copying between different servers only works if there are no schema violations')); + printf('Light%s',_('Hint: Copying between different servers only works if there are no schema violations')); echo '
'; ?> diff --git a/htdocs/delete_form.php b/htdocs/delete_form.php index 622ccd4..00dab16 100644 --- a/htdocs/delete_form.php +++ b/htdocs/delete_form.php @@ -1,5 +1,5 @@ '; printf('

'._('Delete %s').'

',htmlspecialchars(get_rdn($dn))); printf('

%s: %s     %s: %s

', - _('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars(($dn))); + _('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn)); +echo "\n"; + +echo '
'; if ($has_children) { - echo '
'; printf('%s

',_('Permanently delete all children also?')); flush(); # get the total number of child objects (whole sub-tree) $s = $ldapserver->search(null,dn_escape($dn),'objectClass=*',array('dn')); $sub_tree_count = count($s); -?> - - - '; + echo '
-

- - () -
-
+ echo ''; + echo ''; + echo ' - -

'; + printf(_('This entry is the root of a sub-tree containing %s entries.'),$sub_tree_count); + printf('(%s)', + $ldapserver->server_id,rawurlencode('objectClass=*'),rawurlencode($dn),_('view entries')); + echo '

'; -
-
- + printf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),($sub_tree_count-1)); + echo '

'; -
-
- - - + printf('%s', + _('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.')); + echo '

'; + echo "\n"; - - -
-
-
- - - -
-
-
-
-
- - - -
-
-
-

+ echo ''; + echo ''; + echo ''; - -
-
-
+ echo ''; + echo ''; + echo '
'; + echo '
'; + printf('',htmlspecialchars($dn)); + printf('',$ldapserver->server_id); + printf('',sprintf(_('Delete all %s objects'),$sub_tree_count)); + echo '
'; + echo '
'; + echo '
'; + printf('',htmlspecialchars($dn)); + printf('',$ldapserver->server_id); + printf('',_('Cancel')); + echo '
'; + echo '
'; + echo "\n"; -

'; + echo "\n"; + + flush(); + + echo '

'; + echo _('List of entries to be deleted:'); + echo '
'; + + printf(''; + echo "\n"; - - - -
+} else { + echo ''; + echo ''; -
+ echo ''; - + echo ''; + echo ''; + echo '
'; + echo _('Are you sure you want to permanently delete this object?'); + echo '

'; - + printf('%s: %s',_('Distinguished Name'),_('DN'),pretty_print_dn($dn)); + echo '
'; + printf('%s: %s',_('Server'),htmlspecialchars($ldapserver->name)); + echo '

'; + echo "\n"; -
- - - - -
-
-
- :
- : name); ?>
-
+ echo ''; + echo ''; -
- - + echo ' - -
-
-
- - - -
-
-
'; + echo '
'; + printf('',htmlspecialchars($dn)); + printf('',$ldapserver->server_id); + printf('',_('Delete')); + echo '
'; -
-
-
- - - -
-
-
-
-
+ echo '
'; + echo '
'; + printf('',htmlspecialchars($dn)); + printf('',$ldapserver->server_id); + printf('',_('Cancel')); + echo '
'; - - + echo '
'; + echo "\n"; + + echo ''; + echo ''; + echo ''; + echo "\n"; + +} + +echo '
'; +echo '
'; +echo ''; +echo ''; +?> diff --git a/htdocs/header.php b/htdocs/header.php index 394ff67..4129f37 100644 --- a/htdocs/header.php +++ b/htdocs/header.php @@ -1,5 +1,5 @@ GetValue('appearance','language') : 'auto'; # text/xml won't work with MSIE, but is very useful for debugging xhtml code. @@ -17,8 +16,8 @@ $language = isset($config) ? $language = $config->GetValue('appearance','languag # XML version and encoding for well-behaved browsers echo ''."\n"; -echo ''."\n"; +echo ''."\n"; printf('',$language,$language); echo "\n\n"; diff --git a/htdocs/index.php b/htdocs/index.php index 5e52a3a..7f54a22 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,5 +1,5 @@ %s: %s     %s: %s echo '
'; printf('',$ldapserver->server_id); -printf('',$dn); +printf('',htmlspecialchars($dn)); printf('',htmlspecialchars($rdn)); printf('',_('Rename')); echo '
'; diff --git a/htdocs/search.php b/htdocs/search.php index 18f1f49..773e3b2 100644 --- a/htdocs/search.php +++ b/htdocs/search.php @@ -1,5 +1,5 @@ %s ]', - $ldapserver->server_id,$scope,urlencode($base_dn),urlencode($filter), + printf('[ Save %s ]', + $ldapserver->server_id,htmlspecialchars($scope),urlencode($base_dn),urlencode($filter), urlencode(join(', ',$search_result_attributes)),_('export results')); printf('[ %s:',_('Format')); diff --git a/htdocs/server_info.php b/htdocs/server_info.php index b85ab8f..1aa0c7f 100644 --- a/htdocs/server_info.php +++ b/htdocs/server_info.php @@ -1,5 +1,5 @@ search(null,'','objectClass=*',array('+','*'),'b on RHEL 3. */ $attrs2 = array_pop($ldapserver->search(null,'','objectClass=*',$root_dse_attributes,'base')); -foreach ($attrs2 as $attr => $values) - if (! isset($attrs[$attr])) - $attrs[$attr] = $attrs2[$attr]; +if (is_array($attrs2)) + foreach ($attrs2 as $attr => $values) + if (! isset($attrs[$attr])) + $attrs[$attr] = $attrs2[$attr]; include './header.php'; diff --git a/htdocs/template_engine.php b/htdocs/template_engine.php index 104f92e..f292398 100644 --- a/htdocs/template_engine.php +++ b/htdocs/template_engine.php @@ -1,5 +1,5 @@ '; - printf('',$new_dn); + printf('',htmlspecialchars($new_dn)); } else { echo '
'; @@ -188,7 +188,7 @@ if (isset($template['empty_attrs'])) { } printf('',$ldapserver->server_id); - printf('',$_REQUEST['template']); + printf('',htmlspecialchars($_REQUEST['template'])); printf('',rawurlencode(serialize(array_values($template['objectclass'])))); printf('',$page+1); @@ -217,12 +217,12 @@ if (isset($template['empty_attrs'])) { echo 'Container DN:'; printf('', htmlspecialchars($_REQUEST['container'])); - printf('',$_REQUEST['container']); + printf('',htmlspecialchars($_REQUEST['container'])); echo ''; } } else { - printf('',$_REQUEST['container']); + printf('',htmlspecialchars($_REQUEST['container'])); } $count = 0; @@ -256,7 +256,7 @@ if (isset($template['empty_attrs'])) { # Some conditional checking. # $detail['must'] & $detail['disable'] cannot be set at the same time. if (isset($detail['must']) && $detail['must'] && isset($detail['disable']) && $detail['disable']) - pla_error(printf(_('Attribute [%s] is a MUST attribute, so it cannot be disabled.'),$attr)); + pla_error(sprintf(_('Attribute [%s] is a MUST attribute, so it cannot be disabled.'),$attr)); # If this attribute is disabled, go to the next one. if (isset($detail['disable']) && $detail['disable']) @@ -294,13 +294,17 @@ if (isset($template['empty_attrs'])) { $type = 'select'; } - # @todo: $detail['must'] && $detail['hidden'] must have $detail['value'] (with a value). # @todo: if value is a select list, then it cannot be hidden. # If this is a hidden attribute, then set its value. if (isset($detail['hidden']) && $detail['hidden']) { - printf('','hidden',$attr,$attr,$detail['value']); - continue; + if (isset($detail['value'])) { + printf('','hidden',$attr,$attr,$detail['value']); + continue; + + } else { + pla_error(sprintf(_('Attribute [%s] is a HIDDEN attribute, however, it is missing a VALUE in your template.'),$attr)); + } } # This is a displayed attribute. @@ -315,7 +319,7 @@ if (isset($template['empty_attrs'])) { # Display the icon if one is required. if (isset($detail['icon']) && trim($detail['icon'])) - printf('',$detail['icon']); + printf('Icon',$detail['icon']); else printf(' '); @@ -324,9 +328,13 @@ if (isset($template['empty_attrs'])) { # Display the label. if (isset($detail['description']) && (trim($detail['description']))) printf('%s:',$detail['description'],$detail['display']); - else + + elseif (isset($detail['display'])) printf('%s:',$detail['display']); + else + printf('%s:',_('No DISPLAY/DESCRIPTION attribute in template file')); + echo ''; # Calculate the events. @@ -481,7 +489,7 @@ if (isset($template['empty_attrs'])) { # If there is no count, display the summary if (! $count) { - printf('%s :%s', + printf('Create%s :%s', $template['icon'],_('Create Object'),htmlspecialchars($new_dn)); echo ''; @@ -490,7 +498,7 @@ if (isset($template['empty_attrs'])) { foreach ($_REQUEST['form'] as $attr => $value) { # Remove blank attributes. - if (! $_REQUEST['form'][$attr]) { + if (! is_array($_REQUEST['form'][$attr]) && trim($_REQUEST['form'][$attr]) == '') { unset($_REQUEST['form'][$attr]); continue; } @@ -521,12 +529,14 @@ if (isset($template['empty_attrs'])) { } - echo ''; - foreach (array_keys($_SESSION['submitform']) as $attr) { + if (isset($_SESSION['submitform'])) { + echo ''; + foreach (array_keys($_SESSION['submitform']) as $attr) { - printf('%s%s', - ($counter++%2==0?'even':'odd'),$attr,_('Binary value not displayed')); - printf('',$attr); + printf('%s%s', + ($counter++%2==0?'even':'odd'),$attr,_('Binary value not displayed')); + printf('',$attr); + } } } @@ -790,15 +800,15 @@ foreach ($template['attrs'] as $attr => $vals) { if (count($vals) > 1) { for ($i=1; $i<=count($vals); $i++) - printf(' %s(%s)
', + printf('Save %s(%s)
', $href,$i,_('download value'),$i); } else { - printf(' %s
',$href,_('download value')); + printf('Save %s
',$href,_('download value')); } if (! $ldapserver->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr)) - printf(' %s', + printf('Trash %s', $attr,_('delete attribute')); echo '
'; @@ -840,10 +850,11 @@ foreach ($template['attrs'] as $attr => $vals) { if (trim($val) == '') printf('[%s]
',_('empty')); - elseif (! strcasecmp($attr,'userPassword') && $config->GetValue('appearance','obfuscate_password_display')) + elseif (! strcasecmp($attr,'userPassword') && $config->GetValue('appearance','obfuscate_password_display')) { + $user_password = $val; echo preg_replace('/./','*',$val).'
'; - elseif (in_array(strtolower($attr),$shadow_format_attrs)) { + } elseif (in_array(strtolower($attr),$shadow_format_attrs)) { $shadow_date = shadow_date($attrs,$attr); echo htmlspecialchars($val).' '; echo ''; @@ -860,18 +871,9 @@ foreach ($template['attrs'] as $attr => $vals) { } else echo htmlspecialchars($val).'
'; } - -//@todo: redundant? - } else { - - if (! strcasecmp($attr,'userPassword') && obfuscate_password_display()) - echo preg_replace('/./','*',$vals).'
'; - else - echo $vals.'
'; - } - if (! strcasecmp($attr,'userPassword')) + if (! strcasecmp($attr,'userPassword') && isset($user_password)) printf('%s',base64_encode($user_password),_('Check password...')); if (preg_match("/^${attr}=/",$rdn)) @@ -907,8 +909,8 @@ foreach ($template['attrs'] as $attr => $vals) { echo htmlspecialchars($user_password); echo '
'; - printf('', - (obfuscate_password_display($enc_type) ? 'password' : 'text')); + printf('', + (obfuscate_password_display($enc_type) ? 'password' : 'text'),htmlspecialchars($user_password)); echo enc_type_select_list($enc_type); @@ -1002,12 +1004,13 @@ foreach ($template['attrs'] as $attr => $vals) { # Is this value is a structural objectClass, make it read-only if (! strcasecmp($attr,'objectClass')) { - printf(' ', + printf('Info ', _('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val)); $schema_object = $ldapserver->getSchemaObjectClass($val); - if ($schema_object->getType() == 'structural') { + # This should be an object, but we'll test it anyway + if (is_object($schema_object) && $schema_object->getType() == 'structural') { printf(' %s (%s)
', $val,_('This is a structural ObjectClass and cannot be removed.'),_('structural')); printf('',$input_name,$input_id,htmlspecialchars($val)); @@ -1027,10 +1030,10 @@ foreach ($template['attrs'] as $attr => $vals) { } elseif (is_mail_string($val)) - printf(' ',htmlspecialchars($val)); + printf('Mail ',htmlspecialchars($val)); elseif (is_url_string($val)) - printf(' ',htmlspecialchars($val)); + printf('URL ',htmlspecialchars($val)); if ($ldapserver->isMultiLineAttr($attr,$val)) printf('',$input_name,$input_id,htmlspecialchars($val)); @@ -1124,7 +1127,7 @@ else - + diff --git a/htdocs/update_confirm.php b/htdocs/update_confirm.php index c603d34..47670f3 100644 --- a/htdocs/update_confirm.php +++ b/htdocs/update_confirm.php @@ -1,5 +1,5 @@ $old_val) { } # Check user password with new encoding. -if (isset($new_values['userpassword']) && is_array($new_values['userpassword'])) +if (isset($new_values['userpassword']) && is_array($new_values['userpassword'])) { foreach ($new_values['userpassword'] as $key => $userpassword) { if ($userpassword) { - $new_val[$key] = password_hash($userpassword,$_POST['enc_type'][$key]); + if ($old_values['userpassword'][$key] == $new_values['userpassword'][$key] && + get_enc_type($old_values['userpassword'][$key]) == $_POST['enc_type'][$key]) + continue; - if ($new_val[$key] != $old_values['userpassword'][$key]) - $update_array['userpassword'][$key] = $new_val[$key]; + $new_values['userpassword'][$key] = password_hash($userpassword,$_POST['enc_type'][$key]); } } + if ($old_values['userpassword'] != $new_values['userpassword']) + $update_array['userpassword'] = $new_values['userpassword']; +} + # strip empty vals from update_array and ensure consecutive indices for each attribute foreach ($update_array as $attr => $val) { if (is_array($val)) { diff --git a/lib/createlm.php b/lib/createlm.php index 0be0b7e..9631cf4 100644 --- a/lib/createlm.php +++ b/lib/createlm.php @@ -1,6 +1,6 @@ x($ret) > 4294967296) { + $ret = (2*4294967296) - $this->x($ret); + } + return $ret; } function G($X, $Y, $Z) { @@ -468,6 +480,9 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5 $sum[1] &= 0xffff; $sum[0] &= 0xffff; $ret = ($sum[0]<<16) | $sum[1]; + if ($this->x($ret) > 4294967296) { + $ret = (2*4294967296) - $this->x($ret); + } return $ret; } @@ -493,7 +508,14 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5 # Renamed to prevent clash with SAMBA/source/libsmb/smbdes.c:lshift function md4lshift($x, $s) { $x &= 0xFFFFFFFF; - return ((($x<<$s)&0xFFFFFFFF) | $this->unsigned_shift_r($x, (32-$s))); + if ($this->x($x) > 4294967296) { + $x = (2*4294967296) - $this->x($x); + } + $ret = ((($x<<$s)&0xFFFFFFFF) | $this->unsigned_shift_r($x, (32-$s))); + if ($this->x($ret) > 4294967296) { + $ret = (2*4294967296) - $this->x($ret); + } + return $ret; } /** diff --git a/lib/functions.php b/lib/functions.php index 7b95fee..9a6a708 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1,5 +1,5 @@ $element ) { $element = htmlspecialchars($element); @@ -1012,7 +1015,7 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) { ?>
- +
Warning


@@ -1118,7 +1121,7 @@ function pla_error_handler( $errno, $errstr, $file, $lineno ) { $errstr = preg_replace("/\s+/"," ",$errstr); if( $errno == E_NOTICE ) { - echo sprintf(_('
+ echo sprintf(_('
@@ -1262,7 +1265,7 @@ function draw_jpeg_photos($ldapserver,$dn,$attr_name='jpegPhoto',$draw_delete_bu $img_height = $height; } - printf('
', + printf('Photo
', ($fixed_width ? '' : 'width="'.$img_width.'" '), ($fixed_height ? '' : 'height="'.$img_height.'"'), ($img_html_attrs ? $img_html_attrs : ''),basename($jpeg_filename)); @@ -1637,7 +1640,7 @@ function draw_chooser_link( $form_element, $include_choose_text=true, $rdn="none $title = _('Click to popup a dialog to select an entry (DN) graphically'); - printf('',$href,$title); + printf('Find',$href,$title); if ($include_choose_text) printf('%s',$href,$title,_('browse')); } @@ -1659,6 +1662,8 @@ function draw_chooser_link( $form_element, $include_choose_text=true, $rdn="none * */ function pla_explode_dn($dn,$with_attributes=0) { + if (DEBUG_ENABLED) + debug_log('pla_explode_dn(): Entered with (%s,%s)',1,$dn,$with_attributes); $dn = addcslashes(dn_escape($dn),'<>'); # split the dn @@ -1683,6 +1688,8 @@ function pla_explode_dn($dn,$with_attributes=0) { * Parse a DN and escape any special characters */ function dn_escape($dn) { + $olddn = $dn; + # Check if the RDN has a comma and escape it. while (preg_match('/([^\\\\]),(\s*[^=]*\s*),/',$dn)) $dn = preg_replace('/([^\\\\]),(\s*[^=]*\s*),/','$1\\\\2C$2,',$dn); @@ -1690,7 +1697,7 @@ function dn_escape($dn) { $dn = preg_replace('/([^\\\\]),(\s*[^=]*\s*)([^,])$/','$1\\\\2C$2$3',$dn); if (DEBUG_ENABLED) - debug_log('dn_escape(): Entered with (%s), Returning (%s)',1,$dn,$dn); + debug_log('dn_escape(): Entered with (%s), Returning (%s)',1,$olddn,$dn); return $dn; } @@ -2783,7 +2790,7 @@ function draw_date_selector_link( $attr ) { $href = "javascript:dateSelector('$attr');"; $title = _('Click to popup a dialog to select a date graphically'); - printf('',$href,$title,$attr); + printf('Calendar',$href,$title,$attr); } function no_expire_header() { diff --git a/lib/schema_functions.php b/lib/schema_functions.php index fd460f1..dbd0007 100644 --- a/lib/schema_functions.php +++ b/lib/schema_functions.php @@ -1,5 +1,5 @@ auth_type) return false; @@ -2387,6 +2387,9 @@ class LDAPserver { # Set default return $return = false; + if (DEBUG_ENABLED) + debug_log('%s::getLoggedInDN(): auth_type is [%s]',66,get_class($this),$this->auth_type); + if ($this->auth_type) { switch ($this->auth_type) { case 'cookie': @@ -2419,7 +2422,7 @@ class LDAPserver { } if (DEBUG_ENABLED) - debug_log('%s:getLoggedInDN(): Entered with (), Returning (%s)',17,get_class($this),$return); + debug_log('%s::getLoggedInDN(): Entered with (), Returning (%s)',17,get_class($this),$return); return $return; } diff --git a/lib/template_functions.php b/lib/template_functions.php index a6355fb..6503267 100644 --- a/lib/template_functions.php +++ b/lib/template_functions.php @@ -1,5 +1,5 @@ ";print_r($matchall); //0 = highlevel match, 1 = attr, 2 = subst, 3 = mod diff --git a/lib/tree_functions.php b/lib/tree_functions.php index e5a8e9f..1cfbf6f 100644 --- a/lib/tree_functions.php +++ b/lib/tree_functions.php @@ -1,5 +1,5 @@ getDNBase($logged_in_dn); + $bases = $ldapserver->getDNBase($logged_in_dn); + if (is_array($bases) && count($bases)) + $logged_in_dn_array[] = $bases; $rdn = $logged_in_dn; @@ -190,9 +192,6 @@ function draw_server_tree() { $icon = isset($tree['browser'][$base_dn]['icon']) ? $tree['browser'][$base_dn]['icon'] : get_icon($ldapserver,$base_dn); - # Shall we draw the "mass-delete" checkbox? - if ($ldapserver->isMassDeleteEnabled()) - printf('',htmlspecialchars($base_dn)); if ($config->GetValue('appearance','tree_plm')) { $tree_plm .= sprintf(".|%s|%s|%s|%s|%s|%s\n", @@ -200,6 +199,11 @@ function draw_server_tree() { } else { echo ''; + + # Shall we draw the "mass-delete" checkbox? + if ($ldapserver->isMassDeleteEnabled()) + printf('',htmlspecialchars($base_dn)); + printf('',$expand_href,$expand_img,$expand_alt); printf('',$edit_href,$icon); printf(''; - $hintlayout = ''; + $actionlayout = ''; + $hintlayout = ''; printf('

%s

',htmlspecialchars($rdn)); printf('

%s: %s     %s: %s

', @@ -37,24 +37,24 @@ if ($dn) { echo "\n"; echo '
Warning 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
%simg%s',$edit_href,pretty_print_dn($base_dn)); diff --git a/templates/creation/custom.php b/templates/creation/custom.php index f6c8d0e..5aaf2e8 100644 --- a/templates/creation/custom.php +++ b/templates/creation/custom.php @@ -1,5 +1,5 @@ %s"', - htmlspecialchars($attr),htmlspecialchars($friendly_attrs[strtolower($attr)])); + $attr_display = sprintf('%s', + _('Note'),htmlspecialchars($attr),_('is an alias for'), + htmlspecialchars($friendly_attrs[strtolower($attr)]), + htmlspecialchars($friendly_attrs[strtolower($attr)])); else $attr_display = htmlspecialchars($attr); diff --git a/templates/template_header.php b/templates/template_header.php index 2357d80..cd2c8c8 100644 --- a/templates/template_header.php +++ b/templates/template_header.php @@ -1,5 +1,5 @@ '; if ($dn) { - $actionlayout = '%s%s%s%sHint%s
'; - printf($actionlayout,'refresh.png',$refresh_href,_('Refresh this entry'),_('Refresh')); - printf($actionlayout,'save.png',$export_href_base,_('Save a dump of this object'),_('Export')); + printf($actionlayout,'refresh.png','Refresh',$refresh_href,_('Refresh this entry'),_('Refresh')); + printf($actionlayout,'save.png','Save',$export_href_base,_('Save a dump of this object'),_('Export')); echo ''; - printf($actionlayout,'cut.png',$copy_href,_('Copy this object to another location, a new DN, or another server'),_('Copy or move this entry')); + printf($actionlayout,'cut.png','Cut',$copy_href,_('Copy this object to another location, a new DN, or another server'),_('Copy or move this entry')); if ($show_internal_attrs) - printf($actionlayout,'tools-no.png',$refresh_href,'',_('Hide internal attributes')); + printf($actionlayout,'tools-no.png','Hide',$refresh_href,'',_('Hide internal attributes')); else - printf($actionlayout,'tools.png',$intattr_href,'',_('Show internal attributes')); + printf($actionlayout,'tools.png','Show',$intattr_href,'',_('Show internal attributes')); echo ''; if (! $ldapserver->isReadOnly()) { echo ''; - printf($actionlayout,'trash.png',$delete_href,_('You will be prompted to confirm this decision'),_('Delete this entry')); - printf($actionlayout,'rename.png',$rename_href,'',_('Rename')); + printf($actionlayout,'trash.png','Trash',$delete_href,_('You will be prompted to confirm this decision'),_('Delete this entry')); + printf($actionlayout,'rename.png','Rename',$rename_href,'',_('Rename')); echo ''; if ($config->GetValue('appearance','show_hints')) { @@ -64,12 +64,12 @@ if ($dn) { } echo ''; - printf($actionlayout,'compare.png',$compare_href,'',_('Compare with another entry')); + printf($actionlayout,'compare.png','Compare',$compare_href,'',_('Compare with another entry')); echo ''; echo ''; - printf($actionlayout,'star.png',$create_href,'',_('Create a child entry')); - printf($actionlayout,'add.png',$addattr_href,'',_('Add new attribute')); + printf($actionlayout,'star.png','Create',$create_href,'',_('Create a child entry')); + printf($actionlayout,'add.png','Add',$addattr_href,'',_('Add new attribute')); echo ''; } @@ -84,8 +84,8 @@ if ($dn) { $ldapserver->server_id,rawurlencode('objectClass=*'),$encoded_dn); echo ''; - printf($actionlayout,'children.png',$child_href,'',($children_count == 1) ? _('View 1 child') : sprintf(_('View %s children'),$children_count)); - printf($actionlayout,'save.png',$export_href_sub,_('Save a dump of this object and all of its children'),_('Export subtree')); + printf($actionlayout,'children.png','Children',$child_href,'',($children_count == 1) ? _('View 1 child') : sprintf(_('View %s children'),$children_count)); + printf($actionlayout,'save.png','Save',$export_href_sub,_('Save a dump of this object and all of its children'),_('Export subtree')); echo ''; } @@ -116,7 +116,7 @@ if ($dn) { if (! $ldapserver->isReadOnly()) { echo ''; printf('',$ldapserver->server_id); - printf('',$dn); + printf('',htmlspecialchars($dn)); } echo '
'."\n\n";