Esthetic fixes
This commit is contained in:
parent
d78359ca69
commit
e3e9e79965
1 changed files with 11 additions and 2 deletions
13
ldap2smb.py
13
ldap2smb.py
|
@ -18,7 +18,6 @@ creds.set_password('Jps55Sk8An9y2nVL')
|
|||
samdb = SamDB(url='/var/lib/samba/private/sam.ldb', session_info=system_session(),credentials=creds, lp=lp)
|
||||
|
||||
data_file="user.json"
|
||||
attributes_list = []
|
||||
|
||||
with open(data_file, "r") as file:
|
||||
ldap_users = json.load(file)
|
||||
|
@ -36,7 +35,17 @@ with open(data_file, "r") as file:
|
|||
smb_uid_number = ldap_users["params"]["attributes"]["uidNumber"]
|
||||
smb_gid_number = ldap_users["params"]["attributes"]["gidNumber"]
|
||||
|
||||
samdb.newuser(username=smb_username,password=smb_passwd,givenname=smb_givenname,surname=smb_surname,homedirectory=smb_homedir,mailaddress=smb_mail,uidnumber=smb_uid_number,gidnumber=smb_gid_number,useusernameascn=True)
|
||||
samdb.newuser(
|
||||
username=smb_username,
|
||||
password=smb_passwd,
|
||||
givenname=smb_givenname,
|
||||
surname=smb_surname,
|
||||
homedirectory=smb_homedir,
|
||||
mailaddress=smb_mail,
|
||||
uidnumber=smb_uid_number,
|
||||
gidnumber=smb_gid_number,
|
||||
useusernameascn=True
|
||||
)
|
||||
|
||||
query = "(objectclass=user)"
|
||||
result = samdb.search('DC=nantes,DC=omero-fbi,DC=fr', expression=query, scope=ldb.SCOPE_SUBTREE)
|
||||
|
|
Loading…
Reference in a new issue