summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-11-27 06:24:42 -0500
committerAleksander Machniak <alec@alec.pl>2014-11-27 06:24:42 -0500
commit692011df7fbba1c096802922da99a6c8a883d556 (patch)
tree7da6745eadce1448b2e4ad91149aa60f89e67519 /program/lib
parent32eb977b1268ce1e32ab652af6059f49ce59c2f5 (diff)
Extend list_emails() to optionally return only default identity
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Roundcube/rcube_user.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php
index 68156b157..77c58dd14 100644
--- a/program/lib/Roundcube/rcube_user.php
+++ b/program/lib/Roundcube/rcube_user.php
@@ -240,9 +240,11 @@ class rcube_user
/**
* Return a list of all user emails (from identities)
*
+ * @param bool Return only default identity
+ *
* @return array List of emails (identity_id, name, email)
*/
- function list_emails()
+ function list_emails($default = false)
{
if ($this->emails === null) {
$this->emails = array();
@@ -259,7 +261,7 @@ class rcube_user
}
}
- return $this->emails;
+ return $default ? $this->emails[0] : $this->emails;
}
/**