diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index d1d5e07b59..38b57c2509 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -41,6 +41,11 @@ class uicontacts extends bocontacts var $private_addressbook = false; var $org_views; + /** + * Addressbook configuration (stored as phpgwapi = general server config) + * + * @var array + */ var $config; /** * Name(s) of the tabs in the edit dialog @@ -393,6 +398,7 @@ class uicontacts extends bocontacts if ($use_all) { + @set_time_limit(0); // switch off the execution time limit, as it's for big selections to small $query['num_rows'] = -1; // all $this->get_rows($query,$checked,$readonlys,true); // true = only return the id's } @@ -424,6 +430,14 @@ class uicontacts extends bocontacts $to_list = (int)substr($action,8); $action = 'to_list'; } + // Security: stop non-admins to export more then the configured number of contacts + if (in_array($action,array('csv','vcard')) && (int)$this->config['contact_export_limit'] && + !isset($GLOBALS['egw_info']['user']['apps']['admin']) && count($checked) > $this->config['contact_export_limit']) + { + $action_msg = lang('exported'); + $failed = count($checked); + return false; + } switch($action) { case 'csv': @@ -766,7 +780,7 @@ class uicontacts extends bocontacts $wildcard = $query['advanced_search']['meth_select']; unset($query['advanced_search']['meth_select']); } - $rows = parent::search($query['advanced_search'] ? $query['advanced_search'] : $query['search'],false, + $rows = parent::search($query['advanced_search'] ? $query['advanced_search'] : $query['search'],$id_only, $order,'',$wildcard,false,$op,array((int)$query['start'],(int) $query['num_rows']),$query['col_filter']); // do we need the custom fields diff --git a/addressbook/setup/phpgw_de.lang b/addressbook/setup/phpgw_de.lang index a2f8a1df0a..5e4eb3546d 100644 --- a/addressbook/setup/phpgw_de.lang +++ b/addressbook/setup/phpgw_de.lang @@ -167,6 +167,7 @@ home phone addressbook de Tel. privat home state addressbook de Bundesland privat home street addressbook de Straße privat home zip code addressbook de PLZ privat +how many contacts should non-admins be able to export (empty = no limit) admin de Wieviele Kontakte sollen nicht-Adminstratoren exportieren können (leer = keine Begrenzung) icon addressbook de Icon if accounts are already in ldap admin de wenn die Benutzer bereits im LDAP sind import addressbook de Import @@ -289,7 +290,7 @@ translation addressbook de type addressbook de Typ update a single entry by passing the fields. addressbook de Aktualisiert einen einzelnen Eintrag durch Übergabe seiner Felder. upload or delete the photo addressbook de Foto hochladen oder löschen -url to link telephone numbers to (use %1 for the number) admin de URL mit denen Telefonnummern verlinkt werden sollen (%1 für die Nummber verwenden) +url to link telephone numbers to (use %1 for the number) admin de URL mit denen Telefonnummern verlinkt werden sollen (%1 als Platzhalter für die Nummer verwenden) use an extra category tab? addressbook de Separaten Reiter für Kategorien verwenden? use country list addressbook de Länderliste benutzen use setup for a full account-migration admin de für eine komplette Benutzer Migration setup verwenden diff --git a/addressbook/setup/phpgw_en.lang b/addressbook/setup/phpgw_en.lang index 9f249f7a16..28fa146374 100644 --- a/addressbook/setup/phpgw_en.lang +++ b/addressbook/setup/phpgw_en.lang @@ -167,6 +167,7 @@ home phone addressbook en Home Phone home state addressbook en Home State home street addressbook en Home Street home zip code addressbook en Home ZIP Code +how many contacts should non-admins be able to export (empty = no limit) admin en How many contacts should non-admins be able to export (empty = no limit) icon addressbook en Icon if accounts are already in ldap admin en if accounts are already in LDAP import addressbook en Import diff --git a/addressbook/templates/default/config.tpl b/addressbook/templates/default/config.tpl index 3c0a7212ec..68111de9ed 100644 --- a/addressbook/templates/default/config.tpl +++ b/addressbook/templates/default/config.tpl @@ -46,6 +46,10 @@ + +  {lang_Security}: {lang_How_many_contacts_should_non-admins_be_able_to_export_(empty_=_no_limit)}: + +  {lang_Contact_repository}