mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 17:38:28 +01:00
fixed not working export of huge number of contacts (memory and execution time limit reached) AND added a new configuration option to limit the maximum number of exported contacts for non admins
This commit is contained in:
parent
2c5582c15b
commit
452adb97ae
@ -41,6 +41,11 @@ class uicontacts extends bocontacts
|
|||||||
var $private_addressbook = false;
|
var $private_addressbook = false;
|
||||||
var $org_views;
|
var $org_views;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Addressbook configuration (stored as phpgwapi = general server config)
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $config;
|
var $config;
|
||||||
/**
|
/**
|
||||||
* Name(s) of the tabs in the edit dialog
|
* Name(s) of the tabs in the edit dialog
|
||||||
@ -393,6 +398,7 @@ class uicontacts extends bocontacts
|
|||||||
|
|
||||||
if ($use_all)
|
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
|
$query['num_rows'] = -1; // all
|
||||||
$this->get_rows($query,$checked,$readonlys,true); // true = only return the id's
|
$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);
|
$to_list = (int)substr($action,8);
|
||||||
$action = 'to_list';
|
$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)
|
switch($action)
|
||||||
{
|
{
|
||||||
case 'csv':
|
case 'csv':
|
||||||
@ -766,7 +780,7 @@ class uicontacts extends bocontacts
|
|||||||
$wildcard = $query['advanced_search']['meth_select'];
|
$wildcard = $query['advanced_search']['meth_select'];
|
||||||
unset($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']);
|
$order,'',$wildcard,false,$op,array((int)$query['start'],(int) $query['num_rows']),$query['col_filter']);
|
||||||
|
|
||||||
// do we need the custom fields
|
// do we need the custom fields
|
||||||
|
@ -167,6 +167,7 @@ home phone addressbook de Tel. privat
|
|||||||
home state addressbook de Bundesland privat
|
home state addressbook de Bundesland privat
|
||||||
home street addressbook de Straße privat
|
home street addressbook de Straße privat
|
||||||
home zip code addressbook de PLZ 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
|
icon addressbook de Icon
|
||||||
if accounts are already in ldap admin de wenn die Benutzer bereits im LDAP sind
|
if accounts are already in ldap admin de wenn die Benutzer bereits im LDAP sind
|
||||||
import addressbook de Import
|
import addressbook de Import
|
||||||
@ -289,7 +290,7 @@ translation addressbook de
|
|||||||
type addressbook de Typ
|
type addressbook de Typ
|
||||||
update a single entry by passing the fields. addressbook de Aktualisiert einen einzelnen Eintrag durch Übergabe seiner Felder.
|
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
|
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 an extra category tab? addressbook de Separaten Reiter für Kategorien verwenden?
|
||||||
use country list addressbook de Länderliste benutzen
|
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
|
use setup for a full account-migration admin de für eine komplette Benutzer Migration setup verwenden
|
||||||
|
@ -167,6 +167,7 @@ home phone addressbook en Home Phone
|
|||||||
home state addressbook en Home State
|
home state addressbook en Home State
|
||||||
home street addressbook en Home Street
|
home street addressbook en Home Street
|
||||||
home zip code addressbook en Home ZIP Code
|
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
|
icon addressbook en Icon
|
||||||
if accounts are already in ldap admin en if accounts are already in LDAP
|
if accounts are already in ldap admin en if accounts are already in LDAP
|
||||||
import addressbook en Import
|
import addressbook en Import
|
||||||
|
@ -46,6 +46,10 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="row_off">
|
||||||
|
<td> <b>{lang_Security}</b>: {lang_How_many_contacts_should_non-admins_be_able_to_export_(empty_=_no_limit)}:</td>
|
||||||
|
<td><input name="newsettings[contact_export_limit]" value="{value_contact_export_limit}" size="5"></td>
|
||||||
|
</tr>
|
||||||
<tr class="th">
|
<tr class="th">
|
||||||
<td colspan="2"> <b>{lang_Contact_repository}</b></td>
|
<td colspan="2"> <b>{lang_Contact_repository}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user