[Pkg-openldap-devel] [openldap] 11/39: r1676 at pulsar: torsten | 2005-04-06 16:43:23 +0200 Add a directory with some play scripts for testing the LDAP server

Timo Aaltonen tjaalton-guest at alioth.debian.org
Thu Oct 10 05:35:13 UTC 2013


This is an automated email from the git hooks/post-receive script.

tjaalton-guest pushed a commit to annotated tag 2.2.23-2
in repository openldap.

commit 5dda37a3be76fc69ad817f62de4cb3d3951d5dd9
Author: Torsten Landschoff <torsten at debian.org>
Date:   Wed Apr 6 15:11:04 2005 +0000

     r1676 at pulsar:  torsten | 2005-04-06 16:43:23 +0200
     Add a directory with some play scripts for testing the LDAP server
---
 debian/tests/create_account |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/debian/tests/create_account b/debian/tests/create_account
new file mode 100755
index 0000000..a5051af
--- /dev/null
+++ b/debian/tests/create_account
@@ -0,0 +1,24 @@
+#! /usr/bin/perl -w
+
+# Shows how to create an entry on the LDAP server
+
+$host = "localhost";			# LDAP server
+$basedn = "dc=galaxy";			# Base DN
+$admindn = "cn=admin, $basedn";		# Admin entry
+$adminpass = "foo";			# Password
+
+use Net::LDAP;
+
+$ldap = Net::LDAP->new("$host", onerror => "die");
+$ldap->bind($admindn, password => $adminpass);
+
+# Create "ou=People" entry if not there
+
+$results = $ldap->search(base => "$basedn", 
+	filter => "ou=People", scope => "one");
+unless ($results->count > 0) {
+	$ldap->add("ou=People, $basedn", attr => [
+		  ou => "People", 
+		  objectClass => [ "top", "organizationalUnit" ]
+		]);
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openldap/openldap.git



More information about the Pkg-openldap-devel mailing list