1 | <?php |
||
23 | class AdminContext extends ResellerContext |
||
24 | { |
||
25 | /** |
||
26 | * Creates a new Admin level account. |
||
27 | * |
||
28 | * @param string $username |
||
29 | * @param string $password |
||
30 | * @param string $email |
||
31 | * @return Admin The newly created Admin |
||
32 | */ |
||
33 | public function createAdmin($username, $password, $email) |
||
37 | |||
38 | /** |
||
39 | * Creates a new Reseller level account. |
||
40 | * |
||
41 | * @param string $username |
||
42 | * @param string $password |
||
43 | * @param string $email |
||
44 | * @param string $domain |
||
45 | * @param string|array $package Either a package name or an array of options for custom |
||
46 | * @param string $ip shared, sharedreseller or assign. Defaults to 'shared' |
||
47 | * @return Reseller |
||
48 | * @url http://www.directadmin.com/api.html#create for options to use. |
||
49 | */ |
||
50 | public function createReseller($username, $password, $email, $domain, $package = [], $ip = 'shared') |
||
58 | |||
59 | /** |
||
60 | * Returns a list of known admins on the server. |
||
61 | * |
||
62 | * @return Admin[] |
||
63 | */ |
||
64 | public function getAdmins() |
||
68 | |||
69 | /** |
||
70 | * Returns a full list of all accounts of any type on the server. |
||
71 | * |
||
72 | * @return User[] |
||
73 | */ |
||
74 | public function getAllAccounts() |
||
80 | |||
81 | /** |
||
82 | * Returns a full list of all users on the server, so no resellers or admins. |
||
83 | * |
||
84 | * @return User[] |
||
85 | */ |
||
86 | public function getAllUsers() |
||
90 | |||
91 | /** |
||
92 | * Returns a specific reseller by name, or NULL if there is no reseller by this name. |
||
93 | * |
||
94 | * @param string $username |
||
95 | * @return null|Reseller |
||
96 | */ |
||
97 | public function getReseller($username) |
||
102 | |||
103 | /** |
||
104 | * Returns the list of known resellers. |
||
105 | * |
||
106 | * @return Reseller[] |
||
107 | */ |
||
108 | public function getResellers() |
||
112 | |||
113 | /** |
||
114 | * Returns a new AdminContext acting as the specified admin. |
||
115 | * |
||
116 | * @param string $username |
||
117 | * @param bool $validate Whether to check the admin exists and is an admin |
||
118 | * @return AdminContext |
||
119 | */ |
||
120 | public function impersonateAdmin($username, $validate = false) |
||
124 | |||
125 | /** |
||
126 | * Returns a new ResellerContext acting as the specified reseller. |
||
127 | * |
||
128 | * @param string $username |
||
129 | * @param bool $validate Whether to check the reseller exists and is a reseller |
||
130 | * @return ResellerContext |
||
131 | */ |
||
132 | public function impersonateReseller($username, $validate = false) |
||
136 | } |
||
137 |