ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMailOnlyExternalAddressList.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
9 {
11  protected $origin;
12 
14  protected $installationHost;
15 
22  {
23  $this->origin = $origin;
24  $this->installationHost = $installationHost;
25  }
26 
30  public function value() : array
31  {
32  $addresses = $this->origin->value();
33 
34  $filteredAddresses = array_filter($addresses, function (\ilMailAddress $address) {
35  if (\ilObjUser::_lookupId((string) $address)) {
36  // Fixed mantis bug #5875
37  return false;
38  }
39 
40  if ($address->getHost() === $this->installationHost) {
41  return false;
42  }
43 
44  if ('#' === substr($address->getMailbox(), 0, 1)) {
45  return false;
46  }
47 
48  return true;
49  });
50 
51  return $filteredAddresses;
52  }
53 }
static _lookupId($a_user_str)
Lookup id by login.
Class ilMailOnlyExternalAddressList.
Interface ilMailAddressList.
__construct(\ilMailAddressList $origin, string $installationHost)
ilMailOnlyExternalAddressList constructor.
Class ilMailAddress.