Logo Search packages:      
Sourcecode: kde-guidance version File versions  Download package

def unixauthdb::Context::newUser (   self,
  defaults = False,
  systemuser = False 
)

Create a new UnixUser object.

Creates a new blank UnixUser object. The object is not part of the
current Context. You need to add it yourself using addUser().

Newly allocated UIDs are unique with respect to the list of UnixUser
objects in the Context. 

Keyword arguments:
defaults -- Set to true if the new object should be filled in with
    reasonable default values for the UID and username.
    (default False)
systemuser -- Should the new user be allocated a UID from the system
      range of UIDs. (default is False)

Returns a new UnixUser object.

Definition at line 83 of file unixauthdb.py.

00083                                                      :
        """Create a new UnixUser object.

        Creates a new blank UnixUser object. The object is not part of the
        current Context. You need to add it yourself using addUser().

        Newly allocated UIDs are unique with respect to the list of UnixUser
        objects in the Context. 

        Keyword arguments:
        defaults -- Set to true if the new object should be filled in with
                    reasonable default values for the UID and username.
                    (default False)
        systemuser -- Should the new user be allocated a UID from the system
                      range of UIDs. (default is False)

        Returns a new UnixUser object.
        """
        newuserobj = self._createUser()
        if defaults:
            if systemuser:
                r = xrange(0,self.last_system_uid)
            else:
                r = xrange(self.first_uid,self.last_uid)
            for candiate in r:
                for u in self._users:
                    if u.getUID()==candiate:
                        break
                else:
                    newuserobj.setUID(candiate)
                    break

            if self.lookupUsername(u'new_user') is None:
                newuserobj.setUsername(u'new_user')
            else:
                i = 1
                while 1:
                    if self.lookupUsername(u'new_user_'+str(i)) is None:
                        newuserobj.setUsername(u'new_user_'+str(i))
                        break
                    i += 1
        return newuserobj

    def getUsers(self):


Generated by  Doxygen 1.6.0   Back to index