Skip to content

Commit

Permalink
api documentation additions for Customers.add()/update() and Admins.a…
Browse files Browse the repository at this point in the history
…dd()/update()

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
  • Loading branch information
d00p committed Jan 28, 2024
1 parent bcf0818 commit f03b49d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
11 changes: 8 additions & 3 deletions lib/Froxlor/Api/Commands/Admins.php
Expand Up @@ -140,12 +140,16 @@ public function listingCount()
* create a new admin user
*
* @param string $name
* required, name of the adminstrator
* @param string $email
* required, email address of the administrator
* @param string $new_loginname
* required, loginname/username of the administrator
* @param string $admin_password
* optional, default auto-generated
* @param string $def_language
* optional, default is system-default language
* * optional, ISO 639-1 language code (e.g. 'en', 'de', see lng-folder for supported languages),
* * default is system-default language
* @param bool $gui_access
* optional, allow login via webui, if false ONLY the login via webui is disallowed; default true
* @param bool $api_allowed
Expand Down Expand Up @@ -435,9 +439,10 @@ public function get()
* @param string $admin_password
* optional, default auto-generated
* @param string $def_language
* optional, default is system-default language
* * optional, ISO 639-1 language code (e.g. 'en', 'de', see lng-folder for supported languages),
* * default is system-default language
* @param bool $gui_access
* * optional, allow login via webui, if false ONLY the login via webui is disallowed; default true
* * optional, allow login via webui, if false ONLY the login via webui is disallowed; default true
* @param bool $api_allowed
* optional, default is true if system setting api.enabled is true, else false
* @param string $custom_notes
Expand Down
22 changes: 13 additions & 9 deletions lib/Froxlor/Api/Commands/Customers.php
Expand Up @@ -171,6 +171,7 @@ public function listingCount()
* create a new customer with default ftp-user and standard-subdomain (if wanted)
*
* @param string $email
* required, email address of new customer
* @param string $name
* optional if company is set, else required
* @param string $firstname
Expand All @@ -189,8 +190,9 @@ public function listingCount()
* optional
* @param int $customernumber
* optional
* @param string $def_language ,
* optional, default is system-default language
* @param string $def_language
* optional, ISO 639-1 language code (e.g. 'en', 'de', see lng-folder for supported languages),
* default is system-default language
* @param bool $gui_access
* optional, allow login via webui, if false ONLY the login via webui is disallowed; default true
* @param bool $api_allowed
Expand Down Expand Up @@ -273,7 +275,7 @@ public function listingCount()
* optional, specify a hosting-plan to set certain resource-values from the plan
* instead of specifying them
* @param array $allowed_mysqlserver
* optional, array of IDs of defined mysql-servers the customer is allowed to use,
* optional, array of IDs of defined mysql-servers the customer is allowed to use,
* default is to allow the default dbserver (id=0)
*
* @access admin
Expand Down Expand Up @@ -407,7 +409,7 @@ public function add()
}

$allowed_mysqlserver = array();
if (! empty($p_allowed_mysqlserver) && is_array($p_allowed_mysqlserver)) {
if (!empty($p_allowed_mysqlserver) && is_array($p_allowed_mysqlserver)) {
foreach ($p_allowed_mysqlserver as $allowed_ms) {
$allowed_ms = intval($allowed_ms);
$allowed_mysqlserver[] = $allowed_ms;
Expand Down Expand Up @@ -933,6 +935,7 @@ public static function increaseUsage($customerid = 0, $resource = null, $extra =
* @param string $loginname
* optional, the loginname
* @param string $email
* optional
* @param string $name
* optional if company is set, else required
* @param string $firstname
Expand All @@ -951,8 +954,9 @@ public static function increaseUsage($customerid = 0, $resource = null, $extra =
* optional
* @param int $customernumber
* optional
* @param string $def_language ,
* optional, default is system-default language
* @param string $def_language
* * optional, ISO 639-1 language code (e.g. 'en', 'de', see lng-folder for supported languages),
* * default is system-default language
* @param bool $gui_access
* optional, allow login via webui, if false ONLY the login via webui is disallowed; default true
* @param bool $api_allowed
Expand All @@ -965,7 +969,7 @@ public static function increaseUsage($customerid = 0, $resource = null, $extra =
* optional, whether to show the content of custom_notes to the customer, default 0
* (false)
* @param string $new_customer_password
* optional, iset new password
* optional, set new password
* @param bool $sendpassword
* optional, whether to send the password to the customer after creation, default 0
* (false)
Expand Down Expand Up @@ -1033,7 +1037,7 @@ public static function increaseUsage($customerid = 0, $resource = null, $extra =
* @param string $theme
* optional, change theme
* @param array $allowed_mysqlserver
* optional, array of IDs of defined mysql-servers the customer is allowed to use,
* optional, array of IDs of defined mysql-servers the customer is allowed to use,
* default is to allow the default dbserver (id=0)
*
* @access admin, customer
Expand Down Expand Up @@ -1129,7 +1133,7 @@ public function update()
if ($result['mysqls'] == 0 && ($mysqls == -1 || $mysqls > 0)) {
$allowed_mysqlserver = $this->getParam('allowed_mysqlserver', true, [0]);
}
if (! empty($allowed_mysqlserver)) {
if (!empty($allowed_mysqlserver)) {
$allowed_mysqlserver = array_map('intval', $allowed_mysqlserver);
}

Expand Down

0 comments on commit f03b49d

Please sign in to comment.