X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fautohandler;h=ee37934cf0293ebea3cde90246ef8b5303d89745;hb=e4c7cd8602ebb3e70895aee1d7d8a49371ccb70c;hp=2bd3adffd7ea55b60e341b433dd85ef5c5e851c4;hpb=b8cfd0780aa40bb07f3215bf9cb58011f5e32a35;p=freeside.git diff --git a/httemplate/autohandler b/httemplate/autohandler index 2bd3adffd..ee37934cf 100644 --- a/httemplate/autohandler +++ b/httemplate/autohandler @@ -7,9 +7,23 @@ my $profile = ''; if ( UNIVERSAL::can(dbh, 'sprintProfile') ) { - if ( lc($r->content_type) eq 'text/html' ) { + if ( lc($r->content_type) eq 'text/html' + && $FS::CurrentUser::CurrentUser->option('show_db_profile') + ) + { - $profile = '
'. ("\n"x4096). encode_entities(dbh->sprintProfile()).
+    ## barely worth it, just in case someone tries to use profiling on a
+    ## non-RT install
+    #eval "use Text::Wrapper;";
+    #die $@ if $@;
+
+    my $wrapper = new Text::Wrapper( columns => 80 );
+    my $text = dbh->sprintProfile();
+    #my $text = $wrapper->wrap( dbh->sprintProfile() );
+    $text =~ s/^/                                                          /mg;
+    
+    $profile = '
'.
+               encode_entities( $text ).
                #"\n\n". &sprintAutoProfile(). '
'; "\n\n". '
'; } @@ -19,3 +33,6 @@ if ( UNIVERSAL::can(dbh, 'sprintProfile') ) { s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i; +<%cleanup> + dbh->commit(); +