if(disorder_set_volume(c, atoi(argv[0]), atoi(argv[1]))) exit(EXIT_FAILURE);
}
-static void cf_become(disorder_client *c,
- char **argv) {
- if(disorder_become(c, argv[0])) exit(EXIT_FAILURE);
-}
-
static void cf_log(disorder_client *c,
char attribute((unused)) **argv) {
if(disorder_log(c, sink_stdio("stdout", stdout))) exit(EXIT_FAILURE);
xprintf("%s\n", nullcheck(utf82mb(*vec++)));
}
+static void cf_users(disorder_client *c,
+ char attribute((unused)) **argv) {
+ char **vec;
+
+ if(disorder_users(c, &vec, 0)) exit(EXIT_FAILURE);
+ while(*vec)
+ xprintf("%s\n", nullcheck(utf82mb(*vec++)));
+}
+
static void cf_get_global(disorder_client *c, char **argv) {
char *value;
exit(EXIT_FAILURE);
}
+static void cf_deluser(disorder_client *c,
+ char **argv) {
+ if(disorder_deluser(c, argv[0]))
+ exit(EXIT_FAILURE);
+}
+
+static void cf_edituser(disorder_client *c,
+ char **argv) {
+ if(disorder_edituser(c, argv[0], argv[1], argv[2]))
+ exit(EXIT_FAILURE);
+}
+
+static void cf_userinfo(disorder_client *c, char **argv) {
+ char *s;
+
+ if(disorder_userinfo(c, argv[0], argv[1], &s))
+ exit(EXIT_FAILURE);
+ xprintf("%s\n", nullcheck(utf82mb(s)));
+}
+
static const struct command {
const char *name;
int min, max;
"List all files and directories in DIR" },
{ "authorize", 1, 1, cf_authorize, 0, "USER",
"Authorize USER to connect to the server" },
- { "become", 1, 1, cf_become, 0, "USER",
- "Become user USER" },
+ { "deluser", 1, 1, cf_deluser, 0, "USER",
+ "Delete a user" },
{ "dirs", 1, 2, cf_dirs, isarg_regexp, "DIR [~REGEXP]",
"List directories in DIR" },
{ "disable", 0, 0, cf_disable, 0, "",
"Disable play" },
{ "disable-random", 0, 0, cf_random_disable, 0, "",
"Disable random play" },
+ { "edituser", 3, 3, cf_edituser, 0, "USER PROPERTY VALUE",
+ "Set a property of a user" },
{ "enable", 0, 0, cf_enable, 0, "",
"Enable play" },
{ "enable-random", 0, 0, cf_random_enable, 0, "",
"Unset a preference" },
{ "unset-global", 1, 1, cf_unset_global, 0, "NAME",
"Unset a global preference" },
+ { "userinfo", 2, 2, cf_userinfo, 0, "USER PROPERTY",
+ "Get a property of as user" },
+ { "users", 0, 0, cf_users, 0, "",
+ "List all users" },
{ "version", 0, 0, cf_version, 0, "",
"Display the server version" },
};