aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-01-12 15:43:08 -0800
committerredmatrix <git@macgirvin.com>2016-01-12 15:43:08 -0800
commitbaedd253090e1129dfea8284ee6dc29649286b3b (patch)
treeea24903d359fe8f7c7730fcc874d2764f84d45e8 /mod/register.php
parentbbc1a1f1fb925fc804585118364297acb5c8fa1f (diff)
downloadvolse-hubzilla-baedd253090e1129dfea8284ee6dc29649286b3b.tar.gz
volse-hubzilla-baedd253090e1129dfea8284ee6dc29649286b3b.tar.bz2
volse-hubzilla-baedd253090e1129dfea8284ee6dc29649286b3b.zip
'auto channel creation' - if the corresponding config variable is set, create a channel when an account is created.
Plugins can provide the necessary channel details (probably from an extended registration form). If no details are provided, a social (mostly public) channel will be created using the LHS of the email address and you will be directed to your channel page (unless email verification is required, in which case this step will be delayed until successful validation and login). If the reddress is already assigned a random name(1000-9999) reddress will be assigned.
Diffstat (limited to 'mod/register.php')
-rw-r--r--mod/register.php39
1 files changed, 27 insertions, 12 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);
}