From 1a0953e77e1c6287d60f47836ec0e9212d3e0297 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 8 Jun 2020 11:42:44 +0200 Subject: [PATCH] fix typo in response status message, fixes #858 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/Admins.php | 14 ++++----- lib/Froxlor/Api/Commands/ApiKeys.php | 30 ++++++++++++++++++++ lib/Froxlor/Api/Commands/Certificates.php | 12 ++++---- lib/Froxlor/Api/Commands/Cronjobs.php | 8 +++--- lib/Froxlor/Api/Commands/CustomerBackups.php | 8 +++--- lib/Froxlor/Api/Commands/Customers.php | 16 +++++------ lib/Froxlor/Api/Commands/DirOptions.php | 12 ++++---- lib/Froxlor/Api/Commands/DirProtections.php | 12 ++++---- lib/Froxlor/Api/Commands/DomainZones.php | 12 ++++---- lib/Froxlor/Api/Commands/Domains.php | 12 ++++---- lib/Froxlor/Api/Commands/EmailAccounts.php | 6 ++-- lib/Froxlor/Api/Commands/EmailForwarders.php | 8 +++--- lib/Froxlor/Api/Commands/Emails.php | 12 ++++---- lib/Froxlor/Api/Commands/FpmDaemons.php | 12 ++++---- lib/Froxlor/Api/Commands/Froxlor.php | 22 +++++++------- lib/Froxlor/Api/Commands/Ftps.php | 12 ++++---- lib/Froxlor/Api/Commands/HostingPlans.php | 12 ++++---- lib/Froxlor/Api/Commands/IpsAndPorts.php | 12 ++++---- lib/Froxlor/Api/Commands/Mysqls.php | 12 ++++---- lib/Froxlor/Api/Commands/PhpSettings.php | 12 ++++---- lib/Froxlor/Api/Commands/SubDomains.php | 12 ++++---- lib/Froxlor/Api/Commands/SysLog.php | 6 ++-- lib/Froxlor/Api/Commands/Traffic.php | 2 +- 23 files changed, 153 insertions(+), 123 deletions(-) create mode 100644 lib/Froxlor/Api/Commands/ApiKeys.php diff --git a/lib/Froxlor/Api/Commands/Admins.php b/lib/Froxlor/Api/Commands/Admins.php index dec4d09f..b833290c 100644 --- a/lib/Froxlor/Api/Commands/Admins.php +++ b/lib/Froxlor/Api/Commands/Admins.php @@ -51,7 +51,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -75,7 +75,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_admins']); + return $this->response(200, "successful", $result['num_admins']); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -109,7 +109,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get admin '" . $result['loginname'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'"); throw new \Exception("Admin with " . $key . " could not be found", 404); @@ -364,7 +364,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = $this->apiCall('Admins.get', array( 'id' => $adminid )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -677,7 +677,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = $this->apiCall('Admins.get', array( 'id' => $result['adminid'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } } @@ -779,7 +779,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted admin '" . $result['loginname'] . "'"); \Froxlor\User::updateCounters(); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -821,7 +821,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result['loginfail_count'] = 0; $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked admin '" . $result['loginname'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } diff --git a/lib/Froxlor/Api/Commands/ApiKeys.php b/lib/Froxlor/Api/Commands/ApiKeys.php new file mode 100644 index 00000000..971d92d3 --- /dev/null +++ b/lib/Froxlor/Api/Commands/ApiKeys.php @@ -0,0 +1,30 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package API + * @since 0.10.0 + * + */ +class ApiKeys extends \Froxlor\Api\ApiCommand +{ + + public function listing() + {} + + public function listingCount() + {} +} \ No newline at end of file diff --git a/lib/Froxlor/Api/Commands/Certificates.php b/lib/Froxlor/Api/Commands/Certificates.php index cf216186..ee79ab74 100644 --- a/lib/Froxlor/Api/Commands/Certificates.php +++ b/lib/Froxlor/Api/Commands/Certificates.php @@ -81,7 +81,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou $result = $this->apiCall('Certificates.get', array( 'id' => $domain['id'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Domain '" . $domain['domain'] . "' already has a certificate. Did you mean to call update?", 406); } @@ -122,7 +122,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou if (! $result) { throw new \Exception("Domain '" . $domain['domain'] . "' does not have a certificate.", 412); } - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -168,7 +168,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou $result = $this->apiCall('Certificates.get', array( 'id' => $domain['id'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -222,7 +222,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou } $result[] = $cert; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -258,7 +258,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou $certs_stmt = Database::prepare($certs_stmt_query); $result = Database::pexecute_first($certs_stmt, $qry_params, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_certs']); + return $this->response(200, "successful", $result['num_certs']); } } @@ -326,7 +326,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou \Froxlor\System\Cronjob::inserttask('12', $chk['domain']); } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] removed ssl-certificate for '" . $chk['domain'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Unable to determine SSL certificate. Maybe no access?", 406); } diff --git a/lib/Froxlor/Api/Commands/Cronjobs.php b/lib/Froxlor/Api/Commands/Cronjobs.php index 99674501..d6bd7889 100644 --- a/lib/Froxlor/Api/Commands/Cronjobs.php +++ b/lib/Froxlor/Api/Commands/Cronjobs.php @@ -51,7 +51,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE 'id' => $id ), true, true); if ($result) { - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("cronjob with id #" . $id . " could not be found", 404); } @@ -119,7 +119,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE $result = $this->apiCall('Cronjobs.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -152,7 +152,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -175,7 +175,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_crons']); + return $this->response(200, "successful", $result['num_crons']); } } throw new \Exception("Not allowed to execute given command.", 403); diff --git a/lib/Froxlor/Api/Commands/CustomerBackups.php b/lib/Froxlor/Api/Commands/CustomerBackups.php index 19f7b4ac..b5ebf5cf 100644 --- a/lib/Froxlor/Api/Commands/CustomerBackups.php +++ b/lib/Froxlor/Api/Commands/CustomerBackups.php @@ -109,7 +109,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re \Froxlor\System\Cronjob::inserttask('20', $task_data); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] added customer-backup job for '" . $customer['loginname'] . "'. Target directory: " . $userpath); - return $this->response(200, "successfull", $task_data); + return $this->response(200, "successful", $task_data); } /** @@ -168,7 +168,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re } } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list customer-backups"); - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -202,7 +202,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re $result_count ++; } } - return $this->response(200, "successfull", $result_count); + return $this->response(200, "successful", $result_count); } /** @@ -237,7 +237,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re 'tid' => $entry ), true, true); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] deleted planned customer-backup #" . $entry); - return $this->response(200, "successfull", true); + return $this->response(200, "successful", true); } } } diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 97c31225..ee747ef6 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -60,7 +60,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -90,7 +90,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource } $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_customers']); + return $this->response(200, "successful", $result['num_customers']); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -143,7 +143,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $result['custom_notes'] = ""; } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get customer '" . $result['loginname'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'"); throw new \Exception("Customer with " . $key . " could not be found", 404); @@ -743,7 +743,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $result = $this->apiCall('Customers.get', array( 'loginname' => $loginname )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("No more resources available", 406); } @@ -1340,7 +1340,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $result = $this->apiCall('Customers.get', array( 'id' => $result['customerid'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -1573,7 +1573,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource \Froxlor\System\Cronjob::inserttask('10'); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted customer '" . $result['loginname'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -1615,7 +1615,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $result['loginfail_count'] = 0; $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked customer '" . $result['loginname'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -1685,7 +1685,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $result = $this->apiCall('Customers.get', array( 'id' => $c_result['customerid'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } diff --git a/lib/Froxlor/Api/Commands/DirOptions.php b/lib/Froxlor/Api/Commands/DirOptions.php index 6da29a4c..b7ddeb90 100644 --- a/lib/Froxlor/Api/Commands/DirOptions.php +++ b/lib/Froxlor/Api/Commands/DirOptions.php @@ -128,7 +128,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = $this->apiCall('DirOptions.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -186,7 +186,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory options for '" . $result['path'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = "id #" . $id; throw new \Exception("Directory option with " . $key . " could not be found", 404); @@ -275,7 +275,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = $this->apiCall('DirOptions.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -315,7 +315,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result[] = $row; } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-options"); - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -347,7 +347,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_htaccess']); + return $this->response(200, "successful", $result['num_htaccess']); } } @@ -414,7 +414,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc ), true, true); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted directory-option for '" . str_replace($customer_data['documentroot'], '/', $result['path']) . "'"); \Froxlor\System\Cronjob::inserttask('1'); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** diff --git a/lib/Froxlor/Api/Commands/DirProtections.php b/lib/Froxlor/Api/Commands/DirProtections.php index 04b48e69..93959d59 100644 --- a/lib/Froxlor/Api/Commands/DirProtections.php +++ b/lib/Froxlor/Api/Commands/DirProtections.php @@ -111,7 +111,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res $result = $this->apiCall('DirProtections.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -173,7 +173,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory protection for '" . $result['path'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "username '" . $username . "'"); throw new \Exception("Directory protection with " . $key . " could not be found", 404); @@ -258,7 +258,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res $result = $this->apiCall('DirProtections.get', array( 'id' => $result['id'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -298,7 +298,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res $result[] = $row; } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-protections"); - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -330,7 +330,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_htpasswd']); + return $this->response(200, "successful", $result['num_htpasswd']); } } @@ -386,6 +386,6 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'"); \Froxlor\System\Cronjob::inserttask('1'); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } diff --git a/lib/Froxlor/Api/Commands/DomainZones.php b/lib/Froxlor/Api/Commands/DomainZones.php index 303be716..f643306a 100644 --- a/lib/Froxlor/Api/Commands/DomainZones.php +++ b/lib/Froxlor/Api/Commands/DomainZones.php @@ -309,7 +309,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $result = $this->apiCall('DomainZones.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } // return $errors throw new \Exception(implode("\n", $errors)); @@ -360,7 +360,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $zonefile = (string) $zone; $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get dns-zone for '" . $result['domain'] . "'"); - return $this->response(200, "successfull", explode("\n", $zonefile)); + return $this->response(200, "successful", explode("\n", $zonefile)); } /** @@ -420,7 +420,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour while ($row = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) { $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -464,7 +464,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour 'did' => $id ), true, true); if ($result) { - return $this->response(200, "successfull", $result['num_dns']); + return $this->response(200, "successful", $result['num_dns']); } } @@ -511,8 +511,8 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour if ($del_stmt->rowCount() > 0) { // re-generate bind configs \Froxlor\System\Cronjob::inserttask('4'); - return $this->response(200, "successfull", true); + return $this->response(200, "successful", true); } - return $this->response(304, "successfull", true); + return $this->response(304, "successful", true); } } diff --git a/lib/Froxlor/Api/Commands/Domains.php b/lib/Froxlor/Api/Commands/Domains.php index bc572b3c..b87c10d5 100644 --- a/lib/Froxlor/Api/Commands/Domains.php +++ b/lib/Froxlor/Api/Commands/Domains.php @@ -68,7 +68,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn } $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -100,7 +100,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn } $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_domains']); + return $this->response(200, "successful", $result['num_domains']); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -156,7 +156,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn $result['ipsandports'] = $this->getIpsForDomain($result['id']); } $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get domain '" . $result['domain'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'"); throw new \Exception("Domain with " . $key . " could not be found", 404); @@ -828,7 +828,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn $result = $this->apiCall('Domains.get', array( 'domainname' => $domain )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } throw new \Exception("No more resources available", 406); @@ -1766,7 +1766,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn $idna_convert = new \Froxlor\Idna\IdnaWrapper(); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated domain '" . $idna_convert->decode($result['domain']) . "'"); - return $this->response(200, "successfull", $update_data); + return $this->response(200, "successful", $update_data); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -1927,7 +1927,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn \Froxlor\System\Cronjob::inserttask('1'); // Using nameserver, insert a task which rebuilds the server config \Froxlor\System\Cronjob::inserttask('4'); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } diff --git a/lib/Froxlor/Api/Commands/EmailAccounts.php b/lib/Froxlor/Api/Commands/EmailAccounts.php index d9396ee2..4a7b75b4 100644 --- a/lib/Froxlor/Api/Commands/EmailAccounts.php +++ b/lib/Froxlor/Api/Commands/EmailAccounts.php @@ -273,7 +273,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso $result = $this->apiCall('Emails.get', array( 'emailaddr' => $result['email_full'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("No more resources available", 406); } @@ -389,7 +389,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso $result = $this->apiCall('Emails.get', array( 'emailaddr' => $result['email_full'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -492,6 +492,6 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso Customers::decreaseUsage($customer['customerid'], 'email_quota_used', '', $quota); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted email account for '" . $result['email_full'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } diff --git a/lib/Froxlor/Api/Commands/EmailForwarders.php b/lib/Froxlor/Api/Commands/EmailForwarders.php index af344a67..d01094d8 100644 --- a/lib/Froxlor/Api/Commands/EmailForwarders.php +++ b/lib/Froxlor/Api/Commands/EmailForwarders.php @@ -102,7 +102,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re $result = $this->apiCall('Emails.get', array( 'emailaddr' => $result['email_full'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("No more resources available", 406); } @@ -168,7 +168,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re ]; } - return $this->response(200, "successfull", [ + return $this->response(200, "successful", [ 'count' => count($destination), 'list' => $destination ]); @@ -210,7 +210,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re $result['destination'] = explode(' ', $result['destination']); - return $this->response(200, "successfull", count($result['destination'])); + return $this->response(200, "successful", count($result['destination'])); } /** @@ -280,7 +280,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re $result = $this->apiCall('Emails.get', array( 'emailaddr' => $result['email_full'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Unknown forwarder id", 404); } diff --git a/lib/Froxlor/Api/Commands/Emails.php b/lib/Froxlor/Api/Commands/Emails.php index c22989c8..c3120fe7 100644 --- a/lib/Froxlor/Api/Commands/Emails.php +++ b/lib/Froxlor/Api/Commands/Emails.php @@ -140,7 +140,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = $this->apiCall('Emails.get', array( 'emailaddr' => $email_full )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("No more resources available", 406); } @@ -176,7 +176,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get email address '" . $result['email_full'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "emailaddr '" . $emailaddr . "'"); throw new \Exception("Email address with " . $key . " could not be found", 404); @@ -271,7 +271,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = $this->apiCall('Emails.get', array( 'emailaddr' => $result['email_full'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -310,7 +310,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result[] = $row; } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list email-addresses"); - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -340,7 +340,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_emails']); + return $this->response(200, "successful", $result['num_emails']); } } @@ -418,6 +418,6 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt Customers::decreaseUsage($customer['customerid'], 'emails_used'); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted email address '" . $result['email_full'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } diff --git a/lib/Froxlor/Api/Commands/FpmDaemons.php b/lib/Froxlor/Api/Commands/FpmDaemons.php index 09ef8091..ba757dc0 100644 --- a/lib/Froxlor/Api/Commands/FpmDaemons.php +++ b/lib/Froxlor/Api/Commands/FpmDaemons.php @@ -70,7 +70,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $fpmdaemons[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($fpmdaemons), 'list' => $fpmdaemons )); @@ -93,7 +93,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_fpms']); + return $this->response(200, "successful", $result['num_fpms']); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -121,7 +121,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc 'id' => $id ), true, true); if ($result) { - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("fpm-daemon with id #" . $id . " could not be found", 404); } @@ -234,7 +234,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = $this->apiCall('FpmDaemons.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -356,7 +356,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = $this->apiCall('FpmDaemons.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -402,7 +402,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc \Froxlor\System\Cronjob::inserttask('1'); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] fpm-daemon setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } diff --git a/lib/Froxlor/Api/Commands/Froxlor.php b/lib/Froxlor/Api/Commands/Froxlor.php index 080676d6..78c772c9 100644 --- a/lib/Froxlor/Api/Commands/Froxlor.php +++ b/lib/Froxlor/Api/Commands/Froxlor.php @@ -74,7 +74,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand // zum update schritt #1 -> download if ($isnewerversion == 1) { $text = 'There is a newer version available: "' . $_version . '" (Your current version is: ' . $this->version . ')'; - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'isnewerversion' => $isnewerversion, 'version' => $_version, 'message' => $text, @@ -83,7 +83,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand )); } elseif ($isnewerversion == 0) { // all good - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'isnewerversion' => $isnewerversion, 'version' => $version_label, 'message' => "", @@ -95,7 +95,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand } } } - return $this->response(300, "successfull", array( + return $this->response(300, "successful", array( 'isnewerversion' => 0, 'version' => $this->version . $this->branding, 'message' => 'Version-check not available due to missing php-curl extension', @@ -129,7 +129,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand \Froxlor\System\Cronjob::inserttask('4'); // cron.d file \Froxlor\System\Cronjob::inserttask('99'); - return $this->response(200, "successfull", true); + return $this->response(200, "successful", true); } catch (\Exception $e) { throw new \Exception($e->getMessage(), 406); } @@ -149,7 +149,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) { $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "User " . $this->getUserDetail('loginname') . " exported settings"); $json_export = \Froxlor\SImExporter::export(); - return $this->response(200, "successfull", $json_export); + return $this->response(200, "successful", $json_export); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -175,7 +175,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand 'value' => $row['value'] ); } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -197,7 +197,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand { if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) { $setting = $this->getParam('key'); - return $this->response(200, "successfull", Settings::Get($setting)); + return $this->response(200, "successful", Settings::Get($setting)); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -227,7 +227,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand throw new \Exception("Setting '" . $setting . "' could not be found"); } $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] Changing setting '" . $setting . "' from '" . $oldvalue . "' to '" . $value . "'"); - return $this->response(200, "successfull", Settings::Set($setting, $value, true)); + return $this->response(200, "successful", Settings::Set($setting, $value, true)); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -240,7 +240,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand */ public function generatePassword() { - return $this->response(200, "successfull", \Froxlor\System\Crypt::generatePassword()); + return $this->response(200, "successful", \Froxlor\System\Crypt::generatePassword()); } /** @@ -256,7 +256,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand $integrity = new \Froxlor\Database\IntegrityCheck(); $result = $integrity->checkAll(); if ($result) { - return $this->response(200, "successfull", "OK"); + return $this->response(200, "successful", "OK"); } throw new \Exception("Some checks failed.", 406); } @@ -333,7 +333,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand } // return the list - return $this->response(200, "successfull", $functions); + return $this->response(200, "successful", $functions); } /** diff --git a/lib/Froxlor/Api/Commands/Ftps.php b/lib/Froxlor/Api/Commands/Ftps.php index 6123796a..056c43bf 100644 --- a/lib/Froxlor/Api/Commands/Ftps.php +++ b/lib/Froxlor/Api/Commands/Ftps.php @@ -268,7 +268,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit $result = $this->apiCall('Ftps.get', array( 'username' => $username )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } throw new \Exception("No more resources available", 406); @@ -329,7 +329,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get ftp-user '" . $result['username'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "username '" . $username . "'"); throw new \Exception("FTP user with " . $key . " could not be found", 404); @@ -454,7 +454,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit 'username' => $result['username'] )); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] updated ftp-user '" . $result['username'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -490,7 +490,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit $result[] = $row; } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list ftp-users"); - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -518,7 +518,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_ftps']); + return $this->response(200, "successful", $result['num_ftps']); } } @@ -626,6 +626,6 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit Customers::decreaseUsage($customer_data['customerid'], 'ftps_used', $resetaccnumber); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted ftp-user '" . $result['username'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } diff --git a/lib/Froxlor/Api/Commands/HostingPlans.php b/lib/Froxlor/Api/Commands/HostingPlans.php index a8070198..ca3a76bc 100644 --- a/lib/Froxlor/Api/Commands/HostingPlans.php +++ b/lib/Froxlor/Api/Commands/HostingPlans.php @@ -57,7 +57,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -85,7 +85,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou } $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_plans']); + return $this->response(200, "successful", $result['num_plans']); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -120,7 +120,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get hosting-plan '" . $result['name'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "planname '" . $planname . "'"); throw new \Exception("Hosting-plan with " . $key . " could not be found", 404); @@ -246,7 +246,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou $result = $this->apiCall('HostingPlans.get', array( 'planname' => $name )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -393,7 +393,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou ); Database::pexecute($upd_stmt, $update_data, true, true); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated hosting-plan '" . $result['name'] . "'"); - return $this->response(200, "successfull", $update_data); + return $this->response(200, "successful", $update_data); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -431,7 +431,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou 'id' => $id ), true, true); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted hosting-plan '" . $result['name'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } diff --git a/lib/Froxlor/Api/Commands/IpsAndPorts.php b/lib/Froxlor/Api/Commands/IpsAndPorts.php index e9492132..adfe2965 100644 --- a/lib/Froxlor/Api/Commands/IpsAndPorts.php +++ b/lib/Froxlor/Api/Commands/IpsAndPorts.php @@ -56,7 +56,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -82,7 +82,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour SELECT COUNT(*) as num_ips FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_ips']); + return $this->response(200, "successful", $result['num_ips']); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -116,7 +116,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour ), true, true); if ($result) { $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get ip " . $result['ip'] . " " . $result['port']); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("IP/port with id #" . $id . " could not be found", 404); } @@ -307,7 +307,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $result = $this->apiCall('IpsAndPorts.get', array( 'id' => $ins_data['id'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -514,7 +514,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $result = $this->apiCall('IpsAndPorts.get', array( 'id' => $result['id'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -583,7 +583,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour \Froxlor\System\Cronjob::inserttask('4'); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted IP/port '" . $result['ip'] . ":" . $result['port'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } else { \Froxlor\UI\Response::standard_error('cantdeletesystemip', '', true); } diff --git a/lib/Froxlor/Api/Commands/Mysqls.php b/lib/Froxlor/Api/Commands/Mysqls.php index 417e13ed..6ad4e1f8 100644 --- a/lib/Froxlor/Api/Commands/Mysqls.php +++ b/lib/Froxlor/Api/Commands/Mysqls.php @@ -169,7 +169,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = $this->apiCall('Mysqls.get', array( 'dbname' => $username )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -258,7 +258,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt Database::needRoot(false); $result['size'] = $mbdata['MB'] ?? 0; $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get database '" . $result['databasename'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "dbname '" . $dbname . "'"); throw new \Exception("MySQL database with " . $key . " could not be found", 404); @@ -350,7 +350,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = $this->apiCall('Mysqls.get', array( 'dbname' => $result['databasename'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -421,7 +421,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt Database::needRoot(false); } } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -448,7 +448,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_dbs']); + return $this->response(200, "successful", $result['num_dbs']); } } @@ -510,6 +510,6 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt Customers::decreaseUsage($customer['customerid'], 'mysqls_used', $resetaccnumber); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted database '" . $result['databasename'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } } diff --git a/lib/Froxlor/Api/Commands/PhpSettings.php b/lib/Froxlor/Api/Commands/PhpSettings.php index a77d8e02..002ebbca 100644 --- a/lib/Froxlor/Api/Commands/PhpSettings.php +++ b/lib/Froxlor/Api/Commands/PhpSettings.php @@ -113,7 +113,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $phpconfigs[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($phpconfigs), 'list' => $phpconfigs )); @@ -137,7 +137,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour "); $result = Database::pexecute_first($result_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_phps']); + return $this->response(200, "successful", $result['num_phps']); } } throw new \Exception("Not allowed to execute given command.", 403); @@ -165,7 +165,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour 'id' => $id ), true, true); if ($result) { - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("php-config with id #" . $id . " could not be found", 404); } @@ -367,7 +367,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $result = $this->apiCall('PhpSettings.get', array( 'id' => $ins_data['id'] )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -563,7 +563,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $result = $this->apiCall('PhpSettings.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } @@ -614,7 +614,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour \Froxlor\System\Cronjob::inserttask('1'); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] php setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("Not allowed to execute given command.", 403); } diff --git a/lib/Froxlor/Api/Commands/SubDomains.php b/lib/Froxlor/Api/Commands/SubDomains.php index 3b7fbfb7..e4bee37f 100644 --- a/lib/Froxlor/Api/Commands/SubDomains.php +++ b/lib/Froxlor/Api/Commands/SubDomains.php @@ -345,7 +345,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = $this->apiCall('SubDomains.get', array( 'id' => $subdomain_id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } throw new \Exception("No more resources available", 406); } @@ -426,7 +426,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get subdomain '" . $result['domain'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } $key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'"); throw new \Exception("Subdomain with " . $key . " could not be found", 404); @@ -693,7 +693,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc $result = $this->apiCall('SubDomains.get', array( 'id' => $id )); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** @@ -797,7 +797,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc while ($row = $domains_stmt->fetch(\PDO::FETCH_ASSOC)) { $result[] = $row; } - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -862,7 +862,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc "); $result = Database::pexecute_first($domains_stmt, null, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_subdom']); + return $this->response(200, "successful", $result['num_subdom']); } } @@ -976,7 +976,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc Customers::decreaseUsage($customer['customerid'], 'subdomains_used'); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted subdomain '" . $result['domain'] . "'"); - return $this->response(200, "successfull", $result); + return $this->response(200, "successful", $result); } /** diff --git a/lib/Froxlor/Api/Commands/SysLog.php b/lib/Froxlor/Api/Commands/SysLog.php index c19d6e75..9e744827 100644 --- a/lib/Froxlor/Api/Commands/SysLog.php +++ b/lib/Froxlor/Api/Commands/SysLog.php @@ -74,7 +74,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result[] = $row; } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list log-entries"); - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result )); @@ -129,7 +129,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $result = Database::pexecute_first($result_stmt, $params, true, true); if ($result) { - return $this->response(200, "successfull", $result['num_logs']); + return $this->response(200, "successful", $result['num_logs']); } } @@ -204,7 +204,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $params['trunc'] = $truncatedate; Database::pexecute($result_stmt, $params, true, true); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] truncated the froxlor syslog"); - return $this->response(200, "successfull", true); + return $this->response(200, "successful", true); } throw new \Exception("Not allowed to execute given command.", 403); } diff --git a/lib/Froxlor/Api/Commands/Traffic.php b/lib/Froxlor/Api/Commands/Traffic.php index 368c81e2..7212e3c1 100644 --- a/lib/Froxlor/Api/Commands/Traffic.php +++ b/lib/Froxlor/Api/Commands/Traffic.php @@ -110,7 +110,7 @@ class Traffic extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn $result[] = $row; } $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list traffic"); - return $this->response(200, "successfull", array( + return $this->response(200, "successful", array( 'count' => count($result), 'list' => $result ));