示例#1
0
 /**
  * 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'));
 }
示例#2
0
 /**
  * Save blog settings
  *
  * @return     void
  */
 private function _savesettings()
 {
     // Login check
     if (User::isGuest()) {
         return $this->_login();
     }
     if ($this->authorized != 'manager' && $this->authorized != 'admin') {
         $this->setError(Lang::txt('PLG_COLLECTIONS_BLOG_NOT_AUTH'));
         return $this->_collections();
     }
     // Check for request forgeries
     Request::checkToken();
     $settings = Request::getVar('settings', array(), 'post');
     $row = new \Hubzero\Plugin\Params($this->database);
     $row->loadPlugin($this->group->get('gidNumber'), $this->_type, $this->_name);
     $row->object_id = $this->group->get('gidNumber');
     $row->folder = $this->_type;
     $row->element = $this->_name;
     // Get parameters
     $prms = Request::getVar('params', array(), 'post');
     $params = new \Hubzero\Config\Registry($prms);
     $row->params = $params->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), Lang::txt('PLG_GROUPS_COLLECTIONS_SETTINGS_SAVED'), 'passed');
 }
示例#3
0
 /**
  * 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'));
 }