Exemplo n.º 1
0
        public virtual void CreateUser(SqlUser user, string password)
        {
            if (user.Databases == null)
            {
                user.Databases = new string[0];
            }

            /*if (!((Regex.IsMatch(user.Name, @"[^\w\.-]")) && (user.Name.Length > 16)))
             * {
             *  Exception ex = new Exception("INVALID_USERNAME");
             *  throw ex;
             * }
             */
            ExecuteNonQuery(String.Format(
                                "GRANT USAGE ON mysql.* TO '{0}'@'%' IDENTIFIED BY '{1}'",
                                user.Name, password));

            if (OldPassword)
            {
                ChangeUserPassword(user.Name, password);
            }

            // add access to databases
            foreach (string database in user.Databases)
            {
                AddUserToDatabase(database, user.Name);
            }
        }
Exemplo n.º 2
0
        public void BindItem(SqlUser item)
        {
            // bind again
            BindDatabases(item.PackageId, item.GroupName);

            Utils.SelectListItem(ddlDefaultDatabase, item.DefaultDatabase);
        }
Exemplo n.º 3
0
        public virtual void UpdateUser(SqlUser user, string[] allDatabases)
        {
            if (user.Databases == null)
            {
                user.Databases = new string[0];
            }

            // update user databases access
            string[] databases = GetUserDatabases(user.Name);
            foreach (string database in databases)
            {
                RemoveUserFromDatabase(database, user.Name);
            }

            foreach (string database in user.Databases)
            {
                AddUserToDatabase(database, user.Name);
            }

            // change user password if required
            if (!String.IsNullOrEmpty(user.Password))
            {
                ChangeUserPassword(user.Name, user.Password);
            }
        }
