SimpleDesk

SimpleDesk! => SimpleDesk Discussion => Topic started by: feline on April 06, 2010, 06:19:56 AM

Title: Problem with AJAX requests
Post by: feline on April 06, 2010, 06:19:56 AM
On change the ticked details (Privacy, Urgency) I have always the error:
Your session timed out while posting.  Please go back and try again.
I have debug that, and see that the $_POST array is empty ... see attached image.

Fel
Title: Re: Problem with AJAX requests
Post by: Gruffen on April 06, 2010, 06:22:46 AM
Yay for SimpleSEF not including the post data when handling the redirect.

Guess we'll have to rewrite it to not use $_POST.
Title: Re: Problem with AJAX requests
Post by: feline on April 06, 2010, 06:37:50 AM
ahh .. SSEF .. Ok, that is a simple hack  8)

in SimpleSEF.php find:

define('WIRELESS', false);
header('HTTP/1.1 301 Moved Permanently');

// This seems crazy, redirecting to the same url, but it really isn't
redirectexit($_SERVER['REQUEST_URL']);


add before:

if(!empty($modSettings['helpdesk_active']) && strpos($_SERVER['REQUEST_URL'], 'action=helpdesk') !== false && strpos($_SERVER['REQUEST_URL'], 'sa=ajax') !== false)
return;


Now it works  :)

Fel
Title: Re: Problem with AJAX requests
Post by: Gruffen on April 06, 2010, 06:41:36 AM
Thanks, Feline :)

Though perhaps a solution that moves the session var/id to the GET instead of trying to alter another part of SSEF (groan) would be better.
Title: Re: Problem with AJAX requests
Post by: feline on April 06, 2010, 06:45:21 AM
True .. SSEF need a little bit (more) redesign .. but .. Slammedime is not so fast  :(

Fel
Title: Re: Problem with AJAX requests
Post by: Gruffen on April 06, 2010, 06:50:26 AM
I think I can implement this one into SimpleDesk without too much work. Fortunately that's one of the only places I think a URL will get rewritten by the mod as a redirect.

Edit: Tracked as http://www.simpledesk.net/community/issue,330.0/
Title: Re: Problem with AJAX requests
Post by: feline on April 06, 2010, 08:26:00 AM
Thanks .. I think the session check it's secure enough to use GET for this ...

Fel
Title: Re: Problem with AJAX requests
Post by: feline on April 06, 2010, 08:28:31 AM
by the way .. a other good option is to make the assign/reassign also by ajax request. Possible ?

Fel
Title: Re: Problem with AJAX requests
Post by: cσσкιє мσηѕтєя on April 06, 2010, 09:36:50 AM
Quote from: feline on April 06, 2010, 08:28:31 AM
by the way .. a other good option is to make the assign/reassign also by ajax request. Possible ?

That feature has been discussed but it never made it into SD 1.0.
Title: Re: Problem with AJAX requests
Post by: Gruffen on April 06, 2010, 11:13:29 AM
It's something I think we can take a look at for 1.1; since we're doing custom ticket fields, changing of which could well be AJAXified, I think we can take a look at the whole AJAX updating thing and maybe enhance it. Not promising it'll happen but it occurs to me how we could go about it.