File: autoProtectedCGI.pl

package info (click to toggle)
lemonldap-ng 1.1.2-5%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,500 kB
  • sloc: perl: 22,090; makefile: 592; sh: 113; php: 6; sql: 5
file content (18 lines) | stat: -rwxr-xr-x 415 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

my $cgi = new Lemonldap::NG::Handler::CGI( { https => 0, } );

$cgi->authenticate();

print $cgi->header;

unless ( $cgi->authorize ) {
    print $cgi->start_html('Forbidden');
    print "You're not authorized to see this page";
    print $cgi->end_html;
}
else {
    print $cgi->start_html('Authorized');
    print "<h1>Welcome</h1>You're authorized to see this page";
    print $cgi->end_html;
}