diff --git a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php index dd4ef9e797..ad490e0a4c 100644 --- a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php @@ -68,7 +68,7 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi $this->ui->get_rows($query,$selection,$readonlys, true); // only return the ids } elseif ( $options['selection'] == 'all' ) { - if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) { + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1') { $col_filter['account_id'] = null; } $selection = ExecMethod2('addressbook.addressbook_bo.search', array(), true, '', '','',false,'AND',false,$col_filter); diff --git a/addressbook/inc/class.addressbook_export_vcard.inc.php b/addressbook/inc/class.addressbook_export_vcard.inc.php index 471e8b20f2..91590c6740 100644 --- a/addressbook/inc/class.addressbook_export_vcard.inc.php +++ b/addressbook/inc/class.addressbook_export_vcard.inc.php @@ -51,7 +51,7 @@ class addressbook_export_vcard implements importexport_iface_export_plugin { $this->uicontacts->get_rows($query,$this->selection,$readonlys, true); // only return the ids } elseif ( $options['selection'] == 'all' ) { - if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) { + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1') { $col_filter['account_id'] = null; } $this->selection = ExecMethod2('addressbook.addressbook_bo.search', array(), true, '', '','',false,'AND',false,$col_filter); diff --git a/addressbook/inc/class.addressbook_groupdav.inc.php b/addressbook/inc/class.addressbook_groupdav.inc.php index 54793bb6e8..9c85c6bd43 100644 --- a/addressbook/inc/class.addressbook_groupdav.inc.php +++ b/addressbook/inc/class.addressbook_groupdav.inc.php @@ -123,7 +123,7 @@ class addressbook_groupdav extends Api\CalDAV\Handler $filter['owner'] = $user; } // should we hide the accounts addressbook - if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) $filter['account_id'] = null; + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1') $filter['account_id'] = null; // process REPORT filters or multiget href's $nresults = null; @@ -1076,7 +1076,7 @@ class addressbook_groupdav extends Api\CalDAV\Handler } foreach(array_keys($this->bo->get_addressbooks(Acl::READ)) as $id) { - if (($id || !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) && + if (($id || $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1') && $GLOBALS['egw_info']['user']['account_id'] != $id && // no current user and no accounts, if disabled in ab prefs (in_array('A',$this->home_set_pref) || in_array((string)$id,$this->home_set_pref)) && is_numeric($id) && ($owner = $id ? $this->accounts->id2name($id) : 'accounts')) @@ -1101,7 +1101,7 @@ class addressbook_groupdav extends Api\CalDAV\Handler Api\CalDAV::mkprop('href',$data['caldav']->base_uri.'/'.$GLOBALS['egw_info']['user']['account_lid'].'/'))); $data['props']['principal-address'] = Api\CalDAV::mkprop(Api\CalDAV::CARDDAV, 'principal-address', - $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] ? '' : array( + $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1' ? '' : array( Api\CalDAV::mkprop('href',$data['caldav']->base_uri.'/addressbook-accounts/'.$GLOBALS['egw_info']['user']['person_id'].'.vcf'))); $data['props']['directory-gateway'] = Api\CalDAV::mkprop(Api\CalDAV::CARDDAV, 'directory-gateway', array( @@ -1141,7 +1141,7 @@ class addressbook_groupdav extends Api\CalDAV\Handler // rewriting owner=0 to 'U', as 0 get's always selected by prefs // not removing it for default or forced prefs based on current users pref if (!isset($addressbooks[0]) && (in_array($hook_data['type'], array('user', 'group')) || - $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'])) + $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1')) { unset($addressbooks['U']); } diff --git a/addressbook/inc/class.addressbook_zpush.inc.php b/addressbook/inc/class.addressbook_zpush.inc.php index 580682b4ed..110c239b94 100644 --- a/addressbook/inc/class.addressbook_zpush.inc.php +++ b/addressbook/inc/class.addressbook_zpush.inc.php @@ -869,7 +869,7 @@ class addressbook_zpush implements activesync_plugin_write, activesync_plugin_se // rewriting owner=0 to 'U', as 0 get's always selected by prefs // not removing it for default or forced prefs based on current users pref if (!isset($addressbooks[0]) && (in_array($hook_data['type'], array('user', 'group')) || - $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'])) + $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1')) { unset($addressbooks['U']); } diff --git a/api/src/CalDAV.php b/api/src/CalDAV.php index 0f352df294..d47f0f7530 100644 --- a/api/src/CalDAV.php +++ b/api/src/CalDAV.php @@ -675,7 +675,7 @@ class CalDAV extends HTTP_WebDAV_Server // only add global /addressbook-accounts/ as the one in home-set is added (and controled) by add_shared if ($path == '/' && $app == 'addressbook' && - !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) + $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1') { $file = $this->add_app($app,false,0,$path.$app.'-accounts/'); $file['props']['resourcetype']['val'][] = self::mkprop(self::CALENDARSERVER,'shared',''); @@ -851,7 +851,7 @@ class CalDAV extends HTTP_WebDAV_Server $props['displayname'] = lang('All addressbooks'); break; } - elseif(!$user && !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) + elseif(!$user && $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1') { unset($props['owner']); $props['displayname'] = lang($app).' '.lang('Accounts'); @@ -1972,7 +1972,7 @@ class CalDAV extends HTTP_WebDAV_Server { $user_prefix = '/'.$GLOBALS['egw_info']['user']['account_lid'].'/'.$app; list($app, $username) = explode('-', $app, 2); - if ($username == 'accounts' && !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) + if ($username == 'accounts' && $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1') { $account_id = 0; } diff --git a/api/src/CalDAV/Principals.php b/api/src/CalDAV/Principals.php index ffa77d87cb..d59ca38a71 100644 --- a/api/src/CalDAV/Principals.php +++ b/api/src/CalDAV/Principals.php @@ -983,7 +983,7 @@ class Principals extends Handler // CardDAV 'addressbook-home-set' => Api\CalDAV::mkprop(Api\CalDAV::CARDDAV,'addressbook-home-set',$addressbooks), 'principal-address' => Api\CalDAV::mkprop(Api\CalDAV::CARDDAV,'principal-address', - $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] ? '' : array( + $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1' ? '' : array( Api\CalDAV::mkprop('href',$this->base_uri.'/addressbook-accounts/'.$account['person_id'].'.vcf'))), // CardDAV directory 'directory-gateway' => Api\CalDAV::mkprop(Api\CalDAV::CARDDAV, 'directory-gateway',array( diff --git a/api/src/Contacts.php b/api/src/Contacts.php index 12d421b747..20269b7816 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -1550,7 +1550,7 @@ class Contacts extends Contacts\Storage $limit = array($options['start'], $options['num_rows']); } $filter = (array)$options['filter']; - if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) $filter['account_id'] = null; + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1') $filter['account_id'] = null; if (($contacts =& parent::search($criteria,false,'org_name,n_family,n_given,cat_id,contact_email','','%',false,'OR', $limit, $filter))) { $ids = array(); @@ -2508,7 +2508,7 @@ class Contacts extends Contacts\Storage if (!is_null($owner)) $filter['owner'] = $owner; // should we hide the accounts addressbook - if (!$owner && $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) + if (!$owner && $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] === '1') { $filter['account_id'] = null; } diff --git a/api/src/Contacts/Storage.php b/api/src/Contacts/Storage.php index 40afd4ac31..0522c104f2 100755 --- a/api/src/Contacts/Storage.php +++ b/api/src/Contacts/Storage.php @@ -1165,7 +1165,7 @@ class Storage } // add groups for all backends, if accounts addressbook is not hidden - if (empty($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'])) + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1') { foreach($GLOBALS['egw']->accounts->search(array( 'type' => 'groups' diff --git a/home/inc/class.home_birthday_portlet.inc.php b/home/inc/class.home_birthday_portlet.inc.php index 1c52e161cd..077219eabe 100644 --- a/home/inc/class.home_birthday_portlet.inc.php +++ b/home/inc/class.home_birthday_portlet.inc.php @@ -92,7 +92,7 @@ use EGroupware\Api\Etemplate; $bdays =& $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'),'n_given,n_family','','%'); // search accounts too, if not stored in accounts repository $extra_accounts_search = $contacts->account_repository == 'ldap' && !is_null($contacts->so_accounts) && - !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']; + $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1'; if ($extra_accounts_search && ($bdays2 = $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'), 'n_given,n_family','','%',false,'AND',false,array('owner' => 0)))) { diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index f11671417d..50ba6ff57b 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -883,7 +883,7 @@ class mail_compose { $_searchCond = array('contact_id'=>$addressArray); //error_log(__METHOD__.__LINE__.$_searchString); - if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) $showAccounts=false; + $showAccounts= $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1'; $filter = ($showAccounts?array():array('account_id' => null)); $filter['cols_to_search']=array('n_fn','email','email_home'); $contacts = $contacts_obj->search($_searchCond,array('n_fn','email','email_home'),'n_fn','','%',false,'OR',array(0,100),$filter); @@ -3483,7 +3483,7 @@ class mail_compose if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && strlen($_searchString)>=$_searchStringLength) { //error_log(__METHOD__.__LINE__.array2string($_searchString)); - $showAccounts = empty($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']); + $showAccounts = $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1'; $search = explode(' ', $_searchString); foreach ($search as $k => $v) {