diff --git a/VERSION b/VERSION index 067df8fc..d0452171 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.5.1-stable+timestamp.2013.06.13.23.41.35 +Version 2.5.1-stable+timestamp.2013.06.14.16.08.49 diff --git a/applications/admin/controllers/appadmin.py b/applications/admin/controllers/appadmin.py index 101e231b..0a1df73f 100644 --- a/applications/admin/controllers/appadmin.py +++ b/applications/admin/controllers/appadmin.py @@ -38,14 +38,13 @@ elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1"): if request.function == 'manage': if not 'auth' in globals() or not request.args: redirect(URL(request.controller, 'index')) - if request.args(0) == 'auth': + manager_action = auth.settings.manager_actions.get(request.args(0), None) + if manager_action is None and request.args(0) == 'auth': manager_action = dict(role=auth.settings.auth_manager_role, heading=T('Manage Access Control'), tables=[auth.settings.table_user, auth.settings.table_group, auth.settings.table_permission]) - else: - manager_action = auth.settings.manager_actions.get(request.args(0), None) manager_role = manager_action.get('role', None) if manager_action else None auth.requires_membership(manager_role)(lambda: None)() menu = False @@ -596,24 +595,26 @@ def manage(): db = manager_action.get('db', auth.db) db = globals()[db] if isinstance(db, str) else db tables = [db[table] for table in tables] + if request.args(0) == 'auth': + auth.settings.table_user._plural = T('Users') + auth.settings.table_group._plural = T('Roles') + auth.settings.table_membership._plural = T('Memberships') + auth.settings.table_permission._plural = T('Permissions') if request.extension != 'load': return dict(heading=manager_action.get('heading', T('Manage %(action)s') % dict(action=request.args(0).replace('_', ' ').title())), - tablenames=[table._tablename for table in tables]) + tablenames=[table._tablename for table in tables], + labels=[table._plural.title() for table in tables]) + table = tables[request.args(1, cast=int)] formname = '%s_grid' % table._tablename linked_tables = orderby = None - if request.args(0) == 'auth': auth.settings.table_group._id.readable = \ auth.settings.table_membership._id.readable = \ auth.settings.table_permission._id.readable = False - auth.settings.table_user._plural = T('Users') - auth.settings.table_group._plural = T('Roles') - auth.settings.table_membership._plural = T('Memberships') auth.settings.table_membership.user_id.label = T('User') auth.settings.table_membership.group_id.label = T('Role') - auth.settings.table_permission._plural = T('Permissions') auth.settings.table_permission.group_id.label = T('Role') auth.settings.table_permission.name.label = T('Permission') if table == auth.settings.table_user: @@ -622,7 +623,6 @@ def manage(): orderby = 'role' if not request.args(3) or '.group_id' not in request.args(3) else None elif table == auth.settings.table_permission: orderby = 'group_id' - grid = SQLFORM.smartgrid(table, args=request.args[:2], user_signature=True, orderby=orderby, linked_tables=linked_tables, maxtextlength=1000, formname=formname) diff --git a/applications/admin/views/appadmin.html b/applications/admin/views/appadmin.html index 5de90dc8..617daeeb 100644 --- a/applications/admin/views/appadmin.html +++ b/applications/admin/views/appadmin.html @@ -249,7 +249,6 @@ {{pass}} {{if request.function == 'manage':}} -{{labels = ['Users', 'Roles', 'Permissions'] if request.args(0) == 'auth' else [name.replace('_', ' ').title() for name in tablenames]}}

{{=heading}}