/** * Save blog settings * * @return void */ private function savesettings() { if (User::isGuest()) { $this->setError(Lang::txt('GROUPS_LOGIN_NOTICE')); return; } if ($this->authorized != 'manager' && $this->authorized != 'admin') { $this->setError(Lang::txt('PLG_GROUPS_FORUM_NOT_AUTHORIZED')); return $this->sections(); } // Check for request forgeries Request::checkToken(); $settings = Request::getVar('settings', array(), 'post'); $row = new \Hubzero\Plugin\Params($this->database); if (!$row->bind($settings)) { $this->setError($row->getError()); return $this->settings(); } // Get parameters $p = new \Hubzero\Config\Registry(Request::getVar('params', '', 'post')); $row->params = $p->toString(); // Check content if (!$row->check()) { $this->setError($row->getError()); return $this->_settings(); } // Store new content if (!$row->store()) { $this->setError($row->getError()); return $this->_settings(); } App::redirect(Route::url('index.php?option=com_groups&cn=' . $this->group->get('cn') . '&active=' . $this->_name . '&action=settings'), Lang::txt('PLG_GROUPS_FORUM_SETTINGS_SAVED')); }
/** * Save blog settings * * @return void */ private function _savesettings() { if (User::isGuest()) { $this->setError(Lang::txt('MEMBERS_LOGIN_NOTICE')); return; } if (User::get('id') != $this->member->get("uidNumber")) { $this->setError(Lang::txt('PLG_MEMBERS_BLOG_NOT_AUTHORIZED')); return $this->_browse(); } // Check for request forgeries Request::checkToken(); $settings = Request::getVar('settings', array(), 'post'); $row = new \Hubzero\Plugin\Params($this->database); if (!$row->bind($settings)) { $this->setError($row->getError()); return $this->_entry(); } $p = new \Hubzero\Config\Registry(Request::getVar('params', array(), 'post')); $row->params = $p->toString(); // Check content if (!$row->check()) { $this->setError($row->getError()); return $this->_settings(); } // Store new content if (!$row->store()) { $this->setError($row->getError()); return $this->_settings(); } App::redirect(Route::url($this->member->getLink() . '&active=' . $this->_name . '&task=settings'), Lang::txt('PLG_MEMBERS_BLOG_SETTINGS_SAVED')); }