I've set up a custom login page witht the difference that that one should redirect the user to another page.
I use the default drupal login form so I dont really now how to fix the form alter for my custom form without it to change the default login form too.
What could I do to fix this?
My code:
function mymodule_cv_login() {
// Print the user login form
$form = drupal_get_form('user_login');
$form['redirect'] = 'cv';
return $form;
}
function mymodule_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'user_login') {
$path = 'profil';
$form['#action'] = url($_GET['q'], array('query' => array('destination' => $path)));
}
}