public function prepareView(\Nethgui\View\ViewInterface $view) { parent::prepareView($view); $view['username'] = $this->userName; $view['FullName'] = $this->getPlatform()->getDatabase('NethServer::Database::Passwd')->getProp($this->userName, 'gecos'); $provider = new \NethServer\Tool\UserProvider($this->getPlatform()); $view['readOnly'] = $provider->isReadOnly(); $view['ChangePassword'] = $view->getModuleUrl('../ChangePassword'); }
protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base) { $provider = new \NethServer\Tool\UserProvider($this->getPlatform()); # hide this module if no provider is installed if ($provider->isReadOnly()) { return $base; } else { return \Nethgui\Module\SimpleModuleAttributesProvider::extendModuleAttributes($base, 'Security', 30); } }