$structure_info = $structlib->s_get_structure_info($_REQUEST['export']); if ($prefs['feature_wiki_export'] != 'y' || $tiki_p_admin_wiki != 'y' || !$tikilib->user_has_perm_on_object($user, $structure_info["pageName"], 'wiki page', 'tiki_p_view')) { $smarty->assign('errortype', 401); $smarty->assign('msg', tra('You do not have permission to view this page.')); $smarty->display("error.tpl"); die; } $structlib->s_export_structure($_REQUEST['export']); } if (isset($_REQUEST['zip']) && $tiki_p_admin == 'y') { check_ticket('admin-structures'); include_once 'lib/wiki/xmllib.php'; $xmllib = new XmlLib(); $zipFile = 'dump/xml.zip'; $config['debug'] = false; if ($xmllib->export_pages(null, $_REQUEST['zip'], $zipFile, $config)) { if (!$config['debug']) { header("location: {$zipFile}"); die; } } else { $smarty->assign('error', $xmllib->get_error()); } } if (isset($_REQUEST['export_tree'])) { check_ticket('admin-structures'); $structure_info = $structlib->s_get_structure_info($_REQUEST['export_tree']); if (!$tikilib->user_has_perm_on_object($user, $structure_info["pageName"], 'wiki page', 'tiki_p_view')) { $smarty->assign('errortype', 401); $smarty->assign('msg', tra('You do not have permission to view this page.')); $smarty->display("error.tpl");
foreach ($_REQUEST['checked'] as $check) { $info = $tikilib->get_page_info($check); $perms = Perms::get(array('type' => 'wiki page', 'object' => $check)); if ($info['flag'] != 'L' && ($globalperms->admin_wiki == 'y' || $perms->lock)) { $wikilib->lock_page($check); } } break; case 'zip': if ($globalperms->admin == 'y') { $access->check_authenticity(tr('Are you sure you want to download a zip of the %0 selected pages?', count($_REQUEST['checked']))); include_once 'lib/wiki/xmllib.php'; $xmllib = new XmlLib(); $zipFile = 'dump/xml.zip'; $config['debug'] = false; if ($xmllib->export_pages($_REQUEST['checked'], null, $zipFile, $config)) { if (!$config['debug']) { header("location: {$zipFile}"); die; } } else { $smarty->assign('error', $xmllib->get_error()); } } break; case 'title': if ($tiki_p_admin == 'y') { $access->check_authenticity(tr('Are you sure you want to modify the %0 pages?', count($_REQUEST['checked'])) . ' ' . tr('No history will be created.')); foreach ($_REQUEST['checked'] as $check) { $info = $tikilib->get_page_info($check); $info['data'] = "!{$check}\r\n" . $info['data'];