r12749: Fix the newuser script.
authorAndrew Bartlett <abartlet@samba.org>
Fri, 6 Jan 2006 21:45:36 +0000 (21:45 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:49:49 +0000 (13:49 -0500)
Andrew Bartlett
(This used to be commit 42cdad5e3f06c307baf80396fd8449b803ef84c3)

source4/scripting/libjs/provision.js
source4/setup/newuser

index 17382cc01474d9c2dfedb2381eec9675793ca1d4..e71ea83523681415dcd4dd1628e452b8e9dba20c 100644 (file)
@@ -406,7 +406,7 @@ userAccountControl: %u
 /*
   add a new user record
 */
-function newuser(username, unixname, password, message, subobj, session_info, credentials)
+function newuser(username, unixname, password, message, session_info, credentials)
 {
        var lp = loadparm_init();
        var samdb = lp.get("sam database");
@@ -437,15 +437,13 @@ function newuser(username, unixname, password, message, subobj, session_info, cr
        var ldif = sprintf("
 dn: %s
 sAMAccountName: %s
-name: %s
 memberOf: %s
 unixName: %s
-objectGUID: %s
-unicodePwd: %s
+sambaPassword: %s
 objectClass: user
 ",
-                          user_dn, username, username, dom_users,
-                          unixname, randguid(), password);
+                          user_dn, username, dom_users,
+                          unixname, password);
        /*
          add the user to the users group as well
        */
index c114338d272cf4b75e6ea4f24ac38fffe4c8eab9..4d2acf537329103dada5e7cb6a1f68441f5d0dc8 100755 (executable)
@@ -10,6 +10,7 @@ options = GetOptions(ARGV,
                "POPT_AUTOHELP",
                "POPT_COMMON_SAMBA",
                "POPT_COMMON_VERSION",
+               "POPT_COMMON_CREDENTIALS",
                'username=s',
                'unixname=s',
                'password=s',
@@ -70,6 +71,10 @@ if (nss.getpwnam(options.unixname) == undefined) {
        exit(1);
 }
 
-newuser(options.username, options.unixname, options.password, message);
+var creds = options.get_credentials();
+var system_session = system_session();
+
+
+newuser(options.username, options.unixname, options.password, message, system_session, creds);
 
 return 0;