Perl / CGI and IIS6
This is a multipart message in MIME format.
--===============1393215416==
Content-Type: multipart/alternative;
boundary="=_alternative 0046295B862575CF_="
This is a multipart message in MIME format.
--=_alternative 0046295B862575CF_=
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Greetings Perl experts
I am trying to convert a ton of standalone tools written in perl
to be web based
these tools are mostly windows administration tools.
Just looking for some advice on using perl on IIS. I have used the CGI
module
to create dynamic pages but Im not sure how to handle things like
authentication.
For instance I would like to have my users authenticated against and
Active Directory service
which will validate what they can use on the site.
Tony B. Okusanya
Tony B. Okusanya
Windows Standards Group
Phone (651)-962-2702
Pager: 7639136132 [at] messaging.sprintpcs.com
Cell: (763)-913-6132
Fax: (651)-767-3122
Mail Code:EP-MN-O2NS
U.S. BANCORP made the following annotations
------------------------------------------------------------ ---------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.
------------------------------------------------------------ ---------
--=_alternative 0046295B862575CF_=
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
charset=us-ascii
<br><font size=2 face="sans-serif">Greetings Perl experts</font>
<br><font size=2 face="sans-serif"> I
am trying to convert a ton of standalone tools written in perl to be web
based</font>
<br><font size=2 face="sans-serif">these tools are mostly windows administration
tools. </font>
<br><font size=2 face="sans-serif">Just looking for some advice on using
perl on IIS. I have used the CGI module</font>
<br><font size=2 face="sans-serif">to create dynamic pages but Im not sure
how to handle things like authentication.</font>
<br><font size=2 face="sans-serif">For instance I would like to have my
users authenticated against and Active Directory service</font>
<br><font size=2 face="sans-serif">which will validate what they can use
on the site.<br>
<br>
<br>
Tony B. Okusanya</font>
<br><font size=2 face="sans-serif"><br>
<br>
<br>
<br>
Tony B. Okusanya<br>
<br>
Windows Standards Group<br>
Phone (651)-962-2702<br>
Pager: 7639136132 [at] messaging.sprintpcs.com<br>
Cell: (763)-913-6132<br>
Fax: (651)-767-3122<br>
Mail Code:EP-MN-O2NS</font>
<P>U.S. BANCORP made the following annotations<br/> ------------------------------------------------------------ ---------<br/><font face="Arial" size=2>Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.</font><br>
<br>
------------------------------------------------------------ ---------<br/>
</P>
--=_alternative 0046295B862575CF_=--
--===============1393215416==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1393215416==--
RE: Perl / CGI and IIS6
--===============1048266622==
Content-Class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C9E838.C189AC88"
------_=_NextPart_001_01C9E838.C189AC88
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Anthony, I wrote a little method for my libraries which I use to
authenticate all of my web-based apps off of Active Directory (LDAP).
You will need to use the Net::LDAP module. This works on all platforms.
Hope this helps,
Scott
*******************************************************
=3Ditem B<ldap_authenticate()>
This method accepts a username, password, and an array of LDAP servers,
in that order. It returns a true/false code, and a message.
IE: ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list)
=3Dcut
sub ldap_authenticate{
my($class,$username,$password, [at] ldap_servers)=3D [at] _;
#LDAP Connect#
my $ldap =3D Net::LDAP->new(\ [at] ldap_servers, async =3D> =
1);
if(!$ldap){
return("0","LDAP ERROR! Cannot connect
to LDAP server(s).");
}
else{
#If LDAP servers are listening, attempt
BIND (Authentication)#
my
$msg=3D$ldap->bind("$username",password=3D>"$password");
if($msg->error=3D~m/success/i){
$ldap->unbind;
return(1,"Successful
Logon");
}
else{
$ldap->unbind;
return(0,"Error: " .
$msg->error);
}
}
}
*******************************************************
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
anthony.okusanya [at] usbank.com
Sent: Monday, June 08, 2009 8:46 AM
To: ActivePerl [at] listserv.ActiveState.com
Subject: Perl / CGI and IIS6
Greetings Perl experts
I am trying to convert a ton of standalone tools written in perl
to be web based
these tools are mostly windows administration tools.
Just looking for some advice on using perl on IIS. I have used the CGI
module
to create dynamic pages but Im not sure how to handle things like
authentication.
For instance I would like to have my users authenticated against and
Active Directory service
which will validate what they can use on the site.
Tony B. Okusanya
Tony B. Okusanya
Windows Standards Group
Phone (651)-962-2702
Pager: 7639136132 [at] messaging.sprintpcs.com
Cell: (763)-913-6132
Fax: (651)-767-3122
Mail Code:EP-MN-O2NS
U.S. BANCORP made the following annotations
------------------------------------------------------------ ---------
Electronic Privacy Notice. This e-mail, and any attachments, contains
information that is, or may be, covered by electronic communications
privacy laws, and is also confidential and proprietary in nature. If you
are not the intended recipient, please be advised that you are legally
prohibited from retaining, using, copying, distributing, or otherwise
disclosing this information in any manner. Instead, please reply to the
sender that you have received this communication in error, and then
immediately delete it. Thank you in advance for your cooperation.
------------------------------------------------------------ ---------
------_=_NextPart_001_01C9E838.C189AC88
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" =
xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" =
xmlns:a=3D"urn:schemas-microsoft-com:office:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-com:office:publisher" =
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" =
xmlns:odc=3D"urn:schemas-microsoft-com:office:odc" =
xmlns:oa=3D"urn:schemas-microsoft-com:office:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" =
xmlns:rtc=3D"http://microsoft.com/officenet/conferencing" =
xmlns:D=3D"DAV:" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" =
xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/mee tings/" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/x ml" =
xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" =
xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soap/oi s/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/di rectory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/20 02/1/alerts/"=
xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile " =
xmlns:udcp2p=3D"http://schemas.microsoft.com/data/udc/partto part" =
xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/wor kflow/" =
xmlns:dsss=3D"http://schemas.microsoft.com/office/2006/digsi g-setup" =
xmlns:dssi=3D"http://schemas.microsoft.com/office/2006/digsi g" =
xmlns:mdssi=3D"http://schemas.openxmlformats.org/package/200 6/digital-sig=
nature" =
xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compa tibility/2006=
" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns:mrels=3D"http://schemas.openxmlformats.org/package/200 6/relationshi=
ps" xmlns:spwp=3D"http://microsoft.com/sharepoint/webpartpages" =
xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/service s/2006/types"=
=
xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/service s/2006/messag=
es" =
xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/ SlideLibrary/=
" =
xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPor talServer/Pub=
lishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" =
xmlns:st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Anthony, I wrote a little method for my libraries which I =
use to
authenticate all of my web-based apps off of Active Directory =
(LDAP).<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>You will need to use the Net::LDAP module. This =
works on
all platforms.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Hope this helps,<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Scott<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>********************************************* **********<o:=
p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>=3Ditem =
B<ldap_authenticate()><o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>This method accepts a username, password, and an array of =
LDAP
servers, in that order. It returns a true/false code, and a =
message.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>IE: =
ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_li=
st)<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>=3Dcut<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>sub ldap_authenticate{<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; =
my($class,$username,$password, [at] ldap_servers)=3D [at] _;<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; #LDAP
Connect#<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; my
$ldap =3D Net::LDAP->new(\ [at] ldap_servers, async =3D> =
1);<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; <o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; if(!$ldap){<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
return("0","LDAP
ERROR! Cannot connect to LDAP =
server(s).");<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; =
} =
&=
nbsp; <o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; else{<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; #If
LDAP servers are listening, attempt BIND =
(Authentication)#<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; my
$msg=3D$ldap->bind("$username",password=3D>"$passwor=
d");<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
if($msg->error=3D~m/success/i){<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
&=
nbsp; =
$ldap->unbind; &n=
bsp; &nb=
sp; =
<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
&=
nbsp; return(1,"Successful
Logon");<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
}<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
else{<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
&=
nbsp; $ldap->unbind;<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
&=
nbsp; return(0,"Error:
" . $msg->error);<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p;  =
; =
}<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> &nbs=
p; }<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>}<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>********************************************* **********<o:=
p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>
<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0in 0in 0in'>
<p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >From:</span>=
</b><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >
activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] <b>On Behalf Of =
</b>anthony.okusanya [at] usbank.com<br>
<b>Sent:</b> Monday, June 08, 2009 8:46 AM<br>
<b>To:</b> ActivePerl [at] listserv.ActiveState.com<br>
<b>Subject:</b> Perl / CGI and IIS6<o:p></o:p></span></p>
</div>
<p class=3DMsoNormal><o:p> </o:p></p>
<p class=3DMsoNormal><br>
<span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'> Greetings =
Perl
experts</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'> =
I am trying to convert a ton of standalone tools written =
in perl
to be web based</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>these =
tools are
mostly windows administration tools. </span><br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Just =
looking
for some advice on using perl on IIS. I have used the CGI module</span> =
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>to =
create
dynamic pages but Im not sure how to handle things like =
authentication.</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>For =
instance I
would like to have my users authenticated against and Active Directory =
service</span>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>which =
will
validate what they can use on the site.<br>
<br>
<br>
Tony B. Okusanya</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'><br>
<br>
<br>
<br>
Tony B. Okusanya<br>
<br>
Windows Standards Group<br>
Phone (651)-962-2702<br>
Pager: 7639136132 [at] messaging.sprintpcs.com<br>
Cell: (763)-913-6132<br>
Fax: (651)-767-3122<br>
Mail Code:EP-MN-O2NS</span> <o:p></o:p></p>
<p>U.S. BANCORP made the following annotations<br>
------------------------------------------------------------ ---------<br>=
<span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'> Electronic
Privacy Notice. This e-mail, and any attachments, contains information =
that is,
or may be, covered by electronic communications privacy laws, and is =
also
confidential and proprietary in nature. If you are not the intended =
recipient,
please be advised that you are legally prohibited from retaining, using,
copying, distributing, or otherwise disclosing this information in any =
manner.
Instead, please reply to the sender that you have received this =
communication
in error, and then immediately delete it. Thank you in advance for your
cooperation.</span><br>
<br>
------------------------------------------------------------ ---------<o:p=
></o:p></p>
</div>
</body>
</html>
------_=_NextPart_001_01C9E838.C189AC88--
--===============1048266622==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1048266622==--
RE: Perl / CGI and IIS6
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Campbell, Scott
Sent: 08 June 2009 13:58
To: anthony.okusanya [at] usbank.com; ActivePerl [at] listserv.ActiveState.com
Subject: RE: Perl / CGI and IIS6
> Anthony, I wrote a little method for my libraries which I use to
authenticate all of my web-based apps off of
> Active Directory (LDAP).
> You will need to use the Net::LDAP module. This works on all
platforms.
>
> Hope this helps,
> Scott
>
Sorry to be picky when you are trying to help somebody, but I have a
couple of issues with your code.
> *******************************************************
> =item B<ldap_authenticate()>
>
> This method accepts a username, password, and an array of LDAP
servers, in that order. It returns a true/false > code, and a message.
> IE: ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list)
That example call doesn't appear to match the parameters in the sub
below.
>
> =cut
>
> sub ldap_authenticate{
> my($class,$username,$password, [at] ldap_servers)= [at] _;
>
> #LDAP Connect#
> my $ldap = Net::LDAP->new(\ [at] ldap_servers, async => 1);
>
> if(!$ldap){
> return("0","LDAP ERROR! Cannot
connect to LDAP server(s).");
> }
> else{
> #If LDAP servers are listening,
attempt BIND (Authentication)#
> my
$msg=$ldap->bind("$username",password=>"$password");
Try to avoid useless quoting. See 'perldoc -q quoting'
>
> if($msg->error=~m/success/i){
> $ldap->unbind;
> return(1,"Successful
Logon");
> }
> else{
> $ldap->unbind;
> return(0,"Error: " .
$msg->error);
> }
> }
> }
> *******************************************************
HTH
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl / CGI and IIS6
Brian Raven wrote:
> From: activeperl-bounces [at] listserv.ActiveState.com
> [mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
> Campbell, Scott
> Sorry to be picky when you are trying to help somebody, but I have a
> couple of issues with your code.
>
>> *******************************************************
>> =item B<ldap_authenticate()>
>>
>> This method accepts a username, password, and an array of LDAP
> servers, in that order. It returns a true/false > code, and a message.
>> IE: ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list)
>
> That example call doesn't appear to match the parameters in the sub
> below.
It kinda does if it's a 'method' rather than a plain old sub. Maybe better
written/documented in that case as:
$obj->ldap_authenticate('USER [at] mydomain.com', 'MYPass', [at] dc_list)
>>
>> =cut
>>
>> sub ldap_authenticate{
>> my($class,$username,$password, [at] ldap_servers)= [at] _;
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl / CGI and IIS6
Only a couple? Sorry about that, you're right. Since it's a method,
the call should be:
ldap_authenticate->("USER [at] mydomain.com","MYPass", [at] dc_list);
Note, if you are not that excited about putting this sub into a library
of your own, you can put it in locally in your script(s), remove the
"$class" variable in the incoming parameters, and then call as:
ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list);
You may quote me :)
Scott
-----Original Message-----
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Brian
Raven
Sent: Monday, June 08, 2009 9:41 AM
To: ActivePerl [at] listserv.ActiveState.com
Subject: RE: Perl / CGI and IIS6
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Campbell, Scott
Sent: 08 June 2009 13:58
To: anthony.okusanya [at] usbank.com; ActivePerl [at] listserv.ActiveState.com
Subject: RE: Perl / CGI and IIS6
> Anthony, I wrote a little method for my libraries which I use to
authenticate all of my web-based apps off of
> Active Directory (LDAP).
> You will need to use the Net::LDAP module. This works on all
platforms.
>
> Hope this helps,
> Scott
>
Sorry to be picky when you are trying to help somebody, but I have a
couple of issues with your code.
> *******************************************************
> =item B<ldap_authenticate()>
>
> This method accepts a username, password, and an array of LDAP
servers, in that order. It returns a true/false > code, and a message.
> IE: ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list)
That example call doesn't appear to match the parameters in the sub
below.
>
> =cut
>
> sub ldap_authenticate{
> my($class,$username,$password, [at] ldap_servers)= [at] _;
>
> #LDAP Connect#
> my $ldap = Net::LDAP->new(\ [at] ldap_servers, async => 1);
>
> if(!$ldap){
> return("0","LDAP ERROR! Cannot
connect to LDAP server(s).");
> }
> else{
> #If LDAP servers are listening,
attempt BIND (Authentication)#
> my
$msg=$ldap->bind("$username",password=>"$password");
Try to avoid useless quoting. See 'perldoc -q quoting'
>
> if($msg->error=~m/success/i){
> $ldap->unbind;
> return(1,"Successful
Logon");
> }
> else{
> $ldap->unbind;
> return(0,"Error: " .
$msg->error);
> }
> }
> }
> *******************************************************
HTH
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient or have received this e-mail in
error, please advise the sender immediately by reply e-mail and delete
this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in
this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl / CGI and IIS6
Bill's right. Ignore my naughty calls...long night/day already.
$obj->ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_lis t);
is correct.
Scott
-----Original Message-----
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Campbell, Scott
Sent: Monday, June 08, 2009 9:58 AM
To: Brian Raven; ActivePerl [at] listserv.ActiveState.com
Subject: RE: Perl / CGI and IIS6
Only a couple? Sorry about that, you're right. Since it's a method,
the call should be:
ldap_authenticate->("USER [at] mydomain.com","MYPass", [at] dc_list);
Note, if you are not that excited about putting this sub into a library
of your own, you can put it in locally in your script(s), remove the
"$class" variable in the incoming parameters, and then call as:
ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list);
You may quote me :)
Scott
-----Original Message-----
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Brian
Raven
Sent: Monday, June 08, 2009 9:41 AM
To: ActivePerl [at] listserv.ActiveState.com
Subject: RE: Perl / CGI and IIS6
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Campbell, Scott
Sent: 08 June 2009 13:58
To: anthony.okusanya [at] usbank.com; ActivePerl [at] listserv.ActiveState.com
Subject: RE: Perl / CGI and IIS6
> Anthony, I wrote a little method for my libraries which I use to
authenticate all of my web-based apps off of
> Active Directory (LDAP).
> You will need to use the Net::LDAP module. This works on all
platforms.
>
> Hope this helps,
> Scott
>
Sorry to be picky when you are trying to help somebody, but I have a
couple of issues with your code.
> *******************************************************
> =item B<ldap_authenticate()>
>
> This method accepts a username, password, and an array of LDAP
servers, in that order. It returns a true/false > code, and a message.
> IE: ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list)
That example call doesn't appear to match the parameters in the sub
below.
>
> =cut
>
> sub ldap_authenticate{
> my($class,$username,$password, [at] ldap_servers)= [at] _;
>
> #LDAP Connect#
> my $ldap = Net::LDAP->new(\ [at] ldap_servers, async => 1);
>
> if(!$ldap){
> return("0","LDAP ERROR! Cannot
connect to LDAP server(s).");
> }
> else{
> #If LDAP servers are listening,
attempt BIND (Authentication)#
> my
$msg=$ldap->bind("$username",password=>"$password");
Try to avoid useless quoting. See 'perldoc -q quoting'
>
> if($msg->error=~m/success/i){
> $ldap->unbind;
> return(1,"Successful
Logon");
> }
> else{
> $ldap->unbind;
> return(0,"Error: " .
$msg->error);
> }
> }
> }
> *******************************************************
HTH
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient or have received this e-mail in
error, please advise the sender immediately by reply e-mail and delete
this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in
this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl / CGI and IIS6
Bill Luebkert <> wrote:
> Brian Raven wrote:
>> From: activeperl-bounces [at] listserv.ActiveState.com
>> [mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
>> Campbell, Scott
>
>> Sorry to be picky when you are trying to help somebody, but I have a
>> couple of issues with your code.
>>
>>> ******************************************************* =item
>>> B<ldap_authenticate()>
>>>
>>> This method accepts a username, password, and an array of LDAP
>> servers, in that order. It returns a true/false > code, and a
>> message.
>>> IE: ldap_authenticate("USER [at] mydomain.com","MYPass", [at] dc_list)
>>
>> That example call doesn't appear to match the parameters in the sub
>> below.
>
> It kinda does if it's a 'method' rather than a plain old sub. Maybe
> better written/documented in that case as:
>
> $obj->ldap_authenticate('USER [at] mydomain.com', 'MYPass', [at] dc_list)
>
Yes, good point. Its good to see that you corrected the double quoting
as well, unless, of course, the array [at] mydomain is supposed to be
interpolated there.
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs