diff --git a/materio_user.module b/materio_user.module index 4016a5e0..94bd4fe0 100644 --- a/materio_user.module +++ b/materio_user.module @@ -100,7 +100,9 @@ function materio_user_form_alter(&$form, &$form_state, $form_id) { $form['actions']['#type'] = "container"; // $form['actions']['submit']['#value'] = t('Join'); - // $form['#submit'][] = "materio_user_user_register_form_submit"; + if( $_GET['q'] == 'node/11187' ){ + $form['#submit'][] = "materio_user_user_login_form_submit"; + } } @@ -130,6 +132,17 @@ function materio_user_user_register_form_submit($form, &$form_state){ // drupal_set_message(t('Welcome, you just join materiO\'! now you can choose the membership that\'s right for you, or !link', array('!link'=>$frontlink))); } +function materio_user_user_login_form_submit($form, &$form_state){ + unset($_REQUEST['destination'], $_REQUEST['edit']['destination']); + + $form_state['redirect'] = array( + 'node/11187', + array( + 'fragment' => 'content-bottom', // if we login from the membership page, then go directly to the form + ) + ); +} + function materio_user_webform_client_111186_validate($form, &$form_state){ // dsm($form, 'form'); // dsm($form_state, 'form_state');