better MULTI_USER_MODE
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.7 (2012-03-26 16:07:16) dev
|
Version 1.99.7 (2012-03-26 16:15:22) dev
|
||||||
|
|||||||
@@ -1360,14 +1360,16 @@ def reload_routes():
|
|||||||
|
|
||||||
def manage_students():
|
def manage_students():
|
||||||
if not (MULTI_USER_MODE and is_manager()):
|
if not (MULTI_USER_MODE and is_manager()):
|
||||||
raise HTTP(401)
|
session.flash = 'Not Authorized'
|
||||||
|
redirect(URL('site'))
|
||||||
db.auth_user.registration_key.writable = True
|
db.auth_user.registration_key.writable = True
|
||||||
grid = SQLFORM.grid(db.auth_user)
|
grid = SQLFORM.grid(db.auth_user)
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def bulk_register():
|
def bulk_register():
|
||||||
if not (MULTI_USER_MODE and is_manager()):
|
if not (MULTI_USER_MODE and is_manager()):
|
||||||
raise HTTP(401)
|
session.flash = 'Not Authorized'
|
||||||
|
redirect(URL('site'))
|
||||||
form = SQLFORM.factory(Field('emails','text'))
|
form = SQLFORM.factory(Field('emails','text'))
|
||||||
if form.process().accepted:
|
if form.process().accepted:
|
||||||
emails = [x.strip() for x in form.vars.emails.split('\n') if x.strip()]
|
emails = [x.strip() for x in form.vars.emails.split('\n') if x.strip()]
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ except:
|
|||||||
session.flash='sorry, only on Unix systems'
|
session.flash='sorry, only on Unix systems'
|
||||||
redirect(URL(request.application,'default','site'))
|
redirect(URL(request.application,'default','site'))
|
||||||
|
|
||||||
|
if MULTI_USER_MODE and not is_manager():
|
||||||
|
session.flash = 'Not Authorized'
|
||||||
|
redirect(URL('default','site'))
|
||||||
|
|
||||||
forever=10**8
|
forever=10**8
|
||||||
|
|
||||||
def kill():
|
def kill():
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if request.args:
|
|||||||
URL(_a,'mercurial','commit',args=_t)))
|
URL(_a,'mercurial','commit',args=_t)))
|
||||||
|
|
||||||
if not session.authorized:
|
if not session.authorized:
|
||||||
response.menu = [(T('Login'), True, '')]
|
response.menu = [(T('Login'), True, URL('site'))]
|
||||||
else:
|
else:
|
||||||
response.menu.append((T('Logout'), False,
|
response.menu.append((T('Logout'), False,
|
||||||
URL(_a,'default',f='logout')))
|
URL(_a,'default',f='logout')))
|
||||||
|
|||||||
Reference in New Issue
Block a user