+ if (session)
+ s = p->get_session_by_id(session);
+
+ if (!s || !s->ip)
+ {
+ data->response = NSCTL_RES_ERR;
+ data->additional = "session not found";
+ return PLUGIN_RET_STOP;
+ }
+
+ if (s->walled_garden == flag)
+ {
+ data->response = NSCTL_RES_ERR;
+ data->additional = flag ? "already in walled garden" : "not in walled garden";
+ return PLUGIN_RET_STOP;
+ }
+
+ garden_session(s, flag, data->argc > 2 ? data->argv[2] : 0);
+ p->session_changed(session);
+
+ data->response = NSCTL_RES_OK;
+ data->additional = 0;
+