summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael McGrath <mmcgrath@desktop.mmcgrath.net>2008-03-13 21:06:46 (GMT)
committerMichael McGrath <mmcgrath@desktop.mmcgrath.net>2008-03-13 21:06:46 (GMT)
commitb773e22cf478e9741f45d712ec990b16c9265fa6 (patch)
tree5dba7c110d1cb88642386272f73ef001508a3fd5
parent3a652919d9ea780c6304c548554fb33bad96c98c (diff)
parenta419f95a7d4edf35afd399042b4d746f52bf88fd (diff)
downloadfedora-infrastructure-b773e22cf478e9741f45d712ec990b16c9265fa6.zip
fedora-infrastructure-b773e22cf478e9741f45d712ec990b16c9265fa6.tar.gz
fedora-infrastructure-b773e22cf478e9741f45d712ec990b16c9265fa6.tar.xz
Merge branch 'master' of ssh://git.fedorahosted.org/git/fedora-infrastructure0.7.1
-rw-r--r--fas/fas/static/images/favicon.icobin1081 -> 3638 bytes
-rw-r--r--fas/fas/user.py29
2 files changed, 23 insertions, 6 deletions
diff --git a/fas/fas/static/images/favicon.ico b/fas/fas/static/images/favicon.ico
index 332557b..79d0ba9 100644
--- a/fas/fas/static/images/favicon.ico
+++ b/fas/fas/static/images/favicon.ico
Binary files differ
diff --git a/fas/fas/user.py b/fas/fas/user.py
index 33e2ac6..1e6e903 100644
--- a/fas/fas/user.py
+++ b/fas/fas/user.py
@@ -294,6 +294,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
# TODO: This took about 55 seconds for me to load - might want to limit it to the right accounts (systems user, accounts group)
@identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
@expose(template="fas.templates.user.list", allow_json=True)
def list(self, search="a*"):
'''List users
@@ -317,6 +318,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
return dict(people=people, search=search)
@identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
@expose(format='json')
def email_list(self, search='*'):
re_search = re.sub(r'\*', r'%', search).lower()
@@ -327,6 +329,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
return dict(emails=emails)
@identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
@expose(template='fas.templates.user.verifyemail')
def verifyemail(self, token, cancel=False):
username = turbogears.identity.current.user_name
@@ -347,6 +350,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
return dict(person=person, token=token)
@identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
@expose()
def setemail(self, token):
username = turbogears.identity.current.user_name
@@ -369,6 +373,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
turbogears.redirect('/user/view/%s' % username)
return dict()
+ @error_handler(error)
@expose(template='fas.templates.user.new')
def new(self):
if turbogears.identity.not_anonymous():
@@ -435,14 +440,17 @@ forward to working with you!
''') % newpass['pass']
turbomail.enqueue(message)
person.password = newpass['hash']
- turbogears.flash(_('Your password has been emailed to you. Please log in with it and change your password'))
- turbogears.redirect('/user/changepass')
except IntegrityError:
turbogears.flash(_("An account has already been registered with that email address."))
turbogears.redirect('/user/new')
- return dict()
+ return dict()
+ else:
+ turbogears.flash(_('Your password has been emailed to you. Please log in with it and change your password'))
+ turbogears.redirect('/user/changepass')
+ return dict()
@identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
@expose(template="fas.templates.user.changepass")
def changepass(self):
return dict()
@@ -468,13 +476,17 @@ forward to working with you!
try:
person.password = newpass['hash']
Log(author_id=person.id, description='Password changed')
- turbogears.flash(_("Your password has been changed."))
- turbogears.redirect('/user/view/%s' % turbogears.identity.current.user_name)
+ # TODO: Make this catch something specific.
except:
Log(author_id=person.id, description='Password change failed!')
turbogears.flash(_("Your password could not be changed."))
- return dict()
+ return dict()
+ else:
+ turbogears.flash(_("Your password has been changed."))
+ turbogears.redirect('/user/view/%s' % turbogears.identity.current.user_name)
+ return dict()
+ @error_handler(error)
@expose(template="fas.templates.user.resetpass")
def resetpass(self):
if turbogears.identity.not_anonymous():
@@ -483,6 +495,7 @@ forward to working with you!
return dict()
#TODO: Validate
+ @error_handler(error)
@expose(template="fas.templates.user.resetpass")
def sendtoken(self, username, email, encrypted=False):
import turbomail
@@ -549,6 +562,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
turbogears.redirect('/login')
return dict()
+ @error_handler(error)
@expose(template="fas.templates.user.newpass")
# TODO: Validator
def newpass(self, username, token, password=None, passwordcheck=None):
@@ -564,6 +578,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
return dict()
return dict(person=person, token=token)
+ @error_handler(error)
@expose(template="fas.templates.user.verifypass")
# TODO: Validator
def verifypass(self, username, token, cancel=False):
@@ -583,6 +598,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
return dict()
return dict(person=person, token=token)
+ @error_handler(error)
@expose()
@validate(validators=UserResetPassword())
def setnewpass(self, username, token, password, passwordcheck):
@@ -607,6 +623,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
return dict()
@identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
@expose(template="genshi-text:fas.templates.user.cert", format="text", content_type='text/plain; charset=utf-8')
def gencert(self):
username = turbogears.identity.current.user_name