|
|
@ -76,12 +76,48 @@ namespace FLocal.IISHandler { |
|
|
|
default: |
|
|
|
default: |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
case "my": |
|
|
|
|
|
|
|
if(context.requestParts.Length == 1) { |
|
|
|
|
|
|
|
if(context.account != null) { |
|
|
|
|
|
|
|
throw new RedirectException("/My/Conversations/"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
throw new RedirectException("/My/Login/"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
switch(context.requestParts[1].ToLower()) { |
|
|
|
case "login": |
|
|
|
case "login": |
|
|
|
|
|
|
|
if(context.requestParts.Length == 2) { |
|
|
|
return new handlers.response.LoginHandler(); |
|
|
|
return new handlers.response.LoginHandler(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
switch(context.requestParts[2].ToLower()) { |
|
|
|
case "migrateaccount": |
|
|
|
case "migrateaccount": |
|
|
|
return new handlers.response.MigrateAccountHandler(); |
|
|
|
return new handlers.response.MigrateAccountHandler(); |
|
|
|
case "registerbyinvite": |
|
|
|
case "registerbyinvite": |
|
|
|
return new handlers.response.RegisterByInviteHandler(); |
|
|
|
return new handlers.response.RegisterByInviteHandler(); |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case "settings": |
|
|
|
|
|
|
|
return new handlers.response.SettingsHandler(); |
|
|
|
|
|
|
|
case "conversations": |
|
|
|
|
|
|
|
if(context.requestParts.Length == 2) { |
|
|
|
|
|
|
|
return new handlers.response.ConversationsHandler(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
switch(context.requestParts[2].ToLower()) { |
|
|
|
|
|
|
|
case "conversation": |
|
|
|
|
|
|
|
return new handlers.response.ConversationHandler(); |
|
|
|
|
|
|
|
case "pmsend": |
|
|
|
|
|
|
|
return new handlers.response.PMSendHandler(); |
|
|
|
|
|
|
|
case "pmreply": |
|
|
|
|
|
|
|
return new handlers.response.PMReplyHandler(); |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return new handlers.response.ConversationsHandler(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
|
|
|
|
} |
|
|
|
case "users": |
|
|
|
case "users": |
|
|
|
if(context.requestParts.Length == 1) { |
|
|
|
if(context.requestParts.Length == 1) { |
|
|
|
throw new RedirectException("/Users/All/"); |
|
|
|
throw new RedirectException("/Users/All/"); |
|
|
@ -93,17 +129,14 @@ namespace FLocal.IISHandler { |
|
|
|
return new handlers.response.ActiveAccountListHandler(); |
|
|
|
return new handlers.response.ActiveAccountListHandler(); |
|
|
|
case "online": |
|
|
|
case "online": |
|
|
|
return new handlers.response.WhoIsOnlineHandler(); |
|
|
|
return new handlers.response.WhoIsOnlineHandler(); |
|
|
|
default: |
|
|
|
|
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case "user": |
|
|
|
case "user": |
|
|
|
if(context.requestParts.Length < 2) { |
|
|
|
if(context.requestParts.Length < 3) { |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(context.requestParts.Length == 2) { |
|
|
|
if(context.requestParts.Length == 3) { |
|
|
|
return new handlers.response.UserInfoHandler(); |
|
|
|
return new handlers.response.UserInfoHandler(); |
|
|
|
} |
|
|
|
} |
|
|
|
switch(context.requestParts[2].ToLower()) { |
|
|
|
switch(context.requestParts[3].ToLower()) { |
|
|
|
case "posts": |
|
|
|
case "posts": |
|
|
|
return new handlers.response.UserPostsHandler(); |
|
|
|
return new handlers.response.UserPostsHandler(); |
|
|
|
case "replies": |
|
|
|
case "replies": |
|
|
@ -113,19 +146,12 @@ namespace FLocal.IISHandler { |
|
|
|
default: |
|
|
|
default: |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
} |
|
|
|
} |
|
|
|
case "settings": |
|
|
|
default: |
|
|
|
return new handlers.response.SettingsHandler(); |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
case "conversations": |
|
|
|
} |
|
|
|
return new handlers.response.ConversationsHandler(); |
|
|
|
|
|
|
|
case "conversation": |
|
|
|
|
|
|
|
return new handlers.response.ConversationHandler(); |
|
|
|
|
|
|
|
case "pmsend": |
|
|
|
|
|
|
|
return new handlers.response.PMSendHandler(); |
|
|
|
|
|
|
|
case "pmreply": |
|
|
|
|
|
|
|
return new handlers.response.PMReplyHandler(); |
|
|
|
|
|
|
|
case "upload": |
|
|
|
case "upload": |
|
|
|
if(context.requestParts.Length < 2) { |
|
|
|
if(context.requestParts.Length < 2) { |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
throw new RedirectException("/Upload/List/"); |
|
|
|
} |
|
|
|
} |
|
|
|
switch(context.requestParts[1].ToLower()) { |
|
|
|
switch(context.requestParts[1].ToLower()) { |
|
|
|
case "item": |
|
|
|
case "item": |
|
|
@ -161,6 +187,14 @@ namespace FLocal.IISHandler { |
|
|
|
return new handlers.response.LocalNetworksListHandler(); |
|
|
|
return new handlers.response.LocalNetworksListHandler(); |
|
|
|
case "static": |
|
|
|
case "static": |
|
|
|
return new handlers.StaticHandler(context.requestParts); |
|
|
|
return new handlers.StaticHandler(context.requestParts); |
|
|
|
|
|
|
|
case "registerbyinvite": |
|
|
|
|
|
|
|
string[] rbi_parts = context.requestParts; |
|
|
|
|
|
|
|
rbi_parts[0] = "My/Login/RegisterByInvite"; |
|
|
|
|
|
|
|
throw new RedirectException("/" + string.Join("/", rbi_parts)); |
|
|
|
|
|
|
|
case "user": |
|
|
|
|
|
|
|
string[] u_parts = context.requestParts; |
|
|
|
|
|
|
|
u_parts[0] = "Users/User"; |
|
|
|
|
|
|
|
throw new RedirectException("/" + string.Join("/", u_parts)); |
|
|
|
case "do": |
|
|
|
case "do": |
|
|
|
if(context.requestParts.Length < 2) { |
|
|
|
if(context.requestParts.Length < 2) { |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|
return new handlers.WrongUrlHandler(); |
|
|
|