7 static bool do_password_change (const struct TreeNode *tn UNUSED, int nb, const char **com, struct ngadmin *nga) {
10 const struct swi_attr *sa;
14 printf("Usage: password set <value>\n");
18 if ( (sa=ngadmin_getCurrentSwitch(nga))==NULL ) {
19 printf("must be logged\n");
23 i=ngadmin_changePassword(nga, com[0]);
33 static bool do_password_set (const struct TreeNode *tn UNUSED, int nb, const char **com, struct ngadmin *nga) {
39 printf("Usage: password set <value>\n");
43 i=ngadmin_setPassword(nga, com[0]);
54 static const struct TreeNode com_password_change=COM("change", do_password_change, true, NULL);
55 static const struct TreeNode com_password_set=COM("set", do_password_set, true, NULL);
57 const struct TreeNode com_password=COM("password", NULL, false, &com_password_change, &com_password_set, NULL);