From a01f7c8289b5501be43f1a7d1847f0b827419e82 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 30 Jun 2009 20:27:56 +1000 Subject: [PATCH] RELEASE 0.9.8.3 --- htdocs/compare_form.php | 105 +++++++++---------- htdocs/copy_form.php | 35 +++++-- htdocs/delete_form.php | 191 +++++++++++++++++----------------- htdocs/header.php | 7 +- htdocs/rename_form.php | 4 +- htdocs/search.php | 6 +- htdocs/template_engine.php | 48 ++++----- htdocs/update_confirm.php | 15 ++- lib/common.php | 5 +- lib/createlm.php | 28 ++++- lib/functions.php | 20 ++-- lib/server_functions.php | 9 +- lib/template_functions.php | 4 +- lib/tree_functions.php | 14 ++- templates/template_header.php | 32 +++--- 15 files changed, 284 insertions(+), 239 deletions(-) diff --git a/htdocs/compare_form.php b/htdocs/compare_form.php index 0e39390..bd049e4 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 9fc6941..755b096 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 86b8a3b..4726711 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 4f69c5c..c036155 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/rename_form.php b/htdocs/rename_form.php index cb43b8f..bc3a06c 100644 --- a/htdocs/rename_form.php +++ b/htdocs/rename_form.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 2bc143c..039c6e0 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/template_engine.php b/htdocs/template_engine.php index f72c6a2..5721461 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; @@ -319,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(' '); @@ -489,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 ''; @@ -800,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 '
'; @@ -850,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 ''; @@ -870,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)) @@ -917,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); @@ -1012,7 +1004,7 @@ 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); @@ -1038,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)); @@ -1135,7 +1127,7 @@ else - + diff --git a/htdocs/update_confirm.php b/htdocs/update_confirm.php index b052312..a7c4777 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/common.php b/lib/common.php index 8039b60..de747f1 100644 --- a/lib/common.php +++ b/lib/common.php @@ -1,5 +1,5 @@ = '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 declare class members error_reporting(E_DEBUG); } else diff --git a/lib/createlm.php b/lib/createlm.php index 0be0b7e..90d2922 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 fc4c78e..c8b2ddc 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1,5 +1,5 @@ $element ) { @@ -1015,7 +1015,7 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) { ?>
- +
Warning


@@ -1121,7 +1121,7 @@ function pla_error_handler( $errno, $errstr, $file, $lineno ) { $errstr = preg_replace("/\s+/"," ",$errstr); if( $errno == E_NOTICE ) { - echo sprintf(_('
+ echo sprintf(_('
@@ -1265,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)); @@ -1640,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')); } @@ -1662,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 @@ -1686,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); @@ -1693,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; } @@ -2800,7 +2804,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/server_functions.php b/lib/server_functions.php index 40e7dc2..289fd9d 100644 --- a/lib/server_functions.php +++ b/lib/server_functions.php @@ -1,5 +1,5 @@ auth_type) return false; @@ -2303,6 +2303,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': @@ -2335,7 +2338,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 9e1f6e5..1cdfb3f 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 ac3118f..9af5a84 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/template_header.php b/templates/template_header.php index 666aef9..f228bc4 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";