use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.
the class BUG_46297 method doGlobalConfig.
private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
Config config = prov.getConfig();
doEntry(zlc, config, "global config");
}
use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.
the class BUG_46961 method doUpgrade.
@Override
void doUpgrade() throws ServiceException {
Config config = prov.getConfig();
String oldValue = "displayName,cn=fullName";
String newValue = "displayName,cn=fullName,fullName2,fullName3,fullName4,fullName5,fullName6,fullName7,fullName8,fullName9,fullName10";
String[] curValues = config.getMultiAttr(Provisioning.A_zimbraGalLdapAttrMap);
for (String value : curValues) {
if (value.equalsIgnoreCase(oldValue)) {
Map<String, Object> attr = new HashMap<String, Object>();
attr.put("-" + Provisioning.A_zimbraGalLdapAttrMap, oldValue);
attr.put("+" + Provisioning.A_zimbraGalLdapAttrMap, newValue);
printer.println("Modifying " + Provisioning.A_zimbraGalLdapAttrMap + " on global config:");
printer.println(" removing value: " + oldValue);
printer.println(" adding value: " + newValue);
prov.modifyAttrs(config, attr);
}
}
}
use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.
the class BUG_41000 method doUpgrade.
@Override
void doUpgrade() throws ServiceException {
Config config = prov.getConfig();
String[] value = { "zimbraAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))", "zimbraSearch:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))" };
Map<String, Object> attr = new HashMap<String, Object>();
attr.put("+" + Provisioning.A_zimbraGalLdapFilterDef, value);
printer.println("Adding zimbraAutoComplete and zimbraSearch filters to global config " + Provisioning.A_zimbraGalLdapFilterDef);
prov.modifyAttrs(config, attr);
}
use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.
the class BUG_42877 method doUpgrade.
@Override
void doUpgrade() throws ServiceException {
Config config = prov.getConfig();
String[] values = { "facsimileTelephoneNumber,fax=workFax", "homeTelephoneNumber,homePhone=homePhone", "mobileTelephoneNumber,mobile=mobilePhone", "pagerTelephoneNumber,pager=pager" };
Map<String, Object> attr = new HashMap<String, Object>();
attr.put("+" + Provisioning.A_zimbraGalLdapAttrMap, values);
printer.println("Adding workFax, homePhone, mobilePhone, pager attr maps to global config " + Provisioning.A_zimbraGalLdapAttrMap);
prov.modifyAttrs(config, attr);
}
use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.
the class GetInfo method doAttrs.
static void doAttrs(Account acct, String locale, Element response, Map<String, Object> attrsMap) throws ServiceException {
AttributeManager attrMgr = AttributeManager.getInstance();
Set<String> attrList = attrMgr.getAttrsWithFlag(AttributeFlag.accountInfo);
Set<String> acctAttrs = attrMgr.getAllAttrsInClass(AttributeClass.account);
Set<String> domainAttrs = attrMgr.getAllAttrsInClass(AttributeClass.domain);
Set<String> serverAttrs = attrMgr.getAllAttrsInClass(AttributeClass.server);
Set<String> configAttrs = attrMgr.getAllAttrsInClass(AttributeClass.globalConfig);
Provisioning prov = Provisioning.getInstance();
Domain domain = prov.getDomain(acct);
Server server = acct.getServer();
Config config = prov.getConfig();
for (String key : attrList) {
Object value = null;
if (Provisioning.A_zimbraLocale.equals(key)) {
value = locale;
} else if (Provisioning.A_zimbraAttachmentsBlocked.equals(key)) {
// leave this a special case for now, until we have enough incidences to make it a pattern
value = config.isAttachmentsBlocked() || acct.isAttachmentsBlocked() ? ProvisioningConstants.TRUE : ProvisioningConstants.FALSE;
} else {
value = attrsMap.get(key);
if (value == null) {
// no value on account/cos
if (!acctAttrs.contains(key)) {
// see if it is on domain, server, or globalconfig
if (domainAttrs.contains(key)) {
if (domain != null) {
// value on domain/global config (domainInherited)
value = domain.getMultiAttr(key);
}
} else if (serverAttrs.contains(key)) {
// value on server/global config (serverInherited)
value = server.getMultiAttr(key);
} else if (configAttrs.contains(key)) {
// value on global config
value = config.getMultiAttr(key);
}
}
}
}
ToXML.encodeAttr(response, key, value);
}
}
Aggregations