fix typo in response status message, fixes #858

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2020-06-08 11:42:44 +02:00
parent 490704f8e1
commit 1a0953e77e
23 changed files with 153 additions and 123 deletions

View File

@@ -51,7 +51,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); 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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { if ($result) {
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get admin '" . $result['loginname'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'");
throw new \Exception("Admin with " . $key . " could not be found", 404); 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( $result = $this->apiCall('Admins.get', array(
'id' => $adminid 'id' => $adminid
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
} }
throw new \Exception("Not allowed to execute given command.", 403); 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( $result = $this->apiCall('Admins.get', array(
'id' => $result['adminid'] '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'] . "'"); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted admin '" . $result['loginname'] . "'");
\Froxlor\User::updateCounters(); \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); 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; $result['loginfail_count'] = 0;
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked admin '" . $result['loginname'] . "'"); $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); throw new \Exception("Not allowed to execute given command.", 403);
} }

View File

@@ -0,0 +1,30 @@
<?php
namespace Froxlor\Api\Commands;
use Froxlor\Database\Database;
use Froxlor\Settings;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (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()
{}
}

View File

@@ -81,7 +81,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
$result = $this->apiCall('Certificates.get', array( $result = $this->apiCall('Certificates.get', array(
'id' => $domain['id'] '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); 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) { if (! $result) {
throw new \Exception("Domain '" . $domain['domain'] . "' does not have a certificate.", 412); 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( $result = $this->apiCall('Certificates.get', array(
'id' => $domain['id'] '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; $result[] = $cert;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $result 'list' => $result
)); ));
@@ -258,7 +258,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
$certs_stmt = Database::prepare($certs_stmt_query); $certs_stmt = Database::prepare($certs_stmt_query);
$result = Database::pexecute_first($certs_stmt, $qry_params, true, true); $result = Database::pexecute_first($certs_stmt, $qry_params, true, true);
if ($result) { 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']); \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'] . "'"); $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); throw new \Exception("Unable to determine SSL certificate. Maybe no access?", 406);
} }

View File

@@ -51,7 +51,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE
'id' => $id 'id' => $id
), true, true); ), true, true);
if ($result) { 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); 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( $result = $this->apiCall('Cronjobs.get', array(
'id' => $id 'id' => $id
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Not allowed to execute given command.", 403); 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)) { while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); throw new \Exception("Not allowed to execute given command.", 403);

View File

@@ -109,7 +109,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
\Froxlor\System\Cronjob::inserttask('20', $task_data); \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); $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"); $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), 'count' => count($result),
'list' => $result 'list' => $result
)); ));
@@ -202,7 +202,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
$result_count ++; $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 'tid' => $entry
), true, true); ), true, true);
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] deleted planned customer-backup #" . $entry); $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);
} }
} }
} }

View File

