Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion apis/centoswebpanel_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function createAccount(array $params)
*/
public function updateAccount(array $params)
{
// TODO This doesn't actually seem to work. Figure out why and fix it
// TODO This doesn't actually seem to work. Figure out why and fix it - This has been fixed in 2.6.1
$params['action'] = 'udp';
return $this->apiRequest('account', $params);
}
Expand Down Expand Up @@ -295,4 +295,54 @@ public function getClientIp()

return $ip_address;
}

//2.6.1
public function createPackage(array $params)
{
$params['action'] = 'add';
return $this->apiRequest('packages', $params);
}

public function updateCustomPackage(array $params){
$params['action'] = 'udp';
return $this->apiRequest('packages', $params);
}

public function deleteCustomPackage(array $params){
$params['action'] = 'del';
return $this->apiRequest('packages', $params);
}

public function userSession(array $params){
if($params['module'] == 'user'){
unset($params['module']);
}
$params['action'] = 'list';
return $this->apiRequest('user_session', $params);
}

public function listAccounts()
{
$params['action'] = 'list';
return $this->apiRequest('account', $params);
}

public function accountDetail($username)
{
$params = [
'user' => $username,
'action' => 'list'
];
return $this->apiRequest('accountdetail', $params);
}

public function accountQuota($username)
{
$params = [
'user' => $username,
'action' => 'list'
];
return $this->apiRequest('accountquota', $params);
}

}
2 changes: 1 addition & 1 deletion apis/centoswebpanel_response.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct($apiResponse)
if (!empty($this->headers)) {
$headerOne = explode(' ', $this->headers[0]);
if (count($headerOne) >= 2) {
$this->status = $headerOne[1];
$this->status = $headerOne[1];
}
}
}
Expand Down
Loading