mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-23 15:51:27 +00:00
config: remove unused WEB_DEMO_MODE
This commit is contained in:
@@ -22,11 +22,6 @@
|
|||||||
// How long to store cached RSS objects? In seconds.
|
// How long to store cached RSS objects? In seconds.
|
||||||
// Defaults to 30 minutes
|
// Defaults to 30 minutes
|
||||||
|
|
||||||
define('WEB_DEMO_MODE', false);
|
|
||||||
// Demo mode with reduced functionality.
|
|
||||||
// Warning: this option is obsolete. Don't rely on it being
|
|
||||||
// checked in all necessary places.
|
|
||||||
|
|
||||||
define('ICONS_DIR', "icons");
|
define('ICONS_DIR', "icons");
|
||||||
define('ICONS_URL', "icons");
|
define('ICONS_URL', "icons");
|
||||||
// Local and URL path to the directory, where feed favicons are stored.
|
// Local and URL path to the directory, where feed favicons are stored.
|
||||||
@@ -72,7 +67,7 @@
|
|||||||
// greater or equal to SESSION_COOKIE_LIFETIME
|
// greater or equal to SESSION_COOKIE_LIFETIME
|
||||||
|
|
||||||
define('DAEMON_UPDATE_LOGIN_LIMIT', 0);
|
define('DAEMON_UPDATE_LOGIN_LIMIT', 0);
|
||||||
// Stop updating feeds of user who was never logged in
|
// Stop updating feeds of user who haven't logged in
|
||||||
// in specified amount of days. 0 disables.
|
// in specified amount of days. 0 disables.
|
||||||
|
|
||||||
define('CHECK_FOR_NEW_VERSION', true);
|
define('CHECK_FOR_NEW_VERSION', true);
|
||||||
|
|||||||
@@ -957,36 +957,34 @@
|
|||||||
|
|
||||||
if ($subop == "categorize") {
|
if ($subop == "categorize") {
|
||||||
|
|
||||||
if (!WEB_DEMO_MODE) {
|
|
||||||
|
|
||||||
$ids = split(",", db_escape_string($_REQUEST["ids"]));
|
$ids = split(",", db_escape_string($_REQUEST["ids"]));
|
||||||
|
|
||||||
$cat_id = db_escape_string($_REQUEST["cat_id"]);
|
$cat_id = db_escape_string($_REQUEST["cat_id"]);
|
||||||
|
|
||||||
if ($cat_id == 0) {
|
if ($cat_id == 0) {
|
||||||
$cat_id_qpart = 'NULL';
|
$cat_id_qpart = 'NULL';
|
||||||
} else {
|
} else {
|
||||||
$cat_id_qpart = "'$cat_id'";
|
$cat_id_qpart = "'$cat_id'";
|
||||||
}
|
|
||||||
|
|
||||||
db_query($link, "BEGIN");
|
|
||||||
|
|
||||||
foreach ($ids as $id) {
|
|
||||||
|
|
||||||
db_query($link, "UPDATE ttrss_feeds SET cat_id = $cat_id_qpart
|
|
||||||
WHERE id = '$id' AND parent_feed IS NULL
|
|
||||||
AND owner_uid = " . $_SESSION["uid"]);
|
|
||||||
|
|
||||||
# update linked feed categories
|
|
||||||
db_query($link, "UPDATE ttrss_feeds SET
|
|
||||||
cat_id = $cat_id_qpart WHERE parent_feed = '$id' AND
|
|
||||||
owner_uid = " . $_SESSION["uid"]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
db_query($link, "COMMIT");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db_query($link, "BEGIN");
|
||||||
|
|
||||||
|
foreach ($ids as $id) {
|
||||||
|
|
||||||
|
db_query($link, "UPDATE ttrss_feeds SET cat_id = $cat_id_qpart
|
||||||
|
WHERE id = '$id' AND parent_feed IS NULL
|
||||||
|
AND owner_uid = " . $_SESSION["uid"]);
|
||||||
|
|
||||||
|
# update linked feed categories
|
||||||
|
db_query($link, "UPDATE ttrss_feeds SET
|
||||||
|
cat_id = $cat_id_qpart WHERE parent_feed = '$id' AND
|
||||||
|
owner_uid = " . $_SESSION["uid"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
db_query($link, "COMMIT");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($subop == "editCats") {
|
if ($subop == "editCats") {
|
||||||
@@ -1033,27 +1031,25 @@
|
|||||||
|
|
||||||
if ($action == "add") {
|
if ($action == "add") {
|
||||||
|
|
||||||
if (!WEB_DEMO_MODE) {
|
|
||||||
|
|
||||||
$feed_cat = db_escape_string(trim($_REQUEST["cat"]));
|
$feed_cat = db_escape_string(trim($_REQUEST["cat"]));
|
||||||
|
|
||||||
|
$result = db_query($link,
|
||||||
|
"SELECT id FROM ttrss_feed_categories
|
||||||
|
WHERE title = '$feed_cat' AND owner_uid = ".$_SESSION["uid"]);
|
||||||
|
|
||||||
|
if (db_num_rows($result) == 0) {
|
||||||
|
|
||||||
$result = db_query($link,
|
$result = db_query($link,
|
||||||
"SELECT id FROM ttrss_feed_categories
|
"INSERT INTO ttrss_feed_categories (owner_uid,title)
|
||||||
WHERE title = '$feed_cat' AND owner_uid = ".$_SESSION["uid"]);
|
VALUES ('".$_SESSION["uid"]."', '$feed_cat')");
|
||||||
|
|
||||||
if (db_num_rows($result) == 0) {
|
} else {
|
||||||
|
|
||||||
$result = db_query($link,
|
|
||||||
"INSERT INTO ttrss_feed_categories (owner_uid,title)
|
|
||||||
VALUES ('".$_SESSION["uid"]."', '$feed_cat')");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
print_warning(T_sprintf("Category <b>$%s</b> already exists in the database.",
|
|
||||||
$feed_cat));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
print_warning(T_sprintf("Category <b>$%s</b> already exists in the database.",
|
||||||
|
$feed_cat));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "remove") {
|
if ($action == "remove") {
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
|
|
||||||
if ($subop == "editSave") {
|
if ($subop == "editSave") {
|
||||||
|
|
||||||
if (!WEB_DEMO_MODE && $_SESSION["access_level"] >= 10) {
|
if ($_SESSION["access_level"] >= 10) {
|
||||||
|
|
||||||
$login = db_escape_string(trim($_REQUEST["login"]));
|
$login = db_escape_string(trim($_REQUEST["login"]));
|
||||||
$uid = db_escape_string($_REQUEST["id"]);
|
$uid = db_escape_string($_REQUEST["id"]);
|
||||||
@@ -262,7 +262,7 @@
|
|||||||
}
|
}
|
||||||
} else if ($subop == "resetPass") {
|
} else if ($subop == "resetPass") {
|
||||||
|
|
||||||
if (!WEB_DEMO_MODE && $_SESSION["access_level"] >= 10) {
|
if ($_SESSION["access_level"] >= 10) {
|
||||||
|
|
||||||
$uid = db_escape_string($_REQUEST["id"]);
|
$uid = db_escape_string($_REQUEST["id"]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user