$this->group_forum_id=db_insertid($result,'forum_group_list','group_forum_id');
$this->fetchData($this->group_forum_id);
- // set the permission for the role's group
- $roles_group = $this->Group->getRolesId();
- for ($i=0; $i<sizeof($roles_group); $i++) {
- $role_setting_res = db_query_params ('INSERT INTO role_setting (role_id,section_name,ref_id,value) VALUES ($1,$2,$3,$4)',
- array ($roles_group[$i],
- 'forum',
- $this->group_forum_id,
- 1)) ;
- if (!$role_setting_res) {
- db_rollback();
- $this->setError('Error: Role setting for forum id ' . $this->group_forum_id . ' for groud id ' . $this->Group->getID() . ' ' .db_error());
- return false;
- }
- }
-
if ($create_default_message) {
$fm=new ForumMessage($this);
// Use the system side default language
}
}
db_commit();
+
+ $this->Group->normalizeAllRoles () ;
+
return true;
}
* @return int The next thread_id #.
*/
function getNextThreadID() {
- global $sys_database_type;
-
- if ($sys_database_type == "mysql") {
- $sql="call newval('forum_thread_seq', @res)";
- $result=db_mquery($sql);
- if (!$result) {
- echo db_error();
- return false;
- }
- $sql="select @res";
- $result = db_query_mysql ($sql);
- } else {
- $result = db_query_params ('SELECT nextval($1)',
- array ('forum_thread_seq')) ;
- }
+ $result = db_query_params ('SELECT nextval($1)',
+ array ('forum_thread_seq')) ;
if (!$result || db_numrows($result) < 1) {
echo db_error();
return false;