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

def sambagtk::pygwsam::SAMPipeManager::fetch_user (   self,
  rid,
  user = None 
)
Fetch the User whose RID is 'rid'. A new User structure is created if the 'user' argument is left out. 

Returns a User

Definition at line 257 of file pygwsam.py.

                                          :
        """Fetch the User whose RID is 'rid'. A new User structure is created if the 'user' argument is left out. 
        
        Returns a User"""
        user_handle = self.pipe.OpenUser(self.domain_handle, security.SEC_FLAG_MAXIMUM_ALLOWED, rid)
        
        #this handles most of the information we need
        info = self.pipe.QueryUserInfo(user_handle, samr.UserAllInformation)
        user = self.info_to_user(info, user)
        
        #some settings, such as "user cannot change password", are actually part of an access list (ACL)
        secinfo = self.pipe.QuerySecurity(user_handle, security.SECINFO_DACL)
        user = self.secinfo_to_user(secinfo, user)
        
        
        group_rwa_list = self.pipe.GetGroupsForUser(user_handle).rids
        user.group_list = self.rwa_list_to_group_list(group_rwa_list)
        
        return user
    

Generated by  Doxygen 1.6.0   Back to index