Example #1
0
def userpage(request, uid):
#	if request.user.username == uid:
	uid = User.objects.get(username = uid)
	user = DjangoidUser.objects.get(djangouser = uid)
	user.attributes = user.get_attributes(True)
	mid = microid(user.get_user_page(), user.get_user_page())
	res = render_to_response("users/userpage.html", {"server_url": settings.BASE_URL[:-1] + urlreverse("server.views.endpoint"), "user": user, "microid": mid})
	res["X-XRDS-Location"] = user.get_yadis_uri()
	return res
Example #2
0
def userpage(request, uid):
	if request.user.username == uid:
		uid = User.objects.get(username = uid)
		user = DjangoidUser.objects.get(djangouser = uid)
		user.attributes = user.get_attributes(True)
		mid = microid(user.get_user_page(), user.get_user_page())
		res = render_to_response("users/userpage.html", {"server_url": settings.BASE_URL[:-1] + urlreverse("server.views.endpoint"), "user": user, "microid": mid})
		res["X-XRDS-Location"] = user.get_yadis_uri()
		return res
	else: 
		#return only public data, but as a demo it still works
		return HttpResponseForbidden()
Example #3
0
def userpage_short(request, uid):
	uid = User.objects.get(username = uid)
	#Check whether this is a YADIS request
	if checkYadisRequest(request):
		return useryadis(request, uid.username)

	user = DjangoidUser.objects.get(djangouser = uid)
	user.attri\butes = user.get_attributes(True)
	mid = microid(user.get_user_page(), user.get_user_page())
	res = render_to_response("users/userpage.html", {"server_url": settings.BASE_URL[:-1] + urlreverse("server.views.endpoint"), "user": user, "microid": mid})
	res["X-XRDS-Location"] = user.get_yadis_uri()
	return res
Example #4
0
	def get_microids(self):
		return [microid(self.get_contact_uri(), self.uri), microid("mailto:" + self.user.get_djangouser().email, self.uri)]
Example #5
0
 def get_microids(self):
     return [
         microid(self.get_contact_uri(), self.uri),
         microid("mailto:" + self.user.get_djangouser().email, self.uri)
     ]