diff options
| author | Michael <[email protected]> | 2017-05-06 12:16:41 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-06 12:16:41 -0400 |
| commit | e131f72a9b863cc75a4db71670c41efa319886fb (patch) | |
| tree | c2b8daa8e4b6ea8a3cc7d4c3d348f70386c0f3a5 /ShiftOS_TheReturn/UserManagementCommands.cs | |
| parent | 57277a01d685b0e29a79e5d74a1465a2ceb23ef9 (diff) | |
| download | shiftos_thereturn-e131f72a9b863cc75a4db71670c41efa319886fb.tar.gz shiftos_thereturn-e131f72a9b863cc75a4db71670c41efa319886fb.tar.bz2 shiftos_thereturn-e131f72a9b863cc75a4db71670c41efa319886fb.zip | |
Fix the file skimmer pins.
Diffstat (limited to 'ShiftOS_TheReturn/UserManagementCommands.cs')
| -rw-r--r-- | ShiftOS_TheReturn/UserManagementCommands.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/UserManagementCommands.cs b/ShiftOS_TheReturn/UserManagementCommands.cs index 1c3c0ed..21c984b 100644 --- a/ShiftOS_TheReturn/UserManagementCommands.cs +++ b/ShiftOS_TheReturn/UserManagementCommands.cs @@ -53,6 +53,9 @@ namespace ShiftOS.Engine return true; } + + + [Command("set_acl")] [RequiresArgument("user")] [RequiresArgument("val")] @@ -122,7 +125,31 @@ namespace ShiftOS.Engine [RequiresUpgrade("mud_fundamentals")] public static class UserManagementCommands { + [Command("login", description = "Log in as another user.")] + [RequiresArgument("user")] + [RequiresArgument("pass")] + public static bool Login(Dictionary<string, object> args) + { + string user = args["user"].ToString(); + string pass = args["pass"].ToString(); + var usr = SaveSystem.CurrentSave.Users.FirstOrDefault(x => x.Username == user); + if(usr==null) + { + Console.WriteLine("Error: No such user."); + return true; + } + + if (usr.Password != pass) + { + Console.WriteLine("Access denied."); + return true; + } + + SaveSystem.CurrentUser = usr; + Console.WriteLine("Access granted."); + return true; + } [Command("setpass", description ="Allows you to set your password to a new value.", usage ="old:,new:")] [RequiresArgument("old")] |
