PHP Class IMP_Prefs_Identity, horde

Author: Jan Schneider ([email protected])
Author: Chuck Hagenbuch ([email protected])
Inheritance: extends Horde_Core_Prefs_Identity
显示文件 Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_cached array Cached data.
$_impPrefs array Identity preferences added by IMP.

Public Methods

Method Description
__construct ( $params ) Reads all the user's identities from the prefs object or builds a new identity from the standard values given in prefs.php.
getAliasAddress ( integer $ident = null ) : Horde_Mail_Rfc822_List Returns all aliases based on the chosen identity.
getAllFromAddresses ( ) : Horde_Mail_Rfc822_List Returns all identities' From addresses.
getAllIdentityAddresses ( ) : Horde_Mail_Rfc822_List Returns a list of all e-mail addresses from all identities, including both from addresses and tie addreses.
getAllSentmail ( boolean $unique = true ) : array Returns an array with the sent-mail mailboxes from all identities.
getAllSignatures ( string $type = 'text' ) : array Returns an array with the signatures from all identities
getAllTieAddresses ( ) : Horde_Mail_Rfc822_List Get all 'tie to' address/identity pairs.
getBccAddresses ( integer $ident = null ) : Horde_Mail_Rfc822_List Returns the BCC addresses for a given identity.
getFromAddress ( integer $ident = null ) : Horde_Mail_Rfc822_Address Returns the from address based on the chosen identity. If no address can be found it is built from the current user name and the specified maildomain.
getFromAddresses ( integer $ident = null ) : Horde_Mail_Rfc822_List Returns all From addresses for one identity.
getFromLine ( integer $ident = null, string $from_address = '' ) : Horde_Mail_Rfc822_Address Returns a complete From: header based on all relevant factors (fullname, from address, input fields, locks etc.)
getFullname ( integer $ident = null ) : string Returns the user's full name.
getMatchingIdentity ( mixed $addresses, boolean $search_own = true ) : integer Returns the identity's id that matches the passed addresses.
getSelectList ( ) : array Returns an array with the necessary values for the identity select box in the IMP compose window.
getSignature ( string $type = 'text', integer $ident = null ) : string Returns the full signature based on the current settings for the signature itself, the dashes and the position.
getTieAddresses ( integer $ident = null ) : Horde_Mail_Rfc822_List Get tie-to addresses.
getValue ( $key, $identity = null ) Returns a property from one of the identities.
hasAddress ( mixed $address ) : boolean Returns true if the given address belongs to one of the identities.
hasSignature ( boolean $compose_page = false ) : boolean Does the user have any signatures (either text or HTML)?
save ( )
saveSentmail ( integer $ident = null ) : boolean Returns true if the mail should be saved and the user is allowed to.
setValue ( $key, $val, $identity = null ) Sets a property with a specified value.
verify ( integer $identity = null ) Verifies and sanitizes all identity properties.

Protected Methods

Method Description
_identitiesWithDefaultFirst ( ) : array Returns the list of identities with the default identity positioned first.

Method Details

__construct() public method

Reads all the user's identities from the prefs object or builds a new identity from the standard values given in prefs.php.
See also: __construct()
public __construct ( $params )

_identitiesWithDefaultFirst() protected method

Returns the list of identities with the default identity positioned first.
protected _identitiesWithDefaultFirst ( ) : array
return array The identity keys with the default identity first.

getAliasAddress() public method

Returns all aliases based on the chosen identity.
public getAliasAddress ( integer $ident = null ) : Horde_Mail_Rfc822_List
$ident integer The identity to retrieve the aliases from.
return Horde_Mail_Rfc822_List Aliases for the identity.

getAllFromAddresses() public method

Returns all identities' From addresses.
public getAllFromAddresses ( ) : Horde_Mail_Rfc822_List
return Horde_Mail_Rfc822_List Address list.

getAllIdentityAddresses() public method

Returns a list of all e-mail addresses from all identities, including both from addresses and tie addreses.
public getAllIdentityAddresses ( ) : Horde_Mail_Rfc822_List
return Horde_Mail_Rfc822_List A list of e-mail addresses.

getAllSentmail() public method

Returns an array with the sent-mail mailboxes from all identities.
public getAllSentmail ( boolean $unique = true ) : array
$unique boolean If true, return the unique list of sent-mail mailboxes. If false, returns list of sent-mail mailboxes, with the key corresponding to the identity.
return array The array with the sent-mail IMP_Mailbox objects.

