private void HandlePersonalRequest(HttpContext context) { string loginUrl = WebSupport.GetLoginUrl(context); TBRLoginRoot loginRoot = TBRLoginRoot.GetOrCreateLoginRootWithAccount(loginUrl, true); bool doDelete = false; if (doDelete) { loginRoot.DeleteInformationObject(); return; } TBAccount account = loginRoot.Account; string requestPath = context.Request.Path; string contentPath = requestPath.Substring(AuthPersonalPrefixLen); HandleOwnerRequest(account, context, contentPath, TBCollaboratorRole.CollaboratorRoleValue); }
private void HandleGroupRequest(HttpContext context) { string requestPath = context.Request.Path; string groupID = GetGroupID(context.Request.Path); string loginUrl = WebSupport.GetLoginUrl(context); string loginRootID = TBLoginInfo.GetLoginIDFromLoginURL(loginUrl); string loginGroupID = TBRLoginGroupRoot.GetLoginGroupID(groupID, loginRootID); TBRLoginGroupRoot loginGroupRoot = TBRLoginGroupRoot.RetrieveFromDefaultLocation(loginGroupID); if (loginGroupRoot == null) { // TODO: Polite invitation request throw new SecurityException("No access to requested group: TODO - Polite landing page for the group"); return; } InformationContext.Current.CurrentGroupRole = loginGroupRoot.Role; string contentPath = requestPath.Substring(AuthGroupPrefixLen + GuidIDLen + 1); HandleOwnerRequest(loginGroupRoot, context, contentPath, loginGroupRoot.Role); }
private void HandleEmailValidation(HttpContext context) { string loginUrl = WebSupport.GetLoginUrl(context); TBRLoginRoot loginRoot = TBRLoginRoot.GetOrCreateLoginRootWithAccount(loginUrl, false); string requestPath = context.Request.Path; string emailValidationID = requestPath.Substring(AuthEmailValidationLen); TBAccount account = loginRoot.Account; TBEmailValidation emailValidation = TBEmailValidation.RetrieveFromDefaultLocation(emailValidationID); if (emailValidation == null) { RespondEmailValidationRecordNotExist(context); return; } StorageSupport.DeleteInformationObject(emailValidation); if (emailValidation.ValidUntil < DateTime.UtcNow) { RespondEmailValidationExpired(context, emailValidation); return; } if (emailValidation.GroupJoinConfirmation != null) { HandleGroupJoinConfirmation(context, account, emailValidation); } else if (emailValidation.DeviceJoinConfirmation != null) { HandleDeviceJoinConfirmation(context, account, emailValidation); } else if (emailValidation.InformationInputConfirmation != null) { HandleInputJoinConfirmation(context, account, emailValidation); } else { HandleAccountEmailValidation(context, account, emailValidation); } }