Skip to content
Snippets Groups Projects
Commit 2ae1eb77 authored by Florian Schaal's avatar Florian Schaal
Browse files

allow empty remote-list - validate_remote_user.inc.php

parent d6ac29b6
No related branches found
No related tags found
1 merge request!683Option to limit access for remote-user to specified IP(s) / hostname(s) (#4881)
...@@ -33,6 +33,8 @@ class validate_remote_user { ...@@ -33,6 +33,8 @@ class validate_remote_user {
function valid_remote_ip($field_name, $field_value, $validator) { function valid_remote_ip($field_name, $field_value, $validator) {
global $app; global $app;
if(trim($field_value) == '') return;
$values = explode(',', $field_value); $values = explode(',', $field_value);
$regex = '/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/'; $regex = '/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/';
foreach($values as $cur_value) { foreach($values as $cur_value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment