-
-
Save anonymous/1078330 to your computer and use it in GitHub Desktop.
the reg form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = reg_form | |
description = "the reg form." | |
version = "6.x-1.0" | |
core = "6.x" | |
project = "reg_form" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implementation of hook_install(). | |
*/ | |
function formfilter_install() { | |
// Set a high weight so the module is called after other modules that | |
// modify forms. | |
db_query("UPDATE {system} SET weight = -99 WHERE name = 'reg_form'"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function reg_form_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == "user_register") { | |
//Look at the code in user_register_submit for all the ifs and switches to only | |
// add this extra handler when a normal user signs up. | |
$form['#submit'][] = "_reg_form_user_register_submit"; | |
} | |
} | |
function _reg_form_user_register_submit($form, &$form_state) { | |
$form_state['redirect'] = $GET['q']; //Adds the current url as redirect. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment