Hi how are you all, there is a typo in the cron where the statement about how to make a cron run, firstly in the current cron you have unless you are running this code for the latest cron for xortify.
The file
modules/xortify/cron/serverup.php should read the following for the next 2 series, that is any of 2.3 series or 2.4 series should read:
/**
* @package Xortify
* @subpackage module
* @description Sector Network Security Drone for Robots
* @author Simon Roberts WISHCRAFT
* @copyright copyright (c) 2010-2013 XOOPS.org
* @licence GPL 2.0 - see docs/LICENCE.txt
* @cron Run at Least Once an Hour to five minutes!
*/
function getURLData($URI, $curl=false) {
switch ($curl) {
case true:
if (!$ch = curl_init($URI)) {
trigger_error('Could not intialise CURL file: '.$url);
return false;
}
$cookies = XOOPS_VAR_PATH.'/cache/xoops_cache/croncurl_'.md5($URI).'.cookie';
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, XORTIFY_USER_AGENT);
$data = curl_exec($ch);
curl_close($ch);
return $data;
break;
case false:
return file_get_contents($uri);
break;
}
}
define('XORTIFY_USER_AGENT', 'Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) XOOPS/20100101 XoopsAuth/1.xx (php)');
define("SERVER1", 'http://xortify.chronolabs.coop/unban/');
define("SERVER2", 'http://xortify.com/unban/');
define("REPLACE", 'unban');
define("SOAP", 'soap');
define("CURL", 'curl');
define("JSON", 'json');
define("SERIAL", 'serial');
define("XML", 'xml');
define("SEARCHFOR", 'Solve Puzzle');
foreach (get_loaded_extensions() as $ext){
if ($ext=="curl")
$nativecurl=true;
}
include('../../../mainfile.php');
$module_handler =& xoops_gethandler('module');
$configitem_handler =& xoops_gethandler('configitem');
$xoMod = $module_handler->getByDirname('xortify');
$source = getURLData(SERVER1, $nativecurl);
if (strpos($source, SEARCHFOR)>0) {
$xoMod->setVar('isactive', true);
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_urisoap'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, SOAP, SERVER1));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_uricurl'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, CURL, SERVER1));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_urijson'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, JSON, SERVER1));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_uriserial'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, SERIAL, SERVER1));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_urixml'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, XML, SERVER1));
$configitem_handler->insert($xoConfig[0], true);
}
} else {
$source = getURLData(SERVER2, $nativecurl);;
if (strpos($source, SEARCHFOR)>0) {
$xoMod->setVar('isactive', true);
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_urisoap'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, SOAP, SERVER2));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_uricurl'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, CURL, SERVER2));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_urijson'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, JSON, SERVER2));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_uriserial'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, SERIAL, SERVER2));
$configitem_handler->insert($xoConfig[0], true);
}
$criteria = new CriteriaCompo(new Criteria('conf_modid', $xoMod->getVar('mid')));
$criteria->add(new Criteria('conf_name', 'xortify_urixml'));
$xoConfig = $configitem_handler->getObjects($criteria);
if (is_object($xoConfig[0])) {
$xoConfig[0]->setVar('conf_value', str_replace(REPLACE, XML, SERVER2));
$configitem_handler->insert($xoConfig[0], true);
}
} else {
$xoMod->setVar('isactive', false);
}
}
$module_handler->insert($xoMod, true);
?>
code edited 12:59 AM AEST - 30/03/2011I thought i would take a moment to talk about how to set a cron job you are better off looking it up in google and your webhosting arangements.
On any VPS or Cpanel box there will be an option called cron jobs, where you have to run this file from time to time.
The following error was in the previous file.
//Change This
$xoMod = $module_handler->getByDirname('spiders');
//To
$xoMod = $module_handler->getByDirname('xortify');