summaryrefslogtreecommitdiff
path: root/rt/html/autohandler
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/autohandler')
-rw-r--r--rt/html/autohandler24
1 files changed, 15 insertions, 9 deletions
diff --git a/rt/html/autohandler b/rt/html/autohandler
index c854c2b33..b21d26145 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-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2004 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,15 +61,21 @@ if ($m->request_comp->attr_exists('AutoFlush')) {
# passed just one, a scalar whatever they are, mark them as utf8
my $type = ref($_);
(!$type)
- ? Encode::is_utf8($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) :
+ ? Encode::decode(utf8 => $_, Encode::FB_PERLQQ) :
($type eq 'ARRAY')
- ? [ map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] :
+ ? [ map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] :
($type eq 'HASH')
- ? { map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_
+ ? { map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_
} %ARGS;
-$m->{'rt_base_time'} = [Time::HiRes::gettimeofday()];
+if ($ARGS{'Debug'}) {
+ require Time::HiRes;
+ $m->{'rt_base_time'} = [Time::HiRes::gettimeofday()];
+}
+else {
+ $m->{'rt_base_time'} = time;
+}
$m->comp('/Elements/SetupSessionCookie', %ARGS);
unless ($session{'CurrentUser'} && $session{'CurrentUser'}->Id) {
@@ -163,7 +169,7 @@ elsif ( $RT::WebExternalAuth ) {
elsif ($RT::WebFallbackToInternalAuth) {
unless (defined($session{'CurrentUser'})) {
$m->comp('/Elements/Login', %ARGS,
- Error=> loc('You are not an authorized user'));
+ Error=> loc('XXX CHANGEME You are not an authorized user'));
$m->abort();
}
} else {
@@ -187,8 +193,8 @@ if (!$session{'CurrentUser'} && defined ($user) && defined ($pass) ){
if (!$session{'CurrentUser'}->id() ||
!$session{'CurrentUser'}->IsPassword($pass))
{
- delete $session{'CurrentUser'};
$RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}");
+ delete $session{'CurrentUser'};
$m->comp('/Elements/Login', %ARGS,
Error => loc('Your username or password is incorrect'));
$m->abort();