diff options
author | friendica <info@friendica.com> | 2012-08-16 03:37:07 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-08-16 03:37:07 -0700 |
commit | 5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17 (patch) | |
tree | c4f1c0475bd8735a06aea336969c7c28c5b08bb4 | |
parent | 434bcfef8ba816805df29736efb36f8c95c20769 (diff) | |
download | volse-hubzilla-5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17.tar.gz volse-hubzilla-5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17.tar.bz2 volse-hubzilla-5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17.zip |
zregister, cont.
-rw-r--r-- | include/account.php | 11 | ||||
-rw-r--r-- | mod/zregister.php | 19 | ||||
-rw-r--r-- | view/css/mod_zregister.css | 2 |
3 files changed, 27 insertions, 5 deletions
diff --git a/include/account.php b/include/account.php index ead8ce862..e978e64b0 100644 --- a/include/account.php +++ b/include/account.php @@ -141,6 +141,17 @@ function create_account($arr) { return($result); } + $r = q("select * from account where account_email = '%s' and password = '%s' limit 1", + dbesc($email), + dbesc($password_encoded) + ); + if($r && count($r)) { + $result['account'] = $r[0]; + } + else { + logger('create_account: could not retrieve newly created account'); + } + $result['success'] = true; $result['email'] = $email; diff --git a/mod/zregister.php b/mod/zregister.php index b8ed4c66b..0ce6b90ef 100644 --- a/mod/zregister.php +++ b/mod/zregister.php @@ -73,8 +73,14 @@ function zregister_post(&$a) { notice($result['message']); return; } + require_once('include/security.php'); + authenticate_success($result['account'],true,true); + +//??? + // in fact we need the sponsor, not the user $user = $result['user']; +/// $using_invites = get_config('system','invitation_only'); $num_invites = get_config('system','number_invites'); @@ -83,9 +89,10 @@ function zregister_post(&$a) { if($policy == REGISTER_OPEN ) { - if($using_invites && $invite_id) { - q("delete * from register where hash = '%s' limit 1", dbesc($invite_id)); - set_pconfig($user['uid'],'system','invites_remaining',$num_invites); + if($using_invites && $invite_code) { + q("delete * from register where hash = '%s' limit 1", dbesc($invite_code)); +// set $sponsor + set_pconfig($sponsor['uid'],'system','invites_remaining',$num_invites); } $email_tpl = get_intltext_template("register_open_eml.tpl"); @@ -104,6 +111,10 @@ function zregister_post(&$a) { if($res) { info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ; + + + + goaway(z_root()); } } @@ -133,7 +144,7 @@ function zregister_post(&$a) { if($using_invites && $invite_id) { q("delete * from register where hash = '%s' limit 1", dbesc($invite_id)); - set_pconfig($user['uid'],'system','invites_remaining',$num_invites); + set_pconfig($sponsor['uid'],'system','invites_remaining',$num_invites); } $email_tpl = get_intltext_template("register_verify_eml.tpl"); diff --git a/view/css/mod_zregister.css b/view/css/mod_zregister.css index 2edb9e9a9..a5bd9a5cf 100644 --- a/view/css/mod_zregister.css +++ b/view/css/mod_zregister.css @@ -23,7 +23,7 @@ h2 { .zregister-feedback { float: left; - margin-left: 5px; + margin-left: 45px; } .zregister-field-end { |