Show
Ignore:
Timestamp:
02/17/06 23:51:17 (18 years ago)
Author:
jerome
Message:

pkusers now mostly works. Removing an user from a group with
LDAP is not yet done though. Also no test was done with
LDAP yet.
filldb now really creates users (it uses pkusers instead
of edpykota)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2697 r2706  
    982982                group.Members.append(user) 
    983983                 
     984    def delUserFromGroup(self, user, group) :     
     985        """Removes an user from a group.""" 
     986        raise "Not Implemented !" # TODO !!! 
     987                 
    984988    def addUserPQuota(self, user, printer) : 
    985989        """Initializes a user print quota on a printer.""" 
     
    10321036        self.doModify(printer.ident, fields) 
    10331037         
    1034     def writeUserOverCharge(self, user, factor) : 
    1035         """Sets the user's overcharging coefficient.""" 
    1036         fields = { 
    1037                    "pykotaOverCharge" : str(factor), 
    1038                  } 
    1039         self.doModify(user.ident, fields) 
    1040          
    1041     def writeUserLimitBy(self, user, limitby) :     
    1042         """Sets the user's limiting factor.""" 
    1043         fields = { 
    1044                    "pykotaLimitBy" : limitby, 
    1045                  } 
    1046         self.doModify(user.ident, fields)          
    1047          
    1048     def writeGroupLimitBy(self, group, limitby) :     
    1049         """Sets the group's limiting factor.""" 
    1050         fields = { 
    1051                    "pykotaLimitBy" : limitby, 
    1052                  } 
    1053         self.doModify(group.ident, fields)          
     1038    def saveUser(self, user) : 
     1039        """Saves the user to the database in a single operation.""" 
     1040        newfields = { 
     1041                       "pykotaLimitBy" : (user.LimitBy or "quota"), 
     1042                       "pykotaOverCharge" : str(user.OverCharge), 
     1043                    }    
     1044        if user.Email : 
     1045            newfields.update({self.info["usermail"]: user.Email}) 
     1046        if user.Description is not None :  
     1047            newfields.update({"description": self.userCharsetToDatabase(user.Description)}) 
     1048        self.doModify(user.ident, newfields) 
     1049         
     1050    def saveGroup(self, group) : 
     1051        """Saves the group to the database in a single operation.""" 
     1052        newfields = { 
     1053                       "pykotaLimitBy" : (group.LimitBy or "quota"), 
     1054                    }    
     1055        if group.Description is not None :  
     1056            newfields.update({"description": self.userCharsetToDatabase(group.Description)}) 
     1057        self.doModify(group.ident, newfields) 
    10541058         
    10551059    def writeUserPQuotaDateLimit(self, userpquota, datelimit) :