aboutsummaryrefslogtreecommitdiffstats
path: root/mod/zregister.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-08-16 03:37:07 -0700
committerfriendica <info@friendica.com>2012-08-16 03:37:07 -0700
commit5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17 (patch)
treec4f1c0475bd8735a06aea336969c7c28c5b08bb4 /mod/zregister.php
parent434bcfef8ba816805df29736efb36f8c95c20769 (diff)
downloadvolse-hubzilla-5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17.tar.gz
volse-hubzilla-5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17.tar.bz2
volse-hubzilla-5c8d854d7d0fb1dbd5454ab41cf9722de2e4ec17.zip
zregister, cont.
Diffstat (limited to 'mod/zregister.php')
-rw-r--r--mod/zregister.php19
1 files changed, 15 insertions, 4 deletions
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");