Is there a way to only allow admins create groups?
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
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
@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.
This is an option I need.
Which file is the right place to lokk at (OSSN 5.1)?
@z-man thanks i added the redirect line and it works.
It says you can not create group and then successfully create group.
Low and behold the group was actually created
@Asarlan I tried it but user can still create group
Oops, ya: a line is missing.
Add
redirect(REF);
below ossn_trigger_message
...
Sorry, but this only made a warning show up but still created a group. Thank you for trying though.
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');
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)