AuthTestController.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. $request->addParams(Router::parse('/auth_test'));
  44. $request->here = '/auth_test';
  45. $request->webroot = '/';
  46. Router::setRequestInfo($request);
  47. parent::__construct($request, $response);
  48. }
  49. /**
  50. * login method
  51. *
  52. * @return void
  53. */
  54. public function login()
  55. {
  56. }
  57. /**
  58. * logout method
  59. *
  60. * @return void
  61. */
  62. public function logout()
  63. {
  64. }
  65. /**
  66. * add method
  67. *
  68. * @return void
  69. */
  70. public function add()
  71. {
  72. echo 'add';
  73. }
  74. /**
  75. * view method
  76. *
  77. * @return void
  78. */
  79. public function view()
  80. {
  81. echo 'view';
  82. }
  83. /**
  84. * add method
  85. *
  86. * @return void
  87. */
  88. public function camelCase()
  89. {
  90. echo 'camelCase';
  91. }
  92. /**
  93. * redirect method
  94. *
  95. * @param string|array $url
  96. * @param int $status
  97. * @return \Cake\Http\Response|null
  98. */
  99. public function redirect($url, $status = null)
  100. {
  101. $this->testUrl = Router::url($url);
  102. return parent::redirect($url, $status);
  103. }
  104. /**
  105. * isAuthorized method
  106. *
  107. * @return void
  108. */
  109. public function isAuthorized()
  110. {
  111. }
  112. }