added more phpdoc for api-documentation

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-11-18 14:39:20 +01:00
parent 892d259805
commit 8c8be45769
2 changed files with 393 additions and 202 deletions

View File

@@ -116,6 +116,12 @@ class Certificates extends ApiCommand implements ResourceEntity
* optional, the domain-id
* @param string $domainname
* optional, the domainname
* @param string $ssl_cert_file
* @param string $ssl_key_file
* @param string $ssl_ca_file
* optional
* @param string $ssl_cert_chainfile
* optional
*
* @access admin, customer
* @throws Exception

View File

@@ -22,6 +22,7 @@ class Customers extends ApiCommand implements ResourceEntity
* lists all customer entries
*
* @access admin
* @throws Exception
* @return array count|list
*/
public function listing()
@@ -110,7 +111,98 @@ class Customers extends ApiCommand implements ResourceEntity
/**
* create a new customer with default ftp-user and standard-subdomain (if wanted)
*
* @param string $email
* @param string $name
* optional if company is set, else required
* @param string $firstname
* optional if company is set, else required
* @param string $company
* optional but required if name/firstname empty
* @param string $street
* optional
* @param string $zipcode
* optional
* @param string $city
* optional
* @param string $phone
* optional
* @param string $fax
* optional
* @param int $customernumber
* optional
* @param string $def_language,
* optional, default is system-default language
* @param int $gender
* optional, 0 = no-gender, 1 = male, 2 = female
* @param string $custom_notes
* optional notes
* @param bool $custom_notes_show
* optional, whether to show the content of custom_notes to the customer, default 0 (false)
* @param string $new_loginname
* optional, if empty generated automatically using customer-prefix and increasing number
* @param string $password
* optional, if empty generated automatically and send to the customer's email if $sendpassword is 1
* @param bool $sendpassword
* optional, whether to send the password to the customer after creation, default 0 (false)
* @param int $diskspace
* optional disk-space available for customer in MB, default 0
* @param bool $diskspace_ul
* optional, whether customer should have unlimited diskspace, default 0 (false)
* @param int $traffic
* optional traffic available for customer in GB, default 0
* @param bool $traffic_ul
* optional, whether customer should have unlimited traffic, default 0 (false)
* @param int $subdomains
* optional amount of subdomains available for customer, default 0
* @param bool $subdomains_ul
* optional, whether customer should have unlimited subdomains, default 0 (false)
* @param int $emails
* optional amount of emails available for customer, default 0
* @param bool $emails_ul
* optional, whether customer should have unlimited emails, default 0 (false)
* @param int $email_accounts
* optional amount of email-accounts available for customer, default 0
* @param bool $email_accounts_ul
* optional, whether customer should have unlimited email-accounts, default 0 (false)
* @param int $email_forwarders
* optional amount of email-forwarders available for customer, default 0
* @param bool $email_forwarders_ul
* optional, whether customer should have unlimited email-forwarders, default 0 (false)
* @param int $email_quota
* optional size of email-quota available for customer in MB, default is system-setting mail_quota
* @param bool $email_quota_ul
* optional, whether customer should have unlimited email-quota, default 0 (false)
* @param bool $email_imap
* optional, whether to allow IMAP access, default 0 (false)
* @param bool $email_pop3
* optional, whether to allow POP3 access, default 0 (false)
* @param int $ftps
* optional amount of ftp-accounts available for customer, default 0
* @param bool $ftps_ul
* optional, whether customer should have unlimited ftp-accounts, default 0 (false)
* @param int $tickets
* optional amount of tickets available for customer if enabled, default 0
* @param bool $tickets_ul
* optional, whether customer should have unlimited tickets if enabled, default 0 (false)
* @param int $mysqls
* optional amount of mysql-databases available for customer, default 0
* @param bool $mysqls_ul
* optional, whether customer should have unlimited mysql-databases, default 0 (false)
* @param bool $createstdsubdomain
* optional, whether to create a standard-subdomain ([loginname].froxlor-hostname.tld), default 0 (false)
* @param bool $phpenabled
* optional, whether to allow usage of PHP, default 0 (false)
* @param array $allowed_phpconfigs
* optional, array of IDs of php-config that the customer is allowed to use, default empty (none)
* @param bool $perlenabled
* optional, whether to allow usage of Perl/CGI, default 0 (false)
* @param bool $dnsenabled
* optional, ether to allow usage of the DNS editor (requires activated nameserver in settings)
* @param bool $store_defaultindex
* optional, whether to store the default index file to customers homedir
*
* @access admin
* @throws Exception
* @return array
*/
public function add()
@@ -143,7 +235,7 @@ class Customers extends ApiCommand implements ResourceEntity
$emails = $this->getUlParam('emails', 'emails_ul', true, 0);
$email_accounts = $this->getUlParam('email_accounts', 'email_accounts_ul', true, 0);
$email_forwarders = $this->getUlParam('email_forwarders', 'email_forwarders_ul', true, 0);
$email_quota = $this->getUlParam('email_quota', 'email_quota_ul', true, 0);
$email_quota = $this->getUlParam('email_quota', 'email_quota_ul', true, Settings::Get('system.mail_quota'));
$email_imap = $this->getParam('email_imap', true, 0);
$email_pop3 = $this->getParam('email_pop3', true, 0);
$ftps = $this->getUlParam('ftps', 'ftps_ul', true, 0);
@@ -457,7 +549,7 @@ class Customers extends ApiCommand implements ResourceEntity
$stats_folder = 'awstats';
}
$ins_data['path'] = makeCorrectDir($documentroot . '/' . $stats_folder . '/');
$this->logger()->logAction(ADM_ACTION, LOG_NOTICE, "[API] automatically added ".$stats_folder." htpasswd for user '" . $loginname . "'");
$this->logger()->logAction(ADM_ACTION, LOG_NOTICE, "[API] automatically added " . $stats_folder . " htpasswd for user '" . $loginname . "'");
Database::pexecute($ins_stmt, $ins_data, true, true);
inserttask('1');
@@ -640,12 +732,103 @@ class Customers extends ApiCommand implements ResourceEntity
}
/**
* update customer entry by either id or loginname
* update customer entry by either id or loginname, customer can only change language, password and theme
*
* @param int $id
* optional, the customer-id
* @param string $loginname
* optional, the loginname
* @param string $email
* @param string $name
* optional if company is set, else required
* @param string $firstname
* optional if company is set, else required
* @param string $company
* optional but required if name/firstname empty
* @param string $street
* optional
* @param string $zipcode
* optional
* @param string $city
* optional
* @param string $phone
* optional
* @param string $fax
* optional
* @param int $customernumber
* optional
* @param string $def_language,
* optional, default is system-default language
* @param int $gender
* optional, 0 = no-gender, 1 = male, 2 = female
* @param string $custom_notes
* optional notes
* @param bool $custom_notes_show
* optional, whether to show the content of custom_notes to the customer, default 0 (false)
* @param string $new_customer_password
* optional, iset new password
* @param bool $sendpassword
* optional, whether to send the password to the customer after creation, default 0 (false)
* @param int $move_to_admin
* optional, if valid admin-id is given here, the customer's admin/reseller can be changed
* @param bool $deactivated
* optional, if 1 (true) the customer can be deactivated/suspended
* @param int $diskspace
* optional disk-space available for customer in MB, default 0
* @param bool $diskspace_ul
* optional, whether customer should have unlimited diskspace, default 0 (false)
* @param int $traffic
* optional traffic available for customer in GB, default 0
* @param bool $traffic_ul
* optional, whether customer should have unlimited traffic, default 0 (false)
* @param int $subdomains
* optional amount of subdomains available for customer, default 0
* @param bool $subdomains_ul
* optional, whether customer should have unlimited subdomains, default 0 (false)
* @param int $emails
* optional amount of emails available for customer, default 0
* @param bool $emails_ul
* optional, whether customer should have unlimited emails, default 0 (false)
* @param int $email_accounts
* optional amount of email-accounts available for customer, default 0
* @param bool $email_accounts_ul
* optional, whether customer should have unlimited email-accounts, default 0 (false)
* @param int $email_forwarders
* optional amount of email-forwarders available for customer, default 0
* @param bool $email_forwarders_ul
* optional, whether customer should have unlimited email-forwarders, default 0 (false)
* @param int $email_quota
* optional size of email-quota available for customer in MB, default is system-setting mail_quota
* @param bool $email_quota_ul
* optional, whether customer should have unlimited email-quota, default 0 (false)
* @param bool $email_imap
* optional, whether to allow IMAP access, default 0 (false)
* @param bool $email_pop3
* optional, whether to allow POP3 access, default 0 (false)
* @param int $ftps
* optional amount of ftp-accounts available for customer, default 0
* @param bool $ftps_ul
* optional, whether customer should have unlimited ftp-accounts, default 0 (false)
* @param int $tickets
* optional amount of tickets available for customer if enabled, default 0
* @param bool $tickets_ul
* optional, whether customer should have unlimited tickets if enabled, default 0 (false)
* @param int $mysqls
* optional amount of mysql-databases available for customer, default 0
* @param bool $mysqls_ul
* optional, whether customer should have unlimited mysql-databases, default 0 (false)
* @param bool $createstdsubdomain
* optional, whether to create a standard-subdomain ([loginname].froxlor-hostname.tld), default 0 (false)
* @param bool $phpenabled
* optional, whether to allow usage of PHP, default 0 (false)
* @param array $allowed_phpconfigs
* optional, array of IDs of php-config that the customer is allowed to use, default empty (none)
* @param bool $perlenabled
* optional, whether to allow usage of Perl/CGI, default 0 (false)
* @param bool $dnsenabled
* optional, ether to allow usage of the DNS editor (requires activated nameserver in settings)
* @param string $theme
* optional, change theme
*
* @access admin, customer
* @throws Exception
@@ -1458,7 +1641,9 @@ class Customers extends ApiCommand implements ResourceEntity
* and update all its references accordingly
*
* @param int $id
* customer-id
* optional, the customer-id
* @param string $loginname
* optional, the loginname
* @param int $adminid
* target-admin-id
*