comparison MoinMoin/userprefs/prefs.py @ 2369:ccf996479233

fix a suid bug: force switched-to user valid
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 12 Jul 2007 11:41:35 +0200
parents 5fc0717a060f
children 06fabac5a1c7
comparison
equal deleted inserted replaced
2368:5fc0717a060f 2369:ccf996479233
201 available = events.get_subscribable_events() 201 available = events.get_subscribable_events()
202 theuser.subscribed_events = [ev for ev in form.get('events', [])] 202 theuser.subscribed_events = [ev for ev in form.get('events', [])]
203 203
204 # save data 204 # save data
205 theuser.save() 205 theuser.save()
206 if theuser.disabled:
207 # set valid to false so the current request won't
208 # show the user as logged-in any more
209 theuser.valid = False
206 self.request.user = theuser 210 self.request.user = theuser
207 211
208 result = _("User preferences saved!") 212 result = _("User preferences saved!")
209 if _debug: 213 if _debug:
210 result = result + util.dumpFormData(form) 214 result = result + util.dumpFormData(form)