- p->log(3, 0, 0, 0, "Unknown session %d\n", session);
+ if (!(session = strtol(data->argv[1], &end, 10)) || *end)
+ {
+ if (flag)
+ session = p->get_session_by_username(data->argv[1]);
+ else
+ session = 0; // can't ungarden by username
+ }
+
+ if (session)
+ s = p->get_session_by_id(session);
+
+ if (!s || !s->ip)
+ {
+ data->response = NSCTL_RES_ERR;
+ data->additional = "session not found";