Revert "remove unused credentials ejs module."
[kai/samba-autobuild/.git] / source4 / scripting / ejs / ejsnet / net_user.c
index 34524cc0faba39a6670043892858a32b803cae85..0c32035c6cb827259ef8b291438047a08540ccb9 100644 (file)
@@ -195,9 +195,9 @@ static int ejs_net_deleteuser(MprVarHandle eid, int argc, char **argv)
                ejsSetErrorMsg(eid, "ctx property returns null pointer");
                goto done;
        }
-       
+
        /* domain where the account is to be deleted */
-       userman_domain = (struct libnet_context *)mprGetThisPtr(eid, "domain");
+       userman_domain = mprGetThisPtr(eid, "domain");
        if (!userman_domain) {
                ejsSetErrorMsg(eid, "domain property returns null pointer");
                goto done;
@@ -258,9 +258,9 @@ static int ejs_net_userinfo(MprVarHandle eid, int argc, char **argv)
                ejsSetErrorMsg(eid, "ctx property returns null pointer");
                goto done;
        }
-       
+
        /* domain where the user account is to be queried */
-       userman_domain = (struct libnet_context *)mprGetThisPtr(eid, "domain");
+       userman_domain = mprGetThisPtr(eid, "domain");
        if (userman_domain == NULL) {
                ejsSetErrorMsg(eid, "domain property returns null pointer");
                return -1;
@@ -268,8 +268,9 @@ static int ejs_net_userinfo(MprVarHandle eid, int argc, char **argv)
 
        /* call the libnet function */
        req.in.domain_name = userman_domain;
-       req.in.user_name   = username;
-       
+       req.in.data.user_name   = username;
+       req.in.level = USER_INFO_BY_NAME;
+
        status = libnet_UserInfo(ctx, mem_ctx, &req);
        if (!NT_STATUS_IS_OK(status)) {
                ejsSetErrorMsg(eid, "%s", req.out.error_string);