File: echo-user.pl

package info (click to toggle)
libapache2-authcookie-perl 3.22-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 400 kB
  • ctags: 99
  • sloc: perl: 1,130; makefile: 23
file content (17 lines) | stat: -rwxr-xr-x 360 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use constant MODPERL2 => ($mod_perl::VERSION >= 1.99);

if (MODPERL2) {
    require Apache2::Access;
}

my $r = MODPERL2 ? Apache2::RequestUtil->request
                 : Apache->request;

$r->content_type("text/html");
$r->status(200);
$r->send_http_header unless MODPERL2;

my $user = MODPERL2 ? $r->user : $r->connection->user;

print "$user";