diff options
author | friendica <info@friendica.com> | 2012-08-16 05:29:16 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-08-16 05:29:16 -0700 |
commit | 57cf80754d7ad2037ea144369111a624ec5ffcb3 (patch) | |
tree | bee0c22e9365a3f99a308562ce686ebd5167e4d0 /mod/zregister.php | |
parent | d78d6a2e663ad3e71c21c1207411a7bcd704163c (diff) | |
download | volse-hubzilla-57cf80754d7ad2037ea144369111a624ec5ffcb3.tar.gz volse-hubzilla-57cf80754d7ad2037ea144369111a624ec5ffcb3.tar.bz2 volse-hubzilla-57cf80754d7ad2037ea144369111a624ec5ffcb3.zip |
invitation cleanup
Diffstat (limited to 'mod/zregister.php')
-rw-r--r-- | mod/zregister.php | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/mod/zregister.php b/mod/zregister.php index 0ce6b90ef..6478c7c9a 100644 --- a/mod/zregister.php +++ b/mod/zregister.php @@ -5,21 +5,23 @@ require_once('include/account.php'); function zregister_init(&$a) { $a->page['template'] = 'full'; + $result = null; $cmd = ((argc() > 1) ? argv(1) : ''); - - if($cmd === 'invite_check.json') { - $result = check_account_invite($_REQUEST['invite_code']); - json_return_and_die($result); - } - - if($cmd === 'email_check.json') { - $result = check_account_email($_REQUEST['email']); - json_return_and_die($result); + switch($cmd) { + case 'invite_check.json': + $result = check_account_invite($_REQUEST['invite_code']); + break; + case 'email_check.json': + $result = check_account_email($_REQUEST['email']); + break; + case 'password_check.json': + $result = check_account_password($_REQUEST['password']); + break; + default: + break; } - - if($cmd === 'password_check.json') { - $result = check_account_password($_REQUEST['password']); + if($result) { json_return_and_die($result); } } @@ -218,11 +220,10 @@ function zregister_content(&$a) { $enable_tos = 1 - intval(get_config('system','no_termsofservice')); - $email = ((x($_REQUEST,'email')) ? $_REQUEST['email'] : "" ); - $password = ((x($_REQUEST,'password')) ? $_REQUEST['password'] : "" ); - $password2 = ((x($_REQUEST,'password2')) ? $_REQUEST['password2'] : "" ); - $invite_code = ((x($_REQUEST,'invite_code')) ? $_REQUEST['invite_code'] : "" ); - + $email = ((x($_REQUEST,'email')) ? strip_tags(trim($_REQUEST['email'])) : "" ); + $password = ((x($_REQUEST,'password')) ? trim($_REQUEST['password']) : "" ); + $password2 = ((x($_REQUEST,'password2')) ? trim($_REQUEST['password2']) : "" ); + $invite_code = ((x($_REQUEST,'invite_code')) ? strip_tags(trim($_REQUEST['invite_code'])) : "" ); $o = replace_macros(get_markup_template('zregister.tpl'), array( @@ -232,7 +233,7 @@ function zregister_content(&$a) { '$invitations' => get_config('system','invitation_only'), '$invite_desc' => t('Membership on this site is by invitation only.'), '$label_invite' => t('Please enter your invitation code'), - '$invite_id' => $invite_id, + '$invite_code' => $invite_code, '$label_email' => t('Your email address'), '$label_pass1' => t('Choose a password'), |