X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fuser.php;h=282bbdbba24761acc46d6a9bfeb78b25cf725678;hb=cef516956799589c7a7a17c57e7576a87047418f;hp=383a3b3e1cf76fe7a9ba484b5443d7e9c2071130;hpb=65268d25e62f3b04ef06c7265c6b0dde9f376246;p=friendica.git diff --git a/include/user.php b/include/user.php index 383a3b3e1c..282bbdbba2 100644 --- a/include/user.php +++ b/include/user.php @@ -99,11 +99,11 @@ function create_user($arr) { if(! allowed_email($email)) - $result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL; + $result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL; if((! valid_email($email)) || (! validate_email($email))) $result['message'] .= t('Not a valid email address.') . EOL; - + // Disallow somebody creating an account using openid that uses the admin email address, // since openid bypasses email verification. We'll allow it if there is not yet an admin account. @@ -277,6 +277,26 @@ function create_user($arr) { require_once('include/group.php'); group_add($newuid, t('Friends')); + $r = q("SELECT id FROM `group` WHERE uid = %d AND name = '%s'", + intval($newuid), + dbesc(t('Friends')) + ); + if($r && count($r)) { + $def_gid = $r[0]['id']; + + q("UPDATE user SET def_gid = %d WHERE uid = %d", + intval($r[0]['id']), + intval($newuid) + ); + } + + if(get_config('system', 'newuser_private') && $def_gid) { + q("UPDATE user SET allow_gid = '%s' WHERE uid = %d", + dbesc("<" . $def_gid . ">"), + intval($newuid) + ); + } + } // if we have no OpenID photo try to look up an avatar