AjaxAuthController.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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\Event\Event;
  17. /**
  18. * AjaxAuthController class
  19. *
  20. */
  21. class AjaxAuthController extends Controller {
  22. /**
  23. * components property
  24. *
  25. * @var array
  26. */
  27. public $components = array('Session', 'TestAuth');
  28. /**
  29. * uses property
  30. *
  31. * @var array
  32. */
  33. public $uses = array();
  34. /**
  35. * testUrl property
  36. *
  37. * @var mixed
  38. */
  39. public $testUrl = null;
  40. /**
  41. * add method
  42. *
  43. * @return void
  44. */
  45. public function add() {
  46. echo 'Added Record';
  47. }
  48. /**
  49. * redirect method
  50. *
  51. * @param mixed $url
  52. * @param mixed $status
  53. * @param mixed $exit
  54. * @return void
  55. */
  56. public function redirect($url, $status = null, $exit = true) {
  57. $this->testUrl = Router::url($url);
  58. return false;
  59. }
  60. }