Merge pull request #2663 from wallabag/remove-fosuser-attributes

Removed FOSUser attributes removed in alpha4
This commit is contained in:
Nicolas Lœuillet 2016-11-28 14:27:31 +01:00 committed by GitHub
commit 34ea7be622
17 changed files with 62 additions and 28 deletions

View file

@ -0,0 +1,61 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Removed locked, credentials_expire_at and expires_at.
*/
class Version20161128131503 extends AbstractMigration implements ContainerAwareInterface
{
private $fields = [
'locked' => '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);
}
}
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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'

View file

@ -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

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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',

View file

@ -47,14 +47,6 @@
</div>
</div>
<div class="row">
<div class="input-field col s12">
{{ form_widget(edit_form.locked) }}
{{ form_label(edit_form.locked) }}
{{ form_errors(edit_form.locked) }}
</div>
</div>
{% if twofactor_auth %}
<div class="row">
<div class="input-field col s12">

View file

@ -17,7 +17,6 @@
<th>{{ 'user.form.username_label'|trans }}</th>
<th>{{ 'user.form.email_label'|trans }}</th>
<th>{{ 'user.form.last_login_label'|trans }}</th>
<th>{{ 'user.form.locked_label'|trans }}</th>
<th>{{ 'user.list.actions'|trans }}</th>
</tr>
</thead>
@ -27,7 +26,6 @@
<td>{{ user.username }}</td>
<td>{{ user.email }}</td>
<td>{% if user.lastLogin %}{{ user.lastLogin|date('Y-m-d H:i:s') }}{% endif %}</td>
<td>{% if user.locked %}{{ 'user.list.yes'|trans }}{% else %}{{ 'user.list.no'|trans }}{% endif %}</td>
<td>
<a href="{{ path('user_edit', { 'id': user.id }) }}">{{ 'user.list.edit_action'|trans }}</a>
</td>

View file

@ -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);