From 55e746ad560d4406821bc2d721cbb929b79a7a0a Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Mon, 22 Aug 2005 14:32:58 +0000 Subject: r9477: Convert popt options to an ejs object. Doesn't seem to break anything except of popt help (-h) option (unexpected ?). rafal (This used to be commit 1990793b23d6198a85ce1bdf6ad43e12015db203) --- source4/scripting/ejs/smbcalls_auth.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_auth.c') diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c index 4b3534b4cc..37ac9543cc 100644 --- a/source4/scripting/ejs/smbcalls_auth.c +++ b/source4/scripting/ejs/smbcalls_auth.c @@ -105,16 +105,19 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv) const char *password; const char *domain; const char *remote_host; - struct MprVar auth; + struct MprVar auth, *creds_obj; + struct cli_credentials *creds; if (argc != 1 || argv[0]->type != MPR_TYPE_OBJECT) { ejsSetErrorMsg(eid, "userAuth invalid arguments, this function requires an object."); return -1; } - username = mprToString(mprGetProperty(argv[0], "username", NULL)); - password = mprToString(mprGetProperty(argv[0], "password", NULL)); - domain = mprToString(mprGetProperty(argv[0], "domain", NULL)); + /* get credential values from credentials object */ + creds = mprGetPtr(argv[0], "creds"); + username = cli_credentials_get_username(creds); + password = cli_credentials_get_password(creds); + domain = cli_credentials_get_domain(creds); remote_host = mprToString(mprGetProperty(argv[0], "rhost", NULL)); if (username == NULL || password == NULL || domain == NULL) { -- cgit