52 public function __construct($messageFormat =
"", $userInfoFormat =
"")
55 $this->messageFormat = $messageFormat;
60 $this->userInfoFormat = $userInfoFormat;
64 $this->isUserInfoNeeded = mb_strpos($messageFormat, self::USER_INFO) !==
false;
65 $this->isB64MessageNeeded = mb_strpos($messageFormat, self::VARIABLE_VALUE_BASE64) !==
false;
69 $this->siteId = defined(
'SITE_ID') ?
SITE_ID :
false;
72 $this->userInfo = $this->getUserInfo();
73 $this->url = preg_replace(
"/(&?sessid=[0-9a-z]+)/",
"",
$_SERVER[
"REQUEST_URI"]);
120 public function format($auditType, $itemName, $itemDescription)
124 $replacement =
array(
125 self::AUDIT_TYPE => $auditType,
126 self::SITE_ID => $this->siteId,
127 self::USER_INFO => $this->userInfo,
128 self::URL => $this->url,
129 self::VARIABLE_NAME => $itemName,
133 if ($this->isB64MessageNeeded)
134 $replacement[self::VARIABLE_VALUE_BASE64] = base64_encode(
$description);
136 if (defined(
"BX24_HOST_NAME"))
137 $replacement[self::BX24_HOST] = BX24_HOST_NAME;
140 array_keys($replacement),