]> git.sur5r.net Git - ngadmin/blobdiff - cli/com_password.c
CLI: reunited commands in one file.
[ngadmin] / cli / com_password.c
diff --git a/cli/com_password.c b/cli/com_password.c
deleted file mode 100644 (file)
index 4b1f184..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-
-#include "common.h"
-
-
-
-
-static bool do_password_change (const struct TreeNode *tn UNUSED, int nb, const char **com, struct ngadmin *nga) {
- int i;
- const struct swi_attr *sa;
- if ( nb!=1 ) {
-  printf("Usage: password set <value>\n");
-  return false;
- }
- if ( (sa=ngadmin_getCurrentSwitch(nga))==NULL ) {
-  printf("must be logged\n");
-  return false;
- }
- i=ngadmin_changePassword(nga, com[0]);
- printErrCode(i);
- return true;
-}
-
-
-
-static bool do_password_set (const struct TreeNode *tn UNUSED, int nb, const char **com, struct ngadmin *nga) {
- int i;
- if ( nb!=1 ) {
-  printf("Usage: password set <value>\n");
-  return false;
- }
- i=ngadmin_setPassword(nga, com[0]);
- printErrCode(i);
- return true;
-}
-
-
-
-
-static const struct TreeNode com_password_change=COM("change", do_password_change, true, NULL);
-static const struct TreeNode com_password_set=COM("set", do_password_set, true, NULL);
-
-const struct TreeNode com_password=COM("password", NULL, false, &com_password_change, &com_password_set, NULL);
-
-
-