Пример #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
        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);
        }