Example #1
0
 private function createBoard(GWF_Group $group)
 {
     $name = $group->getName();
     $pid = $this->module->getForumBoard()->getID();
     //		$pid = Common::clamp($this->module->cfgBID(), 1);
     if (false === GWF_ForumBoard::getByID($pid)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     $groupid = $group->getID();
     $options = GWF_ForumBoard::ALLOW_THREADS;
     if (false === ($board = GWF_ForumBoard::createBoard('Usergroup: ' . $name, 'Board for the ' . $name . ' group', $pid, $options, $groupid))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === $group->saveVar('group_bid', $board->getID())) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false !== ($error = $this->module->adjustFlags($group))) {
         return $error;
     }
     return false;
 }
Example #2
0
 private function changeGroupName(GWF_Group $group, $new_name)
 {
     if ($new_name === $group->getVar('group_name')) {
         return true;
     }
     if (false === ($mod_forum = GWF_Module::getModule('Forum'))) {
         return true;
     }
     $mod_forum->onInclude();
     if (false === ($board = GWF_ForumBoard::getByID($group->getBoardID()))) {
         return false;
     }
     if (false === $group->saveVar('group_name', $new_name)) {
         return false;
     }
     if (false === $board->saveVars(array('board_title' => 'Usergroup: ' . $new_name, 'board_descr' => 'Board for the ' . $new_name . ' group'))) {
         return false;
     }
     return true;
 }