ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMailLoginOrEmailAddressAddressType Class Reference

Class ilMailLoginOrEmailAddressAddressType. More...

+ Inheritance diagram for ilMailLoginOrEmailAddressAddressType:
+ Collaboration diagram for ilMailLoginOrEmailAddressAddressType:

Public Member Functions

 resolve ()
 {Returns an array of resolved user ids.
Returns
int[]
} More...
 
- Public Member Functions inherited from ilBaseMailAddressType
 __construct (ilMailAddress $a_address)
 ilBaseMailAddressType constructor. More...
 
 validate ($a_sender_id)
 {
Parameters
$a_sender_idinteger
Returns
bool
} More...
 
 getErrors ()
 
 resolve ()
 Returns an array of resolved user ids. More...
 
 validate ($a_sender_id)
 

Additional Inherited Members

- Protected Member Functions inherited from ilBaseMailAddressType
 init ()
 
 isValid ($a_sender_id)
 
- Protected Attributes inherited from ilBaseMailAddressType
 $address
 
 $errors = array()
 

Detailed Description

Member Function Documentation

◆ resolve()

ilMailLoginOrEmailAddressAddressType::resolve ( )

{Returns an array of resolved user ids.

Returns
int[]
}

Implements ilMailAddressType.

Definition at line 48 of file class.ilMailLoginOrEmailAddressAddressType.php.

49 {
50 if($this->address->getHost() == ilMail::ILIAS_HOST)
51 {
52 $address = $this->address->getMailbox();
53
54 }
55 else
56 {
57 $address = $this->address->getMailbox() . '@'. $this->address->getHost();
58 }
59
60 $usr_ids = array_filter(array(ilObjUser::getUserIdByLogin($address)));
61
62 if(count($usr_ids) > 0)
63 {
65 "Found the following user ids for address (login) '%s': %s", $address, implode(', ', array_unique($usr_ids))
66 ));
67 }
68 else if(strlen($address) > 0)
69 {
71 "Did not find any user account for address (login) '%s'", $address
72 ));
73 }
74
75 return $usr_ids;
76 }
sprintf('%.4f', $callTime)
static getLogger($a_component_id)
Get component logger.
const ILIAS_HOST
static getUserIdByLogin($a_login)

References ilBaseMailAddressType\$address, ilLoggerFactory\getLogger(), ilObjUser\getUserIdByLogin(), ilMail\ILIAS_HOST, and sprintf.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: