3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
25 if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') {
26 $r->content_type("text/plain");
27 $m->error_format("text");
28 $m->out("RT/$RT::VERSION 401 Credentials required\n");
29 $m->out("\n$Error\n") if $Error;
34 <& /Elements/Callback, %ARGS, _CallbackName => 'Header' &>
35 <& /Elements/Header, Title => loc('Login'), Focus => 'user' &>
39 <& /Elements/TitleBoxStart, title => loc('Error') &>
41 <& /Elements/TitleBoxEnd &>
44 <& /Elements/TitleBoxStart, width=> "40%", titleright => loc("RT [_1]", $RT::VERSION), title => loc('Login') ,
45 contentbg=>"#cccccc" &>
47 % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
48 <FORM METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" >
49 <TABLE BORDER=0 WIDTH=100%>
51 <TD ALIGN=RIGHT><&|/l&>Username</&>:</TD><TD ALIGN=LEFT><input name=user value="<%$user%>"></TD></TR>
52 <TR><TD ALIGN=RIGHT><&|/l&>Password</&>:</TD><TD ALIGN=LEFT><input type=password name=pass></TD></TR>
53 <TR><TD colspan=2 align=right>
54 <input type=submit Value="<&|/l&>Login</&>">
58 %# Give callbacks a chance to add more control elements
59 <& /Elements/Callback, %ARGS &>
61 <&/Elements/TitleBoxEnd&>
62 % # From mason 1.0.1 forward, this doesn't work. in fact, it breaks things.
63 % # But on Mason 1.15 it's fixed again, so we still use it.
64 % # The code below iterates through everything in the passed in arguments
65 % # Preserving all the old parameters
66 % # This would be easier, except mason is 'smart' and calls multiple values
67 % # arrays rather than multiple hash keys
69 % foreach $key (keys %ARGS) {
70 % if (($key ne 'user') and ($key ne 'pass')) {
71 % if (ref($ARGS{$key}) =~ /ARRAY/) {
72 % foreach $val (@{$ARGS{$key}}) {
73 <input type=hidden name="<%$key %>" value="<% $val %>">
77 <input type="hidden" name="<% $key %>" value="<% $ARGS{$key} %>">
86 <!-- TODO: not yet implemented
87 If you've forgotten your username or password, RT can <A
88 href="/NoAuth/Reminder.html">send you a reminder</a>.
94 <&|/l, '2003'&>RT is © Copyright 1996-[_1] Jesse Vincent <jesse@bestpractical.com>. It is distributed under <a href="http://www.gnu.org/copyleft/gpl.html">Version 2 of the GNU General Public License.</a></&>