]> andersk Git - moira.git/blobdiff - clients/addusr/addusr.c
add cleandir/distclean target
[moira.git] / clients / addusr / addusr.c
index 694271253568ebab2afc983e41af5f0c5b707115..96f18f3fd3c230116421ce15c70d234647437185 100644 (file)
@@ -12,6 +12,7 @@
 #include <mit-copyright.h>
 #include <moira.h>
 #include <moira_site.h>
+#include <mrclient.h>
 
 #include <ctype.h>
 #include <errno.h>
@@ -44,7 +45,7 @@ int main(int argc, char **argv)
 {
   int status, lineno;
   char **arg = argv, *qargv[U_END];
-  char *motd, *p, *first, *middle, *last, *id, *login, *server;
+  char *p, *first, *middle, *last, *id, *login, *server;
   char buf[BUFSIZ], idbuf[32];
   FILE *input;
 
@@ -154,34 +155,8 @@ int main(int argc, char **argv)
     }
 
   /* fire up Moira */
-  if ((status = mr_connect(server)))
-    {
-      com_err(whoami, status, "unable to connect to the Moira server");
-      exit(2);
-    }
-  if ((status = mr_motd(&motd)))
-    {
-      com_err(whoami, status, "unable to check server status");
-      exit(2);
-    }
-  if (motd)
-    {
-      fprintf(stderr, "The Moira server is currently unavailable:\n%s\n",
-             motd);
-      mr_disconnect();
-      exit(2);
-    }
-
-  if ((status = mr_auth("addusr")))
-    {
-      if (status == MR_USER_AUTH)
-       com_err(whoami, status, "");
-      else
-       {
-         com_err(whoami, status, "unable to authenticate to Moira");
-         exit(2);
-       }
-    }
+  if (mrcl_connect(server, "addusr", 1) != MRCL_SUCCESS)
+    exit(2);
 
   qargv[U_NAME] = UNIQUE_LOGIN;
   qargv[U_UID] = UNIQUE_UID;
This page took 0.043518 seconds and 4 git commands to generate.