.

AccessDeniedRedirectRenderDecorator Class Reference
[Usermanagement]

Catches 403 and redirects to login page, if user is not already logged in. More...

Inheritance diagram for AccessDeniedRedirectRenderDecorator:
RenderDecoratorBase IRenderDecorator

List of all members.

Public Member Functions

  render_content ($page_data)
  Render content.

Detailed Description

Catches 403 and redirects to login page, if user is not already logged in.

This render decorator replaces the configuration option USER_403_BEHAVIOUR.

Usage

Set this class as a render decorator on the PageData you create in the index.php, like this:

 $cache_manager = new AnonymousCacheManager();
 $page_data = new PageData($cache_manager, $_GET, $_POST);
 $page_data->add_render_decorator_class('AccessDeniedRedirectRenderDecorator');
Since:
0.6
Author:
Gerd Riesselmann

Definition at line 23 of file accessdeniedredirectrenderdecorator.cls.php.


Member Function Documentation

AccessDeniedRedirectRenderDecorator::render_content ( page_data  ) 

Render content.

Parameters:
PageData  $page_data
Returns:
void

Reimplemented from RenderDecoratorBase.

Definition at line 30 of file accessdeniedredirectrenderdecorator.cls.php.

00030                                                    {
00031                 parent::render_content($page_data);
00032                 if ($page_data->status_code == ControllerBase::ACCESS_DENIED) {
00033                         if (!Users::is_logged_in()) {
00034                                 Session::push('login_goto', Url::current()->build(Url::ABSOLUTE));
00035                                 Url::create(ActionMapper::get_url('login'))->redirect();
00036                                 exit;
00037                         }
00038                 }
00039         }       

The documentation for this class was generated from the following file: