Example #1
0
 public static ZimbraValues GetZimbraValues()
 {
     if (zimbraValues == null)
     {
         zimbraValues = new ZimbraValues();
     }
     return(zimbraValues);
 }
Example #2
0
 public ZimbraValues()
 {
     zimbraValues   = null;
     sUrl           = "";
     sAuthToken     = "";
     sServerVersion = "";
     lDomains       = new List <string>();
     lCOSes         = new List <CosInfo>();
     lTags          = new List <TagInfo>();
 }
Example #3
0
        private HttpWebRequest CreateWebRequest()
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);

            webRequest.ContentType = "application/soap+xml; charset=\"utf-8\"";
            webRequest.UserAgent   = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
            webRequest.Method      = "POST";
            webRequest.Proxy       = null;
            return(webRequest);
        }
Example #4
0
 public ZimbraValues()
 {
     zimbraValues = null;
     sUrl = "";
     sAuthToken = "";
     sServerVersion = "";
     lDomains = new List<string>();
     lCOSes = new List<CosInfo>();
     lTags = new List<TagInfo>();
 }
Example #5
0
 public ZimbraValues()
 {
     zimbraValues     = null;
     sUrl             = "";
     sAuthToken       = "";
     sServerVersion   = "";
     sDefaultCosIndex = -1;
     lDomains         = new List <string>();
     lZimbraDomains   = new List <DomainInfo>();
     lCOSes           = new List <CosInfo>();
 }
Example #6
0
        private HttpWebRequest CreateWebRequest()
        {
            // using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);

                webRequest.ContentType = "application/soap+xml; charset=\"utf-8\"";
                webRequest.UserAgent   = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
                webRequest.Method      = "POST";
                webRequest.Proxy       = null;
                return(webRequest);
            }
        }
Example #7
0
        private HttpWebRequest CreateWebRequestRaw(string authtoken, bool isServerMig)
        {
            CookieContainer cookieContainer = new CookieContainer();
            Cookie          cookie          = (isServerMig) ? new Cookie("ZM_ADMIN_AUTH_TOKEN", authtoken) : new Cookie(
                "ZM_AUTH_TOKEN", authtoken);

            cookieContainer.Add(new Uri(this.Url), cookie);

            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);

            webRequest.CookieContainer = cookieContainer;
            webRequest.UserAgent       = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
            webRequest.Method          = "POST";
            webRequest.Proxy           = null;
            return(webRequest);
        }
Example #8
0
        private HttpWebRequest CreateWebRequestRaw(string authtoken, bool isServerMig)
        {
            //using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                // Get a cookie container containing ZM_ADMIN_AUTH_TOKEN or ZM_AUTH_TOKEN
                CookieContainer cookieContainer = new CookieContainer();
                Cookie          cookie          = (isServerMig) ? new Cookie("ZM_ADMIN_AUTH_TOKEN", authtoken) : new Cookie("ZM_AUTH_TOKEN", authtoken);
                cookieContainer.Add(new Uri(this.Url), cookie);

                // Create the webRequest
                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);
                webRequest.CookieContainer = cookieContainer;
                webRequest.UserAgent       = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
                webRequest.Method          = "POST";
                webRequest.Proxy           = null;

                webRequest.Timeout = 10 * 60 * 1000; // 10 mins
                Log.verbose("Connection timeout is", webRequest.Timeout, "ms");

                return(webRequest);
            }
        }
Example #9
0
 public static ZimbraValues GetZimbraValues()
 {
     if (zimbraValues == null)
         zimbraValues = new ZimbraValues();
     return zimbraValues;
 }