File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -335,17 +335,28 @@ public function tpl_defaults() {
335335
336336 private function get_cookie_domain () {
337337 $ proxy_panel_allowed = $ this ->getconf ->get_security_config ('permissions ' )['reverse_proxy_panel_allowed ' ];
338+ if ($ proxy_panel_allowed == 'all ' ) {
339+ return '' ;
340+ }
338341 $ cookie_domain = (isset ($ _SERVER ['SERVER_NAME ' ]) ? $ _SERVER ['SERVER_NAME ' ] : $ _SERVER ['HTTP_HOST ' ]);
339342 // Workaround for Nginx servers
340343 if ($ cookie_domain == '_ ' ) {
341344 $ tmp = explode (': ' ,$ _SERVER ["HTTP_HOST " ]);
342345 $ cookie_domain = $ tmp [0 ];
343346 unset($ tmp );
344347 }
345- $ this ->log ("Server: " .print_r ($ _SERVER ,true ));
346- if ($ proxy_panel_allowed == 'all ' ) {
347- return '' ;
348+ if ($ proxy_panel_allowed == 'sites ' ) {
349+ $ forwarded_host = (isset ($ _SERVER ['HTTP_X_FORWARDED_HOST ' ]) ? $ _SERVER ['HTTP_X_FORWARDED_HOST ' ] : null );
350+ if ($ forwarded_host !== null && $ forwarded_host !== $ cookie_domain ) {
351+ $ sql = "SELECT domain_id from web_domain where domain = ' $ forwarded_host' " ;
352+ $ recs = $ this ->db ->queryOneRecord ($ sql );
353+ if ($ recs !== null ) {
354+ $ cookie_domain = $ forwarded_host ;
355+ }
356+ unset($ forwarded_host );
357+ }
348358 }
359+
349360 return $ cookie_domain ;
350361 }
351362
You can’t perform that action at this time.
0 commit comments