Exemple #1
0
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 */
require '../lib/bootstrap.php';
# set base url for URLHelper class
URLHelper::setBaseUrl($CANONICAL_RELATIVE_PATH_STUDIP);
# initialize Stud.IP-Session
page_open(array('sess' => 'Seminar_Session', 'auth' => 'Seminar_Default_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
try {
    require_once 'lib/seminar_open.php';
    # get plugin class from request
    $dispatch_to = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
    list($plugin_class, $unconsumed) = PluginEngine::routeRequest($dispatch_to);
    # retrieve corresponding plugin info
    $plugin_manager = PluginManager::getInstance();
    $plugin_info = $plugin_manager->getPluginInfo($plugin_class);
    # create an instance of the queried plugin
    $plugin = PluginEngine::getPlugin($plugin_class);
    # user is not permitted, show login screen
    if (is_null($plugin)) {
        # TODO (mlunzena) should not getPlugin throw this exception?
        throw new AccessDeniedException(_('Sie besitzen keine Rechte zum Aufruf dieses Plugins.'));
    }
    // set default page title
    PageLayout::setTitle($plugin->getPluginName());
    if (is_callable(array($plugin, 'initialize'))) {
        $plugin->initialize();
    }