Commit 72c1d5d3 authored by Till Brehm's avatar Till Brehm

Fixed: #4676 auth.log shows 0.0.0.0 as IP for IPv6

parent e313d006
......@@ -63,7 +63,7 @@ if(count($_POST) > 0) {
if(!preg_match("/^.{1,256}$/i", $_POST['password'])) $error = $app->lng('pw_error_length');
//** importing variables
$ip = ip2long($_SERVER['REMOTE_ADDR']);
$ip = md5($_SERVER['REMOTE_ADDR']);
$username = $_POST['username'];
$password = $_POST['password'];
$loginAs = false;
......@@ -262,7 +262,7 @@ if(count($_POST) > 0) {
$app->plugin->raiseEvent('login', $username);
//* Save successfull login message to var
$authlog = 'Successful login for user \''. $username .'\' from '. long2ip($ip) .' at '. date('Y-m-d H:i:s');
$authlog = 'Successful login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s');
$authlog_handle = fopen($conf['ispconfig_log_dir'].'/auth.log', 'a');
fwrite($authlog_handle, $authlog ."\n");
fclose($authlog_handle);
......@@ -300,7 +300,7 @@ if(count($_POST) > 0) {
$app->plugin->raiseEvent('login_failed', $username);
//* Save failed login message to var
$authlog = 'Failed login for user \''. $username .'\' from '. long2ip($ip) .' at '. date('Y-m-d H:i:s');
$authlog = 'Failed login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s');
$authlog_handle = fopen($conf['ispconfig_log_dir'].'/auth.log', 'a');
fwrite($authlog_handle, $authlog ."\n");
fclose($authlog_handle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment