From 508e9af467d42d4a862336e2d4a9f74009711d00 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Fri, 3 Sep 2010 17:33:06 +0000 Subject: [PATCH] /User/name/ url support --- Builder/IISMainHandler/build.txt | 2 +- IISMainHandler/handlers/response/UserInfoHandler.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 03c4ecb..c16c9d0 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -1044 \ No newline at end of file +1046 \ No newline at end of file diff --git a/IISMainHandler/handlers/response/UserInfoHandler.cs b/IISMainHandler/handlers/response/UserInfoHandler.cs index 21d0532..cbed467 100644 --- a/IISMainHandler/handlers/response/UserInfoHandler.cs +++ b/IISMainHandler/handlers/response/UserInfoHandler.cs @@ -21,7 +21,15 @@ namespace FLocal.IISHandler.handlers.response { } override protected IEnumerable getSpecificData(WebContext context) { - User user = User.LoadById(int.Parse(context.requestParts[1])); + User user; + { + int userId; + if(int.TryParse(context.requestParts[1], out userId)) { + user = User.LoadById(userId); + } else { + user = User.LoadByName(context.requestParts[1]); + } + } Account account = null; if(context.session != null) { try {