diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/register.php | 39 | ||||
-rw-r--r-- | mod/regmod.php | 4 | ||||
-rw-r--r-- | mod/regver.php | 4 |
3 files changed, 31 insertions, 16 deletions
diff --git a/mod/register.php b/mod/register.php index 2e9967c60..3a4d5bcb9 100644 --- a/mod/register.php +++ b/mod/register.php @@ -1,5 +1,6 @@ <?php +require_once('include/identity.php'); function register_init(&$a) { @@ -103,9 +104,8 @@ function register_post(&$a) { if($using_invites && $invite_code) { q("delete * from register where hash = '%s'", dbesc($invite_code)); -// @FIXME - this total needs to be stored by account, but pconfig operates on channels -// This also needs to be considered when using 'invites_remaining' in mod/invite.php -// set_pconfig($result['account']['account_id'],'system','invites_remaining',$num_invites); + // @FIXME - this also needs to be considered when using 'invites_remaining' in mod/invite.php + set_aconfig($result['account']['account_id'],'system','invites_remaining',$num_invites); } if($policy == REGISTER_OPEN ) { @@ -113,7 +113,7 @@ function register_post(&$a) { $res = verify_email_address($result); } else { - $res = send_verification_email($result['email'],$result['password']); + $res = send_register_success_email($result['email'],$result['password']); } if($res) { info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ; @@ -135,28 +135,43 @@ function register_post(&$a) { } authenticate_success($result['account'],true,false,true); + + $new_channel = false; + + if(get_config('system','auto_channel_create')) { + $new_channel = auto_channel_create($result['account']['account_id']); + if($new_channel['success']) { + $channel_id = $new_channel['channel']['channel_id']; + change_channel($channel_id); + $next_page = '~'; + } + else + $new_channel = false; + } + if(! $new_channel) { + if(! strlen($next_page = get_config('system','workflow_register_next'))) + $next_page = 'new_channel'; - if(! strlen($next_page = get_config('system','workflow_register_next'))) - $next_page = 'new_channel'; + $_SESSION['workflow'] = true; + } - $_SESSION['workflow'] = true; - goaway(z_root() . '/' . $next_page); } - - - - function register_content(&$a) { $registration_is = ''; $other_sites = ''; if(get_config('system','register_policy') == REGISTER_CLOSED) { + if(get_config('system','directory_mode') == DIRECTORY_MODE_STANDALONE) { + notice( t('Registration on this site is disabled.') . EOL); + return; + } + require_once('mod/pubsites.php'); return pubsites_content($a); } diff --git a/mod/regmod.php b/mod/regmod.php index c0a75ef48..a1d300e56 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -25,10 +25,10 @@ function regmod_content(&$a) { $hash = argv(2); if($cmd === 'deny') { - if (!user_deny($hash)) killme(); + if (! account_deny($hash)) killme(); } if($cmd === 'allow') { - if (!user_allow($hash)) killme(); + if (! account_allow($hash)) killme(); } } diff --git a/mod/regver.php b/mod/regver.php index c3ade2ee1..78f146ec5 100644 --- a/mod/regver.php +++ b/mod/regver.php @@ -13,10 +13,10 @@ function regver_content(&$a) { $hash = argv(2); if($cmd === 'deny') { - if (!user_deny($hash)) killme(); + if (! account_deny($hash)) killme(); } if($cmd === 'allow') { - if (!user_approve($hash)) killme(); + if (! account_approve($hash)) killme(); } } |