@@ -144,17 +144,19 @@ public function login($username, $password, $client_login = false)
144144 $ sql = "SELECT * FROM remote_user WHERE remote_username = ? and remote_password = md5(?) " ;
145145 $ remote_user = $ app ->db ->queryOneRecord ($ sql , $ username , $ password );
146146 if ($ remote_user ['remote_userid ' ] > 0 ) {
147- $ allowed_ips = explode (', ' ,$ remote_user ['remote_ips ' ]);
148- foreach ($ allowed_ips as $ i => $ allowed ) {
149- if (!filter_var ($ allowed , FILTER_VALIDATE_IP )) {
150- // get the ip for a hostname
151- unset($ allowed_ips [$ i ]);
152- $ temp =dns_get_record ($ allowed , DNS_A +DNS_AAAA );
153- foreach ($ temp as $ t ) {
154- if (isset ($ t ['ip ' ])) $ allowed_ips [] = $ t ['ip ' ];
155- if (isset ($ t ['ipv6 ' ])) $ allowed_ips [] = $ t ['ipv6 ' ];
147+ if (trim ($ remote_user ['remote_ips ' ]) != '' ) {
148+ $ allowed_ips = explode (', ' ,$ remote_user ['remote_ips ' ]);
149+ foreach ($ allowed_ips as $ i => $ allowed ) {
150+ if (!filter_var ($ allowed , FILTER_VALIDATE_IP )) {
151+ // get the ip for a hostname
152+ unset($ allowed_ips [$ i ]);
153+ $ temp =dns_get_record ($ allowed , DNS_A +DNS_AAAA );
154+ foreach ($ temp as $ t ) {
155+ if (isset ($ t ['ip ' ])) $ allowed_ips [] = $ t ['ip ' ];
156+ if (isset ($ t ['ipv6 ' ])) $ allowed_ips [] = $ t ['ipv6 ' ];
157+ }
158+ unset($ temp );
156159 }
157- unset($ temp );
158160 }
159161 }
160162 $ allowed_ips [] = '127.0.0.1 ' ;
0 commit comments