* Fix blank password authentication bug.

* More additions group editing.
This commit is contained in:
Ricky Zhou 2007-08-09 17:08:39 -04:00
parent 89fe26b8a2
commit 680a42e57e
5 changed files with 16 additions and 15 deletions

Binary file not shown.

Binary file not shown.

View file

@ -72,7 +72,7 @@ class editGroup(widgets.WidgetsList):
fedoraGroupUserCanRemove = widgets.CheckBox(label='Self Removal') fedoraGroupUserCanRemove = widgets.CheckBox(label='Self Removal')
fedoraGroupJoinMsg = widgets.TextField(label='Group Join Message') fedoraGroupJoinMsg = widgets.TextField(label='Group Join Message')
editGroupForm = widgets.ListForm(fields=editPerson(), submit_text='Update') editGroupForm = widgets.ListForm(fields=editGroup(), submit_text='Update')
class findUser(widgets.WidgetsList): class findUser(widgets.WidgetsList):
userName = widgets.AutoCompleteField(label='Username', search_controller='search', search_param='userName', result_name='people') userName = widgets.AutoCompleteField(label='Username', search_controller='search', search_param='userName', result_name='people')
@ -228,7 +228,6 @@ class Root(controllers.RootController):
@expose(template="fas.templates.editGroup") @expose(template="fas.templates.editGroup")
@identity.require(identity.not_anonymous()) @identity.require(identity.not_anonymous())
def editGroup(self, groupName, action=None): def editGroup(self, groupName, action=None):
pass
userName = turbogears.identity.current.user_name userName = turbogears.identity.current.user_name
try: try:
Groups.byUserName(userName)['accounts'].cn Groups.byUserName(userName)['accounts'].cn
@ -241,14 +240,14 @@ class Root(controllers.RootController):
turbogears.flash('You cannot edit %s' % groupName) turbogears.flash('You cannot edit %s' % groupName)
turbogears.redirect('viewGroup?groupName=%s' % groupName) turbogears.redirect('viewGroup?groupName=%s' % groupName)
group = Groups.groups(groupName)[groupName] group = Groups.groups(groupName)[groupName]
#value = {'givenName' : user.givenName, value = {'groupName' : groupName,
# 'mail' : user.mail, 'fedoraGroupOwner' : group.fedoraGroupOwner,
# 'fedoraPersonBugzillaMail' : user.fedoraPersonBugzillaMail, 'fedoraGroupType' : group.fedoraGroupType,
# 'fedoraPersonIrcNick' : user.fedoraPersonIrcNick, 'fedoraGroupNeedsSponsor' : (group.fedoraGroupNeedsSponsor.upper() == 'TRUE'),
# 'fedoraPersonKeyId' : user.fedoraPersonKeyId, 'fedoraGroupUserCanRemove' : (group.fedoraGroupUserCanRemove.upper() == 'TRUE'),
# 'telephoneNumber' : user.telephoneNumber, 'fedoraGroupJoinMsg' : group.fedoraGroupJoinMsg,
# 'postalAddress' : user.postalAddress, 'fedoraGroupDesc' : group.fedoraGroupDesc, }
# 'description' : user.description, } #'fedoraGroupRequires' : group.fedoraGroupRequires, }
return dict(form=editGroupForm, value=value) return dict(form=editGroupForm, value=value)
@expose(template="fas.templates.groupList") @expose(template="fas.templates.groupList")
@ -357,15 +356,15 @@ class Root(controllers.RootController):
sponsor = turbogears.identity.current.user_name sponsor = turbogears.identity.current.user_name
try: try:
group = Groups.groups(groupName)[groupName] group = Groups.groups(groupName)[groupName]
except KeyError, e: except KeyError:
turbogears.flash('Group Error: %s does not exist - %s' % (groupName, e)) turbogears.flash('Group Error: %s does not exist.' % groupName)
turbogears.redirect('viewGroup?groupName=%s' % group.cn) turbogears.redirect('viewGroup?groupName=%s' % group.cn)
try: try:
p = Person.byUserName(userName) p = Person.byUserName(userName)
if not p.cn: if not p.cn:
raise KeyError, 'User %s, just not there' % userName raise KeyError, userName
except KeyError, e: except KeyError:
turbogears.flash('User Error: %s does not exist - %s' % (userName, e)) turbogears.flash('User Error: User %s does not exist.' % userName)
turbogears.redirect('viewGroup?groupName=%s' % group.cn) turbogears.redirect('viewGroup?groupName=%s' % group.cn)
g = Groups.byGroupName(groupName, includeUnapproved=True) g = Groups.byGroupName(groupName, includeUnapproved=True)

View file

@ -355,6 +355,8 @@ class Person:
@classmethod @classmethod
def auth(self, who, password, ldapServer=None): def auth(self, who, password, ldapServer=None):
''' Basic Authentication Module ''' ''' Basic Authentication Module '''
if not password:
raise AuthError
if not ldapServer: if not ldapServer:
s = Server() s = Server()
ldapServer = s.ldapConn ldapServer = s.ldapConn

Binary file not shown.