Commit 67235411 authored by webchick's avatar webchick

Issue #687586 by oriol_e9g, Mike Wacker, agentrickard: Fixed Remove access...

Issue #687586 by oriol_e9g, Mike Wacker, agentrickard: Fixed Remove access check from user_register_submit().
parent 9163c089
......@@ -3671,6 +3671,14 @@ function user_register_form($form, &$form_state) {
$admin = user_access('administer users');
// Pass access information to the submit handler. Running an access check
// inside the submit function interferes with form processing and breaks
// hook_form_alter().
$form['administer_users'] = array(
'#type' => 'value',
'#value' => $admin,
);
// If we aren't admin but already logged on, go to the user page instead.
if (!$admin && $user->uid) {
drupal_goto('user/' . $user->uid);
......@@ -3728,7 +3736,7 @@ function user_register_validate($form, &$form_state) {
* @see user_register_form()
*/
function user_register_submit($form, &$form_state) {
$admin = user_access('administer users');
$admin = $form_state['values']['administer_users'];
if (!variable_get('user_email_verification', TRUE) || $admin) {
$pass = $form_state['values']['pass'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment