getRequestValue('id'); /** * product manager allow to check product settings */ $productManager = new ProductManager(); $productManager->loadByHostingId($hid); $this->generateDoubleSection([new Text('firstname'), new Text('lastname')]); $email = new InputGroup('usernameGroup'); $email->addTextField('username', false, true); $email->addInputAddon('emailSign', false, '@'); $email->addInputComponent((new InputGroupElements\Text('domain'))->addHtmlAttribute('readonly','true')); $this->addSection($email); $this->generateDoubleSection([new Text('display_name'), new Select('status')]); /*** * * set cosId dependent od cos_name */ if($productManager->get('cos_name') === ClassOfServices::CLASS_OF_SERVICE_QUOTA) { $field = new Select('cosId'); $this->addField($field); }elseif($productManager->get('cos_name') === ClassOfServices::KERIO_CONFIG_OPTIONS) { $field = new Hidden('cosId'); $this->addField($field); }elseif($productManager->get('cos_name') !== ClassOfServices::CUSTOM_KERIO) { $field = new Hidden('cosId'); $this->addField($field); } $passwd = new Password('password'); $passwd->setDescription('description'); $passwd->addValidator(new PasswordsValidator()); $passwd->notEmpty(); $repPasswd = (new Password('repeat_password'))->addValidator(new RepeatPasswordValidator()); $repPasswd->notEmpty(); $this->generateDoubleSection([$passwd, $repPasswd]); } }