Create standard Nette form
@param bool|true $secured Enable Cross-Site Request Forgery Protection
@return Form|IForm
481246
public function create($secured = true)
	{
		$form = new Form();
		if ($secured) $form->addProtection('Vypršel časový limit, odešlete formulář znovu');
		$form->setTranslator($this->translator);
		return $form;
	}
199299
protected function createResetPasswordForm(): FormInterface
    {
        $minLength = (int) $this->getParameter('netgen.ezforms.form.type.fieldtype.ezuser.parameters.min_password_length');

        $passwordConstraints = [
            new Constraints\NotBlank(),
        ];

        if ($minLength > 0) {
            $passwordConstraints[] = new Constraints\Length(
                [
                    'min' => $minLength,
                ]
            );
        }

        $passwordOptions = [
            'type' => PasswordType::class,
            'required' => true,
            'options' => [
                'constraints' => $passwordConstraints,
            ],
        ];

        return $this->createFormBuilder(null, ['translation_domain' => 'ngsite_user'])
            ->add('password', RepeatedType::class, $passwordOptions)
            ->getForm();
    }
1168070
public function createSchemeHeader($scheme)
    {
        $schemeObj = $this->getScheme($scheme);
        $value = $schemeObj->createResponseHeaderValue();

        return new HttpHeader($this->schemeHeader, trim($scheme . ' ' . $value));
    }
398483
public static function setSSL($enabled, $validate = true)
	{
		self::$useSSL = $enabled;
		self::$useSSLValidation = $validate;
	}
428677
public function setDefaultPathAndDomain( $path, $domain, $secure = false )
	{
		list( $this->path, $this->domain, $this->secure ) = [$path, $domain, $secure];

		return $this;
	}
1017134
public function profile(string $email, ?bool $secure = null): string
    {
        return $this->buildUrl($this->createEmailHash($email), $secure);
    }
541105
public function secure(bool $secure = true) : RouteBuilder
    {
        foreach ($this->routes as $route) {
            $route->secure($secure);
        }
        return $this;
    }
1193090
public function createRoleFromCreateStruct(RoleCreateStruct $createStruct)
    {
        $role = new Role();

        $role->identifier = $createStruct->identifier;
        $role->policies = $createStruct->policies;
        $role->status = Role::STATUS_DRAFT;

        return $role;
    }
356783
public static function to($url, $extra = [], $secure = null)
    {
        return self::getInstance()->to($url, $extra, $secure);
    }
3304
public function generateDigest($nonce, $createdAt, $password)
    {
        return base64_encode(sha1(base64_decode($nonce) . $createdAt . $password, true));
    }
481308
public function createForm() : FormInterface
    {
        foreach ($this->value as $key => $val) {
            if (in_array($val['type'], $this->validMethods)) {
                $method = $val['type'];
                unset($val['type']);
                (!method_exists($this, $method)) ?: $this->{$method}($key, $val);
            } else {
                $this->input($key, $val);
            }

            if (isset($val['type']) && in_array($val['type'], $this->validArray)) {
                $this->setValidationError($key, $val);
            } elseif (!isset($val['type']) && in_array($method, $this->validArray)) {
                $this->setValidationError($key, $val);
            }
        }

        return $this;
    }
27664
public static function createFromJKU($jku, $allow_unsecured_connection = false)
    {
        $content = self::downloadContent($jku, $allow_unsecured_connection);
        Assertion::keyExists($content, 'keys', 'Invalid content.');

        return new JWKSet($content);
    }
132985
public function secure($secure = null)
    {
        if ($secure !== null) {
            $this->secure = (bool) $secure;
        }

        return (bool) $this->secure;
    }
1084392
protected function getScheme($secure)
    {
        if (is_null($secure)) {
            return $this->forceSchema ?: $this->request->getScheme() .'://';
        }

        return $secure ? 'https://' : 'http://';
    }
49647
public function asset($asset, $secure = null)
    {
        return url('themes/' . $this->getCurrent() . '/' . $asset, null, $secure);
    }
817270
public function setSmtpSecurity($security)
    {
        $security = strtoupper($security);
        $validSecurity = [ '', 'TLS', 'SSL' ];

        if (!in_array($security, $validSecurity)) {
            throw new InvalidArgumentException(
                'SMTP Security is not valid. Must be "", "TLS" or "SSL".'
            );
        }

        $this->smtpSecurity = $security;

        return $this;
    }
