diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2014-03-12 18:48:41 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2014-03-12 18:48:41 -0500 |
commit | d69012ea6d65e938a72f7accca498fc9feb2df0d (patch) | |
tree | f18aa896ab7be6889f3860edc157cd8a3146cc6a /tests/functional/fixtures/ext/foo/bar/controller/controller.php | |
parent | c6a87e77d4e11bd9e2e47e20c96fee66892c04b0 (diff) | |
parent | e07f3141179da9943ed51e754f15912dd24f4aff (diff) | |
download | forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar.gz forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar.bz2 forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar.xz forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.zip |
Merge pull request #2104 from nickvergessen/ticket/12261
[ticket/12261] Remove web root path from login redirect url
Diffstat (limited to 'tests/functional/fixtures/ext/foo/bar/controller/controller.php')
-rw-r--r-- | tests/functional/fixtures/ext/foo/bar/controller/controller.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php index 45246f8a97..47d856a5df 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php @@ -10,13 +10,15 @@ class controller protected $helper; protected $path_helper; protected $config; + protected $user; - public function __construct(\phpbb\controller\helper $helper, \phpbb\path_helper $path_helper, \phpbb\template\template $template, \phpbb\config\config $config, $root_path, $php_ext) + public function __construct(\phpbb\controller\helper $helper, \phpbb\path_helper $path_helper, \phpbb\template\template $template, \phpbb\config\config $config, \phpbb\user $user, $root_path, $php_ext) { $this->template = $template; $this->helper = $helper; $this->path_helper = $path_helper; $this->config = $config; + $this->user = $user; $this->root_path = $root_path; $this->php_ext = $php_ext; } @@ -43,6 +45,18 @@ class controller throw new \phpbb\controller\exception('Exception thrown from foo/exception route'); } + public function login_redirect() + { + if (!$this->user->data['is_registered']) + { + login_box(); + } + + $this->template->assign_var('A_VARIABLE', 'I am a variable'); + + return $this->helper->render('foo_bar_body.html'); + } + public function redirect() { $url_root = generate_board_url(); |