diff --git a/backend.php b/backend.php
index 9078a2043..f7318ff47 100644
--- a/backend.php
+++ b/backend.php
@@ -11,9 +11,6 @@
require_once "functions.php";
require_once "magpierss/rss_fetch.inc";
-// $_SESSION["uid"] = PLACEHOLDER_UID; // FIXME: placeholder
-// $_SESSION["name"] = PLACEHOLDER_NAME;
-
$op = $_REQUEST["op"];
if ($op == "rpc" || $op == "updateAllFeeds") {
@@ -1928,14 +1925,104 @@
print "
Selection:
+ onclick=\"javascript:selectedUserDetails()\" value=\"User details\">
";
+ onclick=\"javascript:removeSelectedUsers()\" value=\"Remove\">
+ ";
+
}
}
+ if ($op == "user-details") {
+
+ if (WEB_DEMO_MODE || $_SESSION["access_level"] < 10) {
+ return;
+ }
+
+ print "
+ Tiny Tiny RSS : User Details
+
+
+ ";
+
+ $uid = sprintf("%d", $_GET["id"]);
+
+ /* FIXME this badly needs real implementation */
+
+ print "";
+
+ $result = db_query($link, "SELECT login,last_login,access_level
+ FROM ttrss_users
+ WHERE id = '$uid'");
+
+ if (db_num_rows($result) == 0) {
+ print "
User not found
";
+ return;
+ }
+
+ print "
User Details
";
+
+ print "
";
+
+ $login = db_fetch_result($result, 0, "login");
+ $last_login = db_fetch_result($result, 0, "last_login");
+ $access_level = db_fetch_result($result, 0, "access_level");
+
+ print "Username | $login |
";
+ print "Access level | $access_level |
";
+ print "Last logged in | $last_login |
";
+
+ $result = db_query($link, "SELECT COUNT(id) as num_feeds FROM ttrss_feeds
+ WHERE owner_uid = '$uid'");
+
+ $num_feeds = db_fetch_result($result, 0, "num_feeds");
+
+ print "Subscribed feeds count | $num_feeds |
";
+
+ $result = db_query($link, "SELECT
+ SUM(LENGTH(content)+LENGTH(title)+LENGTH(link)+LENGTH(guid)) AS db_size
+ FROM ttrss_entries WHERE owner_uid = '$uid'");
+
+ $db_size = db_fetch_result($result, 0, "db_size");
+
+ print "Approx. DB size | $db_size bytes |
";
+
+ print "
";
+
+ print "
Subscribed feeds
";
+
+ $result = db_query($link, "SELECT id,title,feed_url FROM ttrss_feeds
+ WHERE owner_uid = '$uid'");
+
+ print "
";
+
+ while ($line = db_fetch_assoc($result)) {
+
+ $icon_file = ICONS_URL."/".$line["id"].".ico";
+
+ if (file_exists($icon_file) && filesize($icon_file) > 0) {
+ $feed_icon = "";
+ } else {
+ $feed_icon = "";
+ }
+
+ print "- $feed_icon ".$line["title"]."
";
+ }
+
+ print "
";
+
+ print "
+ (Close this window)
";
+
+ print "
";
+
+ print "";
+
+ }
+
db_close($link);
?>
diff --git a/functions.php b/functions.php
index 9a6f70184..730b1fedd 100644
--- a/functions.php
+++ b/functions.php
@@ -106,6 +106,9 @@
if (!rename($tmpfname, $icon_file)) {
unlink($tmpfname);
}
+
+ chmod($icon_file, 0644);
+
error_reporting (E_ERROR | E_WARNING | E_PARSE);
}
diff --git a/prefs.js b/prefs.js
index c18e5100f..4333aac18 100644
--- a/prefs.js
+++ b/prefs.js
@@ -848,7 +848,27 @@ function resetSelectedUserPass() {
}
+function selectedUserDetails() {
+ var rows = getSelectedUsers();
+
+ if (rows.length == 0) {
+ notify("No users are selected.");
+ return;
+ }
+
+ if (rows.length > 1) {
+ notify("Please select one user.");
+ return;
+ }
+
+ var id = rows[0];
+
+ var w = window.open("backend.php?op=user-details&id=" + id,
+ "User Details",
+ "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no");
+
+}
function editSelectedFilter() {
var rows = getSelectedFilters();
diff --git a/tt-rss.css b/tt-rss.css
index 3fb4961b0..ca591c50e 100644
--- a/tt-rss.css
+++ b/tt-rss.css
@@ -181,7 +181,7 @@ ul.feedList li.feed {
display : block;
}
-ul.feedList img {
+ul.feedList img, img.feedIcon {
margin : 0px 3px 0px 0px;
width : 16px;
height : 16px;
@@ -411,7 +411,7 @@ a.helpLink:hover {
color : #5050aa;
}
-div.helpResponse {
+div.helpResponse, div.userDetails {
margin : 10px;
background-image : url("images/vgrad_light_rev2.png");
background-position : top left;
@@ -420,17 +420,16 @@ div.helpResponse {
border : 1px solid #f0f0f0;
}
-div.helpResponse h1 {
+div.helpResponse h1, div.userDetails h1 {
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #c0c0c0;
font-size : 16pt;
}
-div.helpResponse h2 {
+div.helpResponse h2, div.userDetails h2 {
border-width : 0px 0px 0px 0px;
font-size : 12pt;
-
}
pre {