From 86dda604313b1b599cc741c25e05957e7218e2de Mon Sep 17 00:00:00 2001 From: Purexo Date: Tue, 26 Nov 2019 19:26:07 +0100 Subject: FIX email token check if not in user-config (#2686) * FIX email token check if not in user-config * fix missing semicolon --- app/Controllers/userController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Controllers/userController.php') diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 5209edc84..39b4769fd 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -130,7 +130,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Error::error(403); } - $email_not_verified = FreshRSS_Context::$user_conf->email_validation_token !== ''; + $email_not_verified = FreshRSS_Context::$user_conf->email_validation_token != ''; $this->view->disable_aside = false; if ($email_not_verified) { $this->view->_layout('simple'); -- cgit v1.2.3 From 0de7e84380dff5222e6728aacbbb42abaac51dd9 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 3 Dec 2019 22:32:17 +0100 Subject: Upgrade user management page (#2417) Before, the use of the user management page was a little bit tedious when there was many users. One must select a user to view some metrics, to update it, or to delete it. Now, the view is clearer because it shows all users at once with their metrics. I introduced a detail page that repeats the metrics but also allow to purge the user's feeds, to update or delete the user. This is the first step to make that page more useful and user-friendly. I have in mind to add a pager for when there is a lot of users, a metric to know when was the last time the user was using the application, and a flag to know if the user has admin rights. See #2096 and #2504 for ideas and inspiration --- app/Controllers/userController.php | 66 ++++++++++++++++++++++++----- app/Models/FeedDAO.php | 33 +++++++++++++++ app/Models/FeedDAOSQLite.php | 1 - app/i18n/cz/admin.php | 5 +++ app/i18n/cz/gen.php | 1 + app/i18n/de/admin.php | 5 +++ app/i18n/de/gen.php | 1 + app/i18n/en/admin.php | 5 +++ app/i18n/en/gen.php | 1 + app/i18n/es/admin.php | 5 +++ app/i18n/es/gen.php | 1 + app/i18n/fr/admin.php | 5 +++ app/i18n/fr/gen.php | 1 + app/i18n/he/admin.php | 5 +++ app/i18n/he/gen.php | 1 + app/i18n/it/admin.php | 5 +++ app/i18n/it/gen.php | 1 + app/i18n/kr/admin.php | 5 +++ app/i18n/kr/gen.php | 1 + app/i18n/nl/admin.php | 5 +++ app/i18n/nl/gen.php | 1 + app/i18n/oc/admin.php | 5 +++ app/i18n/oc/gen.php | 1 + app/i18n/pt-br/admin.php | 5 +++ app/i18n/pt-br/gen.php | 1 + app/i18n/ru/admin.php | 5 +++ app/i18n/ru/gen.php | 1 + app/i18n/sk/admin.php | 5 +++ app/i18n/sk/gen.php | 1 + app/i18n/tr/admin.php | 5 +++ app/i18n/tr/gen.php | 1 + app/i18n/zh-cn/admin.php | 5 +++ app/i18n/zh-cn/gen.php | 1 + app/views/user/details.phtml | 51 +++++++++++++++++++++++ app/views/user/manage.phtml | 85 +++++++++++--------------------------- 35 files changed, 253 insertions(+), 73 deletions(-) create mode 100644 app/views/user/details.phtml (limited to 'app/Controllers/userController.php') diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 39b4769fd..05e7475e7 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -118,7 +118,6 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Request::bad(_t('feedback.user.updated.error', $username), array('c' => 'user', 'a' => 'manage')); } - } } @@ -194,6 +193,23 @@ class FreshRSS_user_Controller extends Minz_ActionController { } } + public function purgeAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + + if (Minz_Request::isPost()) { + $username = Minz_Request::param('username'); + + if (!FreshRSS_UserDAO::exists($username)) { + Minz_Error::error(404); + } + + $feedDAO = FreshRSS_Factory::createFeedDao($username); + $feedDAO->purge(); + } + } + /** * This action displays the user management page. */ @@ -204,18 +220,22 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_View::prependTitle(_t('admin.user.title') . ' · '); + if (Minz_Request::isPost()) { + $action = Minz_Request::param('action'); + if ('delete' === $action) { + $this->deleteAction(); + } elseif ('update' === $action) { + $this->updateAction(); + } elseif ('purge' === $action) { + $this->purgeAction(); + } + } + $this->view->show_email_field = FreshRSS_Context::$system_conf->force_email_validation; $this->view->current_user = Minz_Request::param('u'); - $this->view->nb_articles = 0; - $this->view->size_user = 0; - if ($this->view->current_user) { - // Get information about the current user. - $entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user); - $this->view->nb_articles = $entryDAO->count(); - - $databaseDAO = FreshRSS_Factory::createDatabaseDAO($this->view->current_user); - $this->view->size_user = $databaseDAO->size(); + foreach (listUsers() as $user) { + $this->view->users[$user] = $this->retrieveUserDetails($user); } } @@ -542,4 +562,30 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Request::forward($redirect_url, true); } + + public function detailsAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + + $username = Minz_Request::param('username'); + if (!FreshRSS_UserDAO::exists($username)) { + Minz_Error::error(404); + } + + $this->view->username = $username; + $this->view->details = $this->retrieveUserDetails($username); + } + + private function retrieveUserDetails($username) { + $feedDAO = FreshRSS_Factory::createFeedDao($username); + $entryDAO = FreshRSS_Factory::createEntryDao($username); + $databaseDAO = FreshRSS_Factory::createDatabaseDAO($username); + + return array( + 'feed_count' => $feedDAO->count(), + 'article_count' => $entryDAO->count(), + 'database_size' => $databaseDAO->size(), + ); + } } diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 2bff50d52..417b37773 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -421,6 +421,29 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { return $affected; } + public function purge() { + $sql = 'DELETE FROM `_entry`'; + $stm = $this->pdo->prepare($sql); + $this->pdo->beginTransaction(); + if (!($stm && $stm->execute())) { + $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); + Minz_Log::error('SQL error truncate: ' . $info[2]); + $this->pdo->rollBack(); + return false; + } + + $sql = 'UPDATE `_feed` SET `cache_nbEntries` = 0, `cache_nbUnreads` = 0'; + $stm = $this->pdo->prepare($sql); + if (!($stm && $stm->execute())) { + $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); + Minz_Log::error('SQL error truncate: ' . $info[2]); + $this->pdo->rollBack(); + return false; + } + + $this->pdo->commit(); + } + public static function daoToFeed($listDAO, $catID = null) { $list = array(); @@ -481,4 +504,14 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { $stm->execute(array(':new_value' => -3600, ':old_value' => -1)); } } + + public function count() { + $sql = 'SELECT COUNT(e.id) AS count FROM `_feed` e'; + $stm = $this->pdo->query($sql); + if ($stm == false) { + return false; + } + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + return isset($res[0]) ? $res[0] : 0; + } } diff --git a/app/Models/FeedDAOSQLite.php b/app/Models/FeedDAOSQLite.php index 0f685867a..397b69941 100644 --- a/app/Models/FeedDAOSQLite.php +++ b/app/Models/FeedDAOSQLite.php @@ -13,5 +13,4 @@ class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAO { } return false; } - } diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index a2a509560..aa7f5003a 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s článků (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Vytvořit nového uživatele', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', //TODO - Translation + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Jazyk', + 'list' => 'User list', // TODO - Translation 'number' => 'Zatím je vytvořen %d účet', 'numbers' => 'Zatím je vytvořeno %d účtů', 'password_form' => 'Heslo
(pro přihlášení webovým formulářem)', diff --git a/app/i18n/cz/gen.php b/app/i18n/cz/gen.php index de1456187..3772c90be 100644 --- a/app/i18n/cz/gen.php +++ b/app/i18n/cz/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Spravovat', 'mark_favorite' => 'Označit jako oblíbené', 'mark_read' => 'Označit jako přečtené', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Odstranit', 'see_website' => 'Navštívit WWW stránku', 'submit' => 'Odeslat', diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index f7ddac2d3..4450ce28f 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s Artikel (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Neuen Benutzer erstellen', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Lösche Benutzer', + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Sprache', + 'list' => 'User list', // TODO - Translation 'number' => 'Es wurde bis jetzt %d Account erstellt', 'numbers' => 'Es wurden bis jetzt %d Accounts erstellt', 'password_form' => 'Passwort
(für die Anmeldemethode per Webformular)', diff --git a/app/i18n/de/gen.php b/app/i18n/de/gen.php index 977b0a52f..f095b760f 100644 --- a/app/i18n/de/gen.php +++ b/app/i18n/de/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Verwalten', 'mark_favorite' => 'Als Favorit markieren', 'mark_read' => 'Als gelesen markieren', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Entfernen', 'see_website' => 'Webseite ansehen', 'submit' => 'Abschicken', diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index c5ab183e8..152c70337 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s articles (%s)', + 'article_count' => 'Articles', + 'back_to_manage' => '← Return to user list', 'create' => 'Create new user', + 'database_size' => 'Database size', 'delete_users' => 'Delete user', + 'feed_count' => 'Feeds', 'language' => 'Language', + 'list' => 'User list', 'number' => 'There is %d account created', 'numbers' => 'There are %d accounts created', 'password_form' => 'Password
(for the Web-form login method)', diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index fc1bd587a..c77950c9f 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Manage', 'mark_favorite' => 'Mark as favourite', 'mark_read' => 'Mark as read', + 'purge' => 'Purge', 'remove' => 'Remove', 'see_website' => 'See website', 'submit' => 'Submit', diff --git a/app/i18n/es/admin.php b/app/i18n/es/admin.php index 1af3bdcb2..a31702c70 100755 --- a/app/i18n/es/admin.php +++ b/app/i18n/es/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s articles (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Crear nuevo usuario', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', //TODO - Translation + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Idioma', + 'list' => 'User list', // TODO - Translation 'number' => 'Hay %d cuenta creada', 'numbers' => 'Hay %d cuentas creadas', 'password_form' => 'Contraseña
(para el método de identificación por formulario web)', diff --git a/app/i18n/es/gen.php b/app/i18n/es/gen.php index 538ddc8fe..5a1b9ae56 100755 --- a/app/i18n/es/gen.php +++ b/app/i18n/es/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Administrar', 'mark_favorite' => 'Marcar como favorita', 'mark_read' => 'Marcar como leído', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Borrar', 'see_website' => 'Ver web', 'submit' => 'Enviar', diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index 6002617fc..bdf7ba7b7 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s articles (%s)', + 'article_count' => 'Articles', + 'back_to_manage' => '← Revenir à la liste des utilisateurs', 'create' => 'Créer un nouvel utilisateur', + 'database_size' => 'Volumétrie', 'delete_users' => 'Supprimer un utilisateur', + 'feed_count' => 'Flux', 'language' => 'Langue', + 'list' => 'Liste des utilisateurs', 'number' => '%d compte a déjà été créé', 'numbers' => '%d comptes ont déjà été créés', 'password_form' => 'Mot de passe
(pour connexion par formulaire)', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index a6875dd05..551b614a3 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Gérer', 'mark_favorite' => 'Mettre en favori', 'mark_read' => 'Marquer comme lu', + 'purge' => 'Purger', 'remove' => 'Supprimer', 'see_website' => 'Voir le site', 'submit' => 'Valider', diff --git a/app/i18n/he/admin.php b/app/i18n/he/admin.php index 759b74e2a..73a040aad 100644 --- a/app/i18n/he/admin.php +++ b/app/i18n/he/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s articles (%s)', //TODO - Translation + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', 'create' => 'יצירת משתמש חדש', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', //TODO - Translation + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'שפה', + 'list' => 'User list', // TODO - Translation 'number' => 'There is %d account created', //TODO - Translation 'numbers' => 'There are %d accounts created', //TODO - Translation 'password_form' => 'סיסמה
(לשימוש בטפוס ההרשמה)', diff --git a/app/i18n/he/gen.php b/app/i18n/he/gen.php index 34e6d77de..3e882e2b2 100644 --- a/app/i18n/he/gen.php +++ b/app/i18n/he/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'ניהול', 'mark_read' => 'סימון כנקרא', 'mark_favorite' => 'סימון כמועדף', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Remove', //TODO - Translation 'see_website' => 'ראו אתר', 'submit' => 'אישור', diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php index 8bb6c7bfe..768cb8eb5 100644 --- a/app/i18n/it/admin.php +++ b/app/i18n/it/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s articoli (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Crea nuovo utente', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', //TODO - Translation + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Lingua', + 'list' => 'User list', // TODO - Translation 'number' => ' %d profilo utente creato', 'numbers' => 'Sono presenti %d profili utente', 'password_form' => 'Password
(per il login classico)', diff --git a/app/i18n/it/gen.php b/app/i18n/it/gen.php index 50d4b4e6c..c74d386df 100644 --- a/app/i18n/it/gen.php +++ b/app/i18n/it/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Gestisci', 'mark_favorite' => 'Segna come preferito', 'mark_read' => 'Segna come letto', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Rimuovi', 'see_website' => 'Vai al sito', 'submit' => 'Conferma', diff --git a/app/i18n/kr/admin.php b/app/i18n/kr/admin.php index 4a8e425d5..044c8a273 100644 --- a/app/i18n/kr/admin.php +++ b/app/i18n/kr/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s 개의 글 (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => '새 사용자 생성', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => '사용자 삭제', + 'feed_count' => 'Feeds', //TODO - Translation 'language' => '언어', + 'list' => 'User list', // TODO - Translation 'number' => '%d 개의 계정이 생성되었습니다', 'numbers' => '%d 개의 계정이 생성되었습니다', 'password_form' => '암호
(웹폼 로그인 방식 사용시)', diff --git a/app/i18n/kr/gen.php b/app/i18n/kr/gen.php index fdc95d431..b6a975606 100644 --- a/app/i18n/kr/gen.php +++ b/app/i18n/kr/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => '관리', 'mark_favorite' => '즐겨찾기에 등록', 'mark_read' => '읽음으로 표시', + 'purge' => 'Purge', // TODO - Translation 'remove' => '삭제', 'see_website' => '웹사이트 열기', 'submit' => '설정 저장', diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php index 1083c630b..41fa5ff68 100644 --- a/app/i18n/nl/admin.php +++ b/app/i18n/nl/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s artikelen (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Creëer nieuwe gebruiker', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Verwijder gebruiker', + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Taal', + 'list' => 'User list', // TODO - Translation 'number' => 'Er is %d accounts gemaakt', 'numbers' => 'Er zijn %d accounts gemaakt', 'password_form' => 'Wachtwoord
(voor de Web-formulier loginmethode)', diff --git a/app/i18n/nl/gen.php b/app/i18n/nl/gen.php index fdbb866fc..d276e72a9 100644 --- a/app/i18n/nl/gen.php +++ b/app/i18n/nl/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Beheren', 'mark_favorite' => 'Markeer als favoriet', 'mark_read' => 'Markeer als gelezen', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Verwijder', 'see_website' => 'Bekijk website', 'submit' => 'Opslaan', diff --git a/app/i18n/oc/admin.php b/app/i18n/oc/admin.php index 1fb8d5c3a..a0d49faaa 100644 --- a/app/i18n/oc/admin.php +++ b/app/i18n/oc/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s articles (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Crear un nòu utilizaire', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Suprimir un utilizaire', + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Lenga', + 'list' => 'User list', // TODO - Translation 'number' => '%d compte ja creat', 'numbers' => '%d comptes ja creats', 'password_form' => 'Senhal
(ex. : per la connexion via formulari)', diff --git a/app/i18n/oc/gen.php b/app/i18n/oc/gen.php index a5bd003c2..a2054a16a 100644 --- a/app/i18n/oc/gen.php +++ b/app/i18n/oc/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Gerir', 'mark_favorite' => 'Ajustar als favorits', 'mark_read' => 'Marcar coma legit', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Levar', 'see_website' => 'Veire lo site', 'submit' => 'Mandar', diff --git a/app/i18n/pt-br/admin.php b/app/i18n/pt-br/admin.php index cef6694c2..6a51ca2e7 100644 --- a/app/i18n/pt-br/admin.php +++ b/app/i18n/pt-br/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s artigos (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Criar novo usuário', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', //TODO - Translation + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Idioma', + 'list' => 'User list', // TODO - Translation 'number' => 'Há %d conta criada', 'numbers' => 'Há %d contas criadas', 'password_form' => 'Senha
(para o login pelo método do formulário)', diff --git a/app/i18n/pt-br/gen.php b/app/i18n/pt-br/gen.php index 0e7f367ee..c14499f00 100644 --- a/app/i18n/pt-br/gen.php +++ b/app/i18n/pt-br/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Gerenciar', 'mark_favorite' => 'Marcar como favorito', 'mark_read' => 'Marcar como lido', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Remover', 'see_website' => 'Ver o site', 'submit' => 'Enviar', diff --git a/app/i18n/ru/admin.php b/app/i18n/ru/admin.php index adf091df9..2b93a0099 100644 --- a/app/i18n/ru/admin.php +++ b/app/i18n/ru/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s статей (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Создать нового пользователя', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', //TODO - Translation + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Язык', + 'list' => 'User list', // TODO - Translation 'number' => 'На данный момент создан %d аккаунт', 'numbers' => 'На данный момент аккаунтов создано: %d', 'password_form' => 'Пароль
(для входа через Веб-форму)', diff --git a/app/i18n/ru/gen.php b/app/i18n/ru/gen.php index 5200a7005..b8647bec3 100644 --- a/app/i18n/ru/gen.php +++ b/app/i18n/ru/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Manage', //TODO - Translation 'mark_favorite' => 'Mark as favourite', //TODO - Translation 'mark_read' => 'Mark as read', //TODO - Translation + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Remove', //TODO - Translation 'see_website' => 'See website', //TODO - Translation 'submit' => 'Submit', //TODO - Translation diff --git a/app/i18n/sk/admin.php b/app/i18n/sk/admin.php index 347204f37..209641a70 100644 --- a/app/i18n/sk/admin.php +++ b/app/i18n/sk/admin.php @@ -182,9 +182,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s článkov (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => 'Vytvoriť nového používateľa', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Zmazať používateľa', + 'feed_count' => 'Feeds', //TODO - Translation 'language' => 'Jazyk', + 'list' => 'User list', // TODO - Translation 'number' => 'Je vytvorený používateľ: %d', 'numbers' => 'Je vytvorených používateľov: %d', 'password_form' => 'Heslo
(pre spôsob prihlásenia cez webový formulár)', diff --git a/app/i18n/sk/gen.php b/app/i18n/sk/gen.php index 7303ffa9f..b9c1d5155 100644 --- a/app/i18n/sk/gen.php +++ b/app/i18n/sk/gen.php @@ -15,6 +15,7 @@ return array( 'manage' => 'Spravovať', 'mark_favorite' => 'Označiť ako obľúbené', 'mark_read' => 'Označiť ako prečítané', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Odstrániť', 'see_website' => 'Zobraziť webovú stránku', 'submit' => 'Poslať', diff --git a/app/i18n/tr/admin.php b/app/i18n/tr/admin.php index 2c7d0fd6d..b399358c4 100644 --- a/app/i18n/tr/admin.php +++ b/app/i18n/tr/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s makale (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation + 'database_size' => 'Database size', // TODO - Translation 'create' => 'Yeni kullanıcı oluştur', + 'feed_count' => 'Feeds', //TODO - Translation 'delete_users' => 'Delete user', //TODO - Translation 'language' => 'Dil', + 'list' => 'User list', // TODO - Translation 'number' => 'Oluşturulmuş %d hesap var', 'numbers' => 'Oluşturulmuş %d hesap var', 'password_form' => 'Şifre
(Tarayıcı girişi için)', diff --git a/app/i18n/tr/gen.php b/app/i18n/tr/gen.php index ccc5b9ee6..8f138d482 100644 --- a/app/i18n/tr/gen.php +++ b/app/i18n/tr/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => 'Yönet', 'mark_favorite' => 'Favoriye ekle', 'mark_read' => 'Okundu olarak işaretle', + 'purge' => 'Purge', // TODO - Translation 'remove' => 'Sil', 'see_website' => 'Siteyi gör', 'submit' => 'Onayla', diff --git a/app/i18n/zh-cn/admin.php b/app/i18n/zh-cn/admin.php index cdc8449a3..a663d31fe 100644 --- a/app/i18n/zh-cn/admin.php +++ b/app/i18n/zh-cn/admin.php @@ -183,9 +183,14 @@ return array( ), 'user' => array( 'articles_and_size' => '%s 篇文章 (%s)', + 'article_count' => 'Articles', // TODO - Translation + 'back_to_manage' => '← Return to user list', // TODO - Translation 'create' => '创建新用户', + 'database_size' => 'Database size', // TODO - Translation 'delete_users' => '删除用户', + 'feed_count' => 'Feeds', //TODO - Translation 'language' => '语言', + 'list' => 'User list', // TODO - Translation 'number' => '已有 %d 个用户', 'numbers' => '已有 %d 个用户', 'password_form' => '密码
(用于 Web-form 登录方式)', diff --git a/app/i18n/zh-cn/gen.php b/app/i18n/zh-cn/gen.php index 31817260e..5009e9183 100644 --- a/app/i18n/zh-cn/gen.php +++ b/app/i18n/zh-cn/gen.php @@ -16,6 +16,7 @@ return array( 'manage' => '管理', 'mark_favorite' => '加入收藏', 'mark_read' => '设为已读', + 'purge' => 'Purge', // TODO - Translation 'remove' => '删除', 'see_website' => '查看网站', 'submit' => '提交', diff --git a/app/views/user/details.phtml b/app/views/user/details.phtml new file mode 100644 index 000000000..2e37be872 --- /dev/null +++ b/app/views/user/details.phtml @@ -0,0 +1,51 @@ +partial('aside_configure'); ?> + +
+ + + username; ?> +
+ + +
+ +
+ details['feed_count']) ?> +
+
+ +
+ +
+ details['article_count']) ?> +
+
+ +
+ +
+ details['database_size']) ?> +
+
+ +
+ +
+
+ /> + +
+ +
+
+ +
+ +
+ + + +
+
+ +
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index 93d1008b5..e5d5717fa 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -57,66 +57,27 @@
-
- - - -
- -
- -
-
- -
- -
-
- /> - -
- - -
-
- -
-
- - -
-
-
- -
- - - -
- -
- - -

