Send Form After User Login/Register

startpoint

Active Member
I have a form with several elements. I used this form wih content plugin in article.
Must then be completed by the user in an attempt to send data to check whether the user is login to joomla.
If not logged in, he should come with his login.
If new to register and then send the completed form.
Check whether the user has entered I saw from another topic:
PHP:
$user = JFactory::getUser();
if ($user->get('id') == 0) {
  $app = JFactory::getApplication();
  $app->enqueueMessage("Naughty!  Not logged in.  No Donut");
  return false;
}
How to realize the rest?
I used form plugin redirect witch open in popup login form, but after login my user page loads filled form
and previously filled data is lost.

Regards
 
I've read your post a dozen times, but I'm having trouble understand the workflow you are describing. Can you try and explain again, with a step by step description of exactly what the workflow should be?

Or perhaps create a flow diagram, in something like http://draw.io

-- hugh
 
Sorry about that, I've moved this thread to Standard, so it gets noticed.

Does the form in the first step contain the login / account creation details, i.e. username, email, password, etc?

I suspect not, so you may need to modify that flow, by using some custom PHP in an article, which detects whether the user is logged in. If not, it prompts them to login, or, if they don't have an account, links them to your login form. Then, after the user is created, redirect them back to step 1.

-- hugh
 
I corrected workflow and now is exactly as it should work.
Sending Form After User Login2.jpg
The basic idea is user to fill in the form whether logged in or not. If you want to send the form to enter the system or to register and then send it without it filled again.
I hope now that I have already explained as detailed.

Regards
 
Right, but as I said in my previous post, you'll have to go through the login check and registration process BEFORE filling out the form. We don't have a feature that allows you to somehow save an unprocessed form, go off and do something else, then come back and reload the unsubmitted form.

-- hugh
 
Kinda. It rather depends if your validations depend on the user being registered or not.

It might be possible to process the form and save it, then in a redirect plugin's Condition code, check to see if they are logged in. If not, store the rowid of the just-saved form as session data, and redirect to an article page which has some embedded logic which handles the "do you have an account?", and routes them accordingly, either to login or account creation ... both of which then forward to yet another landing page, which retrieves the previously stored rowid, edits the form, and lets them save it again ... and this time, a 'user' element (set to update on edit) would record their userid.

But there's some unknowns in that approach as well, as i'm not sure how to go about handling a login, which then redirects to the right place.

Which is why I initially said the logic about login / account creation would be MUCH easier to handle prior to filling out the form.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top