File: autoProtectedCGI.pl

package info (click to toggle)
lemonldap-ng 1.9.7-3%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 39,024 kB
  • sloc: perl: 37,552; makefile: 922; sh: 472; 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;
}