333207
public function createForm(bool $edit = false)
    {
        $this->getRolesForUserCreation();

        $rolesStructure = [
            "type"            => 'checkBoxList',
            "fieldID"         => 'roles',
            "tabID"           => trans('HCACL::users.roles'),
            "label"           => trans("HCACL::users.role_groups"),
            "required"        => 1,
            "requiredVisible" => 1,
            "options"         => $this->getRolesForUserCreation(),
        ];

        $form = [
            'storageURL' => route('admin.api.users'),
            'buttons'    => [
                [
                    "class" => "col-centered",
                    "label" => trans('HCTranslations::core.buttons.submit'),
                    "type"  => "submit",
                ],
            ],
            'structure'  => [
                [
                    "type"            => "email",
                    "fieldID"         => "email",
                    "tabID"           => trans('HCTranslations::core.general'),
                    "label"           => trans("HCACL::users.email"),
                    "required"        => 1,
                    "requiredVisible" => 1,
                ],
                [
                    "type"            => "password",
                    "fieldID"         => "password",
                    "tabID"           => trans('HCTranslations::core.general'),
                    "label"           => trans("HCACL::users.register.password"),
                    "required"        => 1,
                    "requiredVisible" => 1,
                ],
                formManagerYesNo('checkBoxList', 'is_active', trans("HCACL::users.active"), 0, 0, trans('HCTranslations::core.general'), false),
                formManagerYesNo('checkBoxList', 'send_welcome_email', trans("HCACL::users.send_welcome_email"), 0, 0, trans('HCTranslations::core.general'), false),
                formManagerYesNo('checkBoxList', 'send_password', trans("HCACL::users.send_password"), 0, 0, trans('HCTranslations::core.general'), false),
                $rolesStructure
            ],
        ];

        if( $this->multiLanguage )
            $form['availableLanguages'] = []; //TOTO implement honeycomb-languages package

        if( ! $edit )
            return $form;

        //Make changes to edit form if needed

        $form['structure'] = [];

        $form['structure'] = array_merge($form['structure'], [
            [
                "type"            => "email",
                "fieldID"         => "email",
                "tabID"           => trans('HCTranslations::core.general'),
                "label"           => trans("HCACL::users.email"),
                "required"        => 1,
                "requiredVisible" => 1,
            ],
            [
                "type"            => "password",
                "fieldID"         => "old_password",
                "tabID"           => trans('HCTranslations::core.general'),
                "label"           => trans('HCACL::users.passwords.old'),
                "editType"        => 0,
                "required"        => 0,
                "requiredVisible" => 0,
                "properties"      => [
                    "strength" => "1" // case 0: much, case 1: 4 symbols, case 2: 6 symbols
                ],
            ],
            [
                "type"            => "password",
                "fieldID"         => "password",
                "tabID"           => trans('HCTranslations::core.general'),
                "label"           => trans('HCACL::users.passwords.new'),
                "editType"        => 0,
                "required"        => 0,
                "requiredVisible" => 0,
                "properties"      => [
                    "strength" => "1" // case 0: much, case 1: 4 symbols, case 2: 6 symbols
                ],
            ],
            [
                "type"            => "password",
                "fieldID"         => "password_confirmation",
                "tabID"           => trans('HCTranslations::core.general'),
                "label"           => trans('HCACL::users.passwords.new_again'),
                "editType"        => 0,
                "required"        => 0,
                "requiredVisible" => 0,
                "properties"      => [
                    "strength" => "1" // case 0: much, case 1: 4 symbols, case 2: 6 symbols
                ],
            ],
            formManagerYesNo('checkBoxList', 'is_active', trans("HCACL::users.active"), 0, 0, trans('HCTranslations::core.general'), false),
            $rolesStructure,
            [
                "type"            => "singleLine",
                "fieldID"         => "last_login",
                "tabID"           => trans('HCACL::users.activity'),
                "label"           => trans("HCACL::users.last_login"),
                "required"        => 0,
                "requiredVisible" => 0,
                "readonly"        => 1,
            ],
            [
                "type"            => "singleLine",
                "fieldID"         => "last_activity",
                "tabID"           => trans('HCACL::users.activity'),
                "label"           => trans("HCACL::users.last_activity"),
                "required"        => 0,
                "requiredVisible" => 0,
                "readonly"        => 1,
            ],
            [
                "type"            => "singleLine",
                "fieldID"         => "activated_at",
                "tabID"           => trans('HCACL::users.activity'),
                "label"           => trans("HCACL::users.activation.activated_at"),
                "required"        => 0,
                "requiredVisible" => 0,
                "readonly"        => 1,
            ],
        ]);

        return $form;
    }