summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pazdziora <jpazdziora@redhat.com>2014-01-08 03:12:20 -0500
committerJan Pazdziora <jpazdziora@redhat.com>2014-01-08 03:12:20 -0500
commitd5c2d76b7e873ab05f179c32b1140743e3e672e0 (patch)
tree5d9d77428a5a855e8012eeb47caa64e748cea539
parent458b1d3588380b7aa2a08b7ad86052a726928bad (diff)
downloadCGI-sessions-trust-REMOTE_USER.zip
CGI-sessions-trust-REMOTE_USER.tar.gz
CGI-sessions-trust-REMOTE_USER.tar.xz
If the REMOTE_USER environment variable is set, trust it.trust-REMOTE_USER
-rwxr-xr-xapp.cgi4
1 files changed, 3 insertions, 1 deletions
diff --git a/app.cgi b/app.cgi
index d80755b..2cd143a 100755
--- a/app.cgi
+++ b/app.cgi
@@ -60,7 +60,9 @@ sub login {
my $login = $q->param('login');
my $password = $q->param('password');
my $error = '';
- if (defined $login) {
+ if (defined $ENV{REMOTE_USER}) {
+ $login = $ENV{REMOTE_USER};
+ } elsif (defined $login) {
my $re = qr/^[-a-zA-Z0-9_.]+$/;
if ($login eq '' or not $login =~ $re) {
$error = '<p>Login has to be nonempty, full characters</p>';