Commit 169d85af authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Ajout contrôleur Utilisateur (génération mot de passe sésame).

parent 33fde095
...@@ -38,7 +38,7 @@ $zfcuserSettings = array( ...@@ -38,7 +38,7 @@ $zfcuserSettings = array(
* Accepted values: boolean true or false * Accepted values: boolean true or false
*/ */
'enable_username' => true, 'enable_username' => true,
/** /**
* Enable Display Name * Enable Display Name
* Enables a display name field on the registration form, which is persisted * Enables a display name field on the registration form, which is persisted
* in the database. Default value is false. * in the database. Default value is false.
...@@ -61,6 +61,11 @@ $zfcuserSettings = array( ...@@ -61,6 +61,11 @@ $zfcuserSettings = array(
return array( return array(
'zfcuser' => $zfcuserSettings, 'zfcuser' => $zfcuserSettings,
'unicaen-auth' => $settings, 'unicaen-auth' => $settings,
'controllers' => array(
'invokables' => array(
'unicaen-auth' => 'UnicaenAuth\Controller\UtilisateurController',
),
),
'view_manager' => array( 'view_manager' => array(
'template_path_stack' => array( 'template_path_stack' => array(
'unicaen-auth' => __DIR__ . '/../view', 'unicaen-auth' => __DIR__ . '/../view',
......
<?php
namespace UnicaenAuth\Controller;
use Zend\Mvc\Controller\AbstractActionController;
/**
*
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class UtilisateurController extends AbstractActionController
{
public function genererSesameAction()
{
if (!($password = $this->getRequest()->getQuery()->get('mdp'))) {
return $this->redirect()->toRoute('home');
}
$bcrypt = new \Zend\Crypt\Password\Bcrypt();
return array('sesame' => $bcrypt->create($password));
}
}
<?php $this->headTitle("Générer un mot de passe"); ?>
<?php echo $this->sesame; ?>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment