예제 #1
0
        public Response <string> license_apply(string dummy, string hostOpaqueRef, string licFileBase64)
        {
            ActivationKeyParser parser = new ActivationKeyParser(licFileBase64);

            Hashtable license_params = (Hashtable)proxy.db.GetValue("host", hostOpaqueRef, "license_params");

            license_params["sku_type"]     = parser.sku_type;
            license_params["version"]      = parser.version;
            license_params["productcode"]  = parser.productcode;
            license_params["serialnumber"] = parser.serialnumber;
            license_params["sockets"]      = parser.sockets;
            DateTime expiry = DateTime.Parse(parser.human_readable_expiry, CultureInfo.InvariantCulture);

            license_params["expiry"]     = string.Format("{0}{1}{2}T00:00:00Z", expiry.Year, expiry.Month.ToString("00"), expiry.Day.ToString("00"));
            license_params["name"]       = parser.name;
            license_params["address1"]   = parser.address1;
            license_params["address2"]   = parser.address2;
            license_params["city"]       = parser.city;
            license_params["state"]      = parser.state;
            license_params["postalcode"] = parser.postalcode;
            license_params["country"]    = parser.country;
            license_params["company"]    = parser.company;

            proxy.EditObject_(DbProxy.EditTypes.Replace, "host", hostOpaqueRef, "license_params", license_params);

            return(new Response <string>(""));
        }
예제 #2
0
파일: fakeHost.cs 프로젝트: huizh/xenadmin
        public Response<string> license_apply(string dummy, string hostOpaqueRef, string licFileBase64)
        {
            ActivationKeyParser parser = new ActivationKeyParser(licFileBase64);

            Hashtable license_params = (Hashtable)proxy.db.GetValue("host", hostOpaqueRef, "license_params");

            license_params["sku_type"] = parser.sku_type;
            license_params["version"] = parser.version;
            license_params["productcode"] = parser.productcode;
            license_params["serialnumber"] = parser.serialnumber;
            license_params["sockets"] = parser.sockets;
            DateTime expiry = DateTime.Parse(parser.human_readable_expiry, CultureInfo.InvariantCulture);
            license_params["expiry"] = string.Format("{0}{1}{2}T00:00:00Z", expiry.Year, expiry.Month.ToString("00"), expiry.Day.ToString("00"));
            license_params["name"] = parser.name;
            license_params["address1"] = parser.address1;
            license_params["address2"] = parser.address2;
            license_params["city"] = parser.city;
            license_params["state"] = parser.state;
            license_params["postalcode"] = parser.postalcode;
            license_params["country"] = parser.country;
            license_params["company"] = parser.company;

            proxy.EditObject_(DbProxy.EditTypes.Replace, "host", hostOpaqueRef, "license_params", license_params);

            return new Response<string>("");
        }