From 2bbc579d726af1c2a68524933117c65aa4d7ea91 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 11 May 2020 17:45:08 +0200 Subject: 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 --- cli/README.md | 12 +++++++----- cli/user-info.php | 19 ++++++++++++------- 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 @@ $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); } -- cgit v1.2.3