Various fixes to SSO services, including transaction handling and correct DbService handling

This commit is contained in:
2010-11-29 11:59:14 +00:00
parent dc372cd3f2
commit 47eb996c63
7 changed files with 15 additions and 31 deletions

View File

@@ -53,7 +53,6 @@ class MediawikiService(BaseDBService):
email = ''
pwhash = self._gen_mw_hash(password)
self.dbcursor.execute(self.SQL_ADD_USER, [self._clean_username(username), pwhash, email, self.default_options])
transaction.set_dirty()
return { 'username': self._clean_username(username), 'password': password }
def check_user(self, username):
@@ -68,7 +67,6 @@ class MediawikiService(BaseDBService):
""" Delete a user """
self.dbcursor.execute(self.SQL_DEL_REV, [uid])
self.dbcursor.execute(self.SQL_DEL_USER, [uid])
transaction.set_dirty()
return True
def disable_user(self, uid):
@@ -79,7 +77,6 @@ class MediawikiService(BaseDBService):
except IntegrityError:
# Record already exists, skip it
pass
transaction.set_dirty()
return True
def enable_user(self, uid, password):
@@ -87,7 +84,6 @@ class MediawikiService(BaseDBService):
pwhash = self._gen_mw_hash(password)
self.dbcursor.execute(self.SQL_ENABLE_USER, [pwhash, uid])
self.dbcursor.execute(self.SQL_ENABLE_GROUP, [uid])
transaction.set_dirty()
return True
def reset_password(self, uid, password):