aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-10-03 06:29:55 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-10-03 13:31:48 +0200
commit0a878469d4038c36c84d1dd707265d880fa342e8 (patch)
tree2e183d359d3f1f0767ebf56277f3fc7aa415ac3f /src/Wallabag/UserBundle
parent1210dae10589515d6f3824c75639342c5e1d52dd (diff)
downloadwallabag-0a878469d4038c36c84d1dd707265d880fa342e8.tar.gz
wallabag-0a878469d4038c36c84d1dd707265d880fa342e8.tar.zst
wallabag-0a878469d4038c36c84d1dd707265d880fa342e8.zip
move some files to UserBundle
Diffstat (limited to 'src/Wallabag/UserBundle')
-rw-r--r--src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php50
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Default/index.html.twig1
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register.html.twig32
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig14
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Security/checkEmail.html.twig27
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Security/forgotPassword.html.twig59
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Security/login.html.twig69
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Security/reset.html.twig57
-rw-r--r--src/Wallabag/UserBundle/WallabagUserBundle.php4
9 files changed, 312 insertions, 1 deletions
diff --git a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php
new file mode 100644
index 00000000..d48855da
--- /dev/null
+++ b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php
@@ -0,0 +1,50 @@
1<?php
2
3namespace Wallabag\UserBundle\DataFixtures\ORM;
4
5use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\UserBundle\Entity\User;
9
10class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $userAdmin = new User();
18 $userAdmin->setName('Big boss');
19 $userAdmin->setEmail('bigboss@wallabag.org');
20 $userAdmin->setUsername('admin');
21 $userAdmin->setPlainPassword('mypassword');
22 $userAdmin->setEnabled(true);
23 $userAdmin->addRole('ROLE_SUPER_ADMIN');
24
25 $manager->persist($userAdmin);
26
27 $this->addReference('admin-user', $userAdmin);
28
29 $bobUser = new User();
30 $bobUser->setName('Bobby');
31 $bobUser->setEmail('bobby@wallabag.org');
32 $bobUser->setUsername('bob');
33 $bobUser->setPlainPassword('mypassword');
34 $bobUser->setEnabled(true);
35
36 $manager->persist($bobUser);
37
38 $this->addReference('bob-user', $bobUser);
39
40 $manager->flush();
41 }
42
43 /**
44 * {@inheritdoc}
45 */
46 public function getOrder()
47 {
48 return 10;
49 }
50}
diff --git a/src/Wallabag/UserBundle/Resources/views/Default/index.html.twig b/src/Wallabag/UserBundle/Resources/views/Default/index.html.twig
deleted file mode 100644
index 4ce626e9..00000000
--- a/src/Wallabag/UserBundle/Resources/views/Default/index.html.twig
+++ /dev/null
@@ -1 +0,0 @@
1Hello {{ name }}!
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register.html.twig
new file mode 100644
index 00000000..d765c851
--- /dev/null
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register.html.twig
@@ -0,0 +1,32 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{% trans %}create an account{% endtrans %}{% endblock %}
4
5{% block body_class %}register{% endblock %}
6
7{% block menu %}{% endblock %}
8{% block messages %}{% endblock %}
9
10{% block content %}
11<main class="valign-wrapper">
12 <div class="valign row">
13 <div class="card sw">
14 <div class="center"><img src="{{ asset('themes/baggy/img/logo-other_themes.png') }}" alt="wallabag logo" /></div>
15
16 {% include "FOSUserBundle:Registration:register_content.html.twig" %}
17
18 </div>
19 <div class="center">
20 <a href="{{ path('fos_user_security_login') }}">{% trans %}Already have an account?{% endtrans %}</a>
21 </div>
22 </div>
23</main>
24 <style>
25 main {
26 padding: 0;
27 }
28 </style>
29{% endblock %}
30
31{% block footer %}
32{% endblock %}
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig
new file mode 100644
index 00000000..26a91433
--- /dev/null
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig
@@ -0,0 +1,14 @@
1{% trans_default_domain 'FOSUserBundle' %}
2
3<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="fos_user_registration_register">
4 <div class="card-content">
5 {{ form_widget(form) }}
6 <input type="submit" value="{{ 'registration.submit'|trans }}" />
7 </div>
8 <div class="card-action">
9 <button class="btn waves-effect waves-light" type="submit" name="send">
10 {% trans %}Create account{% endtrans %}
11 <i class="mdi-content-send right"></i>
12 </button>
13 </div>
14</form>
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/checkEmail.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/checkEmail.html.twig
new file mode 100644
index 00000000..8f698e17
--- /dev/null
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/checkEmail.html.twig
@@ -0,0 +1,27 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{% trans %}Forgot password{% endtrans %}{% endblock %}
4
5{% block body_class %}login{% endblock %}
6
7{% block menu %}{% endblock %}
8
9{% block content %}
10 <main class="valign-wrapper">
11 <div class="valign row">
12 <h1>{% trans %}Forgot password{% endtrans %}</h1>
13 <div class="card sw">
14 <div class="card-content">
15 <span class="card-title black-text">
16 <p>{{ 'An email has been sent to %email%. It contains a link you must click to reset your password.'|trans({'%email%': email}) }}</p>
17 </span>
18 </div>
19 </div>
20 </div>
21 </main>
22 <style>
23 main {
24 padding: 0;
25 }
26 </style>
27{% endblock %}
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/forgotPassword.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/forgotPassword.html.twig
new file mode 100644
index 00000000..9750f8ba
--- /dev/null
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/forgotPassword.html.twig
@@ -0,0 +1,59 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{% trans %}Forgot password{% endtrans %}{% endblock %}
4
5{% block body_class %}login{% endblock %}
6
7{% block menu %}{% endblock %}
8
9{% block content %}
10 <main class="valign-wrapper">
11 <div class="valign row">
12 <h1>{% trans %}Forgot password{% endtrans %}</h1>
13 <div class="card sw">
14 <form action="{{ path('forgot_password') }}" method="post" name="forgotPasswordform">
15 <div class="card-content">
16
17 <span class="card-title black-text"><p>{% trans %}Enter your email address below and we'll send you password reset instructions.{% endtrans %}</p></span>
18
19 {% if form_errors(form) %}
20 <span class="black-text">{{ form_errors(form) }}</span>
21 {% endif %}
22
23 {% for flashMessage in app.session.flashbag.get('notice') %}
24 <span class="black-text"><p>{{ flashMessage }}</p></span>
25 {% endfor %}
26
27 {% if form_errors(form.email) %}
28 <span class="black-text">{{ form_errors(form.email) }}</span>
29 {% endif %}
30
31 <div class="input-field s12">
32 {{ form_label(form.email) }}
33 {{ form_widget(form.email) }}
34 </div>
35
36 </div>
37 <div class="card-action">
38 <button class="btn waves-effect waves-light" type="submit" name="send">
39 {% trans %}Send{% endtrans %}
40 <i class="mdi-content-send right"></i>
41 </button>
42 </div>
43 {{ form_rest(form) }}
44 </form>
45 </div>
46 <div class="center">
47 <a href="{{ path('login') }}">{% trans %}Back to login{% endtrans %}</a>
48 </div>
49 </div>
50 </main>
51 <style>
52 main {
53 padding: 0;
54 }
55 </style>
56{% endblock %}
57
58{% block footer %}
59{% endblock %}
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/login.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/login.html.twig
new file mode 100644
index 00000000..e9532037
--- /dev/null
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/login.html.twig
@@ -0,0 +1,69 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{% trans %}login to your wallabag{% endtrans %}{% endblock %}
4
5{% block body_class %}login{% endblock %}
6
7{% block menu %}{% endblock %}
8{% block messages %}{% endblock %}
9
10{% block content %}
11 <main class="valign-wrapper">
12 <div class="valign row">
13 <div class="card sw">
14 <div class="center"><img src="{{ asset('themes/baggy/img/logo-other_themes.png') }}" alt="wallabag logo" /></div>
15 <form action="{{ path('fos_user_security_check') }}" method="post" name="loginform">
16 <div class="card-content">
17
18 {% if error %}
19 <span class="black-text">{{ error.message }}</span>
20 {% endif %}
21
22 {% for flashMessage in app.session.flashbag.get('notice') %}
23 <span class="black-text"><p>{{ flashMessage }}</p></span>
24 {% endfor %}
25
26 <div class="row">
27
28 <div class="input-field col s12">
29 <label for="username">{% trans %}Username{% endtrans %}</label>
30 <input type="text" id="username" name="_username" value="{{ last_username }}" />
31 </div>
32
33 <div class="input-field col s12">
34 <label for="password">{% trans %}Password{% endtrans %}</label>
35 <input type="password" id="password" name="_password" />
36 </div>
37
38 <div class="input-field col s12">
39 <input type="checkbox" id="remember_me" name="_remember_me" checked />
40 <label for="remember_me">{% trans %}Keep me logged in{% endtrans %}</label>
41 </div>
42
43 </div>
44
45 </div>
46 <div class="card-action">
47 <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
48 <button class="btn waves-effect waves-light" type="submit" name="send">
49 {% trans %}Login{% endtrans %}
50 <i class="mdi-content-send right"></i>
51 </button>
52 <a href="{{ path('fos_user_registration_register') }}">{% trans %}Register{% endtrans %}</a>
53 </div>
54 </form>
55 </div>
56 <div class="center">
57 <a href="{{ path('fos_user_resetting_request') }}">{% trans %}Forgot your password?{% endtrans %}</a>
58 </div>
59 </div>
60 </main>
61 <style>
62 main {
63 padding: 0;
64 }
65 </style>
66{% endblock %}
67
68{% block footer %}
69{% endblock %}
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/reset.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/reset.html.twig
new file mode 100644
index 00000000..09d0b634
--- /dev/null
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/reset.html.twig
@@ -0,0 +1,57 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{% trans %}Change password{% endtrans %}{% endblock %}
4
5{% block body_class %}login{% endblock %}
6
7{% block menu %}{% endblock %}
8
9{% block content %}
10 <main class="valign-wrapper">
11 <div class="valign row">
12 <div class="card sw">
13 <form action="{{ path('forgot_password_reset', {'token': token}) }}" method="post" name="loginform">
14 <div class="card-content">
15
16 <span class="card-title black-text"><p>{% trans %}Change password{% endtrans %}</p></span>
17
18 {% if form_errors(form) %}
19 <span class="black-text">{{ form_errors(form) }}</span>
20 {% endif %}
21
22 {% if form_errors(form.new_password.first) %}
23 <span class="black-text">{{ form_errors(form.new_password.first) }}</span>
24 {% endif %}
25
26 {% if form_errors(form.new_password.second) %}
27 <span class="black-text">{{ form_errors(form.new_password.second) }}</span>
28 {% endif %}
29
30 <div class="input-field s12">
31 {{ form_label(form.new_password.first) }}
32 {{ form_widget(form.new_password.first) }}
33 </div>
34
35 <div class="input-field s12">
36 {{ form_label(form.new_password.second) }}
37 {{ form_widget(form.new_password.second) }}
38 </div>
39
40 </div>
41 <div class="card-action">
42 <button class="btn waves-effect waves-light" type="submit" name="send">
43 {% trans %}Change password{% endtrans %}
44 <i class="mdi-content-send right"></i>
45 </button>
46 </div>
47 {{ form_rest(form) }}
48 </form>
49 </div>
50 </div>
51 </main>
52 <style>
53 main {
54 padding: 0;
55 }
56 </style>
57{% endblock %}
diff --git a/src/Wallabag/UserBundle/WallabagUserBundle.php b/src/Wallabag/UserBundle/WallabagUserBundle.php
index e6e65042..d9180b3b 100644
--- a/src/Wallabag/UserBundle/WallabagUserBundle.php
+++ b/src/Wallabag/UserBundle/WallabagUserBundle.php
@@ -6,4 +6,8 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
6 6
7class WallabagUserBundle extends Bundle 7class WallabagUserBundle extends Bundle
8{ 8{
9 public function getParent()
10 {
11 return 'FOSUserBundle';
12 }
9} 13}