reverse the default newuser privacy setting to public. Sites can over-ride.

This commit is contained in:
friendica 2012-09-13 19:11:07 -07:00
parent 269bb75a14
commit 32d4a359f1
6 changed files with 24 additions and 18 deletions

View File

@ -277,18 +277,24 @@ function create_user($arr) {
require_once('include/group.php'); require_once('include/group.php');
group_add($newuid, t('Friends')); group_add($newuid, t('Friends'));
if(! get_config('system', 'newuser_public')) {
$r = q("SELECT id FROM `group` WHERE uid = %d AND name = '%s'", $r = q("SELECT id FROM `group` WHERE uid = %d AND name = '%s'",
intval($newuid), intval($newuid),
dbesc(t('Friends')) dbesc(t('Friends'))
); );
if($r) { if($r && count($r)) {
q("UPDATE user SET def_gid = %d, allow_gid = '%s' WHERE uid = %d", $def_gid = $r[0]['id'];
q("UPDATE user SET def_gid = %d WHERE uid = %d",
intval($r[0]['id']), intval($r[0]['id']),
dbesc("<" . $r[0]['id'] . ">"),
intval($newuid) 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)
);
} }
} }

View File

@ -254,7 +254,7 @@ function admin_page_site_post(&$a){
$force_publish = ((x($_POST,'publish_all')) ? True : False); $force_publish = ((x($_POST,'publish_all')) ? True : False);
$global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : ''); $global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : '');
$thread_allow = ((x($_POST,'thread_allow')) ? True : False); $thread_allow = ((x($_POST,'thread_allow')) ? True : False);
$newuser_public = ((x($_POST,'newuser_public')) ? True : False); $newuser_private = ((x($_POST,'newuser_private')) ? True : False);
$no_multi_reg = ((x($_POST,'no_multi_reg')) ? True : False); $no_multi_reg = ((x($_POST,'no_multi_reg')) ? True : False);
$no_openid = !((x($_POST,'no_openid')) ? True : False); $no_openid = !((x($_POST,'no_openid')) ? True : False);
$no_regfullname = !((x($_POST,'no_regfullname')) ? True : False); $no_regfullname = !((x($_POST,'no_regfullname')) ? True : False);
@ -355,7 +355,7 @@ function admin_page_site_post(&$a){
set_config('system','directory_submit_url', $global_directory); set_config('system','directory_submit_url', $global_directory);
} }
set_config('system','thread_allow', $thread_allow); set_config('system','thread_allow', $thread_allow);
set_config('system','newuser_public', $newuser_public); set_config('system','newuser_private', $newuser_private;
set_config('system','block_extended_register', $no_multi_reg); set_config('system','block_extended_register', $no_multi_reg);
set_config('system','no_openid', $no_openid); set_config('system','no_openid', $no_openid);
@ -467,7 +467,7 @@ function admin_page_site(&$a) {
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")), '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
'$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), t("URL to update the global directory. If this is not set, the global directory is completely unavailable to the application.")), '$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), t("URL to update the global directory. If this is not set, the global directory is completely unavailable to the application.")),
'$thread_allow' => array('thread_allow', t("Allow threaded items"), get_config('system','thread_allow'), t("Allow infinite level threading for items on this site.")), '$thread_allow' => array('thread_allow', t("Allow threaded items"), get_config('system','thread_allow'), t("Allow infinite level threading for items on this site.")),
'$newuser_public' => array('newuser_public', t("No default permissions for new users"), get_config('system','newuser_public'), t("New users will have no private permissions set for their posts by default, making their posts public until they change it.")), '$newuser_private' => array('newuser_private', t("Private posts by default for new users"), get_config('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")),
'$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")), '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")),
'$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")), '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")),

View File

@ -69,7 +69,7 @@ function newmember_content(&$a) {
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL; $o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
if(! get_config('system', 'newuser_public')) { if(get_config('system', 'newuser_private')) {
$o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL; $o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
} }

View File

@ -76,7 +76,7 @@
{{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }}
{{ inc field_input.tpl with $field=$global_directory }}{{ endinc }} {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$newuser_public }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div> <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>

View File

@ -40,7 +40,7 @@
{{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }}
{{ inc field_input.tpl with $field=$global_directory }}{{ endinc }} {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$newuser_public }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div> <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>

View File

@ -40,7 +40,7 @@
{{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }}
{{ inc field_input.tpl with $field=$global_directory }}{{ endinc }} {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$newuser_public }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div> <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>