#!/usr/bin/perl use strict; use CGI; use CGI::Carp 'fatalsToBrowser'; # remove when finished testing use Net::LDAP; use IPC::System::Simple qw(system capture); # input # create CGI query object to get the SSO from URL my $q = new CGI; my $sso = $q->param( "sso" ); $sso =~ s/[^0-9]//g; # remove non digit # process my $msg; if ($sso){ # check LDPA my @entries = search_LDAP($sso); if (@entries == 1){ $msg = process_sso($sso,$entries[0]); } else { $msg = qq!

ERROR: Wrong SSO [$sso] or User does not exist in OneAD LDAP

!; } } else { $msg = q!

ERROR : parameter sso is empty

!; } # html page print $q->header(),$q->start_html('Application Management System'); print $msg; print qq!
SSO :
!; print $q->end_html; sub search_LDAP { my $sso = shift; return ('test') } sub process_sso { my ($sso,$usr) = @_; my $msg = "

Processing SSO $sso

"; return $msg; }