Location: PHPKode > projects > DIY Blog > diy-blog/classes/diy-blog/backend/view/forbidden/ForbiddenView.class.php
<?php

/**
 * Displayed when user does not have access to Resource.
 * @package diy-blog.backend.view.forbidden
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

class ForbiddenView extends BackEndView
{
	public function __construct(Resource $resource = null)
	{
		parent::__construct($resource);

		$this->template->load(APP_VIEW_DIR."forbidden/Forbidden.xsl");
	}
	
	public function display(Request $request, Response $response)
	{
		$xml = "<?xml version=\"1.0\"?><Forbidden/>";
		$this->doc->loadXML($xml);

		if ($request->getAttribute("login-result") != null)
		{
			$this->proc->setParameter("", "login-result", $request->getAttribute("login-result"));
			$this->resolver->setArgument("login-errors", XMLSerializer::serialize($request->getAttribute("login-errors")));
			$this->resolver->setArgument("login-form", XMLSerializer::serialize($request->getAttribute("login-form")));
		}

		parent::display($request, $response);
		$response->setStatus(Response::SC_FORBIDDEN);
	}

}
Return current item: DIY Blog