|
|
@@ -17,13 +17,13 @@ require_once __DIR__ . '/controllers/BackupController.php';
|
|
|
require_once __DIR__ . '/controllers/DeployDevController.php';
|
|
|
require_once __DIR__ . '/controllers/GetSSLDaysController.php';
|
|
|
require_once __DIR__ . '/controllers/ProdController.php';
|
|
|
+require_once __DIR__ . '/controllers/QuotaController.php';
|
|
|
|
|
|
use application\controllers\BackupController;
|
|
|
use application\controllers\DeployDevController;
|
|
|
use application\controllers\GetSSLDaysController;
|
|
|
use application\controllers\ProdController;
|
|
|
-
|
|
|
-
|
|
|
+use application\controllers\QuotaController;
|
|
|
|
|
|
const API_PASSWORD = 'your-secure-password';
|
|
|
|
|
|
@@ -141,6 +141,24 @@ switch ($endpoint) {
|
|
|
error_log("Request ping from " . get_client_ip());
|
|
|
echo json_encode(['answer' => 'pong']);
|
|
|
break;
|
|
|
+ case 'getQuota':
|
|
|
+ error_log("Request getquota from " . get_client_ip());
|
|
|
+ if ($requestMethod === 'GET' && !empty($username)) {
|
|
|
+ QuotaController::getQuota(['username' => $username]);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'getStats':
|
|
|
+ error_log("Request getstats from " . get_client_ip());
|
|
|
+ if ($requestMethod === 'GET') {
|
|
|
+ QuotaController::getStats();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'setQuota':
|
|
|
+ error_log("Request setquota from " . get_client_ip());
|
|
|
+ if ($requestMethod === 'POST' && !empty($username)) {
|
|
|
+ QuotaController::setQuota(array_merge($parameters, ['username' => $username]));
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
error_log("Error Request: " . $endpoint . " / " . $username ." / " . $domain);
|
|
|
http_response_code(404);
|