5 if (UNIVERSAL::can($r, 'uri') and $r->uri =~ m{.*/m/(.*)}) {
9 my $default_path = RT->Config->Get('WebPath') ."/m/";
11 my $form_action = defined $goto ? $goto
12 : defined $req_uri ? $req_uri
16 # sanitize $form_action
17 my $uri = URI->new($form_action);
19 # You get undef scheme with a relative uri like "/Search/Build.html"
20 unless (!defined($uri->scheme) || $uri->scheme eq 'http' || $uri->scheme eq 'https') {
21 $form_action = $default_path;
24 # Make sure we're logging in to the same domain
25 # You can get an undef authority with a relative uri like "index.html"
26 my $uri_base_url = URI->new(RT->Config->Get('WebURL')."m/");
27 unless (!defined($uri->authority) || $uri->authority eq $uri_base_url->authority) {
28 $form_action = $default_path;
31 <&| /m/_elements/wrapper, show_home_button => 0 &>
33 <& /m/_elements/raw_style &>
35 <h1><&|/l, RT->Config->Get('rtname') &>RT for [_1]</&></h1>
36 <div id="body" class="login-body">
38 <&| "/Widgets/TitleBox", title => loc('Error'), hideable => 0, class => 'error' &>
45 <&| /Widgets/TitleBox, title => loc('Login'), hideable => 0 &>
47 % unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) {
48 <form id="login" name="login" method="post" action="<% $form_action %>">
51 <span class="label"><&|/l&>Username</&>:</span><span class="value"><input name="user" value="<%$user%>" id="user" /></span>
55 <span class="label"><&|/l&>Password</&>:</span><span class="value"><input type="password" name="pass"/></span>
58 <& /Elements/Submit, Label => loc('Login')&>
60 % foreach my $key (keys %ARGS) {
61 % if (($key ne 'user') and ($key ne 'pass')) {
62 % if (ref($ARGS{$key}) =~ /ARRAY/) {
63 % foreach my $val (@{$ARGS{$key}}) {
64 <input type="hidden" class="hidden" name="<%$key %>" value="<% $val %>" />
68 <input type="hidden" class="hidden" name="<% $key %>" value="<% $ARGS{$key} %>" />
75 </div><!-- #login-box -->
76 </div><!-- #login-body -->
77 <& _elements/full_site_link &>