+/* Update a user's status in Moira */
+int update_user_status(char *username, int account_status)
+{
+ char statusbuf[2], *qargv[2], *motd = NULL;
+ long status;
+
+ status = mr_connect(hostname);
+ if (status)
+ return status;
+
+ status = mr_motd(&motd);
+ if (status || motd)
+ {
+ mr_disconnect();
+ return MR_DOWN;
+ }
+
+ status = mr_krb5_auth("reg_svr");
+ if (status)
+ {
+ com_err(whoami, status, "authenticating to moira");
+ mr_disconnect();
+ return MR_INTERNAL;
+ }
+
+ sprintf(statusbuf, "%d", account_status);
+ qargv[0] = username;
+ qargv[1] = statusbuf;
+
+ status = mr_query("update_user_status", 2, qargv, NULL, NULL);
+ mr_disconnect();
+ return status;
+}
+