We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fecb65 commit 269560fCopy full SHA for 269560f
src/LdapAuth.php
@@ -92,11 +92,11 @@ public function autoDetect($overrideIp = false)
92
return 0;
93
}
94
95
- $clientIp = $overrideIp ? $overrideIp : (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null));
+ $clientIp = $overrideIp ? $overrideIp : Yii::$app->request->getUserIP();
96
97
if (empty($clientIp)) {
98
Yii::debug('[Autodetect] No client ip detected, skipping auto detection', __METHOD__);
99
- return 0;
+ return false;
100
101
102
$index = 0;
0 commit comments