1
wishcraft
Xortify 2.3x - 2.4x - Cron Job for CURL and wGET

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($chCURLOPT_HEADER0);
                
curl_setopt($chCURLOPT_POST1);
                
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
                
curl_setopt($chCURLOPT_COOKIEJAR$cookies); 
                
curl_setopt($chCURLOPT_RETURNTRANSFER1); 
                
curl_setopt($chCURLOPT_USERAGENTXORTIFY_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($sourceSEARCHFOR)>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(REPLACESOAPSERVER1));
            
$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(REPLACECURLSERVER1));
            
$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(REPLACEJSONSERVER1));
            
$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(REPLACESERIALSERVER1));
            
$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(REPLACEXMLSERVER1));
            
$configitem_handler->insert($xoConfig[0], true);
        }
        
    } else {
        
$source getURLData(SERVER2$nativecurl);;
        if (
strpos($sourceSEARCHFOR)>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(REPLACESOAPSERVER2));
                
$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(REPLACECURLSERVER2));
                
$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(REPLACEJSONSERVER2));
                
$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(REPLACESERIALSERVER2));
                
$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(REPLACEXMLSERVER2));
                
$configitem_handler->insert($xoConfig[0], true);
            }
                                
        } else {
            
$xoMod->setVar('isactive'false);
        }
    }    
    
$module_handler->insert($xoModtrue);
?>

code edited 12:59 AM AEST - 30/03/2011

I 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');
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

2
wishcraft
Re: Xortify 2.3x - 2.4x - Chronolabs & Download Xortify

btw, chronolabs.coop will be down temporarily while we image to another server, still moving into the new toys in the datafarm, this may be one of the last times.

Mirror for Xortify 2.4 & Earlier versions - Click Here for Xortify
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

3
Mamba
Re: Xortify 2.3x - 2.4x - Chronolabs & Download Xortify
  • 2011/3/29 14:54

  • Mamba

  • Moderator

  • Posts: 11378

  • Since: 2004/4/23


Quote:
btw, chronolabs.coop will be down temporarily

Simon, I went to one of you Websites that you've submitted to our Weblinks, clicked on two links there (About, and Join Us), and after the second one (Join Us: modules/profile/register.php), I got banned

It tells me to go to you Chronolabs site, but since it will be down, how could people unban themselves? Especially since it the ban will be valid across all the sites using Xortify?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

4
trabis
Re: Xortify 2.3x - 2.4x - Cron Job for CURL and wGET
  • 2011/3/29 18:45

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I went to chronolabs by visting this link posted on ogr3:
http://www.chronolabs.coop/forums/makepayment/0,8,0,0,100,0,DESC,0

Then I clicked in the home page, then I clicked on forum and I was banned. I went to front page again and I was really banned!

I clicked on link bellow the image and I went to xortify banned list instead of going to xortify unbanned list.

I've tried to unban myself by entering the captcha and hiting the submit button. I was taken to an empty list of latest unbanned Ips with a submit button. I hit that submit button and then went back to chronolabs.com. I was faced with the banned image again.

Please fix it.

5
Mamba
Re: Xortify 2.3x - 2.4x - Cron Job for CURL and wGET
  • 2011/3/31 18:42

  • Mamba

  • Moderator

  • Posts: 11378

  • Since: 2004/4/23


Trabis, now that I am banned by Xortify, I cannot access your Webiste

Good thing: Xortify seems to work in blocking banned people.

Bad news: I go to Wishcraft's Website to un-ban myself:

http://xortify.chronolabs.coop/ban/index.php

but my every attempt fails, telling me: "Member item updated unsuccessfully"

So unless Wishcraft fixes it, I'll be banned now for 3 months

Question to Wishcraft: in the form you have * for every question, e.g.

Mac Address:*

Does it mean that it's mandatory to fill it out? If yes, how should I know all the details?

Quote:
IPv4:*
IPv6:*
Proxy IPv4:*
Proxy IPv6:*
Network Address:*
Mac Address:*
Email Address:*
Category:*
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

6
trabis
Re: Xortify 2.3x - 2.4x - Cron Job for CURL and wGET
  • 2011/3/31 20:49

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


@mamba,
I think you need to go to the unban page:
http://xortify.chronolabs.coop/unban/index.php

It may take up to 20 minutes to get access back. It will depend on the settings of the site and the time remaining for the cache to expire.
I think I was unbanned because I can now access chronolabs, but I'm not sure, I did not get a confirmation message.

@simon
I think a cron job for getting ban lists would be good addition. It would make page load fast for users and we could schedule it "every minute". At this moment once every 20 minutes, a user will experience a slow page load. That is not optimal for that user, and it is not optimal for users waiting to be unbanned.

I also wonder how xortify defines a bad user. How many bad user votes are required for a ban?

Xortify should do some maths instead of banning everything that moves.


7
Mamba
Re: Xortify 2.3x - 2.4x - Cron Job for CURL and wGET
  • 2011/3/31 21:10

  • Mamba

  • Moderator

  • Posts: 11378

  • Since: 2004/4/23


Quote:
I think you need to go to the unban page:
http://xortify.chronolabs.coop/unban/index.php

This is funny!

This is what is on your Website:
Quote:

Resized Image

You have been Banned by Xortify!

IP Bans that is a ban that is based on your IP Can be removed by going to XORTIFY DOT CHRONOLABS DOT COOP
This ban is not permenant and will drop in 3 months!

where the link to be un-banned, points to:

http://xortify.chronolabs.coop/modules/ban/

Simon, can you change it PLEASE?

Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

8
trabis
Re: Xortify 2.3x - 2.4x - Cron Job for CURL and wGET
  • 2011/3/31 21:44

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


trabis said:
Quote:
I clicked on link bellow the image and I went to xortify banned list instead of going to xortify unbanned list.



Login

Who's Online

481 user(s) are online (95 user(s) are browsing Support Forums)


Members: 0


Guests: 481


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits