MCPcopy Index your code
hub / github.com/foxcpp/maddy / usersRemove

Function usersRemove

internal/cli/ctl/users.go:213–226  ·  view source on GitHub ↗
(be module.PlainUserDB, ctx *cli.Context)

Source from the content-addressed store, hash-verified

211}
212
213func usersRemove(be module.PlainUserDB, ctx *cli.Context) error {
214 username := ctx.Args().First()
215 if username == "" {
216 return errors.New("error: USERNAME is required")
217 }
218
219 if !ctx.Bool("yes") {
220 if !clitools2.Confirmation("Are you sure you want to delete this user account?", false) {
221 return errors.New("cancelled")
222 }
223 }
224
225 return be.DeleteUser(username)
226}
227
228func usersPassword(be module.PlainUserDB, ctx *cli.Context) error {
229 username := ctx.Args().First()

Callers 1

initFunction · 0.85

Calls 3

ArgsMethod · 0.80
BoolMethod · 0.80
DeleteUserMethod · 0.65

Tested by

no test coverage detected