diff --git a/js/config.php b/js/config.php index 8f1caaef..838f4767 100644 --- a/js/config.php +++ b/js/config.php @@ -24,11 +24,13 @@ OCP\JSON::setContentTypeHeader('text/javascript'); OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); -echo 'var contacts_groups_sortorder=[' . OCP\Config::getUserValue(OCP\USER::getUser(), 'contacts', 'groupsort', '') . '],'; +$user = OCP\User::getUser(); + +echo 'var contacts_groups_sortorder=[' . OCP\Config::getUserValue($user, 'contacts', 'groupsort', '') . '],'; echo 'contacts_properties_indexed = ' - . (OCP\Config::getUserValue(OCP\USER::getUser(), 'contacts', 'contacts_properties_indexed', 'no') === 'no' + . (OCP\Config::getUserValue($user, 'contacts', 'contacts_properties_indexed', 'no') === 'no' ? 'false' : 'true') . ','; echo 'contacts_categories_indexed = ' - . (OCP\Config::getUserValue(OCP\USER::getUser(), 'contacts', 'contacts_categories_indexed', 'no') === 'no' + . (OCP\Config::getUserValue($user, 'contacts', 'contacts_categories_indexed', 'no') === 'no' ? 'false' : 'true') . ','; -echo 'lang=\'' . OCP\Config::getUserValue(OCP\USER::getUser(), 'core', 'lang', 'en') . '\';'; +echo 'lang=\'' . OCP\Config::getUserValue($user, 'core', 'lang', 'en') . '\';';