Make it possible to change visibility without changing name.
This commit is contained in:
parent
cc1e906825
commit
0e9df93a69
@ -49,7 +49,7 @@ function group_post(&$a) {
|
|||||||
$groupname = notags(trim($_POST['groupname']));
|
$groupname = notags(trim($_POST['groupname']));
|
||||||
$public = intval($_POST['public']);
|
$public = intval($_POST['public']);
|
||||||
|
|
||||||
if((strlen($groupname)) && ($groupname != $group['name'])) {
|
if((strlen($groupname)) && (($groupname != $group['name']) || ($public != $group['visible']))) {
|
||||||
$r = q("UPDATE `group` SET `name` = '%s', visible = %d WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
$r = q("UPDATE `group` SET `name` = '%s', visible = %d WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||||
dbesc($groupname),
|
dbesc($groupname),
|
||||||
intval($public),
|
intval($public),
|
||||||
@ -57,7 +57,7 @@ function group_post(&$a) {
|
|||||||
intval($group['id'])
|
intval($group['id'])
|
||||||
);
|
);
|
||||||
if($r)
|
if($r)
|
||||||
info( t('Collection name changed.') . EOL );
|
info( t('Collection updated.') . EOL );
|
||||||
}
|
}
|
||||||
|
|
||||||
goaway(z_root() . '/group/' . argv(1) . '/' . argv(2));
|
goaway(z_root() . '/group/' . argv(1) . '/' . argv(2));
|
||||||
|
Reference in New Issue
Block a user