Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
593bd46
Lecture notes
aurelijusb Nov 18, 2019
0152cd7
Pridedame Secrurity biblioteką
aurelijusb Nov 16, 2019
625cdd8
Pridedam profiler biblioteką puslapio informacijos juostai
aurelijusb Nov 16, 2019
21d859f
Susikuriame naudotojo klasę
aurelijusb Nov 16, 2019
afdfc52
Atnaujiname duomenų bazę
aurelijusb Nov 16, 2019
c9268ff
Prisidedame Validator biblioteką
aurelijusb Nov 16, 2019
d96afc5
Susikuriame registracijos formą
aurelijusb Nov 16, 2019
596e02f
Sugeneruojame prisjungimo formos pavyzdį
aurelijusb Nov 17, 2019
286af37
Pataisome nukreipimą po prisijungimo
aurelijusb May 6, 2019
c070a4d
Naudotojo objekto pasiekimas iš Twig
aurelijusb May 6, 2019
5dd1159
Naudotojo objekto pasiekimas iš Controller'io
aurelijusb May 6, 2019
8692fe5
Pridedame EasyAdminBundle biblioteką (receptą)
aurelijusb Nov 17, 2019
f86df09
Pataisome EasyAdmin konfiguraciją
aurelijusb May 6, 2019
8481cc1
Apribojame Administavimą tik registruotiems naudotojams
aurelijusb May 6, 2019
d88aba2
Sukuriam Console's komandą
aurelijusb Nov 17, 2019
85b23ab
Įgyvendinam komandą rolei pakelti
aurelijusb May 6, 2019
e454761
Praplečiame TwigBundle klaidų šabloną
aurelijusb May 6, 2019
7bffea5
Praplečiame EasyAdmin šabloną: Surandame originalų šabloną
aurelijusb May 6, 2019
ed87245
Praplečiame EasyAdmin šabloną: pakeičiam turinį
aurelijusb Nov 17, 2019
b2d5310
Praplečiame EasyAdmin nustatymus: laukų atvaizdavimas
aurelijusb May 6, 2019
396fe97
Registracijos dizainas per konfiguraciją
aurelijusb May 6, 2019
8cdc190
Naujų laukų pridėjimas: Papildome Entity (duomenų modelį)
aurelijusb May 6, 2019
5c6750d
Naujų laukų pridėjimas: Atnaujiname duomenų bazę
aurelijusb Nov 18, 2019
a1394b8
Naujų laukų pridėjimas: Papildome formas ir kitus dizaino elementus
aurelijusb May 6, 2019
80fc826
Po registracijos naudotoją prijungiame automatiškai
aurelijusb May 6, 2019
9bace70
Patogumui: Pataisome redagavimą nenurodant slaptažodžio
aurelijusb May 7, 2019
3f50864
Naujų laukų pridėjimas: Konfiguracija EasyAdminBundle
aurelijusb May 7, 2019
196ac1c
Sukuriame EventSubscriber pavyzdį
aurelijusb May 7, 2019
daf212c
Užregistruojame event'ą Symfony karkase
aurelijusb May 7, 2019
895fdea
Įgyvendiname: slaptažodžio pakeitimo datos laukelį
aurelijusb May 7, 2019
99089a5
Atnaujiname duomenų bazę
aurelijusb Nov 18, 2019
bce8013
done3
indruteok Nov 25, 2019
67d62ad
Solving merge conflicts: inde chanes to homework-2019-11-19
aurelijusb Dec 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
NFQ Akademija
============

# Medžiaga

Bus remiamasi: https://github.com/aurelijusb/kickstart/pull/140
Namų darbai: https://github.com/aurelijusb/kickstart/pull/162

# Intro

Sveiki! Tai yra Jūsų startinis projekto "template".
Expand Down
2 changes: 2 additions & 0 deletions config/packages/easy_admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ easy_admin:
- 'username'
- { property: 'roles', template: 'admin/user/roles-type-read.html.twig' }
- { property: 'homepage', type: 'url' }
- { property: 'linkedin', type: 'url' }
- { property: 'password', template: 'admin/user/password-read.html.twig' }
form:
fields:
- { property: 'email', type: 'email' }
- { property: 'roles', type: 'collection' }
- { property: 'plainPassword', type: 'password' }
- { property: 'linkedin', type: 'url' }
- { property: 'homepage', type: 'url' }

user:
Expand Down
22 changes: 22 additions & 0 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ class User implements UserInterface
*/
private $password;

/**
* @var null|string Link to Personal linkedin
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $linkedin = "";

/**
* @return string|null
*/
public function getLinkedin(): ?string
{
return $this->linkedin;
}

/**
* @param string|null $linkedin
*/
public function setLinkedin(?string $linkedin): void
{
$this->linkedin = $linkedin;
}

/**
* @var null|\DateTime When password was changed
* @ORM\Column(type="datetime", nullable=true)
Expand Down
1 change: 1 addition & 0 deletions src/Form/RegistrationFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
],
])
->add('homepage', UrlType::class, ['required' => false])
->add('linkedin', UrlType::class, ['required' => false])
->add('agreeTerms', CheckboxType::class, [
'mapped' => false,
'constraints' => [
Expand Down
35 changes: 35 additions & 0 deletions src/Migrations/Version20191125191917.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20191125191917 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE user ADD linkedin VARCHAR(255) DEFAULT NULL, CHANGE roles roles JSON NOT NULL, CHANGE homepage homepage VARCHAR(255) DEFAULT NULL, CHANGE password_changed password_changed DATETIME DEFAULT NULL');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE user DROP linkedin, CHANGE roles roles LONGTEXT NOT NULL COLLATE utf8mb4_bin, CHANGE password_changed password_changed DATETIME DEFAULT \'NULL\', CHANGE homepage homepage VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
9 changes: 5 additions & 4 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
<li class="nav-item">
<a class="nav-link" href="{{ path('app_logout') }}">Atsijungti</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ path('easyadmin') }}">Administravimas</a>
</li>

{% if is_granted('ROLE_ADMIN') %}
<li class="nav-item">
<a class="nav-link" href="{{ path('easyadmin') }}">Administravimas</a>
</li>
{% endif %}
{% else %}

<li class="nav-item">
Expand Down
1 change: 1 addition & 0 deletions templates/registration/register.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{{ form_start(registrationForm) }}
{{ form_row(registrationForm.email) }}
{{ form_row(registrationForm.plainPassword) }}
{{ form_row(registrationForm.linkedin) }}
{{ form_row(registrationForm.homepage) }}
{{ form_row(registrationForm.agreeTerms) }}

Expand Down
6 changes: 5 additions & 1 deletion templates/security/profile.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
<span class="badge badge-secondary">{{ role|lower }}</span>
{% endfor %}
<div class="mb-2">
<span class="badge badge-primary">Website</span> <a href="{{ user.homepage }}"></a>{{ user.homepage }}
<span class="badge badge-primary">LinkedIn</span> <a href="{{ user.linkedin}}">{{ user.linkedin }}</a>
</div>
<div class="mb-2">
<span class="badge badge-primary">Website</span> <a href="{{ user.homepage }}">{{ user.homepage }}</a>
</div>
</div>

{% endblock %}