getAllSignatures() public method

Returns an array with the signatures from all identities
public getAllSignatures ( string $type = 'text' ) : array
$type string Either 'text' or 'html'.
return array The array with all the signatures.

getAllTieAddresses() public method

Get all 'tie to' address/identity pairs.
public getAllTieAddresses ( ) : Horde_Mail_Rfc822_List
return Horde_Mail_Rfc822_List A list of e-mail addresses.

getBccAddresses() public method

Returns the BCC addresses for a given identity.
public getBccAddresses ( integer $ident = null ) : Horde_Mail_Rfc822_List
$ident integer The identity to retrieve the Bcc addresses from.
return Horde_Mail_Rfc822_List BCC addresses.

getFromAddress() public method

Returns the from address based on the chosen identity. If no address can be found it is built from the current user name and the specified maildomain.
public getFromAddress ( integer $ident = null ) : Horde_Mail_Rfc822_Address
$ident integer The identity to retrieve the address from.
return Horde_Mail_Rfc822_Address A valid from address.

getFromAddresses() public method

Returns all From addresses for one identity.
public getFromAddresses ( integer $ident = null ) : Horde_Mail_Rfc822_List
$ident integer The identity to retrieve the from addresses from.
return Horde_Mail_Rfc822_List Address list.

getFromLine() public method

Returns a complete From: header based on all relevant factors (fullname, from address, input fields, locks etc.)
public getFromLine ( integer $ident = null, string $from_address = '' ) : Horde_Mail_Rfc822_Address
$ident integer The identity to retrieve the values from.
$from_address string A default from address to use if no identity is selected and the from_addr preference is locked.
return Horde_Mail_Rfc822_Address The address to use for From header.

getFullname() public method

Returns the user's full name.
public getFullname ( integer $ident = null ) : string
$ident integer The identity to retrieve the name from.
return string The user's full name.

getMatchingIdentity() public method

Returns the identity's id that matches the passed addresses.
public getMatchingIdentity ( mixed $addresses, boolean $search_own = true ) : integer
$addresses mixed Either an array or a single string or a comma-separated list of email addresses.
$search_own boolean Search for a matching identity in own addresses also?
return integer The id of the first identity that from or alias addresses match (one of) the passed addresses or null if none matches.

getSelectList() public method

Returns an array with the necessary values for the identity select box in the IMP compose window.
public getSelectList ( ) : array
return array The array with the necessary strings

getSignature() public method

Returns the full signature based on the current settings for the signature itself, the dashes and the position.
public getSignature ( string $type = 'text', integer $ident = null ) : string
$type string Either 'text' or 'html'.
$ident integer The identity to retrieve the signature from.
return string The full signature.

getTieAddresses() public method

Get tie-to addresses.
public getTieAddresses ( integer $ident = null ) : Horde_Mail_Rfc822_List
$ident integer The identity to retrieve the tie-to addresses from.
return Horde_Mail_Rfc822_List A list of tie-to e-mail addresses.

getValue() public method

Returns a property from one of the identities.
See also: getValue()
public getValue ( $key, $identity = null )

hasAddress() public method

This function will search aliases for an identity automatically.
public hasAddress ( mixed $address ) : boolean
$address mixed The address(es) to search for in the identities.
return boolean True if the address was found.

hasSignature() public method

Does the user have any signatures (either text or HTML)?
public hasSignature ( boolean $compose_page = false ) : boolean
$compose_page boolean If true, checks for signatures as used on the compose pages.
return boolean True if the user has at least one signature.

save() public method

public save ( )

saveSentmail() public method

Returns true if the mail should be saved and the user is allowed to.
public saveSentmail ( integer $ident = null ) : boolean
$ident integer The identity to retrieve the setting from.
return boolean True if the sent mail should be saved.

setValue() public method

Sets a property with a specified value.
See also: setValue()
public setValue ( $key, $val, $identity = null )

verify() public method

Verifies and sanitizes all identity properties.
public verify ( integer $identity = null )
$identity integer The identity to verify.

Property Details

$_cached protected_oe property

Cached data.
protected array $_cached
return array

$_impPrefs protected_oe property

Identity preferences added by IMP.
protected array $_impPrefs
return array