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))
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))
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])
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))
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)))
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))