Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Skylark » Skylark : GetIdentity alternative way of working
Re: Skylark : GetIdentity alternative way of working [message #57565 is a reply to message #57564] Sun, 26 September 2021 01:16 Go to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Klugier, I will create a pull request.

Quote:
What if there will be more than one identity (is this reasonable scenario)? Could we call several post_identity in one witz file?


we can call as many post_identity we want in witz file:

	<form action=$Auth2 onSubmit="return prepareData()" method="post" accept-charset="utf-8" enctype="multipart/form-data">
		<div class="row">
			$post_identity()
			$post_identity()
			$post_identity()
			<div class="col-md-1 col-md-offset-3">
				<div class="RightText">Login:</div>

https://i.imgur.com/XaShdHw.png
having it multiple time in witz don't affect the way __identity__ work. Same goes for __js_identity__.

Quote:
Backwards compatibility - does it break something?


Here is the old code :
String GetIdentity(const Renderer *r)
{
	// This ugly hack expects that __identity__ is always present in r->var
	Http *http = const_cast<Http *>(dynamic_cast<const Http *>(r));
	if(!http)
		throw Exc("invalid POST identity call");
	String s = http->var[0];
	if(s.GetCount())
		return s;
	s = AsString(Uuid::Create());
	http->SessionSet0("__identity__", s);
	http->var[0] = s;
	return s;
}

it expect to have __identity__ at index 0. It's not always true (expectially when we use external libs to send data via Javascript).
the new code do the same think but lookup for it. I don't think regression could occure

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: stable
Next Topic: Proposition: Adding a way to send huge file via stream in skylark
Goto Forum:
  


Current Time: Fri May 09 14:23:15 CEST 2025

Total time taken to generate the page: 0.00919 seconds