* task#562.

This commit is contained in:
wangchunsheng
2011-10-18 14:45:15 +00:00
parent 761960a8b7
commit 39cf6d11b3
+31
View File
@@ -208,6 +208,37 @@ class ztclient
return true;
}
/**
* Fetch one method of a module's control.
*
* @param string $module the module name
* @param string $method the methhod name
* @param array $vars the vars to passwd
* @access public
* @return void
*/
public function post($module, $method = 'index', $vars = array())
{
return $this->httpPost($this->setControlAPI($module, $method), $vars);
}
/**
* Post.
*
* @param string $url
* @access private
* @return bool
*/
private function httpPost($url, $vars)
{
$this->agent->submit($url, $vars);
$result = json_decode($this->agent->results);
if($result->status != 'success') return false;
if(isset($result->data) and md5($result->data) != $result->md5) return false;
if(isset($result->data)) return json_decode($result->data);
return true;
}
/**
* Append session param to the url.
*