From: Nicolas Lœuillet Date: Mon, 28 Nov 2016 13:27:31 +0000 (+0100) Subject: Merge pull request #2663 from wallabag/remove-fosuser-attributes X-Git-Tag: 2.2.0~3^2~41 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=34ea7be6228c633ef8da703994eed034026e9c18;hp=6bb0866cf513bf939eb2e3290d1852c55e51ec0d;p=github%2Fwallabag%2Fwallabag.git Merge pull request #2663 from wallabag/remove-fosuser-attributes Removed FOSUser attributes removed in alpha4 --- diff --git a/app/DoctrineMigrations/Version20161128131503.php b/app/DoctrineMigrations/Version20161128131503.php new file mode 100644 index 00000000..f0e016c8 --- /dev/null +++ b/app/DoctrineMigrations/Version20161128131503.php @@ -0,0 +1,61 @@ + 'smallint', + 'credentials_expire_at' => 'datetime', + 'expires_at' => 'datetime', + ]; + + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $userTable = $schema->getTable($this->getTable('user')); + + foreach ($this->fields as $field => $type) { + $this->skipIf(!$userTable->hasColumn($field), 'It seems that you already played this migration.'); + $userTable->dropColumn($field); + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $userTable = $schema->getTable($this->getTable('user')); + + foreach ($this->fields as $field => $type) { + $this->skipIf($userTable->hasColumn($field), 'It seems that you already played this migration.'); + $userTable->addColumn($field, $type); + } + } +} diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 8a20cbe0..c9e21959 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'Emailadresse' # enabled_label: 'Enabled' - # locked_label: 'Locked' # last_login_label: 'Last login' # twofactor_label: Two factor authentication # save: Save diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 68e9c333..b84bd9d3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'E-Mail-Adresse' enabled_label: 'Aktiviert' - locked_label: 'Gesperrt' last_login_label: 'Letzter Login' twofactor_label: Zwei-Faktor-Authentifizierung save: Speichern diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 9e13ad0e..4b92fe97 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'Email' enabled_label: 'Enabled' - locked_label: 'Locked' last_login_label: 'Last login' twofactor_label: Two factor authentication save: Save diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index b8764876..02ce7e19 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'Email' # enabled_label: 'Enabled' - # locked_label: 'Locked' # last_login_label: 'Last login' # twofactor_label: Two factor authentication # save: Save diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index e1bfcade..99c0f71b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'نشانی ایمیل' # enabled_label: 'Enabled' - # locked_label: 'Locked' # last_login_label: 'Last login' # twofactor_label: Two factor authentication # save: Save diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 2e4f4f43..5579bf1f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -503,7 +503,6 @@ user: plain_password_label: "Mot de passe en clair" email_label: "Adresse courriel" enabled_label: "Activé" - locked_label: "Bloqué" last_login_label: "Dernière connexion" twofactor_label: "Double authentification" save: "Sauvegarder" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index d84f7dbf..92ccef68 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'E-mail' # enabled_label: 'Enabled' - # locked_label: 'Locked' # last_login_label: 'Last login' # twofactor_label: Two factor authentication # save: Save diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index f2215a07..9ef3b475 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -503,7 +503,6 @@ user: plain_password_label: 'Senhal en clar' email_label: 'Adreça de corrièl' enabled_label: 'Actiu' - locked_label: 'Varrolhat' last_login_label: 'Darrièra connexion' twofactor_label: 'Autentificacion doble-factor' save: 'Enregistrar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 9e6d3565..9e3726a5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -315,7 +315,7 @@ howto: toggle_favorite: Oznacz wpis gwiazdką toggle_archive: Oznacz wpis jako przeczytany delete: Usuń wpis - material_title: Skróty dostępne wyłącznie w motywie Material + material_title: Skróty dostępne wyłącznie w motywie Material add_link: Dodaj nowy link hide_form: Ukryj obecny formularz (wyszukiwania lub nowego linku) arrows_navigation: Nawiguj pomiędzy artykułami @@ -503,7 +503,6 @@ user: plain_password_label: 'Jawne hasło' email_label: 'Adres email' enabled_label: 'Włączony' - locked_label: 'Zablokowany' last_login_label: 'Ostatnie logowanie' twofactor_label: Autoryzacja dwuetapowa save: Zapisz diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 3dd6e7d8..abe51305 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'E-mail' enabled_label: 'Habilitado' - locked_label: 'Travado' last_login_label: 'Último login' twofactor_label: 'Autenticação de dois passos' save: 'Salvar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 0386c0b6..88780b54 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'E-mail' # enabled_label: 'Enabled' - # locked_label: 'Locked' # last_login_label: 'Last login' # twofactor_label: Two factor authentication # save: Save diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 74601f4e..db0a9bbf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -503,7 +503,6 @@ user: plain_password_label: '????' email_label: 'E-posta' # enabled_label: 'Enabled' - # locked_label: 'Locked' # last_login_label: 'Last login' # twofactor_label: Two factor authentication # save: Save diff --git a/src/Wallabag/UserBundle/Form/UserType.php b/src/Wallabag/UserBundle/Form/UserType.php index cfa67793..d8cdbaf9 100644 --- a/src/Wallabag/UserBundle/Form/UserType.php +++ b/src/Wallabag/UserBundle/Form/UserType.php @@ -35,10 +35,6 @@ class UserType extends AbstractType 'required' => false, 'label' => 'user.form.enabled_label', ]) - ->add('locked', CheckboxType::class, [ - 'required' => false, - 'label' => 'user.form.locked_label', - ]) ->add('twoFactorAuthentication', CheckboxType::class, [ 'required' => false, 'label' => 'user.form.twofactor_label', diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig b/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig index 67843f20..3ffd15f5 100644 --- a/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig @@ -47,14 +47,6 @@ -
-
- {{ form_widget(edit_form.locked) }} - {{ form_label(edit_form.locked) }} - {{ form_errors(edit_form.locked) }} -
-
- {% if twofactor_auth %}
diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig b/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig index 996bdb1a..daba29e4 100644 --- a/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig @@ -17,7 +17,6 @@ {{ 'user.form.username_label'|trans }} {{ 'user.form.email_label'|trans }} {{ 'user.form.last_login_label'|trans }} - {{ 'user.form.locked_label'|trans }} {{ 'user.list.actions'|trans }} @@ -27,7 +26,6 @@ {{ user.username }} {{ user.email }} {% if user.lastLogin %}{{ user.lastLogin|date('Y-m-d H:i:s') }}{% endif %} - {% if user.locked %}{{ 'user.list.yes'|trans }}{% else %}{{ 'user.list.no'|trans }}{% endif %} {{ 'user.list.edit_action'|trans }} diff --git a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php index 243a4459..4faddfc4 100644 --- a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php +++ b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php @@ -49,7 +49,6 @@ class ManageControllerTest extends WallabagCoreTestCase 'user[username]' => 'test_user', 'user[email]' => 'test@test.io', 'user[enabled]' => true, - 'user[locked]' => false, )); $client->submit($form);