[Rt-commit] r10135 - in rt/branches/3.999-DANGEROUS: . lib/RT
jesse at bestpractical.com
jesse at bestpractical.com
Thu Dec 27 01:25:17 EST 2007
Author: jesse
Date: Thu Dec 27 01:25:16 2007
New Revision: 10135
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment
rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
Log:
r74250 at pinglin: jesse | 2007-12-27 01:25:07 -0500
* support old-style logins. makes commandline work. +217 more tests
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment Thu Dec 27 01:25:16 2007
@@ -72,8 +72,8 @@
}
my $action;
-($action = $changes{Action}) =~ s/^(.)(.*)$/\U$1\L$2\E/;
-unless ($action =~ /^(?:comment|Correspond)$/) {
+($action = lc $changes{Action}) =~ s/^(.)(.*)$/\U$1\L$2\E/;
+unless ($action =~ /^(?:comment|correspond)$/) {
$e = 1;
$c = "# Invalid action: `$action'.";
goto OUTPUT;
@@ -127,7 +127,7 @@
unless ($ticket->current_user_has_right('ModifyTicket') ||
($action eq "comment" &&
$ticket->current_user_has_right("commentOnTicket")) ||
- ($action eq "Correspond" &&
+ ($action eq "correspond" &&
$ticket->current_user_has_right("ReplyToTicket")))
{
$e = 1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm Thu Dec 27 01:25:16 2007
@@ -30,6 +30,18 @@
};
+
+before qr/.*/ => run {
+ Jifty->web->new_action(
+ moniker => 'login',
+ class => 'Login',
+ arguments => {
+ email => Jifty->web->request->arguments->{'user'},
+ password => Jifty->web->request->arguments->{'pass'}
+ }
+ )->run if ( Jifty->web->request->arguments->{'user'} && Jifty->web->request->arguments->{'pass'} );
+};
+
# XXX TODO XXX SECURITY RISK - this regex is WRONG AND UNSAFE
before qr'^/(?!login)' => run {
tangent '/login' unless (Jifty->web->current_user->id || Jifty->web->request->path =~ /NoAuth/i);
More information about the Rt-commit
mailing list