Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation: SERVER_ADDR verwenden statt REMOTE_ADDR #109

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/* Eigene IP-Adresse in die erlaubten IP-Adressen hinzufügen, sofern nicht bereits vorhanden */
$allowed_ips = strval($addon->getConfig('allowed_ips')); // @phpstan-ignore-line
$allowed_ips = array_filter(explode(',', $allowed_ips)); // Leere Elemente entfernen
$ip = rex_server('REMOTE_ADDR', 'string', '');
$ip = rex_server('SERVER_ADDR', 'string', '');

if (!in_array($ip, $allowed_ips, true)) {
$allowed_ips[] = $ip;
Expand Down
2 changes: 1 addition & 1 deletion lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ maintenance_announcement_end_date_notice = Datum, bis wann die Ankündigung geze
maintenance_allowed_access_title = Ausnahmen

maintenance_allowed_ips_label = Liste erlaubter IP-Adressen
maintenance_allowed_ips_notice = IP-Adresse(n) ein, die weiterhin Zugriff auf das Frontend haben soll(en). Die aktuelle IP-Adresse lautet <code>{0}</code>.
maintenance_allowed_ips_notice = IP-Adresse(n) ein, die weiterhin Zugriff auf das Frontend haben soll(en). Deine aktuelle IP-Adresse lautet <code>{0}</code>, die des Servers lautet <code>{1}</code>.

maintenance_allowed_domains_label = Liste erlaubter Domains
maintenance_allowed_domains_notice = Domains eintragen, die nicht gesperrt werden sollen.
Expand Down
2 changes: 1 addition & 1 deletion lang/el_gr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ maintenance_announcement_end_date_notice = Η ημερομηνία που η α
maintenance_allowed_access_title = Εξαιρέσεις

maintenance_allowed_ips_label = Λίστα επιτρεπόμενων διευθύνσεων IP
maintenance_allowed_ips_notice = Εισάγετε την(τις) διεύθυνση(εις) IP που θα συνεχίσουν να έχουν πρόσβαση στο frontend. Η τρέχουσα διεύθυνση IP σας: <code>{0}</code>.
maintenance_allowed_ips_notice = Εισάγετε την(τις) διεύθυνση(εις) IP που θα συνεχίσουν να έχουν πρόσβαση στο frontend. Η τρέχουσα διεύθυνση IP σας: <code>{0}</code>

maintenance_allowed_domains_label = Λίστα επιτρεπόμενων τομέων
maintenance_allowed_domains_notice = Εισάγετε τους τομείς που δεν θα αποκλειστούν.
Expand Down
2 changes: 1 addition & 1 deletion lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ maintenance_announcement_end_date_notice = Date until when the announcement shou
maintenance_allowed_access_title = Exceptions

maintenance_allowed_ips_label = List of allowed IP addresses
maintenance_allowed_ips_notice = Enter IP address(es) that should still have access to the frontend. The current IP address is <code>{0}</code>.
maintenance_allowed_ips_notice = Enter IP address(es) that should still have access to the frontend. The current IP address is <code>{0}</code>, the IP address of the server is <code>{1}</code>.

maintenance_allowed_domains_label = List of allowed domains
maintenance_allowed_domains_notice = Enter domains that should not be blocked.
Expand Down
2 changes: 1 addition & 1 deletion pages/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
// Erlaubte IP-Adressen
$field = $form->addTextField('allowed_ips');
$field->setLabel($addon->i18n('maintenance_allowed_ips_label'));
$field->setNotice($addon->i18n('maintenance_allowed_ips_notice', \rex_server('REMOTE_ADDR', 'string', '')));
$field->setNotice($addon->i18n('maintenance_allowed_ips_notice', \rex_server('REMOTE_ADDR', 'string', ''), \rex_server('SERVER_ADDR', 'string', '')));

Check warning on line 68 in pages/frontend.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined function

Undefined function 'rex_server'
$field->setAttribute('class', 'form-control');
$field->setAttribute('data-maintenance', 'tokenfield');
$field->setAttribute('data-beautify', 'false');
Expand Down
Loading