예제 #1
0
if (file_exists($controllerPath)) {
    require_once $controllerPath;
    $controllerClass = 'WFController' . ucfirst($view);
    $controller = new $controllerClass(array('base_path' => WF_ADMINISTRATOR));
    // load default controller
} else {
    $controller = new WFController(array('base_path' => WF_ADMINISTRATOR));
}
// check Authorisations
switch ($view) {
    case 'editor':
    case 'help':
    case 'popup':
        break;
    default:
        $app = JFactory::getApplication();
        if ($app->isAdmin() === false) {
            $app->redirect('index.php', WFText::_('ALERTNOTAUTH'), 'error');
        }
        if ($view == 'cpanel') {
            $view = 'manage';
        }
        // Authorise
        $controller->authorize($view);
        // check state of extension
        $controller->check();
        break;
}
// Perform the Request task
$controller->execute($task);
$controller->redirect();
예제 #2
0
jimport('joomla.application.component.controller');
// Require the base controller
require_once dirname(__FILE__) . DS . 'controller.php';
// Load controller
$controllerPath = dirname(__FILE__) . DS . 'controller' . DS . $view . '.php';
if (file_exists($controllerPath)) {
    require_once $controllerPath;
    $controllerClass = 'WFController' . ucfirst($view);
    $controller = new $controllerClass(array('base_path' => dirname(__FILE__)));
    // load default controller
} else {
    $controller = new WFController(array('base_path' => dirname(__FILE__)));
}
// check Authorisations
switch ($view) {
    case 'editor':
    case 'help':
    case 'popup':
        break;
    case 'cpanel':
        // Authorise
        $controller->authorize('admin');
        break;
    default:
        // Authorise
        $controller->authorize($view);
        break;
}
// Perform the Request task
$controller->execute($task);
$controller->redirect();