[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-308-g689d244

? sunnavy sunnavy at bestpractical.com
Fri Aug 13 03:34:08 EDT 2010


The branch, 3.9-trunk has been updated
       via  689d244fd5b62b6d64052b3be0f1d1ca9302998a (commit)
       via  03e052e52c2ba511c804f25b6371045e712d5c52 (commit)
       via  a6e467804c18cce0eb225acd09936014c40bc45a (commit)
      from  62d117fdb4112d1d0105894a986a2b3eea5af9e7 (commit)

Summary of changes:
 share/html/Admin/Tools/Configuration.html |   48 +++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit a6e467804c18cce0eb225acd09936014c40bc45a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Aug 13 15:22:50 2010 +0800

    make stringified variable prettier

diff --git a/share/html/Admin/Tools/Configuration.html b/share/html/Admin/Tools/Configuration.html
index 67ffa29..3e32637 100644
--- a/share/html/Admin/Tools/Configuration.html
+++ b/share/html/Admin/Tools/Configuration.html
@@ -92,14 +92,8 @@ foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
 <td class="collection-as-table">
 % if ( $key =~ /Password(?!Length)/i ) { 
 <em>Password not printed</em>\
-% } elsif ( !ref $val ) {
-<% "$val" %>\
-% } elsif ( ref $val eq 'ARRAY' ) {
-<% join ', ', @$val %>\
-% } elsif ( ref $val eq 'HASH' ) {
-<% join ', ', %$val %>\
 % } else {
-<% ref $val %>\
+<% stringify($val) |n %>\
 % }
 </td>
 <td class="collection-as-table" style="white-space: nowrap">
@@ -240,3 +234,37 @@ if ($item =~ /^\s*(.*?)\s*v(\S+);/) {
 <% Config::myconfig() %>
 </pre>
 </&>
+
+<%INIT>
+use Data::Dumper;
+local $Data::Dumper::Terse = 1;
+local $Data::Dumper::Indent = 2;
+
+sub obfuscate_password {
+    my $value = shift;
+    if ( ref $value && ref $value eq 'HASH' ) {
+        for my $key ( keys %$value ) {
+            if ( $key =~ /password/i ) {
+                $value->{$key} = 'Password not printed', 
+            }
+            elsif ( ref $value->{$key} && ref $value->{$key} eq 'HASH' ) {
+                $value->{$key} = obfuscate_password( $value->{$key} ); 
+            }
+        }
+    }
+    return $value;
+}
+
+sub stringify {
+    my $value = shift;
+    if ( ref $value && ref $value eq 'HASH' ) {
+        $value = obfuscate_password( $value );
+    }
+
+    my $output = Dumper $value;
+    RT::Interface::Web::EscapeUTF8(\$output);
+    $output =~ s/ /&nbsp;/g;
+    $output =~ s!\n!<br />!g;
+    return $output;
+}
+</%INIT>

commit 03e052e52c2ba511c804f25b6371045e712d5c52
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Aug 13 15:26:35 2010 +0800

    localize "Password not printed" str

diff --git a/share/html/Admin/Tools/Configuration.html b/share/html/Admin/Tools/Configuration.html
index 3e32637..8674feb 100644
--- a/share/html/Admin/Tools/Configuration.html
+++ b/share/html/Admin/Tools/Configuration.html
@@ -91,7 +91,7 @@ foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
 <td class="collection-as-table"><% $key %></td>
 <td class="collection-as-table">
 % if ( $key =~ /Password(?!Length)/i ) { 
-<em>Password not printed</em>\
+<em><% loc('Password not printed' ) %></em>\
 % } else {
 <% stringify($val) |n %>\
 % }
@@ -128,7 +128,7 @@ foreach my $key ( sort keys %{*RT::} ) {
 <td class="collection-as-table">RT::<% $key %></td>
 <td class="collection-as-table">
 % if ( $key =~ /Password(?!Length)/i ) { 
-<em>Password not printed</em>
+<em><% loc('Password not printed' ) %></em>\
 % } else {
 <% ${'RT::'.$key} %>
 % }
@@ -245,7 +245,7 @@ sub obfuscate_password {
     if ( ref $value && ref $value eq 'HASH' ) {
         for my $key ( keys %$value ) {
             if ( $key =~ /password/i ) {
-                $value->{$key} = 'Password not printed', 
+                $value->{$key} = loc('Password not printed'),
             }
             elsif ( ref $value->{$key} && ref $value->{$key} eq 'HASH' ) {
                 $value->{$key} = obfuscate_password( $value->{$key} ); 

commit 689d244fd5b62b6d64052b3be0f1d1ca9302998a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Aug 13 15:28:05 2010 +0800

    warning fix: not all modules in %INC has corresponding file in fs

diff --git a/share/html/Admin/Tools/Configuration.html b/share/html/Admin/Tools/Configuration.html
index 8674feb..df1ac8a 100644
--- a/share/html/Admin/Tools/Configuration.html
+++ b/share/html/Admin/Tools/Configuration.html
@@ -221,7 +221,7 @@ if ($item =~ /^\s*(.*?)\s*v(\S+);/) {
         <%$ver%>
     </td>
     <td class="collection-as-table">
-        <% $INC{$distfile} %>
+        <% $INC{$distfile} || '' %>
     </td>
 </tr>
 % }

-----------------------------------------------------------------------


More information about the Rt-commit mailing list