diff --git a/classes/pref/users.php b/classes/pref/users.php
index 89554ba65..a10404d0a 100644
--- a/classes/pref/users.php
+++ b/classes/pref/users.php
@@ -17,89 +17,16 @@ class Pref_Users extends Handler_Protected {
return array_search($method, $csrf_ignored) !== false;
}
- function userdetails() {
-
- $uid = sprintf("%d", $_REQUEST["id"]);
-
- $result = $this->dbh->query("SELECT login,
- ".SUBSTRING_FOR_DATE."(last_login,1,16) AS last_login,
- access_level,
- (SELECT COUNT(int_id) FROM ttrss_user_entries
- WHERE owner_uid = id) AS stored_articles,
- ".SUBSTRING_FOR_DATE."(created,1,16) AS created
- FROM ttrss_users
- WHERE id = '$uid'");
-
- if ($this->dbh->num_rows($result) == 0) {
- print "
".__('User not found')."
";
- return;
- }
-
- print "";
-
- $last_login = make_local_datetime(
- $this->dbh->fetch_result($result, 0, "last_login"), true);
-
- $created = make_local_datetime(
- $this->dbh->fetch_result($result, 0, "created"), true);
-
- $stored_articles = $this->dbh->fetch_result($result, 0, "stored_articles");
-
- print "".__('Registered')." | $created |
";
- print "".__('Last logged in')." | $last_login |
";
-
- $result = $this->dbh->query("SELECT COUNT(id) as num_feeds FROM ttrss_feeds
- WHERE owner_uid = '$uid'");
-
- $num_feeds = $this->dbh->fetch_result($result, 0, "num_feeds");
-
- print "".__('Subscribed feeds count')." | $num_feeds |
";
- print "".__('Stored articles')." | $stored_articles |
";
-
- print "
";
-
- print "".__('Subscribed feeds')."
";
-
- $result = $this->dbh->query("SELECT id,title,site_url FROM ttrss_feeds
- WHERE owner_uid = '$uid' ORDER BY title");
-
- print "";
-
- while ($line = $this->dbh->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"]."
";
-
- }
-
- if ($this->dbh->num_rows($result) < $num_feeds) {
- // FIXME - add link to show ALL subscribed feeds here somewhere
- print "- ...
";
- }
-
- print "
";
-
- print "
-
";
-
- return;
- }
-
function edit() {
global $access_level_names;
- $id = $this->dbh->escape_string($_REQUEST["id"]);
+ print '
+
';
+
print "
";
@@ -142,7 +69,7 @@ class Pref_Users extends Handler_Protected {
print "
";
- print "
";
print "
";
@@ -150,7 +77,7 @@ class Pref_Users extends Handler_Protected {
print "".__("Options")."
";
print "";
- print "";
print "
";
@@ -159,15 +86,92 @@ class Pref_Users extends Handler_Protected {
print "";
+ print ''; #tab
+ print "";
+
+ print '
';
+ print '';
+
print "
+ __('Save')."
";
+ __('Cancel')."";
return;
}
+ function userdetails() {
+ $id = (int) $this->dbh->escape_string($_REQUEST["id"]);
+
+ $result = $this->dbh->query("SELECT login,
+ ".SUBSTRING_FOR_DATE."(last_login,1,16) AS last_login,
+ access_level,
+ (SELECT COUNT(int_id) FROM ttrss_user_entries
+ WHERE owner_uid = id) AS stored_articles,
+ ".SUBSTRING_FOR_DATE."(created,1,16) AS created
+ FROM ttrss_users
+ WHERE id = '$id'");
+
+ if ($this->dbh->num_rows($result) == 0) {
+ print "".__('User not found')."
";
+ return;
+ }
+
+ print "";
+
+ $last_login = make_local_datetime(
+ $this->dbh->fetch_result($result, 0, "last_login"), true);
+
+ $created = make_local_datetime(
+ $this->dbh->fetch_result($result, 0, "created"), true);
+
+ $stored_articles = $this->dbh->fetch_result($result, 0, "stored_articles");
+
+ print "".__('Registered')." | $created |
";
+ print "".__('Last logged in')." | $last_login |
";
+
+ $result = $this->dbh->query("SELECT COUNT(id) as num_feeds FROM ttrss_feeds
+ WHERE owner_uid = '$id'");
+
+ $num_feeds = $this->dbh->fetch_result($result, 0, "num_feeds");
+
+ print "".__('Subscribed feeds count')." | $num_feeds |
";
+ print "".__('Stored articles')." | $stored_articles |
";
+
+ print "
";
+
+ print "".__('Subscribed feeds')."
";
+
+ $result = $this->dbh->query("SELECT id,title,site_url FROM ttrss_feeds
+ WHERE owner_uid = '$id' ORDER BY title");
+
+ print "";
+
+ while ($line = $this->dbh->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"]."
";
+
+ }
+
+ if ($this->dbh->num_rows($result) < $num_feeds) {
+ // FIXME - add link to show ALL subscribed feeds here somewhere
+ print "- ...
";
+ }
+
+ print "
";
+ }
+
function editSave() {
$login = $this->dbh->escape_string(trim($_REQUEST["login"]));
$uid = $this->dbh->escape_string($_REQUEST["id"]);
@@ -338,8 +342,6 @@ class Pref_Users extends Handler_Protected {
print "";
print "
-