You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(4) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(23) |
Feb
(18) |
Mar
(11) |
Apr
(3) |
May
(23) |
Jun
(13) |
Jul
(16) |
Aug
(11) |
Sep
(5) |
Oct
(4) |
Nov
(2) |
Dec
(4) |
2003 |
Jan
(18) |
Feb
(13) |
Mar
(56) |
Apr
(3) |
May
(124) |
Jun
(21) |
Jul
(2) |
Aug
(8) |
Sep
(1) |
Oct
(23) |
Nov
(4) |
Dec
(2) |
2004 |
Jan
(18) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Clif H. <ch...@us...> - 2003-02-13 02:18:21
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv23985/ldap/contrib Modified Files: tklkup Log Message: Corrected an error in the resetting of the Global max variable when a new schema is pulled. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 2.1 retrieving revision 2.2 diff -u -d -r2.1 -r2.2 --- tklkup 11 Feb 2003 03:41:01 -0000 2.1 +++ tklkup 13 Feb 2003 02:18:18 -0000 2.2 @@ -2359,9 +2359,9 @@ &schema_clear(); -my $dt = "/tmp/schema.dat.$$"; +$Global{'max'} = 0; # Reset objectclass name lenght. -#if ( $Global{'sclear'} ) { &schema_clear(); } +my $dt = "/tmp/schema.dat.$$"; if ( ! defined($Global{ldap}) ) { |
From: Clif H. <ch...@us...> - 2003-02-11 03:41:07
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv12600/ldap/contrib Modified Files: tklkup Log Message: Added code to prevent a race condition when automatically pulling the directory's schema. General clean up of code; removed commented out code, excessive white space, etc. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 2.0 retrieving revision 2.1 diff -u -d -r2.0 -r2.1 --- tklkup 10 Feb 2003 04:06:42 -0000 2.0 +++ tklkup 11 Feb 2003 03:41:01 -0000 2.1 @@ -109,11 +109,11 @@ # Handle the command line parameter(s) #-------------------------------------------------------- -getopts( 'hrd:' ); +getopts( 'hnrd:' ); Usage() if ( $opt_h ); -my $debug = $opt_d ? 1 : 0; +my $debug = $opt_n ? 1 : 0; # Fork this process on start up. # @@ -236,7 +236,7 @@ $splash = undef(); -$Global{mainWindow}->repeat(1000, \&update_schema); +$Global{schema_timer} = $Global{mainWindow}->repeat(1000, \&update_schema); # # Run the Main loop looking for events. # @@ -260,9 +260,13 @@ sub update_schema { -&schema if ( $Global{schemaServer} ne $Global{LDAP_SERVER} ); -$Global{schemaServer} = $Global{LDAP_SERVER} - if ( $Global{schemaServer} ne $Global{LDAP_SERVER} ); +if ( $Global{schemaServer} ne $Global{CORE_SERVER} ) +{ +$Global{schema_timer}->cancel; +&schema if ( $Global{schemaServer} ne $Global{CORE_SERVER} ); +$Global{schemaServer} = $Global{LDAP_SERVER}; +$Global{schema_timer} = $Global{mainWindow}->repeat(1000, \&update_schema); +} } # End of subroutine update_schema @@ -1293,7 +1297,7 @@ # Destroy the dn history list if it exists. # $Global{'searchHList'}->delete('all') if Tk::Exists($Global{'searchHList'}); - + # # Parameter(s) to return # @@ -1389,7 +1393,7 @@ } } - + # # Display the DN search results list box. # @@ -1412,7 +1416,6 @@ ERROR($mesg->code); } - # # Create Hierarchial DN list box data tree, # and display data. @@ -1444,7 +1447,6 @@ ERROR( \$@ ) if ( $@ ); - # # Get and print out the record attributes. # @@ -1603,14 +1605,13 @@ if ( !$error ) { - if ( $Global{'CORE_SERVER'} ne $Global{'LDAP_SERVER'} && defined($server{$Global{'LDAP_SERVER'}} ) ) { # user defined base my $t1 = []; $NC{$server{$Global{'LDAP_SERVER'}}} = [ "0" ]; # dummy load in position 0 ${$NC{$server{$Global{'LDAP_SERVER'}}}}[1] = $t1; # - push(@$t1, getBases($Global{'LDAP_SERVER'}, $server{$Global{'LDAP_SERVER'}})); + push(@$t1, getBases($Global{'LDAP_SERVER'}, $server{$Global{'LDAP_SERVER'}})); } elsif ( $Global{setVersion} == 3 ) @@ -1639,7 +1640,7 @@ # # Create the cascade search base menus -# +# @NcKeys = sort(keys(%NC)); foreach ( @NcKeys ) @@ -1675,7 +1676,6 @@ $sbmenu->entryconfigure("$Nclabel", -menu => @{$NC{$Nclabel}}[0]); } - } else { @@ -1757,7 +1757,8 @@ $msgbox->insert("0.0", $@) if ($@ && Tk::Exists($msgbox)) ; return -1; } - $Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, + +$Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, timeout => 1, port => $Global{'port'}, debug => $opt{d}, @@ -1800,18 +1801,6 @@ } # End of subroutine dirConn - - - - - - - - - - - - # # Detect and record the sub-bases, or branches, of the directory. # @@ -1930,7 +1919,7 @@ } return @new_base; -} +} } # End of subroutine calBase() # @@ -1945,7 +1934,8 @@ $Global{'vert'} = $pos[2]; } # End of subrountine globalPos - sub root_cancel + +sub root_cancel { $Global{'rootWindow'}->destroy if Tk::Exists($Global{'rootWindow'}); } # End of subrountine root_cancel @@ -1992,18 +1982,6 @@ } # End of displayPhoto - - - - - - - - - - - - # # Create Main Error Window # @@ -2067,14 +2045,6 @@ } # End of ERROR subroutine - - - - - - - - # # LDAP Error check, some return codes are not really errors. # You can retry the ldap action after waiting a while. @@ -2113,9 +2083,6 @@ } # End of subrountine CheckError - - - # # Create Main Bind Window # @@ -2353,16 +2320,7 @@ } } -} - - - # - # Get the various other items associated with - # this attribute. - # -# next if ( $value eq 'type'); - -# $value =~ tr/a-z/A-Z/; +} } @@ -2793,7 +2751,7 @@ $Global{'histWindow'}->raise() if Tk::Exists($Global{'histWindow'}); } -} +} $Global{'histWindow'}->geometry("+$x+$y"); # @@ -3354,7 +3312,6 @@ $acframe -> Button(-text => " ACCEPT DATA CHANGE ", -command => \&makeChanges, -# -command => [ \&makeChanges,\$ADD,\$DELETE,\$REPLACE ], -font => $Global{'Font'}, -borderwidth => 3 ) ->pack( -fill => 'both' ); @@ -3418,19 +3375,6 @@ $Global{'newAttributeReady'} = 1 ; } - - -# -## -## Create process add new attribute button -## -# -#$Global{'changeWindow'}->Button(-text => "ADD\nATTRIBUTE", -# -command => [\&add_attribute, $attr, $Value, \$outerframe], -# -font => $Global{'Font'}, -borderwidth => 5 ) -# -> pack(-side => $Global{'hand'}, -# -padx => 2, -pady => 2 ) ; - # # Create process Add button @@ -3509,12 +3453,10 @@ $Global{'tmpDELETE'}{$$attr} = $$Value; $Global{'tmpADD'}{$$attr} = $$tbox->get('1.0','1.end'); -# print '|',$Global{'tmpREPLACE'}{$$attr},"|\n"; } else { $Global{'tmpREPLACE'}{$$attr} = $$tbox->get('1.0','1.end'); -# print '||',$Global{'tmpREPLACE'}{$$attr},"||\n"; } @@ -3619,7 +3561,7 @@ $Global{tmpREPLACE} = {}; $Global{'changeWindow'}->destroy if Tk::Exists($Global{'changeWindow'}); -} # End of cancel subroutine +} # End of cancel subroutine @@ -4674,9 +4616,10 @@ #----------------------------------------# sub Usage { - print( "Usage: [-h] | [-d]\n" ); - print( "\t-d Debug mode. Display debug messages to stdout.\n" ); - print( "\t Will not fork process.\n" ); + print( "Usage: [-h] | [-d <#> ] | [-n]\n" ); + print( "\t-d Perl-LDAP debug mode. Display debug messages to stdout.\n" ); + print( "\t Should be used with -n so that process will not fork a\n" ); + print( "\t new process.\n" ); print( "\t Value: 0 - display tklkup messages only.\n" ); print( "\t Value: 1 - Show outgoing packets (using asn_hexdump).\n" ); print( "\t Value: 2 - Show incoming packets (using asn_hexdump).\n" ); @@ -4684,6 +4627,7 @@ print( "\t Value: 8 - Show incoming packets (using asn_dump).\n" ); print( "\t These values can be add to display several functions.\n" ); print( "\t-h Help. Display this message.\n" ); + print( "\t-n Tklkup debug mode. Display debug messages to stdout.\n" ); print( "\n" ); print( "\t Perldoc pod documentation is included in this script.\n" ); print( "\t To read the pod documentation do the following;\n" ); |
From: Clif H. <ch...@us...> - 2003-02-10 04:06:46
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv13580/ldap/contrib Modified Files: Tag: 2.0 tklkup Log Message: Almost a total rewrite of tklkup and almost total change up of GUI. The changes are to numerous to mention, but a few major items are the use of notebook panes, saving information to ldif files, limited entry modification with ldif files, limited entry creation from ldif files, auto lookup of schema information. CVS number was increased to 2.0. --- NEW FILE: tklkup --- #!/usr/local/bin/perl # # Copyright (c) 1999 - 2003 Clif Harden. All Rights Reserved # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU GENERAL PUBLIC LICENSE. #---------------------------------------------------------------------------- # # This program was originally written by Clif Harden. # Some of the software in the LDAP search subroutine was orginally # written by Graham Barr. It is based on Graham Barr's PERL LDAP # module and the PERL TK module. # Both modules are available from the CPAN.org system. # # $Id: tklkup,v 2.0 2003/02/10 04:06:42 charden Exp $ # # Purpose: This program is designed to retrieve data from a LDAP # directory and display on the graphical user interface # created by this program. This program can edit the data # retrieved from the directory. [...5463 lines suppressed...] Since the script is in PERL, feel free to modify it if it does not meet your needs. This is one of the main reasons I did it in PERL. If you make an addition to the code that you feel other individuals could use let me know about it. I may incorporate your code into my code. =head1 AUTHOR Clif Harden <ch...@po...> If you find any errors in the code please let me know at ch...@po.... =head1 COPYRIGHT Copyright (c) 1999-2003 Clif Harden. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut |
From: Clif H. <ch...@us...> - 2003-02-05 04:58:00
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv20228/ldap/contrib Modified Files: tklkup Log Message: Removed an unused label in the ldapAction window. Added state checking before calling deiconify method, if needed then call deiconify method. Added raise method to the display search window. Moved startup location of ldapAction window, causes a slight overlap between the ldapAction window and the displaySearch window, and this is used to play a trick on the displaySearch window raising. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- tklkup 1 Feb 2003 05:46:56 -0000 1.42 +++ tklkup 5 Feb 2003 04:57:57 -0000 1.43 @@ -1508,8 +1508,14 @@ } else { -$Global{'schemaWindow'}->deiconify() if Tk::Exists($Global{'schemaWindow'}); -$Global{'schemaWindow'}->raise() if Tk::Exists($Global{'schemaWindow'}); + my $wstate = $Global{'schemaWindow'}->state(); + if ( $wstate =~ /iconic/ || $wstate =~ /withdrawn/ ) + { + $Global{'schemaWindow'}->deiconify() + if Tk::Exists($Global{'schemaWindow'}); + $Global{'schemaWindow'}->raise() + if Tk::Exists($Global{'schemaWindow'}); + } } sub schema_clear { @@ -1952,16 +1958,23 @@ eval { $Global{'histWindow'} = MainWindow->new(); + $Global{'histWindow'}->title("HIERARCHICAL OBJECTCLASS DISPLAY WINDOW"); }; - print "$@" if ( defined($@)); } + ERROR(\$@) if ( $@ ); +} else { -$Global{'histWindow'}->deiconify() if Tk::Exists($Global{'histWindow'}); -$Global{'histWindow'}->raise() if Tk::Exists($Global{'histWindow'}); + my $wstate = $Global{'histWindow'}->state(); + if ( $wstate =~ /iconic/ || $wstate =~ /withdrawn/ ) + { + $Global{'histWindow'}->deiconify() + if Tk::Exists($Global{'histWindow'}); + $Global{'histWindow'}->raise() + if Tk::Exists($Global{'histWindow'}); + } } $Global{'histWindow'}->geometry("+$x+$y"); -$Global{'histWindow'}->title("HIERARCHICAL OBJECTCLASS DISPLAY WINDOW"); # # Create label box # @@ -2218,7 +2231,7 @@ $Global{'ldapActionDN'} = shift; &globalPos(); -my $x = $Global{'horz'} + 0; +my $x = $Global{'horz'} + 20; my $y = $Global{'vert'} + 30; # @@ -2310,13 +2323,14 @@ } my $objects = $Global{'ldapActionDN'}; +&displaySearch(); # create the entry data display window. + delete($Global{'ldapActionDN'}); $Global{'ldapActionWindow'}->destroy() if Tk::Exists($Global{'ldapActionWindow'}); delete($Global{'ldapActionWindow'}); -&displaySearch(); # create the entry data display window. # clear the entry data display window. if ( $display_clear ) { &display_clear(); } @@ -3246,11 +3260,19 @@ $list->pack(-fill => "both", -expand => 1 ); } -#else -#{ -#$displayWindow->deiconify() if Tk::Exists($displayWindow); -#$displayWindow->raise() if Tk::Exists($displayWindow); -#} +else +{ + + $displayWindow->update; + my $wstate = $displayWindow->state(); + if ( $wstate =~ /iconic/ || $wstate =~ /withdrawn/ ) + { + $displayWindow->deiconify() + if Tk::Exists($displayWindow); + } + $displayWindow->raise() + if Tk::Exists($displayWindow); +} sub display_clear { @@ -3265,7 +3287,6 @@ sub display_cancel{ -# $displayWindow->withdraw if Tk::Exists($displayWindow); $displayWindow->destroy if Tk::Exists($displayWindow); } # End of cancel subroutine @@ -3586,24 +3607,26 @@ eval { $Global{'searchHistWindow'} = MainWindow->new(); + $Global{'searchHistWindow'}->title("SEARCH RESULTS"); }; - print "$@" if ( defined($@)); } + ERROR(\$@) if ( $@ ); + +} else { -$Global{'searchHistWindow'}->deiconify() if Tk::Exists($Global{'searchHistWindow'}); -$Global{'searchHistWindow'}->raise() if Tk::Exists($Global{'searchHistWindow'}); + + my $wstate = $Global{'searchHistWindow'}->state(); + if ( $wstate =~ /iconic/ || $wstate =~ /withdrawn/ ) + { + $Global{'searchHistWindow'}->deiconify() + if Tk::Exists($Global{'searchHistWindow'}); + } + $Global{'searchHistWindow'}->raise() + if Tk::Exists($Global{'searchHistWindow'}); } $Global{'searchHistWindow'}->geometry("+$x+$y"); -$Global{'searchHistWindow'}->title("SEARCH RESULTS"); -# -# Create label box -# -if ( !Exists($Global{'label'}) ) -{ -$Global{'searchLabel'} = $Global{'searchHistWindow'}->Label()->pack; -} # # Create process Exit button @@ -3643,6 +3666,7 @@ ); # End of Scrolled HList. + sub histSearch_clear { # @@ -3829,7 +3853,7 @@ $Global{'searchHList'}->pack(-side => "right"); }; # End of eval -print "$@" if ( defined($@)); +ERROR( \$@ ) if ( $@ ); # |
From: Clif H. <ch...@us...> - 2003-02-01 05:46:59
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv31033/ldap/contrib Modified Files: tklkup Log Message: Made numerous changes, and corrected several errors, to error display code. Condensed all connect (new) and bind calls to one subroutine. Removed all calls to the perl function "die". If the program terminates now it is due to a software crash or the user hit the EXIT button. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- tklkup 27 Jan 2003 17:46:21 -0000 1.41 +++ tklkup 1 Feb 2003 05:46:56 -0000 1.42 @@ -1,6 +1,6 @@ #!/usr/local/bin/perl # -# Copyright (c) 1999 - 2001 Clif Harden. All Rights Reserved +# Copyright (c) 1999 - 2003 Clif Harden. All Rights Reserved # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU GENERAL PUBLIC LICENSE. #---------------------------------------------------------------------------- @@ -98,6 +98,7 @@ $Global{'records'} = 0; $Global{'mwwidth'} = 600; $Global{'mwheight'} = 430; +$Global{dirConnError} = undef(); my $sbbframe; my @base = (); @@ -115,12 +116,8 @@ my $debug = $opt_d ? 1 : 0; -# -# - # Fork this process on start up. # -# # If not in debug mode; # Fork a child process and kill the parent. # (That sounds nasty) @@ -162,13 +159,11 @@ my $rbsn; my $rbmail; my $rbclear; -#my $mainWindow; my $lframe; my $sframe; my $aframe; my $tframe; my $bframe; -#my $sbmenu; my @attribute = (); my @server = (); @@ -338,53 +333,15 @@ # Default directory search base. # - # - # Find the branches of the directory. - # - -$error = 0; - -if ( $Global{port} == 636 ) -{ - -eval -{ - require Net::LDAPS; -}; -if ($@) -{ -$msgbox->insert("0.0", $@) if ($@); -return; -} - -$Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ -$Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} +$error = dirConn(); # connect and bind to the directory. if ( !$error ) { -$mesg = $Global{ldap}->bind( password => "$Global{'bindpw'}", - dn => "$Global{'binddn'}", - version => $Global{'setVersion'}, - ); - -if ( $mesg->code && $mesg->code != 48 ) -{ - $errstr = $mesg->code; - ERROR($errstr); -} -if ( $mesg->code || $Global{setVersion} ) +# +# Find the branches of the directory. +# + +if ( !$error || $Global{setVersion} ) { if ( defined($server{$server[0]}) ) @@ -427,14 +384,19 @@ } } - #$Global{ldap}->unbind if ( defined($Global{ldap}) ); - #$Global{ldap} = undef if ( defined($Global{ldap}) ); } } } else { - print "Error: $@\n"; + if ( defined($Global{dirConnError}) ) + { + ERROR(\$Global{dirConnError}); + } + else + { + ERROR($error); + } } @@ -453,7 +415,7 @@ $splash->update() if ( $Global{splash} ); -$Global{'mainWindow'}->title("DIRECTORY SEARCH"); +$Global{'mainWindow'}->title("TKLKUP"); # # Default directory search attributes. @@ -484,13 +446,12 @@ # Create process Exit button # -$Global{'mainWindow'}->Button(-text => "EXIT", +$Global{'mainWindow'}->Button(-text => "EXIT THE APPLICATION", -command => sub{ exit; }, -font => $Global{'Font'}, -borderwidth => 5 ) -> pack(-fill => "both", -padx => 5, -pady => 2 ) ; - $dsaframe = $Global{'mainWindow'}->Frame() ->pack( -fill => "both", -side => "top" ); @@ -625,11 +586,11 @@ # Create Search Directory button # -$bframe -> Button(-text => "SEARCH DIRECTORY", -command => \&search, +$bframe -> Button(-text => "SEARCH THE DIRECTORY", + -command => \&search, -font => $Global{'Font'}, -borderwidth => 3 ) -> pack( -fill => "both"); - $attframe = $Global{'mainWindow'}->Frame() ->pack( -fill => "both", -side => "bottom"); @@ -718,10 +679,6 @@ if ( $Global{splash} ); $splash->update() if ( $Global{splash} ); -##$cframe -> Button(-text => "OBTAIN ROOT DSE ENTRY", -## -command => \&rootDse, -## -font => $Global{'Font'}, -borderwidth => 3 ) -## -> pack( -side => $Global{'hand'} ); # # Create left attribute selection frame @@ -888,42 +845,14 @@ @BaseButton = (); # Delete the old stuff. @NcKeys = (); # Delete the old stuff. -if ( $Global{port} == 636 ) -{ -$Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ -$Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} - $msgbox->delete("0.0", "end"); $msgbox->update(); -if ( !$error ) -{ - -$mesg = $Global{ldap}->bind( password => "$Global{'bindpw'}", - dn => "$Global{'binddn'}", - version => $Global{'setVersion'}, - ); +$error = dirConn(); -if ( $mesg->code && $mesg->code != 48 ) +if ( !$error ) { -$errstr = $mesg->code; -ERROR($errstr); -} -if ( !$mesg->code || $Global{setVersion} == 3 ) -{ if ( $Global{'CORE_SERVER'} ne $Global{'LDAP_SERVER'} && defined($server{$Global{'LDAP_SERVER'}} ) ) { @@ -934,7 +863,7 @@ push(@$t1, getBases($Global{'LDAP_SERVER'}, $server{$Global{'LDAP_SERVER'}})); } -else +elsif ( $Global{setVersion} == 3 ) { my $entry; # use root_dse to find the bases @@ -956,11 +885,6 @@ } } -# $Global{ldap}->unbind if ( defined($Global{ldap})); -# $Global{ldap} = undef if ( defined($Global{ldap})); - -} - } # @@ -1005,8 +929,15 @@ } else { -$msgbox->insert("1", "Connection error."); - + if ( defined($Global{dirConnError}) ) + { + ERROR(\$Global{dirConnError}); + $msgbox->insert("1", "$Global{dirConnError}"); + } + else + { + ERROR($error); + } } if ( @NcKeys) @@ -1026,21 +957,6 @@ } # End of server subroutine -#sub attribute { - -# -# Build a correct Filter string from the data -# passed from the Additional Attributes -# radiobutton selection. -# - -#my $tmp = "(" . $uid . "="; - -#$info = $tmp; - -#} # End of attribute subroutine - - sub base { # @@ -1149,9 +1065,11 @@ } else { +$Global{'bindWindow'}->Busy(-recurse => 1); $Global{'binddn'} = $dn_data; $Global{'bindpw'} = $pw_data; &server; +$Global{'bindWindow'}->Unbusy; } } @@ -1211,8 +1129,8 @@ $errlist->pack(-fill => "both", -expand => 1 ); } -$errlist->insert("end", "Error Code: $errcode"); -$errlist->insert("end", ""); +$errlist->insert("end", "Error Code: $errcode") if ( !ref($errcode) ); +$errlist->insert("end", "") if ( !ref($errcode) ); foreach my $msg ( @errmsg ) { @@ -1410,14 +1328,15 @@ { $Global{'schemaWindow'} = MainWindow->new; -$Global{'schemaWindow'}->title("DIRECTORY SCHEMA SEARCH"); +$Global{'schemaWindow'}->title("DIRECTORY SCHEMA DISPLAY"); $Global{'schemaWindow'}->geometry("+$x+$y"); # # Create process Exit button # -$Global{'schemaWindow'}->Button( -text => "CLOSE SCHEMA SEARCH WINDOW", +$schemaExit = $Global{'schemaWindow'}->Button( + -text => "EXIT SCHEMA DISPLAY", -command => \&schema_cancel, -font => $Global{'Font'}, -borderwidth => 5 ) -> pack(-fill => "both", -padx => 2, -pady => 2 ) ; @@ -1625,19 +1544,6 @@ $schemaHash{'obj'} = {}; $schemaHash{'tree'} = {}; -#my %obj = (); -#my %tree = (); - -#my @atts = (); -#my @ocs = (); -#my @mrs = (); -#my @nfm = (); -#my @lsyn = (); -#my @dits = (); -#my @ditc = (); -#my @mru = (); - - my $dt = "/tmp/schema.dat.$$"; @@ -1649,40 +1555,18 @@ # # Connect to directory server # - -if ( $Global{port} == 636 ) -{ - $Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ - $Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} +$error = dirConn(); if ( $error == 1 ) { - $schema_list->insert("end", "Connect error: $@\n"); - return; -} - -$mesg = $Global{ldap}->bind( password => "$Global{'bindpw'}", - dn => "$Global{'binddn'}", - version => $Global{'setVersion'}, - ); - - -if ( $mesg->code && $mesg->code != 48 ) -{ - $errstr = $mesg->code; - ERROR($errstr); + if ( defined($Global{dirConnError}) ) + { + $schema_list->insert("end", "$Global{dirConnError}\n"); + } + else + { + ERROR($error); + } return; } @@ -2995,40 +2879,21 @@ if ( !defined($Global{ldap}) ) { -if ( $Global{port} == 636 ) -{ -$Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ -$Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -if ( $error == 1 ) -{ - $errstr = "Delete connect error on ldap server $Global{'LDAP_SERVER'}\n"; - ERROR($errstr); - return; -} - -$mesg = $Global{ldap}->bind( password => $Global{'bindpw'}, - dn => $Global{'binddn'}, - version => $Global{'setVersion'}, - ); +$error = dirConn(); -if ( $mesg->code ) +if ( $error == 1 ) { - $errstr = $mesg->code; - ERROR($errstr); - return; + if ( defined($Global{dirConnError}) ) + { + $error = "ldapActionDelete $Global{dirConnError}"; + ERROR(\$error); + } + else + { + ERROR($error); + } + return; } } @@ -3089,43 +2954,23 @@ if ( !defined($Global{ldap}) ) { -if ( $Global{port} == 636 ) -{ -$Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ -$Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} + +$error = dirConn(); if ( $error == 1 ) { - $list->insert("end", "Connect error: $@\n"); - return; - $errstr = "Rename connect error on ldap server $Global{'LDAP_SERVER'}\n"; - ERROR($errstr); + if ( defined($Global{dirConnError}) ) + { + $error = "ldapActionRename $Global{dirConnError}"; + ERROR(\$error); + return; + } + else + { + ERROR($error); + } } -$mesg = $Global{ldap}->bind( password => $Global{'bindpw'}, - dn => $Global{'binddn'}, - version => $Global{'setVersion'}, - ); - - -if ( $mesg->code ) -{ - $errstr = $mesg->code; - ERROR($errstr); - return; -} } @@ -3544,42 +3389,23 @@ if ( !defined($Global{ldap}) ) { -if ( $Global{port} == 636 ) -{ - $Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ - $Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} + +$error = dirConn(); if ( $error == 1 ) { - $errstr = "Connect error: $@\n"; - ERROR($errstr); - return; + if ( defined($Global{dirConnError}) ) + { + $error = "changeEntry $Global{dirConnError}"; + ERROR(\$error); + } + else + { + ERROR($error); + } + return; } -$mesg = $Global{ldap}->bind( password => $Global{'bindpw'}, - dn => $Global{'binddn'}, - version => $Global{'setVersion'}, - ); - -if ( $mesg->code ) -{ - $errstr = $mesg->code; - ERROR($errstr); - return; -} - } # # Execute any LDAP add changes. @@ -3925,46 +3751,28 @@ if ( $error == 1 ) { - ERROR("Bad filter $match."); + $error = "Bad filter $match."; + ERROR(\$error); return; } if ( !defined($Global{ldap}) ) { -if ( $Global{port} == 636 ) -{ - $Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ - $Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -if ( $error == 1 ) -{ - ERROR("Connect error: $@"); - return; -} - -$mesg = $Global{ldap}->bind( password => $Global{'bindpw'}, - dn => $Global{'binddn'}, - version => $Global{'setVersion'}, - ); - +$error = dirConn(); -if ( $mesg->code && $mesg->code != 48 ) +if ( $error == 1 ) { - $errstr = $mesg->code; - ERROR($errstr); - return; + if ( defined($Global{dirConnError}) ) + { + $error = "search $Global{dirConnError}"; + ERROR(\$error); + } + else + { + ERROR($error); + } + return; } } @@ -4057,7 +3865,8 @@ { foreach (@ref ) { - ERROR("LDAP Referral: $_"); + my $rvar = "LDAP Referral: $_"; + ERROR(\$rvar); } } @@ -4164,6 +3973,7 @@ my @base = (); my $ptr; my $match; +my $error = 0; # initialize error flag. if ( $Global{'nismapname'} ) { @@ -4176,9 +3986,15 @@ { $match = "(|(o=*)(ou=*))"; #search only for ou entries. } -my $error = 0; # initialize error flag. -my $f = Net::LDAP::Filter->new($match) or die "Bad filter '$match'"; +my $f = Net::LDAP::Filter->new($match) or $error = 1; + +if ( $error ) +{ +$error = "getBases subroutine Bad filter $match"; +ERROR(\$error); +return @base; +} push(@base,$base); $ptr = 0; @@ -4281,32 +4097,27 @@ my $error; my $mesg; -#if ( $Global{'setVersion'} != 3 ) -#{ -# $error = "LDAP version is not equal to 3."; -# ERROR(\$error); -# return; -#} +$error = 0; if ( !defined($Global{ldap} ) ) { -if ( $Global{port} == 636 ) -{ -$Global{ldap} = new Net::LDAPS($Global{'LDAP_SERVER'}) or die; -} -else -{ -$Global{ldap} = new Net::LDAP($Global{'LDAP_SERVER'}) or die; -} -$mesg = $Global{ldap}->bind( version => $Global{'setVersion'} ) or die; -if ( $mesg->code ) -{ - $error = $mesg->code; - ERROR($error); - return if ( $mesg->code != 48 ); +$error = dirConn(); +if ( $error ) +{ + if ( defined($Global{dirConnError}) ) + { + $error = "rootDSE $Global{dirConnError}"; + ERROR(\$error); + } + else + { + ERROR($error); + } + return; } + } my $root = $Global{ldap}->root_dse(); @@ -4386,6 +4197,81 @@ } # End of subrountine rootDse + +# +# Make the correction and bind to the directory server. +# + +sub dirConn +{ +my $error; +$error = 0; + +$Global{dirConnError} = undef(); + + # + # Make the connection to the directory server + # + + +if ( $Global{port} == 636 ) +{ + +eval +{ + require Net::LDAPS; +}; +if ($@) +{ +$msgbox->insert("0.0", $@) if ($@ && Tk::Exists($msgbox)) ; +return -1; +} + +$Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, + timeout => 1, + port => $Global{'port'}, + debug => $opt{'d'}, + ) or $error = 1; +if ( $error ) +{ +$Global{dirConnError} = "LDAPS connection error to $Global{'LDAP_SERVER'}."; +return 1; +} + +} +else +{ +$Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, + timeout => 1, + port => $Global{'port'}, + debug => $opt{'d'}, + ) or $error = 1; +if ( $error ) +{ +$Global{dirConnError} = "LDAP connection error to $Global{'LDAP_SERVER'}."; +return 1; +} + +} + +$mesg = $Global{ldap}->bind( password => "$Global{'bindpw'}", + dn => "$Global{'binddn'}", + version => $Global{'setVersion'}, + ); + +if ( $mesg->code && $mesg->code != 48 ) +{ +# $errstr = $mesg->code; +# ERROR($errstr); + return $mesg->code; +} + + +return 0; + +} # End of subroutine dirConn + + # # Determine new mainWindow position. # @@ -4508,11 +4394,11 @@ There are 5 commands that can be used with this file; hand, attribute, server, limit, and port. -mwwidth -> numeric value: Default 600 main window width in - pixels, user may need to adjust this. + mwwidth -> numeric value: Default 600 main window width in + pixels, user may need to adjust this. -mwheight -> numeric value: Default is 430 main window height in - pixels, user may need to adjust this. + mwheight -> numeric value: Default is 430 main window height in + pixels, user may need to adjust this. hand -> values: left or right. Defines where the attribute label box will be place. @@ -4629,7 +4515,7 @@ ------------------------------------------------------------------- -=head1 Directory Search Menu Bar +=head1 Tklkup Menu Bar At the top of the GUI is the main menu bar. It has 3 drop down menus; "Directory OPS", "Set Bind Credentials", and @@ -4638,7 +4524,7 @@ The I<DIRECTORY OPS> button will activate a drop down menu that has 2 menu selections; -The I<Explore ROOT DSE> menu will attempt to obtain the +The I<EXPLORE ROOT DSE> menu will attempt to obtain the root dse entry for the selected directory server. If the root dse entry is obtained a separate window will be displayed that will display the information obtained from the root dse entry. @@ -4701,10 +4587,10 @@ ------------------------------------------------------------------- -=head1 Directory Search GUI +=head1 Tklkup GUI -I<Exit> button. Just below the main menu bar is the "Exit" -button. When a mouse click is done on the "Exit" button +I<EXIT THE APPLICATION> button. Just below the main menu bar is +the "Exit" button. When a mouse click is done on the "Exit" button the program will terminate. The I<LDAP VERSION> "RadioButton" diamond will select the @@ -4753,6 +4639,11 @@ SEARCH BASE text box will display the directory search base that is selected. +The I<Process Messages> text window is where process messages +will be displayed. The messages are indicators of what is +happening during the excution of the program. By selecting +a line of text and moving the cursor up or down, the user +can scroll thru the messages. The I<SELECT ADDITIONAL ATTRIBUTES> button will activate a drop down menu. From the menu the user will select the @@ -4794,15 +4685,16 @@ I<COMPLETE> filter is entered, the program will not modify this string in any way. -I<SEARCH> button. At the bottom of the GUI is the "Search" -button. When a mouse click is done on the "Search" button -the program will execute a ldap search. +I<SEARCH THE DIRECTORY> button. At the bottom of the GUI is +the "Search" button. When a mouse click is done on the +"SEARCH THE DIRECTORY" button the program will execute a ldap search +of the directory. ------------------------------------------------------------------- =head1 Display Search Results -When the SEARCH DIRECTORY button is pressed the Search Results +When the SEARCH THE DIRECTORY button is pressed the Search Results window will be displayed. At the top of the GUI is the "Close Display Search Result Window" @@ -5072,18 +4964,18 @@ directory server. The directory server to be searched is selected from the Directory Search window. -=head2 Directory Schema Search Window Operation +=head2 Directory Schema Display Window Operation When the Explore Directory Schema button is pressed in the -Directory Search window, the Directory Schema Search window +Directory Search window, the Directory Schema Display window will be displayed on your computer. The graphical user interface, GUI, has several sections to it. -At the top of the GUI is the "Close Schema Search Window" button. +At the top of the GUI is the "Exit Schema Display" button. When a mouse click is done on the "Close Schema Search Window" button the schema window will be destroyed. -The Directory Schema Search window can be destroyed by +The Directory Schema Display window can be destroyed by enabling the proper window manager destroy function. When the Write Data To File RadioButton is selected the |
From: Graham B. <gb...@us...> - 2003-01-27 18:24:28
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory sc8-pr-cvs1:/tmp/cvs-serv31563/lib/Net Modified Files: LDAP.pm Log Message: Release 0.2701 Index: LDAP.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- LDAP.pm 27 Jan 2003 16:33:16 -0000 1.39 +++ LDAP.pm 27 Jan 2003 18:24:15 -0000 1.40 @@ -22,7 +22,7 @@ LDAP_INAPPROPRIATE_AUTH ); -$VERSION = "0.27"; +$VERSION = "0.2701"; @ISA = qw(Net::LDAP::Extra); $LDAP_VERSION = 3; # default LDAP protocol version |
From: Clif H. <ch...@us...> - 2003-01-27 17:46:28
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv7964/ldap/contrib Modified Files: tklkup Log Message: Corrected default numbers for gui height and width. Corrected error in gui height and width geometry initialization. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- tklkup 25 Jan 2003 05:17:24 -0000 1.40 +++ tklkup 27 Jan 2003 17:46:21 -0000 1.41 @@ -96,8 +96,8 @@ $Global{'infoFilter'} = "equal"; $Global{'nismapname'} = 0; $Global{'records'} = 0; -$Global{'mwwidth'} = 400; -$Global{'mwheight'} = 540; +$Global{'mwwidth'} = 600; +$Global{'mwheight'} = 430; my $sbbframe; my @base = (); @@ -318,7 +318,7 @@ } -$Global{'mainWindow'}->geometry("$Global{'mwheight'}x$Global{'mwwidth'}+$Global{'horz'}+$Global{'vert'}"); +$Global{'mainWindow'}->geometry("$Global{'mwwidth'}x$Global{'mwheight'}+$Global{'horz'}+$Global{'vert'}"); $splashList->insert("0", "Determining search bases.") if ( $Global{splash} ); @@ -4508,10 +4508,10 @@ There are 5 commands that can be used with this file; hand, attribute, server, limit, and port. -mwwidth -> numeric value: Default 400 main window width in +mwwidth -> numeric value: Default 600 main window width in pixels, user may need to adjust this. -mwheight -> numeric value: Default is 540 main window height in +mwheight -> numeric value: Default is 430 main window height in pixels, user may need to adjust this. hand -> values: left or right. Defines where the |
From: Clif H. <ch...@us...> - 2003-01-27 17:43:31
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv7074/ldap/contrib Modified Files: dot.tklkup Log Message: Corrected default numbers for width and height. Index: dot.tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/dot.tklkup,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dot.tklkup 25 Jan 2003 03:35:41 -0000 1.6 +++ dot.tklkup 27 Jan 2003 17:43:27 -0000 1.7 @@ -4,12 +4,16 @@ # # # Default main window width, user may need to adjust +# Sun systems seem to do best on 600. +# Linux systems seem to do best at 500. # -mwwidth: 400 +mwwidth: 600 # # Default main window height, user may need to adjust +# Sun systems seem to do best on 430. +# Linux systems seem to do best at 400. # -mwheight: 540 +mwheight: 430 # # Set up which side you want the Attributes pane to be displayed # on. |
From: Graham B. <gb...@us...> - 2003-01-27 16:33:23
|
Update of /cvsroot/perl-ldap/ldap In directory sc8-pr-cvs1:/tmp/cvs-serv30293 Modified Files: ChangeLog RELEASE_NOTES Log Message: Release 0.27 Index: ChangeLog =================================================================== RCS file: /cvsroot/perl-ldap/ldap/ChangeLog,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ChangeLog 18 Jul 2002 13:01:29 -0000 1.26 +++ ChangeLog 27 Jan 2003 16:33:14 -0000 1.27 @@ -1,3 +1,222 @@ +2003-01-27 14:19 Graham Barr + + * lib/Net/LDAP.pod: + + Document the ability to pass an array ref for the HOST parameter to new + +2003-01-25 05:17 Clif Harden + + * contrib/tklkup: + + + Corrected an error in the rootDse subroutine. + +2003-01-25 05:00 Clif Harden + + * contrib/tklkup: + + + Removed one of the mainwindow update commands in the schema display + section, it was interfering with the automatic window sizing on + window creation. + +2003-01-25 03:45 Clif Harden + + * contrib/tklkup: + + + Replaced width and height test values with correct values. + +2003-01-25 03:38 Clif Harden + + * contrib/tklkup: + + + Moved position of process message window. + Added main window height and width options. + Added busy indicator. + +2003-01-25 03:35 Clif Harden + + * contrib/dot.tklkup: + + + Added options for main window width and height. + +2003-01-24 13:11 Clif Harden + + * contrib/tklkup: + + + Change 3 use statments to require statments. + +2003-01-24 04:47 Clif Harden + + * contrib/tklkup: + + + Corrected several errors. + Added a list box for process messages. + Corrected a memory hogging issue with the way returned entry + data was stored. + +2003-01-21 01:45 Clif Harden + + * contrib/tklkup: + + + Corrected an error in the mod rdn section. + +2003-01-20 00:33 Clif Harden + + * contrib/tklkup: + + + Made major changes to the layout of GUI and program operation. + Added Splash screen on program initialization. + Added Menubar to top of GUI. Moved Bind Credentials and Port buttons + to menubar. Added Directory OPS drop down menu to menubar and moved + Obtain Root DSE and Schema buttons to Directory Ops menu. + Removed the dsa re-connect and bind operations when the dsa port + number is changed. User must re-select dsa for the new port number + to be used. + Corrected a nismapname error in the search base detection routines. + Changed wording on several buttons and check boxes. + Remove the cvs tag that put revision information in the program. This was + done to make the program smaller. + +2003-01-17 02:55 Clif Harden + + * contrib/tklkup: + + + Changed the Bind To Directory button to Set Bind Credential button. + Changed completely the way a connection is made to the directory server. + Changing any of the port, bind credentials, or directory server will reconnect + to the currently selected directory server and pull new a new set of + search bases. + Added support for SSL connections. + +2002-12-30 05:30 Clif Harden + + * contrib/tklkup: + + + Modified the error checking on ldap modify commands. + Corrected all the ldap bind commands. + Added CheckError subrountine. + Added a few comments at the end of subrountines. + +2002-12-03 02:35 Clif Harden + + * lib/Net/LDAP/FAQ.pod: + + + Added section on what is a proper bind DN. + Corrected some spelling errors. + +2002-11-06 04:27 Clif Harden + + * contrib/tklkup: + + + Corrected a few pod errors that podchecker found. + +2002-11-03 01:47 Kartik Subbarao + + * contrib/ldifdiff.pl: + + Speeded up attribute value comparisons significantly. + +2002-10-24 14:08 Graham Barr + + * lib/Net/: LDAP.pm, LDAP.pod: + + Add multihomed to the options passed onto IO::Socket + +2002-10-24 14:04 Graham Barr + + * lib/Net/LDAP/: LDIF.pm, LDIF.pod: + + Allow the file passed to new to be a pipe to/from a sub-process + +2002-10-24 13:49 Graham Barr + + * lib/Net/LDAP/LDIF.pm: + + Patch for solitary comments from Peter Marschall + +2002-10-08 02:41 Clif Harden + + * contrib/tklkup: + + + Change the way search base(s) are displayed. Instead of one big list, + the base list has been setup as a cascading menu based on the + namingContext(s) of the directory server. + +2002-09-11 13:54 Graham Barr + + * lib/Net/LDAP.pm: + + Fix typo preventing multiple being passed to new + +2002-09-11 13:53 Graham Barr + + * lib/Net/LDAP.pm: + + Change default protocol version to 3 + +2002-09-11 13:52 Graham Barr + + * MANIFEST: + + Add contrib/ldifuniq.pl + +2002-09-11 13:49 Graham Barr + + * lib/Net/LDAP/DSML.pm: + + Base64 encode values when needed + +2002-09-11 13:49 Graham Barr + + * lib/Net/LDAP/: Search.pm, Filter.pm: + + Fix perl5.004 compatability issues + +2002-08-24 16:13 Kartik Subbarao + + * contrib/README: + + Added ldifuniq.pl + +2002-08-19 13:21 Graham Barr + + * lib/Net/LDAP/Constant.pm: + + Add LDAP_CONTROL_TREE_DELETE + +2002-07-19 03:44 Clif Harden + + * contrib/tklkup: + + + Added the calling of the DSML end_dsml function when schema XML information + is writen to a file. + +2002-07-18 21:04 Graham Barr + + * lib/Net/LDAP/DSML.pm: + + Need to end the dsml:attribute-type element + +2002-07-18 19:19 Graham Barr + + * lib/Net/LDAP/DSML.pm: + + Added no strict 'refs' to AUTOLOAD + 2002-07-18 14:01 Graham Barr * RELEASE_NOTES, lib/Net/LDAP.pm: Index: RELEASE_NOTES =================================================================== RCS file: /cvsroot/perl-ldap/ldap/RELEASE_NOTES,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- RELEASE_NOTES 18 Jul 2002 13:01:11 -0000 1.11 +++ RELEASE_NOTES 27 Jan 2003 16:33:15 -0000 1.12 @@ -1,3 +1,9 @@ +perl-ldap 0.27 27 Jan 2003 +========================== + +* Default protocol version is now version 3 +* Fixed support for multiple hosts to be passed to new + perl-ldap 0.26 18 Jul 2002 ========================== |
From: Graham B. <gb...@us...> - 2003-01-27 16:33:21
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory sc8-pr-cvs1:/tmp/cvs-serv30293/lib/Net Modified Files: LDAP.pm Log Message: Release 0.27 Index: LDAP.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pm,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- LDAP.pm 24 Oct 2002 13:08:07 -0000 1.38 +++ LDAP.pm 27 Jan 2003 16:33:16 -0000 1.39 @@ -22,7 +22,7 @@ LDAP_INAPPROPRIATE_AUTH ); -$VERSION = "0.26_01"; +$VERSION = "0.27"; @ISA = qw(Net::LDAP::Extra); $LDAP_VERSION = 3; # default LDAP protocol version |
From: Graham B. <gb...@us...> - 2003-01-27 14:19:42
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory sc8-pr-cvs1:/tmp/cvs-serv27503/lib/Net Modified Files: LDAP.pod Log Message: Document the ability to pass an array ref for the HOST parameter to new Index: LDAP.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pod,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- LDAP.pod 24 Oct 2002 13:08:07 -0000 1.17 +++ LDAP.pod 27 Jan 2003 14:19:39 -0000 1.18 @@ -60,6 +60,10 @@ Creates a new B<Net::LDAP> object and opens a connection to the named host. OPTIONS is a list of key-value pairs, valid options are :- +C<HOST> may also be a reference to an array of hosts to try. Each will +be tried in order until a connection is made. Only when all have +failed will the result of C<undef> be returned. + =over 4 =item port |
From: Clif H. <ch...@us...> - 2003-01-25 05:17:27
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv4636/ldap/contrib Modified Files: tklkup Log Message: Corrected an error in the rootDse subroutine. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- tklkup 25 Jan 2003 05:00:26 -0000 1.39 +++ tklkup 25 Jan 2003 05:17:24 -0000 1.40 @@ -4317,6 +4317,7 @@ { my $error = "Root DSE entry could not be obtained."; ERROR(\$error); + return; } # |
From: Clif H. <ch...@us...> - 2003-01-25 05:00:30
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv559/ldap/contrib Modified Files: tklkup Log Message: Removed one of the mainwindow update commands in the schema display section, it was interfering with the automatic window sizing on window creation. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- tklkup 25 Jan 2003 03:45:49 -0000 1.38 +++ tklkup 25 Jan 2003 05:00:26 -0000 1.39 @@ -1473,12 +1473,6 @@ -> pack(-fill => 'x'); # -# Allow mainWindow to update -# - -$Global{'mainWindow'}->update; - -# # Create list frame. # |
From: Clif H. <ch...@us...> - 2003-01-25 03:45:51
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv17629/ldap/contrib Modified Files: tklkup Log Message: Replaced width and height test values with correct values. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- tklkup 25 Jan 2003 03:38:24 -0000 1.37 +++ tklkup 25 Jan 2003 03:45:49 -0000 1.38 @@ -96,8 +96,8 @@ $Global{'infoFilter'} = "equal"; $Global{'nismapname'} = 0; $Global{'records'} = 0; -$Global{'mwwidth'} = 00; -$Global{'mwheight'} = 40; +$Global{'mwwidth'} = 400; +$Global{'mwheight'} = 540; my $sbbframe; my @base = (); @@ -319,7 +319,6 @@ } $Global{'mainWindow'}->geometry("$Global{'mwheight'}x$Global{'mwwidth'}+$Global{'horz'}+$Global{'vert'}"); -#$Global{'mainWindow'}->geometry("+$Global{'horz'}+$Global{'vert'}"); $splashList->insert("0", "Determining search bases.") if ( $Global{splash} ); |
From: Clif H. <ch...@us...> - 2003-01-25 03:38:26
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv15440/ldap/contrib Modified Files: tklkup Log Message: Moved position of process message window. Added main window height and width options. Added busy indicator. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- tklkup 24 Jan 2003 13:11:21 -0000 1.36 +++ tklkup 25 Jan 2003 03:38:24 -0000 1.37 @@ -28,7 +28,6 @@ use Data::Dumper; use MIME::Base64; use Net::LDAP qw(:all); -use Net::LDAPS qw(:all); use Net::LDAP::Filter; use Net::LDAP::Util qw(ldap_error_name ldap_error_text); use Net::LDAP::Constant; @@ -97,6 +96,8 @@ $Global{'infoFilter'} = "equal"; $Global{'nismapname'} = 0; $Global{'records'} = 0; +$Global{'mwwidth'} = 00; +$Global{'mwheight'} = 40; my $sbbframe; my @base = (); @@ -176,7 +177,6 @@ # $Global{'mainWindow'} = MainWindow->new; -$Global{'mainWindow'}->geometry("520x320+$Global{'horz'}+$Global{'vert'}"); $splash = $Global{'mainWindow'}->Splashscreen(-milliseconds => 0) if ( $Global{splash} ); $splframe = $splash->LabFrame(-label => "DIRECTORY SEARCH SPLASH SCREEN", @@ -286,6 +286,14 @@ $Global{'nismapname'} = 1; last TYPE; }; + /^mwwidth/i && do { + $Global{'mwwidth'} = $data[1]; + last TYPE; }; + + /^mwheight/i && do { + $Global{'mwheight'} = $data[1]; + last TYPE; }; + my $error = "Parsing configuration file found an undefined type: $_"; ERROR(\$error); @@ -310,6 +318,9 @@ } +$Global{'mainWindow'}->geometry("$Global{'mwheight'}x$Global{'mwwidth'}+$Global{'horz'}+$Global{'vert'}"); +#$Global{'mainWindow'}->geometry("+$Global{'horz'}+$Global{'vert'}"); + $splashList->insert("0", "Determining search bases.") if ( $Global{splash} ); $splash->update() @@ -336,6 +347,17 @@ if ( $Global{port} == 636 ) { + +eval +{ + require Net::LDAPS; +}; +if ($@) +{ +$msgbox->insert("0.0", $@) if ($@); +return; +} + $Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, timeout => 1, port => $Global{'port'}, @@ -612,6 +634,10 @@ $attframe = $Global{'mainWindow'}->Frame() ->pack( -fill => "both", -side => "bottom"); +$msgframe = $attframe->LabFrame(-label => "Process Messages", + -labelside => "acrosstop" ) + ->pack( -fill => "both", -side => "top", -padx => 1, -pady => 1 ); + # # Create Bottom Attribute frame. # This is where the user will enter data to be @@ -779,14 +805,10 @@ } # End of foreach (@attribute) -$msgframe = $attframe->LabFrame(-label => "Process Messages", - -labelside => "acrosstop" ) - ->pack( -fill => "both", -side => "right", -padx => 1, -pady => 1 ); - $msgbox = $msgframe ->Scrolled('Listbox', -scrollbars => 's', -width => 50, -height => 2 ); -$msgbox->pack( -side => "bottom" ); +$msgbox->pack( -side => "left" ); $splash->Destroy() if ( $Global{splash} ); @@ -843,6 +865,7 @@ $Global{'slist'}->insert(0 , $Global{'LDAP_SERVER'}); $sslist->insert(0 , $Global{'LDAP_SERVER'}) if ( Exists($sslist) ) ; +$Global{mainWindow} -> Busy(-recurse => 1); # window is busy $Global{mainWindow} -> update; # Allow Tk to update $ptr = 1; @@ -1000,6 +1023,7 @@ $Global{'CORE_SERVER'} = $Global{'LDAP_SERVER'}; +$Global{mainWindow} -> Unbusy; # window is not busy } # End of server subroutine @@ -1376,6 +1400,7 @@ my $tframe; my $sbframe; #my $sslist; +$Global{mainWindow} -> Busy(-recurse => 1); # window is busy &globalPos(); my $x = $Global{'horz'} + 100; my $y = $Global{'vert'} + 100; @@ -1899,6 +1924,7 @@ } # End of schema subroutine +$Global{mainWindow} -> Unbusy; # window is not busy } # End of SCHEMA subroutine sub init_schemaHash @@ -3830,6 +3856,7 @@ 'd' => 0 ); +$Global{mainWindow} -> Busy(-recurse => 1); # window is busy # # Destroy the dn history list if it exists. # @@ -4089,6 +4116,7 @@ ${$Global{'searchResults'}}{$dn} = $data; } +$Global{mainWindow} -> Unbusy; # window is not busy } # End of search subroutine # @@ -4485,6 +4513,12 @@ There are 5 commands that can be used with this file; hand, attribute, server, limit, and port. + +mwwidth -> numeric value: Default 400 main window width in + pixels, user may need to adjust this. + +mwheight -> numeric value: Default is 540 main window height in + pixels, user may need to adjust this. hand -> values: left or right. Defines where the attribute label box will be place. |
From: Clif H. <ch...@us...> - 2003-01-25 03:35:43
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv15104/ldap/contrib Modified Files: dot.tklkup Log Message: Added options for main window width and height. Index: dot.tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/dot.tklkup,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- dot.tklkup 9 Sep 2001 04:46:36 -0000 1.5 +++ dot.tklkup 25 Jan 2003 03:35:41 -0000 1.6 @@ -2,6 +2,15 @@ # Initialization file for tklkup. This file should reside # in the user home directory as .tklkup. # +# +# Default main window width, user may need to adjust +# +mwwidth: 400 +# +# Default main window height, user may need to adjust +# +mwheight: 540 +# # Set up which side you want the Attributes pane to be displayed # on. # |
From: Clif H. <ch...@us...> - 2003-01-24 13:11:25
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv12567/ldap/contrib Modified Files: tklkup Log Message: Change 3 use statments to require statments. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- tklkup 24 Jan 2003 04:47:38 -0000 1.35 +++ tklkup 24 Jan 2003 13:11:21 -0000 1.36 @@ -52,12 +52,12 @@ $Global{'jpeg'} = 1; -eval { use Tk::JPEG; }; +eval { require Tk::JPEG; }; $Global{'jpeg'} = 0 if ( $@ ); $Global{'splash'} = 1; -eval { use Tk::Splashscreen; - use Tie::Watch; +eval { require Tk::Splashscreen; + require Tie::Watch; }; $Global{'splash'} = 0 if ( $@ ); |
From: Clif H. <ch...@us...> - 2003-01-24 04:47:41
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv5761/ldap/contrib Modified Files: tklkup Log Message: Corrected several errors. Added a list box for process messages. Corrected a memory hogging issue with the way returned entry data was stored. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- tklkup 21 Jan 2003 01:45:51 -0000 1.34 +++ tklkup 24 Jan 2003 04:47:38 -0000 1.35 @@ -96,6 +96,7 @@ $Global{'max'} = 0; $Global{'infoFilter'} = "equal"; $Global{'nismapname'} = 0; +$Global{'records'} = 0; my $sbbframe; my @base = (); @@ -512,17 +513,6 @@ } - -# -# Create bind button. -# This will cause another window to be displayed where -# the user will enter the bind DN and password. -# - -##$abind = $stframe -> Button(-text => " SET BIND\n CREDENTIALS", -## -relief => "raised", -command => \&BIND, -## -font => $Global{'Font'}, -borderwidth => 3 ) -## -> pack( -side => $Global{'hand'}, -anchor => "w", -pady => 2); # # Create a LDAP version Checkbutton that will set up variable # setVersion to set the LDAP version before each directory query. @@ -789,25 +779,18 @@ } # End of foreach (@attribute) +$msgframe = $attframe->LabFrame(-label => "Process Messages", + -labelside => "acrosstop" ) + ->pack( -fill => "both", -side => "right", -padx => 1, -pady => 1 ); -##$schframe = $attframe->LabFrame(-label => "DIRECTORY SCHEMA", -## -labelside => "acrosstop" ) -## ->pack( -fill => "both", -side => "right", -padx => 1, -pady => 1 ); - -# -# Create schema button. -# This will cause another window to be displayed where -# the user will be able to display schema information. -# - -##$abind = $schframe -> Button(-text => " EXPLORE DIRECTORY\n SCHEMA", -## -relief => "raised", -command => \&SCHEMA, -## -font => $Global{'Font'}, -borderwidth => 3 ) -## -> pack( -side => "$Global{'hand'}", -anchor => "w" ); +$msgbox = $msgframe ->Scrolled('Listbox', -scrollbars => 's', + -width => 50, -height => 2 ); +$msgbox->pack( -side => "bottom" ); $splash->Destroy() if ( $Global{splash} ); +$splash = undef(); # # Run the Main loop looking for events. # @@ -860,6 +843,8 @@ $Global{'slist'}->insert(0 , $Global{'LDAP_SERVER'}); $sslist->insert(0 , $Global{'LDAP_SERVER'}) if ( Exists($sslist) ) ; +$Global{mainWindow} -> update; # Allow Tk to update + $ptr = 1; # @@ -898,6 +883,9 @@ ) or $error = 1; } +$msgbox->delete("0.0", "end"); +$msgbox->update(); + if ( !$error ) { @@ -937,6 +925,7 @@ { foreach my $ncbase ( @$attr ) { + $Global{mainWindow}->update; my $t1 = []; ${$NC{$ncbase}}[0] = [ "0" ]; # dummy load in position 0 ${$NC{$ncbase}}[1] = $t1; # @@ -992,6 +981,11 @@ } +else +{ +$msgbox->insert("1", "Connection error."); + +} if ( @NcKeys) { @@ -1454,6 +1448,11 @@ $srbfilelabel->Entry(-textvariable => \$Global{'fdata'}, -width => 25 ) -> pack(-fill => 'x'); +# +# Allow mainWindow to update +# + +$Global{'mainWindow'}->update; # # Create list frame. @@ -1560,6 +1559,13 @@ $schema_list->pack( -side => "bottom" ); + +# +# Allow mainWindow to update +# + +$Global{'mainWindow'}->update; + &schema; } @@ -1710,6 +1716,13 @@ } + +# +# Allow mainWindow to update +# + +$Global{'mainWindow'}->update; + $ra_atts = []; # # Get the attributes @@ -2019,6 +2032,13 @@ } + +# +# Allow mainWindow to update +# + +$Global{'mainWindow'}->update; + # # Set up the Tk windows. # @@ -2098,7 +2118,8 @@ $Global{'list'}->insert("end", " \n"); foreach my $var (@objectclasses) - { + { + $Global{mainWindow}->update; $oid = $$obj{$var}->[0]; # # Get the various other items associated with @@ -2392,8 +2413,6 @@ if Tk::Exists($Global{'ldapActionWindow'}); delete($Global{'ldapActionWindow'}); -&displaySearch(); - &displaySearch(); # create the entry data display window. # clear the entry data display window. @@ -3817,11 +3836,6 @@ $Global{'searchHList'}->destroy if Tk::Exists($Global{'searchHList'}); # -# Display the DN search results list box. -# -displayDnList(); - -# # Parameter(s) to return # @@ -3891,7 +3905,7 @@ if ( $error == 1 ) { - $list->insert("end", "Bad filter '$match'.\n"); + ERROR("Bad filter $match."); return; } @@ -3916,7 +3930,7 @@ if ( $error == 1 ) { - $list->insert("end", "Connect error: $@\n"); + ERROR("Connect error: $@"); return; } @@ -3935,6 +3949,14 @@ } +# +# Display the DN search results list box. +# +displayDnList(); + +$msgbox->delete("0.0", "end"); +$msgbox->update; +$Global{'records'} = 0; # initialize record count. $Global{'searchResults'} = {}; # initialize results hash. $mesg = $Global{ldap}->search( @@ -3946,11 +3968,7 @@ if ( $mesg->code && $mesg->code != 48 ) { - $errstr = $mesg->code; - $list->insert("end", "Error code: $errstr\n"); - $errstr = ldap_error_text($errstr); - $list->insert("end", "$errstr\n"); - return; + ERROR($mesg->code); } @@ -4000,13 +4018,17 @@ if ( !defined($entry) ) { -# $list->insert("end", "No records found matching filter $match.\n") -# if ($mesg->count == 0) ; - return; } $dn = $entry->dn; # store the entry dn + ++$Global{'records'}; + $msgbox->delete("0.0", "end") + if ( !($Global{'records'} % 10 )); + $msgbox->update if ( !($Global{'records'} % 10 )); + $msgbox->insert("0.0", "Entries found: $Global{'records'}") + if ( !($Global{'records'} % 10 )); + $msgbox->update if ( !($Global{'records'} % 10 )); # # # @@ -4015,7 +4037,7 @@ { foreach (@ref ) { - $list->insert("end", "LDAP Referral: $_ \n"); + ERROR("LDAP Referral: $_"); } } @@ -4040,7 +4062,9 @@ # foreach (@attrs) { - my $attr = $entry->get_value($_, asref => 1); +# my $attr = $entry->get_value($_, asref => 1); + my $attr = []; + @$attr = $entry->get_value($_); next unless $attr; if ( /^jpegPhoto/i ) @@ -4142,6 +4166,14 @@ { if ( @base < $Global{'limit'} ) { + $splashList->insert("1", "Searching $base") + if ( defined( $splash) ); + $splash->update() + if ( defined( $splash) ); + $msgbox->insert("0", "Searching $base") + if ( defined( $msgbox) ); + $msgbox->update() + if ( defined( $msgbox) ); my @new_base = calBase($base, $f ); push(@base, @new_base); } @@ -4196,14 +4228,14 @@ $_ = $dn; # -# Record only dn that start with ou=, o=, or in some cases nismapname. +# Record only dn that start with ou=, or in some cases nismapname. # Normal entrys can be mixed in with these objects. # - if ( $Global{'nismapname'} && ( /^ou=/ || /^o=/ || /^nismapname/i ) ) + if ( $Global{'nismapname'} && ( /^ou=/ || /^nismapname/i ) ) { push(@new_base, $dn); # record only dn that start with ou= } - elsif ( /^ou=/ || /^o=/ ) + elsif ( /^ou=/ ) { push(@new_base, $dn); # record only dn that start with ou= } |
From: Graham B. <gb...@us...> - 2003-01-21 19:15:07
|
Update of /cvsroot/perl-ldap/sasl/lib/Authen In directory sc8-pr-cvs1:/tmp/cvs-serv13366/lib/Authen Modified Files: SASL.pm Log Message: Release 2.03 Index: SASL.pm =================================================================== RCS file: /cvsroot/perl-ldap/sasl/lib/Authen/SASL.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SASL.pm 28 May 2002 14:22:48 -0000 1.4 +++ SASL.pm 21 Jan 2003 19:15:04 -0000 1.5 @@ -8,7 +8,7 @@ use vars qw($VERSION @Plugins); use Carp; -$VERSION = "2.02"; +$VERSION = "2.03"; @Plugins = qw( Authen::SASL::Cyrus |
From: Graham B. <gb...@us...> - 2003-01-21 12:22:15
|
Update of /cvsroot/perl-ldap/sasl/lib/Authen/SASL/Perl In directory sc8-pr-cvs1:/tmp/cvs-serv2594/lib/Authen/SASL/Perl Modified Files: LOGIN.pm Log Message: Fix LOGIN mechanism to respond with the username when prompted Index: LOGIN.pm =================================================================== RCS file: /cvsroot/perl-ldap/sasl/lib/Authen/SASL/Perl/LOGIN.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LOGIN.pm 28 May 2002 13:36:25 -0000 1.1 +++ LOGIN.pm 21 Jan 2003 12:22:13 -0000 1.2 @@ -7,7 +7,7 @@ use strict; use vars qw($VERSION @ISA); -$VERSION = "1.00"; +$VERSION = "1.01"; @ISA = qw(Authen::SASL::Perl); my %secflags = ( @@ -23,7 +23,7 @@ sub client_start { my $self = shift; - $self->_call('user'); + ''; } sub client_step { @@ -31,7 +31,9 @@ $string =~ /password/i ? $self->_call('pass') - : ''; + : $string =~ /username/i + ? $self->_call('user') + : ''; } 1; |
From: Clif H. <ch...@us...> - 2003-01-21 01:45:54
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv29597/ldap/contrib Modified Files: tklkup Log Message: Corrected an error in the mod rdn section. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- tklkup 20 Jan 2003 00:33:42 -0000 1.33 +++ tklkup 21 Jan 2003 01:45:51 -0000 1.34 @@ -50,7 +50,6 @@ my %Global = (); my %NC = (); -my $programVersion = "$Id\$"; $Global{'jpeg'} = 1; eval { use Tk::JPEG; }; @@ -177,15 +176,6 @@ $Global{'mainWindow'} = MainWindow->new; $Global{'mainWindow'}->geometry("520x320+$Global{'horz'}+$Global{'vert'}"); -$Global{'mainWindow'}->configure(-menu => $Global{'menubar'} = $Global{'mainWindow'}->Menu); - -$Global{'menubar'}->cascade(-label => "~Directory OPS", - -menuitems => ops_items); -$Global{'menubar'}->command(-label => "Set ~Bind Credentials", - -command => \&BIND ); -$Global{'menubar'}->command(-label => "Set DSA ~Port", - -command => \&PORT ); - $splash = $Global{'mainWindow'}->Splashscreen(-milliseconds => 0) if ( $Global{splash} ); $splframe = $splash->LabFrame(-label => "DIRECTORY SEARCH SPLASH SCREEN", @@ -456,6 +446,19 @@ push(@attribute,"Filter"); # put roll your on filter at the end # +# Create the Menubar +# + +$Global{'mainWindow'}->configure(-menu => $Global{'menubar'} = $Global{'mainWindow'}->Menu); + +$Global{'menubar'}->cascade(-label => "~Directory OPS", + -menuitems => ops_items); +$Global{'menubar'}->command(-label => "Set ~Bind Credentials", + -command => \&BIND ); +$Global{'menubar'}->command(-label => "Set DSA ~Port", + -command => \&PORT ); + +# # Create process Exit button # @@ -1703,7 +1706,6 @@ $Global{'sfile'} = 0; $Global{'fdata'} = ""; $Global{'xml'} = 0; - #$ldap->unbind if ( defined($ldap)); return; } @@ -2929,7 +2931,6 @@ sub ldapActionDelete { my $error; -my $ldap; my $mesg; my @DNs; my $do_it; @@ -3029,7 +3030,6 @@ } } -#$ldap->unbind; } # End of ldapActionDelete subroutine @@ -3040,7 +3040,6 @@ sub ldapActionRename { my $error; -my $ldap; my $mesg; $error = 0; my $do_it; @@ -3098,7 +3097,7 @@ while ($do_it == 1 ) { -$mesg = $ldap->moddn($Global{'RenameDN'}, +$mesg = $Global{ldap}->moddn($Global{'RenameDN'}, newrdn => $Global{'newrdn'}, deleteoldrdn => $Global{'deleteoldrdn'}, newsuperior => $Global{'newsuperior'} ); |
From: Clif H. <ch...@us...> - 2003-01-20 00:33:45
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv1226/ldap/contrib Modified Files: tklkup Log Message: Made major changes to the layout of GUI and program operation. Added Splash screen on program initialization. Added Menubar to top of GUI. Moved Bind Credentials and Port buttons to menubar. Added Directory OPS drop down menu to menubar and moved Obtain Root DSE and Schema buttons to Directory Ops menu. Removed the dsa re-connect and bind operations when the dsa port number is changed. User must re-select dsa for the new port number to be used. Corrected a nismapname error in the search base detection routines. Changed wording on several buttons and check boxes. Remove the cvs tag that put revision information in the program. This was done to make the program smaller. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- tklkup 17 Jan 2003 02:55:56 -0000 1.32 +++ tklkup 20 Jan 2003 00:33:42 -0000 1.33 @@ -41,6 +41,8 @@ use Tk::ROText; use Tk::HList; use Tk::Label; + +use subs qw/ops_items/; # # Global variables, wish I did not have to use them # but Tk forces me to. @@ -48,10 +50,18 @@ my %Global = (); my %NC = (); +my $programVersion = "$Id\$"; + $Global{'jpeg'} = 1; eval { use Tk::JPEG; }; $Global{'jpeg'} = 0 if ( $@ ); +$Global{'splash'} = 1; +eval { use Tk::Splashscreen; + use Tie::Watch; + }; +$Global{'splash'} = 0 if ( $@ ); + # # Window roots # @@ -160,6 +170,38 @@ #my $sbmenu; my @attribute = (); my @server = (); + +# +# Create Main Window +# + +$Global{'mainWindow'} = MainWindow->new; +$Global{'mainWindow'}->geometry("520x320+$Global{'horz'}+$Global{'vert'}"); +$Global{'mainWindow'}->configure(-menu => $Global{'menubar'} = $Global{'mainWindow'}->Menu); + +$Global{'menubar'}->cascade(-label => "~Directory OPS", + -menuitems => ops_items); +$Global{'menubar'}->command(-label => "Set ~Bind Credentials", + -command => \&BIND ); +$Global{'menubar'}->command(-label => "Set DSA ~Port", + -command => \&PORT ); + +$splash = $Global{'mainWindow'}->Splashscreen(-milliseconds => 0) + if ( $Global{splash} ); +$splframe = $splash->LabFrame(-label => "DIRECTORY SEARCH SPLASH SCREEN", + -labelside => "acrosstop") + ->pack() if ( $Global{splash} ); + +$splashList = $splframe->Listbox( -height => 2, -width => 40 ) + if ( $Global{splash} ); +$splashList->pack() + if ( $Global{splash} ); +$splashList->insert("0", "Splash box") + if ( $Global{splash} ); +$splash->Splash() + if ( $Global{splash} ); +$splash->update() + if ( $Global{splash} ); # # Check for dot file, use it to configure program. # @@ -173,6 +215,10 @@ $ENV{'TMP'} = "./"; } +$splashList->insert("0", "Reading initialization file") + if ( $Global{splash} ); +$splash->update() + if ( $Global{splash} ); # # Active State Perl does not always set ENV HOME. # @@ -273,6 +319,10 @@ } +$splashList->insert("0", "Determining search bases.") + if ( $Global{splash} ); +$splash->update() + if ( $Global{splash} ); # # Default directory server. # @@ -321,7 +371,6 @@ { $errstr = $mesg->code; ERROR($errstr); - print $mesg->code,"\n"; } if ( $mesg->code || $Global{setVersion} ) { @@ -332,10 +381,9 @@ my $t1 = []; $NC{$server{$server[0]}} = [ "0" ]; # dummy load in position 0 ${$NC{$server{$server[0]}}}[1] = $t1; # -# print "server == ", $server{$server[0]}, "\n"; push(@$t1, getBases($Global{'LDAP_SERVER'}, $server{$server[0]})); - @base = getBases($Global{'LDAP_SERVER'}, $server{$server[0]}); + push(@base, @$t1); } else { @@ -354,11 +402,15 @@ { foreach my $ncbase ( @$attr ) { + $splashList->insert("1", "Searching $ncbase") + if ( $Global{splash} ); + $splash->update() + if ( $Global{splash} ); my $t1 = []; ${$NC{$ncbase}}[0] = [ "0" ]; # dummy load in position 0 ${$NC{$ncbase}}[1] = $t1; # push(@$t1, getBases($Global{'LDAP_SERVER'}, $ncbase)); - push(@base, getBases($Global{'LDAP_SERVER'}, $ncbase)); + push(@base, @$t1); } } } @@ -384,6 +436,13 @@ } +$splashList->insert("0", "Setting tklkup GUI.") + if ( $Global{splash} ); +$splash->update() + if ( $Global{splash} ); + +$Global{'mainWindow'}->title("DIRECTORY SEARCH"); + # # Default directory search attributes. # @@ -397,15 +456,6 @@ push(@attribute,"Filter"); # put roll your on filter at the end # -# Create Main Window -# - -$Global{'mainWindow'} = MainWindow->new; - -$Global{'mainWindow'}->title("DIRECTORY SEARCH"); - -$Global{'mainWindow'}->geometry("+$Global{'horz'}+$Global{'vert'}"); -# # Create process Exit button # @@ -466,17 +516,17 @@ # the user will enter the bind DN and password. # -$abind = $stframe -> Button(-text => " SET BIND\n CREDENTIALS", - -relief => "raised", -command => \&BIND, - -font => $Global{'Font'}, -borderwidth => 3 ) - -> pack( -side => $Global{'hand'}, -anchor => "w", -pady => 2); +##$abind = $stframe -> Button(-text => " SET BIND\n CREDENTIALS", +## -relief => "raised", -command => \&BIND, +## -font => $Global{'Font'}, -borderwidth => 3 ) +## -> pack( -side => $Global{'hand'}, -anchor => "w", -pady => 2); # # Create a LDAP version Checkbutton that will set up variable # setVersion to set the LDAP version before each directory query. # $setVersion = $sbframe -> Checkbutton( - -text => "SET LDAP VERSION, LDAP V3 DEFAULT", + -text => "LDAP VERSION 3, DEFAULT", -variable => \$Global{'setVersion'}, -onvalue => 3, -offvalue => 2, -font => $Global{'Font'} ) -> pack(-side => "left", -anchor => "center" ); @@ -509,6 +559,10 @@ -borderwidth => 3 ) -> pack(-side => "left", -anchor => "w" ); +$splashList->insert("0", "Creating cascading search base menus.") + if ( $Global{splash} ); +$splash->update() + if ( $Global{splash} ); # # Create the cascade search base menus # @@ -610,7 +664,7 @@ -> pack(-side => $Global{'hand'} ); # -# Set up the select search base radio buttons. +# Set up the filter type radio buttons. # $rbsf = $sfcmenu -> radiobutton(-label => "equal", @@ -642,10 +696,14 @@ # Create get root dse entry button. # -$cframe -> Button(-text => "OBTAIN ROOT DSE ENTRY", - -command => \&rootDse, - -font => $Global{'Font'}, -borderwidth => 3 ) - -> pack( -side => $Global{'hand'} ); +$splashList->insert("0", "Creating root dse and attribute buttons.") + if ( $Global{splash} ); +$splash->update() + if ( $Global{splash} ); +##$cframe -> Button(-text => "OBTAIN ROOT DSE ENTRY", +## -command => \&rootDse, +## -font => $Global{'Font'}, -borderwidth => 3 ) +## -> pack( -side => $Global{'hand'} ); # # Create left attribute selection frame @@ -729,13 +787,9 @@ } # End of foreach (@attribute) -$schframe = $attframe->LabFrame(-label => "DIRECTORY SCHEMA", - -labelside => "acrosstop" ) - ->pack( -fill => "both", -side => "right", -padx => 1, -pady => 1 ); - -$prtframe = $attframe->LabFrame(-label => "DIRECTORY PORT", - -labelside => "acrosstop" ) - ->pack( -fill => "both", -side => "right", -padx => 1, -pady => 1 ); +##$schframe = $attframe->LabFrame(-label => "DIRECTORY SCHEMA", +## -labelside => "acrosstop" ) +## ->pack( -fill => "both", -side => "right", -padx => 1, -pady => 1 ); # # Create schema button. @@ -743,26 +797,13 @@ # the user will be able to display schema information. # -$abind = $schframe -> Button(-text => " EXPLORE DIRECTORY\n SCHEMA", - -relief => "raised", -command => \&SCHEMA, - -font => $Global{'Font'}, -borderwidth => 3 ) - -> pack( -side => "$Global{'hand'}", -anchor => "w" ); - -# -# Create port button. -# This will cause another window to be displayed where -# the user will be able to display port information. -# - -$abind = $prtframe -> Button(-text => "SET DIRECTORY\nPORT", - -relief => "raised", -command => \&PORT, - -font => $Global{'Font'}, -borderwidth => 3 ) - -> pack( -side => "$Global{'hand'}", -anchor => "w" ); +##$abind = $schframe -> Button(-text => " EXPLORE DIRECTORY\n SCHEMA", +## -relief => "raised", -command => \&SCHEMA, +## -font => $Global{'Font'}, -borderwidth => 3 ) +## -> pack( -side => "$Global{'hand'}", -anchor => "w" ); -#$_ = $Global{'mainWindow'}->geometry(); - -#/^=?(\d+x\d+)?([+-]\d+[+-]\d+)?$/; +$splash->Destroy() if ( $Global{splash} ); # # Run the Main loop looking for events. @@ -770,7 +811,19 @@ MainLoop; +sub ops_items +{ + +[ + +[ 'command', 'Explore ~Root DSE', -accelerator => "Ctrl-r", -command => \&rootDse ], +"", +[ 'command', 'Explore Directory ~Schema ', -accelerator => "Ctrl-s", -command => \&SCHEMA ], + +]; + +} sub AClear { @@ -814,10 +867,16 @@ while ( @BaseButton >= 1 ) { $widget = pop(@BaseButton); + foreach my $mvar ( @$widget) + { $sbmenu->menu->delete($ptr); + } ++$ptr; } +%NC = (); # Delete the old stuff. +@BaseButton = (); # Delete the old stuff. +@NcKeys = (); # Delete the old stuff. if ( $Global{port} == 636 ) { @@ -856,7 +915,6 @@ if ( $Global{'CORE_SERVER'} ne $Global{'LDAP_SERVER'} && defined($server{$Global{'LDAP_SERVER'}} ) ) { # user defined base - %NC = (); # Delete the old stuff. my $t1 = []; $NC{$server{$Global{'LDAP_SERVER'}}} = [ "0" ]; # dummy load in position 0 ${$NC{$server{$Global{'LDAP_SERVER'}}}}[1] = $t1; # @@ -868,7 +926,6 @@ my $entry; # use root_dse to find the bases - %NC = (); # Delete the old stuff. $entry = $Global{ldap}->root_dse(); if ( defined($entry) ) { @@ -892,8 +949,6 @@ } -} - # # Create the cascade search base menus # @@ -932,6 +987,9 @@ $sbmenu->entryconfigure("$Nclabel", -menu => @{$NC{$Nclabel}}[0]); } + +} + if ( @NcKeys) { $LDAP_SEARCH_BASE = shift (@NcKeys); @@ -983,7 +1041,7 @@ } # End of setFilter subroutine - + # # Create Main Bind Window # @@ -1206,62 +1264,7 @@ sub portAccept{ -my $error; - -$error = 0; - -$Global{ldap}->unbind if ( defined($Global{ldap}) ); -$Global{ldap} = undef if ( defined($Global{ldap}) ); - $Global{'port'} = $port_data; - -# -# Connect to directory server -# - -if ( $Global{port} == 636 ) -{ - $Global{ldap} = new Net::LDAPS( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} -else -{ - $Global{ldap} = new Net::LDAP( $Global{'LDAP_SERVER'}, - timeout => 1, - port => $Global{'port'}, - debug => $opt{'d'}, - ) or $error = 1; -} - -if ( $error == 1 ) -{ - ERROR("Connect error: $@\n"); - - # $schema_list->insert("end", "Connect error: $@\n"); - return; -} - -$mesg = $Global{ldap}->bind( password => "$Global{'bindpw'}", - dn => "$Global{'binddn'}", - version => $Global{'setVersion'}, - ); - - -if ( $mesg->code && $mesg->code != 48 ) -{ - $errstr = $mesg->code; - ERROR($errstr); - return; -} - -# -# New server setup -# -&server; - $Global{'portWindow'}->destroy() if Tk::Exists($Global{'portWindow'}); $Global{'portWindow'} = undef(); @@ -4123,11 +4126,11 @@ # # Solaris Native LDAP enabled # - $match = "(|(ou=*)(nismapname=*))"; #search only for ou entries. + $match = "(|(o=*)(ou=*)(nismapname=*))"; #search only for ou entries. } else { - $match = "(ou=*)"; #search only for ou entries. + $match = "(|(o=*)(ou=*))"; #search only for ou entries. } my $error = 0; # initialize error flag. @@ -4163,7 +4166,7 @@ $mesg = $Global{ldap}->search( base => $base, filter => $f, - attrs => [ "cn" ], + attrs => [ "cn","nismapname" ], scope => "one", ); @@ -4172,7 +4175,7 @@ # Search call work, but there was an ldap error. # -if ( $mesg->code ) +if ( $mesg->code && $mesg->code != 11 ) { $errstr = $mesg->code; ERROR($errstr); @@ -4194,14 +4197,14 @@ $_ = $dn; # -# Record only dn that start with ou= +# Record only dn that start with ou=, o=, or in some cases nismapname. # Normal entrys can be mixed in with these objects. # - if ( $Global{'nismapname'} && ( /^ou=/ || /^nismapname/ ) ) + if ( $Global{'nismapname'} && ( /^ou=/ || /^o=/ || /^nismapname/i ) ) { push(@new_base, $dn); # record only dn that start with ou= } - elsif ( /^ou=/ ) + elsif ( /^ou=/ || /^o=/ ) { push(@new_base, $dn); # record only dn that start with ou= } @@ -4559,33 +4562,38 @@ listed above it will I<NOT> fork and will run in in foreground mode. -I<Exit> button. At the top of the GUI is the "Exit" -button. When a mouse click is done on the "Exit" button -the program will terminate. +During initial program initialization a "splash" screen will +be displayed telling the user what is going on. It is possible +that the user will never see the splash screen if tklkup +initializes quickly. -The I<SET LDAP VERSION> "RadioButton" diamond will select the -LDAP protocol version. When selected the "RadioButton" -diamond will be red in color. This indicates that the -ldap connection will use the version I<3> protocol. To use -ldap version I<2> protocol press the "RadioButton" diamond -so that it becomes a gray color. -The I<SELECT SERVER> button will activate a -drop down menu. From the menu the user will select the -"RadioButton" that corresponds to the directory server the -user wishes to use. When selected the "RadioButton" diamond -will turn red in color. This menu is a designed to be a -"I<tear off>" menu, selecting the "---------------" line will -cause the pull down menu to become a separate window that -is still somewhat controlled by the GUI. The -DIRECTORY SERVER text box will display the directory name -that is selected. If the GUI is icon-ed or exited, the tear -off window will follow the actions of the GUI. All other -actions like moving or closing just the torn off window -must be done by the user's window manager. +------------------------------------------------------------------- + +=head1 Directory Search Menu Bar + +At the top of the GUI is the main menu bar. It has 3 drop down +menus; "Directory OPS", "Set Bind Credentials", and +"Set DSA Port". + +The I<DIRECTORY OPS> button will activate a drop down menu that +has 2 menu selections; + +The I<Explore ROOT DSE> menu will attempt to obtain the +root dse entry for the selected directory server. If the root +dse entry is obtained a separate window will be displayed that +will display the information obtained from the root dse entry. +If the root dse entry can not be obtained then an error message +window will be displayed. This menu has a "Hot" key, Ctrl-r. + +The I<EXPLORE DIRECTORY SCHEMA> menu will activate the +Directory Schema Search Window. This menu has a "Hot" key, Ctrl-s. +For information about this window see the Schema section of +the manual. The I<SET BIND CREDENTIALS> button will activate a window -that is separate from the main window. +that is separate from the main window. This menu has a +"Hot" key, Alt-b. The new window contains two buttons and two text boxes. For security reasons nothing is initially displayed in the @@ -4605,7 +4613,61 @@ as they are typed into the text box. At the bottom of the window is the Accept button, pressing -this button will set the bind DN and the password. +this button will set the bind DN and the password. Pressing the +accept button will cause the program to bind to the currently +selected directory server. + +The I<DIRECTORY PORT> button will activate a window +that is separate from the main window. This menu has a +"Hot" key, Alt-p. + +The new window contains two buttons and one text box. +If the user needs to change the TCP connection port, this +is where it is done. + +At the top of the window is a Cancel button, pressing +this button will cancel the operation of setting the +port number. + +The text box is where the user will enter the port +number to connect. Display in the text box is the +current port number. + +At the bottom of the window is the Accept button, pressing +this button will set the port number. Changing the connection +port number will I<NOT> cause the program to issue a new +connection to the directory server. The user must re-select or +change to a new directory server. + + +------------------------------------------------------------------- + +=head1 Directory Search GUI + +I<Exit> button. Just below the main menu bar is the "Exit" +button. When a mouse click is done on the "Exit" button +the program will terminate. + +The I<LDAP VERSION> "RadioButton" diamond will select the +LDAP protocol version. When selected the "RadioButton" +diamond will be red in color. This indicates that the +ldap connection will use the version I<3> protocol. To use +ldap version I<2> protocol press the "RadioButton" diamond +so that it becomes a gray color. + +The I<SELECT SERVER> button will activate a +drop down menu. From the menu the user will select the +"RadioButton" that corresponds to the directory server the +user wishes to use. When selected the "RadioButton" diamond +will turn red in color. This menu is a designed to be a +"I<tear off>" menu, selecting the "---------------" line will +cause the pull down menu to become a separate window that +is still somewhat controlled by the GUI. The +DIRECTORY SERVER text box will display the directory name +that is selected. If the GUI is icon-ed or exited, the tear +off window will follow the actions of the GUI. All other +actions like moving or closing just the torn off window +must be done by the user's window manager. The I<SELECT BASE> button will activate a cascading drop down menu that contains the NamingContexts of the directory @@ -4666,41 +4728,12 @@ button is a text box that displays the filter condition that is selected. -The I<OBTAIN ROOT DSE ENTRY> button will attempt to obtain the -root dse entry for the selected directory server. If the root -dse entry is obtained a separate window will be displayed that -will display the information obtained from the root dse entry. -If the root dse entry can not be obtained then an error message -window will be displayed. - The I<ATTRIBUTE DATA> text box is where the user will enter the data to be searched for. The program will automatically put the beginning and ending parenthesis around the data. If the I<Filter> attribute is selected this is where the I<COMPLETE> filter is entered, the program will not modify this string in any way. - -The I<DIRECTORY PORT> button will activate a window -that is separate from the main window. - -The new window contains two buttons and one text box. -If the user needs to change the TCP connection port, this -is where it is done. - -At the top of the window is a Cancel button, pressing -this button will cancel the operation of setting the -port number. - -The text box is where the user will enter the port -number to connect. Display in the text box is the -current port number. - -At the bottom of the window is the Accept button, pressing -this button will set the port number. - -The I<EXPLORE DIRECTORY SCHEMA> button will activate the -Directory Schema Search Window. For information about -this window see the Schema section of the manual. I<SEARCH> button. At the bottom of the GUI is the "Search" button. When a mouse click is done on the "Search" button |
From: Clif H. <ch...@us...> - 2003-01-17 02:55:59
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv16900/ldap/contrib Modified Files: tklkup Log Message: Changed the Bind To Directory button to Set Bind Credential button. Changed completely the way a connection is made to the directory server. Changing any of the port, bind credentials, or directory server will reconnect to the currently selected directory server and pull new a new set of search bases. Added support for SSL connections. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- tklkup 30 Dec 2002 05:30:45 -0000 1.31 +++ tklkup 17 Jan 2003 02:55:56 -0000 1.32 @@ -1,5 +1,4 @@ -#!/usr/bin/perl -# !/usr/local/bin/perl +#!/usr/local/bin/perl # # Copyright (c) 1999 - 2001 Clif Harden. All Rights Reserved # This program is free software; you can redistribute it and/or @@ -20,211 +19,16 @@ # retrieved from the directory. # # -# Revisions: [...1077 lines suppressed...] my @Attributes = ( qw(subschemaSubentry namingContexts supportedLDAPVersion supportedControl supportedExtension altServer supportedSASLMechanisms) ); @@ -4353,8 +4328,6 @@ } -$ldap->unbind; - } # End of subrountine rootDse # @@ -4611,7 +4584,7 @@ actions like moving or closing just the torn off window must be done by the user's window manager. -The I<BIND TO DIRECTORY> button will activate a window +The I<SET BIND CREDENTIALS> button will activate a window that is separate from the main window. The new window contains two buttons and two text boxes. |
From: Clif H. <ch...@us...> - 2002-12-30 05:30:49
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv897/ldap/contrib Modified Files: tklkup Log Message: Modified the error checking on ldap modify commands. Corrected all the ldap bind commands. Added CheckError subrountine. Added a few comments at the end of subrountines. Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- tklkup 6 Nov 2002 04:27:37 -0000 1.30 +++ tklkup 30 Dec 2002 05:30:45 -0000 1.31 @@ -22,6 +22,13 @@ # # Revisions: # $Log$ +# Revision 1.31 2002/12/30 05:30:45 charden +# +# Modified the error checking on ldap modify commands. +# Corrected all the ldap bind commands. +# Added CheckError subrountine. +# Added a few comments at the end of subrountines. +# # Revision 1.30 2002/11/06 04:27:37 charden # # Corrected a few pod errors that podchecker found. @@ -1703,21 +1710,16 @@ $mesg = $ldap->bind( password => "$Global{'bindpw'}", dn => "$Global{'binddn'}", version => $Global{'setVersion'}, - ) or $error = 1; + ); -if ( $mesg->code ) +if ( $mesg->code && $mesg->code != 48 ) { $errstr = $mesg->code; ERROR($errstr); -} - -if ( $error == 1 ) -{ - $schema_list->insert("end", "Bind error: $@\n"); return; } - + # # Get the schema, tries to read rootdse, if unable assumes cn=schema. # This is NOT always the case. @@ -2991,6 +2993,7 @@ my $ldap; my $mesg; my @DNs; +my $do_it; if ( !$Global{'ldapActionDN'} ) { @@ -3019,45 +3022,58 @@ if ( $error == 1 ) { - $list->insert("end", "Connect error: $@\n"); - return; $errstr = "Delete connect error on ldap server $Global{'LDAP_SERVER'}\n"; ERROR($errstr); + return; } $mesg = $ldap->bind( password => $Global{'bindpw'}, dn => $Global{'binddn'}, version => $Global{'setVersion'}, - ) or $error = 1; - + ); -if ( $mesg->code ) +if ( $mesg->code && $mesg->code != 48 ) { $errstr = $mesg->code; ERROR($errstr); -} - -if ( $error == 1 ) -{ - $errstr = "Delete Bind error on ldap server $Global{'LDAP_SERVER'}\n"; - ERROR($errstr); + return; } -$mesg = $ldap->delete($DNs[1]) or $error = 1; +$do_it = 1; +$Global{loopCount} = 0; -if ( $error == 1 ) -{ - $errstr = "Delete error: $object\nOn ldap server $Global{'LDAP_SERVER'}\n"; - ERROR($errstr); - return; -} +while ($do_it == 1 ) +{ + $mesg = $ldap->delete($DNs[1]); -if ( $mesg->code ) -{ + if ( $mesg->code ) + { + # + # There was an error, check for dsa busy + # error. + # + # $errstr = $mesg->code; - ERROR($errstr); -} + $errstr = ldap_error_text($errstr); + # + # Check for server busy. + # + if ( !(CheckError($errstr) ) ) + { + $errstr = $mesg->code; + ERROR($errstr); + return; + } + } + else + { + # + # There was no error + # + $do_it = 0; + } +} $ldap->unbind; } # End of ldapActionDelete subroutine @@ -3072,6 +3088,7 @@ my $ldap; my $mesg; $error = 0; +my $do_it; if ( $Global{'Rename'} == -1 ) { @@ -3094,39 +3111,58 @@ $mesg = $ldap->bind( password => $Global{'bindpw'}, dn => $Global{'binddn'}, version => $Global{'setVersion'}, - ) or $error = 1; + ); -if ( $mesg->code ) +if ( $mesg->code && $mesg->code != 48 ) { $errstr = $mesg->code; ERROR($errstr); } -if ( $error == 1 ) + +$do_it = 1; +$Global{loopCount} = 0; + +while ($do_it == 1 ) { - $errstr = "Rename Bind error on ldap server $Global{'LDAP_SERVER'}\n"; - ERROR($errstr); -} $mesg = $ldap->moddn($Global{'RenameDN'}, newrdn => $Global{'newrdn'}, deleteoldrdn => $Global{'deleteoldrdn'}, - newsuperior => $Global{'newsuperior'} ) or $error = 1; + newsuperior => $Global{'newsuperior'} ); -if ( $error == 1 ) -{ - $errstr = "Rename error: $Global{'RenameDN'}\nOn ldap server $Global{'LDAP_SERVER'}\n"; - ERROR($errstr); - return; -} - if ( $mesg->code ) { + # + # There was an error, check for dsa busy + # error. + # + # $errstr = $mesg->code; - ERROR($errstr); + $errstr = ldap_error_text($errstr); + # + # Check for server busy. + # + if ( !(CheckError($errstr) ) ) + { + $errstr = $mesg->code; + ERROR($errstr); + return; + } + } + else + { + # + # There was no error + # + $do_it = 0; + } + } +$ldap->unbind; + } # @@ -3498,6 +3534,7 @@ my $errstr; my $mesg; my $error = 0; # initialize error flag. +my $do_it; my $ldap = new Net::LDAP( $Global{'LDAP_SERVER'}, timeout => 1, @@ -3514,18 +3551,12 @@ $mesg = $ldap->bind( password => $Global{'bindpw'}, dn => $Global{'binddn'}, version => $Global{'setVersion'}, - ) or $error = 1; + ); -if ( $mesg->code ) +if ( $mesg->code && $mesg->code != 48 ) { $errstr = $mesg->code; ERROR($errstr); -} - -if ( $error == 1 ) -{ - $errstr = "Bind error: $@\n"; - ERROR($errstr); return; } @@ -3535,22 +3566,41 @@ if ( defined($Global{'add'}) ) { -$mesg = $ldap->modify( $Global{'entryDN'}, add => $Global{'add'}) - or $error = 1; - +$do_it = 1; +$Global{loopCount} = 0; -if ( $error == 1 ) +while ($do_it == 1 ) { - $errstr = "Add modify error: $@\n"; - ERROR($errstr); - return; -} + +$mesg = $ldap->modify( $Global{'entryDN'}, add => $Global{'add'}); if ( $mesg->code ) { + # + # There was an error, check for dsa busy + # error. + # + # $errstr = $mesg->code; - ERROR($errstr); - return; + $errstr = ldap_error_text($errstr); + # + # Check for server busy. + # + if ( !(CheckError($errstr) ) ) + { + $errstr = $mesg->code; + ERROR($errstr); + return; + } + } + else + { + # + # There was no error + # + $do_it = 0; + } + } delete( $Global{'add'} ); @@ -3562,23 +3612,44 @@ # if ( defined($Global{'delete'}) ) { -$mesg = $ldap->modify( $Global{'entryDN'}, delete => $Global{'delete'}) - or $error = 1; - + +$do_it = 1; +$Global{loopCount} = 0; -if ( $error == 1 ) +while ($do_it == 1 ) { - $errstr = "Delete modify error: $@\n"; - ERROR($errstr); - return; -} + +$mesg = $ldap->modify( $Global{'entryDN'}, delete => $Global{'delete'}); if ( $mesg->code ) { + # + # There was an error, check for dsa busy + # error. + # + # $errstr = $mesg->code; - ERROR($errstr); - return; + $errstr = ldap_error_text($errstr); + # + # Check for server busy. + # + if ( !(CheckError($errstr) ) ) + { + $errstr = $mesg->code; + ERROR($errstr); + return; + } + } + else + { + # + # There was no error + # + $do_it = 0; + } + } + delete( $Global{'delete'} ); } @@ -3589,23 +3660,44 @@ # if ( defined($Global{'replace'}) ) { -$mesg = $ldap->modify( $Global{'entryDN'}, replace => $Global{'replace'}) - or $error = 1; - + +$do_it = 1; +$Global{loopCount} = 0; -if ( $error == 1 ) +while ($do_it == 1 ) { - $errstr = "Replace modify error: $@\n"; - ERROR($errstr); - return; -} + +$mesg = $ldap->modify( $Global{'entryDN'}, replace => $Global{'replace'}); if ( $mesg->code ) { + # + # There was an error, check for dsa busy + # error. + # + # $errstr = $mesg->code; - ERROR($errstr); - return; + $errstr = ldap_error_text($errstr); + + # + # Check for server busy. + # + if ( !(CheckError($errstr) ) ) + { + $errstr = $mesg->code; + ERROR($errstr); + return; + } + } + else + { + # + # There was no error + # + $do_it = 0; + } } + delete( $Global{'replace'} ); } @@ -3721,7 +3813,7 @@ $Global{'searchHistWindow'}->destroy if Tk::Exists($Global{'searchHistWindow'}); } # End of cancel subroutine -} # End of cancel subroutine +} # End of subroutine displayDnList # # Search the directory for data @@ -3834,21 +3926,16 @@ $mesg = $ldap->bind( password => $Global{'bindpw'}, dn => $Global{'binddn'}, version => $Global{'setVersion'}, - ) or $error = 1; + ); -if ( $mesg->code ) +if ( $mesg->code && $mesg->code != 48 ) { $errstr = $mesg->code; ERROR($errstr); -} - -if ( $error == 1 ) -{ - $list->insert("end", "Bind error: $@\n"); return; } - + $Global{'searchResults'} = {}; # initialize results hash. $mesg = $ldap->search( @@ -4075,7 +4162,7 @@ # Check for an error on bind # -if ( $mesg->code ) +if ( $mesg->code && $mesg->code != 48 ) { $errstr = $mesg->code; ERROR($errstr); @@ -4268,7 +4355,7 @@ $ldap->unbind; -} +} # End of subrountine rootDse # # Determine new mainWindow position. @@ -4281,12 +4368,50 @@ $Global{'horz'} = $pos[1]; $Global{'vert'} = $pos[2]; -} +} # End of subrountine globalPos sub root_cancel { $Global{'rootWindow'}->destroy if Tk::Exists($Global{'rootWindow'}); +} # End of subrountine root_cancel + +# +# LDAP Error check, some return codes are not really errors. +# You can retry the ldap action after waiting a while. +# + +sub CheckError { + +my ( $error ) = @_; + +# +# Check for DSA busy or internal error +# + +if ( $Global{loopCount} > 61 ) { + return 0; # return an error condition. } + +++$Global{loopCount}; # Increment the loop counter. + +if ( $error =~ /too busy/ || + $error =~ /Server encountered an internal error/ ) + { + # + # DSA Busy. + # + sleep 1; + return 1; # No error, try again + } +else { + # + # DSA did not return "DSA busy" message + # + return 0; # error + + } + +} # End of subrountine CheckError #----------------------------------------# # Usage() - display simple usage message # @@ -4419,6 +4544,8 @@ same search base, there should be little or no delay when switching to the new server. +=back + Now a word about directory branch, or search base, detection. There are many things that can prevent this function from working properly. Several version 2 LDAP servers that this was tested @@ -4439,8 +4566,6 @@ If you decide to use auto search base detection you will just have to try it and hope it works. - -=back ------------------------------------------------------------------- |
From: Clif H. <ch...@us...> - 2002-12-03 03:13:45
|
Update of /cvsroot/perl-ldap/website In directory sc8-pr-cvs1:/tmp/cvs-serv14476/website Modified Files: index.html Log Message: Pointed Distrubution to the .26 release. Pointed Changelog and Release_Notes to the correct revisions. Index: index.html =================================================================== RCS file: /cvsroot/perl-ldap/website/index.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- index.html 15 Jul 2002 01:47:56 -0000 1.19 +++ index.html 3 Dec 2002 03:13:41 -0000 1.20 @@ -63,11 +63,11 @@ <hr> <h1>Distribution</h1> The latest release of the library is -<A HREF="http://prdownloads.sourceforge.net/perl-ldap/perl-ldap-0.25.tar.gz">perl-ldap-0.25</A>. +<A HREF="http://prdownloads.sourceforge.net/perl-ldap/perl-ldap-0.26.tar.gz">perl-ldap-0.26</A>. You may also <A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-ldap/ldap/">look at the individual files</A> in the CVS repository and the -<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-ldap/ldap/ChangeLog?rev=1.25">ChangeLog</A> and <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-ldap/ldap/RELEASE_NOTES?rev=1.10">RELEASE_NOTES</A> +<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-ldap/ldap/ChangeLog?rev=1.26">ChangeLog</A> and <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-ldap/ldap/RELEASE_NOTES?rev=1.11">RELEASE_NOTES</A> files, which will tell you what the most recent changes are. <!-- |