mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-07 07:58:48 +00:00
Merge pull request #2663 from wallabag/remove-fosuser-attributes
Removed FOSUser attributes removed in alpha4
This commit is contained in:
commit
34ea7be622
17 changed files with 62 additions and 28 deletions
61
app/DoctrineMigrations/Version20161128131503.php
Normal file
61
app/DoctrineMigrations/Version20161128131503.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'Emailadresse'
|
email_label: 'Emailadresse'
|
||||||
# enabled_label: 'Enabled'
|
# enabled_label: 'Enabled'
|
||||||
# locked_label: 'Locked'
|
|
||||||
# last_login_label: 'Last login'
|
# last_login_label: 'Last login'
|
||||||
# twofactor_label: Two factor authentication
|
# twofactor_label: Two factor authentication
|
||||||
# save: Save
|
# save: Save
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'E-Mail-Adresse'
|
email_label: 'E-Mail-Adresse'
|
||||||
enabled_label: 'Aktiviert'
|
enabled_label: 'Aktiviert'
|
||||||
locked_label: 'Gesperrt'
|
|
||||||
last_login_label: 'Letzter Login'
|
last_login_label: 'Letzter Login'
|
||||||
twofactor_label: Zwei-Faktor-Authentifizierung
|
twofactor_label: Zwei-Faktor-Authentifizierung
|
||||||
save: Speichern
|
save: Speichern
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'Email'
|
email_label: 'Email'
|
||||||
enabled_label: 'Enabled'
|
enabled_label: 'Enabled'
|
||||||
locked_label: 'Locked'
|
|
||||||
last_login_label: 'Last login'
|
last_login_label: 'Last login'
|
||||||
twofactor_label: Two factor authentication
|
twofactor_label: Two factor authentication
|
||||||
save: Save
|
save: Save
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'Email'
|
email_label: 'Email'
|
||||||
# enabled_label: 'Enabled'
|
# enabled_label: 'Enabled'
|
||||||
# locked_label: 'Locked'
|
|
||||||
# last_login_label: 'Last login'
|
# last_login_label: 'Last login'
|
||||||
# twofactor_label: Two factor authentication
|
# twofactor_label: Two factor authentication
|
||||||
# save: Save
|
# save: Save
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'نشانی ایمیل'
|
email_label: 'نشانی ایمیل'
|
||||||
# enabled_label: 'Enabled'
|
# enabled_label: 'Enabled'
|
||||||
# locked_label: 'Locked'
|
|
||||||
# last_login_label: 'Last login'
|
# last_login_label: 'Last login'
|
||||||
# twofactor_label: Two factor authentication
|
# twofactor_label: Two factor authentication
|
||||||
# save: Save
|
# save: Save
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: "Mot de passe en clair"
|
plain_password_label: "Mot de passe en clair"
|
||||||
email_label: "Adresse courriel"
|
email_label: "Adresse courriel"
|
||||||
enabled_label: "Activé"
|
enabled_label: "Activé"
|
||||||
locked_label: "Bloqué"
|
|
||||||
last_login_label: "Dernière connexion"
|
last_login_label: "Dernière connexion"
|
||||||
twofactor_label: "Double authentification"
|
twofactor_label: "Double authentification"
|
||||||
save: "Sauvegarder"
|
save: "Sauvegarder"
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'E-mail'
|
email_label: 'E-mail'
|
||||||
# enabled_label: 'Enabled'
|
# enabled_label: 'Enabled'
|
||||||
# locked_label: 'Locked'
|
|
||||||
# last_login_label: 'Last login'
|
# last_login_label: 'Last login'
|
||||||
# twofactor_label: Two factor authentication
|
# twofactor_label: Two factor authentication
|
||||||
# save: Save
|
# save: Save
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: 'Senhal en clar'
|
plain_password_label: 'Senhal en clar'
|
||||||
email_label: 'Adreça de corrièl'
|
email_label: 'Adreça de corrièl'
|
||||||
enabled_label: 'Actiu'
|
enabled_label: 'Actiu'
|
||||||
locked_label: 'Varrolhat'
|
|
||||||
last_login_label: 'Darrièra connexion'
|
last_login_label: 'Darrièra connexion'
|
||||||
twofactor_label: 'Autentificacion doble-factor'
|
twofactor_label: 'Autentificacion doble-factor'
|
||||||
save: 'Enregistrar'
|
save: 'Enregistrar'
|
||||||
|
|
|
@ -315,7 +315,7 @@ howto:
|
||||||
toggle_favorite: Oznacz wpis gwiazdką
|
toggle_favorite: Oznacz wpis gwiazdką
|
||||||
toggle_archive: Oznacz wpis jako przeczytany
|
toggle_archive: Oznacz wpis jako przeczytany
|
||||||
delete: Usuń wpis
|
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
|
add_link: Dodaj nowy link
|
||||||
hide_form: Ukryj obecny formularz (wyszukiwania lub nowego linku)
|
hide_form: Ukryj obecny formularz (wyszukiwania lub nowego linku)
|
||||||
arrows_navigation: Nawiguj pomiędzy artykułami
|
arrows_navigation: Nawiguj pomiędzy artykułami
|
||||||
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: 'Jawne hasło'
|
plain_password_label: 'Jawne hasło'
|
||||||
email_label: 'Adres email'
|
email_label: 'Adres email'
|
||||||
enabled_label: 'Włączony'
|
enabled_label: 'Włączony'
|
||||||
locked_label: 'Zablokowany'
|
|
||||||
last_login_label: 'Ostatnie logowanie'
|
last_login_label: 'Ostatnie logowanie'
|
||||||
twofactor_label: Autoryzacja dwuetapowa
|
twofactor_label: Autoryzacja dwuetapowa
|
||||||
save: Zapisz
|
save: Zapisz
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'E-mail'
|
email_label: 'E-mail'
|
||||||
enabled_label: 'Habilitado'
|
enabled_label: 'Habilitado'
|
||||||
locked_label: 'Travado'
|
|
||||||
last_login_label: 'Último login'
|
last_login_label: 'Último login'
|
||||||
twofactor_label: 'Autenticação de dois passos'
|
twofactor_label: 'Autenticação de dois passos'
|
||||||
save: 'Salvar'
|
save: 'Salvar'
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'E-mail'
|
email_label: 'E-mail'
|
||||||
# enabled_label: 'Enabled'
|
# enabled_label: 'Enabled'
|
||||||
# locked_label: 'Locked'
|
|
||||||
# last_login_label: 'Last login'
|
# last_login_label: 'Last login'
|
||||||
# twofactor_label: Two factor authentication
|
# twofactor_label: Two factor authentication
|
||||||
# save: Save
|
# save: Save
|
||||||
|
|
|
@ -503,7 +503,6 @@ user:
|
||||||
plain_password_label: '????'
|
plain_password_label: '????'
|
||||||
email_label: 'E-posta'
|
email_label: 'E-posta'
|
||||||
# enabled_label: 'Enabled'
|
# enabled_label: 'Enabled'
|
||||||
# locked_label: 'Locked'
|
|
||||||
# last_login_label: 'Last login'
|
# last_login_label: 'Last login'
|
||||||
# twofactor_label: Two factor authentication
|
# twofactor_label: Two factor authentication
|
||||||
# save: Save
|
# save: Save
|
||||||
|
|
|
@ -35,10 +35,6 @@ class UserType extends AbstractType
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => 'user.form.enabled_label',
|
'label' => 'user.form.enabled_label',
|
||||||
])
|
])
|
||||||
->add('locked', CheckboxType::class, [
|
|
||||||
'required' => false,
|
|
||||||
'label' => 'user.form.locked_label',
|
|
||||||
])
|
|
||||||
->add('twoFactorAuthentication', CheckboxType::class, [
|
->add('twoFactorAuthentication', CheckboxType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => 'user.form.twofactor_label',
|
'label' => 'user.form.twofactor_label',
|
||||||
|
|
|
@ -47,14 +47,6 @@
|
||||||
</div>
|
</div>
|
||||||
</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 %}
|
{% if twofactor_auth %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
<th>{{ 'user.form.username_label'|trans }}</th>
|
<th>{{ 'user.form.username_label'|trans }}</th>
|
||||||
<th>{{ 'user.form.email_label'|trans }}</th>
|
<th>{{ 'user.form.email_label'|trans }}</th>
|
||||||
<th>{{ 'user.form.last_login_label'|trans }}</th>
|
<th>{{ 'user.form.last_login_label'|trans }}</th>
|
||||||
<th>{{ 'user.form.locked_label'|trans }}</th>
|
|
||||||
<th>{{ 'user.list.actions'|trans }}</th>
|
<th>{{ 'user.list.actions'|trans }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
<td>{{ user.username }}</td>
|
<td>{{ user.username }}</td>
|
||||||
<td>{{ user.email }}</td>
|
<td>{{ user.email }}</td>
|
||||||
<td>{% if user.lastLogin %}{{ user.lastLogin|date('Y-m-d H:i:s') }}{% endif %}</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>
|
<td>
|
||||||
<a href="{{ path('user_edit', { 'id': user.id }) }}">{{ 'user.list.edit_action'|trans }}</a>
|
<a href="{{ path('user_edit', { 'id': user.id }) }}">{{ 'user.list.edit_action'|trans }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -49,7 +49,6 @@ class ManageControllerTest extends WallabagCoreTestCase
|
||||||
'user[username]' => 'test_user',
|
'user[username]' => 'test_user',
|
||||||
'user[email]' => 'test@test.io',
|
'user[email]' => 'test@test.io',
|
||||||
'user[enabled]' => true,
|
'user[enabled]' => true,
|
||||||
'user[locked]' => false,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
$client->submit($form);
|
$client->submit($form);
|
||||||
|
|
Loading…
Reference in a new issue