Verifying if the WHM ACCESS KEY is correct.

paulgfx

Registered
Mar 9, 2006
4
0
151
Hi.
I would like to know if the user copied/pasted the correct whm access key.
I am trying with this function:
Code:
function hashOK()
  {
    $result = whmreq("/scripts2/showversion",CPANEL_HOST,CPANEL_USER,$this->getAccessHash(),0);
    if ((strlen($result)>0)&&(strlen($result)<25)) return true;
	else return false;
  }
I made this, because I found that in case of wrong whm key, it returns a big html data.

The problem is that this request sometimes returns 0 even if the key is correct or even if it is wrong key.
Please tell me a sure way how can I verify the WHM key.
Thanks.
Paul