コード例 #1
0
ファイル: views.py プロジェクト: AndrewIsaac/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 = 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
ファイル: views.py プロジェクト: AndrewIsaac/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])
コード例 #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
ファイル: views.py プロジェクト: AndrewIsaac/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)))
コード例 #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
ファイル: views.py プロジェクト: AndrewIsaac/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))