public static int UpdateWebSite(WebSite site)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // load web site item
            WebSite siteItem = (WebSite)PackageController.GetPackageItem(site.Id);
            if (siteItem == null)
                return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;

            // place log record
            TaskManager.StartTask("WEB_SITE", "UPDATE", siteItem.Name);
            TaskManager.ItemId = site.Id;

            try
            {
                // update home folder
                string origPath = site.ContentPath;
                site.ContentPath = FilesController.GetFullPackagePath(site.PackageId, site.ContentPath);

                // build data folder path
                site.DataPath = siteItem.DataPath;

                // update site on the service
                WebServer web = new WebServer();
                ServiceProviderProxy.Init(web, siteItem.ServiceId);
                web.UpdateSite(site);
				// Restore settings back
				#region Web Deploy Settings
				site.WebDeployPublishingAccount = siteItem.WebDeployPublishingAccount;
				site.WebDeployPublishingPassword = siteItem.WebDeployPublishingPassword;
				site.WebDeploySitePublishingEnabled = siteItem.WebDeploySitePublishingEnabled;
				site.WebDeploySitePublishingProfile = siteItem.WebDeploySitePublishingProfile;
				#endregion

                // update service item
                PackageController.UpdatePackageItem(site);

                // set origpath
                site.ContentPath = origPath;

                return 0;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }