zregister, cont.
This commit is contained in:
parent
434bcfef8b
commit
5c8d854d7d
@ -141,6 +141,17 @@ function create_account($arr) {
|
|||||||
return($result);
|
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['success'] = true;
|
||||||
|
|
||||||
$result['email'] = $email;
|
$result['email'] = $email;
|
||||||
|
@ -73,8 +73,14 @@ function zregister_post(&$a) {
|
|||||||
notice($result['message']);
|
notice($result['message']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
require_once('include/security.php');
|
||||||
|
|
||||||
|
authenticate_success($result['account'],true,true);
|
||||||
|
|
||||||
|
//???
|
||||||
|
// in fact we need the sponsor, not the user
|
||||||
$user = $result['user'];
|
$user = $result['user'];
|
||||||
|
///
|
||||||
|
|
||||||
$using_invites = get_config('system','invitation_only');
|
$using_invites = get_config('system','invitation_only');
|
||||||
$num_invites = get_config('system','number_invites');
|
$num_invites = get_config('system','number_invites');
|
||||||
@ -83,9 +89,10 @@ function zregister_post(&$a) {
|
|||||||
|
|
||||||
if($policy == REGISTER_OPEN ) {
|
if($policy == REGISTER_OPEN ) {
|
||||||
|
|
||||||
if($using_invites && $invite_id) {
|
if($using_invites && $invite_code) {
|
||||||
q("delete * from register where hash = '%s' limit 1", dbesc($invite_id));
|
q("delete * from register where hash = '%s' limit 1", dbesc($invite_code));
|
||||||
set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
|
// set $sponsor
|
||||||
|
set_pconfig($sponsor['uid'],'system','invites_remaining',$num_invites);
|
||||||
}
|
}
|
||||||
|
|
||||||
$email_tpl = get_intltext_template("register_open_eml.tpl");
|
$email_tpl = get_intltext_template("register_open_eml.tpl");
|
||||||
@ -104,6 +111,10 @@ function zregister_post(&$a) {
|
|||||||
|
|
||||||
if($res) {
|
if($res) {
|
||||||
info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ;
|
info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,7 +144,7 @@ function zregister_post(&$a) {
|
|||||||
|
|
||||||
if($using_invites && $invite_id) {
|
if($using_invites && $invite_id) {
|
||||||
q("delete * from register where hash = '%s' limit 1", dbesc($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");
|
$email_tpl = get_intltext_template("register_verify_eml.tpl");
|
||||||
|
@ -23,7 +23,7 @@ h2 {
|
|||||||
|
|
||||||
.zregister-feedback {
|
.zregister-feedback {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 5px;
|
margin-left: 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.zregister-field-end {
|
.zregister-field-end {
|
||||||
|
Reference in New Issue
Block a user