ispman/scripts ldifupdate,1.18,1.19

Joerg Delker <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19862/scripts

Modified Files:
	ldifupdate 
Log Message:
added check for minimum required ispmanDomainUser objectclasses

Index: ldifupdate
===================================================================
RCS file: /cvsroot/ispman/ispman/scripts/ldifupdate,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ldifupdate	27 Jun 2004 20:35:44 -0000	1.18
+++ ldifupdate	27 Jun 2004 22:16:28 -0000	1.19
@@ -19,8 +19,9 @@
 
 # defines
 my @oc_normalDomain       = qw(ispmanDomain PureFTPdUser posixAccount);
-my @oc_replicaDomain      = qw(ispmanDomain ispmanBranch top);
+my @oc_replicaDomain      = qw(ispmanDomain ispmanBranch);
 my @oc_virtualHost        = qw(ispmanVirtualHost posixAccount PureFTPdUser);
+my @oc_domainUser         = qw(ispmanDomainUser posixAccount);
 my $default_domainHomedir = "/ispman/domains";
 my @default_fileserver    = qw( );
 my @default_webhost       = qw( );
@@ -52,7 +53,7 @@
 }
 
 sub update_oc {
-    my ( $entry, $src, $dst ) = @_;
+    my ( $entry, $src, $dst, %opt ) = @_;
     my $msg = "";
     my %in_src;
     my %in_dst;
@@ -65,10 +66,13 @@
         }
         $in_dst{$_} = 1;
     }
-    for (@$src) {
-        if ( !$in_dst{$_} ) {
-            $msg .= "deleting objectclass: \"$_\"\n";
-            $entry->delete( "objectclass" => [$_] );
+    
+    if (!$opt{addonly}){
+        for (@$src) {
+            if ( !$in_dst{$_} ) {
+                $msg .= "deleting objectclass: \"$_\"\n";
+                $entry->delete( "objectclass" => [$_] );
+            }
         }
     }
 
@@ -474,6 +478,10 @@
     }
     elsif ( $oc{'ispmanDomainUser'} ) {
 
+        # checking minimum objectclasses
+        $msg .= update_oc( $entry, \@oc, \@oc_domainUser,
+                           addonly => 1);
+
         # checking for alternate uid
         my @uids = $entry->get_value("uid");
         my $uid = join "@", $entry->get_value("ispmanUserId"),



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.