X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fnewgroup.php;h=c54e24ed95103226918f16b5e9b7898f058e5e7c;hb=c97048d01bea468e0cf8865b60c3c250b4515c39;hp=9682b875cb0c666a058c0b241b4310d939cd2225;hpb=325cb4833db7e3fd396720f12a27b880b63f4173;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;