Thanks for Tweeting me Kevin
.
I'm glad this is out, was waiting eagerly for this. Will try this one this week end and i promise to report bugs if i find any.
Hey in my auxilary login username. In the username field in THT i had to enter a 19character string.
Syntax being : reseller.com_auxnam.aux
when i enter that and rechecked the username after adding the Server, i only see
Code:
reseller.com_auxname.
It ends at the "." but dosen't show the aux.
I don't know if this is the reason causing the Step 5 process to show an error.
Also it shows the domain name in the auxiliary username field on creation of a new account on Kloxo because it's a resellers account.
[EDIT]
I've created a smaller auxiliary name. Now step 5 dosen't show an error but it loads forever
Awesome job on this. I had gotten everything to work except Terminate, so I went into the code and seem to have fixed it.
I removed $define (as well as your... colorful...comments) from:
PHP Code:
public function terminate($user, $server) {
$this->server = $server;
$action = "action=delete&class=client&name=" . strtolower($user);
$command = $this->remote($define ,$action);
if($command == true) {
return true;
}
else {
return false;
}
}
So it would look like:
PHP Code:
public function terminate($user, $server) {
$this->server = $server;
$action = "action=delete&class=client&name=" . strtolower($user);
$command = $this->remote($action);
if($command == true) {
return true;
}
else {
return false;
}
}
I assume that the problem stems from $define, as I could not find it anywhere else in kloxo.php.
Also as a side note, the account must exist in Kloxo to be terminated in THT.
Keep up the good work.
Just as a note, you can shorten
PHP Code:
$command = $this->remote($action);
if($command == true) {
return true;
}
else {
return false;
}
to
PHP Code:
return $this->remote($action);
as long as you're not using $command after that. This is assuming that $this->remote($action) will always return either true or false. If it returns true on success and
anything else is
always false, then you can do:
PHP Code:
return ($this->remote($action) === true);
And you technically don't even need the parenthesis there, I just like them to make it easier to understand/read. Haven't tested any of this, but it should work.
Thanks to both Days and Kevin.
@Days mind uploading a copy of your version? My version doesn't have a working terminate function. Thanks alot
LOL at the colorful comments part. I thought I took that out before uploading the attachment.
@Kevin I don't exactly remember, but I think I used strpos there to check if "success" is on the string before giving a result, since strpos returns false when the string is not found, and returns an integer if it is. But whatever works.
@Liam D. I've attached my kloxo.php. I haven't gotten around to making Kevin's suggested changes yet though.
Thanks, Days. Rep +1 for that.
Implemented what Kevin suggested and it works. Shortened suspend, unsuspend, and terminate to:
PHP Code:
public function suspend($user, $server, $reason = false) {
$this->server = $server;
$action = "action=update&subaction=disable&class=client&name=" . strtolower($user);
return $this->remote($action);
}
public function unsuspend($user, $server) {
$this->server = $server;
$action = "action=update&subaction=enable&class=client&name=" . strtolower($user);
return $this->remote($action);
}
public function terminate($user, $server) {
$this->server = $server;
$action = "action=delete&class=client&name=" . strtolower($user);
return $this->remote($action);
}