ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMailOnlyExternalAddressList.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
9 {
11  protected $origin;
12 
14  protected $installationHost;
15 
18 
25  public function __construct(
27  string $installationHost,
29  ) {
30  $this->origin = $origin;
31  $this->installationHost = $installationHost;
32  $this->getUsrIdByLoginCallable = $getUsrIdByLoginCallable;
33  }
34 
38  public function value() : array
39  {
40  $addresses = $this->origin->value();
41 
42  $filteredAddresses = array_filter($addresses, function (ilMailAddress $address) {
44  if ($c((string) $address)) {
45  // Fixed mantis bug #5875
46  return false;
47  }
48 
49  if ($address->getHost() === $this->installationHost) {
50  return false;
51  }
52 
53  if ('#' === substr($address->getMailbox(), 0, 1)) {
54  return false;
55  }
56 
57  return true;
58  });
59 
60  return $filteredAddresses;
61  }
62 }
Class ilMailOnlyExternalAddressList.
Interface ilMailAddressList.
__construct(ilMailAddressList $origin, string $installationHost, callable $getUsrIdByLoginCallable)
ilMailOnlyExternalAddressList constructor.
Class ilMailAddress.