#!/usr/local/bin/perl -w # $Id: ldapUniventionPrefs.pl,v 1.1.2.1 2007/03/23 08:34:05 martin Exp $ use strict; # Perl script to set authentication server LDAP preferences # for the Univention LDAP server. # # Set $Univention_Server to the host name or IP address # of the Univention LDAP Server, e.g. # my $Univention_Server = "server.company.com"; # # Set $Univention_Administrator and $Univention_Password # to the user name and password for the simple LDAP authentication, e.g. # my $Univention_Administrator = "Administrator"; # my $Univention_Password = "univention"; my $Univention_Server = "192.168.2.20"; my $Univention_Administrator = "Administrator"; my $Univention_Password = "univention"; my $HELIOSDIR; open(FD, "/etc/HELIOSInstallPath") || die "cannot find HELIOS product, check installation\n"; chop($HELIOSDIR = ); close(FD); my $prefvalue = "$HELIOSDIR/bin/prefvalue"; system($prefvalue, "-k", "Programs/authsrv/NameServices", "-t", "str", "local,NIS,LDAP"); system($prefvalue, "-k", "Programs/authsrv/LDAP_Server", "-t", "str", $Univention_Server); # ldap base DN to search users system($prefvalue, "-k", "Programs/authsrv/LDAP_UserBase", "-t", "str", "cn=users,dc=univention,dc=local"); # ldap base DN to search groups system($prefvalue, "-k", "Programs/authsrv/LDAP_GroupBase", "-t", "str", "cn=groups,dc=univention,dc=local"); # how to bind for requests, empty DN is anonymuous system($prefvalue, "-k", "Programs/authsrv/LDAP_BindDN", "-t", "str", "uid=$Univention_Administrator,cn=users,dc=univention,dc=local"); system($prefvalue, "-k", "Programs/authsrv/LDAP_BindPassword", "-t", "str", $Univention_Password); # -- LDAP FILTER -- system($prefvalue, "-k", "Programs/authsrv/LDAP_LongUserFilter", "-t", "str", "cn=%s"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UserFilter", "-t", "str", "uid=%s"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UserIDFilter", "-t", "str", "uidNumber=%d"); system($prefvalue, "-k", "Programs/authsrv/LDAP_GroupFilter", "-t", "str", "cn=%s"); system($prefvalue, "-k", "Programs/authsrv/LDAP_GroupIDFilter", "-t", "str", "gidNumber=%d"); system($prefvalue, "-k", "Programs/authsrv/LDAP_GroupMemberFilter", "-t", "str", "uniqueMember=uid=%s,cn=users,dc=univention,dc=local"); #-- LDAP Attributes -- system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_HeliosPassword", "-t", "str", ""); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_ClearPassword", "-t", "str", ""); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_NTPassword", "-t", "str", "sambaNTPassword"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_LMPassword", "-t", "str", "sambaLMPassword"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_Name", "-t", "str", "uid"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_LongName", "-t", "str", "cn"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_UID", "-t", "str", "uidNumber"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_PGID", "-t", "str", "gidNumber"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_HomeDirectory", "-t", "str", "homeDirectory"); system($prefvalue, "-k", "Programs/authsrv/LDAP_UATTR_AppleID", "-t", "str", ""); system($prefvalue, "-k", "Programs/authsrv/LDAP_GATTR_GID", "-t", "str", "gidNumber"); system($prefvalue, "-k", "Programs/authsrv/LDAP_GATTR_Name", "-t", "str", "cn");