mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:07 +01:00
Enhance validation for select-account widget, which doesn't load all options - check that selected account is visible to the user instead of loading all or failing
This commit is contained in:
parent
fb3672f950
commit
60843f9a1a
@ -91,7 +91,9 @@ class etemplate_widget_menupopup extends etemplate_widget
|
||||
}
|
||||
foreach((array) $value as $val)
|
||||
{
|
||||
if (!($this->attrs['multiple'] && !$val) && !isset($allowed[$val]))
|
||||
// Special for select-account - selOptions doesn't always load all accounts
|
||||
if($this->attrs['type'] == 'select-account' && !$GLOBALS['egw']->accounts->visible($val) && !isset($allowed[$val]) ||
|
||||
$this->attrs['type'] != 'select-account' && !($this->attrs['multiple'] && !$val) && !isset($allowed[$val]))
|
||||
{
|
||||
self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($allowed))),'');
|
||||
$value = '';
|
||||
|
Loading…
Reference in New Issue
Block a user