From fe2751bf1e0388ddfa3fdfa88ed70b2bc94e2173 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 03:23:54 +0200 Subject: Adding debian version 2.4.47+dfsg-3+deb10u7. Signed-off-by: Daniel Baumann --- debian/tests/create_account | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 debian/tests/create_account (limited to 'debian/tests/create_account') 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" ] + ]); +} -- cgit v1.2.3