Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Does any one know how to call LDAP from UNIX script ?
I hope you can read UGLY Perl code.
HTH & YMMV!
#!/usr/local/bin/perl
# File: chg-oracle-passwd.cgi
use Net::LDAP;
use Carp;
use DBI;
$ENV{"ORACLE_HOME"} = "/db02/app/oracle/product/8.1.6";
print "Content-type: text/html\n\n";
print "<HTML>\n\n<BODY>\n\n";
#print "METHOD = $ENV{'REQUEST_METHOD'}\n";
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
$form_info = $ENV{'QUERY_STRING'};
}
elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
$form_info = '';
$bytes = $ENV{'CONTENT_LENGTH'};
read (STDIN, $form_info, $bytes);
}
@pairs = split(/&/, $form_info);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if ($name eq "UNAME") {
$istring = $value;
}
if ($name eq "PWORD") {
$passwd = $value;
}
if ($name eq "DATABASE") {
$dbase = $value;
}
}
#
my ($ldap, $res, $code);
$mypasswd = $passwd;
$myuid = $istring;
$ldap = Net::LDAP->new('ldap.mwh.com:389') || die "$@";
$mesg = $ldap->bind('cn=Directory Manager') || die("failed to bind with ",
$mesg->code(),"\n");
$res = $ldap->search
( base => "ou=People,o=mwh.com", filter => "&(uid=$myuid ) (!(objectclass=alias))", attrs => [] ) || die;
Steven Joshua wrote:
> > Hello: > > Hope the subject make sense. I'm new to LDAP, and > don't know how it works. > I need to use SQL Loader to load a text file into > Oracle817 Database from a unix box. The file/data > comes from LDAP server. My question is: how do I get > the file/object from LDAP site from my unix script? > > Does anyone has any examples? or know a helpful URL? > > Thanks > > From Steven > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - your guide to health and wellness > http://health.yahoo.com > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Steven Joshua > INET: wndyu_at_yahoo.com > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California -- Public Internet access / Mailing Lists > -------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an E-Mail message > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse charliem_at_mwh.com 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131Am I sure? Of course I'm sure. I could be wrong, but I'm sure for now!
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: charliem_at_mwh.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu May 02 2002 - 15:54:11 CDT
![]() |
![]() |