/** * Get a model to store the config * * @param boolean $valueMask MAsk the password or if false decrypt it * @return \Gems_Model_JoinModel */ protected function getConfigModel($valueMask = true) { if (!$this->_configModel) { $model = new \MUtil_Model_TableModel('gems__radius_config', 'config'); // $model = new \Gems_Model_JoinModel('config', 'gems__radius_config', 'grcfg'); $model->setIfExists('grcfg_ip', 'label', $this->translate->_('IP address'), 'required', true); $model->setIfExists('grcfg_port', 'label', $this->translate->_('Port'), 'required', true); $model->setIfExists('grcfg_secret', 'label', $this->translate->_('Shared secret'), 'description', $this->translate->_('Enter only when changing'), 'elementClass', 'password', 'required', false, 'repeatLabel', $this->translate->_('Repeat password')); $type = new \Gems_Model_Type_EncryptedField($this->project, $valueMask); $type->apply($model, 'grcfg_secret', 'grcfg_encryption'); $this->_configModel = $model; } return $this->_configModel; }