Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. <?php
  2. declare(strict_types=1);
  3.  
  4. /**
  5. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  13. * @link https://cakephp.org CakePHP(tm) Project
  14. * @since 0.2.9
  15. * @license https://opensource.org/licenses/mit-license.php MIT License
  16. */
  17. namespace App\Controller;
  18.  
  19. use Cake\Controller\Controller;
  20.  
  21. /**
  22. * Application Controller
  23. *
  24. * Add your application-wide methods in the class below, your controllers
  25. * will inherit them.
  26. *
  27. * @link https://book.cakephp.org/4/en/controllers.html#the-app-controller
  28. */
  29. class AppController extends Controller
  30. {
  31. /**
  32. * Initialization hook method.
  33. *
  34. * Use this method to add common initialization code like loading components.
  35. *
  36. * e.g. `$this->loadComponent('FormProtection');`
  37. *
  38. * @return void
  39. */
  40. public function initialize(): void
  41. {
  42. parent::initialize();
  43.  
  44. $this->loadComponent('RequestHandler');
  45. $this->loadComponent('Flash');
  46. $this->loadComponent('Auth', [
  47. 'authenticate' => [
  48. 'Form' => [
  49. 'fields' => [
  50. 'username' => 'email',
  51. 'password' => 'password'
  52. ]
  53. ]
  54. ], 'loginAction' => [
  55. 'controller' => 'Users',
  56. 'action' => 'login'
  57. ]
  58. ]);
  59.  
  60. /*
  61. * Enable the following component for recommended CakePHP form protection settings.
  62. * see https://book.cakephp.org/4/en/controllers/components/form-protection.html
  63. */
  64. //$this->loadComponent('FormProtection');
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement