/[smecontribs]/rpms/smeserver-password/contribs9/smeserver-password-1.2.0-fix-password-aging.patch
ViewVC logotype

Annotation of /rpms/smeserver-password/contribs9/smeserver-password-1.2.0-fix-password-aging.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Fri Feb 6 20:44:56 2015 UTC (9 years, 9 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-password-1_2_0-3_el6_sme, smeserver-password-1_2_0-4_el6_sme
* Fri Feb 06 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 1.2.0-2
- fix password aging [SME: 8823]

1 stephdl 1.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     -

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed