示例#1
0
        public static MaintainUsersTDS LoadUsersAndModulePermissions()
        {
            TDBTransaction   ReadTransaction = null;
            MaintainUsersTDS ReturnValue     = new MaintainUsersTDS();

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted,
                                                                      TEnforceIsolationLevel.eilMinimum,
                                                                      ref ReadTransaction,
                                                                      delegate
            {
                SUserAccess.LoadAll(ReturnValue, ReadTransaction);
                SUserModuleAccessPermissionAccess.LoadAll(ReturnValue, ReadTransaction);
                SModuleAccess.LoadAll(ReturnValue, ReadTransaction);
            });

            // Remove Password Hash and Password 'Salt' before passing it out to the caller - these aren't needed
            // and it is better to not hand them out needlessly to prevent possible 'eavesdropping' by an attacker
            // (who could otherwise gather the Password Hashes and Password 'Salts' of all users in one go if the
            // attacker manages to listen to network traffic). (#5502)!
            foreach (var UserRow in ReturnValue.SUser.Rows)
            {
                ((SUserRow)UserRow).PasswordHash = "****************";
                ((SUserRow)UserRow).PasswordSalt = "****************";
            }

            ReturnValue.AcceptChanges();

            return(ReturnValue);
        }
示例#2
0
        public static MaintainUsersTDS LoadUsersAndModulePermissions()
        {
            MaintainUsersTDS ReturnValue = null;

            Boolean        NewTransaction;
            TDBTransaction Transaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.ReadCommitted,
                                                                                           TEnforceIsolationLevel.eilMinimum, out NewTransaction);

            try
            {
                ReturnValue = new MaintainUsersTDS();
                SUserAccess.LoadAll(ReturnValue, Transaction);
                SUserModuleAccessPermissionAccess.LoadAll(ReturnValue, Transaction);
                SModuleAccess.LoadAll(ReturnValue, Transaction);
            }
            catch (Exception e)
            {
                TLogging.Log(e.Message);
                TLogging.Log(e.StackTrace);
                ReturnValue = null;
            }

            if (NewTransaction)
            {
                DBAccess.GDBAccessObj.RollbackTransaction();
            }

            return(ReturnValue);
        }
示例#3
0
        /// <summary>
        /// get the datatable from the database
        /// </summary>
        /// <param name="ATableName">name of table to retrieve</param>
        /// <returns></returns>
        public DataTable GetData(string ATableName)
        {
            DataTable      table           = new DataTable();
            TDBTransaction ReadTransaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.RepeatableRead, 5);

            if (ATableName == SUserTable.GetTableDBName())
            {
                table = SUserAccess.LoadAll(ReadTransaction);
            }

            return(table);
        }
示例#4
0
        private DataTable GetUserListTable(TDBTransaction AReadTransaction, string ATableName)
        {
            DataColumn LastAndFirstNameColumn;
            DataTable  TmpTable = SUserAccess.LoadAll(AReadTransaction);

            // add column to display a combination of last and first name
            LastAndFirstNameColumn            = new DataColumn();
            LastAndFirstNameColumn.DataType   = System.Type.GetType("System.String");
            LastAndFirstNameColumn.ColumnName = MSysManConstants.USER_LAST_AND_FIRST_NAME_COLUMNNAME;
            LastAndFirstNameColumn.Expression = string.Format("{0} + ' ' + {1}", SUserTable.GetFirstNameDBName(), SUserTable.GetLastNameDBName());
            TmpTable.Columns.Add(LastAndFirstNameColumn);

            return(TmpTable);
        }
示例#5
0
        public static MaintainUsersTDS LoadUsersAndModulePermissions()
        {
            TDBTransaction   ReadTransaction = null;
            MaintainUsersTDS ReturnValue     = new MaintainUsersTDS();

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted,
                                                                      TEnforceIsolationLevel.eilMinimum,
                                                                      ref ReadTransaction,
                                                                      delegate
            {
                SUserAccess.LoadAll(ReturnValue, ReadTransaction);
                SUserModuleAccessPermissionAccess.LoadAll(ReturnValue, ReadTransaction);
                SModuleAccess.LoadAll(ReturnValue, ReadTransaction);
            });

            return(ReturnValue);
        }