summaryrefslogtreecommitdiff
path: root/rt/html/autohandler
diff options
context:
space:
mode:
authorivan <ivan>2005-10-15 09:11:20 +0000
committerivan <ivan>2005-10-15 09:11:20 +0000
commitd4d0590bef31071e8809ec046717444b95b3f30a (patch)
treeee1236da50578390d2642114f28eaed99a5efb18 /rt/html/autohandler
parentd39d52aac8f38ea9115628039f0df5aa3ac826de (diff)
import rt 3.4.4
Diffstat (limited to 'rt/html/autohandler')
-rw-r--r--rt/html/autohandler24
1 files changed, 9 insertions, 15 deletions
diff --git a/rt/html/autohandler b/rt/html/autohandler
index b21d261..c854c2b 100644
--- a/rt/html/autohandler
+++ b/rt/html/autohandler
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<%INIT>
# Roll back any dangling transactions from a previous failed connection
@@ -61,21 +61,15 @@ if ($m->request_comp->attr_exists('AutoFlush')) {
# passed just one, a scalar whatever they are, mark them as utf8
my $type = ref($_);
(!$type)
- ? Encode::decode(utf8 => $_, Encode::FB_PERLQQ) :
+ ? Encode::is_utf8($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) :
($type eq 'ARRAY')
- ? [ map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] :
+ ? [ map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] :
($type eq 'HASH')
- ? { map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_
+ ? { map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_
} %ARGS;
-if ($ARGS{'Debug'}) {
- require Time::HiRes;
- $m->{'rt_base_time'} = [Time::HiRes::gettimeofday()];
+$m->{'rt_base_time'} = [Time::HiRes::gettimeofday()];
-}
-else {
- $m->{'rt_base_time'} = time;
-}
$m->comp('/Elements/SetupSessionCookie', %ARGS);
unless ($session{'CurrentUser'} && $session{'CurrentUser'}->Id) {
@@ -169,7 +163,7 @@ elsif ( $RT::WebExternalAuth ) {
elsif ($RT::WebFallbackToInternalAuth) {
unless (defined($session{'CurrentUser'})) {
$m->comp('/Elements/Login', %ARGS,
- Error=> loc('XXX CHANGEME You are not an authorized user'));
+ Error=> loc('You are not an authorized user'));
$m->abort();
}
} else {
@@ -193,8 +187,8 @@ if (!$session{'CurrentUser'} && defined ($user) && defined ($pass) ){
if (!$session{'CurrentUser'}->id() ||
!$session{'CurrentUser'}->IsPassword($pass))
{
- $RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}");
delete $session{'CurrentUser'};
+ $RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}");
$m->comp('/Elements/Login', %ARGS,
Error => loc('Your username or password is incorrect'));
$m->abort();