Changeset 11556 for issm/trunk-jpl/externalpackages/dyson/ldap.pl
- Timestamp:
- 02/27/12 16:38:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/externalpackages/dyson/ldap.pl
r11222 r11556 7 7 $bn="jplbadgenumber"; $txt="$bn".".txt"; $db="jplusers.db"; # Initialize values 8 8 # 9 system(`$ldb -x -h $lds -b $ou uid=* filter $bn > $txt`);# Execute LDAPsearch, write to file9 system(`$ldb -x -h $lds -b $ou uid=* uid > $txt`); # Execute LDAPsearch, write to file 10 10 # 11 11 open(I,"<$txt"); # Open input file handle 12 12 open(O,">badges.tmp"); # Open output file handle 13 13 while (<I>) { chomp($_); # Spool through input file 14 if ($_ =~"^uid=") {# If line begins with UID value,15 $_=~s/uid =//; $_=~s/,(.*)$//; $_=~s/\n//;# strip line of extraneous data14 if ($_ =~ "^uid: ") { # If line begins with UID value, 15 $_=~s/uid: //; $_=~s/,(.*)$//; $_=~s/\n//; # strip line of extraneous data 16 16 if (!($_=~/^\d\d\d\d\d\d/)) { print O "$_\n"; } # If UID is non-numeric, print output 17 17 } # Close condition
Note:
See TracChangeset
for help on using the changeset viewer.