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 |