Esempio n. 1
0
	def getPlotColourGlobe(self,dS):
		#chose the users prefered value, else the plots default value, else the default
		cSetSec = self.request.cookies.get('cSet','0')
		if check_secure_val(cSetSec): cSet = cSetSec.split('|')[0]	
		else: cSet = '0'
		if cSet=='0':
			if dS: cSet=dS.CSET
			else: cSet='d3set20'
		return cSet
Esempio n. 2
0
	def getPlotColour(self,dS=None):
		if dS: cSet=dS.CSET	#get the plot colour
		else:	#if its not in the db check cookies
			cSetSec = self.request.cookies.get('cSet','0')
			if check_secure_val(cSetSec): cSet = cSetSec.split('|')[0]	
			else: cSet = '0'
			if cSet=='0':	#if its not in the cookies, set default
				cSet = 'd3set20'
		return cSet
Esempio n. 3
0
	def checkCookies(self):
		UNH = self.request.cookies.get('UNH','0')
		UNA = self.request.cookies.get('UNA','0')
		
		if check_secure_val(UNH):
			id = UNH.split('|')[0]
			q = UNPW.get_by_id(int(id))
			UN = q.UN
			loggedIn = True
		else:
			loggedIn = False
			UN = '0'
			
		admin = False
		if check_secure_val(UNA): admin = True	
		else: admin = False
		
		return loggedIn,admin,UN
Esempio n. 4
0
	def getUserColour(self,UN='0'):
		cSetMainSec = self.request.cookies.get('cSetMain','0')
		if check_secure_val(cSetMainSec): cSetMain = cSetMainSec.split('|')[0]	
		else: cSetMain = '0'
		
		if cSetMain=='0' and UN != '0':
			dBUN = db.GqlQuery("SELECT * FROM UNPW WHERE UN=:USER",USER=UN).get()
			if dBUN:
				cSetMain = dBUN.CSET
			else:
				cSetMain = 'd3set20'
		elif cSetMain=='0':
			cSetMain = 'd3set20'
		return cSetMain