Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm	(revision 2439)
@@ -74,7 +74,8 @@
 
     $self->{_configdir} = $config;
+    $self->{_loguser} = $options{loguser};
     bless($self, $class);
 
-    unless ($options{noacl} || $ENV{LA_USERNAME}) {
+    unless ($options{noacl}) {
         if (-f (my $aclf = join('/', $self->_configdir, 'la-acls.ini'))) {
             $self->{_acls} = LATMOS::Accounts::Acls->new($aclf) or do {
@@ -147,4 +148,22 @@
     };
     $base;
+}
+
+=head2 LogUser
+
+Return the username to use when no user is connected
+
+=cut
+
+sub LogUser {
+    my ( $self, $Login ) = @_;
+
+    my $name = $self->{_loguser} || '@Console';
+
+    if ($Login) {
+        $self->{_loguser} = $Login;
+    }
+
+    return $name;
 }
 
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm	(revision 2439)
@@ -1279,4 +1279,16 @@
 sub user { $_[0]->{_user} }
 
+=head2 LogUser
+
+Return the username to use when no user is connected
+
+=cut
+
+sub LogUser {
+    my ( $self ) = @_;
+
+    return $self->user || $self->la->LogUser;
+}
+
 =head2 check_acl($obj, $attr, $perm)
 
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm	(revision 2439)
@@ -1011,5 +1011,5 @@
 
     $sthmodifiedby->execute(
-        $self->user || '@Console',
+        $self->LogUser,
         $ref,
     );
@@ -1036,5 +1036,5 @@
         $name,
         $changetype,
-        $self->user || '@Console',
+        $self->LogUser,
         sprintf($message, @args),
         $potype, $pname, $pikey,
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm	(revision 2439)
@@ -394,6 +394,6 @@
     }
     $first{$class->_key_field} = $id;
-    $first{createdby} =  $base->user || '@Console';
-    $first{modifiedby} = $base->user || '@Console';
+    $first{createdby} =  $base->LogUser;
+    $first{modifiedby} = $base->LogUser;
 
     my $lastid;
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SyncManager.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SyncManager.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SyncManager.pm	(revision 2439)
@@ -61,4 +61,16 @@
 sub ini { $_[0]->{ini} }
 
+=head2 LA
+
+Return a LATMOS::Accounts setup for SynchM
+
+=cut
+
+sub LA {
+    my ( $self ) = @_;
+
+    return LATMOS::Accounts->new($self->{config}, noacl => 1, loguser => '@SyncManager');
+}
+
 =head2 dbrev
 
@@ -69,5 +81,5 @@
 sub dbrev {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $base = $LA->base;
     return $base->current_rev;
@@ -76,5 +88,5 @@
 sub _load_state_ini {
     my ($self) = @_;
-    my $la = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $la = $self->LA;
 
     my $state_file =  $la->val('_default_', 'state_dir', '/');
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task.pm	(revision 2439)
@@ -37,4 +37,10 @@
 }
 
+sub LA {
+    my $self = shift;
+
+    return $self->{syncm}->LA(@_);
+}
+
 =head2 config($value, $default)
 
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Basessynchro.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Basessynchro.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Basessynchro.pm	(revision 2439)
@@ -23,5 +23,5 @@
 sub run {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1) or do {
+    my $LA = $self->LA;
         la_log LA_ERR, "Cannot instantiate LA";
         return 1;
@@ -55,5 +55,5 @@
 sub reset_savepoint {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1) or do {
+    my $LA = $self->LA;
         la_log LA_ERR, "Cannot instantiate LA";
         return;
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildlistes.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildlistes.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildlistes.pm	(revision 2439)
@@ -25,5 +25,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm	(revision 2439)
@@ -53,5 +53,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
 
     $self->{_base} = $LA->base();
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Delexpiredusers.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Delexpiredusers.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Delexpiredusers.pm	(revision 2439)
@@ -98,5 +98,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Employment.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Employment.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Employment.pm	(revision 2439)
@@ -23,5 +23,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Expiredaliases.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Expiredaliases.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Expiredaliases.pm	(revision 2439)
@@ -25,5 +25,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Iprecover.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Iprecover.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Iprecover.pm	(revision 2439)
@@ -45,5 +45,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Refreshexpired.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Refreshexpired.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Refreshexpired.pm	(revision 2439)
@@ -35,5 +35,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Setattribute.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Setattribute.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Setattribute.pm	(revision 2439)
@@ -49,5 +49,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Stats.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Stats.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Stats.pm	(revision 2439)
@@ -18,5 +18,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Unexportexpired.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Unexportexpired.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Unexportexpired.pm	(revision 2439)
@@ -32,5 +32,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Unusedhosts.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Unusedhosts.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Unusedhosts.pm	(revision 2439)
@@ -55,5 +55,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Update.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Update.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Update.pm	(revision 2439)
@@ -22,5 +22,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $basename = $LA->default_base_name;
     my $labase = $LA->_load_base($basename) or die "Cannot load base";
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Updatedyndata.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Updatedyndata.pm	(revision 2438)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Updatedyndata.pm	(revision 2439)
@@ -31,5 +31,5 @@
 sub init {
     my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
+    my $LA = $self->LA;
     my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
     $labase && $labase->load or die "Cannot load base";
