]> git.mxchange.org Git - friendica.git/commitdiff
reverse the default newuser privacy setting to public. Sites can over-ride.
authorfriendica <info@friendica.com>
Fri, 14 Sep 2012 02:11:07 +0000 (19:11 -0700)
committerfriendica <info@friendica.com>
Fri, 14 Sep 2012 02:11:07 +0000 (19:11 -0700)
include/user.php
mod/admin.php
mod/newmember.php
view/admin_site.tpl
view/theme/frost-mobile/admin_site.tpl
view/theme/frost/admin_site.tpl

index 2d06ef3742e092ff051d1596abe33bddea160ff3..282bbdbba24761acc46d6a9bfeb78b25cf725678 100644 (file)
@@ -277,18 +277,24 @@ function create_user($arr) {
                require_once('include/group.php');
                group_add($newuid, t('Friends'));
 
-               if(! get_config('system', 'newuser_public')) {
-                       $r = q("SELECT id FROM `group` WHERE uid = %d AND name = '%s'",
-                               intval($newuid),
-                               dbesc(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($r) {
-                               q("UPDATE user SET def_gid = %d, allow_gid = '%s' WHERE uid = %d",
-                                  intval($r[0]['id']),
-                                  dbesc("<" . $r[0]['id'] . ">"),
-                                  intval($newuid)
-                               );
-                       }
                }
 
        }
index db4d4cff25b8289d1fa9ab275442c13b3d4fd374..2d1d21bb475d3cf9a916d607621ee2519448d202 100644 (file)
@@ -254,7 +254,7 @@ function admin_page_site_post(&$a){
        $force_publish          =       ((x($_POST,'publish_all'))              ? True                                          : False);
        $global_directory       =       ((x($_POST,'directory_submit_url'))     ? notags(trim($_POST['directory_submit_url']))  : '');
        $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_openid              =       !((x($_POST,'no_openid'))               ? 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','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','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.")),
                '$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.")),
-               '$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_openid'            => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")),
index e17a0db037085c55a66abd8e9cf16c9811a18dbe..8028e7e08d9f263cfa3a40a274a8843f1294a14a 100644 (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;
 
-       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;
        }
 
index 6564565f7ebfbb7501010000e93547af53471e2c..ceba97d3f11998043f774b70b04667c85042deba 100644 (file)
@@ -76,7 +76,7 @@
        {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ 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=$newuser_public }}{{ endinc }}
+       {{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }}
        
        <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
        
index 91aeda035792e5c1f40aa40372a5448a6e6f1b0b..087de4f7dbca41328d27d5e91872b0730e657309 100644 (file)
@@ -40,7 +40,7 @@
        {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ 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=$newuser_public }}{{ endinc }}
+       {{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }}
        
        <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
        
index 91aeda035792e5c1f40aa40372a5448a6e6f1b0b..087de4f7dbca41328d27d5e91872b0730e657309 100644 (file)
@@ -40,7 +40,7 @@
        {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ 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=$newuser_public }}{{ endinc }}
+       {{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }}
        
        <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>