diff options
| author | Michael <[email protected]> | 2017-05-11 19:44:52 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-11 19:44:52 -0400 |
| commit | 1abd027bdbd55fac59ad5bcdd8df301bb2499204 (patch) | |
| tree | 76c631f7fb4c1eadf1ed5d720afbde28ea9146ed /Project-Unite | |
| parent | dbce55459fae3568c3cd69562b5fe37bc7493d1c (diff) | |
| download | project-unite-1abd027bdbd55fac59ad5bcdd8df301bb2499204.tar.gz project-unite-1abd027bdbd55fac59ad5bcdd8df301bb2499204.tar.bz2 project-unite-1abd027bdbd55fac59ad5bcdd8df301bb2499204.zip | |
Fix even more bugs.
Diffstat (limited to 'Project-Unite')
| -rw-r--r-- | Project-Unite/Controllers/ModeratorController.cs | 9 | ||||
| -rw-r--r-- | Project-Unite/Global.asax.cs | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/ModeratorController.cs b/Project-Unite/Controllers/ModeratorController.cs index 04e40de..70404e4 100644 --- a/Project-Unite/Controllers/ModeratorController.cs +++ b/Project-Unite/Controllers/ModeratorController.cs @@ -104,6 +104,15 @@ namespace Project_Unite.Controllers return Redirect(returnUrl); } + public ActionResult GetUsername(string id) + { + var db = new ApplicationDbContext(); + var usr = db.Users.FirstOrDefault(x => x.Id == id); + if (usr == null) + return new HttpStatusCodeResult(404); + return Content(usr.DisplayName); + } + public ActionResult ChangeUserName(string id, string newName) { var db = new ApplicationDbContext(); diff --git a/Project-Unite/Global.asax.cs b/Project-Unite/Global.asax.cs index 79df7eb..4e9b93d 100644 --- a/Project-Unite/Global.asax.cs +++ b/Project-Unite/Global.asax.cs @@ -68,6 +68,13 @@ namespace Project_Unite actionname = split[2]; } + try + { + string paramsequence = actionname.Substring(actionname.IndexOf("?")); + actionname = actionname.Replace(paramsequence, ""); + } + catch { } + var asm = Assembly.GetExecutingAssembly(); var ctl = asm.GetTypes().FirstOrDefault(x => x.Name == controllername + "Controller"); var adm = ctl.GetCustomAttributes(false).FirstOrDefault(x => x is RequiresAdmin); |
