renamed variable $currentUser$ to $user:local_name$

updated docs, too
This commit is contained in:
Oliver Rahner 2019-06-03 23:56:21 +02:00 committed by GitHub
parent 967a0bf74e
commit 6ad74ef1cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -216,13 +216,13 @@ results of this query instead:
#### Username placeholder <a id="username-placeholder"></a>
The string `$currentUser` is replaced by the local username (without the domain part) of the logged on user while evaluating restrictions.
The string `$user:local_name$` is replaced by the local username (without the domain part) of the logged on user while evaluating restrictions.
This can come in handy if you have some kind of attribute on host or service level defining which user is responsible for a certain host or service.
#### Example <a id="username-placeholder-example"> </a>:
**Example**
```
monitoring/filter/objects = (__responsible=$currentUser$|__deputy=$currentUser$)
monitoring/filter/objects = (_responsible=$user:local_name$|_deputy=$user:local_name$)
```
#### Stacking Filters <a id="stacking-filters"></a>

View File

@ -253,7 +253,7 @@ class User
public function setRestrictions(array $restrictions)
{
foreach ($restrictions as $name => $restriction) {
$restrictions[$name] = str_replace('$currentUser$', $this->getLocalUsername(), $restriction);
$restrictions[$name] = str_replace('$user:local_name$', $this->getLocalUsername(), $restriction);
}
$this->restrictions = $restrictions;