AuthTestController.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright 2005-2011, Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (https://cakefoundation.org)
  10. * @link https://cakephp.org CakePHP(tm) Project
  11. * @since 3.0.0
  12. * @license https://opensource.org/licenses/mit-license.php MIT License
  13. */
  14. namespace TestApp\Controller;
  15. use Cake\Controller\Controller;
  16. use Cake\Routing\Router;
  17. /**
  18. * AuthTestController class
  19. */
  20. class AuthTestController extends Controller
  21. {
  22. /**
  23. * components property
  24. *
  25. * @var array
  26. */
  27. public $components = ['Auth'];
  28. /**
  29. * testUrl property
  30. *
  31. * @var string|array
  32. */
  33. public $testUrl = null;
  34. /**
  35. * construct method
  36. *
  37. * @param \Cake\Http\ServerRequest|null $request Request object for this controller. Can be null for testing,
  38. * but expect that features that use the request parameters will not work.
  39. * @param \Cake\Http\Response|null $response Response object for this controller.
  40. */
  41. public function __construct($request = null, $response = null)
  42. {
  43. Router::setRequestInfo($request);
  44. parent::__construct($request, $response);
  45. }
  46. /**
  47. * login method
  48. *
  49. * @return void
  50. */
  51. public function login()
  52. {
  53. }
  54. /**
  55. * logout method
  56. *
  57. * @return void
  58. */
  59. public function logout()
  60. {
  61. }
  62. /**
  63. * add method
  64. *
  65. * @return void
  66. */
  67. public function add()
  68. {
  69. echo 'add';
  70. }
  71. /**
  72. * view method
  73. *
  74. * @return void
  75. */
  76. public function view()
  77. {
  78. echo 'view';
  79. }
  80. /**
  81. * add method
  82. *
  83. * @return void
  84. */
  85. public function camelCase()
  86. {
  87. echo 'camelCase';
  88. }
  89. /**
  90. * redirect method
  91. *
  92. * @param string|array $url
  93. * @param int $status
  94. * @return \Cake\Http\Response|null
  95. */
  96. public function redirect($url, $status = null)
  97. {
  98. $this->testUrl = Router::url($url);
  99. return parent::redirect($url, $status);
  100. }
  101. /**
  102. * isAuthorized method
  103. *
  104. * @return void
  105. */
  106. public function isAuthorized()
  107. {
  108. }
  109. }