If you define roles to manage permission on category/forum, you may have a minor bug when creating new topic : users can select all the categories/forums instead of only having categories where users can create topic.
The solution :
/sys/CODOF/Forum/Category.php
line number 51, change the function
public function getCategoriesWhereUserCanCreateTopic() {
$cats = array();
$user = \CODOF\User\User::get();
$qry = 'SELECT cat_id, cat_pid, cat_name, cat_alias, no_topics, cat_img, granted'
. ' FROM ' . PREFIX . 'codo_categories, codo_permissions '
. ' WHERE permission=\'create new topic\' AND cid=cat_id AND rid=' . $user->rid . ''
. ' AND EXISTS (SELECT 1 FROM codo_permissions AS p WHERE '
. ' p.cid=cat_id AND p.rid=' . $user->rid . ' AND permission=\'create new topic\' AND granted=1) '
. ' ORDER BY cat_order';
$ans = $this->db->query($qry);
if ($ans) {
$cats = $ans->fetchAll(\PDO::FETCH_CLASS);
}
$cats = \CODOF\Hook::call('on_get_categories_for_create_topic', $cats);
return $cats;
}
If you define roles to manage permission on category/forum, you may have a minor bug when creating new topic : users can select all the categories/forums instead of only having categories where users can create topic.
The solution :
**/sys/CODOF/Forum/Category.php**
line number 51, change the function
````
public function getCategoriesWhereUserCanCreateTopic() {
$cats = array();
$user = \CODOF\User\User::get();
$qry = 'SELECT cat_id, cat_pid, cat_name, cat_alias, no_topics, cat_img, granted'
. ' FROM ' . PREFIX . 'codo_categories, codo_permissions '
. ' WHERE permission=\'create new topic\' AND cid=cat_id AND rid=' . $user->rid . ''
. ' AND EXISTS (SELECT 1 FROM codo_permissions AS p WHERE '
. ' p.cid=cat_id AND p.rid=' . $user->rid . ' AND permission=\'create new topic\' AND granted=1) '
. ' ORDER BY cat_order';
$ans = $this->db->query($qry);
if ($ans) {
$cats = $ans->fetchAll(\PDO::FETCH_CLASS);
}
$cats = \CODOF\Hook::call('on_get_categories_for_create_topic', $cats);
return $cats;
}
````