Skip to content

Commit

Permalink
Update User.php
Browse files Browse the repository at this point in the history
  • Loading branch information
HieuPT7 authored Dec 19, 2019
1 parent bb5c82b commit 455f18c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/DirectAdmin/Objects/Users/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,4 +576,19 @@ public function deleteLoginKey(string $keyName)

return $this->getContext()->invokeApiPost('LOGIN_KEYS', $values);
}

/**
* Modifies the package of the user. For available keys in the array check the documentation on
* CMD_API_MODIFY_USER in the linked document.
*
* @param string $package package name to be modified
* @url http://www.directadmin.com/api.html#modify
*/
public function modifyPackage(string $package)
{
$this->getContext()->invokeApiPost('MODIFY_USER', array_merge(
['action' => 'package', 'user' => $this->getUsername(), 'package' => $package]
));
$this->clearCache();
}
}

0 comments on commit 455f18c

Please sign in to comment.