gyro/modules/console/controller/base/renderdecorators/consoleonlyrenderdecorator.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Return 403 if not invoked from console, effectively forcing users to 00004 * use the console 00005 * 00006 * @author Gerd Riesselmann 00007 * @ingroup Console 00008 */ 00009 class ConsoleOnlyRenderDecorator extends RenderDecoratorBase { 00010 /** 00011 * Render content 00012 * 00013 * @param PageData $page_data 00014 * @return void 00015 */ 00016 public function render_content($page_data) { 00017 if (!class_exists('Console') || !Console::is_console_request()) { 00018 $page_data->status_code = CONTROLLER_ACCESS_DENIED; 00019 } 00020 else { 00021 parent::render_content($page_data); 00022 } 00023 } 00024 }