nb_articles), - format_bytes($this->size_user)); ?>

-
-
- -
-
- -
-
-
+ + + + + + + + + + + + + users as $username => $values) : ?> + + + + + + + + + +
 
Details
-- cgit v1.2.3 From d0f1f9f141a58e090d210c221a7c1745378b96a3 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 3 Dec 2019 23:11:06 +0100 Subject: Separate the update API password endpoint (#2675) * Extract hashPassword method from userController * Extract and refactor fever key-related methods * Move update of API password to dedicated action * Simplify the controller by refactoring feverUtil * Add locales --- app/Controllers/apiController.php | 47 +++++++++++++++++++ app/Controllers/javascriptController.php | 2 +- app/Controllers/userController.php | 61 +++--------------------- app/Utils/feverUtil.php | 80 ++++++++++++++++++++++++++++++++ app/Utils/passwordUtil.php | 27 +++++++++++ app/i18n/cz/conf.php | 1 + app/i18n/cz/feedback.php | 6 +++ app/i18n/de/conf.php | 1 + app/i18n/de/feedback.php | 6 +++ app/i18n/en/conf.php | 1 + app/i18n/en/feedback.php | 6 +++ app/i18n/es/conf.php | 1 + app/i18n/es/feedback.php | 6 +++ app/i18n/fr/conf.php | 1 + app/i18n/fr/feedback.php | 6 +++ app/i18n/he/conf.php | 1 + app/i18n/he/feedback.php | 6 +++ app/i18n/it/conf.php | 1 + app/i18n/it/feedback.php | 6 +++ app/i18n/kr/conf.php | 1 + app/i18n/kr/feedback.php | 6 +++ app/i18n/nl/conf.php | 1 + app/i18n/nl/feedback.php | 6 +++ app/i18n/oc/conf.php | 1 + app/i18n/oc/feedback.php | 6 +++ app/i18n/pt-br/conf.php | 1 + app/i18n/pt-br/feedback.php | 6 +++ app/i18n/ru/conf.php | 1 + app/i18n/ru/feedback.php | 6 +++ app/i18n/sk/conf.php | 1 + app/i18n/sk/feedback.php | 6 +++ app/i18n/tr/conf.php | 1 + app/i18n/tr/feedback.php | 6 +++ app/i18n/zh-cn/conf.php | 1 + app/i18n/zh-cn/feedback.php | 6 +++ app/install.php | 1 - app/views/user/profile.phtml | 37 +++++++++------ cli/_update-or-create-user.php | 3 +- cli/create-user.php | 1 - cli/update-user.php | 1 - 40 files changed, 292 insertions(+), 73 deletions(-) create mode 100644 app/Controllers/apiController.php create mode 100644 app/Utils/feverUtil.php create mode 100644 app/Utils/passwordUtil.php (limited to 'app/Controllers/userController.php') diff --git a/app/Controllers/apiController.php b/app/Controllers/apiController.php new file mode 100644 index 000000000..d096ba83f --- /dev/null +++ b/app/Controllers/apiController.php @@ -0,0 +1,47 @@ + 'user', 'a' => 'profile'); + + if (!Minz_Request::isPost()) { + Minz_Request::forward($return_url, true); + } + + $apiPasswordPlain = Minz_Request::param('apiPasswordPlain', '', true); + if ($apiPasswordPlain == '') { + Minz_Request::forward($return_url, true); + } + + $username = Minz_Session::param('currentUser'); + $userConfig = FreshRSS_Context::$user_conf; + + $apiPasswordHash = FreshRSS_password_Util::hash($apiPasswordPlain); + $userConfig->apiPasswordHash = $apiPasswordHash; + + $feverKey = FreshRSS_fever_Util::updateKey($username, $apiPasswordPlain); + if (!$feverKey) { + Minz_Request::bad(_t('feedback.api.password.failed'), $return_url); + } + + $userConfig->feverKey = $feverKey; + if ($userConfig->save()) { + Minz_Request::good(_t('feedback.api.password.updated'), $return_url); + } else { + Minz_Request::bad(_t('feedback.api.password.failed'), $return_url); + } + } +} diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php index c84e5483b..b22e2c127 100755 --- a/app/Controllers/javascriptController.php +++ b/app/Controllers/javascriptController.php @@ -47,7 +47,7 @@ class FreshRSS_javascript_Controller extends Minz_ActionController { Minz_Log::notice('Nonce failure due to invalid username!'); } //Failure: Return random data. - $this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_user_Controller::BCRYPT_COST); + $this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_password_Util::BCRYPT_COST); $alphabet = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; for ($i = 22; $i > 0; $i--) { $this->view->salt1 .= $alphabet[mt_rand(0, 63)]; diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 05e7475e7..3a48e65e3 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -4,17 +4,6 @@ * Controller to handle user actions. */ class FreshRSS_user_Controller extends Minz_ActionController { - // Will also have to be computed client side on mobile devices, - // so do not use a too high cost - const BCRYPT_COST = 9; - - public static function hashPassword($passwordPlain) { - $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); - $passwordPlain = ''; - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - return $passwordHash == '' ? '' : $passwordHash; - } - /** * The username is also used as folder name, file name, and part of SQL table name. * '_' is a reserved internal username. @@ -25,15 +14,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { return preg_match('/^' . self::USERNAME_PATTERN . '$/', $username) === 1; } - public static function deleteFeverKey($username) { - $userConfig = get_user_configuration($username); - if ($userConfig !== null && ctype_xdigit($userConfig->feverKey)) { - return @unlink(DATA_PATH . '/fever/.key-' . sha1(FreshRSS_Context::$system_conf->salt) . '-' . $userConfig->feverKey . '.txt'); - } - return false; - } - - public static function updateUser($user, $email, $passwordPlain, $apiPasswordPlain, $userConfigUpdated = array()) { + public static function updateUser($user, $email, $passwordPlain, $userConfigUpdated = array()) { $userConfig = get_user_configuration($user); if ($userConfig === null) { return false; @@ -51,33 +32,10 @@ class FreshRSS_user_Controller extends Minz_ActionController { } if ($passwordPlain != '') { - $passwordHash = self::hashPassword($passwordPlain); + $passwordHash = FreshRSS_password_Util::hash($passwordPlain); $userConfig->passwordHash = $passwordHash; } - if ($apiPasswordPlain != '') { - $apiPasswordHash = self::hashPassword($apiPasswordPlain); - $userConfig->apiPasswordHash = $apiPasswordHash; - - $feverPath = DATA_PATH . '/fever/'; - - if (!file_exists($feverPath)) { - @mkdir($feverPath, 0770, true); - } - - if (!is_writable($feverPath)) { - Minz_Log::error("Could not save Fever API credentials. The directory does not have write access."); - } else { - self::deleteFeverKey($user); - $userConfig->feverKey = strtolower(md5("{$user}:{$apiPasswordPlain}")); - $ok = file_put_contents($feverPath . '.key-' . sha1(FreshRSS_Context::$system_conf->salt) . '-' . $userConfig->feverKey . '.txt', $user) !== false; - - if (!$ok) { - Minz_Log::warning('Could not save Fever API credentials. Unknown error.', ADMIN_LOG); - } - } - } - if (is_array($userConfigUpdated)) { foreach ($userConfigUpdated as $configName => $configValue) { if ($configValue !== null) { @@ -100,10 +58,8 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Request::_param('newPasswordPlain'); //Discard plain-text password ASAP $_POST['newPasswordPlain'] = ''; - $apiPasswordPlain = Minz_Request::param('apiPasswordPlain', '', true); - $username = Minz_Request::param('username'); - $ok = self::updateUser($username, null, $passwordPlain, $apiPasswordPlain, array( + $ok = self::updateUser($username, null, $passwordPlain, array( 'token' => Minz_Request::param('token', null), )); @@ -150,8 +106,6 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Request::_param('newPasswordPlain'); //Discard plain-text password ASAP $_POST['newPasswordPlain'] = ''; - $apiPasswordPlain = Minz_Request::param('apiPasswordPlain', '', true); - if ($system_conf->force_email_validation && empty($email)) { Minz_Request::bad( _t('user.email.feedback.required'), @@ -170,7 +124,6 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Session::param('currentUser'), $email, $passwordPlain, - $apiPasswordPlain, array( 'token' => Minz_Request::param('token', null), ) @@ -239,7 +192,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { } } - public static function createUser($new_user_name, $email, $passwordPlain, $apiPasswordPlain = '', $userConfigOverride = [], $insertDefaultFeeds = true) { + public static function createUser($new_user_name, $email, $passwordPlain, $userConfigOverride = [], $insertDefaultFeeds = true) { $userConfig = []; $customUserConfigPath = join_path(DATA_PATH, 'config-user.custom.php'); @@ -291,7 +244,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { } } - $ok &= self::updateUser($new_user_name, $email, $passwordPlain, $apiPasswordPlain); + $ok &= self::updateUser($new_user_name, $email, $passwordPlain); } return $ok; } @@ -346,7 +299,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { ); } - $ok = self::createUser($new_user_name, $email, $passwordPlain, '', array('language' => $new_user_language)); + $ok = self::createUser($new_user_name, $email, $passwordPlain, array('language' => $new_user_language)); Minz_Request::_param('new_user_passwordPlain'); //Discard plain-text password ASAP $_POST['new_user_passwordPlain'] = ''; invalidateHttpCache(); @@ -386,7 +339,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { $user_data = join_path(DATA_PATH, 'users', $username); $ok &= is_dir($user_data); if ($ok) { - self::deleteFeverKey($username); + FreshRSS_fever_Util::deleteKey($username); $oldUserDAO = FreshRSS_Factory::createUserDao($username); $ok &= $oldUserDAO->deleteUser(); $ok &= recursive_unlink($user_data); diff --git a/app/Utils/feverUtil.php b/app/Utils/feverUtil.php new file mode 100644 index 000000000..83921943c --- /dev/null +++ b/app/Utils/feverUtil.php @@ -0,0 +1,80 @@ +salt); + return self::FEVER_PATH . '/.key-' . $salt . '-' . $feverKey . '.txt'; + } + + /** + * Update the fever key of a user. + * + * @param string + * @param string + * @return string the Fever key, or false if the update failed + */ + public static function updateKey($username, $passwordPlain) { + $ok = self::checkFeverPath(); + if (!$ok) { + return false; + } + + self::deleteKey($username); + + $feverKey = strtolower(md5("{$username}:{$passwordPlain}")); + $feverKeyPath = self::getKeyPath($feverKey); + $res = file_put_contents($feverKeyPath, $username); + if ($res !== false) { + return $feverKey; + } else { + Minz_Log::warning('Could not save Fever API credentials. Unknown error.', ADMIN_LOG); + return false; + } + } + + /** + * Delete the Fever key of a user. + * + * @param string + * @return boolean true if the deletion succeeded, else false. + */ + public static function deleteKey($username) { + $userConfig = get_user_configuration($username); + if ($userConfig === null) { + return false; + } + + $feverKey = $userConfig->feverKey; + if (!ctype_xdigit($feverKey)) { + return false; + } + + $feverKeyPath = self::getKeyPath($feverKey); + return @unlink($feverKeyPath); + } +} diff --git a/app/Utils/passwordUtil.php b/app/Utils/passwordUtil.php new file mode 100644 index 000000000..fd71d4b72 --- /dev/null +++ b/app/Utils/passwordUtil.php @@ -0,0 +1,27 @@ + self::BCRYPT_COST) + ); + $passwordPlain = ''; + + // Compatibility with bcrypt.js + $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); + + return $passwordHash == '' ? '' : $passwordHash; + } +} diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php index 056e895a7..f066ac9a4 100644 --- a/app/i18n/cz/conf.php +++ b/app/i18n/cz/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Správa profilu', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Smazání účtu', 'warn' => 'Váš účet bude smazán spolu se všemi souvisejícími daty', diff --git a/app/i18n/cz/feedback.php b/app/i18n/cz/feedback.php index 3d0dcbc96..ad3d38cf0 100644 --- a/app/i18n/cz/feedback.php +++ b/app/i18n/cz/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Nemáte oprávnění přistupovat na tuto stránku', 'not_found' => 'Tato stránka neexistuje', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Nastal problém s konfigurací přihlašovacího systému. Zkuste to prosím později.', diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index b08694eee..2d9b91260 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Profil-Verwaltung', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Accountlöschung', 'warn' => 'Dein Account und alle damit bezogenen Daten werden gelöscht.', diff --git a/app/i18n/de/feedback.php b/app/i18n/de/feedback.php index 269069162..446aa2a04 100644 --- a/app/i18n/de/feedback.php +++ b/app/i18n/de/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Sie haben nicht die Berechtigung, diese Seite aufzurufen', 'not_found' => 'Sie suchen nach einer Seite, die nicht existiert', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Während der Konfiguration des Authentifikationssystems trat ein Fehler auf. Bitte versuchen Sie es später erneut.', diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index 2d4e06550..f01de649a 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Profile management', + 'api' => 'API management', 'delete' => array( '_' => 'Account deletion', 'warn' => 'Your account and all related data will be deleted.', diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php index 2322a62cc..89bbd4154 100644 --- a/app/i18n/en/feedback.php +++ b/app/i18n/en/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'You don’t have permission to access this page', 'not_found' => 'You are looking for a page which doesn’t exist', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', + 'updated' => 'Your password has been modified', + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'A problem occured during authentication system configuration. Please retry later.', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index 7a93a87de..fcbe9b984 100755 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Administración de perfiles', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Borrar cuenta', 'warn' => 'Tu cuenta y todos los datos asociados serán eliminados.', diff --git a/app/i18n/es/feedback.php b/app/i18n/es/feedback.php index d70ccfe8a..5a7358b0d 100755 --- a/app/i18n/es/feedback.php +++ b/app/i18n/es/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'No dispones de permiso para acceder a esta página', 'not_found' => 'La página que buscas no existe', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Hubo un problema durante la configuración del sistema de idenfificación. Por favor, inténtalo más tarde.', diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 020c94085..b51d123f1 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Gestion du profil', + 'api' => 'Gestion de l’API', 'delete' => array( '_' => 'Suppression du compte', 'warn' => 'Le compte et toutes les données associées vont être supprimées.', diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php index 328113c25..f4b3ba245 100644 --- a/app/i18n/fr/feedback.php +++ b/app/i18n/fr/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Vous n’avez pas le droit d’accéder à cette page !', 'not_found' => 'La page que vous cherchez n’existe pas !', ), + 'api' => array( + 'password' => array( + 'failed' => 'Votre mot de passe n’a pas pu être mis à jour', + 'updated' => 'Votre mot de passe a été mis à jour', + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Un problème est survenu lors de la configuration de votre système d’authentification. Veuillez réessayer plus tard.', diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index b987f21f4..d83d688d5 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Profile management', //TODO - Translation + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Account deletion', //TODO - Translation 'warn' => 'Your account and all related data will be deleted.', //TODO - Translation diff --git a/app/i18n/he/feedback.php b/app/i18n/he/feedback.php index f972173cb..026e93450 100644 --- a/app/i18n/he/feedback.php +++ b/app/i18n/he/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'אין לך הרשאות לצפות בדף זה', 'not_found' => 'הדף הזה לא נמצא', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'אירעה שגיאה במהלך הגדרת מערכת האימיות. אנא נסו שוב מאוחר יותר.', diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 4bdaad33d..6dd390ebd 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Gestione profili', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Cancellazione account', 'warn' => 'Il tuo account e tutti i dati associati saranno cancellati.', diff --git a/app/i18n/it/feedback.php b/app/i18n/it/feedback.php index ca7879904..f137de9e8 100644 --- a/app/i18n/it/feedback.php +++ b/app/i18n/it/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Non hai i permessi per accedere a questa pagina', 'not_found' => 'Pagina non disponibile', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Si è verificato un problema alla configurazione del sistema di autenticazione. Per favore riprova più tardi.', diff --git a/app/i18n/kr/conf.php b/app/i18n/kr/conf.php index 1e77d0098..219feab49 100644 --- a/app/i18n/kr/conf.php +++ b/app/i18n/kr/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => '프로필 관리', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => '계정 삭제', 'warn' => '당신의 계정과 관련된 모든 데이터가 삭제됩니다.', diff --git a/app/i18n/kr/feedback.php b/app/i18n/kr/feedback.php index 0e31536f8..1ea58388b 100644 --- a/app/i18n/kr/feedback.php +++ b/app/i18n/kr/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => '이 페이지에 접근할 수 있는 권한이 없습니다', 'not_found' => '이 페이지는 존재하지 않습니다', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => '인증 시스템을 설정하는 동안 문제가 발생했습니다. 잠시 후 다시 시도하세요.', diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index ca6627cbb..fdd82f7c2 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Profiel beheer', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Account verwijderen', 'warn' => 'Uw account en alle gerelateerde gegvens worden verwijderd.', diff --git a/app/i18n/nl/feedback.php b/app/i18n/nl/feedback.php index 97e1a71b8..dafbb9d68 100644 --- a/app/i18n/nl/feedback.php +++ b/app/i18n/nl/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'U hebt geen rechten om deze pagina te bekijken.', 'not_found' => 'Deze pagina bestaat niet', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Er is een probleem opgetreden tijdens de controle van de systeemconfiguratie. Probeer het later nog eens.', diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index e123c03c5..98758be28 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -51,6 +51,7 @@ return array( ), 'profile' => array( '_' => 'Gestion del perfil', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Supression del compte', 'warn' => 'Lo compte e totas las donadas ligadas seràn suprimits.', diff --git a/app/i18n/oc/feedback.php b/app/i18n/oc/feedback.php index 7f7d05dbd..a37ad2ae2 100644 --- a/app/i18n/oc/feedback.php +++ b/app/i18n/oc/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Avètz pas l’autorizacion d’accedir a aquesta pagina', 'not_found' => 'La pagina que cercatz existís pas', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Un problèma es aparegut pendent la configuracion del sistèma d’autentificacion. Tonatz ensajar ai tard.', diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php index 5e43cc373..d2a60aba8 100644 --- a/app/i18n/pt-br/conf.php +++ b/app/i18n/pt-br/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Gerenciamento de perfil', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Remover conta', 'warn' => 'Sua conta e todos os dados relacionados serão removidos.', diff --git a/app/i18n/pt-br/feedback.php b/app/i18n/pt-br/feedback.php index 816bbf43b..d15080964 100644 --- a/app/i18n/pt-br/feedback.php +++ b/app/i18n/pt-br/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Você não tem permissão para acessar esta página', 'not_found' => 'VocÊ está buscando por uma página que não existe', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Um problema ocorreu durante o sistema de configuração para autenticação. Por favor tente mais tarde.', diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 7a80587f8..96a307976 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Profile management', //TODO - Translation + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Account deletion', //TODO - Translation 'warn' => 'Your account and all the related data will be deleted.', //TODO - Translation diff --git a/app/i18n/ru/feedback.php b/app/i18n/ru/feedback.php index 7b859fcdd..449d01ee4 100644 --- a/app/i18n/ru/feedback.php +++ b/app/i18n/ru/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'You don’t have permission to access this page', //TODO - Translation 'not_found' => 'You are looking for a page which doesn’t exist', //TODO - Translation ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'A problem occured during authentication system configuration. Please retry later.', //TODO - Translation diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php index 2e2289b79..be6fdce4f 100644 --- a/app/i18n/sk/conf.php +++ b/app/i18n/sk/conf.php @@ -42,6 +42,7 @@ return array( ), 'profile' => array( '_' => 'Správca profilu', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Vymazanie účtu', 'warn' => 'Váš účet a všetky údaje v ňom budú vymazané.', diff --git a/app/i18n/sk/feedback.php b/app/i18n/sk/feedback.php index 9aee79068..5bccd8259 100644 --- a/app/i18n/sk/feedback.php +++ b/app/i18n/sk/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Na prístup k tejto stránke nemáte oprávnenie', 'not_found' => 'Hľadáte stránku, ktorá neexistuje', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Nastavl problém pri nastavovaní prihlasovacieho systému. Prosím, skúste to znova neskôr.', diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index c8ea78efa..25eaedc55 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => 'Profil yönetimi', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => 'Hesap silme', 'warn' => 'Hesabınız ve tüm verileriniz silinecek.', diff --git a/app/i18n/tr/feedback.php b/app/i18n/tr/feedback.php index fc1e59bbc..73489c723 100644 --- a/app/i18n/tr/feedback.php +++ b/app/i18n/tr/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => 'Bu sayfaya erişim yetkiniz yok', 'not_found' => 'Varolmayan bir sayfa arıyorsunuz', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => 'Sistem yapılandırma kimlik doğrulaması sırasında hata oldu. Lütfen daha sonra tekrar deneyin.', diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index a7404bc58..485da16f2 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -50,6 +50,7 @@ return array( ), 'profile' => array( '_' => '帐户管理', + 'api' => 'API management', // TODO - Translation 'delete' => array( '_' => '账户删除', 'warn' => '你的帐户和所有相关数据都将被删除。', diff --git a/app/i18n/zh-cn/feedback.php b/app/i18n/zh-cn/feedback.php index e8ee969b0..9dbc45cf5 100644 --- a/app/i18n/zh-cn/feedback.php +++ b/app/i18n/zh-cn/feedback.php @@ -8,6 +8,12 @@ return array( 'denied' => '你无权访问此页面', 'not_found' => '你寻找的页面不存在', ), + 'api' => array( + 'password' => array( + 'failed' => 'Your password cannot be modified', // TODO - Translation + 'updated' => 'Your password has been modified', // TODO - Translation + ), + ), 'auth' => array( 'form' => array( 'not_set' => '配置认证方式时出错。请稍后重试。', diff --git a/app/install.php b/app/install.php index 557ae9eab..3737e2ccc 100644 --- a/app/install.php +++ b/app/install.php @@ -221,7 +221,6 @@ function saveStep3() { $_SESSION['default_user'], '', //TODO: Add e-mail $password_plain, - '', [ 'language' => $_SESSION['language'], ] diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml index b8bb5cee9..5357c2bfd 100644 --- a/app/views/user/profile.phtml +++ b/app/views/user/profile.phtml @@ -48,19 +48,6 @@ - api_enabled) { ?> -
- -
-
- /> - -
- -
-
- -
@@ -82,6 +69,30 @@
+ api_enabled) { ?> +
+ + + +
+ +
+
+ /> + +
+ +
+
+ +
+
+ +
+
+
+ +
diff --git a/cli/_update-or-create-user.php b/cli/_update-or-create-user.php index 43b86a4a9..3217a07ea 100644 --- a/cli/_update-or-create-user.php +++ b/cli/_update-or-create-user.php @@ -4,7 +4,6 @@ require(__DIR__ . '/_cli.php'); $params = array( 'user:', 'password:', - 'api_password:', 'language:', 'email:', 'token:', @@ -24,7 +23,7 @@ $options = getopt('', $params); if (!validateOptions($argv, $params) || empty($options['user'])) { fail('Usage: ' . basename($_SERVER['SCRIPT_FILENAME']) . - " --user username ( --password 'password' --api_password 'api_password'" . + " --user username ( --password 'password'" . " --language en --email user@example.net --token 'longRandomString'" . ($isUpdate ? '' : '--no_default_feeds') . " --purge_after_months 3 --feed_min_articles_default 50 --feed_ttl_default 3600" . diff --git a/cli/create-user.php b/cli/create-user.php index 7e0a031d9..9e978ee3c 100755 --- a/cli/create-user.php +++ b/cli/create-user.php @@ -20,7 +20,6 @@ $ok = FreshRSS_user_Controller::createUser( $username, empty($options['mail_login']) ? '' : $options['mail_login'], empty($options['password']) ? '' : $options['password'], - empty($options['api_password']) ? '' : $options['api_password'], $values, !isset($options['no_default_feeds']) ); diff --git a/cli/update-user.php b/cli/update-user.php index 8067dadd3..02da16d5a 100755 --- a/cli/update-user.php +++ b/cli/update-user.php @@ -11,7 +11,6 @@ $ok = FreshRSS_user_Controller::updateUser( $username, empty($options['mail_login']) ? null : $options['mail_login'], empty($options['password']) ? '' : $options['password'], - empty($options['api_password']) ? '' : $options['api_password'], $values); if (!$ok) { -- cgit v1.2.3 From d13a8a0eb1c37c6b241bcea3d0123e8fa6bd8f5a Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 7 Dec 2019 11:55:12 +0100 Subject: Add user language display When managing users, I've added the language they selected to be able to communicate with them with the selected language (if I know it). It could be useful when managing a community or a paid service. --- app/Controllers/userController.php | 4 ++++ app/i18n/cz/admin.php | 1 + app/i18n/de/admin.php | 1 + app/i18n/en/admin.php | 1 + app/i18n/es/admin.php | 1 + app/i18n/fr/admin.php | 3 ++- app/i18n/he/admin.php | 1 + app/i18n/it/admin.php | 1 + app/i18n/kr/admin.php | 1 + app/i18n/nl/admin.php | 1 + app/i18n/oc/admin.php | 1 + app/i18n/pt-br/admin.php | 1 + app/i18n/ru/admin.php | 1 + app/i18n/sk/admin.php | 1 + app/i18n/tr/admin.php | 1 + app/i18n/zh-cn/admin.php | 1 + app/views/user/details.phtml | 14 ++++++++++++++ app/views/user/manage.phtml | 4 ++++ cli/i18n/ignore/fr.php | 1 + 19 files changed, 39 insertions(+), 1 deletion(-) (limited to 'app/Controllers/userController.php') diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 3a48e65e3..7d3c010c4 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -535,10 +535,14 @@ class FreshRSS_user_Controller extends Minz_ActionController { $entryDAO = FreshRSS_Factory::createEntryDao($username); $databaseDAO = FreshRSS_Factory::createDatabaseDAO($username); + $userConfiguration = get_user_configuration($username); + return array( 'feed_count' => $feedDAO->count(), 'article_count' => $entryDAO->count(), 'database_size' => $databaseDAO->size(), + 'language' => $userConfiguration->language, + 'mail_login' => $userConfiguration->mail_login, ); } } diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index 047fb2d9a..18f7520a7 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Vytvořit nového uživatele', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', // TODO - Translation + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Jazyk', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index 729f6a761..443a9b380 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Neuen Benutzer erstellen', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Lösche Benutzer', + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Sprache', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index 812e0293a..497a7051c 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Create new user', 'database_size' => 'Database size', 'delete_users' => 'Delete user', + 'email' => 'Email address', 'feed_count' => 'Feeds', 'language' => 'Language', 'list' => 'User list', diff --git a/app/i18n/es/admin.php b/app/i18n/es/admin.php index 5a9a3ab81..a8dcac86e 100755 --- a/app/i18n/es/admin.php +++ b/app/i18n/es/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Crear nuevo usuario', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', // TODO - Translation + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Idioma', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index 7bea14f35..2cf6adc89 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -183,11 +183,12 @@ return array( ), 'user' => array( 'articles_and_size' => '%s articles (%s)', - 'article_count' => 'Articles', // TODO - Translation + 'article_count' => 'Articles', 'back_to_manage' => '← Revenir à la liste des utilisateurs', 'create' => 'Créer un nouvel utilisateur', 'database_size' => 'Volumétrie', 'delete_users' => 'Supprimer un utilisateur', + 'email' => 'Adresse email', 'feed_count' => 'Flux', 'language' => 'Langue', 'list' => 'Liste des utilisateurs', diff --git a/app/i18n/he/admin.php b/app/i18n/he/admin.php index 4e83a178f..55ee9fc5d 100644 --- a/app/i18n/he/admin.php +++ b/app/i18n/he/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'יצירת משתמש חדש', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', // TODO - Translation + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'שפה', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php index 6b1cf1198..7a0f2e47e 100644 --- a/app/i18n/it/admin.php +++ b/app/i18n/it/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Crea nuovo utente', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', // TODO - Translation + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Lingua', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/kr/admin.php b/app/i18n/kr/admin.php index e18da9b13..9c41430eb 100644 --- a/app/i18n/kr/admin.php +++ b/app/i18n/kr/admin.php @@ -188,6 +188,7 @@ return array( 'create' => '새 사용자 생성', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => '사용자 삭제', + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => '언어', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php index f690dff33..b6ffee16a 100644 --- a/app/i18n/nl/admin.php +++ b/app/i18n/nl/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Creëer nieuwe gebruiker', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Verwijder gebruiker', + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Taal', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/oc/admin.php b/app/i18n/oc/admin.php index e0f69eb65..f27014fca 100644 --- a/app/i18n/oc/admin.php +++ b/app/i18n/oc/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Crear un nòu utilizaire', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Suprimir un utilizaire', + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Lenga', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/pt-br/admin.php b/app/i18n/pt-br/admin.php index e3cc752f6..83639c01b 100644 --- a/app/i18n/pt-br/admin.php +++ b/app/i18n/pt-br/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Criar novo usuário', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', // TODO - Translation + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Idioma', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/ru/admin.php b/app/i18n/ru/admin.php index 8c69a9425..3fcf151dd 100644 --- a/app/i18n/ru/admin.php +++ b/app/i18n/ru/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Создать нового пользователя', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', // TODO - Translation + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Язык', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/sk/admin.php b/app/i18n/sk/admin.php index 053999033..1e06c40b9 100644 --- a/app/i18n/sk/admin.php +++ b/app/i18n/sk/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Vytvoriť nového používateľa', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Zmazať používateľa', + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Jazyk', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/tr/admin.php b/app/i18n/tr/admin.php index 36aace7b6..bb097d5e8 100644 --- a/app/i18n/tr/admin.php +++ b/app/i18n/tr/admin.php @@ -188,6 +188,7 @@ return array( 'create' => 'Yeni kullanıcı oluştur', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => 'Delete user', // TODO - Translation + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => 'Dil', 'list' => 'User list', // TODO - Translation diff --git a/app/i18n/zh-cn/admin.php b/app/i18n/zh-cn/admin.php index 1d7b97f38..84541e402 100644 --- a/app/i18n/zh-cn/admin.php +++ b/app/i18n/zh-cn/admin.php @@ -188,6 +188,7 @@ return array( 'create' => '创建新用户', 'database_size' => 'Database size', // TODO - Translation 'delete_users' => '删除用户', + 'email' => 'Email address', // TODO - Translation 'feed_count' => 'Feeds', // TODO - Translation 'language' => '语言', 'list' => 'User list', // TODO - Translation diff --git a/app/views/user/details.phtml b/app/views/user/details.phtml index 2e37be872..7a4687184 100644 --- a/app/views/user/details.phtml +++ b/app/views/user/details.phtml @@ -7,6 +7,20 @@ +
+ +
+ details['mail_login'] ?> +
+
+ +
+ +
+ details['language']}") ?> +
+
+
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index e5d5717fa..951544248 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -62,6 +62,8 @@ + + @@ -72,6 +74,8 @@ users as $username => $values) : ?> + + diff --git a/cli/i18n/ignore/fr.php b/cli/i18n/ignore/fr.php index a121e5502..d7e54ed98 100644 --- a/cli/i18n/ignore/fr.php +++ b/cli/i18n/ignore/fr.php @@ -3,6 +3,7 @@ return array( 'admin.extensions.title', 'admin.stats.number_entries', + 'admin.user.article_count', 'admin.user.articles_and_size', 'conf.display.width.large', 'conf.sharing.blogotext', -- cgit v1.2.3