Example #1
0
 * Kunena Component
 *
 * @package       Kunena.Installer
 *
 * @copyright (C) 2008 - 2015 Kunena Team. All rights reserved.
 * @license       http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link          http://www.kunena.org
 **/
defined('_JEXEC') or die;
/*
 ************************/
/*
  KUNENA FORUM INSTALLER */
$app = JFactory::getApplication();
$view = $app->input->getCmd('view');
$task = $app->input->getCmd('task');
// Special case for developer versions.
if ($view != 'install' && class_exists('KunenaForum') && KunenaForum::isDev()) {
    // Developer version found: Check if latest version of Kunena has been installed. If not, prepare installation.
    require_once __DIR__ . '/install/version.php';
    $kversion = new KunenaVersion();
    if (!$kversion->checkVersion()) {
        JFactory::getApplication()->redirect(JUri::base(true) . '/index.php?option=com_kunena&view=install');
    }
    return;
}
// Run the installer...
require_once __DIR__ . '/install/controller.php';
$controller = new KunenaControllerInstall();
$controller->execute($task);
$controller->redirect();
Example #2
0
$app = JFactory::getApplication();
// Safety check to prevent fatal error if 'System - Kunena Forum' plug-in has been disabled.
if ($app->input->getCmd('view') == 'install' || !class_exists('KunenaForum') || !KunenaForum::isCompatible('4.0')) {
    // Run installer instead..
    require_once __DIR__ . '/install/controller.php';
    $controller = new KunenaControllerInstall();
    // TODO: execute special task that checks what's wrong
    $controller->execute($app->input->getCmd('task'));
    $controller->redirect();
    return;
}
if ($app->input->getCmd('view') == 'uninstall') {
    $allowed = $app->getUserState('com_kunena.uninstall.allowed');
    if ($allowed) {
        require_once __DIR__ . '/install/controller.php';
        $controller = new KunenaControllerInstall();
        $controller->execute('uninstall');
        $controller->redirect();
        $app->setUserState('com_kunena.uninstall.allowed', null);
        return;
    }
}
// Initialize Kunena Framework.
KunenaForum::setup();
// Initialize custom error handlers.
KunenaError::initialize();
// Kunena has been successfully installed: Load our main controller.
$controller = KunenaController::getInstance();
$controller->execute($app->input->getCmd('task'));
$controller->redirect();
// Remove custom error handlers.
Example #3
0
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_kunena')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// Check if installation hasn't been completed.
if (file_exists(__DIR__ . '/install.php')) {
    require_once __DIR__ . '/install.php';
    if (class_exists('KunenaControllerInstall')) {
        return;
    }
}
// Safety check to prevent fatal error if 'System - Kunena Forum' plug-in has been disabled.
if (JRequest::getCmd('view') == 'install' || !class_exists('KunenaForum') || !KunenaForum::isCompatible('3.0')) {
    // Run installer instead..
    require_once __DIR__ . '/install/controller.php';
    $controller = new KunenaControllerInstall();
    // TODO: execute special task that checks what's wrong
    $controller->execute(JRequest::getCmd('task'));
    $controller->redirect();
    return;
}
// Initialize Kunena Framework.
KunenaForum::setup();
// Initialize custom error handlers.
KunenaError::initialize();
// Kunena has been successfully installed: Load our main controller.
$controller = KunenaController::getInstance();
$controller->execute(JRequest::getCmd('task'));
$controller->redirect();
// Remove custom error handlers.
KunenaError::cleanup();