X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fnewgroup.php;h=c54e24ed95103226918f16b5e9b7898f058e5e7c;hb=7150c54a3f437043eac95d57ac9fc0672adef564;hp=9682b875cb0c666a058c0b241b4310d939cd2225;hpb=59a0b2a82da418f688faf182407146d9e7a7af7a;p=quix0rs-gnu-social.git diff --git a/actions/newgroup.php b/actions/newgroup.php index 9682b875cb..c54e24ed95 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -130,6 +130,7 @@ class NewgroupAction extends Action $homepage = $this->trimmed('homepage'); $description = $this->trimmed('description'); $location = $this->trimmed('location'); + $private = $this->boolean('private'); $aliasstring = $this->trimmed('aliases'); if ($this->nicknameExists($nickname)) { @@ -202,6 +203,14 @@ class NewgroupAction extends Action } } + if ($private) { + $force_scope = 1; + $join_policy = User_group::JOIN_POLICY_MODERATE; + } else { + $force_scope = 0; + $join_policy = User_group::JOIN_POLICY_OPEN; + } + $cur = common_current_user(); // Checked in prepare() above @@ -215,6 +224,8 @@ class NewgroupAction extends Action 'location' => $location, 'aliases' => $aliases, 'userid' => $cur->id, + 'join_policy' => $join_policy, + 'force_scope' => $force_scope, 'local' => true)); $this->group = $group;