X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fregister.php;h=fdf488b1a75e96a01e1e56ab4270406fc1963b4c;hb=9d9176f87e6db2f34c85ee098cede766d0744e9b;hp=86bfe2066e9888e397fc583c98a1a1846a6470e8;hpb=2a269e0c182eb90405644190abe6f40a9cdef615;p=friendica.git diff --git a/mod/register.php b/mod/register.php index 86bfe2066e..fdf488b1a7 100644 --- a/mod/register.php +++ b/mod/register.php @@ -36,7 +36,10 @@ function register_post(&$a) { $email = ((x($_POST,'email')) ? notags(trim($_POST['email'])) : ''); $openid_url = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : ''); $photo = ((x($_POST,'photo')) ? notags(trim($_POST['photo'])) : ''); + $publish = ((x($_POST,'profile_publish_reg') && intval($_POST['profile_publish_reg'])) ? 1 : 0); + $netpublish = ((strlen(get_config('system','directory_submit_url'))) ? $publish : 0); + $tmp_str = $openid_url; if((! x($username)) || (! x($email)) || (! x($nickname))) { if($openid_url) { @@ -60,6 +63,10 @@ function register_post(&$a) { return; } + if(! validate_url($tmp_str)) + $openid_url = ''; + + $err = ''; @@ -193,14 +200,16 @@ function register_post(&$a) { } if(x($newuid) !== false) { - $r = q("INSERT INTO `profile` ( `uid`, `profile-name`, `is-default`, `name`, `photo`, `thumb` ) - VALUES ( %d, '%s', %d, '%s', '%s', '%s' ) ", + $r = q("INSERT INTO `profile` ( `uid`, `profile-name`, `is-default`, `name`, `photo`, `thumb`, `publish`, `net-publish` ) + VALUES ( %d, '%s', %d, '%s', '%s', '%s', %d, %d ) ", intval($newuid), 'default', 1, dbesc($username), dbesc($a->get_baseurl() . "/photo/profile/{$newuid}.jpg"), - dbesc($a->get_baseurl() . "/photo/avatar/{$newuid}.jpg") + dbesc($a->get_baseurl() . "/photo/avatar/{$newuid}.jpg"), + intval($publish), + intval($netpublish) ); if($r === false) { @@ -282,6 +291,12 @@ function register_post(&$a) { } } + if($netpublish && $a->config['register_policy'] != REGISTER_APPROVE) { + $url = $a->get_baseurl() . "/profile/$nickname"; + proc_run('php',"include/directory.php","$url"); + } + + if( $a->config['register_policy'] == REGISTER_OPEN ) { $email_tpl = load_view_file("view/register_open_eml.tpl"); $email_tpl = replace_macros($email_tpl, array( @@ -338,6 +353,7 @@ function register_post(&$a) { } } + return; }} @@ -355,7 +371,7 @@ function register_content(&$a) { $block = get_config('system','block_extended_register'); - if((($a->config['register_policy'] == REGISTER_CLOSED) && (! getuid())) || ($block)) { + if((($a->config['register_policy'] == REGISTER_CLOSED) && (! local_user())) || ($block)) { notice("Permission denied." . EOL); return; } @@ -385,12 +401,33 @@ function register_content(&$a) { $oidlabel = t("Your OpenID \x28optional\x29: "); } + // I set this and got even more fake names than before... + + $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 = ''; + } + 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 Creative Commons Attribution 3.0 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')) ? '
' . $a->config['register_text'] . '
' @@ -401,9 +438,10 @@ function register_content(&$a) { '$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 global profile locator will then be \'nickname@$sitename\'.'), + '$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'nickname@$sitename\'.'), '$nicklabel' => t('Choose a nickname: '), '$photo' => $photo, + '$publish' => $profile_publish, '$regbutt' => t('Register'), '$username' => $username, '$email' => $email,