From 64d1026dd979740010088d1f4237f6dc2a4f4cfd Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 5 Oct 2014 17:55:35 +0200 Subject: Move usersAction into usersController --- app/layout/aside_configure.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/layout/aside_configure.phtml') diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index d5c9bf4c9..e17bcb254 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -19,8 +19,8 @@
  • -
  • - +
  • +
  • Date: Tue, 7 Oct 2014 10:16:38 +0200 Subject: Introduce FreshRSS_Auth::hasAccess('admin') Replace Minz_Configuration::isAdmin($user). FreshRSS_Auth::hasAccess() could be extended to others scopes later. See https://github.com/marienfressinaud/FreshRSS/issues/655 --- app/Controllers/configureController.php | 2 +- app/Controllers/updateController.php | 2 +- app/Controllers/usersController.php | 8 ++++---- app/Models/Auth.php | 19 +++++++++++++++---- app/layout/aside_configure.phtml | 5 +---- app/layout/header.phtml | 5 +---- app/views/configure/archiving.phtml | 2 +- app/views/users/index.phtml | 6 +++--- lib/Minz/Configuration.php | 3 --- 9 files changed, 27 insertions(+), 25 deletions(-) (limited to 'app/layout/aside_configure.phtml') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 7e77a757a..fb8c1466e 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -229,7 +229,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->nb_total = $entryDAO->count(); $this->view->size_user = $entryDAO->size(); - if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { + if (FreshRSS_Auth::hasAccess('admin')) { $this->view->size_total = $entryDAO->size(true); } } diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 9da1e8657..9d1e1ddf5 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -3,7 +3,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { public function firstAction() { $current_user = Minz_Session::param('currentUser', ''); - if (!FreshRSS_Auth::hasAccess() && Minz_Configuration::isAdmin($current_user)) { + if (!FreshRSS_Auth::hasAccess('admin')) { Minz_Error::error( 403, array('error' => array(_t('access_denied'))) diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php index c2b1d163f..11862ce27 100644 --- a/app/Controllers/usersController.php +++ b/app/Controllers/usersController.php @@ -51,7 +51,7 @@ class FreshRSS_users_Controller extends Minz_ActionController { $this->view->conf->_apiPasswordHash($passwordHash); } - if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { + if (FreshRSS_Auth::hasAccess('admin')) { $this->view->conf->_mail_login(Minz_Request::param('mail_login', '', true)); } $email = $this->view->conf->mail_login; @@ -65,7 +65,7 @@ class FreshRSS_users_Controller extends Minz_ActionController { $ok &= (file_put_contents($personaFile, Minz_Session::param('currentUser', '_')) !== false); } - if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { + if (FreshRSS_Auth::hasAccess('admin')) { $current_token = $this->view->conf->token; $token = Minz_Request::param('token', $current_token); $this->view->conf->_token($token); @@ -105,7 +105,7 @@ class FreshRSS_users_Controller extends Minz_ActionController { } public function createAction() { - if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { + if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) { $db = Minz_Configuration::dataBase(); require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); @@ -177,7 +177,7 @@ class FreshRSS_users_Controller extends Minz_ActionController { } public function deleteAction() { - if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { + if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) { $db = Minz_Configuration::dataBase(); require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); diff --git a/app/Models/Auth.php b/app/Models/Auth.php index c4a3abd98..992b444a5 100644 --- a/app/Models/Auth.php +++ b/app/Models/Auth.php @@ -99,12 +99,23 @@ class FreshRSS_Auth { } /** - * Returns if current user is connected. + * Returns if current user has access to the given scope. * - * @return boolean true if user is connected, false else. + * @param string $scope general (default) or admin + * @return boolean true if user has corresponding access, false else. */ - public static function hasAccess() { - return self::$login_ok; + public static function hasAccess($scope = 'general') { + $ok = self::$login_ok; + switch ($scope) { + case 'general': + break; + case 'admin': + $ok &= Minz_Session::param('currentUser') === Minz_Configuration::defaultUser(); + break; + default: + $ok = false; + } + return $ok; } /** diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index e17bcb254..59846a7c8 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -22,10 +22,7 @@
  • - +
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index fadfd13d7..12c86d61d 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -64,10 +64,7 @@ if (Minz_Configuration::canLogIn()) {
  • - +
  • diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index a883571aa..adbfdb77e 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -67,7 +67,7 @@ - +

    diff --git a/app/views/users/index.phtml b/app/views/users/index.phtml index 95659f727..f1cdf01a3 100644 --- a/app/views/users/index.phtml +++ b/app/views/users/index.phtml @@ -11,7 +11,7 @@
    @@ -44,7 +44,7 @@ conf->mail_login; ?>
    - placeholder="alice@example.net" /> + placeholder="alice@example.net" />
    @@ -56,7 +56,7 @@
    - + diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 4e9da58b4..554bc8c96 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -100,9 +100,6 @@ class Minz_Configuration { public static function defaultUser () { return self::$default_user; } - public static function isAdmin($currentUser) { - return $currentUser === self::$default_user; - } public static function allowAnonymous() { return self::$allow_anonymous; } -- cgit v1.2.3 From c5fe3bd6593d0a07c087d1e60ae2e4b8ab5f9fa9 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 16 Oct 2014 15:25:46 +0200 Subject: Reorganize user pages Three pages: - User profil - User management - Authentication --- app/Controllers/authController.php | 60 ++++++++++ app/Controllers/userController.php | 198 +++++++++++++++++++++++++++++++++ app/Controllers/usersController.php | 210 ----------------------------------- app/layout/aside_configure.phtml | 12 +- app/layout/header.phtml | 4 +- app/views/auth/index.phtml | 84 ++++++++++++++ app/views/user/manage.phtml | 76 +++++++++++++ app/views/user/profil.phtml | 59 ++++++++++ app/views/users/index.phtml | 211 ------------------------------------ 9 files changed, 490 insertions(+), 424 deletions(-) create mode 100644 app/Controllers/userController.php delete mode 100644 app/Controllers/usersController.php create mode 100644 app/views/auth/index.phtml create mode 100644 app/views/user/manage.phtml create mode 100644 app/views/user/profil.phtml delete mode 100644 app/views/users/index.phtml (limited to 'app/layout/aside_configure.phtml') diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index e30fa4b72..751ce1f3f 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -4,6 +4,66 @@ * This controller handles action about authentication. */ class FreshRSS_auth_Controller extends Minz_ActionController { + /** + * This action handles authentication management page. + * + * Parameters are: + * - token (default: current token) + * - anon_access (default: false) + * - anon_refresh (default: false) + * - auth_type (default: none) + * - unsafe_autologin (default: false) + * - api_enabled (default: false) + * + * @todo move unsafe_autologin in an extension. + */ + public function indexAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403, + array('error' => array(_t('access_denied')))); + } + + if (Minz_Request::isPost()) { + $ok = true; + + $current_token = $this->view->conf->token; + $token = Minz_Request::param('token', $current_token); + $this->view->conf->_token($token); + $ok &= $this->view->conf->save(); + + $anon = Minz_Request::param('anon_access', false); + $anon = ((bool)$anon) && ($anon !== 'no'); + $anon_refresh = Minz_Request::param('anon_refresh', false); + $anon_refresh = ((bool)$anon_refresh) && ($anon_refresh !== 'no'); + $auth_type = Minz_Request::param('auth_type', 'none'); + $unsafe_autologin = Minz_Request::param('unsafe_autologin', false); + $api_enabled = Minz_Request::param('api_enabled', false); + if ($anon != Minz_Configuration::allowAnonymous() || + $auth_type != Minz_Configuration::authType() || + $anon_refresh != Minz_Configuration::allowAnonymousRefresh() || + $unsafe_autologin != Minz_Configuration::unsafeAutologinEnabled() || + $api_enabled != Minz_Configuration::apiEnabled()) { + + Minz_Configuration::_authType($auth_type); + Minz_Configuration::_allowAnonymous($anon); + Minz_Configuration::_allowAnonymousRefresh($anon_refresh); + Minz_Configuration::_enableAutologin($unsafe_autologin); + Minz_Configuration::_enableApi($api_enabled); + $ok &= Minz_Configuration::writeFile(); + } + + invalidateHttpCache(); + + if ($ok) { + Minz_Request::good('configuration_updated', + array('c' => 'auth', 'a' => 'index')); + } else { + Minz_Request::bad('error_occurred', + array('c' => 'auth', 'a' => 'index')); + } + } + } + /** * This action handles the login page. * diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php new file mode 100644 index 000000000..c516246c9 --- /dev/null +++ b/app/Controllers/userController.php @@ -0,0 +1,198 @@ + array(_t('access_denied'))) + ); + } + } + + /** + * This action displays the user profil page. + */ + public function profilAction() { + Minz_View::prependTitle(_t('users.profil') . ' · '); + + if (Minz_Request::isPost()) { + $ok = true; + + $passwordPlain = Minz_Request::param('passwordPlain', '', true); + if ($passwordPlain != '') { + Minz_Request::_param('passwordPlain'); //Discard plain-text password ASAP + $_POST['passwordPlain'] = ''; + if (!function_exists('password_hash')) { + include_once(LIB_PATH . '/password_compat.php'); + } + $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); + $passwordPlain = ''; + $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js + $ok &= ($passwordHash != ''); + $this->view->conf->_passwordHash($passwordHash); + } + Minz_Session::_param('passwordHash', $this->view->conf->passwordHash); + + $passwordPlain = Minz_Request::param('apiPasswordPlain', '', true); + if ($passwordPlain != '') { + if (!function_exists('password_hash')) { + include_once(LIB_PATH . '/password_compat.php'); + } + $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); + $passwordPlain = ''; + $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js + $ok &= ($passwordHash != ''); + $this->view->conf->_apiPasswordHash($passwordHash); + } + + // TODO: why do we need of hasAccess here? + if (FreshRSS_Auth::hasAccess('admin')) { + $this->view->conf->_mail_login(Minz_Request::param('mail_login', '', true)); + } + $email = $this->view->conf->mail_login; + Minz_Session::_param('mail', $email); + + $ok &= $this->view->conf->save(); + + if ($email != '') { + $personaFile = DATA_PATH . '/persona/' . $email . '.txt'; + @unlink($personaFile); + $ok &= (file_put_contents($personaFile, Minz_Session::param('currentUser', '_')) !== false); + } + + if ($ok) { + Minz_Request::good('users.profil.updated', + array('c' => 'user', 'a' => 'profil')); + } else { + Minz_Request::bad('error_occurred', + array('c' => 'user', 'a' => 'profil')); + } + } + } + + /** + * This action displays the user management page. + */ + public function manageAction() { + Minz_View::prependTitle(_t('users.manage') . ' · '); + } + + public function createAction() { + if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) { + $db = Minz_Configuration::dataBase(); + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); + + $new_user_language = Minz_Request::param('new_user_language', $this->view->conf->language); + if (!in_array($new_user_language, $this->view->conf->availableLanguages())) { + $new_user_language = $this->view->conf->language; + } + + $new_user_name = Minz_Request::param('new_user_name'); + $ok = ($new_user_name != '') && ctype_alnum($new_user_name); + + if ($ok) { + $ok &= (strcasecmp($new_user_name, Minz_Configuration::defaultUser()) !== 0); //It is forbidden to alter the default user + + $ok &= !in_array(strtoupper($new_user_name), array_map('strtoupper', listUsers())); //Not an existing user, case-insensitive + + $configPath = DATA_PATH . '/' . $new_user_name . '_user.php'; + $ok &= !file_exists($configPath); + } + if ($ok) { + + $passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true); + $passwordHash = ''; + if ($passwordPlain != '') { + Minz_Request::_param('new_user_passwordPlain'); //Discard plain-text password ASAP + $_POST['new_user_passwordPlain'] = ''; + if (!function_exists('password_hash')) { + include_once(LIB_PATH . '/password_compat.php'); + } + $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); + $passwordPlain = ''; + $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js + $ok &= ($passwordHash != ''); + } + if (empty($passwordHash)) { + $passwordHash = ''; + } + + $new_user_email = filter_var($_POST['new_user_email'], FILTER_VALIDATE_EMAIL); + if (empty($new_user_email)) { + $new_user_email = ''; + } else { + $personaFile = DATA_PATH . '/persona/' . $new_user_email . '.txt'; + @unlink($personaFile); + $ok &= (file_put_contents($personaFile, $new_user_name) !== false); + } + } + if ($ok) { + $config_array = array( + 'language' => $new_user_language, + 'passwordHash' => $passwordHash, + 'mail_login' => $new_user_email, + ); + $ok &= (file_put_contents($configPath, "createUser($new_user_name); + } + invalidateHttpCache(); + + $notif = array( + 'type' => $ok ? 'good' : 'bad', + 'content' => _t($ok ? 'user_created' : 'error_occurred', $new_user_name) + ); + Minz_Session::_param('notification', $notif); + } + + Minz_Request::forward(array('c' => 'user', 'a' => 'manage'), true); + } + + public function deleteAction() { + if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) { + $db = Minz_Configuration::dataBase(); + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); + + $username = Minz_Request::param('username'); + $ok = ctype_alnum($username); + + if ($ok) { + $ok &= (strcasecmp($username, Minz_Configuration::defaultUser()) !== 0); //It is forbidden to delete the default user + } + if ($ok) { + $configPath = DATA_PATH . '/' . $username . '_user.php'; + $ok &= file_exists($configPath); + } + if ($ok) { + $userDAO = new FreshRSS_UserDAO(); + $ok &= $userDAO->deleteUser($username); + $ok &= unlink($configPath); + //TODO: delete Persona file + } + invalidateHttpCache(); + + $notif = array( + 'type' => $ok ? 'good' : 'bad', + 'content' => _t($ok ? 'user_deleted' : 'error_occurred', $username) + ); + Minz_Session::_param('notification', $notif); + } + + Minz_Request::forward(array('c' => 'user', 'a' => 'manage'), true); + } +} diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php deleted file mode 100644 index 11862ce27..000000000 --- a/app/Controllers/usersController.php +++ /dev/null @@ -1,210 +0,0 @@ - array(_t('access_denied'))) - ); - } - } - - /** - * This action display the user configuration page - */ - public function indexAction() { - Minz_View::prependTitle(_t('users') . ' · '); - } - - public function authAction() { - if (Minz_Request::isPost()) { - $ok = true; - - $passwordPlain = Minz_Request::param('passwordPlain', '', true); - if ($passwordPlain != '') { - Minz_Request::_param('passwordPlain'); //Discard plain-text password ASAP - $_POST['passwordPlain'] = ''; - if (!function_exists('password_hash')) { - include_once(LIB_PATH . '/password_compat.php'); - } - $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); - $passwordPlain = ''; - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - $ok &= ($passwordHash != ''); - $this->view->conf->_passwordHash($passwordHash); - } - Minz_Session::_param('passwordHash', $this->view->conf->passwordHash); - - $passwordPlain = Minz_Request::param('apiPasswordPlain', '', true); - if ($passwordPlain != '') { - if (!function_exists('password_hash')) { - include_once(LIB_PATH . '/password_compat.php'); - } - $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); - $passwordPlain = ''; - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - $ok &= ($passwordHash != ''); - $this->view->conf->_apiPasswordHash($passwordHash); - } - - if (FreshRSS_Auth::hasAccess('admin')) { - $this->view->conf->_mail_login(Minz_Request::param('mail_login', '', true)); - } - $email = $this->view->conf->mail_login; - Minz_Session::_param('mail', $email); - - $ok &= $this->view->conf->save(); - - if ($email != '') { - $personaFile = DATA_PATH . '/persona/' . $email . '.txt'; - @unlink($personaFile); - $ok &= (file_put_contents($personaFile, Minz_Session::param('currentUser', '_')) !== false); - } - - if (FreshRSS_Auth::hasAccess('admin')) { - $current_token = $this->view->conf->token; - $token = Minz_Request::param('token', $current_token); - $this->view->conf->_token($token); - $ok &= $this->view->conf->save(); - - $anon = Minz_Request::param('anon_access', false); - $anon = ((bool)$anon) && ($anon !== 'no'); - $anon_refresh = Minz_Request::param('anon_refresh', false); - $anon_refresh = ((bool)$anon_refresh) && ($anon_refresh !== 'no'); - $auth_type = Minz_Request::param('auth_type', 'none'); - $unsafe_autologin = Minz_Request::param('unsafe_autologin', false); - $api_enabled = Minz_Request::param('api_enabled', false); - if ($anon != Minz_Configuration::allowAnonymous() || - $auth_type != Minz_Configuration::authType() || - $anon_refresh != Minz_Configuration::allowAnonymousRefresh() || - $unsafe_autologin != Minz_Configuration::unsafeAutologinEnabled() || - $api_enabled != Minz_Configuration::apiEnabled()) { - - Minz_Configuration::_authType($auth_type); - Minz_Configuration::_allowAnonymous($anon); - Minz_Configuration::_allowAnonymousRefresh($anon_refresh); - Minz_Configuration::_enableAutologin($unsafe_autologin); - Minz_Configuration::_enableApi($api_enabled); - $ok &= Minz_Configuration::writeFile(); - } - } - - invalidateHttpCache(); - - $notif = array( - 'type' => $ok ? 'good' : 'bad', - 'content' => _t($ok ? 'configuration_updated' : 'error_occurred') - ); - Minz_Session::_param('notification', $notif); - } - Minz_Request::forward(array('c' => 'users', 'a' => 'index'), true); - } - - public function createAction() { - if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) { - $db = Minz_Configuration::dataBase(); - require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); - - $new_user_language = Minz_Request::param('new_user_language', $this->view->conf->language); - if (!in_array($new_user_language, $this->view->conf->availableLanguages())) { - $new_user_language = $this->view->conf->language; - } - - $new_user_name = Minz_Request::param('new_user_name'); - $ok = ($new_user_name != '') && ctype_alnum($new_user_name); - - if ($ok) { - $ok &= (strcasecmp($new_user_name, Minz_Configuration::defaultUser()) !== 0); //It is forbidden to alter the default user - - $ok &= !in_array(strtoupper($new_user_name), array_map('strtoupper', listUsers())); //Not an existing user, case-insensitive - - $configPath = DATA_PATH . '/' . $new_user_name . '_user.php'; - $ok &= !file_exists($configPath); - } - if ($ok) { - - $passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true); - $passwordHash = ''; - if ($passwordPlain != '') { - Minz_Request::_param('new_user_passwordPlain'); //Discard plain-text password ASAP - $_POST['new_user_passwordPlain'] = ''; - if (!function_exists('password_hash')) { - include_once(LIB_PATH . '/password_compat.php'); - } - $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); - $passwordPlain = ''; - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - $ok &= ($passwordHash != ''); - } - if (empty($passwordHash)) { - $passwordHash = ''; - } - - $new_user_email = filter_var($_POST['new_user_email'], FILTER_VALIDATE_EMAIL); - if (empty($new_user_email)) { - $new_user_email = ''; - } else { - $personaFile = DATA_PATH . '/persona/' . $new_user_email . '.txt'; - @unlink($personaFile); - $ok &= (file_put_contents($personaFile, $new_user_name) !== false); - } - } - if ($ok) { - $config_array = array( - 'language' => $new_user_language, - 'passwordHash' => $passwordHash, - 'mail_login' => $new_user_email, - ); - $ok &= (file_put_contents($configPath, "createUser($new_user_name); - } - invalidateHttpCache(); - - $notif = array( - 'type' => $ok ? 'good' : 'bad', - 'content' => _t($ok ? 'user_created' : 'error_occurred', $new_user_name) - ); - Minz_Session::_param('notification', $notif); - } - Minz_Request::forward(array('c' => 'users', 'a' => 'index'), true); - } - - public function deleteAction() { - if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) { - $db = Minz_Configuration::dataBase(); - require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); - - $username = Minz_Request::param('username'); - $ok = ctype_alnum($username); - - if ($ok) { - $ok &= (strcasecmp($username, Minz_Configuration::defaultUser()) !== 0); //It is forbidden to delete the default user - } - if ($ok) { - $configPath = DATA_PATH . '/' . $username . '_user.php'; - $ok &= file_exists($configPath); - } - if ($ok) { - $userDAO = new FreshRSS_UserDAO(); - $ok &= $userDAO->deleteUser($username); - $ok &= unlink($configPath); - //TODO: delete Persona file - } - invalidateHttpCache(); - - $notif = array( - 'type' => $ok ? 'good' : 'bad', - 'content' => _t($ok ? 'user_deleted' : 'error_occurred', $username) - ); - Minz_Session::_param('notification', $notif); - } - Minz_Request::forward(array('c' => 'users', 'a' => 'index'), true); - } -} diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 59846a7c8..7a9d0d839 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -19,10 +19,18 @@
  • -
  • - +
  • +
  • +
  • + +
  • +
  • + +
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index deb21edc9..7e7c1b477 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -63,8 +63,10 @@ if (Minz_Configuration::canLogIn()) {
  • -
  • +
  • +
  • +
  • diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml new file mode 100644 index 000000000..c37a7aef6 --- /dev/null +++ b/app/views/auth/index.phtml @@ -0,0 +1,84 @@ +partial('aside_configure'); ?> + +
    + + +
    + + +
    + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + + +
    + + conf->token; ?> +
    + /> + +
    +
    + + +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    +
    diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml new file mode 100644 index 000000000..03746cabb --- /dev/null +++ b/app/views/user/manage.phtml @@ -0,0 +1,76 @@ +partial('aside_configure'); ?> + +
    + + +
    + + +
    + +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    + + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    +
    + + +
    + +
    +
    + +
    + + conf->mail_login; ?> +
    + +
    +
    + +
    +
    + + +
    +
    + +
    +
    diff --git a/app/views/user/profil.phtml b/app/views/user/profil.phtml new file mode 100644 index 000000000..a74c7b6f8 --- /dev/null +++ b/app/views/user/profil.phtml @@ -0,0 +1,59 @@ +partial('aside_configure'); ?> + +
    + + +
    + + +
    + +
    + + +
    +
    + +
    + +
    +
    + /> + +
    + +
    +
    + + +
    + +
    +
    + /> + +
    +
    +
    + + +
    + + conf->mail_login; ?> +
    + placeholder="alice@example.net" /> + +
    +
    + +
    +
    + + +
    +
    +
    +
    diff --git a/app/views/users/index.phtml b/app/views/users/index.phtml deleted file mode 100644 index f1cdf01a3..000000000 --- a/app/views/users/index.phtml +++ /dev/null @@ -1,211 +0,0 @@ -partial('aside_configure'); ?> - -
    - - -
    - - -
    - -
    - - -
    -
    - -
    - -
    -
    - /> - -
    - -
    -
    - - -
    - -
    -
    - /> - -
    -
    -
    - - -
    - - conf->mail_login; ?> -
    - placeholder="alice@example.net" /> - -
    -
    - -
    -
    - - -
    -
    - - - - - -
    - -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - - -
    - - conf->token; ?> -
    - /> - -
    -
    - - -
    -
    - -
    -
    - -
    -
    - - -
    -
    -
    - -
    - - -
    - -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    - - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    -
    - - -
    - -
    -
    - -
    - - conf->mail_login; ?> -
    - -
    -
    - -
    -
    - - -
    -
    - -
    - - -
    -- cgit v1.2.3 From 74be86d7e817bcccdc0052c54fefdc8379d9fe7f Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 17 Oct 2014 09:33:35 +0200 Subject: Reorganise menus (aside and header) --- app/layout/aside_configure.phtml | 2 +- app/layout/header.phtml | 3 ++- lib/lib_opml.php | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'app/layout/aside_configure.phtml') diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 7a9d0d839..2e2b87203 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -18,12 +18,12 @@
  • -
  • +
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 7e7c1b477..c680cbcdc 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -62,9 +62,10 @@ if (Minz_Configuration::canLogIn()) {
  • -
  • +
  • +
  • diff --git a/lib/lib_opml.php b/lib/lib_opml.php index 16a9921ea..f320335bb 100644 --- a/lib/lib_opml.php +++ b/lib/lib_opml.php @@ -101,6 +101,7 @@ function libopml_parse_string($xml) { // First, we get all "head" elements. Head is required but its sub-elements // are optional. + // TODO: test head exists! foreach ($opml->head->children() as $key => $value) { if (in_array($key, unserialize(HEAD_ELEMENTS), true)) { $array['head'][$key] = (string)$value; @@ -114,6 +115,7 @@ function libopml_parse_string($xml) { // Then, we get body oulines. Body must contain at least one outline // element. $at_least_one_outline = false; + // TODO: test body exists! foreach ($opml->body->children() as $key => $value) { if ($key === 'outline') { $at_least_one_outline = true; -- cgit v1.2.3 From ce0984e102f5ce7d07277425595dad74193d4528 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 17 Oct 2014 16:23:07 +0200 Subject: Fix i18n --- app/i18n/en.php | 28 +++++++++++++++++----------- app/i18n/fr.php | 32 +++++++++++++++++++------------- app/layout/aside_configure.phtml | 8 ++++---- app/layout/header.phtml | 10 +++++----- app/views/configure/archiving.phtml | 19 ++++++++++++------- app/views/user/manage.phtml | 4 +++- 6 files changed, 60 insertions(+), 41 deletions(-) (limited to 'app/layout/aside_configure.phtml') diff --git a/app/i18n/en.php b/app/i18n/en.php index ebc25ba0c..f65576ea3 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -9,6 +9,7 @@ 'add_category' => 'Add a category', 'add_query' => 'Add a query', 'add_rss_feed' => 'Add a RSS feed', + 'admin.users.articles_and_size' => '%d articles (%s)', 'administration' => 'Manage', 'advanced' => 'Advanced', 'after_onread' => 'After “mark all as read”,', @@ -18,8 +19,8 @@ 'all_feeds' => 'All feeds', 'already_subscribed' => 'You have already subscribed to %s', 'api_enabled' => 'Allow API access (required for mobile apps)', - 'apr' => 'apr', 'Apr' => '\\A\\p\\r\\i\\l', + 'apr' => 'apr', 'april' => 'Apr', 'archiving_configuration' => 'Archiving', 'archiving_configuration_help' => 'More options are available in the individual stream settings', @@ -34,8 +35,8 @@ 'article_viewed' => 'when article is viewed', 'ask_empty' => 'Clear?', 'attention' => 'Attention!', - 'aug' => 'aug', 'Aug' => '\\A\\u\\g\\u\\s\\t', + 'aug' => 'aug', 'august' => 'Aug', 'author' => 'Author', 'auth_form' => 'Web form (traditional, requires JavaScript)', @@ -98,10 +99,11 @@ 'choose_language' => 'Choose a language for FreshRSS', 'clear_logs' => 'Clear the logs', 'collapse_article' => 'Collapse', + 'conf.users.articles_and_size' => '%d articles (%s)', 'configuration' => 'Configuration', 'configuration_updated' => 'Configuration has been updated', 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', - 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You may lost related favorites and user queries. It cannot be cancelled!', + 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', 'congratulations' => 'Congratulations!', 'content_width' => 'Content width', 'create' => 'Create', @@ -116,8 +118,8 @@ 'current_user' => 'Current user', 'damn' => 'Damn!', 'data_is_ok' => 'Permissions on data directory are good', - 'Dec' => '\\D\\e\\c\\e\\m\\b\\e\\r', 'dec' => 'dec', + 'Dec' => '\\D\\e\\c\\e\\m\\b\\e\\r', 'december' => 'Dec', 'default_category' => 'Uncategorized', 'default_user' => 'Username of the default user (maximum 16 alphanumeric characters)', @@ -182,6 +184,10 @@ 'freshrss_installation' => 'Installation · FreshRSS', 'fri' => 'Fri', 'g+' => 'Google+', + 'gen.menu.admin' => 'Administration', + 'gen.menu.authentication' => 'Authentication', + 'gen.menu.manage_users' => 'Manage users', + 'gen.menu.profil' => 'Profil', 'general_configuration' => 'General configuration', 'general_conf_is_ok' => 'General configuration has been saved.', 'github_or_email' => 'on Github or by mail', @@ -207,18 +213,18 @@ 'invalid_login' => 'Login is invalid', 'invalid_url' => 'URL %s is invalid', 'is_admin' => 'is administrator', - 'jan' => 'jan', 'Jan' => '\\J\\a\\n\\u\\a\\r\\y', + 'jan' => 'jan', 'january' => 'Jan', 'javascript_for_shortcuts' => 'JavaScript must be enabled in order to use shortcuts', 'javascript_is_better' => 'FreshRSS is more pleasant with JavaScript enabled', 'javascript_should_be_activated' => 'JavaScript must be enabled', - 'Jul' => '\\J\\u\\l\\y', 'jul' => 'jul', + 'Jul' => '\\J\\u\\l\\y', 'july' => 'Jul', 'jump_next' => 'jump to next unread sibling (feed or category)', - 'Jun' => '\\J\\u\\n\\e', 'jun' => 'jun', + 'Jun' => '\\J\\u\\n\\e', 'june' => 'Jun', 'keep_history' => 'Minimum number of articles to keep', 'keep_logged_in' => 'Keep me logged in (1 month)', @@ -244,16 +250,16 @@ 'logs_empty' => 'Log file is empty', 'log_is_ok' => 'Permissions on logs directory are good', 'main_stream' => 'Main stream', - 'Mar' => '\\M\\a\\r\\c\\h', 'mar' => 'mar', + 'Mar' => '\\M\\a\\r\\c\\h', 'march' => 'Mar', 'mark_all_read' => 'Mark all as read', 'mark_cat_read' => 'Mark category as read', 'mark_favorite' => 'Mark as favourite', 'mark_feed_read' => 'Mark feed as read', 'mark_read' => 'Mark as read', - 'May' => '\\M\\a\\y', 'may' => 'May', + 'May' => '\\M\\a\\y', 'minz_is_nok' => 'You lack the Minz framework. You should execute build.sh script or download it on Github and install in %s directory the content of its /lib directory.', 'minz_is_ok' => 'You have the Minz framework', 'mon' => 'Mon', @@ -274,8 +280,8 @@ 'not_read' => '%d unread', 'not_reads' => '%d unread', 'not_yet_implemented' => 'Not yet implemented', - 'nov' => 'nov', 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', + 'nov' => 'nov', 'november' => 'Nov', 'no_feed_actualized' => 'No RSS feed has been updated', 'no_feed_to_display' => 'There is no article to show.', @@ -291,8 +297,8 @@ 'number_feeds' => '%d feeds', 'n_entries_deleted' => '%d articles have been deleted', 'n_feeds_actualized' => '%d feeds have been updated', - 'oct' => 'oct', 'Oct' => '\\O\\c\\t\\o\\b\\e\\r', + 'oct' => 'oct', 'october' => 'Oct', 'ok' => 'Ok!', 'older_first' => 'Oldest first', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 220f8b12d..ab34eed3e 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -9,6 +9,7 @@ 'add_category' => 'Ajouter une catégorie', 'add_query' => 'Créer un filtre', 'add_rss_feed' => 'Ajouter un flux RSS', + 'admin.users.articles_and_size' => '%d articles (%s)', 'administration' => 'Gérer', 'advanced' => 'Avancé', 'after_onread' => 'Après “marquer tout comme lu”,', @@ -18,8 +19,8 @@ 'all_feeds' => 'Tous les flux', 'already_subscribed' => 'Vous êtes déjà abonné à %s', 'api_enabled' => 'Autoriser l’accès par API (nécessaire pour les applis mobiles)', - 'apr' => 'avr.', 'Apr' => '\\a\\v\\r\\i\\l', + 'apr' => 'avr.', 'april' => 'avril', 'archiving_configuration' => 'Archivage', 'archiving_configuration_help' => 'D’autres options sont disponibles dans la configuration individuelle des flux.', @@ -34,8 +35,8 @@ 'article_viewed' => 'lorsque l’article est affiché', 'ask_empty' => 'Vider ?', 'attention' => 'Attention !', - 'aug' => 'août', 'Aug' => '\\a\\o\\û\\t', + 'aug' => 'août', 'august' => 'août', 'author' => 'Auteur', 'auth_form' => 'Formulaire (traditionnel, requiert JavaScript)', @@ -88,8 +89,8 @@ 'category_empty' => 'Catégorie vide', 'category_name_exists' => 'Une catégorie possède déjà ce nom.', 'category_not_delete_default' => 'Vous ne pouvez pas supprimer la catégorie par défaut !', - 'category_not_exist' => 'Cette catégorie n\'existe pas !', - 'category_no_id' => 'Vous devez préciser l\'id de la catégorie.', + 'category_not_exist' => 'Cette catégorie n’existe pas !', + 'category_no_id' => 'Vous devez préciser l’id de la catégorie.', 'category_no_name' => 'Vous devez préciser un nom pour la catégorie.', 'category_number' => 'Catégorie n°%d', 'category_updated' => 'La catégorie a été mise à jour.', @@ -98,10 +99,11 @@ 'choose_language' => 'Choisissez la langue pour FreshRSS', 'clear_logs' => 'Effacer les logs', 'collapse_article' => 'Refermer', + 'conf.users.articles_and_size' => '%d articles (%s)', 'configuration' => 'Configuration', 'configuration_updated' => 'La configuration a été mise à jour.', 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', - 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous pourriez perdre les favoris et les filtres associés. Cette action ne peut être annulée !', + 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', 'congratulations' => 'Félicitations !', 'content_width' => 'Largeur du contenu', 'create' => 'Créer', @@ -116,8 +118,8 @@ 'current_user' => 'Utilisateur actuel', 'damn' => 'Arf !', 'data_is_ok' => 'Les droits sur le répertoire de data sont bons', - 'Dec' => '\\d\\é\\c\\e\\m\\b\\r\\e', 'dec' => 'déc.', + 'Dec' => '\\d\\é\\c\\e\\m\\b\\r\\e', 'december' => 'décembre', 'default_category' => 'Sans catégorie', 'default_user' => 'Nom de l’utilisateur par défaut (16 caractères alphanumériques maximum)', @@ -182,6 +184,10 @@ 'freshrss_installation' => 'Installation · FreshRSS', 'fri' => 'ven.', 'g+' => 'Google+', + 'gen.menu.admin' => 'Administration', + 'gen.menu.authentication' => 'Authentification', + 'gen.menu.manage_users' => 'Gestion des utilisateurs', + 'gen.menu.profil' => 'Profil', 'general_configuration' => 'Configuration générale', 'general_conf_is_ok' => 'La configuration générale a été enregistrée.', 'github_or_email' => 'sur Github ou par courriel', @@ -207,18 +213,18 @@ 'invalid_login' => 'L’identifiant est invalide !', 'invalid_url' => 'L’url %s est invalide.', 'is_admin' => 'est administrateur', - 'jan' => 'jan.', 'Jan' => '\\j\\a\\n\\v\\i\\e\\r', + 'jan' => 'jan.', 'january' => 'janvier', 'javascript_for_shortcuts' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis.', 'javascript_is_better' => 'FreshRSS est plus agréable à utiliser avec JavaScript activé', 'javascript_should_be_activated' => 'Le JavaScript doit être activé.', - 'Jul' => '\\j\\u\\i\\l\\l\\e\\t', 'jul' => 'jui.', + 'Jul' => '\\j\\u\\i\\l\\l\\e\\t', 'july' => 'juillet', 'jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)', - 'Jun' => '\\j\\u\\i\\n', 'jun' => 'juin', + 'Jun' => '\\j\\u\\i\\n', 'june' => 'juin', 'keep_history' => 'Nombre minimum d’articles à conserver', 'keep_logged_in' => 'Rester connecté (1 mois)', @@ -244,16 +250,16 @@ 'logs_empty' => 'Les logs sont vides.', 'log_is_ok' => 'Les droits sur le répertoire des logs sont bons', 'main_stream' => 'Flux principal', - 'Mar' => '\\m\\a\\r\\s', 'mar' => 'mar.', + 'Mar' => '\\m\\a\\r\\s', 'march' => 'mars', 'mark_all_read' => 'Tout marquer comme lu', 'mark_cat_read' => 'Marquer la catégorie comme lue', 'mark_favorite' => 'Mettre en favori', 'mark_feed_read' => 'Marquer le flux comme lu', 'mark_read' => 'Marquer comme lu', - 'May' => '\\m\\a\\i', 'may' => 'mai.', + 'May' => '\\m\\a\\i', 'minz_is_nok' => 'Vous ne disposez pas de la librairie Minz. Vous devriez exécuter le script build.sh ou bien la télécharger sur Github et installer dans le répertoire %s le contenu de son répertoire /lib.', 'minz_is_ok' => 'Vous disposez du framework Minz', 'mon' => 'lun.', @@ -274,8 +280,8 @@ 'not_read' => '%d non lu', 'not_reads' => '%d non lus', 'not_yet_implemented' => 'Pas encore implémenté', - 'nov' => 'nov.', 'Nov' => '\\n\\o\\v\\e\\m\\b\\r\\e', + 'nov' => 'nov.', 'november' => 'novembre', 'no_feed_actualized' => 'Aucun flux n’a pu être mis à jour.', 'no_feed_to_display' => 'Il n’y a aucun article à afficher.', @@ -291,8 +297,8 @@ 'number_feeds' => '%d flux', 'n_entries_deleted' => '%d articles ont été supprimés.', 'n_feeds_actualized' => '%d flux ont été mis à jour.', - 'oct' => 'oct.', 'Oct' => '\\o\\c\\t\\o\\b\\r\\e', + 'oct' => 'oct.', 'october' => 'octobre', 'ok' => 'Ok !', 'older_first' => 'Plus anciens en premier', diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 2e2b87203..20446c877 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -20,16 +20,16 @@
  • - +
  • - +
  • - +
  • - +
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index c680cbcdc..e848ac4eb 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -62,12 +62,12 @@ if (Minz_Configuration::canLogIn()) {
  • -
  • -
  • +
  • - -
  • -
  • +
  • + +
  • +
  • diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 8f424c126..f469d343c 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -58,20 +58,25 @@
    -

    +
    -

    nb_total)), ' — ', formatBytes($this->size_user); ?>

    - - - + nb_total), formatBytes($this->size_user)); ?>
    -

    +
    -

    size_total); ?>

    + size_total); ?> +
    +
    + +
    +
    + + +
    diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index 65e60add5..89c91e06c 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -64,7 +64,9 @@ -

    nb_articles)), ', ', formatBytes($this->size_user); ?>

    +

    nb_articles), + formatBytes($this->size_user)); ?>

    -- cgit v1.2.3 From 7080a32650ab8b19e917d8add944a75cc98381bc Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 20 Oct 2014 11:54:31 +0200 Subject: Add checking installation feature --- app/Controllers/updateController.php | 14 +++++- app/Models/DatabaseDAO.php | 83 ++++++++++++++++++++++++++++++++++++ app/Models/DatabaseDAOSQLite.php | 48 +++++++++++++++++++++ app/Models/Factory.php | 9 ++++ app/SQL/install.sql.mysql.php | 2 - app/SQL/install.sql.sqlite.php | 2 - app/layout/aside_configure.phtml | 7 ++- app/layout/header.phtml | 1 + app/views/update/checkInstall.phtml | 30 +++++++++++++ lib/lib_rss.php | 62 +++++++++++++++++++++++++++ 10 files changed, 252 insertions(+), 6 deletions(-) create mode 100644 app/Models/DatabaseDAO.php create mode 100644 app/Models/DatabaseDAOSQLite.php create mode 100644 app/views/update/checkInstall.phtml (limited to 'app/layout/aside_configure.phtml') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 9d1e1ddf5..4ebb11f51 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -12,7 +12,6 @@ class FreshRSS_update_Controller extends Minz_ActionController { invalidateHttpCache(); - Minz_View::prependTitle(_t('update_system') . ' · '); $this->view->update_to_apply = false; $this->view->last_update_time = 'unknown'; $this->view->check_last_hour = false; @@ -24,6 +23,8 @@ class FreshRSS_update_Controller extends Minz_ActionController { } public function indexAction() { + Minz_View::prependTitle(_t('update_system') . ' · '); + if (file_exists(UPDATE_FILENAME) && !is_writable(FRESHRSS_PATH)) { $this->view->message = array( 'status' => 'bad', @@ -126,4 +127,15 @@ class FreshRSS_update_Controller extends Minz_ActionController { } } } + + /** + * This action displays information about installation. + */ + public function checkInstallAction() { + Minz_View::prependTitle(_t('gen.title.check_install') . ' · '); + + $this->view->status_php = check_install_php(); + $this->view->status_files = check_install_files(); + $this->view->status_database = check_install_database(); + } } diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php new file mode 100644 index 000000000..0d85718e3 --- /dev/null +++ b/app/Models/DatabaseDAO.php @@ -0,0 +1,83 @@ +bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + $tables = array( + $this->prefix . 'category' => false, + $this->prefix . 'feed' => false, + $this->prefix . 'entry' => false, + ); + foreach ($res as $value) { + $tables[array_pop($value)] = true; + } + + return count(array_keys($tables, true, true)) == count($tables); + } + + public function getSchema($table) { + $sql = 'DESC ' . $this->prefix . $table; + $stm = $this->bd->prepare($sql); + $stm->execute(); + + return $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC)); + } + + public function checkTable($table, $schema) { + $columns = $this->getSchema($table); + + $ok = (count($columns) == count($schema)); + foreach ($columns as $c) { + $ok &= in_array($c['name'], $schema); + } + + return $ok; + } + + public function categoryIsCorrect() { + return $this->checkTable('category', array( + 'id', 'name' + )); + } + + public function feedIsCorrect() { + return $this->checkTable('feed', array( + 'id', 'url', 'category', 'name', 'website', 'description', 'lastUpdate', + 'priority', 'pathEntries', 'httpAuth', 'error', 'keep_history', 'ttl', + 'cache_nbEntries', 'cache_nbUnreads' + )); + } + + public function entryIsCorrect() { + return $this->checkTable('entry', array( + 'id', 'guid', 'title', 'author', 'content_bin', 'link', 'date', 'is_read', + 'is_favorite', 'id_feed', 'tags' + )); + } + + public function daoToSchema($dao) { + return array( + 'name' => $dao['Field'], + 'type' => strtolower($dao['Type']), + 'notnull' => (bool)$dao['Null'], + 'default' => $dao['Default'], + ); + } + + public function listDaoToSchema($listDAO) { + $list = array(); + + foreach ($listDAO as $dao) { + $list[] = $this->daoToSchema($dao); + } + + return $list; + } +} diff --git a/app/Models/DatabaseDAOSQLite.php b/app/Models/DatabaseDAOSQLite.php new file mode 100644 index 000000000..7f53f967d --- /dev/null +++ b/app/Models/DatabaseDAOSQLite.php @@ -0,0 +1,48 @@ +bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + $tables = array( + 'category' => false, + 'feed' => false, + 'entry' => false, + ); + foreach ($res as $value) { + $tables[$value['name']] = true; + } + + return count(array_keys($tables, true, true)) == count($tables); + } + + public function getSchema($table) { + $sql = 'PRAGMA table_info(' . $table . ')'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + + return $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC)); + } + + public function entryIsCorrect() { + return $this->checkTable('entry', array( + 'id', 'guid', 'title', 'author', 'content', 'link', 'date', 'is_read', + 'is_favorite', 'id_feed', 'tags' + )); + } + + public function daoToSchema($dao) { + return array( + 'name' => $dao['name'], + 'type' => strtolower($dao['type']), + 'notnull' => $dao['notnull'] === '1' ? true : false, + 'default' => $dao['dflt_value'], + ); + } +} diff --git a/app/Models/Factory.php b/app/Models/Factory.php index 93f4552f7..91cb84998 100644 --- a/app/Models/Factory.php +++ b/app/Models/Factory.php @@ -29,4 +29,13 @@ class FreshRSS_Factory { } } + public static function createDatabaseDAO($username = null) { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_DatabaseDAOSQLite($username); + } else { + return new FreshRSS_DatabaseDAO($username); + } + } + } diff --git a/app/SQL/install.sql.mysql.php b/app/SQL/install.sql.mysql.php index 16cb3a3b8..cf0159199 100644 --- a/app/SQL/install.sql.mysql.php +++ b/app/SQL/install.sql.mysql.php @@ -57,5 +57,3 @@ INSERT IGNORE INTO `%1$scategory` (id, name) VALUES(1, "%2$s"); '); define('SQL_DROP_TABLES', 'DROP TABLES %1$sentry, %1$sfeed, %1$scategory'); - -define('SQL_SHOW_TABLES', 'SHOW tables;'); diff --git a/app/SQL/install.sql.sqlite.php b/app/SQL/install.sql.sqlite.php index 7988ada04..30bca2810 100644 --- a/app/SQL/install.sql.sqlite.php +++ b/app/SQL/install.sql.sqlite.php @@ -55,5 +55,3 @@ $SQL_CREATE_TABLES = array( ); define('SQL_DROP_TABLES', 'DROP TABLES %1$sentry, %1$sfeed, %1$scategory'); - -define('SQL_SHOW_TABLES', 'SELECT name FROM sqlite_master WHERE type="table"'); diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 20446c877..32dc19a4e 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -31,7 +31,12 @@
  • -
  • +
  • + +
  • +
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index e848ac4eb..506cec175 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -68,6 +68,7 @@ if (Minz_Configuration::canLogIn()) {
  • +
  • diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml new file mode 100644 index 000000000..32058714e --- /dev/null +++ b/app/views/update/checkInstall.phtml @@ -0,0 +1,30 @@ +partial('aside_configure'); ?> + +
    + + +

    + + status_php as $key => $status) { ?> +

    + +

    + + +

    + + status_files as $key => $status) { ?> +

    + +

    + + +

    + + status_database as $key => $status) { ?> +

    + +

    + + +
    diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 2f9a2ea45..dbed207d0 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -245,3 +245,65 @@ function is_referer_from_same_domain() { } return (isset($host['port']) ? $host['port'] : 0) === (isset($referer['port']) ? $referer['port'] : 0); } + + +/** + * + */ +function check_install_php() { + return array( + 'php' => version_compare(PHP_VERSION, '5.2.1') >= 0, + 'minz' => file_exists(LIB_PATH . '/Minz'), + 'curl' => extension_loaded('curl'), + 'pdo_mysql' => extension_loaded('pdo_mysql'), + 'pdo_sqlite' => extension_loaded('pdo_sqlite'), + 'pdo' => extension_loaded('pdo_mysql') || extension_loaded('pdo_sqlite'), + 'pcre' => extension_loaded('pcre'), + 'ctype' => extension_loaded('ctype'), + 'dom' => class_exists('DOMDocument'), + 'json' => extension_loaded('json'), + 'zip' => extension_loaded('zip'), + ); +} + + +/** + * + */ +function check_install_files() { + return array( + 'data' => DATA_PATH && is_writable(DATA_PATH), + 'cache' => CACHE_PATH && is_writable(CACHE_PATH), + 'logs' => LOG_PATH && is_writable(LOG_PATH), + 'favicons' => is_writable(DATA_PATH . '/favicons'), + 'persona' => is_writable(DATA_PATH . '/persona'), + 'tokens' => is_writable(DATA_PATH . '/tokens'), + ); +} + + +/** + * + */ +function check_install_database() { + $status = array( + 'connection' => true, + 'tables' => false, + 'categories' => false, + 'feeds' => false, + 'entries' => false, + ); + + try { + $dbDAO = FreshRSS_Factory::createDatabaseDAO(); + + $status['tables'] = $dbDAO->tablesAreCorrect(); + $status['categories'] = $dbDAO->categoryIsCorrect(); + $status['feeds'] = $dbDAO->feedIsCorrect(); + $status['entries'] = $dbDAO->entryIsCorrect(); + } catch(Minz_PDOConnectionException $e) { + $status['connection'] = false; + } + + return $status; +} -- cgit v1.2.3 From 5d6407a0bf0ecee7017f9d6c6c110b7afa98fff0 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 26 Oct 2014 12:22:13 +0100 Subject: Update i18n - Fix i18n strings - Fix typo profil -> profile See https://github.com/marienfressinaud/FreshRSS/issues/678 --- app/Controllers/authController.php | 6 ++-- app/Controllers/userController.php | 16 +++++------ app/i18n/en.php | 16 +++++++---- app/i18n/fr.php | 16 +++++++---- app/layout/aside_configure.phtml | 6 ++-- app/layout/header.phtml | 4 +-- app/views/user/profil.phtml | 59 -------------------------------------- app/views/user/profile.phtml | 59 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 97 insertions(+), 85 deletions(-) delete mode 100644 app/views/user/profil.phtml create mode 100644 app/views/user/profile.phtml (limited to 'app/layout/aside_configure.phtml') diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index 4af39cb71..a08f906e3 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -143,7 +143,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { } // All is good, go back to the index. - Minz_Request::good(_t('login'), + Minz_Request::good(_t('feedback.login.success'), array('c' => 'index', 'a' => 'index')); } else { Minz_Log::warning('Password mismatch for' . @@ -182,7 +182,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { Minz_Session::_param('passwordHash', $s); FreshRSS_Auth::giveAccess(); - Minz_Request::good(_t('login'), + Minz_Request::good(_t('feedback.login.success'), array('c' => 'index', 'a' => 'index')); } else { Minz_Log::warning('Unsafe password mismatch for user ' . $username); @@ -274,7 +274,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { public function logoutAction() { invalidateHttpCache(); FreshRSS_Auth::removeAccess(); - Minz_Request::good(_t('disconnected'), + Minz_Request::good(_t('feedback.logout.success'), array('c' => 'index', 'a' => 'index')); } diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 61d33437d..2343520ca 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -23,10 +23,10 @@ class FreshRSS_user_Controller extends Minz_ActionController { } /** - * This action displays the user profil page. + * This action displays the user profile page. */ - public function profilAction() { - Minz_View::prependTitle(_t('users.profil') . ' · '); + public function profileAction() { + Minz_View::prependTitle(_t('gen.title.user_profile') . ' · '); if (Minz_Request::isPost()) { $ok = true; @@ -74,11 +74,11 @@ class FreshRSS_user_Controller extends Minz_ActionController { } if ($ok) { - Minz_Request::good('users.profil.updated', - array('c' => 'user', 'a' => 'profil')); + Minz_Request::good(_t('feedback.user_profile.updated'), + array('c' => 'user', 'a' => 'profile')); } else { - Minz_Request::bad('error_occurred', - array('c' => 'user', 'a' => 'profil')); + Minz_Request::bad(_t('error_occurred'), + array('c' => 'user', 'a' => 'profile')); } } } @@ -92,7 +92,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { array('error' => array(_t('access_denied')))); } - Minz_View::prependTitle(_t('users.manage') . ' · '); + Minz_View::prependTitle(_t('gen.title.user_management') . ' · '); // Get the correct current user. $userDAO = new FreshRSS_UserDAO(); diff --git a/app/i18n/en.php b/app/i18n/en.php index a3593b28c..275471e19 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -196,6 +196,10 @@ 'Feb' => '\\F\\e\\b\\r\\u\\a\\r\\y', 'february' => 'Feb', 'feed' => 'Feed', + 'feedback.login.error' => 'Login is invalid', + 'feedback.login.success' => 'You are connected', + 'feedback.logout.success' => 'You are disconnected', + 'feedback.user_profile.updated' => 'Your profile has been modified', 'feeds' => 'Feeds', 'feeds_actualized' => 'RSS feeds have been updated', 'feeds_imported' => 'Your feeds have been imported and will now be updated', @@ -233,10 +237,12 @@ 'gen.menu.admin' => 'Administration', 'gen.menu.authentication' => 'Authentication', 'gen.menu.check_install' => 'Installation checking', - 'gen.menu.manage_users' => 'Manage users', - 'gen.menu.profil' => 'Profil', + 'gen.menu.user_management' => 'Manage users', + 'gen.menu.user_profile' => 'Profile', 'gen.title.check_install' => 'Installation checking', 'gen.title.global_view' => 'Global view', + 'gen.title.user_management' => 'Manage users', + 'gen.title.user_profile' => 'Profile', 'general_configuration' => 'General configuration', 'general_conf_is_ok' => 'General configuration has been saved.', 'github_or_email' => 'on Github or by mail', @@ -262,8 +268,8 @@ 'invalid_login' => 'Login is invalid', 'invalid_url' => 'URL %s is invalid', 'is_admin' => 'is administrator', - 'jan' => 'jan', 'Jan' => '\\J\\a\\n\\u\\a\\r\\y', + 'jan' => 'jan', 'january' => 'Jan', 'javascript_for_shortcuts' => 'JavaScript must be enabled in order to use shortcuts', 'javascript_is_better' => 'FreshRSS is more pleasant with JavaScript enabled', @@ -272,8 +278,8 @@ 'Jul' => '\\J\\u\\l\\y', 'july' => 'Jul', 'jump_next' => 'jump to next unread sibling (feed or category)', - 'jun' => 'jun', 'Jun' => '\\J\\u\\n\\e', + 'jun' => 'jun', 'june' => 'Jun', 'keep_history' => 'Minimum number of articles to keep', 'keep_logged_in' => 'Keep me logged in (1 month)', @@ -329,8 +335,8 @@ 'not_read' => '%d unread', 'not_reads' => '%d unread', 'not_yet_implemented' => 'Not yet implemented', - 'nov' => 'nov', 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', + 'nov' => 'nov', 'november' => 'Nov', 'no_feed_actualized' => 'No RSS feed has been updated', 'no_feed_to_display' => 'There is no article to show.', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 60b7a4682..e3a49d54c 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -196,6 +196,10 @@ 'Feb' => '\\f\\é\\v\\r\\i\\e\\r', 'february' => 'février', 'feed' => 'Flux', + 'feedback.login.error' => 'L’identifiant est invalide !', + 'feedback.login.success' => 'Vous êtes désormais connecté', + 'feedback.logout.success' => 'Vous avez été déconnecté', + 'feedback.user_profile.updated' => 'Votre profil a été mis à jour', 'feeds' => 'Flux', 'feeds_actualized' => 'Les flux ont été mis à jour.', 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.', @@ -233,10 +237,12 @@ 'gen.menu.admin' => 'Administration', 'gen.menu.authentication' => 'Authentification', 'gen.menu.check_install' => 'Vérification de l\'installation', - 'gen.menu.manage_users' => 'Gestion des utilisateurs', - 'gen.menu.profil' => 'Profil', + 'gen.menu.user_management' => 'Gestion des utilisateurs', + 'gen.menu.user_profile' => 'Profil', 'gen.title.check_install' => 'Vérification de l\'installation', 'gen.title.global_view' => 'Vue globale', + 'gen.title.user_management' => 'Gestion des utilisateurs', + 'gen.title.user_profile' => 'Profil', 'general_configuration' => 'Configuration générale', 'general_conf_is_ok' => 'La configuration générale a été enregistrée.', 'github_or_email' => 'sur Github ou par courriel', @@ -262,8 +268,8 @@ 'invalid_login' => 'L’identifiant est invalide !', 'invalid_url' => 'L’url %s est invalide.', 'is_admin' => 'est administrateur', - 'jan' => 'jan.', 'Jan' => '\\j\\a\\n\\v\\i\\e\\r', + 'jan' => 'jan.', 'january' => 'janvier', 'javascript_for_shortcuts' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis.', 'javascript_is_better' => 'FreshRSS est plus agréable à utiliser avec JavaScript activé', @@ -272,8 +278,8 @@ 'Jul' => '\\j\\u\\i\\l\\l\\e\\t', 'july' => 'juillet', 'jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)', - 'jun' => 'juin', 'Jun' => '\\j\\u\\i\\n', + 'jun' => 'juin', 'june' => 'juin', 'keep_history' => 'Nombre minimum d’articles à conserver', 'keep_logged_in' => 'Rester connecté (1 mois)', @@ -329,8 +335,8 @@ 'not_read' => '%d non lu', 'not_reads' => '%d non lus', 'not_yet_implemented' => 'Pas encore implémenté', - 'nov' => 'nov.', 'Nov' => '\\n\\o\\v\\e\\m\\b\\r\\e', + 'nov' => 'nov.', 'november' => 'novembre', 'no_feed_actualized' => 'Aucun flux n’a pu être mis à jour.', 'no_feed_to_display' => 'Il n’y a aucun article à afficher.', diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 32dc19a4e..53c52d3e3 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -19,14 +19,14 @@
  • - + Minz_Request::actionName() === 'profile'? ' active' : ''; ?>"> +
  • - +
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 506cec175..c73d9cdbb 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -62,11 +62,11 @@ if (Minz_Configuration::canLogIn()) {
  • -
  • +
  • -
  • +
  • diff --git a/app/views/user/profil.phtml b/app/views/user/profil.phtml deleted file mode 100644 index a2af53c96..000000000 --- a/app/views/user/profil.phtml +++ /dev/null @@ -1,59 +0,0 @@ -partial('aside_configure'); ?> - -
    - - -
    - - -
    - -
    - - -
    -
    - -
    - -
    -
    - /> - -
    - -
    -
    - - -
    - -
    -
    - /> - -
    -
    -
    - - -
    - - mail_login; ?> -
    - placeholder="alice@example.net" /> - -
    -
    - -
    -
    - - -
    -
    -
    -
    diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml new file mode 100644 index 000000000..60257012c --- /dev/null +++ b/app/views/user/profile.phtml @@ -0,0 +1,59 @@ +partial('aside_configure'); ?> + +
    + + +
    + + +
    + +
    + + +
    +
    + +
    + +
    +
    + /> + +
    + +
    +
    + + +
    + +
    +
    + /> + +
    +
    +
    + + +
    + + mail_login; ?> +
    + placeholder="alice@example.net" /> + +
    +
    + +
    +
    + + +
    +
    +
    +
    -- cgit v1.2.3 From 9fc60317eecba785b66011f04b9a5150296f2df6 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 5 Dec 2014 14:17:02 +0100 Subject: First draft for listing and manipulate extensions See https://github.com/FreshRSS/FreshRSS/issues/252 --- app/Controllers/extensionController.php | 43 +++++++++++++++++++++++++++++++++ app/layout/aside_configure.phtml | 4 +++ app/layout/header.phtml | 1 + app/views/extension/index.phtml | 35 +++++++++++++++++++++++++++ lib/Minz/Extension.php | 20 +++++++++++++++ lib/Minz/ExtensionManager.php | 17 +++++++++++++ 6 files changed, 120 insertions(+) create mode 100644 app/Controllers/extensionController.php create mode 100644 app/views/extension/index.phtml (limited to 'app/layout/aside_configure.phtml') diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php new file mode 100644 index 000000000..504be56d3 --- /dev/null +++ b/app/Controllers/extensionController.php @@ -0,0 +1,43 @@ +view->extension_list = Minz_ExtensionManager::list_extensions(); + } + + public function configureAction() { + if (Minz_Request::param('ajax')) { + $this->view->_useLayout(false); + } + } + + public function enableAction() { + + } + + public function disableAction() { + + } + + public function removeAction() { + + } +} diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 53c52d3e3..f7f3617c4 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -22,6 +22,10 @@ Minz_Request::actionName() === 'profile'? ' active' : ''; ?>"> +
  • + +
  • +
  • diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml new file mode 100644 index 000000000..c6b7c84a1 --- /dev/null +++ b/app/views/extension/index.phtml @@ -0,0 +1,35 @@ +partial('aside_configure'); ?> + +
    + + +

    + + extension_list)) { ?> + + extension_list as $ext) { ?> +
      +
    • + getName()); ?> +
      + + is_enabled()) { ?> + + + + + + + +
      +
    • +
    • getName(); ?>
    • +
    + + +

    + +
    + + +
    diff --git a/lib/Minz/Extension.php b/lib/Minz/Extension.php index ecf510ea2..a1fdd659b 100644 --- a/lib/Minz/Extension.php +++ b/lib/Minz/Extension.php @@ -17,6 +17,8 @@ class Minz_Extension { 'user', ); + private $is_enabled; + /** * The constructor to assign specific information to the extension. * @@ -41,6 +43,8 @@ class Minz_Extension { $this->description = isset($meta_info['description']) ? $meta_info['description'] : ''; $this->version = isset($meta_info['version']) ? $meta_info['version'] : '0.1'; $this->setType(isset($meta_info['type']) ? $meta_info['type'] : 'user'); + + $this->is_enabled = false; } /** @@ -66,6 +70,22 @@ class Minz_Extension { */ public function init() {} + /** + * Set the current extension to enable. + */ + public function enable() { + $this->is_enabled = true; + } + + /** + * Return if the extension is currently enabled. + * + * @return true if extension is enabled, false else. + */ + public function is_enabled() { + return $this->is_enabled; + } + /** * Getters and setters. */ diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php index 789557b9e..6c32ccf19 100644 --- a/lib/Minz/ExtensionManager.php +++ b/lib/Minz/ExtensionManager.php @@ -144,6 +144,7 @@ class Minz_ExtensionManager { if (isset(self::$ext_list[$ext_name])) { $ext = self::$ext_list[$ext_name]; self::$ext_list_enabled[$ext_name] = $ext; + $ext->enable(); $ext->init(); } } @@ -158,4 +159,20 @@ class Minz_ExtensionManager { self::enable($ext_name); } } + + + + /** + * Returns a list of extensions. + * + * @param $only_enabled if true returns only the enabled extensions (false by default). + * @return an array of extensions. + */ + public static function list_extensions($only_enabled = false) { + if ($only_enabled) { + return self::$ext_list_enabled; + } else { + return self::$ext_list; + } + } } -- cgit v1.2.3 From f807a6f5c1e9aa5aadf338c5242e54e1930b4088 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 10 Dec 2014 22:10:01 +0100 Subject: Fix i18n for header and aside_configure --- app/i18n/en/gen.php | 58 +++++++++++++++++++++------------------- app/i18n/fr/gen.php | 58 +++++++++++++++++++++------------------- app/layout/aside_configure.phtml | 16 +++++------ app/layout/header.phtml | 32 +++++++++++----------- 4 files changed, 84 insertions(+), 80 deletions(-) (limited to 'app/layout/aside_configure.phtml') diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index a7f51e8f9..bd386f6a0 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -1,6 +1,36 @@ array( + 'login' => 'Login', + 'logout' => 'Logout', + ), + 'menu' => array( + 'about' => 'About', + 'admin' => 'Administration', + 'archiving' => 'Archiving', + 'authentication' => 'Authentication', + 'check_install' => 'Installation checking', + 'configuration' => 'Configuration', + 'display' => 'Display', + 'logs' => 'Logs', + 'queries' => 'User queries', + 'reading' => 'Reading', + 'sharing' => 'Sharing', + 'shortcuts' => 'Shortcuts', + 'stats' => 'Statistics', + 'update' => 'Update', + 'user_management' => 'Manage users', + 'user_profile' => 'Profile', + ), + 'title' => array( + '_' => 'Title', + 'authentication' => 'Authentication', + 'check_install' => 'Installation checking', + 'global_view' => 'Global view', + 'user_management' => 'Manage users', + 'user_profile' => 'Profile', + ), 'Apr' => '\\A\\p\\r\\i\\l', 'Aug' => '\\A\\u\\g\\u\\s\\t', 'Dec' => '\\D\\e\\c\\e\\m\\b\\e\\r', @@ -13,7 +43,6 @@ return array( 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', 'Oct' => '\\O\\c\\t\\o\\b\\e\\r', 'Sep' => '\\S\\e\\p\\t\\e\\m\\b\\e\\r', - 'about' => 'About', 'about_freshrss' => 'About FreshRSS', 'access_denied' => 'You don’t have permission to access this page', 'access_protected_feeds' => 'Connection allows to access HTTP protected RSS feeds', @@ -33,7 +62,6 @@ return array( 'api_enabled' => 'Allow API access (required for mobile apps)', 'apr' => 'apr', 'april' => 'Apr', - 'archiving_configuration' => 'Archiving', 'archiving_configuration_help' => 'More options are available in the individual stream settings', 'article' => 'Article', 'article_icons' => 'Article icons', @@ -110,7 +138,6 @@ return array( 'choose_language' => 'Choose a language for FreshRSS', 'clear_logs' => 'Clear the logs', 'collapse_article' => 'Collapse', - 'configuration' => 'Configuration', 'configuration_updated' => 'Configuration has been updated', 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', @@ -136,7 +163,6 @@ return array( 'delete' => 'Delete', 'delete_articles_every' => 'Remove articles after', 'diaspora' => 'Diaspora*', - 'display' => 'Display', 'display_articles_unfolded' => 'Show articles unfolded by default', 'display_categories_unfolded' => 'Show categories folded by default', 'display_configuration' => 'Display', @@ -191,21 +217,6 @@ return array( 'freshrss_installation' => 'Installation · FreshRSS', 'fri' => 'Fri', 'g+' => 'Google+', - 'menu' => array( - 'admin' => 'Administration', - 'authentication' => 'Authentication', - 'check_install' => 'Installation checking', - 'user_management' => 'Manage users', - 'user_profile' => 'Profile', - ), - 'title' => array( - '_' => 'Title', - 'authentication' => 'Authentication', - 'check_install' => 'Installation checking', - 'global_view' => 'Global view', - 'user_management' => 'Manage users', - 'user_profile' => 'Profile', - ), 'general_conf_is_ok' => 'General configuration has been saved.', 'general_configuration' => 'General configuration', 'github_or_email' => 'on Github or by mail', @@ -256,13 +267,10 @@ return array( 'license' => 'License', 'load_more' => 'Load more articles', 'log_is_ok' => 'Permissions on logs directory are good', - 'login' => 'Login', 'login_configuration' => 'Login', 'login_persona_problem' => 'Connection problem with Persona?', 'login_required' => 'Login required:', 'login_with_persona' => 'Login with Persona', - 'logout' => 'Logout', - 'logs' => 'Logs', 'logs_empty' => 'Log file is empty', 'main_stream' => 'Main stream', 'mar' => 'mar', @@ -340,7 +348,6 @@ return array( 'publication_date' => 'Date of publication', 'purge_completed' => 'Purge completed (%d articles deleted)', 'purge_now' => 'Purge now', - 'queries' => 'User queries', 'query_created' => 'Query "%s" has been created.', 'query_deprecated' => 'This query is no longer valid. The referenced category or feed has been deleted.', 'query_filter' => 'Filter applied:', @@ -370,7 +377,6 @@ return array( 'query_state_15' => 'Display all articles', 'random_string' => 'Random string', 'reader_view' => 'Reading view', - 'reading_configuration' => 'Reading', 'reading_confirm' => 'Display a confirmation dialog on “mark all as read” actions', 'refresh' => 'Refresh', 'related_tags' => 'Related tags', @@ -392,10 +398,8 @@ return array( 'share' => 'Share', 'share_name' => 'Share name to display', 'share_url' => 'Share URL to use', - 'sharing' => 'Sharing', 'sharing_management' => 'Sharing options management', 'shift_for_all_read' => '+ shift to mark all articles as read', - 'shortcuts' => 'Shortcuts', 'shortcuts_article_action' => 'Article actions', 'shortcuts_navigation' => 'Navigation', 'shortcuts_navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.
    With the "Alt" modifier, navigation shortcuts apply on categories.', @@ -410,7 +414,6 @@ return array( 'show_read' => 'Show only read', 'sort_order' => 'Sort order', 'starred_list' => 'List of favourite articles', - 'stats' => 'Statistics', 'stats_entry_count' => 'Entry count', 'stats_entry_per_category' => 'Entries per category', 'stats_entry_per_day' => 'Entries per day (last 30 days)', @@ -445,7 +448,6 @@ return array( 'tue' => 'Tue', 'twitter' => 'Twitter', 'unsafe_autologin' => 'Allow unsafe automatic login using the format: ', - 'update' => 'Update', 'update_apply' => 'Apply', 'update_can_apply' => 'An update is available.', 'update_check' => 'Check for new updates', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index 0b2395bd0..b33dc49bc 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -1,6 +1,36 @@ array( + 'login' => 'Connexion', + 'logout' => 'Déconnexion', + ), + 'menu' => array( + 'about' => 'À propos', + 'admin' => 'Administration', + 'archiving' => 'Archivage', + 'authentication' => 'Authentification', + 'check_install' => 'Vérification de l’installation', + 'configuration' => 'Configuration', + 'display' => 'Affichage', + 'logs' => 'Logs', + 'queries' => 'Filtres utilisateurs', + 'reading' => 'Lecture', + 'sharing' => 'Partage', + 'shortcuts' => 'Raccourcis', + 'stats' => 'Statistiques', + 'update' => 'Mise à jour', + 'user_management' => 'Gestion des utilisateurs', + 'user_profile' => 'Profil', + ), + 'title' => array( + '_' => 'Titre', + 'authentication' => 'Authentification', + 'check_install' => 'Vérification de l’installation', + 'global_view' => 'Vue globale', + 'user_management' => 'Gestion des utilisateurs', + 'user_profile' => 'Profil', + ), 'Apr' => '\\a\\v\\r\\i\\l', 'Aug' => '\\a\\o\\û\\t', 'Dec' => '\\d\\é\\c\\e\\m\\b\\r\\e', @@ -13,7 +43,6 @@ return array( 'Nov' => '\\n\\o\\v\\e\\m\\b\\r\\e', 'Oct' => '\\o\\c\\t\\o\\b\\r\\e', 'Sep' => '\\s\\e\\p\\t\\e\\m\\b\\r\\e', - 'about' => 'À propos', 'about_freshrss' => 'À propos de FreshRSS', 'access_denied' => 'Vous n’avez pas le droit d’accéder à cette page !', 'access_protected_feeds' => 'La connexion permet d’accéder aux flux protégés par une authentification HTTP.', @@ -33,7 +62,6 @@ return array( 'api_enabled' => 'Autoriser l’accès par API (nécessaire pour les applis mobiles)', 'apr' => 'avr.', 'april' => 'avril', - 'archiving_configuration' => 'Archivage', 'archiving_configuration_help' => 'D’autres options sont disponibles dans la configuration individuelle des flux.', 'article' => 'Article', 'article_icons' => 'Icônes d’article', @@ -110,7 +138,6 @@ return array( 'choose_language' => 'Choisissez la langue pour FreshRSS', 'clear_logs' => 'Effacer les logs', 'collapse_article' => 'Refermer', - 'configuration' => 'Configuration', 'configuration_updated' => 'La configuration a été mise à jour.', 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', @@ -139,7 +166,6 @@ return array( 'display' => 'Affichage', 'display_articles_unfolded' => 'Afficher les articles dépliés par défaut', 'display_categories_unfolded' => 'Afficher les catégories pliées par défaut', - 'display_configuration' => 'Affichage', 'do_not_change_if_doubt' => 'Laissez tel quel dans le doute', 'dom_is_nok' => 'Il manque une librairie pour parcourir le DOM (paquet php-xml)', 'dom_is_ok' => 'Vous disposez du nécessaire pour parcourir le DOM', @@ -191,21 +217,6 @@ return array( 'freshrss_installation' => 'Installation · FreshRSS', 'fri' => 'ven.', 'g+' => 'Google+', - 'menu' => array( - 'admin' => 'Administration', - 'authentication' => 'Authentification', - 'check_install' => 'Vérification de l’installation', - 'user_management' => 'Gestion des utilisateurs', - 'user_profile' => 'Profil', - ), - 'title' => array( - '_' => 'Titre', - 'authentication' => 'Authentification', - 'check_install' => 'Vérification de l’installation', - 'global_view' => 'Vue globale', - 'user_management' => 'Gestion des utilisateurs', - 'user_profile' => 'Profil', - ), 'general_conf_is_ok' => 'La configuration générale a été enregistrée.', 'general_configuration' => 'Configuration générale', 'github_or_email' => 'sur Github ou par courriel', @@ -256,13 +267,10 @@ return array( 'license' => 'Licence', 'load_more' => 'Charger plus d’articles', 'log_is_ok' => 'Les droits sur le répertoire des logs sont bons', - 'login' => 'Connexion', 'login_configuration' => 'Identification', 'login_persona_problem' => 'Problème de connexion à Persona ?', 'login_required' => 'Accès protégé par mot de passe :', 'login_with_persona' => 'Connexion avec Persona', - 'logout' => 'Déconnexion', - 'logs' => 'Logs', 'logs_empty' => 'Les logs sont vides.', 'main_stream' => 'Flux principal', 'mar' => 'mar.', @@ -340,7 +348,6 @@ return array( 'publication_date' => 'Date de publication', 'purge_completed' => 'Purge effectuée (%d articles supprimés).', 'purge_now' => 'Purger maintenant', - 'queries' => 'Filtres utilisateurs', 'query_created' => 'Le filtre "%s" a bien été créé.', 'query_deprecated' => 'Ce filtre n’est plus valide. La catégorie ou le flux concerné a été supprimé.', 'query_filter' => 'Filtres appliqués :', @@ -370,7 +377,6 @@ return array( 'query_state_15' => 'Afficher tous les articles', 'random_string' => 'Chaîne aléatoire', 'reader_view' => 'Vue lecture', - 'reading_configuration' => 'Lecture', 'reading_confirm' => 'Afficher une confirmation lors des actions “marquer tout comme lu”', 'refresh' => 'Actualisation', 'related_tags' => 'Tags associés', @@ -392,10 +398,8 @@ return array( 'share' => 'Partager', 'share_name' => 'Nom du partage à afficher', 'share_url' => 'URL du partage à utiliser', - 'sharing' => 'Partage', 'sharing_management' => 'Gestion des options de partage', 'shift_for_all_read' => '+ shift pour marquer tous les articles comme lus', - 'shortcuts' => 'Raccourcis', 'shortcuts_article_action' => 'Actions associées à l’article courant', 'shortcuts_navigation' => 'Navigation', 'shortcuts_navigation_help' => 'Avec le modificateur "Shift", les raccourcis de navigation s’appliquent aux flux.
    Avec le modificateur "Alt", les raccourcis de navigation s’appliquent aux catégories.', @@ -410,7 +414,6 @@ return array( 'show_read' => 'Afficher les lus', 'sort_order' => 'Ordre de tri', 'starred_list' => 'Liste des articles favoris', - 'stats' => 'Statistiques', 'stats_entry_count' => 'Nombre d’articles', 'stats_entry_per_category' => 'Articles par catégorie', 'stats_entry_per_day' => 'Nombre d’articles par jour (30 derniers jours)', @@ -445,7 +448,6 @@ return array( 'tue' => 'mar.', 'twitter' => 'Twitter', 'unsafe_autologin' => 'Autoriser les connexions automatiques non-sûres au format : ', - 'update' => 'Mise à jour', 'update_apply' => 'Appliquer la mise à jour', 'update_can_apply' => 'Une mise à jour est disponible.', 'update_check' => 'Vérifier les mises à jour', diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 53c52d3e3..25b8037e6 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,22 +1,22 @@ diff --git a/app/layout/header.phtml b/app/layout/header.phtml index c73d9cdbb..429cfc1d2 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -2,9 +2,9 @@ if (Minz_Configuration::canLogIn()) { ?>" method="get">
    - + @@ -55,13 +55,13 @@ if (Minz_Configuration::canLogIn()) {
    - +
    -- cgit v1.2.3 From 81dac9975d0c662467cc2625154da2568457e3dd Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 14 Jan 2015 23:47:06 +0100 Subject: Fix aside_configure for extension/configure action --- app/layout/aside_configure.phtml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/layout/aside_configure.phtml') diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 2d4cb9cad..7567a8206 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -22,8 +22,7 @@ Minz_Request::actionName() === 'profile'? ' active' : ''; ?>"> -
  • +
  • -- cgit v1.2.3