Exemplo n.º 1
0
    $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
} elseif ($page_id > 0) {
    $page = $admin->get_page_details($page_id, ADMIN_URL . '/pages/index.php');
} else {
    $admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS'], ADMIN_URL);
}
$old_admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
$old_admin_users = explode(',', str_replace('_', '', $page['admin_users']));
$in_group = false;
foreach ($admin->get_groups_id() as $cur_gid) {
    if (in_array($cur_gid, $old_admin_groups)) {
        $in_group = true;
    }
}
if (!$in_group && !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
    print $admin->get_group_id() . $admin->get_user_id();
    // print_r ($old_admin_groups);
    $admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
}
// some additional security checks:
// Check whether the section_id belongs to the page_id at all
if (!is_numeric($section_id)) {
    $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
} elseif ($section_id > 0) {
    $section = $admin->get_section_details($section_id, ADMIN_URL . '/pages/index.php');
    if (!$admin->get_permission($section['module'], 'module')) {
        $admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS'], ADMIN_URL);
    }
}
// Workout if the developer wants to show the info banner
if (isset($print_info_banner) && $print_info_banner == true) {
    }
}
// Work-out file mode
if ($advanced == '') {
    // Check if should be set to 777 or left alone
    if (isset($_POST['world_writeable']) && $_POST['world_writeable'] == 'true') {
        $file_mode = '0777';
        $dir_mode = '0777';
    } else {
        $file_mode = STRING_FILE_MODE;
        $dir_mode = STRING_DIR_MODE;
    }
} else {
    $file_mode = STRING_FILE_MODE;
    $dir_mode = STRING_DIR_MODE;
    if ($admin->get_group_id() == '1') {
        // Work-out the octal value for file mode
        $u = 0;
        if (isset($_POST['file_u_r']) && $_POST['file_u_r'] == 'true') {
            $u = $u + 4;
        }
        if (isset($_POST['file_u_w']) && $_POST['file_u_w'] == 'true') {
            $u = $u + 2;
        }
        if (isset($_POST['file_u_e']) && $_POST['file_u_e'] == 'true') {
            $u = $u + 1;
        }
        $g = 0;
        if (isset($_POST['file_g_r']) && $_POST['file_g_r'] == 'true') {
            $g = $g + 4;
        }
Exemplo n.º 3
0
                    } elseif ($type == 'languages') {
                        load_language($dir . '/' . $file);
                    }
                }
            }
            closedir($handle);
        }
    }
    $sql = 'DELETE FROM `' . TABLE_PREFIX . 'settings` WHERE `name`=\'FINALIZE_SETUP\'';
    if ($database->query($sql)) {
    }
}
// ---------------------------------------
$msg = '<br />';
// check if it is neccessary to start the uograde-script
if ($admin->get_group_id() == 1 && file_exists(WB_PATH . '/upgrade-script.php')) {
    // check if it is neccessary to start the uograde-script
    $sql = 'SELECT `value` FROM `' . TABLE_PREFIX . 'settings` WHERE `name`=\'wb_revision\'';
    if ($wb_revision = $database->get_one($sql)) {
    }
    if (version_compare($wb_revision, REVISION) < 0) {
        if (!headers_sent()) {
            header('Location: ' . WB_URL . '/upgrade-script.php');
            exit;
        } else {
            echo "<p style=\"text-align:center;\"> The <strong>upgrade script</strong> could not be start automatically.\n" . "Please click <a style=\"font-weight:bold;\" " . "href=\"" . WB_URL . "/upgrade-script.php\">on this link</a> to start the script!</p>\n";
            exit;
        }
    }
    $msg .= '' . $MESSAGE['START_UPGRADE_SCRIPT_EXISTS'] . '<br />';
}
$template->set_var(array('TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'], 'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'], 'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'], 'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'], 'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'], 'TEXT_HEADER' => $TEXT['HEADER'], 'TEXT_FOOTER' => $TEXT['FOOTER'], 'TEXT_VISIBILITY' => $TEXT['VISIBILITY'], 'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'], 'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'], 'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'], 'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'], 'TEXT_TEXT' => $TEXT['TEXT'], 'TEXT_DEFAULT' => $TEXT['DEFAULT'], 'TEXT_LANGUAGE' => $TEXT['LANGUAGE'], 'TEXT_TIMEZONE' => $TEXT['TIMEZONE'], 'TEXT_CHARSET' => $TEXT['CHARSET'], 'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'], 'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'], 'TEXT_TEMPLATE' => $TEXT['TEMPLATE'], 'TEXT_THEME' => $TEXT['THEME'], 'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'], 'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'], 'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'], 'TEXT_FRONTEND' => $TEXT['FRONTEND'], 'TEXT_LOGIN' => $TEXT['LOGIN'], 'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'], 'TEXT_SIGNUP' => $TEXT['SIGNUP'], 'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'], 'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'], 'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'], 'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'], 'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'], 'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'], 'TEXT_APP_NAME' => $TEXT['APP_NAME'], 'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'], 'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'], 'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'], 'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'], 'TEXT_WINDOWS' => $TEXT['WINDOWS'], 'TEXT_ADMIN' => $TEXT['ADMIN'], 'TEXT_TYPE' => $TEXT['TYPE'], 'TEXT_DATABASE' => $TEXT['DATABASE'], 'TEXT_HOST' => $TEXT['HOST'], 'TEXT_USERNAME' => $TEXT['USERNAME'], 'TEXT_PASSWORD' => $TEXT['PASSWORD'], 'TEXT_NAME' => $TEXT['NAME'], 'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'], 'TEXT_SAVE' => $TEXT['SAVE'], 'TEXT_RESET' => $TEXT['RESET'], 'TEXT_CHANGES' => $TEXT['CHANGES'], 'TEXT_ENABLED' => $TEXT['ENABLED'], 'TEXT_DISABLED' => $TEXT['DISABLED'], 'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'], 'TEXT_MANAGE' => $TEXT['MANAGE'], 'TEXT_SEARCH' => $TEXT['SEARCH'], 'TEXT_PUBLIC' => $TEXT['PUBLIC'], 'TEXT_PRIVATE' => $TEXT['PRIVATE'], 'TEXT_REGISTERED' => $TEXT['REGISTERED'], 'TEXT_NONE' => $TEXT['NONE'], 'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)) . substr($TEXT['FILES'], 1), 'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'], 'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'], 'TEXT_USER' => $TEXT['USER'], 'TEXT_GROUP' => $TEXT['GROUP'], 'TEXT_OTHERS' => $TEXT['OTHERS'], 'TEXT_READ' => $TEXT['READ'], 'TEXT_WRITE' => $TEXT['WRITE'], 'TEXT_EXECUTE' => $TEXT['EXECUTE'], 'TEXT_WARN_PAGE_LEAVE' => '', 'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'], 'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'], 'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'], 'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'], 'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'], 'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'], 'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'], 'TEXT_INLINE' => $TEXT['INLINE'], 'TEXT_SEPARATE' => $TEXT['SEPARATE'], 'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'], 'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'], 'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'], 'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS_MODE_SWITCH_WARNING'], 'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS_WORLD_WRITEABLE_WARNING'], 'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'], 'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'], 'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']));
if ($is_advanced) {
    $template->parse('show_page_level_limit', 'show_page_level_limit_block', true);
    $template->parse('show_checkbox_1', 'show_checkbox_1_block', true);
    $template->parse('show_checkbox_2', 'show_checkbox_2_block', true);
    $template->parse('show_checkbox_3', 'show_checkbox_3_block', true);
    $template->parse('show_php_error_level', 'show_php_error_level_block', true);
    $template->parse('show_charset', 'show_charset_block', true);
    $template->parse('show_wysiwyg', 'show_wysiwyg_block', true);
    $template->parse('show_search', 'show_search_block', false);
    $template->parse('show_redirect_timer', 'show_redirect_timer_block', true);
} else {
    $template->set_block('show_page_level_limit', '');
    $template->set_block('show_checkbox_1', '');
    $template->set_block('show_checkbox_2', '');
    $template->set_block('show_checkbox_3', '');
    $template->set_block('show_php_error_level', '');
    $template->set_block('show_charset', '');
    $template->set_block('show_wysiwyg', '');
    $template->set_block('show_search', '');
    $template->set_block('show_redirect_timer', '');
}
if ($is_advanced && $admin->get_group_id() == '1') {
    $template->parse('show_access', 'show_access_block', true);
} else {
    $template->set_block('show_access', '');
}
// Parse template objects output
$template->parse('main', 'main_block', false);
$template->pparse('output', 'page');
$admin->print_footer();