mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add set_krbccache() calls to new controller methods.
Small fix to proxyprovider for anonymous case.
This commit is contained in:
parent
370500ab1a
commit
5cdfc5bd3b
@ -228,7 +228,7 @@ class Root(controllers.RootController):
|
||||
def userlist_ajax(self, **kw):
|
||||
"""Searches for users and displays list of results in a table.
|
||||
This method is used for ajax calls."""
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
users = []
|
||||
searchlimit = 100
|
||||
uid = kw.get('uid')
|
||||
@ -332,7 +332,7 @@ class Root(controllers.RootController):
|
||||
if (len(givenname) == 0) or (len(sn) == 0):
|
||||
return ""
|
||||
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
givenname = givenname.lower()
|
||||
sn = sn.lower()
|
||||
|
||||
@ -384,7 +384,7 @@ class Root(controllers.RootController):
|
||||
if tg_errors:
|
||||
turbogears.flash("There was a problem with the form!")
|
||||
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
|
||||
return dict(form=group_new_form)
|
||||
|
||||
@ -393,7 +393,7 @@ class Root(controllers.RootController):
|
||||
def groupcreate(self, **kw):
|
||||
"""Creates a new group"""
|
||||
restrict_post()
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
|
||||
if kw.get('submit') == 'Cancel':
|
||||
turbogears.flash("Add group cancelled")
|
||||
@ -427,7 +427,7 @@ class Root(controllers.RootController):
|
||||
if tg_errors:
|
||||
turbogears.flash("There was a problem with the form!")
|
||||
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
try:
|
||||
group = client.get_group_by_cn(cn, group_fields)
|
||||
|
||||
@ -470,7 +470,7 @@ class Root(controllers.RootController):
|
||||
def groupupdate(self, **kw):
|
||||
"""Updates an existing group"""
|
||||
restrict_post()
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
if kw.get('submit') == 'Cancel Edit':
|
||||
turbogears.flash("Edit group cancelled")
|
||||
raise turbogears.redirect('/groupshow', cn=kw.get('cn'))
|
||||
@ -573,7 +573,7 @@ class Root(controllers.RootController):
|
||||
@identity.require(identity.not_anonymous())
|
||||
def grouplist(self, **kw):
|
||||
"""Search for groups and display results"""
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
groups = None
|
||||
# counter = 0
|
||||
criteria = kw.get('criteria')
|
||||
@ -595,7 +595,7 @@ class Root(controllers.RootController):
|
||||
@identity.require(identity.not_anonymous())
|
||||
def groupshow(self, cn):
|
||||
"""Retrieve a single group for display"""
|
||||
client.set_principal(identity.current.user_name)
|
||||
client.set_krbccache(os.environ["KRB5CCNAME"])
|
||||
try:
|
||||
group = client.get_group_by_cn(cn, group_fields)
|
||||
group_dict = group.toDict()
|
||||
|
@ -19,8 +19,7 @@ class IPA_User(object):
|
||||
|
||||
class ProxyIdentity(object):
|
||||
def __init__(self, visit_key, user=None):
|
||||
if user:
|
||||
self._user= user
|
||||
self._user= user
|
||||
self.visit_key= visit_key
|
||||
|
||||
def _get_user(self):
|
||||
|
Loading…
Reference in New Issue
Block a user