I'd like to insert the login form in my own form. To be clear, I have a quotation form and after we answer all the questions I would like to find the user login block. And after the user is logged in, I would like to reload the page to show differents elements.
In the form, I insert this code to show the login block:
$dgf_login_block = drupal_get_form('user_login_block'); $render_login_block = drupal_render($dgf_login_block); $form['envoi']['login_block'] = array( '#markup' => $render_login_block , '#prefix' => '<div class="lead text-left">', '#suffix' => '</div>', );
But it doesn't work.
My question is: what is the best way to insert the user login form inside an other form? Or does it better to define two fields (username and password) and validate them (and how can I validate the login)?
Thanks in advance for your help.