Forums / Developer / Module/view redirect while preserving POST variables / Comment49106
Bruce Morrison
Tuesday 19 February 2008 2:52:00 am
Hi Piotrek
Try storing the POST variables in the session then redirecting to content/action...from user/login.php
// Save array of previous post variables in session variable $post = $http->attribute( 'post' ); $lastPostVars = array(); foreach ( array_keys( $post ) as $postKey ) { if ( substr( $postKey, 0, 5 ) == 'Last_' ) $lastPostVars[ substr( $postKey, 5, strlen( $postKey ) )] = $post[ $postKey ]; } if ( count( $lastPostVars ) > 0 ) { $postData = $lastPostVars; $http->setSessionVariable( 'LastPostVars', $lastPostVars ); }
content/action.php merges these with it's own POST variables. I think the is the mechanism that allows object creation to continue after a login is required.
I'll leave it for now but I'm positive it's possible and not difficult ;)
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish