From 18e990a4f37a750ff71a2c5c9206afcd95df6208 Mon Sep 17 00:00:00 2001 From: Jeffrey Hutzelman Date: Fri, 22 Feb 2013 21:17:44 -0500 Subject: Allow zctl flush_locs to take a user argument Provide a new library function, ZFlushUserLocations(), to flush locations for a specified user. This can be called using zctl flush_locs, which now takes an optional username parameter. This is the client side of #102 --- clients/zctl/zctl.1.in | 8 +++++--- clients/zctl/zctl.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'clients') diff --git a/clients/zctl/zctl.1.in b/clients/zctl/zctl.1.in index d3835d3..ec9dbf0 100644 --- a/clients/zctl/zctl.1.in +++ b/clients/zctl/zctl.1.in @@ -66,10 +66,12 @@ from the subscriptions file as an un-subscription. Set default subscriptions file to \fIfile\fR. If \fIfile\fR isn't specified, show what the current subscriptions file is. .TP -.B flush_locs +.B flush_locs \fR[ \fIuser\fR ] Tell the Zephyr servers to flush all location information associated with -the user. This should only be used to remove any incorrect data that may have -been left after a system crash. +\fIuser\fR, or with the user running the command if none is given. This +should only be used to remove any incorrect data that may have been left +after a system crash. Note that only Operations staff may flush location +information associated with another user. .TP .B hide Hide your location as maintained by the Zephyr server. This does not diff --git a/clients/zctl/zctl.c b/clients/zctl/zctl.c index 706f3cd..1dfa792 100644 --- a/clients/zctl/zctl.c +++ b/clients/zctl/zctl.c @@ -217,12 +217,17 @@ flush_locations(int argc, { int retval; - if (argc > 1) { - fprintf(stderr,"Usage: %s\n",argv[0]); + if (argc > 2) { + fprintf(stderr,"Usage: %s [user]\n",argv[0]); return; } - if ((retval = ZFlushMyLocations()) != ZERR_NONE) + if (argc > 1) + retval = ZFlushUserLocations(argv[1]); + else + retval = ZFlushMyLocations(); + + if (retval != ZERR_NONE) com_err(whoami, retval, "while flushing locations"); } -- cgit v1.2.3