/** * Delete all sitemaps named : '*_sitemap.xml' '*_sitemap.xml.gz' 'sitemap_index.xml' * * @return boolean FALSE on any fails */ final function remove_sitemaps() { $path = vB5_Route_Admincp::resolvePath(vB::getDatastore()->getOption('sitemap_path')); $success = true; $all = scandir($path); foreach ($all as $filename) { $is_index_file = ($filename == $this->sitemap_index_filename . '.xml' or $filename == $this->sitemap_index_filename . '.xml.gz'); $is_sitemap_file = (substr($filename, 0, strlen($this->sitemap_filename_prefix)) == $this->sitemap_filename_prefix and (substr($filename, -4) == '.xml' or substr($filename, -7) == '.xml.gz')); if ($is_index_file or $is_sitemap_file) { if (!@unlink("{$path}/{$filename}")) { $this->errors[] = "No Permission to delete sitemap : {$path}/{$filename}"; $success = false; } } } return $success; }
$vbulletin->input->clean_array_gpc('r', $fields); $vbulletin->input->clean_array_gpc('f', array('stylefile' => vB_Cleaner::TYPE_FILE)); // Legacy Hook 'admin_style_import' Removed // //only do multipage processing for a local file. If we do it for an uploaded file we need //to figure out how to //a) store the file locally so it will be available on subsequent page loads. //b) make sure that that location is shared across an load balanced servers (which // eliminates any php tempfile functions) // got an uploaded file? // do not use file_exists here, under IIS it will return false in some cases if (is_uploaded_file($vbulletin->GPC['stylefile']['tmp_name'])) { $xml = file_read($vbulletin->GPC['stylefile']['tmp_name']); $startat = null; $perpage = null; } else { $serverfile = vB5_Route_Admincp::resolvePath(urldecode($vbulletin->GPC['serverfile'])); if (file_exists($serverfile)) { $xml = file_read($serverfile); $startat = $vbulletin->GPC['startat']; $perpage = 10; } else { print_stop_message2('no_file_uploaded_and_no_local_file_found_gerror'); } } // themes check. $xmlobj = new vB_XML_Parser($xml); $parsedXML = $xmlobj->parse(); if (!empty($parsedXML['guid'])) { // it's a theme! // if overwrite isn't set, let's check if the theme already exists, and redirect to a overwrite confirmation page. if (empty($vbulletin->GPC['overwrite'])) {
@ob_end_clean(); header('Content-Encoding:'); } // #################### DEFINE IMPORTANT CONSTANTS ####################### //define('THIS_SCRIPT', 'xmlsitemap'); //define('BYPASS_FORUM_DISABLED', true); //define('CSRF_PROTECTION', true); // ################### PRE-CACHE TEMPLATES AND DATA ###################### global $vbulletin; // ######################### REQUIRE BACK-END ############################ require_once dirname(__FILE__) . '/global.php'; // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $vbulletin->input->clean_array_gpc('r', array('fn' => TYPE_STR)); $sitemap_path = vB5_Route_Admincp::resolvePath(vB::getDatastore()->getOption('sitemap_path')); if ($vbulletin->GPC['fn']) { $sitemap_filename = preg_replace('#[^a-z0-9_.]#i', '', $vbulletin->GPC['fn']); $sitemap_filename = preg_replace('#\\.{2,}#', '.', $sitemap_filename); if (substr($sitemap_filename, -4) != '.xml' and substr($sitemap_filename, -7) != '.xml.gz') { $sitemap_filename = ''; } } else { if (file_exists($sitemap_path . '/vbulletin_sitemap_index.xml.gz')) { $sitemap_filename = 'vbulletin_sitemap_index.xml.gz'; } else { if (file_exists($sitemap_path . '/vbulletin_sitemap_index.xml')) { $sitemap_filename = 'vbulletin_sitemap_index.xml'; } else { $sitemap_filename = ''; }