option GLOBAL_ENABLE_LABELS restricts labels globally

This commit is contained in:
Andrew Dolgov 2005-12-02 21:07:47 +01:00
parent c868b15476
commit cfaba6df12
3 changed files with 9 additions and 2 deletions

View File

@ -272,7 +272,7 @@
print "</li></ul>"; print "</li></ul>";
} }
if (get_pref($link, 'ENABLE_LABELS')) { if (GLOBAL_ENABLE_LABELS && get_pref($link, 'ENABLE_LABELS')) {
$result = db_query($link, "SELECT id,sql_exp,description FROM $result = db_query($link, "SELECT id,sql_exp,description FROM
ttrss_labels WHERE owner_uid = '$owner_uid' ORDER by description"); ttrss_labels WHERE owner_uid = '$owner_uid' ORDER by description");
@ -2203,6 +2203,10 @@
if ($op == "pref-labels") { if ($op == "pref-labels") {
if (!GLOBAL_ENABLE_LABELS) {
return;
}
$subop = $_GET["subop"]; $subop = $_GET["subop"];
if ($subop == "test") { if ($subop == "test") {

View File

@ -45,4 +45,7 @@
// makes UI more responsive, but eats server memory. // makes UI more responsive, but eats server memory.
// If you experience weird feedlist refresh bugs, disable this option. // If you experience weird feedlist refresh bugs, disable this option.
define('GLOBAL_ENABLE_LABELS', true);
// Labels are a security risk, so this option can globally disable them for all users.
?> ?>

View File

@ -83,7 +83,7 @@
onclick="selectTab('feedConfig')"> onclick="selectTab('feedConfig')">
<input id="filterConfigTab" class="prefsTab" type="submit" value="Content Filtering" <input id="filterConfigTab" class="prefsTab" type="submit" value="Content Filtering"
onclick="selectTab('filterConfig')"> onclick="selectTab('filterConfig')">
<? if (get_pref($link, 'ENABLE_LABELS')) { ?> <? if (GLOBAL_ENABLE_LABELS && get_pref($link, 'ENABLE_LABELS')) { ?>
<input id="labelConfigTab" class="prefsTab" type="submit" value="Label Editor" <input id="labelConfigTab" class="prefsTab" type="submit" value="Label Editor"
onclick="selectTab('labelConfig')"> onclick="selectTab('labelConfig')">
<? } ?> <? } ?>