diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index 5b8ed6f7ae..b82438cb0d 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -25,6 +25,7 @@ return call_user_func(function() { $app = new SilexApp(); $app['Core'] = \bootstrap::getCore(); + $app['debug'] = true; $app->register(new ValidatorServiceProvider()); diff --git a/lib/Alchemy/Phrasea/Controller/Root/Account.php b/lib/Alchemy/Phrasea/Controller/Root/Account.php index fd9c42b229..b1bc124a3e 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Account.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Account.php @@ -143,6 +143,54 @@ class Account implements ControllerProviderInterface $controllers->get('/access/', $this->call('accountAccess')) ->bind('account_access'); + /** + * Reset user email + * + * name : account_reset_email + * + * description : Reset User email + * + * method : GET + * + * parameters : none + * + * return : HTML Response + */ + $controllers->get('/register/', $this->call('registerAccount')) + ->bind('account_register'); + + /** + * Reset user email + * + * name : account_reset_email + * + * description : Reset User email + * + * method : GET + * + * parameters : none + * + * return : HTML Response + */ + $controllers->get('/reset-email/', $this->call('resetEmail')) + ->bind('account_reset_email'); + + /** + * Reset user password + * + * name : account_reset_password + * + * description : Reset user password + * + * method : GET + * + * parameters : none + * + * return : HTML Response + */ + $controllers->get('/reset-password/', $this->call('resetPassword')) + ->bind('account_reset_password'); + /** * Give account open sessions * @@ -195,6 +243,22 @@ class Account implements ControllerProviderInterface return $controllers; } + + public function registerAccount(Application $app, Request $request) + { + return new Response($app['Core']['Twig']->render('account/register.html.twig')); + } + + public function resetPassword(Application $app, Request $request) + { + return new Response($app['Core']['Twig']->render('account/reset-password.html.twig')); + } + + public function resetEmail(Application $app, Request $request) + { + return new Response($app['Core']['Twig']->render('account/reset-email.html.twig')); + } + /** * Submit the new password * diff --git a/templates/web/account/account.html.twig b/templates/web/account/account.html.twig index f7e7d661b6..01c00317df 100644 --- a/templates/web/account/account.html.twig +++ b/templates/web/account/account.html.twig @@ -7,6 +7,10 @@ {% endblock %} +{% block title %} + {% trans 'login:: Mon compte' %} +{% endblock %} + {% block content %} @@ -20,7 +24,7 @@ {% trans 'Informations personnelles' %}
-

{% trans 'admin::compte-utilisateur changer mon mot de passe' %}

+

{% trans 'admin::compte-utilisateur changer mon mot de passe' %}

@@ -64,7 +68,7 @@
@@ -217,4 +221,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/web/account/authorized_apps.html.twig b/templates/web/account/authorized_apps.html.twig index d24dee9edc..62706a82d2 100644 --- a/templates/web/account/authorized_apps.html.twig +++ b/templates/web/account/authorized_apps.html.twig @@ -45,6 +45,7 @@ $(document).ready(function(){ }); {% endblock %} + {% block content %} diff --git a/templates/web/account/base.html.twig b/templates/web/account/base.html.twig index 18aadc36be..122b33e55f 100644 --- a/templates/web/account/base.html.twig +++ b/templates/web/account/base.html.twig @@ -1,6 +1,6 @@ - {{ registry.get('GV_homeTitle') }} {% trans 'login:: Mon compte'%} + {{ home_title }} {% block title %}{% endblock %} @@ -14,8 +14,8 @@
diff --git a/templates/web/account/forgot-password.html.twig b/templates/web/account/forgot-password.html.twig index 75844f8a3d..cf86dc62ba 100644 --- a/templates/web/account/forgot-password.html.twig +++ b/templates/web/account/forgot-password.html.twig @@ -1,171 +1,149 @@ - - - - - {% trans 'admin::compte-utilisateur changer mon mot de passe' %} - - -
-
-
- {{ registry.get('GV_homeTitle') }} - {% trans 'login:: Mon compte' %} + {{ home_title }} + {{ block('title') }}
- - - - -
{{ registry.get('GV_homeTitle') }}
-
- -
-
- -
-
+{% extends 'account/base.html.twig' %} - {% if tokenize %} - - - - + - $('#form_password_confirm').rules("add",{ - equalTo: "#form_password" - }); + + $('#form_password').rules("add",{ + password: "#form_login" + }); - {% if app.request.get('salt') %} -
- {% trans 'Pour ameliorer la securite de l\'application, vous devez mettre a jour votre mot de passe.' %}
- {% trans 'Cette tache ne pouvant etre automatisee, merci de bien vouloir la realiser.' %} -
- {% endif %} + $('#form_password_confirm').rules("add",{ + equalTo: "#form_password" + }); -
- - - - - - - - - - - - - - - - -
-
- -
-
-
- {% if passwordMsg is not none %} - {{ passwordMsg }} - {% endif %} -
-
 
-
-
-
-
-
-
- -
- -
-
-
- {% if passwordMsg is not none %} - {{ passwordMsg }} - {% endif %} -
-
- - - - {% trans 'login:: Retour a l\'accueil' %} -
-
+ $("#form_password").valid(); + }); +{% endif %} + - {% endif %} +{% endblock %} - {% if not tokenize %} -
- {% if errorMsg is not none %} -
{{ errorMsg }}
- {% endif %} +{% block content %} - {% if sentMsg is not none %} -
{{ sentMsg }}
- {% endif %} +{% if tokenize %} -
- {% trans 'login:: Forgot your password' %} -
-
- {% trans 'login:: Entrez votre adresse email' %} -
-
- -
- -
- {% endif %} + {% if app.request.get('salt') %} +
+ {% trans 'Pour ameliorer la securite de l\'application, vous devez mettre a jour votre mot de passe.' %}
+ {% trans 'Cette tache ne pouvant etre automatisee, merci de bien vouloir la realiser.' %} +
+ {% endif %} + +
+ + + + + + + + + + + + + + + + +
+
+ +
+
+
+ {% if passwordMsg is not none %} + {{ passwordMsg }} + {% endif %} +
+
 
+
+
+
- -
- © Copyright Alchemy 2005-{{ "now"|date("Y") }} -
- +
+ +
+ +
+
+
+ {% if passwordMsg is not none %} + {{ passwordMsg }} + {% endif %} +
+
+ + + + {% trans 'login:: Retour a l\'accueil' %} +
+
+ +{% endif %} + +{% if not tokenize %} +
+ {% if errorMsg is not none %} +
{{ errorMsg }}
+ {% endif %} + + {% if sentMsg is not none %} +
{{ sentMsg }}
+ {% endif %} + +
+ {% trans 'login:: Forgot your password' %}
- - +
+ {% trans 'login:: Entrez votre adresse email' %} +
+
+ +
+ +
+{% endif %} + +{% endblock %} diff --git a/templates/web/account/register.html.twig b/templates/web/account/register.html.twig new file mode 100644 index 0000000000..48e4da4dbe --- /dev/null +++ b/templates/web/account/register.html.twig @@ -0,0 +1,384 @@ +{% extends 'account/base.html.twig' %} + +{% block title %} +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block content %} + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + " class="input_element" name="form_login"> + + +
+
+ + + " class="input_element password" name="form_password" id="form_password" /> + + + {% trans 'Resistance du mot de passe' %}
+ +
+
 
+
+
+
+
+
+ + + " class="input_element" name="form_password_confirm"> + + +
+
+ {% trans 'admin::compte-utilisateur A propos de la securite des mots de passe' %} + +
+
+
+
+ + + " class="input_element" name="form_email"> + + +
 
+ + + " value="name_from_id($parm["form_geonameid"]) ?>" class="input_element geoname_field" name="form_geonameid"> + + +
+ {% trans 'admin::compte-utilisateur sexe' %} : + + value="0">{% trans 'admin::compte-utilisateur:sexe: mademoiselle' %} + value="1">{% trans 'admin::compte-utilisateur:sexe: madame' %} + value="2">{% trans 'admin::compte-utilisateur:sexe: monsieur' %} + + +
+ + + + + +
+ + + " class="input_element" name="form_firstname"> + + +
+ + + " class="input_element" name="form_job"> + + +
+ + + " class="input_element" name="form_activity"> + + +
+ + + " class="input_element" name="form_phone"> + + +
+ + + " class="input_element" name="form_fax"> + + +
+ + + " class="input_element" name="form_company"> + + +
+ + + " class="input_element" name="form_address"> + + +
+ + + " class="input_element" name="form_zip"> + + +
+
+
+ + + get('GV_autoselectDB')) { + ?> +
+ +
{% trans 'admin::compte-utilisateur actuellement, acces aux bases suivantes : ' %}
+
+ +
+ + + +
+ + get('GV_autoselectDB')) { + ?> +
+ + +
+
+ + + + + + +{% endblock %} diff --git a/templates/web/account/reset-email.html.twig b/templates/web/account/reset-email.html.twig new file mode 100644 index 0000000000..9ffd72d2d8 --- /dev/null +++ b/templates/web/account/reset-email.html.twig @@ -0,0 +1,88 @@ +{% extends 'account/base.html.twig' %} + +{% block title %} + {% trans 'admin::compte-utilisateur changer mon mot de passe' %} +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block content %} +
+
+ +
+

{{ user.get_login() }}

+

+
+
+
+ +
+ + {#

#} +
+
+
+ +
+ + {#

#} +
+
+
+ +
+ + {#

#} +
+
+
+ + +
+
+

+ {% trans 'admin::compte-utilisateur: Pourquoi me demande-t-on mon mot de passe pour changer mon adresse email ?'%} +
+ {% trans 'admin::compte-utilisateur: Votre adresse e-mail sera utilisee lors de la perte de votre mot de passe afin de pouvoir le reinitialiser, il est important que vous soyez la seule personne a pouvoir la changer.'%} +

+{% endblock %} diff --git a/templates/web/account/reset-password.html.twig b/templates/web/account/reset-password.html.twig new file mode 100644 index 0000000000..7f1c5b531c --- /dev/null +++ b/templates/web/account/reset-password.html.twig @@ -0,0 +1,122 @@ +{% extends 'account/base.html.twig' %} + +{% block title %} + {% trans 'admin::compte-utilisateur changer mon mot de passe' %} +{% endblock %} + +{% block head %} + +{% endblock %} + +{% block content %} +
+
+ +
+

{{ user.get_login() }}

+

+
+
+
+ +
+ + {#

#} +
+
+
+ +
+ + + {#

+ +

+

 

+
+
+
+
+

#} +
+
+
+ +
+ + {#

#} +
+
+
+ + +
+
+
+

+ {% trans 'admin::compte-utilisateur A propos de la securite des mots de passe :' %} +

+

+ {% trans 'admin::compte-utilisateur Les mots de passe doivent etre clairement distincts du login et contenir au moins deux types parmis les caracteres suivants :' %} +

+
+
    +
  • {% trans 'admin::compte-utilisateur::securite caracteres speciaux' %}
  • +
  • {% trans 'admin::compte-utilisateur::securite caracteres majuscules' %}
  • +
  • {% trans 'admin::compte-utilisateur::securite caracteres minuscules' %}
  • +
  • {% trans 'admin::compte-utilisateur::securite caracteres numeriques' %}
  • +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/web/account/sessions.html.twig b/templates/web/account/sessions.html.twig index 1af4b95bc5..d01d628b03 100644 --- a/templates/web/account/sessions.html.twig +++ b/templates/web/account/sessions.html.twig @@ -1,15 +1,12 @@ {% extends 'account/base.html.twig' %} +{% block title %} + {% trans 'Mes sessions' %} +{% endblock %} + {% block content %}
- - - - -
- {% trans 'Mes sessions' %} -
diff --git a/www/login/reset-password.php b/www/login/reset-password.php index 2cdf53b31e..d720743d23 100644 --- a/www/login/reset-password.php +++ b/www/login/reset-password.php @@ -186,14 +186,14 @@ if ($error) {
' . _('admin::compte-utilisateur A propos de la securite des mots de passe :') . '
'; -echo '
' . _('admin::compte-utilisateur Les mots de passe doivent etre clairement distincts du login et contenir au moins deux types parmis les caracteres suivants :') . '
'; -echo '
    '; -echo '
  • ' . _('admin::compte-utilisateur::securite caracteres speciaux') . '
  • '; -echo '
  • ' . _('admin::compte-utilisateur::securite caracteres majuscules') . '
  • '; -echo '
  • ' . _('admin::compte-utilisateur::securite caracteres minuscules') . '
  • '; -echo '
  • ' . _('admin::compte-utilisateur::securite caracteres numeriques') . '
  • '; -echo '
'; + echo '
' . _('admin::compte-utilisateur A propos de la securite des mots de passe :') . '
'; + echo '
' . _('admin::compte-utilisateur Les mots de passe doivent etre clairement distincts du login et contenir au moins deux types parmis les caracteres suivants :') . '
'; + echo '
    '; + echo '
  • ' . _('admin::compte-utilisateur::securite caracteres speciaux') . '
  • '; + echo '
  • ' . _('admin::compte-utilisateur::securite caracteres majuscules') . '
  • '; + echo '
  • ' . _('admin::compte-utilisateur::securite caracteres minuscules') . '
  • '; + echo '
  • ' . _('admin::compte-utilisateur::securite caracteres numeriques') . '
  • '; + echo '
'; ?>