Commit 9479c0d1 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #647 in ZP/z-push from...

Merge pull request #647 in ZP/z-push from bugfix/ZP-1353-check-user-vs-authuser-case-insensitive-for-log to develop

* commit 'aa17e60b':
  ZP-1353 Check user vs authUser case-insensitive for log.
parents 736493bb aa17e60b
......@@ -86,11 +86,11 @@ class FileLog extends Log {
if ($includeUserDevice) {
// when the users differ, we need to log both
if ($this->GetUser() != $this->GetAuthUser()) {
$log .= ' ['. $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() .']';
if (strcasecmp($this->GetAuthUser(), $this->GetUser()) == 0) {
$log .= ' ['. $this->GetUser() .']';
}
else {
$log .= ' ['. $this->GetUser() .']';
$log .= ' ['. $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() .']';
}
}
if ($includeUserDevice && (LOGLEVEL >= LOGLEVEL_DEVICEID || (LOGUSERLEVEL >= LOGLEVEL_DEVICEID && $this->IsAuthUserInSpecialLogUsers()))) {
......
......@@ -167,11 +167,11 @@ class Syslog extends Log {
public function BuildLogString($loglevel, $message, $includeUserDevice = true) {
$log = $this->GetLogLevelString($loglevel); // Never pad syslog log because syslog log are usually read with a software.
// when the users differ, we need to log both
if ($this->GetUser() != $this->GetAuthUser()) {
$log .= ' ['. $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() .']';
if (strcasecmp($this->GetAuthUser(), $this->GetUser()) == 0) {
$log .= ' ['. $this->GetUser() .']';
}
else {
$log .= ' ['. $this->GetUser() .']';
$log .= ' ['. $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() .']';
}
if ($loglevel >= LOGLEVEL_DEVICEID) {
$log .= '['. $this->GetDevid() .']';
......
......@@ -60,7 +60,7 @@ abstract class RequestProcessor {
if(defined("CERTIFICATE_OWNER_PARAMETER") && isset($_SERVER[CERTIFICATE_OWNER_PARAMETER]) && strtolower($_SERVER[CERTIFICATE_OWNER_PARAMETER]) != strtolower(Request::GetAuthUser()))
throw new AuthenticationRequiredException(sprintf("Access denied. Access is allowed only for the certificate owner '%s'", $_SERVER[CERTIFICATE_OWNER_PARAMETER]));
if (Request::GetImpersonatedUser() && Request::GetAuthUser() != Request::GetImpersonatedUser()) {
if (Request::GetImpersonatedUser() && strcasecmp(Request::GetAuthUser(), Request::GetImpersonatedUser()) !== 0) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("RequestProcessor->Authenticate(): Impersonation active - authenticating: '%s' - impersonating '%s'", Request::GetAuthUser(), Request::GetImpersonatedUser()));
}
......
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