def create(self):
     # Add the new tag to the database
     tag = model.Tag()
     for k, v in self.form_result.items():
         setattr(tag, k, v)
     meta.Session.add(tag)
     meta.Session.commit()
     # Issue an HTTP redirect
     response.status_int = 302
     response.headers["location"] = h.url(controller="tag", action="view", id=tag.id)
     return "Moved temporarily"
Example #2
0
	def create_passcode(self):
		#Add the new pag to the database
		passcodes = model.Passcodes()
		for k, v in self.form_result.items():
			setattr(passcodes, k, v)
		meta.Session.add(passcodes)
		meta.Session.commit()
		# issue HTTP redirect
		response.status_int = 302
		response.headers['location'] = h.url(controller='page',
			action='home')
		return "Moved temporarily"
Example #3
0
	def create(self):
		#Add the new pag to the database
		whitelist = model.Whitelist1()
		for k, v in self.form_result.items():
			setattr(whitelist, k, v)
		whitelist.count = 0
		meta.Session.add(whitelist)
		meta.Session.commit()
		# issue HTTP redirect
		response.status_int = 302
		response.headers['location'] = h.url(controller='page',
			action='view', id=whitelist.id)
		return "Moved temporarily"
Example #4
0
	def delete_passcode(self, id=None):
		if id is None:
			abort(404)
		passcode = meta.Session.query(model.Passcodes)
		psscd = passcode.filter_by(id=id).first()
		if psscd is None:
			abort(404)
		meta.Session.delete(psscd)
		meta.Session.commit()
		# issue HTTP redirect
		response.status_int = 302
		response.headers['location'] = h.url(controller='page',
			action='home')
		return "Moved temporarily"
Example #5
0
	def save(self, id=None):
		page_q = meta.Session.query(model.Whitelist1)
		whitelist = page_q.filter_by(id=id).first()
		if whitelist is None:
			abort(404)
		for k,v in self.form_result.items():
			if getattr(whitelist, k) != v:
				setattr(whitelist, k, v)
		meta.Session.commit()
		# issue HTTP redirect
		response.status_int = 302
		response.headers['location'] = h.url(controller='page',
			action='view', id=whitelist.id)
		return "Moved temporarily"
 def delete_user(username):
     users = request.environ['authkit.users']
     users.user_delete(request.params['username'])
     redirect(url(h.url(controller='account', action='manage_accounts')))
 def signinagain(self):
     request.environ['paste.auth_tkt.logout_user']()
     return render('/derived/account/signin.html').replace('%s', h.url('signin'))