* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 * @category Stud.IP * @since 5.4 */ class ExternController extends StudipController { protected $with_session = true; /** * Action shows rendered external page. * * @param string $config_id The id of the configuration of the external page to show. * @throws Trails\Exceptions\DoubleRenderError */ public function index_action(string $config_id) { $config = ExternPageConfig::find($config_id); if (!$config) { $this->render_text( Config::get()->EXTERN_PAGES_ERROR_MESSAGE ); return; } try { $page = ExternPage::get($config); $page->setRequestParams(); } catch (Exception $e) { $this->render_text( Config::get()->EXTERN_PAGES_ERROR_MESSAGE . '
' . $e->getMessage() ); return; } $this->render_text($page->toString()); } }