- FCGI_JSONPair("description", "Already logged in");
- FCGI_JSONPair("user", context->login_ip);
- FCGI_JSONPair("time", buf);
- FCGI_EndJSON();
- }
-}
-
-/*TODO: Remove and replace with the actual actuator code*/
-static void ActuatorHandler(FCGIContext *context, char *params) {
- const char *key, *value, *loginkey = NULL;
- while ((params = FCGI_KeyPair(params, &key, &value))) {
- if (!strcmp(key, "key")) {
- loginkey = value;
- }
- }
- if (!loginkey || !FCGI_Authorized(context, loginkey)) {
- FCGI_BeginJSON(context, STATUS_UNAUTHORIZED);
- FCGI_JSONPair("description", "Invalid key specified.");
- FCGI_EndJSON();
- } else {
- FCGI_BeginJSON(context, STATUS_OK);
- FCGI_JSONPair("description", "Logged in!");
+ FCGI_JSONPair("description", "Another user already has control");
+ FCGI_JSONPair("current_user", context->control_ip);
+ FCGI_JSONPair("when", buf);