<?php defined('SYSPATH') or die('No direct access allowed.');

/**
 *
 * @package    OSB
 * @category   Controllers
 * @author     Deon George
 * @copyright  (c) 2009-2013 Open Source Billing
 * @license    http://dev.osbill.net/license.html
*/
class Controller_Debug extends Controller_TemplateDefault {
	public function before() {
		if (! in_array(Config::sitemode(),array(Kohana::DEVELOPMENT,Kohana::TESTING)))
			HTTP::redirect();

		parent::before();
	}

	public function action_site() {
		$output = '';

		$output .= debug::vars(array(
			'm'=>__METHOD__,
			'site'=>Config::site(),
			'siteID'=>Company::instance()->site(),
			'siteMode'=>Config::sitemodeverbose(),
			'modules'=>Config::appmodules(),
		));

		Block::add(array(
			'title'=>_('Site debug'),
			'body'=>$output,
		));
	}
}
?>