Example #1
0
def setUserDetails(username, name=None, password=None, aliases=None):
    debugOutput("Setting details for %s name %s password %s" %
                (username, name, password))

    system.updateUser(username, name=name, password=password)
    if password and username in samba.getUsers():
        samba.setPassword(username, password)
Example #2
0
def deleteUser(username):

    # For sanity's sake!
    if username.lower() in ["root", "administrator"]:
        return

    if username in samba.getUsers():
        samba.deleteUser(username)
    system.deleteUser(username)
Example #3
0
def deleteUser(username):

    # For sanity's sake!
    if username.lower() in ["root", "administrator"]:
        return

    if username in samba.getUsers():
        samba.deleteUser(username)
    system.deleteUser(username)
Example #4
0
	def onMessage(self, payload, isBinary):
		
		if payload == "list-users":
			# echo back message verbatim
			# self.sendMessage(payload, isBinary)
			
			# print samba users
			samba = MySambaClass()
			users = samba.getUsers()
			
			self.sendMessage(json.dumps(users))
			
		else:
			print("Did not understand command")
Example #5
0
def getUsers():

    sambaUsers = samba.getUsers()
    systemUsers = system.getUserDetails()

    users = {}

    for username in sambaUsers:

        if username in ["root"]:
            continue

        users[username] = systemUsers[username]

    return users
Example #6
0
def getUsers():

    sambaUsers = samba.getUsers()
    systemUsers = system.getUserDetails()

    users = {}

    for username in sambaUsers:

        if username in ["root"]:
            continue

        users[username] = systemUsers[username]

    return users
Example #7
0
def setUserDetails(username, name=None, password=None, aliases=None):
    debugOutput("Setting details for %s name %s password %s" % (username, name, password))

    system.updateUser(username, name=name, password=password)
    if password and username in samba.getUsers():
        samba.setPassword(username, password)