summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-10-01 16:00:34 +0300
committerAndrew Dolgov <fox@fakecake.org>2024-10-01 16:00:34 +0300
commit884fd92f1320d17daebb772297da03fb2cfa59b8 (patch)
tree3aa80af1df6ffa1d70f21f9fc4411f451c8b6c56 /backend.php
parent8fcc68baf5b0ff964a0a4a045353462586e0e316 (diff)
drop opentelemetry
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php15
1 files changed, 1 insertions, 14 deletions
diff --git a/backend.php b/backend.php
index a56847111..762557956 100644
--- a/backend.php
+++ b/backend.php
@@ -35,8 +35,6 @@
return;
}
- $span = OpenTelemetry\API\Trace\Span::getCurrent();
-
header("Content-Type: text/json; charset=utf-8");
if (Config::get(Config::SINGLE_USER_MODE)) {
@@ -48,7 +46,6 @@
header("Content-Type: text/json");
print Errors::to_json(Errors::E_UNAUTHORIZED);
- $span->setAttribute('error', Errors::E_UNAUTHORIZED);
return;
}
UserHelper::load_user_plugins($_SESSION["uid"]);
@@ -57,7 +54,6 @@
if (Config::is_migration_needed()) {
print Errors::to_json(Errors::E_SCHEMA_MISMATCH);
- $span->setAttribute('error', Errors::E_SCHEMA_MISMATCH);
return;
}
@@ -120,7 +116,6 @@
header("Content-Type: text/json");
print Errors::to_json(Errors::E_UNAUTHORIZED);
- $span->setAttribute('error', Errors::E_UNAUTHORIZED);
return;
}
@@ -133,16 +128,14 @@
}
if (implements_interface($handler, 'IHandler')) {
- $span->addEvent("construct/$op");
+
$handler->__construct($_REQUEST);
if (validate_csrf($csrf_token) || $handler->csrf_ignore($method)) {
- $span->addEvent("before/$method");
$before = $handler->before($method);
if ($before) {
- $span->addEvent("method/$method");
if ($method && method_exists($handler, $method)) {
$reflection = new ReflectionMethod($handler, $method);
@@ -152,7 +145,6 @@
user_error("Refusing to invoke method $method of handler $op which has required parameters.", E_USER_WARNING);
header("Content-Type: text/json");
- $span->setAttribute('error', Errors::E_UNAUTHORIZED);
print Errors::to_json(Errors::E_UNAUTHORIZED);
}
} else {
@@ -161,19 +153,16 @@
} else {
header("Content-Type: text/json");
- $span->setAttribute('error', Errors::E_UNKNOWN_METHOD);
print Errors::to_json(Errors::E_UNKNOWN_METHOD, ["info" => get_class($handler) . "->$method"]);
}
}
- $span->addEvent("after/$method");
$handler->after();
return;
} else {
header("Content-Type: text/json");
print Errors::to_json(Errors::E_UNAUTHORIZED);
- $span->setAttribute('error', Errors::E_UNAUTHORIZED);
return;
}
} else {
@@ -181,7 +170,6 @@
header("Content-Type: text/json");
print Errors::to_json(Errors::E_UNAUTHORIZED);
- $span->setAttribute('error', Errors::E_UNAUTHORIZED);
return;
}
}
@@ -190,4 +178,3 @@
header("Content-Type: text/json");
print Errors::to_json(Errors::E_UNKNOWN_METHOD, [ "info" => (isset($handler) ? get_class($handler) : "UNKNOWN:".$op) . "->$method"]);
- $span->setAttribute('error', Errors::E_UNKNOWN_METHOD);