@@ -60,7 +60,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { 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); 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'] = ""; $result['custom_notes'] = "";
} }
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get customer '" . $result['loginname'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'");
throw new \Exception("Customer with " . $key . " could not be found", 404); 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( $result = $this->apiCall('Customers.get', array(
'loginname' => $loginname 'loginname' => $loginname
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("No more resources available", 406); 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( $result = $this->apiCall('Customers.get', array(
'id' => $result['customerid'] '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'); \Froxlor\System\Cronjob::inserttask('10');
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted customer '" . $result['loginname'] . "'"); $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); 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; $result['loginfail_count'] = 0;
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked customer '" . $result['loginname'] . "'"); $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); 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( $result = $this->apiCall('Customers.get', array(
'id' => $c_result['customerid'] '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); throw new \Exception("Not allowed to execute given command.", 403);
} }

View File

@@ -128,7 +128,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$result = $this->apiCall('DirOptions.get', array( $result = $this->apiCall('DirOptions.get', array(
'id' => $id '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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { if ($result) {
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory options for '" . $result['path'] . "'"); $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; $key = "id #" . $id;
throw new \Exception("Directory option with " . $key . " could not be found", 404); 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( $result = $this->apiCall('DirOptions.get', array(
'id' => $id '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; $result[] = $row;
} }
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-options"); $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), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); ), 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']) . "'"); $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'); \Froxlor\System\Cronjob::inserttask('1');
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
/** /**

View File

@@ -111,7 +111,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
$result = $this->apiCall('DirProtections.get', array( $result = $this->apiCall('DirProtections.get', array(
'id' => $id '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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { if ($result) {
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory protection for '" . $result['path'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "username '" . $username . "'");
throw new \Exception("Directory protection with " . $key . " could not be found", 404); 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( $result = $this->apiCall('DirProtections.get', array(
'id' => $result['id'] '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; $result[] = $row;
} }
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-protections"); $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), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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'] . ")'"); $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'); \Froxlor\System\Cronjob::inserttask('1');
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
} }

View File

@@ -309,7 +309,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$result = $this->apiCall('DomainZones.get', array( $result = $this->apiCall('DomainZones.get', array(
'id' => $id 'id' => $id
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
// return $errors // return $errors
throw new \Exception(implode("\n", $errors)); throw new \Exception(implode("\n", $errors));
@@ -360,7 +360,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$zonefile = (string) $zone; $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'] . "'"); $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)) { while ($row = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $result 'list' => $result
)); ));
@@ -464,7 +464,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
'did' => $id 'did' => $id
), true, true); ), true, true);
if ($result) { 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) { if ($del_stmt->rowCount() > 0) {
// re-generate bind configs // re-generate bind configs
\Froxlor\System\Cronjob::inserttask('4'); \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);
} }
} }

View File

@@ -68,7 +68,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
} }
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { 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); 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']); $result['ipsandports'] = $this->getIpsForDomain($result['id']);
} }
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get domain '" . $result['domain'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'");
throw new \Exception("Domain with " . $key . " could not be found", 404); 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( $result = $this->apiCall('Domains.get', array(
'domainname' => $domain 'domainname' => $domain
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
} }
throw new \Exception("No more resources available", 406); 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(); $idna_convert = new \Froxlor\Idna\IdnaWrapper();
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated domain '" . $idna_convert->decode($result['domain']) . "'"); $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); 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'); \Froxlor\System\Cronjob::inserttask('1');
// Using nameserver, insert a task which rebuilds the server config // Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4'); \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); throw new \Exception("Not allowed to execute given command.", 403);
} }

View File

@@ -273,7 +273,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
$result = $this->apiCall('Emails.get', array( $result = $this->apiCall('Emails.get', array(
'emailaddr' => $result['email_full'] 'emailaddr' => $result['email_full']
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("No more resources available", 406); 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( $result = $this->apiCall('Emails.get', array(
'emailaddr' => $result['email_full'] '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); 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'] . "'"); $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);
} }
} }

View File

@@ -102,7 +102,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
$result = $this->apiCall('Emails.get', array( $result = $this->apiCall('Emails.get', array(
'emailaddr' => $result['email_full'] 'emailaddr' => $result['email_full']
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("No more resources available", 406); 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), 'count' => count($destination),
'list' => $destination 'list' => $destination
]); ]);
@@ -210,7 +210,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
$result['destination'] = explode(' ', $result['destination']); $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( $result = $this->apiCall('Emails.get', array(
'emailaddr' => $result['email_full'] 'emailaddr' => $result['email_full']
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Unknown forwarder id", 404); throw new \Exception("Unknown forwarder id", 404);
} }

View File

@@ -140,7 +140,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$result = $this->apiCall('Emails.get', array( $result = $this->apiCall('Emails.get', array(
'emailaddr' => $email_full 'emailaddr' => $email_full
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("No more resources available", 406); 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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { if ($result) {
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get email address '" . $result['email_full'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "emailaddr '" . $emailaddr . "'");
throw new \Exception("Email address with " . $key . " could not be found", 404); 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( $result = $this->apiCall('Emails.get', array(
'emailaddr' => $result['email_full'] '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; $result[] = $row;
} }
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list email-addresses"); $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), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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'); 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'] . "'"); $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);
} }
} }

View File

@@ -70,7 +70,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$fpmdaemons[] = $row; $fpmdaemons[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($fpmdaemons), 'count' => count($fpmdaemons),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); 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 'id' => $id
), true, true); ), true, true);
if ($result) { 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); 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( $result = $this->apiCall('FpmDaemons.get', array(
'id' => $id 'id' => $id
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Not allowed to execute given command.", 403); 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( $result = $this->apiCall('FpmDaemons.get', array(
'id' => $id 'id' => $id
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Not allowed to execute given command.", 403); 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'); \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') . "'"); $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); throw new \Exception("Not allowed to execute given command.", 403);
} }

View File

@@ -74,7 +74,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
// zum update schritt #1 -> download // zum update schritt #1 -> download
if ($isnewerversion == 1) { if ($isnewerversion == 1) {
$text = 'There is a newer version available: "' . $_version . '" (Your current version is: ' . $this->version . ')'; $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, 'isnewerversion' => $isnewerversion,
'version' => $_version, 'version' => $_version,
'message' => $text, 'message' => $text,
@@ -83,7 +83,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
)); ));
} elseif ($isnewerversion == 0) { } elseif ($isnewerversion == 0) {
// all good // all good
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'isnewerversion' => $isnewerversion, 'isnewerversion' => $isnewerversion,
'version' => $version_label, 'version' => $version_label,
'message' => "", '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, 'isnewerversion' => 0,
'version' => $this->version . $this->branding, 'version' => $this->version . $this->branding,
'message' => 'Version-check not available due to missing php-curl extension', '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'); \Froxlor\System\Cronjob::inserttask('4');
// cron.d file // cron.d file
\Froxlor\System\Cronjob::inserttask('99'); \Froxlor\System\Cronjob::inserttask('99');
return $this->response(200, "successfull", true); return $this->response(200, "successful", true);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new \Exception($e->getMessage(), 406); throw new \Exception($e->getMessage(), 406);
} }
@@ -149,7 +149,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) { if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "User " . $this->getUserDetail('loginname') . " exported settings"); $this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "User " . $this->getUserDetail('loginname') . " exported settings");
$json_export = \Froxlor\SImExporter::export(); $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); throw new \Exception("Not allowed to execute given command.", 403);
} }
@@ -175,7 +175,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
'value' => $row['value'] 'value' => $row['value']
); );
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $result 'list' => $result
)); ));
@@ -197,7 +197,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
{ {
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) { if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
$setting = $this->getParam('key'); $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); 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"); 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 . "'"); $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); throw new \Exception("Not allowed to execute given command.", 403);
} }
@@ -240,7 +240,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
*/ */
public function generatePassword() 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(); $integrity = new \Froxlor\Database\IntegrityCheck();
$result = $integrity->checkAll(); $result = $integrity->checkAll();
if ($result) { if ($result) {
return $this->response(200, "successfull", "OK"); return $this->response(200, "successful", "OK");
} }
throw new \Exception("Some checks failed.", 406); throw new \Exception("Some checks failed.", 406);
} }
@@ -333,7 +333,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
} }
// return the list // return the list
return $this->response(200, "successfull", $functions); return $this->response(200, "successful", $functions);
} }
/** /**

View File

@@ -268,7 +268,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
$result = $this->apiCall('Ftps.get', array( $result = $this->apiCall('Ftps.get', array(
'username' => $username 'username' => $username
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
} }
throw new \Exception("No more resources available", 406); 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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { if ($result) {
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get ftp-user '" . $result['username'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "username '" . $username . "'");
throw new \Exception("FTP user with " . $key . " could not be found", 404); 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'] 'username' => $result['username']
)); ));
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] updated ftp-user '" . $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; $result[] = $row;
} }
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list ftp-users"); $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), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); 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'] . "'"); $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);
} }
} }

View File

@@ -57,7 +57,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { 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); 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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { if ($result) {
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get hosting-plan '" . $result['name'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "planname '" . $planname . "'");
throw new \Exception("Hosting-plan with " . $key . " could not be found", 404); 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( $result = $this->apiCall('HostingPlans.get', array(
'planname' => $name 'planname' => $name
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Not allowed to execute given command.", 403); 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); Database::pexecute($upd_stmt, $update_data, true, true);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated hosting-plan '" . $result['name'] . "'"); $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); 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 'id' => $id
), true, true); ), true, true);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted hosting-plan '" . $result['name'] . "'"); $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); throw new \Exception("Not allowed to execute given command.", 403);
} }

View File

@@ -56,7 +56,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); SELECT COUNT(*) as num_ips FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where);
$result = Database::pexecute_first($result_stmt, null, true, true); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); 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); ), true, true);
if ($result) { if ($result) {
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get ip " . $result['ip'] . " " . $result['port']); $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); 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( $result = $this->apiCall('IpsAndPorts.get', array(
'id' => $ins_data['id'] '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); 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( $result = $this->apiCall('IpsAndPorts.get', array(
'id' => $result['id'] '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); 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'); \Froxlor\System\Cronjob::inserttask('4');
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted IP/port '" . $result['ip'] . ":" . $result['port'] . "'"); $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 { } else {
\Froxlor\UI\Response::standard_error('cantdeletesystemip', '', true); \Froxlor\UI\Response::standard_error('cantdeletesystemip', '', true);
} }

View File

@@ -169,7 +169,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$result = $this->apiCall('Mysqls.get', array( $result = $this->apiCall('Mysqls.get', array(
'dbname' => $username '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); Database::needRoot(false);
$result['size'] = $mbdata['MB'] ?? 0; $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'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "dbname '" . $dbname . "'");
throw new \Exception("MySQL database with " . $key . " could not be found", 404); 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( $result = $this->apiCall('Mysqls.get', array(
'dbname' => $result['databasename'] '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); Database::needRoot(false);
} }
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); 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'] . "'"); $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);
} }
} }

View File

@@ -113,7 +113,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$phpconfigs[] = $row; $phpconfigs[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($phpconfigs), 'count' => count($phpconfigs),
'list' => $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); $result = Database::pexecute_first($result_stmt, null, true, true);
if ($result) { 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); 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 'id' => $id
), true, true); ), true, true);
if ($result) { 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); 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( $result = $this->apiCall('PhpSettings.get', array(
'id' => $ins_data['id'] '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); 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( $result = $this->apiCall('PhpSettings.get', array(
'id' => $id 'id' => $id
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Not allowed to execute given command.", 403); 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'); \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') . "'"); $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); throw new \Exception("Not allowed to execute given command.", 403);
} }

View File

@@ -345,7 +345,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$result = $this->apiCall('SubDomains.get', array( $result = $this->apiCall('SubDomains.get', array(
'id' => $subdomain_id 'id' => $subdomain_id
)); ));
return $this->response(200, "successfull", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("No more resources available", 406); 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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { if ($result) {
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get subdomain '" . $result['domain'] . "'"); $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 . "'"); $key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'");
throw new \Exception("Subdomain with " . $key . " could not be found", 404); 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( $result = $this->apiCall('SubDomains.get', array(
'id' => $id '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)) { while ($row = $domains_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;
} }
return $this->response(200, "successfull", array( return $this->response(200, "successful", array(
'count' => count($result), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($domains_stmt, null, true, true);
if ($result) { 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'); 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'] . "'"); $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);
} }
/** /**

View File

@@ -74,7 +74,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$result[] = $row; $result[] = $row;
} }
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list log-entries"); $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), 'count' => count($result),
'list' => $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); $result = Database::pexecute_first($result_stmt, $params, true, true);
if ($result) { 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; $params['trunc'] = $truncatedate;
Database::pexecute($result_stmt, $params, true, true); 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"); $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); throw new \Exception("Not allowed to execute given command.", 403);
} }

View File

@@ -110,7 +110,7 @@ class Traffic extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$result[] = $row; $result[] = $row;
} }
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list traffic"); $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), 'count' => count($result),
'list' => $result 'list' => $result
)); ));