summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-02-27 14:37:32 +0100
committerJoas Schilling <coding@schilljs.com>2018-02-27 14:37:32 +0100
commitf81d4eb060ea15c0c753d094b65eaa2c8c9315a5 (patch)
tree8d0f494efe078639bdc49872c9b58087a5a246a8 /apps/workflowengine/lib
parent640db3d5fed6ca6d274d64842100fa7216ae1d67 (diff)
downloadnextcloud-server-f81d4eb060ea15c0c753d094b65eaa2c8c9315a5.tar.gz
nextcloud-server-f81d4eb060ea15c0c753d094b65eaa2c8c9315a5.zip
Make the Outlook and Thunderbird addons identifyable
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r--apps/workflowengine/lib/Check/RequestUserAgent.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/workflowengine/lib/Check/RequestUserAgent.php b/apps/workflowengine/lib/Check/RequestUserAgent.php
index 7a8d4a71acf..4191a2f3412 100644
--- a/apps/workflowengine/lib/Check/RequestUserAgent.php
+++ b/apps/workflowengine/lib/Check/RequestUserAgent.php
@@ -44,9 +44,9 @@ class RequestUserAgent extends AbstractStringCheck {
* @param string $value
* @return bool
*/
- public function executeCheck($operator, $value) {
+ public function executeCheck($operator, $value) {
$actualValue = $this->getActualValue();
- if (in_array($operator, ['is', '!is'])) {
+ if (in_array($operator, ['is', '!is'], true)) {
switch ($value) {
case 'android':
$operator = $operator === 'is' ? 'matches' : '!matches';
@@ -60,6 +60,14 @@ class RequestUserAgent extends AbstractStringCheck {
$operator = $operator === 'is' ? 'matches' : '!matches';
$value = IRequest::USER_AGENT_CLIENT_DESKTOP;
break;
+ case 'mail':
+ if ($operator === 'is') {
+ return $this->executeStringCheck('matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue)
+ || $this->executeStringCheck('matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue);
+ }
+
+ return $this->executeStringCheck('!matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue)
+ && $this->executeStringCheck('!matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue);
}
}
return $this->executeStringCheck($operator, $value, $actualValue);