• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Should we do something about the abuse within the (free) hosting industry ??

@Programmers should start to study ... http://hostinquest.com/usage that location ....
I fail to see how most of this will be used if it is "silently" integrated into cPanel. By silently I mean that is should require no extra user intervention.
Chris

If you just read the previous posts ....

Now I know what I need from programmers, I decided that restricting the API to cPanel/WHM will do exactly that, restrict it, so instead of aiming at cPanel, I'll write a generic API that can recieve and transmit certain account data and carry out commands on data it recieved, and what I need other people to do is write the packages that will allow the api the most interaction it can get from their favourite server software / signup script, I once the api and site are written I will provide a generic signup script and also the cpanel one, but some others are needed to maximize use ( and the data we store ) .....

The API recieves data by POST or GET and sends back a well formatted XML document with the results of the request ..... you have SSL available too ....

When I have a list of functions you can carry out and have written some docs on the site, I'll post again and update, in the mean time though, is anyone up for doing anything, please post what you plan to write for so that we dont have a load of copies of everything .... or if you're up for doing the generic one or cpanel package that would be great ....

I realise that some of the functions cpanel won't be able to use, but that wont stop it using basic functions to see if an account is hosted and all the things we discussed at the begining of the thread ....

There isn't a signup script that can't use this api, you could even use it with javascript, by inserting a little bit of code in whatever form is taking your signup you can check the content of the form before whatever signup script you use is even invoked ...... same serverside but because a lot of client management systems are encoded or incredibly complicated, using javascript is actually quite appealing .......... other things like suspensions and stuff are a little more tricky, but I'm sure we'll work it out somehow ...
 
Last edited:
Yeah it's wierd, I really would like there to be an indentation on the <ul> though so I can use it for the usage page too ....

EDIT : I got it, the margin really is back this time ....
 
Last edited:
What extra information ??

PHP:
<?php
/**
 * A SimpleXML and cURL Implementation of the HostInquest API
 * @package inquest
 * @author J Watkins <krakjoe@krakjoe.info>
 * @copyright 2007 Hostinquest.com
 */
class inquest
{
	/**
	 * Email address you registered on hostinquest.com
	 *
	 * @var string
	 */
	var $email ;
	/**
	 * Your activated API key
	 *
	 * @var string
	 */
	var $key ;
	/**
	 * Use SSL when connecting with Hostinquest.com
	 *
	 * @var bool
	 */
	var $ssl ;
	/**
	 * cURL Resource
	 *
	 * @var resource
	 */
	var $curl ;
	/**
	 * Object ready to operate
	 *
	 * @var bool
	 */
	var $loaded ;
	/**
	 * Cached XML
	 *
	 * @var string
	 */
	var $cache ;
	/**
	 * Parsed XML object
	 *
	 * @var object
	 */
	var $xml ;
	/**
	 * Errors array
	 *
	 * @var array
	 */
	var $errors ;
	
	/**
	 * Construct Object
	 *
	 * @param string $email
	 * @param string $key
	 * @param bool $ssl
	 * @return inquest
	 * 
	 * <code><?php $inquest = new inquest( 'email', 'key', true ); ?></code>
	 */
	
