Пример #1
0
 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');
 }
Пример #2
0
 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);
     }
 }