diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-04-06 06:40:45 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-04-06 06:40:45 +0000 |
| commit | bfd8962bb0984cb350206c773ea57d274042ba5f (patch) | |
| tree | a5f8863e0ceab03079ce32e3ec4b20ec17a27042 /roundcubemail/program/steps | |
| parent | f94d2e0ac707df0d5bc452925c6bdba94b799ab5 (diff) | |
Configurable limit of address group members
git-svn-id: https://svn.roundcube.net/trunk@3470 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
| -rw-r--r-- | roundcubemail/program/steps/addressbook/groups.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/addressbook/groups.inc b/roundcubemail/program/steps/addressbook/groups.inc index df44703a9..eda258c6e 100644 --- a/roundcubemail/program/steps/addressbook/groups.inc +++ b/roundcubemail/program/steps/addressbook/groups.inc @@ -31,7 +31,12 @@ if ($RCMAIL->action == 'group-addmembers') { if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) { $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source)); - if (!$plugin['abort'] && $CONTACTS->add_to_group($gid, $plugin['ids'])) + $CONTACTS->set_group($gid); + $num2add = count(explode(',', $plugin['ids'])); + + if (!$plugin['abort'] && ($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + $num2add > $maxnum)) + $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum)); + else if (!$plugin['abort'] && $CONTACTS->add_to_group($gid, $plugin['ids'])) $OUTPUT->show_message('contactaddedtogroup'); else if ($plugin['message']) $OUTPUT->show_message($plugin['message'], 'warning'); |
