mirror of https://github.com/Icinga/icinga2.git
Change user attribute macros to $USER...$
but keep the $CONTACT...$ still supported for compatibility. fixes #4792
This commit is contained in:
parent
d97d2e399d
commit
972a4f8b9a
|
@ -135,10 +135,10 @@ users:
|
|||
|
||||
Name | Description
|
||||
-----------------------|--------------
|
||||
CONTACTNAME | The name of the user object.
|
||||
CONTACTALIAS | The value of the display_name attribute.
|
||||
CONTACTEMAIL | This is an alias for the *email* macro.
|
||||
CONTACTPAGER | This is an alias for the *pager* macro.
|
||||
USERNAME | The name of the user object.
|
||||
USERDISPLAYNAME | The value of the display_name attribute.
|
||||
USEREMAIL | This is an alias for the *email* macro.
|
||||
USERPAGER | This is an alias for the *pager* macro.
|
||||
|
||||
### Global Macros
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ Example:
|
|||
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
||||
command = [
|
||||
"/opt/bin/send-mail-notification",
|
||||
"$CONTACTEMAIL$",
|
||||
"$USEREMAIL$",
|
||||
"$NOTIFICATIONTYPE$ - $HOSTNAME$ - $SERVICEDESC$ - $SERVICESTATE$",
|
||||
{{{***** Icinga *****
|
||||
|
||||
|
|
|
@ -126,18 +126,18 @@ double User::GetLastNotification(void) const
|
|||
|
||||
bool User::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *result) const
|
||||
{
|
||||
if (macro == "CONTACTNAME") {
|
||||
if (macro == "USERNAME" || macro == "CONTACTNAME") {
|
||||
*result = GetName();
|
||||
return true;
|
||||
} else if (macro == "CONTACTALIAS") {
|
||||
} else if (macro == "USERDISPLAYNAME" || macro == "CONTACTALIAS") {
|
||||
*result = GetDisplayName();
|
||||
return true;
|
||||
} else {
|
||||
String tmacro;
|
||||
|
||||
if (macro == "CONTACTEMAIL")
|
||||
if (macro == "USEREMAIL" || macro == "CONTACTEMAIL")
|
||||
tmacro = "email";
|
||||
else if (macro == "CONTACTPAGER")
|
||||
else if (macro == "USERPAGER" || macro == "CONTACTPAGER")
|
||||
tmacro = "pager";
|
||||
else
|
||||
tmacro = macro;
|
||||
|
|
Loading…
Reference in New Issue