• 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 ??

Thanks for that Joe, I realised that actually when posting it. For what it can provide a budding host it's not exactly hard and costing to signup.

I'll change the host now really. I'll change it to the IP.
EDIT: ----e... realised can't do that because of the validation.

Would there be a work around this? Alot of hosts would probably not be able to use this. Would be awesome if it was a global sort of thing.
 
Last edited:
Yeah u should be good, so long as your ip address is associated with your validated hostname in DNS.

I didn't realize how restrictive that was until you said it .... still, all better now ...
 
Right, got everything going now. One question, is there a search function to search for IP's? It doesn't appear the any function does that. That could be a very good feature to include.
 
yeah it does, search.address, or search.any ...

I don't store postal addresses, address = ip ...
 
Last edited:
Joe is the search down? My inergration or your API both doesn't get any results on search.
 
It's not getting results because it's only returning records you didn't create. I don't know if that makes more sense than returning data you sent already ?? It seems to ... am I wrong ??

While you're testing Johnny, why not make another API key and create some records with it, that way you can test on the data returned by the original API key ...

Also added type.* including a criminal check type.criminal ...

Lets have some opinion on this, on the one hand you might store the data you sent, should I return results you create or not ?? ( I thought about making it an option, but I'd prefer it to do one or the other ) ... I'd also like to make a decision at this stage, but from the inside I'm probably not the person to make it ...
 
Last edited:
Oh, it does make more sense yes. Usually, the API returned back the ones I created as well.

Overall, that's perfect how it's set up. Just makes it that little harder for testing.
 
Last edited:
Joe, question. I don't have another API key so I can't really put this to the test. So, here we go. I want to detect if a user searched is criminal. Since I have no records to go on, would this work?
PHP:
//Check for criminal activity
					$inquest = $this->classes['HostInquestSearch']->any($email);
					if(count($inquest) > 0 && $this->config("hicriminal") == 0) {
						foreach($inquest as $client) {
							if($client['criminal'] == 1) {
								echo "<h1>Criminal Activity</h1>";
								echo "Your account has been marked has criminal. You won't be allowed to signup.";
								return;
							}
						}
					}
 
Last edited:
Ok so API keys will only serve records created by other keys.

Yeah it would work, however yesterday I added a simple type.* namespace ( the example code now includes this and a little error reporting you might want to have a look at ). type.criminal will only search for records with criminal activity so assuming your setup stays the same ...

PHP:
					if( $this->classes['HostInquestType']->criminal($email) )
					{
						echo "<h1>Criminal Activity</h1>";
                        echo "Your account has been marked has criminal. You won't be allowed to signup.";
                        return;
					}

But that only gives you the option of checking one piece of data, what I would do is search.any with email hostname and ip address, that way if any of those bits of data are found in a record they are returned ...

Remembering of course that the code I post on hostinquest.com is an example, it's the bear minimum, you're getting a lot of data here, it would be silly to hold up the process for a couple of seconds and not use a few milliseconds to analyze the data returned ... I'm just saying ...
 
Last edited:
Just updated the classes now with some of the example code, thanks for that.

I'll think about how to do it really, I'm guessing from looking at the code criminal checks the ip, domain and email? Or is it just the email.

By the last part, sorry for my stupidity but are you quoting the code which was given to create, suspend, unsuspend? The basic code? If your regarding that, I'm not using it.
 
Working with the new classes Joe, after entering the email on criminal, it gives me this:
Warning: Invalid error type specified in /home/cpcreato/public_html/dev/2.8/classes/HostInquest.php on line 43
 
oh right that should be E_USER_ERROR or whatever you see as necessary, actually I'm in the middle of error handling for the api code so I can populate faultCode's with meaningful errors, E_WARNING is defined for me but won't be for you because trigger error only works on E_USER_* constants normally ...

at this moment, it checks the parameter passed against the email, address and hostname.

I think logically type should be rewritten. I think it would be better if these methods were overloaded, the signatures being something like

method( api, match )
method( api, email, address, hostname )

That way you can execute match( api, method ) if you only have one piece of information, such as an email or ip, and return any records of that type containing match in email, address or ip.

OR

You can execute method( api, email, address, hostname ) if you have all the information and return matches that contain any of it ...

Am I right ??

I want to leave search the way it is more for windows or standalone web applications rather than integration, but type could be useful for such logic as

PHP:
<?php
if( ( $created = $type->created( params ) ) )
{
	if( ( $deleted = $type->deleted( params ) ) )
	{
		if( count( $deleted ) != count( $created ) )
		{
			printf( "You have been hosted for free at %d other locations, please use one of those accounts", count( $created ) - count( $deleted ) );
		}
	}
}
?>

<?php
if( ( $criminal = $type->criminal( params ) ) )
{
	printf( "You have had %d criminal flags raised, this is unacceptable, we will not host you", count( $criminal ) );
}
?>

<?php
if( ( $suspended = $type->suspended( params ) ) )
{
	if( count( $suspended ) > 5 )
	{
		printf( "You have been suspended on %d other services, this is over our threshold", count( $suspended ) );
	}
}
?>

Type should provide logic that needn't analyze the data returned too much, where search should really return as much as possible for manual analysis.

So rewrite type with overloaded methods ??
 
Last edited:
Overall, with the params needed with type, it would be better to have the method( api, email, address, hostname ) as long as it was searching for either of them not searching a record which matches all three. Then again, it it was searching for all I would still have to run it three times. Waiting seconds for it to load.

With the type, it is better to leave it logic based. For the quicker, information which doesn't really need PHP to manually proccess it accordingly.

You could rewrite type, but it sometimes it could restrict me when I would use it due to requiring all of those details. It would be nice to have the option of only using one param to get what you need. Then again, sometimes for the more accurate and quicker loads, I would need all the three to give me the information I need.
 
I do happen to think something standalone for desktops wouold be good, soemthing that allows hosts to make queries on already existing clients they are suspicious of, if you wanna do that it'd be great because I'm pretty much out of time ...

There's a bit of a problem though with having a desktop application ... the way API keys are validated might interfere. You might have to proxy requests through a script on the server that validated the API key and return data from it to the desktop to get around it ...
 
Just intergrated it fully now with the updated API.

Joe one check, the criminal function still is pretty logical yes? It just returns 1 if true? Not the record.
 
Back
Top