Handle deploiement password change

tags/0.0.1
Daniel Berteaud 13 years ago
parent 00ff1c53a6
commit c49d6aadd7
  1. 2
      ipasserelle-gp.spec
  2. 18
      root/etc/e-smith/events/actions/wpkg-init

@ -1,5 +1,5 @@
%define version 0.0.1 %define version 0.0.1
%define release 1.beta13 %define release 1.beta14
%define name ipasserelle-gp %define name ipasserelle-gp

@ -52,16 +52,32 @@ if (!$dep){
City => 'Martillac', City => 'Martillac',
Dept => 'Administration', Dept => 'Administration',
Removable => 'no', Removable => 'no',
PasswordSet => 'yes', PasswordSet => 'no',
}); });
unless ( system("/sbin/e-smith/signal-event", "user-create", "deploiement") == 0 ){ unless ( system("/sbin/e-smith/signal-event", "user-create", "deploiement") == 0 ){
die "Failed to create user account deploiement\n"; die "Failed to create user account deploiement\n";
} }
esmith::util::setUserPassword ("deploiement", "$pass"); esmith::util::setUserPassword ("deploiement", "$pass");
$a->set_prop('deploiement', 'PasswordSet', 'yes');
unless ( system("/sbin/e-smith/signal-event", "password-modify", "deploiement") == 0 ){ unless ( system("/sbin/e-smith/signal-event", "password-modify", "deploiement") == 0 ){
die "Failed to set password for user deploiement\n"; die "Failed to set password for user deploiement\n";
} }
$a->set_prop('deploiement', 'Password', "$pass");
}
else{
my $wpkg = $c->get('wpkg') || die "Couldn't find wpkg service\n";
my $new = $wpkg->prop('UserPassword') || '';
my $old = $dep->prop('Password') || '';
my $set = $dep->prop('PasswordSet') || 'no';
if (($old ne $new) || ($set ne 'yes')){
esmith::util::setUserPassword ("deploiement", "$new");
$a->set_prop('deploiement', 'PasswordSet', 'yes');
unless ( system("/sbin/e-smith/signal-event", "password-modify", "deploiement") == 0 ){
die "Failed to set password for user deploiement\n";
}
$a->set_prop('deploiement', 'Password', "$new");
}
} }
# sharedfolder wpkg # sharedfolder wpkg

Loading…
Cancel
Save