X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fhtml%2Fautohandler;fp=rt%2Fhtml%2Fautohandler;h=c854c2b337ec9d598513d97580a50790e30d0a2c;hp=b21d26145b70bb47975176642b339f9b5e5a5791;hb=d4d0590bef31071e8809ec046717444b95b3f30a;hpb=d39d52aac8f38ea9115628039f0df5aa3ac826de diff --git a/rt/html/autohandler b/rt/html/autohandler index b21d26145..c854c2b33 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 %# %# %# (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();