streams/mod/regmod.php
redmatrix baedd25309 '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.
2016-01-12 15:43:08 -08:00

34 lines
558 B
PHP

<?php
function regmod_content(&$a) {
global $lang;
$_SESSION['return_url'] = $a->cmd;
if(! local_channel()) {
info( t('Please login.') . EOL);
$o .= '<br /><br />' . login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
return $o;
}
if(! is_site_admin()) {
notice( t('Permission denied.') . EOL);
return '';
}
if(argc() != 3)
killme();
$cmd = argv(1);
$hash = argv(2);
if($cmd === 'deny') {
if (! account_deny($hash)) killme();
}
if($cmd === 'allow') {
if (! account_allow($hash)) killme();
}
}