Changeset 197
- Timestamp:
- 05/26/09 20:48:34 (15 years ago)
- Location:
- LATMOS-Accounts
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/bin/la-sync
r132 r197 61 61 foreach (@ARGV) { 62 62 warn "Try to sync $otype: $_\n"; 63 $sync->sync_object($otype, $_); 63 $sync->sync_object($otype, $_) or do { 64 warn "Error while synching $_ ($otype)\n"; 65 exit 1; 66 } 64 67 } 65 68 } else { 66 69 $sync->process() or warn "Sync has failed\n"; 67 70 } 71 72 exit 0; -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r175 r197 174 174 my ($self, $otype, $id, %data) = @_; 175 175 my $pclass = $self->_load_obj_class($otype); 176 $pclass->_create($self, $id, %data) or return; 176 $pclass->_create($self, $id, %data) or do { 177 return; 178 }; 177 179 $self->get_object($otype, $id); 178 180 } … … 324 326 return 'CREATE' if ($self->create_c_object($srcobj->type, $srcobj->id, %data)); 325 327 } else { 326 return ''; 328 # No error, but creation is denied 329 return 'Creation skipped'; 327 330 } 328 331 -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ad/User.pm
r193 r197 91 91 $entry->replace(objectClass => [ qw(top person organizationalPerson user)],); 92 92 $entry->replace(userAccountControl => 66112); 93 $entry->replace(sAMAccountType => 0x30000000); 93 # This attributes cannot be set via LDAP: 94 #$entry->replace(sAMAccountType => 0x30000000); 94 95 $entry->replace(accountExpires => '9223372036854775807'); # TODO hardcoded, burk 95 96 $entry->replace(userPrincipalName => "$id\@" . $base->ad_domain); … … 98 99 } 99 100 my $msg = $base->ldap->add($entry); 101 warn $msg->error if ($msg->code); 100 102 return $msg->code ? 0 : 1; 101 103 } -
LATMOS-Accounts/lib/LATMOS/Accounts/Synchro.pm
r110 r197 182 182 sub sync_object { 183 183 my ($self, $otype, $uid) = @_; 184 my $sobj = $self->from->get_object($otype, $uid) or return; 185 foreach ($self->to) { 186 $_->sync_object($sobj) 184 my $sobj = $self->from->get_object($otype, $uid) or do { 185 warn "Cannot get object for synching $uid ($otype)\n"; 186 return; 187 }; 188 foreach ($self->to) { 189 if (my $res = $_->sync_object($sobj)) { 190 print $_->label . " $uid ($otype) $res\n"; 191 } else { warn "error synching $uid ($otype) to " . $_->label . "\n"; } 187 192 } 188 193 foreach ($self->to) {
Note: See TracChangeset
for help on using the changeset viewer.