/[smecontribs]/rpms/smeserver-shared-folders/contribs7/smeserver-shared-folders-0.1-manual_permissions.patch
ViewVC logotype

Annotation of /rpms/smeserver-shared-folders/contribs7/smeserver-shared-folders-0.1-manual_permissions.patch

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


Revision 1.1 - (hide annotations) (download)
Mon Mar 8 13:19:13 2010 UTC (14 years, 8 months ago) by vip-ire
Branch: MAIN
CVS Tags: smeserver-shared-folders-0_1-28_el4_sme, smeserver-shared-folders-0_1-43_el4_sme, smeserver-shared-folders-0_1-39_el4_sme, smeserver-shared-folders-0_1-17_el4_sme, smeserver-shared-folders-0_1-25_el4_sme, smeserver-shared-folders-0_1-40_el4_sme, smeserver-shared-folders-0_1-18_el4_sme, smeserver-shared-folders-0_1-71_el4_sme, smeserver-shared-folders-0_1-61_el4_sme, smeserver-shared-folders-0_1-70_el4_sme, smeserver-shared-folders-0_1-66_el4_sme, smeserver-shared-folders-0_1-65_el4_sme, smeserver-shared-folders-0_1-51_el4_sme, smeserver-shared-folders-0_1-50_el4_sme, smeserver-shared-folders-0_1-59_el4_sme, smeserver-shared-folders-0_1-48_el4_sme, smeserver-shared-folders-0_1-21_el4_sme, smeserver-shared-folders-0_1-56_el4_sme, smeserver-shared-folders-0_1-35_el4_sme, smeserver-shared-folders-0_1-37_el4_sme, smeserver-shared-folders-0_1-42_el4_sme, smeserver-shared-folders-0_1-23_el4_sme, smeserver-shared-folders-0_1-60_el4_sme, smeserver-shared-folders-0_1-47_el4_sme, smeserver-shared-folders-0_1-77_el4_sme, smeserver-shared-folders-0_1-32_el4_sme, smeserver-shared-folders-0_1-74_el4_sme, smeserver-shared-folders-0_1-26_el4_sme, smeserver-shared-folders-0_1-20_el4_sme, smeserver-shared-folders-0_1-78_el4_sme, smeserver-shared-folders-0_1-22_el4_sme, smeserver-shared-folders-0_1-30_el4_sme, smeserver-shared-folders-0_1-41_el4_sme, smeserver-shared-folders-0_1-31_el4_sme, smeserver-shared-folders-0_1-24_el4_sme, smeserver-shared-folders-0_1-34_el4_sme, smeserver-shared-folders-0_1-62_el4_sme, smeserver-shared-folders-0_1-58_el4_sme, smeserver-shared-folders-0_1-63_el4_sme, smeserver-shared-folders-0_1-75_el4_sme, smeserver-shared-folders-0_1-76_el4_sme, smeserver-shared-folders-0_1-68_el4_sme, smeserver-shared-folders-0_1-69_el4_sme, smeserver-shared-folders-0_1-57_el4_sme, smeserver-shared-folders-0_1-54_el4_sme, smeserver-shared-folders-0_1-49_el4_sme, smeserver-shared-folders-0_1-46_el4_sme, smeserver-shared-folders-0_1-33_el4_sme, smeserver-shared-folders-0_1-44_el4_sme, smeserver-shared-folders-0_1-45_el4_sme, smeserver-shared-folders-0_1-52_el4_sme, smeserver-shared-folders-0_1-29_el4_sme, smeserver-shared-folders-0_1-19_el4_sme, smeserver-shared-folders-0_1-72_el4_sme, smeserver-shared-folders-0_1-73_el4_sme, smeserver-shared-folders-0_1-38_el4_sme, smeserver-shared-folders-0_1-64_el4_sme, smeserver-shared-folders-0_1-36_el4_sme, smeserver-shared-folders-0_1-67_el4_sme, smeserver-shared-folders-0_1-79_el4_sme, smeserver-shared-folders-0_1-55_el4_sme, smeserver-shared-folders-0_1-27_el4_sme, smeserver-shared-folders-0_1-53_el4_sme, HEAD
* Mon Mar 08 2010 Daniel B. <daniel@firewall-services.com> 0.1-17.sme
- Add an option to allow manual permissions (ManualPermissions)
- remove unused .orig file
- Exec CGI in cgi-bin directories

