Tk Library Source Code

Attachment Details
Login
Overview

Artifact ID: c53c17bc557fd5a72c0b0ffd4718460a73271e01
Ticket: 1082061fffffffffffffffffffffffffffffffff
Date: 2004-12-09 19:48:53
User: dossy
Artifact Attached: aae54e295954467420232fb796fff4aae762e664
Filename:rfe-1082061-patch.txt
Description:Add -scope option to ldap::search patch - 20041209
Content:
--- ldap.tcl.orig	2004-12-09 07:30:46.000000000 -0500
+++ ldap.tcl	2004-12-09 07:42:36.000000000 -0500
@@ -55,7 +55,7 @@
 #-----------------------------------------------------------------------------
 
 
-package provide ldap 1.2
+package provide ldap 1.3
 
 
 namespace eval ldap {
@@ -359,7 +359,7 @@
 #               dn1 { attr1 val1 attr2 val2 ... } dn2 { a1 v1 } ....
 #
 #-----------------------------------------------------------------------------
-proc ldap::search { handle baseObject filterString attributes } {
+proc ldap::search { handle baseObject filterString attributes args} {
 
     upvar $handle conn
 
@@ -369,6 +369,19 @@
     set timeLimit    0
     set attrsOnly    0
 
+    foreach {key value} $args {
+        switch -- $key {
+            -scope {
+                switch -- $value {
+                    base { set scope 0 }
+                    one - onelevel { set scope 1 }
+                    sub - subtree { set scope 2 }
+                    default { set scope $value }
+                }
+            }
+        }
+    }
+
     #----------------------------------------------------------
     #   marshal filter and attributes parameter
     #----------------------------------------------------------