AuthTestController.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright 2005-2011, Cake Software Foundation, Inc. (http://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. (http://cakefoundation.org)
  10. * @link http://cakephp.org CakePHP(tm) Project
  11. * @since 3.0.0
  12. * @license http://www.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 mixed
  32. */
  33. public $testUrl = null;
  34. /**
  35. * construct method
  36. */
  37. public function __construct($request = null, $response = null)
  38. {
  39. $request->addParams(Router::parse('/auth_test'));
  40. $request->here = '/auth_test';
  41. $request->webroot = '/';
  42. Router::setRequestInfo($request);
  43. parent::__construct($request, $response);
  44. }
  45. /**
  46. * login method
  47. *
  48. * @return void
  49. */
  50. public function login()
  51. {
  52. }
  53. /**
  54. * logout method
  55. *
  56. * @return void
  57. */
  58. public function logout()
  59. {
  60. }
  61. /**
  62. * add method
  63. *
  64. * @return void
  65. */
  66. public function add()
  67. {
  68. echo "add";
  69. }
  70. /**
  71. * view method
  72. *
  73. * @return void
  74. */
  75. public function view()
  76. {
  77. echo "view";
  78. }
  79. /**
  80. * add method
  81. *
  82. * @return void
  83. */
  84. public function camelCase()
  85. {
  86. echo "camelCase";
  87. }
  88. /**
  89. * redirect method
  90. *
  91. * @param mixed $url
  92. * @param mixed $status
  93. * @return void|\Cake\Network\Response
  94. */
  95. public function redirect($url, $status = null)
  96. {
  97. $this->testUrl = Router::url($url);
  98. return parent::redirect($url, $status);
  99. }
  100. /**
  101. * isAuthorized method
  102. *
  103. * @return void
  104. */
  105. public function isAuthorized()
  106. {
  107. }
  108. }