Skip to content

Commit

Permalink
Fix user register
Browse files Browse the repository at this point in the history
  • Loading branch information
hoaquynhtim99 committed May 30, 2016
1 parent da15dc0 commit 30dffaf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion modules/users/blocks/global.login.php
Expand Up @@ -163,6 +163,7 @@ function nv_block_login($block_config)
$xtpl->assign('SRC_CAPTCHA', NV_BASE_SITEURL . 'index.php?scaptcha=captcha&t=' . NV_CURRENTTIME);
$xtpl->assign('NV_HEADER', '');
$xtpl->assign('NV_REDIRECT', '');
$xtpl->assign('CHECKSS', NV_CHECK_SESSION);

$username_rule = empty($global_config['nv_unick_type']) ? sprintf($lang_global['username_rule_nolimit'], NV_UNICKMIN, NV_UNICKMAX) : sprintf($lang_global['username_rule_limit'], $lang_global['unick_type_' . $global_config['nv_unick_type']], NV_UNICKMIN, NV_UNICKMAX);
$password_rule = empty($global_config['nv_upass_type']) ? sprintf($lang_global['password_rule_nolimit'], NV_UPASSMIN, NV_UPASSMAX) : sprintf($lang_global['password_rule_limit'], $lang_global['upass_type_' . $global_config['nv_upass_type']], NV_UPASSMIN, NV_UPASSMAX);
Expand Down Expand Up @@ -333,6 +334,7 @@ function nv_block_login($block_config)
$xtpl->parse('main.allowuserreg.field');
}

$xtpl->parse('main.allowuserreg.agreecheck');
$xtpl->parse('main.allowuserreg');
!empty($block_config['display_mode']) ? $xtpl->parse('main.' . $display_layout . '.allowuserreg2') : $xtpl->parse('main.' . $display_layout . '.allowuserreg2_form');

Expand All @@ -343,7 +345,6 @@ function nv_block_login($block_config)
}

$xtpl->parse('main.' . $display_layout);

$xtpl->parse('main');
$content = $xtpl->text('main');
}
Expand Down
2 changes: 2 additions & 0 deletions modules/users/blocks/global.user_button.php
Expand Up @@ -100,6 +100,7 @@
$xtpl->assign('SRC_CAPTCHA', NV_BASE_SITEURL . 'index.php?scaptcha=captcha&t=' . NV_CURRENTTIME);
$xtpl->assign('NV_HEADER', '');
$xtpl->assign('NV_REDIRECT', '');
$xtpl->assign('CHECKSS', NV_CHECK_SESSION);

$username_rule = empty($global_config['nv_unick_type']) ? sprintf($lang_global['username_rule_nolimit'], NV_UNICKMIN, NV_UNICKMAX) : sprintf($lang_global['username_rule_limit'], $lang_global['unick_type_' . $global_config['nv_unick_type']], NV_UNICKMIN, NV_UNICKMAX);
$password_rule = empty($global_config['nv_upass_type']) ? sprintf($lang_global['password_rule_nolimit'], NV_UPASSMIN, NV_UPASSMAX) : sprintf($lang_global['password_rule_limit'], $lang_global['upass_type_' . $global_config['nv_upass_type']], NV_UPASSMIN, NV_UPASSMAX);
Expand Down Expand Up @@ -265,6 +266,7 @@
$xtpl->parse('main.allowuserreg.field');
}

$xtpl->parse('main.allowuserreg.agreecheck');
$xtpl->parse('main.allowuserreg');
$xtpl->parse('main.allowuserreg2');
$xtpl->parse('main.allowuserreg3');
Expand Down
4 changes: 3 additions & 1 deletion modules/users/theme.php
Expand Up @@ -27,7 +27,6 @@ function user_register($gfx_chk, $checkss, $data_questions, $array_field_config,
global $module_info, $module_file, $global_config, $lang_global, $lang_module, $module_name, $nv_Request, $op, $nv_redirect;

$xtpl = new XTemplate('register.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
$xtpl->assign('USER_REGISTER', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=register');
$xtpl->assign('NICK_MAXLENGTH', NV_UNICKMAX);
$xtpl->assign('NICK_MINLENGTH', NV_UNICKMIN);
$xtpl->assign('PASS_MAXLENGTH', NV_UPASSMAX);
Expand All @@ -38,6 +37,9 @@ function user_register($gfx_chk, $checkss, $data_questions, $array_field_config,

if ($group_id != 0) {
$xtpl->assign('USER_REGISTER', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=register/' . $group_id);
} else {
$xtpl->assign('USER_REGISTER', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=register');
$xtpl->parse('main.agreecheck');
}

$username_rule = empty($global_config['nv_unick_type']) ? sprintf($lang_global['username_rule_nolimit'], NV_UNICKMIN, NV_UNICKMAX) : sprintf($lang_global['username_rule_limit'], $lang_global['unick_type_' . $global_config['nv_unick_type']], NV_UNICKMIN, NV_UNICKMAX);
Expand Down
9 changes: 8 additions & 1 deletion themes/default/js/users.js
Expand Up @@ -256,7 +256,14 @@ function reg_validForm(a) {
window.location.href = "" != b.input ? b.input : window.location.href
}, 6E3)
})))
}
},
error: function (xhr, opt, err) {
if (window.console.log) {
console.log(xhr.status + ': ' + err);
} else {
alert(xhr.status + ': ' + err);
}
}
}));
return !1
}
Expand Down

0 comments on commit 30dffaf

Please sign in to comment.