How Do I Stop Memebers From Creating Groups

Deleted User Posted in Technical Support 7 years ago

Is there a way to only allow admins create groups?

Replies
German Michael Zülsdorff Replied 4 years ago

I'm very much in line with Steven that having a link which in the end won't work isn't really smart.

Just created a new component to realize Steven's idea. See ...

https://www.opensource-socialnetwork.org/component/view/3682/restrict-group-creation

Tatar Steven downer Replied 4 years ago

If only "Admins" are to create Groups, then perhaps it could be better to simply have an option to not display the "ADD GROUP" option to "normal users" in the side panel but to display it only to "Admins", similar to that of displaying the "Administrator" panel only to Admins.... Just thinking further outside the box for future updates

German Michael Zülsdorff Replied 4 years ago

@Oliver
Hä? Arsalan already explained that in the very first answer.
Be sure to add the redirect(REF); as said in the comment of mine.

German Oliver Mankewitz Replied 4 years ago

This is an option I need.
Which file is the right place to lokk at (OSSN 5.1)?

ng Sunday Ajani Replied 6 years ago

@z-man thanks i added the redirect line and it works.

ng Sunday Ajani Replied 6 years ago

It says you can not create group and then successfully create group.
Low and behold the group was actually created

ng Sunday Ajani Replied 6 years ago

@Asarlan I tried it but user can still create group

German Michael Zülsdorff Replied 7 years ago

Oops, ya: a line is missing.
Add
redirect(REF);
below ossn_trigger_message...

us Erik M Replied 7 years ago

Sorry, but this only made a warning show up but still created a group. Thank you for trying though.

Indonesian Arsalan Shah Replied 7 years ago

Simply put following in the HelloWorld/ossn_com.php (at end of file)

function ossn_restirct_group_creation_init(){
    ossn_register_callback('action', 'load', 'ossn_restirct_group_creation');
}
function ossn_restirct_group_creation($callback, $type, $params){
        if(ossn_isLoggedin()){
                if(!ossn_loggedin_user()->isAdmin() && $params['action'] == 'group/add'){
                        ossn_trigger_message('You can not create group', 'error');
                }
        }
}
ossn_register_callback('ossn', 'init', 'ossn_restirct_group_creation_init');