aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2020-05-11 17:45:08 +0200
committerGravatar GitHub <noreply@github.com> 2020-05-11 17:45:08 +0200
commit2bbc579d726af1c2a68524933117c65aa4d7ea91 (patch)
tree1178b0f84ba14bb63406ff8b9d2d7d076305a24d /cli
parent1a0901bbd00f94c92ed798399a52ea777525dd1b (diff)
Add lang and mail in CLI user-info (#2958)
* Add lang and mail in CLI user-info Anf update documentation after https://github.com/FreshRSS/FreshRSS/pull/2296 * iff and language
Diffstat (limited to 'cli')
-rw-r--r--cli/README.md12
-rwxr-xr-xcli/user-info.php19
2 files changed, 19 insertions, 12 deletions
diff --git a/cli/README.md b/cli/README.md
index 1e9e72d4d..a4d70b779 100644
--- a/cli/README.md
+++ b/cli/README.md
@@ -61,12 +61,14 @@ cd /usr/share/FreshRSS
./cli/list-users.php
# Return a list of users, with the default/admin user first
-./cli/user-info.php -h --user username
+./cli/user-info.php -h --header --user username1 --user username2 ...
# -h is to use a human-readable format
-# --user can be a username, or '*' to loop on all users
-# Returns: 1) a * iff the user is admin, 2) the name of the user,
+# --header outputs some columns headers
+# --user indicates a username, and can be repeated
+# Returns: 1) a * if the user is admin, 2) the name of the user,
# 3) the date/time of last user action, 4) the size occupied,
-# and the number of: 5) categories, 6) feeds, 7) read articles, 8) unread articles, 9) favourites, and 10) tags
+# and the number of: 5) categories, 6) feeds, 7) read articles, 8) unread articles, 9) favourites, 10) tags,
+# 11) language, 12) e-mail
./cli/import-for-user.php --user username --filename /path/to/file.ext
# The extension of the file { .json, .opml, .xml, .zip } is used to detect the type of import
@@ -88,7 +90,7 @@ cd /usr/share/FreshRSS
### Note about cron
-Some commands display informations on standard error, cron will send an email with thoses informations every time the command will be executed (exited zero or non-zero).
+Some commands display information on standard error; cron will send an email with this information every time the command will be executed (exited zero or non-zero).
To avoid cron sending email on success:
diff --git a/cli/user-info.php b/cli/user-info.php
index f56bd9aa5..2123c1b99 100755
--- a/cli/user-info.php
+++ b/cli/user-info.php
@@ -2,7 +2,7 @@
<?php
require(__DIR__ . '/_cli.php');
-const DATA_FORMAT = "%-7s | %-20s | %-25s | %-15s | %-10s | %-10s | %-10s | %-10s | %-10s | %-10s\n";
+const DATA_FORMAT = "%-7s | %-20s | %-25s | %-15s | %-10s | %-10s | %-10s | %-10s | %-10s | %-10s | %-5s | %-10s\n";
$params = array(
'user:',
@@ -29,20 +29,23 @@ if (array_key_exists('header', $options)) {
DATA_FORMAT,
'default',
'user',
- 'last update',
+ 'last user activity',
'space used',
'categories',
'feeds',
'reads',
'unreads',
'favourites',
- 'tags'
+ 'tags',
+ 'lang',
+ 'email'
);
}
foreach ($users as $username) {
$username = cliInitUser($username);
+ $userConfiguration = get_user_configuration($username);
$catDAO = FreshRSS_Factory::createCategoryDao($username);
$feedDAO = FreshRSS_Factory::createFeedDao($username);
$entryDAO = FreshRSS_Factory::createEntryDao($username);
@@ -55,18 +58,20 @@ foreach ($users as $username) {
$data = array(
'default' => $username === FreshRSS_Context::$system_conf->default_user ? '*' : '',
'user' => $username,
- 'lastUpdate' => FreshRSS_UserDAO::mtime($username),
- 'spaceUsed' => $databaseDAO->size(),
+ 'last_user_activity' => FreshRSS_UserDAO::mtime($username),
+ 'database_size' => $databaseDAO->size(),
'categories' => $catDAO->count(),
'feeds' => count($feedDAO->listFeedsIds()),
'reads' => $nbEntries['read'],
'unreads' => $nbEntries['unread'],
'favourites' => $nbFavorites['all'],
'tags' => $tagDAO->count(),
+ 'lang' => $userConfiguration->language,
+ 'mail_login' => $userConfiguration->mail_login,
);
if (isset($options['h'])) { //Human format
- $data['lastUpdate'] = date('c', $data['lastUpdate']);
- $data['spaceUsed'] = format_bytes($data['spaceUsed']);
+ $data['last_user_activity'] = date('c', $data['last_user_activity']);
+ $data['database_size'] = format_bytes($data['database_size']);
}
vprintf(DATA_FORMAT, $data);
}