more api-documentation and code-formatting
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -172,7 +172,7 @@ class Domains extends ApiCommand implements ResourceEntity
|
|||||||
* @param bool $hsts_preload
|
* @param bool $hsts_preload
|
||||||
* optional whether or not to preload HSTS header value
|
* optional whether or not to preload HSTS header value
|
||||||
* @param bool $ocsp_stapling
|
* @param bool $ocsp_stapling
|
||||||
* optional whether to enable oscp-stapling for this domain. default ß (false), requires SSL
|
* optional whether to enable oscp-stapling for this domain. default 0 (false), requires SSL
|
||||||
*
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
@@ -745,7 +745,7 @@ class Domains extends ApiCommand implements ResourceEntity
|
|||||||
* @param bool $hsts_preload
|
* @param bool $hsts_preload
|
||||||
* optional whether or not to preload HSTS header value
|
* optional whether or not to preload HSTS header value
|
||||||
* @param bool $ocsp_stapling
|
* @param bool $ocsp_stapling
|
||||||
* optional whether to enable oscp-stapling for this domain. default ß (false), requires SSL
|
* optional whether to enable oscp-stapling for this domain. default 0 (false), requires SSL
|
||||||
*
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
|||||||
@@ -101,6 +101,26 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
|
|||||||
/**
|
/**
|
||||||
* create a new fpm-daemon entry
|
* create a new fpm-daemon entry
|
||||||
*
|
*
|
||||||
|
* @param string $description
|
||||||
|
* @param string $reload_cmd
|
||||||
|
* @param string $config_dir
|
||||||
|
* @param string $pm
|
||||||
|
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'static'
|
||||||
|
* @param int $max_children
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $start_servers
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $min_spare_servers
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $max_spare_servers
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $max_requests
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $idle_timeout
|
||||||
|
* optional, default 0
|
||||||
|
* @param string $limit_extensions
|
||||||
|
* optional, limit execution to the following extensions, default '.php'
|
||||||
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @return array
|
* @return array
|
||||||
@@ -188,6 +208,29 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
|
|||||||
* update a fpm-daemon entry by given id
|
* update a fpm-daemon entry by given id
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* fpm-daemon id
|
||||||
|
* @param string $description
|
||||||
|
* optional
|
||||||
|
* @param string $reload_cmd
|
||||||
|
* optional
|
||||||
|
* @param string $config_dir
|
||||||
|
* optional
|
||||||
|
* @param string $pm
|
||||||
|
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'static'
|
||||||
|
* @param int $max_children
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $start_servers
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $min_spare_servers
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $max_spare_servers
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $max_requests
|
||||||
|
* optional, default 0
|
||||||
|
* @param int $idle_timeout
|
||||||
|
* optional, default 0
|
||||||
|
* @param string $limit_extensions
|
||||||
|
* optional, limit execution to the following extensions, default '.php'
|
||||||
*
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class Froxlor extends ApiCommand
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @todo export settings to file
|
* @todo export settings
|
||||||
*
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
*/
|
*/
|
||||||
@@ -234,7 +234,7 @@ class Froxlor extends ApiCommand
|
|||||||
$reflection = new \ReflectionClass($mod);
|
$reflection = new \ReflectionClass($mod);
|
||||||
$_functions = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC);
|
$_functions = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC);
|
||||||
foreach ($_functions as $func) {
|
foreach ($_functions as $func) {
|
||||||
if ($func->class == $mod && $func->isPublic() && !$func->isStatic()) {
|
if ($func->class == $mod && $func->isPublic() && ! $func->isStatic()) {
|
||||||
array_push($functions, array_merge(array(
|
array_push($functions, array_merge(array(
|
||||||
'module' => $matches[1],
|
'module' => $matches[1],
|
||||||
'function' => $func->name
|
'function' => $func->name
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class IpsAndPorts extends ApiCommand implements ResourceEntity
|
|||||||
if ($this->isAdmin() && ($this->getUserDetail('change_serversettings') || ! empty($this->getUserDetail('ip')))) {
|
if ($this->isAdmin() && ($this->getUserDetail('change_serversettings') || ! empty($this->getUserDetail('ip')))) {
|
||||||
$this->logger()->logAction(ADM_ACTION, LOG_NOTICE, "[API] list ips and ports");
|
$this->logger()->logAction(ADM_ACTION, LOG_NOTICE, "[API] list ips and ports");
|
||||||
$ip_where = "";
|
$ip_where = "";
|
||||||
if (!empty($this->getUserDetail('ip')) && $this->getUserDetail('ip') != -1) {
|
if (! empty($this->getUserDetail('ip')) && $this->getUserDetail('ip') != - 1) {
|
||||||
$ip_where = "WHERE `id` IN (".implode(", ", json_decode($this->getUserDetail('ip'), true)).")";
|
$ip_where = "WHERE `id` IN (" . implode(", ", json_decode($this->getUserDetail('ip'), true)) . ")";
|
||||||
}
|
}
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where . " ORDER BY `ip` ASC, `port` ASC
|
SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where . " ORDER BY `ip` ASC, `port` ASC
|
||||||
@@ -63,9 +63,9 @@ class IpsAndPorts extends ApiCommand implements ResourceEntity
|
|||||||
{
|
{
|
||||||
if ($this->isAdmin() && ($this->getUserDetail('change_serversettings') || ! empty($this->getUserDetail('ip')))) {
|
if ($this->isAdmin() && ($this->getUserDetail('change_serversettings') || ! empty($this->getUserDetail('ip')))) {
|
||||||
$id = $this->getParam('id');
|
$id = $this->getParam('id');
|
||||||
if (!empty($this->getUserDetail('ip')) && $this->getUserDetail('ip') != -1) {
|
if (! empty($this->getUserDetail('ip')) && $this->getUserDetail('ip') != - 1) {
|
||||||
$allowed_ips = json_decode($this->getUserDetail('ip'), true);
|
$allowed_ips = json_decode($this->getUserDetail('ip'), true);
|
||||||
if (!in_array($id, $allowed_ips)) {
|
if (! in_array($id, $allowed_ips)) {
|
||||||
throw new Exception("You cannot access this resource", 405);
|
throw new Exception("You cannot access this resource", 405);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,6 +87,34 @@ class IpsAndPorts extends ApiCommand implements ResourceEntity
|
|||||||
/**
|
/**
|
||||||
* create a new ip/port entry
|
* create a new ip/port entry
|
||||||
*
|
*
|
||||||
|
* @param string $ip
|
||||||
|
* @param int $port
|
||||||
|
* optional, default 80
|
||||||
|
* @param bool $listen_statement
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param bool $namevirtualhost_statement
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param bool $vhostcontainer
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param string $specialsettings
|
||||||
|
* optional, default empty
|
||||||
|
* @param bool $vhostcontainer_servername_statement
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param string $default_vhostconf_domain
|
||||||
|
* optional, defatul empty
|
||||||
|
* @param string $docroot
|
||||||
|
* optional, default empty (point to froxlor)
|
||||||
|
* @param bool $ssl
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param string $ssl_cert_file
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
|
* @param string $ssl_key_file
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
|
* @param string $ssl_ca_file
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
|
* @param string $ssl_cert_chainfile
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @return array
|
* @return array
|
||||||
@@ -227,6 +255,34 @@ class IpsAndPorts extends ApiCommand implements ResourceEntity
|
|||||||
* update ip/port entry by given id
|
* update ip/port entry by given id
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @param string $ip
|
||||||
|
* optional
|
||||||
|
* @param int $port
|
||||||
|
* optional, default 80
|
||||||
|
* @param bool $listen_statement
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param bool $namevirtualhost_statement
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param bool $vhostcontainer
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param string $specialsettings
|
||||||
|
* optional, default empty
|
||||||
|
* @param bool $vhostcontainer_servername_statement
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param string $default_vhostconf_domain
|
||||||
|
* optional, defatul empty
|
||||||
|
* @param string $docroot
|
||||||
|
* optional, default empty (point to froxlor)
|
||||||
|
* @param bool $ssl
|
||||||
|
* optional, default 0 (false)
|
||||||
|
* @param string $ssl_cert_file
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
|
* @param string $ssl_key_file
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
|
* @param string $ssl_ca_file
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
|
* @param string $ssl_cert_chainfile
|
||||||
|
* optional, requires $ssl = 1, default empty
|
||||||
*
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
* @throws ErrorException
|
* @throws ErrorException
|
||||||
|
|||||||
Reference in New Issue
Block a user