Example #1
0
 private AuthToken getAuthTokenForApp(
     HttpServletRequest req, HttpServletResponse resp, boolean doNotSendHttpError)
     throws IOException, ServiceException {
   Config config = Provisioning.getInstance().getConfig();
   int adminPort = config.getIntAttr(Provisioning.A_zimbraAdminPort, 0);
   if (adminPort == req.getLocalPort()) {
     return getAdminAuthTokenFromCookie(req, resp, doNotSendHttpError);
   }
   return getAuthTokenFromCookie(req, resp, doNotSendHttpError);
 }
Example #2
0
 protected SoapCLI() throws ServiceException {
   // get admin username from local config
   mUser = LC.zimbra_ldap_user.value();
   // get password from localconfig
   mPassword = LC.zimbra_ldap_password.value();
   // host can be specified
   mHost = "localhost";
   // get admin port number from provisioning
   com.zimbra.cs.account.Config conf = null;
   try {
     conf = Provisioning.getInstance().getConfig();
   } catch (ServiceException e) {
     throw ServiceException.FAILURE("Unable to connect to LDAP directory", e);
   }
   mPort = conf.getIntAttr(Provisioning.A_zimbraAdminPort, 0);
   if (mPort == 0)
     throw ServiceException.FAILURE("Unable to get admin port number from provisioning", null);
   mOptions = new Options();
   mHiddenOptions = new Options();
 }