1 vip-ire 1.1 diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify
2     --- smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify 2010-03-08 10:45:06.000000000 +0100
3     +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify 2010-03-08 10:40:59.000000000 +0100
4     @@ -40,6 +40,8 @@
5     my $share = $accountdb->get($shareName) or
6     die "Couldn't find $shareName record in accounts db\n";
7    
8     +my $perm = $share->prop('ManualPermissions') || 'no';
9     +
10     die "Account $shareName is not an share account; modify share event failed.\n"
11     unless ($share->prop('type') eq 'share');
12    
13     @@ -127,11 +129,14 @@
14     }
15    
16     # Purge Old ACLs before defining new ones
17     +# Don't reset permissions if ManualPermissions is set to 'yes'
18    
19     -system($setfacl,
20     +unless ( $perm eq 'yes' || $perm eq 'enabled' ){
21     + system($setfacl,
22     '-R',
23     '--remove-all',
24     '.');
25    
26     -find(\&process, glob("./"));
27     + find(\&process, glob("./"));
28     +}
29    
30     diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/shares mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/shares
31     --- smeserver-shared-folders-0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/shares 2010-03-08 10:45:06.000000000 +0100
32     +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/shares 2010-03-08 10:44:49.000000000 +0100
33     @@ -356,4 +356,10 @@
34     </trans>
35     </entry>
36    
37     + <entry>
38     + <base>MANUAL_PERMS</base>
39     + <trans>
40     + <![CDATA[<span style="color:red">Permissions on this shared folder are managed manually, you cannot change it.</span><br><br>]]>
41     + </trans>
42     + </entry>
43     </lexicon>
44     diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/shares.pm mezzanine_patched_smeserver-shared-folders-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/shares.pm
45     --- smeserver-shared-folders-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/shares.pm 2010-03-08 10:45:06.000000000 +0100
46     +++ mezzanine_patched_smeserver-shared-folders-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/shares.pm 2010-03-08 10:40:59.000000000 +0100
47     @@ -218,6 +218,8 @@
48     ($rec->prop('Indexes') || 'enabled'));
49     $q->param(-name=>'dynamic',-value=>
50     ($rec->prop('DynamicContent') || 'disabled'));
51     + $q->param(-name=>'manualPerm',-value=>
52     + ($rec->prop('ManualPermissions') || 'no'));
53     }
54     }
55     else {
56     @@ -243,39 +245,44 @@
57     my $WriteGroups = $q->param('WriteGroups') || '';
58     my $ReadGroups = $q->param('ReadGroups') || '';
59     my $share = $q->param('share');
60     + my $manualPerm = $q->param('manualPerm') || '';
61    
62     - my %WriteGroups;
63     - my %ReadGroups;
64     - foreach my $group ( split ( /[,;]/, $WriteGroups ) ) {
65     - $WriteGroups{$group} = 1;
66     - }
67     - foreach my $group ( split ( /[,;]/, $ReadGroups ) ) {
68     - $ReadGroups{$group} = 1;
69     - }
70     - my @groups = sort { $a->key() cmp $b->key() } $accountdb->groups();
71     -
72     - my $out = "<tr><td class=\"sme-noborders-label\">" .
73     - $fm->localise('PERMISSIONS') .
74     - "</td><td>\n".
75     - $q->start_table({-class => "sme-border"})."\n".
76     - $q->Tr(
77     - esmith::cgi::genSmallCell($q, $fm->localise('GROUPS'),"header"),
78     - esmith::cgi::genSmallCell($q, $fm->localise('WRITE_PERM'),"header"),
79     - esmith::cgi::genSmallCell($q, $fm->localise('READ_PERM'),"header")
80     - );
81     -
82     - foreach my $group (@groups) {
83     - my $write = "";
84     - my $read = "";
85     - my $name = $group->key();
86     - if ( $WriteGroups{$name} ) {
87     - $write = "checked";
88     + if (($manualPerm eq 'yes') || ($manualPerm eq 'enabled')){
89     + return $fm->localise('MANUAL_PERMS');
90     + }
91     + else {
92     + my %WriteGroups;
93     + my %ReadGroups;
94     + foreach my $group ( split ( /[,;]/, $WriteGroups ) ) {
95     + $WriteGroups{$group} = 1;
96     }
97     - if ( $ReadGroups{$name} ) {
98     - $read = "checked";
99     + foreach my $group ( split ( /[,;]/, $ReadGroups ) ) {
100     + $ReadGroups{$group} = 1;
101     }
102     + my @groups = sort { $a->key() cmp $b->key() } $accountdb->groups();
103     +
104     + my $out = "<tr><td class=\"sme-noborders-label\">" .
105     + $fm->localise('PERMISSIONS') .
106     + "</td><td>\n".
107     + $q->start_table({-class => "sme-border"})."\n".
108     + $q->Tr(
109     + esmith::cgi::genSmallCell($q, $fm->localise('GROUPS'),"header"),
110     + esmith::cgi::genSmallCell($q, $fm->localise('WRITE_PERM'),"header"),
111     + esmith::cgi::genSmallCell($q, $fm->localise('READ_PERM'),"header")
112     + );
113    
114     - $out .= $q->Tr(
115     + foreach my $group (@groups) {
116     + my $write = "";
117     + my $read = "";
118     + my $name = $group->key();
119     + if ( $WriteGroups{$name} ) {
120     + $write = "checked";
121     + }
122     + if ( $ReadGroups{$name} ) {
123     + $read = "checked";
124     + }
125     +
126     + $out .= $q->Tr(
127     esmith::cgi::genSmallCell($q, $name, "normal"),
128     esmith::cgi::genSmallCell($q,"<input type=\"checkbox\""
129     . " name=\"write\""
130     @@ -284,10 +291,11 @@
131     . " name=\"read\""
132     . " $read value=\"$name\">", "normal")
133     );
134     - }
135     + }
136    
137     - $out .= "</table></td></tr>\n";
138     - return $out;
139     + $out .= "</table></td></tr>\n";
140     + return $out;
141     + }
142     }
143    
144     # Print a section bar

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