	function inquest( $email, $key, $ssl = false )
	{
		$this->email = $email ;
		$this->key = $key ;
		$this->ssl = $ssl;
		$this->curl = $curl ;
		$this->loaded = false ;
		$this->cache = null ;
		$this->xml = null ;
		$this->errors = array( );
		
		if( function_exists( 'curl_init' ) )
		{
			if( ( $this->curl = curl_init( sprintf( 'http%s://hostinquest.com/api', $this->ssl ? 's' : '' ) ) ) )
			{
				if( $this->ssl )
				{
					if( !curl_setopt( $this->curl, CURLOPT_SSL_VERIFYHOST, false ) or 
						!curl_setopt( $this->curl, CURLOPT_SSL_VERIFYPEER, false ) )
						{
							$this->error( __METHOD__, "cannot setup SSL", $this->cerror( ) );
						}
				}
				if( !curl_setopt( $this->curl, CURLOPT_RETURNTRANSFER, true ) or 
					!curl_setopt( $this->curl, CURLOPT_HEADER, 0 ) or 
					!curl_setopt( $this->curl, CURLOPT_POST, true ) )
				{
					$this->error( __METHOD__, "cannot setup curl transfer", $this->cerror( ) );
				}
				$this->loaded( );
			}
			else $this->error( __METHOD__, "cannot setup curl", $this->cerror( ) );
		}
		else $this->error( __METHOD__, "requires curl_init" );
	}
	/**
	 * Get last cURL error
	 *
	 * @return string
	 * 
	 * <code><?php echo $inquest->cerror( ); ?></code>
	 */
	function cerror( )
	{
		if( ( $errno = curl_errno( $this->curl ) ) and
			( $errstr = curl_error( $this->curl ) ) )
		{
			return sprintf( '%d : %s', $errno, $errstr );
		}
	}
	/**
	 * Add an error to the errors array
	 *
	 * @param string $method
	 * @param string $message
	 * @param string $extra
	 * 
	 * <code><?php $inquest->error( __METHOD__, 'an error occured' ); ?></code>
	 */
	function error( $method, $message, $extra = null )
	{
		$this->errors[ ] = sprintf( '%s %s%s', $method, $message, $extra ? sprintf( ' %s', $extra ) : '' ) ;	
	}
	/**
	 * Lazy, return errors array
	 *
	 * @return array
	 * 
	 * <code><?php $errors = $inquest->errors( ); ?></code>
	 */
	function errors( )
	{
		return $this->errors ;
	}
	/**
	 * Determine if object is ready for operation
	 *
	 * @return bool
	 * 
	 * <code><?php if( $inquest->loaded( ) ) echo 'Loaded'; ?></code>
	 */
	function loaded( )
	{
		$this->loaded = count( $this->errors( ) ) == 0 ? true : false ;
		
		return $this->loaded ;
	}
	/**
	 * Returns raw xml from an API request
	 *
	 * @param string $function
	 * @param array $params
	 * @return string
	 * 
	 * <code><?php echo $inquest->call( 'enter', array( 'service' => 'myhost.com', 'domain' => 'thehosted.com', 'umail' => 'them@thehosted.com' ) ); ?></code>
	 */
	function call( $function, $params = array( ) )
	{
		$request[ ] = sprintf('email=%s', urlencode( $this->email ) ) ;
		$request[ ] = sprintf('key=%s', $this->key );
		
		if( count( $params ) > 0 )
		{
			foreach( $params as $key => $value )
			{
				$request[ ] = sprintf('%s=%s', $key, urlencode( $value ) );
			}
		}
		if( !curl_setopt( $this->curl, CURLOPT_POSTFIELDS, implode( '&', $request ) ) )
		{
			$this->error( __METHOD__, 'cannot setup post data', $this->cerror( ) );
		}
		if( !( $result = curl_exec( $this->curl ) ) )
		{
			$this->error( __METHOD__, 'cannot send HTTP request', $this->cerror( ) );
		}
		else return $result ;
	}
	/**
	 * Parse XML from an API call
	 *
	 * @param string $function
	 * @param array $params
	 * @return string
	 * 
	 * <code><?php $xml = $inquest->xml( 'enter', array( 'service' => 'myhost.com', 'domain' => 'thehosted.com', 'umail' => 'them@thehosted.com' ) ); ?></code>
	 */
	function xml( $function, $params = array( ) )
	{
		if( ( $this->cache = $this->call( $function, $params ) ) )
		{
			$this->xml = new SimpleXMLElement( $this->cache );
			
			if( !$this->xml->error and !$this->xml->errors )
			{
				return $this->xml->inquest ;
			}
			elseif( $this->xml->error )
			{
				$this->error( __METHOD__, sprintf( "recieved %s from HostInquest API", $this->xml->error ) );
			}
			elseif( $this->xml->errors )
			{
				foreach( $this->xml->errors as $error )
				{
					$this->error( __METHOD__, sprintf( "recieved %s from HostInquest API", $this->xml->error ) );
				}
			}
		}
	}
	/**
	 * Return cached raw xml
	 *
	 * @return string
	 * 
	 * <code><?php echo $inquest->cache( ); ?></code>
	 */
	function cache( )
	{
		return $this->cache ;
	}
}
$inquest = new inquest( 'registered@email.com', 'APIKEY', true );

if( $inquest->loaded( ) )
{
	$inquest->xml( 'check' ); // this will fail, the function doesn't exist, just want some data
	echo "<pre>";
	print_r( $inquest ); // heres the data .....
}
?>
..... some tests ..... and possibly starting place ...
 
I meen, we should have an optional field for free / paid then...
If($krakjoe == "dontwantto"){
echo "ok";
} else {
echo "cool";
}
 
I must be missing something, why would it matter if the account is free or paid ? the data is the same either way .....
 
Helps track abuse better... it catagorises people better.. there can be more than one chris22 user account if you get what i mean.
Chris
 
Sorry, I don't see what you're getting at, I'm not going to keep free and paid data seperate, there's no need ......
 
Also Joes right, as it might help to cross reference abusers from time to time. An abuser using free hosting just might switch to paid, and at that stage it seems stupid to not grant paid host customers with the information they need, just because it came from a freehost member of the database, and the end of the day, these people are either going to have different user names or different emails so identification shouldnt be too hard.
 
I'm not storing usernames, the only information transmitted is the server that will be doing the hosting ( eg. hozter.info ), the domain that will be hosted ( eg. newdomain.com ), and the email address that requested the account ( eg a ruddy email address ), so when a new user is created on your server we wont know the name of that client, or their address or any other personal information, just the domain name ( because people keep those, even if they ask for the same subdomain, you can regex match on the xml for subdomains on other servers with the same name ), and the email address ( because people also keep those, again if they change it a little bit, you can define your own functions for trying to match slightly different versions of the same address ), it all depends on how strict you want to be and also how much you want to trust the data we provide ..... the best way to give end users ( thats people with servers ) total control is to provide all the same information for everyone on everything, then the application you make from it is totally down to you - you have everything you need to be as loose or as strict as you like, you can ignore things or not, but I'm not going to make that choice for you and I don't believe it should be made by the type of hosting you run, abuse is abuse and hosting is hosting ......
 
Don't get me wrong, this is not the final version of this software, I plan to run this for a few months gather suggestions from people, iron out the creases you know, but for the moment, I think making it generic as I can is the best approach so that if someone wants to try and make their software or software they use work with it they have the best chance of doing that. There are so many softwares out there that could work with it, it's impossible to target one ( or indeed, all ) of them - and also not sensible to try.

There is far more that I want to add, even now, however I'm holding back so as not to scare people off, there is a fine line between fully featured and bloated and to cross that line on the first revision is a big mistake, in any field of software development.
 
Gonna do a rewrite this weekend, I gotta few emails on the subject, I'm gonna say it's gonna take the rest of this month to get what I want, so if you were planning on developing something based on the current information I have given, please hold off untill I post again ....

Thanks
 
Back
Top