- Timestamp:
- May 7, 2023, 5:05:29 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/Permissions/AdminWebUsers.cs
r404 r433 133 133 } 134 134 135 public WebUser? GetUser (string _name, string _password) {136 if (users.TryGetValue (_name, out WebUser user) && user.ValidatePassword (_password)) {137 return user;135 public bool TryGetUser (string _name, string _password, out WebUser _result) { 136 if (users.TryGetValue (_name, out _result) && _result.ValidatePassword (_password)) { 137 return true; 138 138 } 139 139 140 return null; 140 _result = default; 141 return false; 141 142 } 142 143 144 public bool HasUser (PlatformUserIdentifierAbs _platformUser, PlatformUserIdentifierAbs _crossPlatformUser, out WebUser _result) { 145 _result = default; 146 147 foreach ((string _, WebUser webUser) in users) { 148 if (!PlatformUserIdentifierAbs.Equals (webUser.PlatformUser, _platformUser) || 149 !PlatformUserIdentifierAbs.Equals (webUser.CrossPlatformUser, _crossPlatformUser)) { 150 continue; 151 } 143 152 144 #region Specials 153 _result = webUser; 154 return true; 155 } 145 156 146 147 #endregion 157 return false; 158 } 159 148 160 } 149 161 }
Note:
See TracChangeset
for help on using the changeset viewer.