+ // logged in users can register others (people/pages/groups)
+ // even with closed registrations, unless specifically prohibited by site policy.
+ // 'block_extended_register' blocks all registrations, period.
+
+ $block = get_config('system','block_extended_register');
+
+ if((($a->config['register_policy'] == REGISTER_CLOSED) && (! local_user())) || ($block)) {
+ notice("Permission denied." . EOL);
+ return;
+ }
+
+ if(x($_SESSION,'theme'))
+ unset($_SESSION['theme']);
+
+
+ $username = ((x($_POST,'username')) ? $_POST['username'] : ((x($_GET,'username')) ? $_GET['username'] : ''));
+ $email = ((x($_POST,'email')) ? $_POST['email'] : ((x($_GET,'email')) ? $_GET['email'] : ''));
+ $openid_url = ((x($_POST,'openid_url')) ? $_POST['openid_url'] : ((x($_GET,'openid_url')) ? $_GET['openid_url'] : ''));
+ $nickname = ((x($_POST,'nickname')) ? $_POST['nickname'] : ((x($_GET,'nickname')) ? $_GET['nickname'] : ''));
+ $photo = ((x($_POST,'photo')) ? $_POST['photo'] : ((x($_GET,'photo')) ? hex2bin($_GET['photo']) : ''));
+
+ $noid = get_config('system','no_openid');
+
+ if($noid) {
+ $oidhtml = '';
+ $fillwith = '';
+ $fillext = '';
+ $oidlabel = '';
+ }
+ else {
+ $oidhtml = '<label for="register-openid" id="label-register-openid" >$oidlabel</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="$openid" >';
+ $fillwith = t("You may \x28optionally\x29 fill in this form via OpenID by supplying your OpenID and clicking 'Register'.");
+ $fillext = t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.');
+ $oidlabel = t("Your OpenID \x28optional\x29: ");
+ }
+
+ $realpeople = t('Members of this network prefer to communicate with real people who use their real names.');
+
+ if(get_config('system','publish_all')) {
+ $profile_publish_reg = '<input type="hidden" name="profile_publish_reg" value="1" />';
+ }
+ else {
+ $publish_tpl = load_view_file("view/profile_publish.tpl");
+ $profile_publish = replace_macros($publish_tpl,array(
+ '$instance' => 'reg',
+ '$pubdesc' => t('Include your profile in member directory?'),
+ '$yes_selected' => ' checked="checked" ',
+ '$no_selected' => '',
+ '$str_yes' => t('Yes'),
+ '$str_no' => t('No')
+ ));
+ }
+
+
+ $license = t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.');
+
+
+ $o = load_view_file("view/register.tpl");
+ $o = replace_macros($o, array(
+ '$oidhtml' => $oidhtml,
+ '$realpeople' => $realpeople,
+ '$regtitle' => t('Registration'),
+ '$registertext' =>((x($a->config,'register_text'))
+ ? '<div class="error-message">' . $a->config['register_text'] . '</div>'
+ : "" ),
+ '$fillwith' => $fillwith,
+ '$fillext' => $fillext,
+ '$oidlabel' => $oidlabel,
+ '$openid' => $openid_url,
+ '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\x29" . ': '),
+ '$addrlabel' => t('Your Email Address: '),
+ '$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@$sitename</strong>\'.'),
+ '$nicklabel' => t('Choose a nickname: '),
+ '$photo' => $photo,
+ '$publish' => $profile_publish,
+ '$regbutt' => t('Register'),
+ '$username' => $username,
+ '$email' => $email,
+ '$nickname' => $nickname,
+ '$license' => $license,
+ '$sitename' => $a->get_hostname()
+ ));