function submit($option) { global $stack, $mainframe; // get values from gui of script $website = JRequest::getVar('http_host', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); if (substr($website, -1) != "/") { $website = $website . "/"; } $page_root = JRequest::getVar('document_root', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $sitemap_file = $page_root . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $sitemap_url = $website . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $sitemap_form = JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $priority = JRequest::getVar('priority', '1.0', 'POST', 'STRING', JREQUEST_ALLOWHTML); $forbidden_types = toArray(JRequest::getVar('forbidden_types', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML)); $exclude_names = toArray(JRequest::getVar('exclude_names', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML)); $freq = JRequest::getVar('freq', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $modifyrobots = JRequest::getVar('robots', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $method = JRequest::getVar('method', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $level = JRequest::getVar('levels', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $maxcon = JRequest::getVar('maxcon', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $timeout = JRequest::getVar('timeout', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $whitelist = JRequest::getVar('whitelist', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $priority >= 1 ? $priority = "1.0" : null; $xmlconfig = genConfig($priority, $forbidden_types, $exclude_names, $freq, $method, $level, $maxcon, $sitemap_form, $page_root, $timeout); if (substr($page_root, -1) != "/") { $page_root = $page_root . "/"; } $robots = @JFile::read($page_root . 'robots.txt'); preg_match_all("/Disallow:(.*?)\n/", $robots, $pos); if ($exclude_names[0] == "") { unset($exclude_names[0]); } foreach ($pos[1] as $disallow) { $disallow = trim($disallow); if (strpos($disallow, $website) === false) { $disallow = $website . $disallow; } $exclude_names[] = $disallow; } $forbidden_strings = array("print=1", "format=pdf", "option=com_mailto", "component/mailto", "/mailto/", "mailto:", "login", "register", "reset", "remind"); foreach ($exclude_names as $name) { $name != "" ? $forbidden_strings[] = $name : null; } $stack = array(); $s = microtime(true); if ($whitelist == "yes") { AntiFloodControl($website); } $file = genSitemap($priority, getlinks($website, $forbidden_types, $level, $forbidden_strings, $method, $maxcon, $timeout), $freq, $website); writeXML($file, $sitemap_file, $option, $sitemap_url); writeXML($xmlconfig, $page_root . "/administrator/components/com_jcrawler/config.xml", $option, $sitemap_url); $mainframe->enqueueMessage("total time: " . round(microtime(true) - $s, 4) . " seconds"); if ($modifyrobots == 1) { modifyrobots($sitemap_url, $page_root); } HTML_jcrawler::showNotifyForm($option, $sitemap_url); }
function writeNotice($type, $simple) { // Generate the XML data $xml = '<type>' . $type . '</type> <notice>' . stripslashes(htmlspecialchars($simple)) . '</notice>'; // Write this data writeXML('conf', 'notice', $xml); }
// Developer mode if (isset($_POST['developer']) && $_POST['developer'] == 'on') { $developer = 'on'; } else { $developer = 'off'; } // Generate the configuration XML content $conf_xml = '<name>' . $service_name . '</name> <desc>' . $service_desc . '</desc> <owner_name>' . $owner_name . '</owner_name> <owner_website>' . $owner_website . '</owner_website> <legal>' . $legal . '</legal> <resource>' . $jappix_resource . '</resource> <lock>' . $lock_host . '</lock> <anonymous>' . $anonymous_mode . '</anonymous> <http_auth>' . $http_auth . '</http_auth> <registration>' . $registration . '</registration> <bosh_proxy>' . $bosh_proxy . '</bosh_proxy> <manager_link>' . $manager_link . '</manager_link> <groupchats_join>' . $groupchats_join . '</groupchats_join> <groupchats_suggest>' . $groupchats_suggest . '</groupchats_suggest> <encryption>' . $encryption . '</encryption> <https_storage>' . $https_storage . '</https_storage> <https_force>' . $https_force . '</https_force> <compression>' . $compression . '</compression> <multi_files>' . $multi_files . '</multi_files> <developer>' . $developer . '</developer> <statistics>' . $statistics . '</statistics>'; // Write the main configuration writeXML('conf', 'main', $conf_xml);
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"/> <meta content="width=device-width, initial-scale=1.0" name="viewport"/> <title>UOIT - Event Calendar</title> <meta content="Register" name="description"/> <meta content="Register" name="keywords"/> <meta content="index, follow" name="robots"/> <meta content="UOIT" name="author"/> <link rel="stylesheet" href="css/normalize.css" /> <link rel="stylesheet" href="css/fonts.css" /> <link rel="stylesheet" href="css/foundation.min.css" /> <link rel="stylesheet" href="css/foundation-icons.css" /> <link rel="stylesheet" href="css/fullcalendar.css" /> <link rel="stylesheet" href="css/main.css" /> <script src="js/vendor/modernizr.js"></script> <script src="js/vendor/jquery-1.11.3.min.js"></script> <script src="js/vendor/moment.min.js"></script> <script src="js/vendor/fullcalendar.js"></script> </head> <body> <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/eventcalendar/inc/functions.php'; // output feed.xml as RSS and check for archived events writeXML($link); checkArchived($link);
} catch (Exception $e) { $log .= "loadContent: " . $e->getMessage() . "<br/>"; } $uniqueId = $game->getUniqueId(); // creo carpeta destino $dirToWrite = $tmpDir . "/{$uniqueId}"; echo "<li> creating temp dir <b>{$dirToWrite}</b>...</li>"; exec("mkdir {$dirToWrite}"); echo "<li> creating meta dir <b>{$dirToWrite}/meta</b>...</li>"; exec("mkdir {$dirToWrite}/meta"); try { //SI y solo SI se descargan JAD Y JAR puedo crear el XML y el ZIP if ($game->downloadBinaries($dirToWrite)) { $i++; $xmlContent = $game->genXML(); writeXML($xmlContent, $dirToWrite . "/meta/" . $xmlFile); $ds = writeZIP($dirToWrite, $contentId, $game->getVersion()); if ($primera_version) { /*echo '<h2>Subir este zip PRIMERO</h2>'; echo "<div style=\"margin: 0 auto; text-align: center; font-size: 20px\">Nombre del Zip generado <a href='".$ds['path']."'>".$ds['path']."</a>, <b>".$ds['size']."</b></div><br/>\n"; */ $main_zip = $ds['path']; } else { $zips_generados[] = $ds; // echo "<div style=\"margin: 0 auto; text-align: center; font-size: 20px\"> // Nombre del Zip generado ".$ds['path']."<b>".$ds['size']."</b></div><br/>\n"; } emptyDir($dirToWrite); } else { echo '<li>ERROR al descargar binarios, zip no generado...</li>'; }
function writeSimpleXML($xml_obj, $name, &$no_data_flg) { if (isset($xml_obj->title)) { if ($xml_obj->title == $name) { writeXML($xml_obj->lead, $name, "simple"); $no_data_flg = false; } else { echo "{$name} simple xml is not defined\n"; } } return $no_data_flg; }
if (isset($_POST['host_bosh_mini']) && !empty($_POST['host_bosh_mini'])) { $host_bosh_mini = stripslashes(htmlspecialchars($_POST['host_bosh_mini'])); } else { $host_bosh_mini = stripslashes(htmlspecialchars($hosts_default['bosh_mini'])); } // Static host if (isset($_POST['host_static']) && !empty($_POST['host_static'])) { $host_static = stripslashes(htmlspecialchars($_POST['host_static'])); } else { $host_static = stripslashes(htmlspecialchars($hosts_default['static'])); } // Upload host if (isset($_POST['host_upload']) && !empty($_POST['host_upload'])) { $host_upload = stripslashes(htmlspecialchars($_POST['host_upload'])); } else { $host_upload = stripslashes(htmlspecialchars($hosts_default['upload'])); } // Generate the hosts XML content $hosts_xml = '<main>' . $host_main . '</main> <muc>' . $host_muc . '</muc> <pubsub>' . $host_pubsub . '</pubsub> <vjud>' . $host_vjud . '</vjud> <anonymous>' . $host_anonymous . '</anonymous> <bosh>' . $host_bosh . '</bosh> <bosh_main>' . $host_bosh_main . '</bosh_main> <bosh_mini>' . $host_bosh_mini . '</bosh_mini> <static>' . $host_static . '</static> <upload>' . $host_upload . '</upload>'; // Write the main configuration writeXML('conf', 'hosts', $hosts_xml);
function manageUsers($action, $array) { // Try to read the old XML file $users_array = getUsers(); // What must we do? switch ($action) { // Add some users case 'add': foreach ($array as $array_user => $array_password) { $users_array[$array_user] = genStrongHash($array_password); } break; // Remove some users // Remove some users case 'remove': foreach ($array as $array_user) { // Not the last user? if (count($users_array) > 1) { unset($users_array[$array_user]); } } break; } // Regenerate the XML $users_xml = ''; foreach ($users_array as $users_name => $users_password) { $users_xml .= "\n" . ' <user name="' . stripslashes(htmlspecialchars($users_name)) . '" password="******" />'; } // Write the main configuration writeXML('conf', 'users', $users_xml); }
} } } } } } } } $temp = "\"{$row_xmlw['w_id']}\""; $xmlstore .= "\t<row id=\"{$counter}\">\n"; $xmlstore .= "\t\t<cell>" . $month . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['report_year'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['itm_name'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['wh_name'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . number_format($row_xmlw['wh_obl_a']) . "</cell>\n"; $xmlstore .= "\t\t<cell>" . number_format($row_xmlw['wh_received']) . "</cell>\n"; $xmlstore .= "\t\t<cell>" . number_format($row_xmlw['wh_issue_up']) . "</cell>\n"; $xmlstore .= "\t\t<cell>" . number_format($row_xmlw['wh_adja']) . "</cell>\n"; $xmlstore .= "\t\t<cell>" . number_format($row_xmlw['wh_adjb']) . "</cell>\n"; $xmlstore .= "\t\t<cell>" . number_format($row_xmlw['wh_cbl_a']) . "</cell>\n"; $xmlstore .= "\t</row>\n"; $counter++; } } $xmlstore .= "</rows>\n"; $handle = fopen($xmlfile_path, 'w'); fwrite($handle, $xmlstore); } //Put XML file name and mysql table name simultaniously writeXML('whreport.xml');
function getOAI($theBaseUrl, $theExtension, $theVerb) { global $rounds, $errorlog, $testmode, $splitfiles, $targetdir, $logHandle; $rounds++; echo 'Round ' . $rounds . "\n"; $time_start = microtime_float(); $url = $theBaseUrl . $theExtension; if ($testmode) { $xml = file_get_contents($theBaseUrl); } else { $xml = getXML($url, $theVerb); } message('Collecting ' . $url, false); echo 'Data received: ' . strlen($xml) . " Bytes.\n"; // build DOM $dom = new DOMDocument(); if (!$dom->loadXML($xml)) { message('could not build DOM for ' . $url, true); file_put_contents($targetdir . 'error.xml', $xml); return; } // get error $errorNode = $dom->getElementsByTagName('error'); if ($errorNode->length) { echo "Error encountered!\n"; $error = $errorNode->item(0)->nodeValue; if ($error) { message('retrieving ' . $url . ":\n" . $error, true); return; } } // get responseDate $node = $dom->getElementsByTagName('responseDate'); if ($node->length) { $responseDate = $node->item(0)->nodeValue; echo "responseDate: {$responseDate}\n"; } // retrieve request $requests = $dom->getElementsByTagname('request'); if ($requests->length) { $request = $requests->item(0); $fullRequest = $request->nodeValue . '?'; if ($request->hasAttribute('verb')) { $fullRequest .= 'verb=' . $request->getAttribute('verb'); } if ($request->hasAttribute('metadataPrefix')) { $fullRequest .= '&metadataPrefix=' . $request->getAttribute('metadataPrefix'); } if ($request->hasAttribute('set')) { $fullRequest .= '&set=' . $request->getAttribute('set'); } echo "request: {$fullRequest}\n"; } fwrite($logHandle, 'Request: ' . $url . "\rDate: " . $responseDate . "\r"); // rewrite file with instructive name and separated lines (better for grep!) if (!$splitfiles) { $fullRequest = str_replace('metadataPrefix', 'mP', $fullRequest); $fullRequest = str_replace('http://', '', $fullRequest); $fullRequest = str_replace('ListRecords', 'LR', $fullRequest); $fullRequest = str_replace('ListIdentifiers', 'LI', $fullRequest); $theFilename = strtr(trim($fullRequest), '/:', '_-') . '-' . $rounds . '.xml'; $xml = str_replace('><', ">\n<", $xml); file_put_contents($targetdir . $theFilename, $xml); } else { $test = writeXML($dom, $url); } //auf Platte schreiben echo "XML written!\n"; //get resumptionToken $node = $dom->getElementsByTagName('resumptionToken'); if ($node->length) { $theExtension = $node->item(0)->nodeValue; return $theExtension; } else { return ""; } }
} } } } } } } } $temp = "\"{$row_xmlw['w_id']}\""; $xmlstore .= "\t<row id=\"{$counter}\">\n"; $xmlstore .= "\t\t<cell>" . $month . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['report_year'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['itm_name'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['wh_name'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['fld_obl_a'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['fld_recieved'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['fld_issue_up'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['fld_adja'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['fld_adjb'] . "</cell>\n"; $xmlstore .= "\t\t<cell>" . $row_xmlw['fld_cbl_a'] . "</cell>\n"; $xmlstore .= "\t</row>\n"; $counter++; } } $xmlstore .= "</rows>\n"; $handle = fopen($xmlfile_path, 'w'); fwrite($handle, $xmlstore); } //Put XML file name and mysql table name simultaniously writeXML('freport.xml');
/** * Main wrapper function for submit task * - get parameters from the form * - save config * - do several checks * - call main crawling function (getLinks) to get all the links at once * - complete it with priority information * - generate sitemap XML file * * @param string $option the component name * @return nothing */ function submit($option) { $db =& JFactory::getDBO(); $query = "TRUNCATE TABLE `#__jcrawler_urls`"; $db->setQuery($query); $db->query(); $app =& JFactory::getApplication(); // get parameters from gui of script if (!defined('HTTP_HOST')) { define('HTTP_HOST', JRequest::getVar('http_host', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML)); } $website = HTTP_HOST; if (substr($website, -1) != "/") { $website = $website . "/"; } $page_root = JRequest::getVar('document_root', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $sitemap_file = $page_root . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $sitemap_url = $website . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $sitemap_form = JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $priority = JRequest::getVar('priority', '1.0', 'POST', 'STRING', JREQUEST_ALLOWHTML); $forbidden_types = toTrimmedArray(JRequest::getVar('forbidden_types', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML)); $exclude_names = toTrimmedArray(JRequest::getVar('exclude_names', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML)); $freq = JRequest::getVar('freq', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $modifyrobots = JRequest::getVar('robots', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $method = JRequest::getVar('method', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $level = JRequest::getVar('levels', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $maxcon = JRequest::getVar('maxcon', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $timeout = JRequest::getVar('timeout', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); $whitelist = JRequest::getVar('whitelist', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML); if ($priority >= 1) { $priority = "1.0"; } $xmlconfig = genConfig($priority, $forbidden_types, $exclude_names, $freq, $method, $level, $maxcon, $sitemap_form, $page_root, $timeout); if (substr($page_root, -1) != "/") { $page_root = $page_root . "/"; } $robots = @JFile::read($page_root . 'robots.txt'); preg_match_all("/Disallow:(.*?)\n/", $robots, $pos); if ($exclude_names[0] == "") { unset($exclude_names[0]); } foreach ($pos[1] as $disallow) { $disallow = trim($disallow); if (strpos($disallow, $website) === false) { $disallow = $website . $disallow; } $exclude_names[] = $disallow; } $forbidden_strings = array("print=1", "format=pdf", "option=com_mailto", "component/mailto", "/mailto/", "mailto:", "login", "register", "reset", "remind"); foreach ($exclude_names as $name) { if ($name != "") { $forbidden_strings[] = $name; } } $s = microtime(true); if ($whitelist == "yes") { AntiFloodControl($website); } $file = genSitemap($priority, getLinks($website, $forbidden_types, $level, $forbidden_strings, $method, $maxcon, $timeout), $freq, $website); writeXML($file, $sitemap_file, $option, $sitemap_url); writeXML($xmlconfig, $page_root . "/administrator/components/com_jcrawler/config.xml", $option, $sitemap_url); $app->enqueueMessage("total time: " . round(microtime(true) - $s, 4) . " seconds"); if ($modifyrobots == 1) { modifyrobots($sitemap_url, $page_root); } require_once JApplicationHelper::getPath('admin_html', 'com_jcrawler'); HTML_jcrawler::showNotifyForm($option, $sitemap_url); }
/** Globaler Sessionstorage bei Bedarf initialisieren. */ if (!isset($_SESSION['Kategorie'])) { $_SESSION['Kategorie'] = "all"; } if (isset($_POST) && !empty($_POST)) { if (isset($_POST['titel']) && isset($_POST['untertitel']) && isset($_POST['text']) && isset($_POST['foto']) && isset($_POST['autor_id']) && isset($_POST['kategorie_id'])) { saveData($_POST); } if (isset($_POST['action']) && $_POST['action'] == 'delete') { deleteNews($_POST['news_id']); } if ($_POST['action'] == 'search') { search($_POST['search']); } if (isset($_POST['action']) && $_POST['action'] == 'xml') { writeXML(); } } function sqlConnect() { $user = '******'; $password = ''; $connection = mysqli_connect('localhost', $user, $password, "data"); if (mysqli_connect_errno()) { echo "Keine Datenbankverbindung möglich: " . mysqli_connect_errno(); } return $connection; } /** * [saveData description] * @param [type] $array [description]
_e("Services installation"); ?> </h3> <p><?php _e("You can install some extra softwares on your server, to extend your Jappix features. Some others might be modified, because of security restrictions which are set by default."); ?> </p> <p><?php _e("To perform this, you must be able to access your server's shell and be logged in as root. Remember this is facultative, Jappix will work without these modules, but some of its features will be unavailable."); ?> </p> <?php // Write the installed marker writeXML('conf', 'installed', '<installed>true</installed>'); // Checks some services are installed $services_functions = array('gd_info', 'curl_init'); $services_names = array('GD', 'cURL'); $services_packages = array('php5-gd', 'php5-curl'); for ($i = 0; $i < count($services_names); $i++) { $service_class = 'info smallspace'; // First info? if ($i == 0) { $service_class .= ' first'; } // Service installed? if (function_exists($services_functions[$i])) { ?> <p class="<?php echo $service_class;