@@ -27,80 +27,80 @@ |
||
27 | 27 | ?> |
28 | 28 | |
29 | 29 | <div class="section" id="shareAPI"> |
30 | - <h2><?php p($l->t('Sharing'));?></h2> |
|
30 | + <h2><?php p($l->t('Sharing')); ?></h2> |
|
31 | 31 | <a target="_blank" rel="noreferrer" class="icon-info" |
32 | - title="<?php p($l->t('Open documentation'));?>" |
|
32 | + title="<?php p($l->t('Open documentation')); ?>" |
|
33 | 33 | href="<?php p(link_to_docs('admin-sharing')); ?>"></a> |
34 | 34 | <p id="enable"> |
35 | 35 | <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" class="checkbox" |
36 | 36 | value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
37 | - <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/> |
|
37 | + <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API')); ?></label><br/> |
|
38 | 38 | </p> |
39 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
39 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
40 | 40 | <input type="checkbox" name="shareapi_allow_links" id="allowLinks" class="checkbox" |
41 | 41 | value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
42 | - <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/> |
|
42 | + <label for="allowLinks"><?php p($l->t('Allow users to share via link')); ?></label><br/> |
|
43 | 43 | </p> |
44 | 44 | |
45 | 45 | <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
46 | 46 | <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox" |
47 | 47 | value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> /> |
48 | - <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/> |
|
48 | + <label for="allowPublicUpload"><?php p($l->t('Allow public uploads')); ?></label><br/> |
|
49 | 49 | <input type="checkbox" name="shareapi_enable_link_password_by_default" id="enableLinkPasswordByDefault" class="checkbox" |
50 | 50 | value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
51 | - <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password'));?></label><br/> |
|
51 | + <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password')); ?></label><br/> |
|
52 | 52 | <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox" |
53 | 53 | value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> /> |
54 | - <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/> |
|
54 | + <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection')); ?></label><br/> |
|
55 | 55 | |
56 | 56 | <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox" |
57 | 57 | value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
58 | - <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/> |
|
58 | + <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date')); ?></label><br/> |
|
59 | 59 | |
60 | 60 | </p> |
61 | - <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
62 | - <?php p($l->t( 'Expire after ' )); ?> |
|
61 | + <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
62 | + <?php p($l->t('Expire after ')); ?> |
|
63 | 63 | <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>" |
64 | 64 | value='<?php p($_['shareExpireAfterNDays']) ?>' /> |
65 | - <?php p($l->t( 'days' )); ?> |
|
65 | + <?php p($l->t('days')); ?> |
|
66 | 66 | <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" class="checkbox" |
67 | 67 | value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
68 | - <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/> |
|
68 | + <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date')); ?></label><br/> |
|
69 | 69 | </p> |
70 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
70 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
71 | 71 | <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox" |
72 | 72 | value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
73 | - <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/> |
|
73 | + <label for="allowResharing"><?php p($l->t('Allow resharing')); ?></label><br/> |
|
74 | 74 | </p> |
75 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
75 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
76 | 76 | <input type="checkbox" name="shareapi_allow_group_sharing" id="allowGroupSharing" class="checkbox" |
77 | 77 | value="1" <?php if ($_['allowGroupSharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
78 | - <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups'));?></label><br /> |
|
78 | + <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups')); ?></label><br /> |
|
79 | 79 | </p> |
80 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
80 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
81 | 81 | <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" class="checkbox" |
82 | 82 | value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> /> |
83 | - <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/> |
|
83 | + <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups')); ?></label><br/> |
|
84 | 84 | </p> |
85 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
85 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
86 | 86 | <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" class="checkbox" |
87 | 87 | value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> /> |
88 | - <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/> |
|
88 | + <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing')); ?></label><br/> |
|
89 | 89 | </p> |
90 | 90 | <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
91 | 91 | <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px" class="noJSAutoUpdate"/> |
92 | 92 | <br /> |
93 | 93 | <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em> |
94 | 94 | </p> |
95 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
95 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
96 | 96 | <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration" class="checkbox" |
97 | 97 | <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
98 | - <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered.'));?></label><br /> |
|
98 | + <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered.')); ?></label><br /> |
|
99 | 99 | </p> |
100 | 100 | <p> |
101 | 101 | <input type="checkbox" id="publicShareDisclaimer" class="checkbox noJSAutoUpdate" |
102 | 102 | <?php if ($_['publicShareDisclaimerText'] !== null) print_unescaped('checked="checked"'); ?> /> |
103 | - <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)'));?></label> |
|
103 | + <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)')); ?></label> |
|
104 | 104 | <span id="publicShareDisclaimerStatus" class="msg" style="display:none"></span> |
105 | 105 | <br/> |
106 | 106 | <textarea placeholder="<?php p($l->t('This text will be shown on the public link upload page when the file list is hidden.')) ?>" id="publicShareDisclaimerText" <?php if ($_['publicShareDisclaimerText'] === null) { print_unescaped('class="hidden"'); } ?>><?php p($_['publicShareDisclaimerText']) ?></textarea> |
@@ -33,73 +33,139 @@ |
||
33 | 33 | href="<?php p(link_to_docs('admin-sharing')); ?>"></a> |
34 | 34 | <p id="enable"> |
35 | 35 | <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" class="checkbox" |
36 | - value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
36 | + value="1" <?php if ($_['shareAPIEnabled'] === 'yes') { |
|
37 | + print_unescaped('checked="checked"'); |
|
38 | +} |
|
39 | +?> /> |
|
37 | 40 | <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/> |
38 | 41 | </p> |
39 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
42 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
43 | + p('hidden'); |
|
44 | +} |
|
45 | +?>"> |
|
40 | 46 | <input type="checkbox" name="shareapi_allow_links" id="allowLinks" class="checkbox" |
41 | - value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
47 | + value="1" <?php if ($_['allowLinks'] === 'yes') { |
|
48 | + print_unescaped('checked="checked"'); |
|
49 | +} |
|
50 | +?> /> |
|
42 | 51 | <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/> |
43 | 52 | </p> |
44 | 53 | |
45 | - <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
54 | + <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') { |
|
55 | + p('hidden'); |
|
56 | +} |
|
57 | +?>"> |
|
46 | 58 | <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox" |
47 | - value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> /> |
|
59 | + value="1" <?php if ($_['allowPublicUpload'] == 'yes') { |
|
60 | + print_unescaped('checked="checked"'); |
|
61 | +} |
|
62 | +?> /> |
|
48 | 63 | <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/> |
49 | 64 | <input type="checkbox" name="shareapi_enable_link_password_by_default" id="enableLinkPasswordByDefault" class="checkbox" |
50 | - value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
65 | + value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') { |
|
66 | + print_unescaped('checked="checked"'); |
|
67 | +} |
|
68 | +?> /> |
|
51 | 69 | <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password'));?></label><br/> |
52 | 70 | <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox" |
53 | - value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> /> |
|
71 | + value="1" <?php if ($_['enforceLinkPassword']) { |
|
72 | + print_unescaped('checked="checked"'); |
|
73 | +} |
|
74 | +?> /> |
|
54 | 75 | <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/> |
55 | 76 | |
56 | 77 | <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox" |
57 | - value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
78 | + value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') { |
|
79 | + print_unescaped('checked="checked"'); |
|
80 | +} |
|
81 | +?> /> |
|
58 | 82 | <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/> |
59 | 83 | |
60 | 84 | </p> |
61 | - <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
85 | + <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') { |
|
86 | + p('hidden'); |
|
87 | +} |
|
88 | +?>"> |
|
62 | 89 | <?php p($l->t( 'Expire after ' )); ?> |
63 | 90 | <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>" |
64 | 91 | value='<?php p($_['shareExpireAfterNDays']) ?>' /> |
65 | 92 | <?php p($l->t( 'days' )); ?> |
66 | 93 | <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" class="checkbox" |
67 | - value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
94 | + value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') { |
|
95 | + print_unescaped('checked="checked"'); |
|
96 | +} |
|
97 | +?> /> |
|
68 | 98 | <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/> |
69 | 99 | </p> |
70 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
100 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
101 | + p('hidden'); |
|
102 | +} |
|
103 | +?>"> |
|
71 | 104 | <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox" |
72 | - value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
105 | + value="1" <?php if ($_['allowResharing'] === 'yes') { |
|
106 | + print_unescaped('checked="checked"'); |
|
107 | +} |
|
108 | +?> /> |
|
73 | 109 | <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/> |
74 | 110 | </p> |
75 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
111 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
112 | + p('hidden'); |
|
113 | +} |
|
114 | +?>"> |
|
76 | 115 | <input type="checkbox" name="shareapi_allow_group_sharing" id="allowGroupSharing" class="checkbox" |
77 | - value="1" <?php if ($_['allowGroupSharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
116 | + value="1" <?php if ($_['allowGroupSharing'] === 'yes') { |
|
117 | + print_unescaped('checked="checked"'); |
|
118 | +} |
|
119 | +?> /> |
|
78 | 120 | <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups'));?></label><br /> |
79 | 121 | </p> |
80 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
122 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
123 | + p('hidden'); |
|
124 | +} |
|
125 | +?>"> |
|
81 | 126 | <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" class="checkbox" |
82 | - value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> /> |
|
127 | + value="1" <?php if ($_['onlyShareWithGroupMembers']) { |
|
128 | + print_unescaped('checked="checked"'); |
|
129 | +} |
|
130 | +?> /> |
|
83 | 131 | <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/> |
84 | 132 | </p> |
85 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
133 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
134 | + p('hidden'); |
|
135 | +} |
|
136 | +?>"> |
|
86 | 137 | <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" class="checkbox" |
87 | - value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> /> |
|
138 | + value="1" <?php if ($_['shareExcludeGroups']) { |
|
139 | + print_unescaped('checked="checked"'); |
|
140 | +} |
|
141 | +?> /> |
|
88 | 142 | <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/> |
89 | 143 | </p> |
90 | - <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
144 | + <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') { |
|
145 | + p('hidden'); |
|
146 | +} |
|
147 | +?>"> |
|
91 | 148 | <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px" class="noJSAutoUpdate"/> |
92 | 149 | <br /> |
93 | 150 | <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em> |
94 | 151 | </p> |
95 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
152 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
153 | + p('hidden'); |
|
154 | +} |
|
155 | +?>"> |
|
96 | 156 | <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration" class="checkbox" |
97 | - <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
157 | + <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') { |
|
158 | + print_unescaped('checked="checked"'); |
|
159 | +} |
|
160 | +?> /> |
|
98 | 161 | <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered.'));?></label><br /> |
99 | 162 | </p> |
100 | 163 | <p> |
101 | 164 | <input type="checkbox" id="publicShareDisclaimer" class="checkbox noJSAutoUpdate" |
102 | - <?php if ($_['publicShareDisclaimerText'] !== null) print_unescaped('checked="checked"'); ?> /> |
|
165 | + <?php if ($_['publicShareDisclaimerText'] !== null) { |
|
166 | + print_unescaped('checked="checked"'); |
|
167 | +} |
|
168 | +?> /> |
|
103 | 169 | <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)'));?></label> |
104 | 170 | <span id="publicShareDisclaimerStatus" class="msg" style="display:none"></span> |
105 | 171 | <br/> |
@@ -33,235 +33,235 @@ |
||
33 | 33 | |
34 | 34 | class JSConfigHelper { |
35 | 35 | |
36 | - /** @var IL10N */ |
|
37 | - private $l; |
|
36 | + /** @var IL10N */ |
|
37 | + private $l; |
|
38 | 38 | |
39 | - /** @var \OC_Defaults */ |
|
40 | - private $defaults; |
|
39 | + /** @var \OC_Defaults */ |
|
40 | + private $defaults; |
|
41 | 41 | |
42 | - /** @var IAppManager */ |
|
43 | - private $appManager; |
|
42 | + /** @var IAppManager */ |
|
43 | + private $appManager; |
|
44 | 44 | |
45 | - /** @var ISession */ |
|
46 | - private $session; |
|
45 | + /** @var ISession */ |
|
46 | + private $session; |
|
47 | 47 | |
48 | - /** @var IUser|null */ |
|
49 | - private $currentUser; |
|
48 | + /** @var IUser|null */ |
|
49 | + private $currentUser; |
|
50 | 50 | |
51 | - /** @var IConfig */ |
|
52 | - private $config; |
|
51 | + /** @var IConfig */ |
|
52 | + private $config; |
|
53 | 53 | |
54 | - /** @var IGroupManager */ |
|
55 | - private $groupManager; |
|
54 | + /** @var IGroupManager */ |
|
55 | + private $groupManager; |
|
56 | 56 | |
57 | - /** @var IniGetWrapper */ |
|
58 | - private $iniWrapper; |
|
57 | + /** @var IniGetWrapper */ |
|
58 | + private $iniWrapper; |
|
59 | 59 | |
60 | - /** @var IURLGenerator */ |
|
61 | - private $urlGenerator; |
|
60 | + /** @var IURLGenerator */ |
|
61 | + private $urlGenerator; |
|
62 | 62 | |
63 | - /** |
|
64 | - * @param IL10N $l |
|
65 | - * @param \OC_Defaults $defaults |
|
66 | - * @param IAppManager $appManager |
|
67 | - * @param ISession $session |
|
68 | - * @param IUser|null $currentUser |
|
69 | - * @param IConfig $config |
|
70 | - * @param IGroupManager $groupManager |
|
71 | - * @param IniGetWrapper $iniWrapper |
|
72 | - * @param IURLGenerator $urlGenerator |
|
73 | - */ |
|
74 | - public function __construct(IL10N $l, |
|
75 | - \OC_Defaults $defaults, |
|
76 | - IAppManager $appManager, |
|
77 | - ISession $session, |
|
78 | - $currentUser, |
|
79 | - IConfig $config, |
|
80 | - IGroupManager $groupManager, |
|
81 | - IniGetWrapper $iniWrapper, |
|
82 | - IURLGenerator $urlGenerator) { |
|
83 | - $this->l = $l; |
|
84 | - $this->defaults = $defaults; |
|
85 | - $this->appManager = $appManager; |
|
86 | - $this->session = $session; |
|
87 | - $this->currentUser = $currentUser; |
|
88 | - $this->config = $config; |
|
89 | - $this->groupManager = $groupManager; |
|
90 | - $this->iniWrapper = $iniWrapper; |
|
91 | - $this->urlGenerator = $urlGenerator; |
|
92 | - } |
|
63 | + /** |
|
64 | + * @param IL10N $l |
|
65 | + * @param \OC_Defaults $defaults |
|
66 | + * @param IAppManager $appManager |
|
67 | + * @param ISession $session |
|
68 | + * @param IUser|null $currentUser |
|
69 | + * @param IConfig $config |
|
70 | + * @param IGroupManager $groupManager |
|
71 | + * @param IniGetWrapper $iniWrapper |
|
72 | + * @param IURLGenerator $urlGenerator |
|
73 | + */ |
|
74 | + public function __construct(IL10N $l, |
|
75 | + \OC_Defaults $defaults, |
|
76 | + IAppManager $appManager, |
|
77 | + ISession $session, |
|
78 | + $currentUser, |
|
79 | + IConfig $config, |
|
80 | + IGroupManager $groupManager, |
|
81 | + IniGetWrapper $iniWrapper, |
|
82 | + IURLGenerator $urlGenerator) { |
|
83 | + $this->l = $l; |
|
84 | + $this->defaults = $defaults; |
|
85 | + $this->appManager = $appManager; |
|
86 | + $this->session = $session; |
|
87 | + $this->currentUser = $currentUser; |
|
88 | + $this->config = $config; |
|
89 | + $this->groupManager = $groupManager; |
|
90 | + $this->iniWrapper = $iniWrapper; |
|
91 | + $this->urlGenerator = $urlGenerator; |
|
92 | + } |
|
93 | 93 | |
94 | - public function getConfig() { |
|
94 | + public function getConfig() { |
|
95 | 95 | |
96 | - if ($this->currentUser !== null) { |
|
97 | - $uid = $this->currentUser->getUID(); |
|
98 | - } else { |
|
99 | - $uid = null; |
|
100 | - } |
|
96 | + if ($this->currentUser !== null) { |
|
97 | + $uid = $this->currentUser->getUID(); |
|
98 | + } else { |
|
99 | + $uid = null; |
|
100 | + } |
|
101 | 101 | |
102 | - // Get the config |
|
103 | - $apps_paths = []; |
|
102 | + // Get the config |
|
103 | + $apps_paths = []; |
|
104 | 104 | |
105 | - if ($this->currentUser === null) { |
|
106 | - $apps = $this->appManager->getInstalledApps(); |
|
107 | - } else { |
|
108 | - $apps = $this->appManager->getEnabledAppsForUser($this->currentUser); |
|
109 | - } |
|
105 | + if ($this->currentUser === null) { |
|
106 | + $apps = $this->appManager->getInstalledApps(); |
|
107 | + } else { |
|
108 | + $apps = $this->appManager->getEnabledAppsForUser($this->currentUser); |
|
109 | + } |
|
110 | 110 | |
111 | - foreach($apps as $app) { |
|
112 | - $apps_paths[$app] = \OC_App::getAppWebPath($app); |
|
113 | - } |
|
111 | + foreach($apps as $app) { |
|
112 | + $apps_paths[$app] = \OC_App::getAppWebPath($app); |
|
113 | + } |
|
114 | 114 | |
115 | 115 | |
116 | - $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'); |
|
117 | - $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false; |
|
118 | - $defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes'; |
|
119 | - $defaultExpireDate = $enforceDefaultExpireDate = null; |
|
120 | - if ($defaultExpireDateEnabled) { |
|
121 | - $defaultExpireDate = (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
122 | - $enforceDefaultExpireDate = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes'; |
|
123 | - } |
|
124 | - $outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; |
|
116 | + $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'); |
|
117 | + $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false; |
|
118 | + $defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes'; |
|
119 | + $defaultExpireDate = $enforceDefaultExpireDate = null; |
|
120 | + if ($defaultExpireDateEnabled) { |
|
121 | + $defaultExpireDate = (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
122 | + $enforceDefaultExpireDate = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes'; |
|
123 | + } |
|
124 | + $outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; |
|
125 | 125 | |
126 | - $countOfDataLocation = 0; |
|
127 | - $dataLocation = str_replace(\OC::$SERVERROOT .'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
128 | - if($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) { |
|
129 | - $dataLocation = false; |
|
130 | - } |
|
126 | + $countOfDataLocation = 0; |
|
127 | + $dataLocation = str_replace(\OC::$SERVERROOT .'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
128 | + if($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) { |
|
129 | + $dataLocation = false; |
|
130 | + } |
|
131 | 131 | |
132 | - if ($this->currentUser instanceof IUser) { |
|
133 | - $lastConfirmTimestamp = $this->session->get('last-password-confirm'); |
|
134 | - if (!is_int($lastConfirmTimestamp)) { |
|
135 | - $lastConfirmTimestamp = 0; |
|
136 | - } |
|
137 | - } else { |
|
138 | - $lastConfirmTimestamp = 0; |
|
139 | - } |
|
132 | + if ($this->currentUser instanceof IUser) { |
|
133 | + $lastConfirmTimestamp = $this->session->get('last-password-confirm'); |
|
134 | + if (!is_int($lastConfirmTimestamp)) { |
|
135 | + $lastConfirmTimestamp = 0; |
|
136 | + } |
|
137 | + } else { |
|
138 | + $lastConfirmTimestamp = 0; |
|
139 | + } |
|
140 | 140 | |
141 | - $array = [ |
|
142 | - "oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false', |
|
143 | - "oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false', |
|
144 | - "oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false', |
|
145 | - "oc_webroot" => "\"".\OC::$WEBROOT."\"", |
|
146 | - "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution |
|
147 | - "datepickerFormatDate" => json_encode($this->l->l('jsdate', null)), |
|
148 | - 'nc_lastLogin' => $lastConfirmTimestamp, |
|
149 | - "dayNames" => json_encode([ |
|
150 | - (string)$this->l->t('Sunday'), |
|
151 | - (string)$this->l->t('Monday'), |
|
152 | - (string)$this->l->t('Tuesday'), |
|
153 | - (string)$this->l->t('Wednesday'), |
|
154 | - (string)$this->l->t('Thursday'), |
|
155 | - (string)$this->l->t('Friday'), |
|
156 | - (string)$this->l->t('Saturday') |
|
157 | - ]), |
|
158 | - "dayNamesShort" => json_encode([ |
|
159 | - (string)$this->l->t('Sun.'), |
|
160 | - (string)$this->l->t('Mon.'), |
|
161 | - (string)$this->l->t('Tue.'), |
|
162 | - (string)$this->l->t('Wed.'), |
|
163 | - (string)$this->l->t('Thu.'), |
|
164 | - (string)$this->l->t('Fri.'), |
|
165 | - (string)$this->l->t('Sat.') |
|
166 | - ]), |
|
167 | - "dayNamesMin" => json_encode([ |
|
168 | - (string)$this->l->t('Su'), |
|
169 | - (string)$this->l->t('Mo'), |
|
170 | - (string)$this->l->t('Tu'), |
|
171 | - (string)$this->l->t('We'), |
|
172 | - (string)$this->l->t('Th'), |
|
173 | - (string)$this->l->t('Fr'), |
|
174 | - (string)$this->l->t('Sa') |
|
175 | - ]), |
|
176 | - "monthNames" => json_encode([ |
|
177 | - (string)$this->l->t('January'), |
|
178 | - (string)$this->l->t('February'), |
|
179 | - (string)$this->l->t('March'), |
|
180 | - (string)$this->l->t('April'), |
|
181 | - (string)$this->l->t('May'), |
|
182 | - (string)$this->l->t('June'), |
|
183 | - (string)$this->l->t('July'), |
|
184 | - (string)$this->l->t('August'), |
|
185 | - (string)$this->l->t('September'), |
|
186 | - (string)$this->l->t('October'), |
|
187 | - (string)$this->l->t('November'), |
|
188 | - (string)$this->l->t('December') |
|
189 | - ]), |
|
190 | - "monthNamesShort" => json_encode([ |
|
191 | - (string)$this->l->t('Jan.'), |
|
192 | - (string)$this->l->t('Feb.'), |
|
193 | - (string)$this->l->t('Mar.'), |
|
194 | - (string)$this->l->t('Apr.'), |
|
195 | - (string)$this->l->t('May.'), |
|
196 | - (string)$this->l->t('Jun.'), |
|
197 | - (string)$this->l->t('Jul.'), |
|
198 | - (string)$this->l->t('Aug.'), |
|
199 | - (string)$this->l->t('Sep.'), |
|
200 | - (string)$this->l->t('Oct.'), |
|
201 | - (string)$this->l->t('Nov.'), |
|
202 | - (string)$this->l->t('Dec.') |
|
203 | - ]), |
|
204 | - "firstDay" => json_encode($this->l->l('firstday', null)) , |
|
205 | - "oc_config" => json_encode([ |
|
206 | - 'session_lifetime' => min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')), |
|
207 | - 'session_keepalive' => $this->config->getSystemValue('session_keepalive', true), |
|
208 | - 'version' => implode('.', \OCP\Util::getVersion()), |
|
209 | - 'versionstring' => \OC_Util::getVersionString(), |
|
210 | - 'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value |
|
211 | - 'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null), |
|
212 | - 'modRewriteWorking' => ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'), |
|
213 | - 'sharing.maxAutocompleteResults' => intval($this->config->getSystemValue('sharing.maxAutocompleteResults', 0)), |
|
214 | - 'sharing.minSearchStringLength' => intval($this->config->getSystemValue('sharing.minSearchStringLength', 0)), |
|
215 | - 'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX, |
|
216 | - ]), |
|
217 | - "oc_appconfig" => json_encode([ |
|
218 | - 'core' => [ |
|
219 | - 'defaultExpireDateEnabled' => $defaultExpireDateEnabled, |
|
220 | - 'defaultExpireDate' => $defaultExpireDate, |
|
221 | - 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, |
|
222 | - 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), |
|
223 | - 'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault, |
|
224 | - 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), |
|
225 | - 'resharingAllowed' => \OCP\Share::isResharingAllowed(), |
|
226 | - 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, |
|
227 | - 'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'), |
|
228 | - 'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing() |
|
229 | - ] |
|
230 | - ]), |
|
231 | - "oc_defaults" => json_encode([ |
|
232 | - 'entity' => $this->defaults->getEntity(), |
|
233 | - 'name' => $this->defaults->getName(), |
|
234 | - 'title' => $this->defaults->getTitle(), |
|
235 | - 'baseUrl' => $this->defaults->getBaseUrl(), |
|
236 | - 'syncClientUrl' => $this->defaults->getSyncClientUrl(), |
|
237 | - 'docBaseUrl' => $this->defaults->getDocBaseUrl(), |
|
238 | - 'docPlaceholderUrl' => $this->defaults->buildDocLinkToKey('PLACEHOLDER'), |
|
239 | - 'slogan' => $this->defaults->getSlogan(), |
|
240 | - 'logoClaim' => $this->defaults->getLogoClaim(), |
|
241 | - 'shortFooter' => $this->defaults->getShortFooter(), |
|
242 | - 'longFooter' => $this->defaults->getLongFooter(), |
|
243 | - 'folder' => \OC_Util::getTheme(), |
|
244 | - ]), |
|
245 | - ]; |
|
141 | + $array = [ |
|
142 | + "oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false', |
|
143 | + "oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false', |
|
144 | + "oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false', |
|
145 | + "oc_webroot" => "\"".\OC::$WEBROOT."\"", |
|
146 | + "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution |
|
147 | + "datepickerFormatDate" => json_encode($this->l->l('jsdate', null)), |
|
148 | + 'nc_lastLogin' => $lastConfirmTimestamp, |
|
149 | + "dayNames" => json_encode([ |
|
150 | + (string)$this->l->t('Sunday'), |
|
151 | + (string)$this->l->t('Monday'), |
|
152 | + (string)$this->l->t('Tuesday'), |
|
153 | + (string)$this->l->t('Wednesday'), |
|
154 | + (string)$this->l->t('Thursday'), |
|
155 | + (string)$this->l->t('Friday'), |
|
156 | + (string)$this->l->t('Saturday') |
|
157 | + ]), |
|
158 | + "dayNamesShort" => json_encode([ |
|
159 | + (string)$this->l->t('Sun.'), |
|
160 | + (string)$this->l->t('Mon.'), |
|
161 | + (string)$this->l->t('Tue.'), |
|
162 | + (string)$this->l->t('Wed.'), |
|
163 | + (string)$this->l->t('Thu.'), |
|
164 | + (string)$this->l->t('Fri.'), |
|
165 | + (string)$this->l->t('Sat.') |
|
166 | + ]), |
|
167 | + "dayNamesMin" => json_encode([ |
|
168 | + (string)$this->l->t('Su'), |
|
169 | + (string)$this->l->t('Mo'), |
|
170 | + (string)$this->l->t('Tu'), |
|
171 | + (string)$this->l->t('We'), |
|
172 | + (string)$this->l->t('Th'), |
|
173 | + (string)$this->l->t('Fr'), |
|
174 | + (string)$this->l->t('Sa') |
|
175 | + ]), |
|
176 | + "monthNames" => json_encode([ |
|
177 | + (string)$this->l->t('January'), |
|
178 | + (string)$this->l->t('February'), |
|
179 | + (string)$this->l->t('March'), |
|
180 | + (string)$this->l->t('April'), |
|
181 | + (string)$this->l->t('May'), |
|
182 | + (string)$this->l->t('June'), |
|
183 | + (string)$this->l->t('July'), |
|
184 | + (string)$this->l->t('August'), |
|
185 | + (string)$this->l->t('September'), |
|
186 | + (string)$this->l->t('October'), |
|
187 | + (string)$this->l->t('November'), |
|
188 | + (string)$this->l->t('December') |
|
189 | + ]), |
|
190 | + "monthNamesShort" => json_encode([ |
|
191 | + (string)$this->l->t('Jan.'), |
|
192 | + (string)$this->l->t('Feb.'), |
|
193 | + (string)$this->l->t('Mar.'), |
|
194 | + (string)$this->l->t('Apr.'), |
|
195 | + (string)$this->l->t('May.'), |
|
196 | + (string)$this->l->t('Jun.'), |
|
197 | + (string)$this->l->t('Jul.'), |
|
198 | + (string)$this->l->t('Aug.'), |
|
199 | + (string)$this->l->t('Sep.'), |
|
200 | + (string)$this->l->t('Oct.'), |
|
201 | + (string)$this->l->t('Nov.'), |
|
202 | + (string)$this->l->t('Dec.') |
|
203 | + ]), |
|
204 | + "firstDay" => json_encode($this->l->l('firstday', null)) , |
|
205 | + "oc_config" => json_encode([ |
|
206 | + 'session_lifetime' => min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')), |
|
207 | + 'session_keepalive' => $this->config->getSystemValue('session_keepalive', true), |
|
208 | + 'version' => implode('.', \OCP\Util::getVersion()), |
|
209 | + 'versionstring' => \OC_Util::getVersionString(), |
|
210 | + 'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value |
|
211 | + 'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null), |
|
212 | + 'modRewriteWorking' => ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'), |
|
213 | + 'sharing.maxAutocompleteResults' => intval($this->config->getSystemValue('sharing.maxAutocompleteResults', 0)), |
|
214 | + 'sharing.minSearchStringLength' => intval($this->config->getSystemValue('sharing.minSearchStringLength', 0)), |
|
215 | + 'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX, |
|
216 | + ]), |
|
217 | + "oc_appconfig" => json_encode([ |
|
218 | + 'core' => [ |
|
219 | + 'defaultExpireDateEnabled' => $defaultExpireDateEnabled, |
|
220 | + 'defaultExpireDate' => $defaultExpireDate, |
|
221 | + 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, |
|
222 | + 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), |
|
223 | + 'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault, |
|
224 | + 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), |
|
225 | + 'resharingAllowed' => \OCP\Share::isResharingAllowed(), |
|
226 | + 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, |
|
227 | + 'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'), |
|
228 | + 'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing() |
|
229 | + ] |
|
230 | + ]), |
|
231 | + "oc_defaults" => json_encode([ |
|
232 | + 'entity' => $this->defaults->getEntity(), |
|
233 | + 'name' => $this->defaults->getName(), |
|
234 | + 'title' => $this->defaults->getTitle(), |
|
235 | + 'baseUrl' => $this->defaults->getBaseUrl(), |
|
236 | + 'syncClientUrl' => $this->defaults->getSyncClientUrl(), |
|
237 | + 'docBaseUrl' => $this->defaults->getDocBaseUrl(), |
|
238 | + 'docPlaceholderUrl' => $this->defaults->buildDocLinkToKey('PLACEHOLDER'), |
|
239 | + 'slogan' => $this->defaults->getSlogan(), |
|
240 | + 'logoClaim' => $this->defaults->getLogoClaim(), |
|
241 | + 'shortFooter' => $this->defaults->getShortFooter(), |
|
242 | + 'longFooter' => $this->defaults->getLongFooter(), |
|
243 | + 'folder' => \OC_Util::getTheme(), |
|
244 | + ]), |
|
245 | + ]; |
|
246 | 246 | |
247 | - if ($this->currentUser !== null) { |
|
248 | - $array['oc_userconfig'] = json_encode([ |
|
249 | - 'avatar' => [ |
|
250 | - 'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
251 | - ] |
|
252 | - ]); |
|
253 | - } |
|
247 | + if ($this->currentUser !== null) { |
|
248 | + $array['oc_userconfig'] = json_encode([ |
|
249 | + 'avatar' => [ |
|
250 | + 'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
251 | + ] |
|
252 | + ]); |
|
253 | + } |
|
254 | 254 | |
255 | - // Allow hooks to modify the output values |
|
256 | - \OC_Hook::emit('\OCP\Config', 'js', array('array' => &$array)); |
|
255 | + // Allow hooks to modify the output values |
|
256 | + \OC_Hook::emit('\OCP\Config', 'js', array('array' => &$array)); |
|
257 | 257 | |
258 | - $result = ''; |
|
258 | + $result = ''; |
|
259 | 259 | |
260 | - // Echo it |
|
261 | - foreach ($array as $setting => $value) { |
|
262 | - $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; |
|
263 | - } |
|
260 | + // Echo it |
|
261 | + foreach ($array as $setting => $value) { |
|
262 | + $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; |
|
263 | + } |
|
264 | 264 | |
265 | - return $result; |
|
266 | - } |
|
265 | + return $result; |
|
266 | + } |
|
267 | 267 | } |
@@ -30,61 +30,61 @@ |
||
30 | 30 | use OCP\Util; |
31 | 31 | |
32 | 32 | class Sharing implements ISettings { |
33 | - /** @var IConfig */ |
|
34 | - private $config; |
|
33 | + /** @var IConfig */ |
|
34 | + private $config; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @param IConfig $config |
|
38 | - */ |
|
39 | - public function __construct(IConfig $config) { |
|
40 | - $this->config = $config; |
|
41 | - } |
|
36 | + /** |
|
37 | + * @param IConfig $config |
|
38 | + */ |
|
39 | + public function __construct(IConfig $config) { |
|
40 | + $this->config = $config; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * @return TemplateResponse |
|
45 | - */ |
|
46 | - public function getForm() { |
|
47 | - $excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', ''); |
|
48 | - $excludeGroupsList = !is_null(json_decode($excludedGroups)) |
|
49 | - ? implode('|', json_decode($excludedGroups, true)) : ''; |
|
43 | + /** |
|
44 | + * @return TemplateResponse |
|
45 | + */ |
|
46 | + public function getForm() { |
|
47 | + $excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', ''); |
|
48 | + $excludeGroupsList = !is_null(json_decode($excludedGroups)) |
|
49 | + ? implode('|', json_decode($excludedGroups, true)) : ''; |
|
50 | 50 | |
51 | - $parameters = [ |
|
52 | - // Built-In Sharing |
|
53 | - 'allowGroupSharing' => $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes'), |
|
54 | - 'allowLinks' => $this->config->getAppValue('core', 'shareapi_allow_links', 'yes'), |
|
55 | - 'allowPublicUpload' => $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'), |
|
56 | - 'allowResharing' => $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes'), |
|
57 | - 'allowShareDialogUserEnumeration' => $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes'), |
|
58 | - 'enforceLinkPassword' => Util::isPublicLinkPasswordRequired(), |
|
59 | - 'onlyShareWithGroupMembers' => Share::shareWithGroupMembersOnly(), |
|
60 | - 'shareAPIEnabled' => $this->config->getAppValue('core', 'shareapi_enabled', 'yes'), |
|
61 | - 'shareDefaultExpireDateSet' => $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no'), |
|
62 | - 'shareExpireAfterNDays' => $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'), |
|
63 | - 'shareEnforceExpireDate' => $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'), |
|
64 | - 'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false, |
|
65 | - 'shareExcludedGroupsList' => $excludeGroupsList, |
|
66 | - 'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null), |
|
67 | - 'enableLinkPasswordByDefault' => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'), |
|
68 | - ]; |
|
51 | + $parameters = [ |
|
52 | + // Built-In Sharing |
|
53 | + 'allowGroupSharing' => $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes'), |
|
54 | + 'allowLinks' => $this->config->getAppValue('core', 'shareapi_allow_links', 'yes'), |
|
55 | + 'allowPublicUpload' => $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'), |
|
56 | + 'allowResharing' => $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes'), |
|
57 | + 'allowShareDialogUserEnumeration' => $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes'), |
|
58 | + 'enforceLinkPassword' => Util::isPublicLinkPasswordRequired(), |
|
59 | + 'onlyShareWithGroupMembers' => Share::shareWithGroupMembersOnly(), |
|
60 | + 'shareAPIEnabled' => $this->config->getAppValue('core', 'shareapi_enabled', 'yes'), |
|
61 | + 'shareDefaultExpireDateSet' => $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no'), |
|
62 | + 'shareExpireAfterNDays' => $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'), |
|
63 | + 'shareEnforceExpireDate' => $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'), |
|
64 | + 'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false, |
|
65 | + 'shareExcludedGroupsList' => $excludeGroupsList, |
|
66 | + 'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null), |
|
67 | + 'enableLinkPasswordByDefault' => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'), |
|
68 | + ]; |
|
69 | 69 | |
70 | - return new TemplateResponse('settings', 'admin/sharing', $parameters, ''); |
|
71 | - } |
|
70 | + return new TemplateResponse('settings', 'admin/sharing', $parameters, ''); |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @return string the section ID, e.g. 'sharing' |
|
75 | - */ |
|
76 | - public function getSection() { |
|
77 | - return 'sharing'; |
|
78 | - } |
|
73 | + /** |
|
74 | + * @return string the section ID, e.g. 'sharing' |
|
75 | + */ |
|
76 | + public function getSection() { |
|
77 | + return 'sharing'; |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * @return int whether the form should be rather on the top or bottom of |
|
82 | - * the admin section. The forms are arranged in ascending order of the |
|
83 | - * priority values. It is required to return a value between 0 and 100. |
|
84 | - * |
|
85 | - * E.g.: 70 |
|
86 | - */ |
|
87 | - public function getPriority() { |
|
88 | - return 0; |
|
89 | - } |
|
80 | + /** |
|
81 | + * @return int whether the form should be rather on the top or bottom of |
|
82 | + * the admin section. The forms are arranged in ascending order of the |
|
83 | + * priority values. It is required to return a value between 0 and 100. |
|
84 | + * |
|
85 | + * E.g.: 70 |
|
86 | + */ |
|
87 | + public function getPriority() { |
|
88 | + return 0; |
|
89 | + } |
|
90 | 90 | } |