Browse Source

automatically make posts private for new users

pull/443/head
Zach Prezkuta 9 years ago
parent
commit
7c5f5f3113
  1. 15
      include/user.php

15
include/user.php

@ -277,6 +277,21 @@ function create_user($arr) {
require_once('include/group.php');
group_add($newuid, t('Friends'));
if((! isset($a->config['system']['newuser_public'])) || ($a->config['system']['newuser_public'] === 0)) {
// Make the group we just created the default for new contacts and for posts
$r = q("SELECT id FROM `group` WHERE uid = %d AND name = '%s'",
intval($newuid),
dbesc(t('Friends'))
);
if($r) {
q("UPDATE user SET def_gid = %d, allow_gid = '%s' WHERE uid = %d",
intval($r[0]['id']),
dbesc("<" . $r[0]['id'] . ">"),
intval($newuid)
);
}
}
}
// if we have no OpenID photo try to look up an avatar

Loading…
Cancel
Save