From: Andrew Dolgov Date: Tue, 20 Jan 2009 14:26:24 +0000 (+0100) Subject: simplify user deletion X-Git-Tag: 1.3.0~29 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=ec800fe1f28137d7c21471796aa44a2ca97664b8;p=tt-rss.git simplify user deletion --- diff --git a/modules/pref-users.php b/modules/pref-users.php index 52d8161a..6a768ced 100644 --- a/modules/pref-users.php +++ b/modules/pref-users.php @@ -212,21 +212,21 @@ } } else if ($subop == "remove") { - if (!WEB_DEMO_MODE && $_SESSION["access_level"] >= 10) { + if ($_SESSION["access_level"] >= 10) { $ids = split(",", db_escape_string($_GET["ids"])); foreach ($ids as $id) { - db_query($link, "BEGIN"); - db_query($link, "DELETE FROM ttrss_feeds WHERE owner_uid = '$id' AND owner_uid != " . $_SESSION["uid"]); - db_query($link, "DELETE FROM ttrss_users WHERE id = '$id' AND id != " . $_SESSION["uid"]); - db_query($link, "COMMIT"); - + if ($id != $_SESSION["uid"]) { + db_query($link, "DELETE FROM ttrss_tags WHERE owner_uid = '$id'"); + db_query($link, "DELETE FROM ttrss_feeds WHERE owner_uid = '$id'"); + db_query($link, "DELETE FROM ttrss_users WHERE id = '$id'"); + } } } } else if ($subop == "add") { - if (!WEB_DEMO_MODE && $_SESSION["access_level"] >= 10) { + if ($_SESSION["access_level"] >= 10) { $login = db_escape_string(trim($_GET["login"])); $tmp_user_pwd = make_password(8);