Exemplo n.º 4
0
        public virtual SqlUser GetUser(string username, string[] databases)
        {
            // get user information
            SqlUser user = new SqlUser();

            user.Name = username;

            // get user databases
            user.Databases = GetUserDatabases(username);

            return(user);
        }
 public void UpdateUser(SqlUser user, string[] databases)
 {
     try
     {
         Log.WriteStart("'{0}' UpdateUser", ProviderSettings.ProviderName);
         DatabaseProvider.UpdateUser(user, databases);
         Log.WriteEnd("'{0}' UpdateUser", ProviderSettings.ProviderName);
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' UpdateUser", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
 public int AddSqlUser(SqlUser item, string groupName)
 {
     return DatabaseServerController.AddSqlUser(item, groupName);
 }
Exemplo n.º 7
0
        public virtual void UpdateUser(SqlUser user, string[] allDatabases)
        {
            if (user.Databases == null)
                user.Databases = new string[0];

            // update user's default database
            if (user.DefaultDatabase == null || user.DefaultDatabase == "")
                user.DefaultDatabase = "master";

            ExecuteNonQuery(String.Format("EXEC sp_defaultdb '{0}', '{1}'",
                user.Name, user.DefaultDatabase));

            
            // update user databases access
            UpdateUserDatabases(user.Name, user.Databases, allDatabases);

            // change user password if required
            if (user.Password != "")
                ChangeUserPassword(user.Name, user.Password);
        }
 public void SaveItem(SqlUser item)
 {
 }
Exemplo n.º 9
0
        private void SaveItem()
        {
            if (!Page.IsValid)
                return;

            // get form data
            SqlUser item = new SqlUser();
            item.Id = PanelRequest.ItemID;
            item.PackageId = PanelSecurity.PackageId;
            item.Name = usernameControl.Text;
            item.Password = passwordControl.Password;

            List<string> databases = new List<string>();
            foreach (ListItem li in dlDatabases.Items)
            {
                if (li.Selected)
                    databases.Add(li.Value);
            }
            item.Databases = databases.ToArray();

            // get other props
            IDatabaseEditUserControl ctrl = (IDatabaseEditUserControl)providerControl.Controls[0];
            ctrl.SaveItem(item);

            if (PanelRequest.ItemID == 0)
            {
                // new item
                try
                {
                    int result = ES.Services.DatabaseServers.AddSqlUser(item, SqlDatabases.GetDatabasesGroupName(Settings));
					// Show an error message if the operation has failed to complete
                    if (result < 0)
                    {
                        ShowResultMessageWithContactForm(result);
                        return;
                    }
                }
                catch (Exception ex)
                {
                    ShowErrorMessage("SQL_ADD_USER", ex);
                    return;
                }
            }
            else
            {
                // existing item
                try
                {
                    int result = ES.Services.DatabaseServers.UpdateSqlUser(item);
					// Show an error message if the operation has failed to complete
                    if (result < 0)
                    {
						ShowResultMessageWithContactForm(result);
                        return;
                    }
                }
                catch (Exception ex)
                {
                    ShowErrorMessage("SQL_UPDATE_USER", ex);
                    return;
                }
            }

            // return
            RedirectSpaceHomePage();
        }
Exemplo n.º 10
0
        public virtual SqlUser GetUser(string username, string[] allDatabases)
        {
            // get user information
            SqlUser user = new SqlUser();

            DataView dvUser = ExecuteQuery(String.Format("select dbname from master..syslogins where name = '{0}'",
                username)).Tables[0].DefaultView;

            user.Name = username;
            user.DefaultDatabase = "";
            if (dvUser.Count > 0)
            {
                object dbname = dvUser[0]["dbname"];
                user.DefaultDatabase = (dbname != null && dbname != DBNull.Value) ? (string)dbname : "";
            }

            // get user databases
            user.Databases = GetUserDatabases(username, allDatabases);

            return user;
        }
Exemplo n.º 11
0
 /// <remarks/>
 public System.IAsyncResult BeginCreateUser(SqlUser user, string password, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("CreateUser", new object[] {
                 user,
                 password}, callback, asyncState);
 }
        public static int UpdateSqlUser(SqlUser item)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // load original meta item
            SqlUser origItem = (SqlUser)PackageController.GetPackageItem(item.Id);
            if (origItem == null)
                return BusinessErrorCodes.ERROR_MSSQL_USERS_PACKAGE_ITEM_NOT_FOUND;

            // check package
            int packageCheck = SecurityContext.CheckPackage(origItem.PackageId, DemandPackage.IsActive);
            if (packageCheck < 0) return packageCheck;

            // place log record
            TaskManager.StartTask("SQL_USER", "UPDATE", origItem.Name);
            TaskManager.ItemId = item.Id;

            try
            {
                // get service
                DatabaseServer sql = GetDatabaseServer(origItem.ServiceId);

                // update service item
                sql.UpdateUser(item, GetSqlDatabasesArray(origItem.PackageId, origItem.GroupName));

                // update meta item
                if (item.Password == "")
                    item.Password = CryptoUtils.Decrypt(origItem.Password);

                item.Password = CryptoUtils.Encrypt(item.Password);
                PackageController.UpdatePackageItem(item);
                return 0;
                
            }
            catch (Exception ex)
            {
                TaskManager.WriteError(ex);

				// Return a generic error instead of re-throwing an exception
				return BusinessErrorCodes.FAILED_EXECUTE_SERVICE_OPERATION;
            }
            finally
            {
                TaskManager.CompleteTask();
            }
         }
        public int InstallWebApplication(InstallationInfo inst)
        {
            // place log record
            TaskManager.StartTask("APP_INSTALLER", "INSTALL_APPLICATION");
            TaskManager.WriteParameter("Virtual directory", inst.VirtualDir);
            TaskManager.WriteParameter("Database group", inst.DatabaseGroup);
            TaskManager.ItemId = inst.PackageId;

            try
            {
                // get application info
                app = GetApplication(inst.PackageId, inst.ApplicationId);

                TaskManager.ItemName = app.Name;

                // check web site for existance
                WebSite webSite = WebServerController.GetWebSite(inst.WebSiteId);

                if (webSite == null)
                    return BusinessErrorCodes.ERROR_WEB_INSTALLER_WEBSITE_NOT_EXISTS;

				TaskManager.WriteParameter("Web site", webSite.Name);

                webSiteName = webSite.Name;
                siteId = webSite.SiteId;

                // change web site properties if required
                if (String.IsNullOrEmpty(inst.VirtualDir))
                {
                    ChangeVirtualDirectoryProperties(webSite, app.WebSettings);
                    WebServerController.UpdateWebSite(webSite);
                }

                // get OS service
                int osId = PackageController.GetPackageServiceId(inst.PackageId, "os");
                os = new OS.OperatingSystem();
                ServiceProviderProxy.Init(os, osId);

                // get remote content path
                contentPath = webSite.ContentPath;

                // create virtual dir if required
                if (!String.IsNullOrEmpty(inst.VirtualDir))
                {
                    // check if the required virtual dir already exists
                    contentPath = Path.Combine(contentPath, inst.VirtualDir);

                    WebVirtualDirectory vdir = null;
                    int result = WebServerController.AddVirtualDirectory(inst.WebSiteId, inst.VirtualDir, contentPath);
                    if (result == BusinessErrorCodes.ERROR_VDIR_ALREADY_EXISTS)
                    {
                        // the directory alredy exists
                        vdir = WebServerController.GetVirtualDirectory(
                            inst.WebSiteId, inst.VirtualDir);

                        contentPath = vdir.ContentPath;
                    }
                    else
                    {
                        vdir = WebServerController.GetVirtualDirectory(
                            inst.WebSiteId, inst.VirtualDir);

                        inst[PROPERTY_VDIR_CREATED] = "True";
                    }

                    // change virtual directory properties if required
                    ChangeVirtualDirectoryProperties(vdir, app.WebSettings);
                    WebServerController.UpdateVirtualDirectory(inst.WebSiteId, vdir);
                }

                // deploy application codebase ZIP and then unpack it
                string codebasePath = app.Codebase;
                string remoteCodebasePath = Path.Combine(contentPath, Path.GetFileName(app.Codebase));

                // make content path absolute
                string absContentPath = FilesController.GetFullPackagePath(inst.PackageId, contentPath);

                // save content path
                inst[PROPERTY_CONTENT_PATH] = contentPath;
                inst[PROPERTY_ABSOLUTE_CONTENT_PATH] = absContentPath;

                // copy ZIP to the target server
                FileStream stream = File.OpenRead(codebasePath);
                int BUFFER_LENGTH = 5000000;

                byte[] buffer = new byte[BUFFER_LENGTH];
                int readBytes = 0;
                while (true)
                {
                    readBytes = stream.Read(buffer, 0, BUFFER_LENGTH);

                    if (readBytes < BUFFER_LENGTH)
                        Array.Resize<byte>(ref buffer, readBytes);

                    FilesController.AppendFileBinaryChunk(inst.PackageId, remoteCodebasePath, buffer);

                    if (readBytes < BUFFER_LENGTH)
                        break;
                }


                
                // unpack codebase
                inst[PROPERTY_INSTALLED_FILES] = String.Join(";",
                   FilesController.UnzipFiles(inst.PackageId, new string[] { remoteCodebasePath }));
                
                // delete codebase zip
                FilesController.DeleteFiles(inst.PackageId, new string[] { remoteCodebasePath });

                // check/create databases
                if (!String.IsNullOrEmpty(inst.DatabaseGroup) &&
                    String.Compare(inst.DatabaseGroup, "None", true) != 0)
                {
                    // database
                    if (inst.DatabaseId == 0)
                    {
                        TaskManager.WriteParameter("Database name", inst.DatabaseName);

                        // we should create a new database
                        SqlDatabase db = new SqlDatabase();
                        db.PackageId = inst.PackageId;
                        db.Name = inst.DatabaseName;
                        inst.DatabaseId = DatabaseServerController.AddSqlDatabase(db, inst.DatabaseGroup);
                        if (inst.DatabaseId < 0)
                        {
                            // rollback installation
                            RollbackInstallation(inst);

                            // return error
                            return inst.DatabaseId; // there was an error when creating database
                        }

                        inst[PROPERTY_DATABASE_CREATED] = "True";
                    }
                    else
                    {
                        // existing database
                        SqlDatabase db = DatabaseServerController.GetSqlDatabase(inst.DatabaseId);
                        inst.DatabaseName = db.Name;

                        TaskManager.WriteParameter("Database name", inst.DatabaseName);
                    }

                    SqlUser user = null;
                    // database user
                    if (inst.UserId == 0)
                    {
                        TaskManager.WriteParameter("Database user", inst.Username);

                        // NEW USER
                        user = new SqlUser();
                        user.PackageId = inst.PackageId;
                        user.Name = inst.Username;
                        user.Databases = new string[] { inst.DatabaseName };
                        user.Password = inst.Password;
                        inst.UserId = DatabaseServerController.AddSqlUser(user, inst.DatabaseGroup);
                        if (inst.UserId < 0)
                        {
                            // rollback installation
                            RollbackInstallation(inst);

                            // return error
                            return inst.UserId; // error while adding user
                        }

                        inst[PROPERTY_USER_CREATED] = "True";
                    }
                    else
                    {
                        // EXISTING USER
                        user = DatabaseServerController.GetSqlUser(inst.UserId);
                        inst.Username = user.Name;

                        TaskManager.WriteParameter("Database user", inst.Username);

                        List<string> databases = new List<string>();
                        databases.AddRange(user.Databases);

                        if (!databases.Contains(inst.DatabaseName))
                        {
                            databases.Add(inst.DatabaseName);

                            user.Databases = databases.ToArray();
                            DatabaseServerController.UpdateSqlUser(user);
                        }
                    }

                    // check connectivity with SQL Server and credentials provided
                    // load user item
                    int sqlServiceId = PackageController.GetPackageServiceId(inst.PackageId, inst.DatabaseGroup);
                    sql = new DatabaseServer();
                    ServiceProviderProxy.Init(sql, sqlServiceId);

                    if (!sql.CheckConnectivity(inst.DatabaseName, inst.Username,
                        inst.Password))
                    {
                        // can't connect to the database
                        RollbackInstallation(inst);

                        return BusinessErrorCodes.ERROR_WEB_INSTALLER_CANT_CONNECT_DATABASE;
                    }

                    // read SQL server settings
                    StringDictionary settings = ServerController.GetServiceSettings(sqlServiceId);
                    serverIpAddressExternal = settings["ExternalAddress"];
					if (settings.ContainsKey("InternalAddress"))
					{
						serverIpAddressInternal = settings["InternalAddress"];
					}
                }

                // ********* RUN INSTALL SCENARIO ***********
                int scriptResult = RunInstallScenario(inst);
                if (scriptResult < 0)
                {
                    // rollback installation
                    RollbackInstallation(inst);

                    // return error
                    return scriptResult;
                }

                // add new installation to the database
                return 0;
            }
            catch (Exception ex)
            {
                // rollback installation
                RollbackInstallation(inst);

                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
Exemplo n.º 14
0
 public void CreateUser(SqlUser user, string password)
 {
     this.Invoke("CreateUser", new object[] {
                 user,
                 password});
 }
Exemplo n.º 15
0
        public virtual void UpdateUser(SqlUser user, string[] allDatabases)
        {
            if (user.Databases == null)
                user.Databases = new string[0];

            // update user databases access
            string[] databases = GetUserDatabases(user.Name);
            foreach (string database in databases)
                RemoveUserFromDatabase(database, user.Name);

            foreach (string database in user.Databases)
                AddUserToDatabase(database, user.Name);

            // change user password if required
            if (!String.IsNullOrEmpty(user.Password))
                ChangeUserPassword(user.Name, user.Password);
        }
Exemplo n.º 16
0
        public virtual void CreateUser(SqlUser user, string password)
        {
            if (user.Databases == null)
                user.Databases = new string[0];
            
            /*if (!((Regex.IsMatch(user.Name, @"[^\w\.-]")) && (user.Name.Length > 16)))
            {
                Exception ex = new Exception("INVALID_USERNAME");
                throw ex;
            }
            */
            ExecuteNonQuery(String.Format(
                                "GRANT USAGE ON mysql.* TO '{0}'@'%' IDENTIFIED BY '{1}'",
                                user.Name, password));

            if (OldPassword)
                ChangeUserPassword(user.Name, password);

            // add access to databases
            foreach (string database in user.Databases)
                AddUserToDatabase(database, user.Name);
         }
Exemplo n.º 17
0
        public virtual SqlUser GetUser(string username, string[] databases)
        {
            // get user information
            SqlUser user = new SqlUser();
            user.Name = username;

            // get user databases
            user.Databases = GetUserDatabases(username);

            return user;
        }
Exemplo n.º 18
0
 public int UpdateSqlUser(SqlUser item)
 {
     return DatabaseServerController.UpdateSqlUser(item);
 }
Exemplo n.º 19
0
 /// <remarks/>
 public void CreateUserAsync(SqlUser user, string password)
 {
     this.CreateUserAsync(user, password, null);
 }
        public static int AddSqlUser(SqlUser item, string groupName)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // check package
            int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
            if (packageCheck < 0) return packageCheck;

            // check quota
            QuotaValueInfo quota = PackageController.GetPackageQuota(item.PackageId, groupName + ".Users");
            if (quota.QuotaExhausted)
                return BusinessErrorCodes.ERROR_MSSQL_USERS_RESOURCE_QUOTA_LIMIT;

            // check if mail resource is available
            int serviceId = PackageController.GetPackageServiceId(item.PackageId, groupName);
            if (serviceId == 0)
                return BusinessErrorCodes.ERROR_MSSQL_RESOURCE_UNAVAILABLE;

            // check package items
            if (PackageController.GetPackageItemByName(item.PackageId, groupName, item.Name, typeof(SqlUser)) != null)
                return BusinessErrorCodes.ERROR_MSSQL_USERS_PACKAGE_ITEM_EXISTS;

            // place log record
            TaskManager.StartTask("SQL_USER", "ADD", item.Name);
            TaskManager.WriteParameter("Provider", groupName);

            int itemId = default(int); 
            try
            {
                // check service items
                DatabaseServer sql = GetDatabaseServer(serviceId);
                if (sql.UserExists(item.Name))
                    return BusinessErrorCodes.ERROR_MSSQL_USERS_SERVICE_ITEM_EXISTS;

                // add service item
                sql.CreateUser(item, item.Password);

                // save item
                item.Password = CryptoUtils.Encrypt(item.Password);
                item.ServiceId = serviceId;
                itemId = PackageController.AddPackageItem(item);

                TaskManager.ItemId = itemId;                
            }
            catch (Exception ex)
            {
                TaskManager.WriteError(ex);
				//
                if (ex.Message.Contains("INVALID_USERNAME"))
                    return BusinessErrorCodes.ERROR_MYSQL_INVALID_USER_NAME;
				// Return a generic error instead of default(int)
				itemId = BusinessErrorCodes.FAILED_EXECUTE_SERVICE_OPERATION;
            }
            finally
            {
                TaskManager.CompleteTask();
            }
            return itemId;
        }
Exemplo n.º 21
0
 /// <remarks/>
 public void CreateUserAsync(SqlUser user, string password, object userState)
 {
     if ((this.CreateUserOperationCompleted == null))
     {
         this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted);
     }
     this.InvokeAsync("CreateUser", new object[] {
                 user,
                 password}, this.CreateUserOperationCompleted, userState);
 }
        public void ImportItem(int packageId, int itemTypeId,
            Type itemType, ResourceGroupInfo group, string itemName)
        {
            // get service id
            int serviceId = PackageController.GetPackageServiceId(packageId, group.GroupName);
            if (serviceId == 0)
                return;

            if (itemType == typeof(SqlDatabase))
            {
                // import database
                SqlDatabase db = new SqlDatabase();
                db.ServiceId = serviceId;
                db.PackageId = packageId;
                db.Name = itemName;
                db.GroupName = group.GroupName;
                PackageController.AddPackageItem(db);
            }
            else if (itemType == typeof(SqlUser))
            {
                // import user
                SqlUser user = new SqlUser();
                user.ServiceId = serviceId;
                user.PackageId = packageId;
                user.Name = itemName;
                user.GroupName = group.GroupName;
                user.Password = "";
                PackageController.AddPackageItem(user);
            }
        }
Exemplo n.º 23
0
 public void UpdateUser(SqlUser user, string[] databases)
 {
     this.Invoke("UpdateUser", new object[] {
                 user,
                 databases});
 }
Exemplo n.º 24
0
 public void SaveItem(SqlUser item)
 {
     item.DefaultDatabase = ddlDefaultDatabase.SelectedValue;
 }
Exemplo n.º 25
0
        private void BindItem()
        {
            string policyName = (SqlDatabases.GetDatabasesGroupName(Settings).ToLower().StartsWith("mssql"))
                ? UserSettings.MSSQL_POLICY : UserSettings.MYSQL_POLICY;

            try
            {
                if (!IsPostBack)
                {
                    // load item if required
                    if (PanelRequest.ItemID > 0)
                    {
                        // existing item
                        try
                        {
                            item = ES.Services.DatabaseServers.GetSqlUser(PanelRequest.ItemID);
                        }
                        catch (Exception ex)
                        {
                            ShowErrorMessage("SQL_GET_USER", ex);
                            return;
                        }

                        if (item != null)
                        {
                            // save package info
                            ViewState["PackageId"] = item.PackageId;
                            usernameControl.SetPackagePolicy(item.PackageId, policyName, "UserNamePolicy");
                            passwordControl.SetPackagePolicy(item.PackageId, policyName, "UserPasswordPolicy");
                            BindDatabases(item.PackageId);
                        }
                        else
                            RedirectToBrowsePage();
                    }
                    else
                    {
                        // new item
                        ViewState["PackageId"] = PanelSecurity.PackageId;
                        usernameControl.SetPackagePolicy(PanelSecurity.PackageId, policyName, "UserNamePolicy");
                        passwordControl.SetPackagePolicy(PanelSecurity.PackageId, policyName, "UserPasswordPolicy");
                        BindDatabases(PanelSecurity.PackageId);
                    }
                }

                // load provider control
                LoadProviderControl((int)ViewState["PackageId"], SqlDatabases.GetDatabasesGroupName(Settings),
                    providerControl, "EditUser.ascx");

                IDatabaseEditUserControl ctrl = (IDatabaseEditUserControl)providerControl.Controls[0];
                ctrl.InitControl(SqlDatabases.GetDatabasesGroupName(Settings));

                if (!IsPostBack)
                {
                    // bind item to controls
                    if (item != null)
                    {
                        // bind item to controls
                        usernameControl.Text = item.Name;
                        usernameControl.EditMode = true;
                        passwordControl.EditMode = true;

                        foreach (string database in item.Databases)
                        {
							foreach (ListItem li in dlDatabases.Items)
							{
								if (String.Compare(database, li.Value, true) == 0)
								{
									li.Selected = true;
									break;
								}
							}
                        }

                        // other controls
                        ctrl.BindItem(item);
                    }
                }
            }
            catch
            {
                ShowWarningMessage("INIT_SERVICE_ITEM_FORM");
                DisableFormControls(this, btnCancel);
                return;
            }
        }
Exemplo n.º 26
0
        public virtual void CreateUser(SqlUser user, string password)
        {
            if (user.Databases == null)
                user.Databases = new string[0];

            // create user account
            if (user.DefaultDatabase == null || user.DefaultDatabase == "")
                user.DefaultDatabase = "master";

            //ExecuteNonQuery(String.Format("EXEC sp_addlogin '{0}', '{1}', '{2}'",
            //    user.Name, password, user.DefaultDatabase));
            //Fixed create login with "Enforce password policy" disabled.
            ExecuteNonQuery(
                String.Format("CREATE LOGIN {0} WITH PASSWORD='******', DEFAULT_DATABASE={2}, CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF",
                    user.Name, password, user.DefaultDatabase));

            // add access to databases
            foreach (string database in user.Databases)
                AddUserToDatabase(database, user.Name);
        }
Exemplo n.º 27
0
		/// <remarks/>
		public void UpdateSqlUserAsync(SqlUser item)
		{
			this.UpdateSqlUserAsync(item, null);
		}
Exemplo n.º 28
0
 public void BindItem(SqlUser item)
 {
 }
Exemplo n.º 29
0
 /// <remarks/>
 public void UpdateUserAsync(SqlUser user, string[] databases, object userState)
 {
     if ((this.UpdateUserOperationCompleted == null))
     {
         this.UpdateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateUserOperationCompleted);
     }
     this.InvokeAsync("UpdateUser", new object[] {
                 user,
                 databases}, this.UpdateUserOperationCompleted, userState);
 }
Exemplo n.º 30
0
 /// <remarks/>
 public System.IAsyncResult BeginUpdateUser(SqlUser user, string[] databases, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("UpdateUser", new object[] {
                 user,
                 databases}, callback, asyncState);
 }
Exemplo n.º 31
0
 public void CreateUser(SqlUser user, string password)
 {
     try
     {
         Log.WriteStart("'{0}' CreateUser", ProviderSettings.ProviderName);
         DatabaseProvider.CreateUser(user, password);
         Log.WriteEnd("'{0}' CreateUser", ProviderSettings.ProviderName);
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' CreateUser", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
Exemplo n.º 32
0
 /// <remarks/>
 public void UpdateUserAsync(SqlUser user, string[] databases)
 {
     this.UpdateUserAsync(user, databases, null);
 }
Exemplo n.º 33
0
		/// <remarks/>
		public System.IAsyncResult BeginUpdateSqlUser(SqlUser item, System.AsyncCallback callback, object asyncState)
		{
			return this.BeginInvoke("UpdateSqlUser", new object[] {
                        item}, callback, asyncState);
		}