1 |
diff -Nur smeserver-password-1.2.0.old8823/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm smeserver-password-1.2.0.bz8823/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm |
2 |
--- smeserver-password-1.2.0.old8823/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm 2015-02-06 17:03:34.319193079 +0100 |
3 |
+++ smeserver-password-1.2.0.bz8823/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm 2015-02-06 21:26:41.486827403 +0100 |
4 |
@@ -14,6 +14,7 @@ |
5 |
our @EXPORT = qw(); |
6 |
our $db = esmith::ConfigDB->open(); |
7 |
our $adb = esmith::AccountsDB->open(); |
8 |
+our @acctName; |
9 |
|
10 |
sub new |
11 |
{ |
12 |
@@ -171,43 +172,35 @@ |
13 |
$key->set_prop('LockAccount', $q->param('LockAccount')); |
14 |
$key->set_prop('DateReset', $q->param('DateReset')); |
15 |
|
16 |
-# this way something goes wrong when deselecting all one stays |
17 |
-#my @cusers = $q->param('PasswordAge'); |
18 |
-# workaround |
19 |
use CGI; |
20 |
my $cgi = CGI->new; |
21 |
my @cusers = $cgi->param('PasswordAge'); |
22 |
|
23 |
-my %opt1 ; |
24 |
-foreach (@cusers) { |
25 |
- $opt1{$_}="on"; |
26 |
- } |
27 |
my $isok=0; |
28 |
|
29 |
-for my $user ($adb->users) |
30 |
- { |
31 |
+foreach my $user ($adb->users) |
32 |
+ { |
33 |
# next user unless password is set |
34 |
next unless (($user->prop('PasswordSet') || 'no') eq 'yes'); |
35 |
- my $passage = $user->prop('PasswordAge') || 'no'; |
36 |
- # $user->set_prop('PasswordAge', 'no'); |
37 |
- my $acctName=$user->key; |
38 |
- if ( defined $opt1{$acctName} eq "on" ) |
39 |
- { |
40 |
- $user->set_prop('PasswordAge', 'yes'); |
41 |
- } |
42 |
- else |
43 |
- { |
44 |
- $user->set_prop('PasswordAge', 'no'); |
45 |
- } |
46 |
- unless (system ("/sbin/e-smith/signal-event", "password-modify", $acctName) == 0) { |
47 |
+ my $passage = $user->prop('PasswordAge') || 'no'; |
48 |
+ $user->set_prop('PasswordAge', 'no'); |
49 |
+ my $username = $user-> key; |
50 |
+ push @acctName, $username; |
51 |
+ } |
52 |
+ |
53 |
+ #we retrieve if the modify box is checked and set to on |
54 |
+ foreach my $m (@cusers) { |
55 |
+ $key = $adb->get($m); |
56 |
+ $key->set_prop('PasswordAge','yes') |
57 |
+ } |
58 |
+ |
59 |
+ unless (system ("/sbin/e-smith/signal-event", "password-modify", @acctName) == 0) { |
60 |
$isok=1; |
61 |
} |
62 |
- } |
63 |
-unless ($isok==0) { |
64 |
- return $self->error('CANNOT_SAVE'); |
65 |
- } |
66 |
+ unless ($isok==0) { |
67 |
+ return $self->error('CANNOT_SAVE'); |
68 |
+ } |
69 |
|
70 |
-return $self->success('SUCCESSFULLY_MODIFIED'); |
71 |
-} |
72 |
+ return $self->success('SUCCESSFULLY_MODIFIED'); |
73 |
+ } |
74 |
1; |
75 |
- |