mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Implement CONTACTEMAIL and CONTACTPAGER macros.
This commit is contained in:
parent
c194ad1ca3
commit
b94f1603bb
@ -128,10 +128,19 @@ bool User::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res
|
|||||||
*result = GetDisplayName();
|
*result = GetDisplayName();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
String tmacro;
|
||||||
|
|
||||||
|
if (macro == "CONTACTEMAIL")
|
||||||
|
tmacro = "email";
|
||||||
|
else if (macro == "CONTACTPAGER")
|
||||||
|
tmacro = "pager";
|
||||||
|
else
|
||||||
|
tmacro = macro;
|
||||||
|
|
||||||
Dictionary::Ptr macros = GetMacros();
|
Dictionary::Ptr macros = GetMacros();
|
||||||
|
|
||||||
if (macros && macros->Contains(macro)) {
|
if (macros && macros->Contains(tmacro)) {
|
||||||
*result = macros->Get(macro);
|
*result = macros->Get(tmacro);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user