Logo Search packages:      
Sourcecode: samba-gtk version File versions  Download package

def sambagtk::pygwsam::SAMPipeManager::add_user (   self,
  user 
)
Creates 'user' on the remote computer. This function will update user's RID.

Returns 'user' with updated RID

Definition at line 96 of file pygwsam.py.

                            :
        """Creates 'user' on the remote computer. This function will update user's RID.
        
        Returns 'user' with updated RID"""
        
        #Creates the new user on the server using default values for everything. Only the username is taken into account here.
        (user_handle, rid) = self.pipe.CreateUser(self.domain_handle, self.set_lsa_string(user.username), security.SEC_FLAG_MAXIMUM_ALLOWED)        
        new_user = self.fetch_user(rid)
        
        user.rid = rid #update the user's RID
        if user.group_list == []: #The user must be part of a group. If the user is not part of any groups, the user is actually part of the "None" group! 
            user.group_list = new_user.group_list #use the default values assigned to the user when it was created on the server, which is probably "None"
        
        self.update_user(user) #send the other user information to the server.
        user = self.fetch_user(rid, user) # just to make sure we have the updated user properties
        self.user_list.append(user)
        
        return user


Generated by  Doxygen 1.6.0   Back to index