---
title: "Login-Form invisible when IP-rage is wrong//No login-process possible from wrong IP"
url: "https://www.typo3.net/d/125702-login-form-invisible-when-ip-rage-is-wrongno-login-process-possible-from-wrong-ip"
source: "typo3.net"
tags: ["TYPO3","Frontend","English","Frage","TYPO3 7","felogin"]
created: "2017-02-11"
last_reply: "2017-02-21"
replies: 1
solved: false
page: 1
pages: 1
lang: "en"
---

# Login-Form invisible when IP-rage is wrong//No login-process possible from wrong IP

TYPO3 › Frontend · 1 Antwort · gestartet 2017-02-11

## Eröffnungsbeitrag

**hansiglue** · 2017-02-11 · [Beitrag #1](https://www.typo3.net/d/125702-login-form-invisible-when-ip-rage-is-wrongno-login-process-possible-from-wrong-ip/1)

I work with typo3 7.6 LTS and some extensions do not work any more. On some pages I have a FE-Login-Form to login to some pages to be seen after fe-login.

Now, I would like to restrict the login process to a certain IP-range from which it is initiated. The deprecated extension helped to realize this by not displaying the login-content-element in the frontend when the page had been called from the wrong ip-range. Being called from the right IP-range the login-form will be displayed and the login-process maybe initiated.

After some hours looking and trying nonsense I got a shabby solution. I add a template expansion on the page where the login-form should be displayed/not-displayed. And this code:

```typoscript
[IP = *.*.*.*]
plugin.tx_felogin_pi1._CSS_DEFAULT_STYLE (
    .tx-felogin-pi1  form, input {
        display: none;
    }
)
[end]

[IP = x.y.*.*]
plugin.tx_felogin_pi1._CSS_DEFAULT_STYLE (
    .tx-felogin-pi1  form, input {
        display: block;
    }
)
[end]
```

This works for the html-code of the form-tag. It is simply turned off by css. Shabby!

Does anybody have an idea more elegant?

## Antworten

### [#2](https://www.typo3.net/d/125702-login-form-invisible-when-ip-rage-is-wrongno-login-process-possible-from-wrong-ip/2) · Julian.​Hofmann · 2017-02-21

Have you tried using the if-function together with gettext?
<https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Data.html#confval-data-getindpenv>

Not tested:

```typoscript
page.123 = COA
page.123 {
  if.value = 192.168.1.1
  if.equals.data = getIndpEnv : REMOTE_ADDR
  10 < plugin.tx_felogin
}
```

---

Quelle: „Login-Form invisible when IP-rage is wrong//No login-process possible from wrong IP“, typo3.net, https://www.typo3.net/d/125702-login-form-invisible-when-ip-rage-is-wrongno-login-process-possible-from-wrong-ip
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
