'Auth Menu'

@classmethod
def menu_auth(cls, **attr):

    auth = current.auth
    if (not auth.is_logged_in()):
        request = current.request
        login_next = URL(args=request.args, vars=request.get_vars)
        if ((request.controller == 'default') and (request.function == 'user') and ('_next' in request.get_vars)):
            login_next = request.get_vars['_next']
        menu_auth = MM('Log    in', c='default', f='user', m='login', _id='auth_menu_login', vars=dict(_next=login_next), **attr)
    else:
        user = auth.user
        greeting = ('Welcome,    %s!' % user.first_name)
        if user.org_group_id:
            menu_auth = MM(greeting, c='org', f='group', args=[user.org_group_id, 'dashboard'], translate=False, _id='auth_menu_email', **attr)
        else:
            menu_auth = MM(greeting, link=False, translate=False, _id='auth_menu_email', **attr)
        menu_auth(MM('Your    Maps', c='gis', f='config', args='datalist', vars={'~.pe_id__belongs': user.pe_id}), MM('Admin    Users', c='admin', f='user'), MM('Edit    Profile', c='default', f='user', m='profile'), MM('Change    Password', c='default', f='user', m='change_password'), MM('Logout', c='default', f='user', m='logout', _id='auth_menu_logout'))
    return menu_auth
