Exemple #1
0
function module_install_now()
{
    global $xoopsSecurity, $xoopsConfig;
    $mod = rmc_server_var($_POST, 'module', '');
    if (!$xoopsSecurity->check()) {
        redirectMsg('modules.php?action=install&dir=' . $module, __('Sorry, this operation could not be completed!', 'rmcommon'), 1);
        die;
    }
    $module_handler = xoops_gethandler('module');
    if ($module = $module_handler->getByDirname($mod)) {
        redirectMsg('modules.php', sprintf(__('%s is already installed!', 'rmcommon'), $module->name()), 1);
        die;
    }
    $file = XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/modulesadmin.php';
    if (file_exists($file)) {
        include_once $file;
    } else {
        include_once str_replace($xoopsConfig['language'], 'english', $file);
    }
    $file = XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/admin.php';
    if (file_exists($file)) {
        include_once $file;
    } else {
        include_once str_replace($xoopsConfig['language'], 'english', $file);
    }
    include_once XOOPS_ROOT_PATH . '/modules/system/admin/modulesadmin/modulesadmin.php';
    RMEvents::get()->run_event('rmcommon.installing.module', $mod);
    $module_log = xoops_module_install($mod);
    $module_log = RMEvents::get()->run_event('rmcommon.module.installed', $module_log, $mod);
    RMFunctions::create_toolbar();
    RMTemplate::get()->add_style('modules.css', 'rmcommon');
    xoops_cp_header();
    $module = $module_handler->getByDirname($mod);
    $log_title = sprintf(__('Installation log for %s', 'rmcommon'), $module ? $module->name() : $mod);
    $action = rmc_server_var($_POST, 'action', '');
    include RMTemplate::get()->get_template('rmc_mod_log.php', 'module', 'rmcommon');
    xoops_cp_footer();
}
Exemple #2
0
     xoops_cp_header();
     // Define Stylesheet
     $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
     // Define Breadcrumb and tips
     $xoBreadCrumb->addLink(_AM_SYSTEM_MODULES_ADMIN, system_adminVersion('modulesadmin', 'adminpath'));
     $xoBreadCrumb->addLink(_AM_SYSTEM_MODULES_INSTALL);
     $xoBreadCrumb->addHelp(system_adminVersion('modulesadmin', 'help') . '#install');
     $xoBreadCrumb->render();
     // Display question message
     xoops_confirm(array('module' => $module, 'op' => 'install_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _AM_SYSTEM_MODULES_INSTALL);
     // Call Footer
     xoops_cp_footer();
     break;
 case 'install_ok':
     $ret = array();
     $ret[] = xoops_module_install($module);
     // Flush cache files for cpanel GUIs
     xoops_load('cpanel', 'system');
     XoopsSystemCpanel::flush();
     //Set active modules in cache folder
     xoops_setActiveModules();
     // Define main template
     $xoopsOption['template_main'] = 'system_header.html';
     // Call Header
     xoops_cp_header();
     // Define Stylesheet
     $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
     // Define Breadcrumb and tips
     $xoBreadCrumb->addLink(_AM_SYSTEM_MODULES_ADMIN, system_adminVersion('modulesadmin', 'adminpath'));
     $xoBreadCrumb->addLink(_AM_SYSTEM_MODULES_INSTALL);
     $xoBreadCrumb->addHelp(system_adminVersion('modulesadmin', 'help') . '#install');
        $system_moduleObj = $module_handler->getByDirname('system');
        xoops_module_update_system($system_moduleObj);
        $install_mods = isset($_POST['install_mods']) ? $_POST['install_mods'] : '';
        $anon_accessible_mods = isset($_POST['anon_accessible_mods']) ? $_POST['anon_accessible_mods'] : '';
        if (isset($_POST['install_mods'])) {
            for ($i = 0; $i <= count($install_mods) - 1; $i++) {
                $content .= xoops_module_install($install_mods[$i]);
                impresscms_get_adminmenu();
            }
        } else {
            $content .= _INSTALL_NO_PLUS_MOD;
        }
        //Install protector module by default if found.
        //TODO: Insert Protector installation - leads to blank page as it is now.
        if (file_exists(ICMS_ROOT_PATH . '/modules/protector/xoops_version.php')) {
            $content .= xoops_module_install('protector');
            /*        	include_once "./class/mainfilemanager.php";
            			 $mm = new mainfile_manager("../mainfile.php");
            			 $mm->setRewrite('PROTECTOR1', 'include  XOOPS_TRUST_PATH.\'/modules/protector/include/precheck.inc.php\')' ;
            			 $mm->setRewrite('PROTECTOR2', 'include  XOOPS_TRUST_PATH.\'/modules/protector/include/postcheck.inc.php\')' ;
            
            			 $result = $mm->doRewrite();
            			 $mm->report();*/
        }
        $tables = array();
        $content .= "<div style='height:auto;max-height:400px;overflow:auto;'>" . $dbm->report() . "</div>";
    } else {
        $wizard->redirectToPage('+1');
        exit;
    }
} else {
require_once '../class/xoopsformloader.php';
require_once '../class/xoopslists.php';
$pageHasForm = true;
$pageHasHelp = false;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    include_once '../class/xoopsblock.php';
    include_once '../kernel/module.php';
    include_once '../include/cp_functions.php';
    include_once '../include/version.php';
    include_once './include/modulesadmin.php';
    $config_handler =& xoops_gethandler('config');
    $xoopsConfig =& $config_handler->getConfigsByCat(XOOPS_CONF);
    $msgs = array();
    foreach ($_REQUEST['modules'] as $dirname => $installmod) {
        if ($installmod) {
            $msgs[] =& xoops_module_install($dirname);
        }
    }
    $pageHasForm = false;
    if (count($msgs) > 0) {
        $content = "<div class='x2-note successMsg'>" . INSTALLED_MODULES . "</div><ul class='log'>";
        foreach ($msgs as $msg) {
            $content .= "<dt>{$msg}</dt>";
        }
        $content .= "</ul>";
    } else {
        $content = "<div class='x2-note confirmMsg'>" . NO_INSTALLED_MODULES . "</div>";
    }
    // Flush cache files for cpanel GUIs
    xoops_load("cpanel", "system");
    XoopsSystemCpanel::flush();
Exemple #5
0
    $mod->loadInfoAsVar($module);
    if ($mod->getInfo('image') != false && trim($mod->getInfo('image')) != '') {
        $msgs = '<img src="' . XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . trim($mod->getInfo('image')) . '" alt="" />';
    }
    $msgs .= '<br /><span style="font-size:smaller;";>' . $mod->getVar('name') . '</span><br /><br />' . _MD_AM_RUSUREINS;
    xoops_cp_header();
    xoops_token_confirm(array('module' => $module, 'op' => 'install_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _MD_AM_INSTALL);
    xoops_cp_footer();
    exit;
}
if ($op == 'install_ok') {
    if (!xoops_confirm_validate()) {
        system_modulesadmin_error("Ticket Error");
    }
    $ret = array();
    $ret[] = xoops_module_install($_POST['module']);
    $contents = xoops_module_get_admin_menu();
    if (!xoops_module_write_admin_menu($contents)) {
        $ret[] = "<p>" . _MD_AM_FAILWRITE . "</p>";
    }
    xoops_cp_header();
    if (count($ret) > 0) {
        foreach ($ret as $msg) {
            if ($msg != '') {
                echo $msg;
            }
        }
    }
    echo "<br /><a href='admin.php?fct=modulesadmin'>" . _MD_AM_BTOMADMIN . "</a>";
    xoops_cp_footer();
    exit;