예제 #1
0
def serveIndex(request, force_mcf=None):
    currentuser = getCurrentUser(request)
    mcf = 'dashboard'
    params = ''
    if currentuser.is_authenticated():
        #only clear if we were logged in.
        urlstate = getCurrentURLState(request, andClear=True)
    else:
        urlstate = getCurrentURLState(request)

    if force_mcf:
        mcf = force_mcf
    elif urlstate.redirectMainContentFunction:
        mcf = urlstate.redirectMainContentFunction
    if urlstate.params:
        params = urlstate.params

    if params:
        sendparams = params[1]
    else:
        sendparams = ''

    jsonparams = simplejson.dumps(sendparams)

    return render_to_response('index.html', {
                        'APP_SECURE_URL': siteurl(request),
                        'user': request.user,
                        'mainContentFunction': mcf,
                        'wh': webhelpers,
                        'params': jsonparams,
                        }, context_instance=RequestContext(request))
예제 #2
0
파일: views.py 프로젝트: eschen42/mastr-ms
def serveIndex(request, force_mcf=None):
    currentuser = getCurrentUser(request)
    mcf = 'dashboard'
    params = ''
    if currentuser.is_authenticated():
        #only clear if we were logged in.
        urlstate = getCurrentURLState(request, andClear=True)
    else:
        urlstate = getCurrentURLState(request)

    if force_mcf:
        mcf = force_mcf
    elif urlstate.redirectMainContentFunction:
        mcf = urlstate.redirectMainContentFunction
    if urlstate.params:
        params = urlstate.params

    if params:
        sendparams = params[1]
    else:
        sendparams = ''

    jsonparams = json.dumps(sendparams)

    return render_to_response('index.html', {
        'APP_SECURE_URL': siteurl(request),
        'user': request.user,
        'mainContentFunction': mcf,
        'wh': webhelpers,
        'params': jsonparams,
    },
                              context_instance=RequestContext(request))
예제 #3
0
def populateResetPasswordForm(request, *args):
    u = request.user
    data = {}
    urlstate = getCurrentURLState(request, andClear=True)
    data['email'] = urlstate.resetPasswordEmail
    data['validationKey'] = urlstate.resetPasswordValidationKey
    return jsonResponse(items=[data])
예제 #4
0
파일: views.py 프로젝트: eschen42/mastr-ms
def populateResetPasswordForm(request, *args):
    u = request.user
    data = {}
    urlstate = getCurrentURLState(request, andClear=True)
    data['email'] = urlstate.resetPasswordEmail
    data['validationKey'] = urlstate.resetPasswordValidationKey
    return jsonResponse(items=[data])
예제 #5
0
파일: views.py 프로젝트: eschen42/mastr-ms
def viewFormalRedirect(request, *args):
    urlstate = getCurrentURLState(request)
    urlstate.redirectMainContentFunction = 'quote:viewformal'
    urlstate.params = [
        'quote:viewformal', {
            'qid': int(request.REQUEST.get('quoterequestid', 0))
        }
    ]
    return HttpResponseRedirect(siteurl(request))
예제 #6
0
def forgotPasswordRedirect(request, *args):
    u = request.user
    try:
        urlstate = getCurrentURLState(request)
        urlstate.redirectMainContentFunction = 'login:resetpassword'
        urlstate.resetPasswordEmail = request.REQUEST['em']
        urlstate.resetPasswordValidationKey = request.REQUEST['vk']
        return HttpResponseRedirect(siteurl(request))
    except Exception, e:
        logger.warning('Exception in forgot password redirect: %s' % (str(e)))
예제 #7
0
파일: views.py 프로젝트: eschen42/mastr-ms
def forgotPasswordRedirect(request, *args):
    u = request.user
    try:
        urlstate = getCurrentURLState(request)
        urlstate.redirectMainContentFunction = 'login:resetpassword'
        urlstate.resetPasswordEmail = request.REQUEST['em']
        urlstate.resetPasswordValidationKey = request.REQUEST['vk']
        return HttpResponseRedirect(siteurl(request))
    except Exception, e:
        logger.warning('Exception in forgot password redirect: %s' % (str(e)))
예제 #8
0
def viewFormalRedirect(request, *args):
    urlstate = getCurrentURLState(request)
    urlstate.redirectMainContentFunction = 'quote:viewformal'
    urlstate.params = ['quote:viewformal', {'qid':int(request.REQUEST.get('quoterequestid', 0))}]
    return HttpResponseRedirect(siteurl(request))