예제 #1
0
        public void RegisterUrls(IUrlController controller)
        {
            controller.AddRaw("samlresponse", "samlresponse", null, new { handlerHeader = new RequestTypeHandlerMethodConstraint("GET", "POST") },
                              (c, p) =>
            {
                var handler = new SamlResponseHandler();
                handler.ProcessRequest(c.ApplicationInstance.Context);
            },
                              new RawDefinitionOptions()
                              );

            controller.AddRaw("samlauthn", "samlauthn", null, new { handlerHeader = new RequestTypeHandlerMethodConstraint("GET", "POST") },
                              (c, p) =>
            {
                var handler = new SamlAuthnHandler();
                handler.ProcessRequest(c.ApplicationInstance.Context);
            },
                              new RawDefinitionOptions()
                              );

            controller.AddPage("saml-logout", "samllogout", null, null, "saml-logout", new PageDefinitionOptions()
            {
                DefaultPageXml = LoadPageXml("SamlLogout-Social-Site-Page")
            });
        }
예제 #2
0
        public void RegisterUrls(IUrlController controller)
        {
            const string guidConstraintRegex = @"^[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}";
            object       pollIdConstraints   = new { PollId = guidConstraintRegex };
            object       answerIdConstraints = new { PollId = guidConstraintRegex, PollAnswerId = guidConstraintRegex };

            controller.AddPage("polls_list", "polls", null, null, "polls", new PageDefinitionOptions()
            {
                DefaultPageXml = LoadPageXml("polls-Social-Groups-Page")
            });
            controller.AddPage("polls_create", "polls/create", null, null, "createeditpoll", new PageDefinitionOptions()
            {
                DefaultPageXml = LoadPageXml("createeditpoll-Social-Groups-Page")
            });

            controller.AddPage("polls_view", "polls/{PollId}", null, pollIdConstraints, "poll", new PageDefinitionOptions()
            {
                ParseContext = ParsePollContext, DefaultPageXml = LoadPageXml("poll-Social-Groups-Page")
            });
            controller.AddPage("polls_edit", "polls/edit/{PollId}", null, pollIdConstraints, "createeditpoll", new PageDefinitionOptions()
            {
                ParseContext = ParsePollContext, DefaultPageXml = LoadPageXml("createeditpoll-Social-Groups-Page")
            });

            controller.AddRaw("polls_vote", "polls/{PollId}/vote/{PollAnswerId}", null, answerIdConstraints,
                              (a, p) =>
            {
                HandlePollVote(a.ApplicationInstance.Context);
            }, new RawDefinitionOptions()
            {
                ParseContext = ParsePollContext
            });
        }
 public void RegisterUrls(IUrlController controller)
 {
     controller.AddRaw("bundling", "bundling/{*pathInfo}", null, null, null, new RawDefinitionOptions()
     {
         ForceLowercaseUrl = false
     });
 }
예제 #4
0
 void IApplicationNavigable.RegisterUrls(IUrlController controller)
 {
     controller.AddRaw("forum-raw", "{ForumApp}/raw", null, null,
                       (a, p) =>
     {
         var handler = new CustomForumRawHttpHandler();
         handler.ProcessRequest(a.ApplicationInstance.Context);
     }, new RawDefinitionOptions()
     {
         ParseContext = ParseForumContext
     });
 }
예제 #5
0
 public void RegisterUrls(IUrlController controller)
 {
     controller.AddRaw("office365_icon_handler", "icons/office365.png", null, null,
                       (a, p) =>
     {
         var handler = new OAuthIconHandler
         {
             CacheTimeOut = TimeSpan.FromMinutes(5)
         };
         handler.ProcessRequest(a.ApplicationInstance.Context);
     }, new RawDefinitionOptions()
     {
         ParseContext = null
     });
 }
예제 #6
0
        public void RegisterUrls(IUrlController controller)
        {
            controller.AddRaw("ipa-installation", "install-ipa/{*pathInfo}", null, null, (c, p) =>
            {
                string path = c.Request.Url.LocalPath;

                path = path.Substring(path.IndexOf("__key/") + 6);

                if (path.EndsWith("/install.plist"))
                {
                    path = path.Substring(0, path.Length - 14);
                }

                string fileStoreKey = path.Substring(0, path.IndexOf('/'));
                string fileName     = path.Substring(path.LastIndexOf('/') + 1);

                if (path.Length - (fileStoreKey.Length + fileName.Length + 2) <= 0)
                {
                    path = string.Empty;
                }
                else
                {
                    path = path.Substring(fileStoreKey.Length + 1, path.Length - (fileStoreKey.Length + fileName.Length + 2));
                }

                fileStoreKey = PublicApi.Url.DecodePathComponent(fileStoreKey);
                fileName     = PublicApi.Url.DecodeFileComponent(fileName);
                path         = PublicApi.Url.DecodePathComponent(path);

                if (!CentralizedFileStorage.CurrentUserHasAccess(fileStoreKey, path, fileName))
                {
                    c.Response.StatusCode = 404;
                    return;
                }

                var fileStore = CentralizedFileStorage.GetFileStore(fileStoreKey);
                if (fileStore == null)
                {
                    c.Response.StatusCode = 404;
                    return;
                }

                var file = fileStore.GetFile(path, fileName);
                if (file == null)
                {
                    c.Response.StatusCode = 404;
                    return;
                }

                var appData = Telligent.Evolution.Mobile.ServiceLocator.Get <Telligent.Evolution.Mobile.App.Services.IAppDataService>().Get(file);
                if (appData == null)
                {
                    c.Response.StatusCode = 404;
                    return;
                }

                c.Response.ContentType = "application/xml";
                c.Response.Write(string.Format(@"<?xml version=""1.0"" encoding=""UTF-8""?>
<!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd"">
<plist version=""1.0"">
	<dict>
		<!-- array of downloads. -->
		<key>items</key>
		<array>
			<dict>
				<!-- an array of assets to download -->
				<key>assets</key>
				<array>
					<!-- software-package: the ipa to install. -->
					<dict>
						<!-- required.  the asset kind. -->
						<key>kind</key>
						<string>software-package</string>

						<!-- required.  the URL of the file to download. -->
						<key>url</key>
						<string>{0}</string>
					</dict>
				</array>

				<key>metadata</key>
				<dict>
					<!-- required -->
					<key>bundle-identifier</key>
					<string>{2}</string>

					<!-- required.  the download kind. -->
					<key>kind</key>
					<string>software</string>

					<!-- required.  the title to display during the download. -->
					<key>title</key>
					<string>{1}</string>
				</dict>
			</dict>
		</array>
	</dict>
</plist>", PublicApi.Html.Encode(PublicApi.Url.Absolute(file.GetDownloadUrl())), PublicApi.Html.Encode(appData.Name), PublicApi.Html.Encode(appData.ApplicationId)));
            }, new RawDefinitionOptions()
            {
                ForceLowercaseUrl = false, EnableRemoteProxying = true
            });
        }
예제 #7
0
        public void RegisterUrls(IUrlController controller)
        {
            controller.AddRaw("samlresponse", "samlresponse", null, new { handlerHeader = new RequestTypeHandlerMethodConstraint("GET", "POST") },
               (c, p) =>
               {
                   var handler = new SamlResponseHandler();
                   handler.ProcessRequest(c.ApplicationInstance.Context);
               },
               new RawDefinitionOptions()
               );

            controller.AddRaw("samlauthn", "samlauthn", null, new { handlerHeader = new RequestTypeHandlerMethodConstraint("GET", "POST") },
               (c, p) =>
               {
                   var handler = new SamlAuthnHandler();
                   handler.ProcessRequest(c.ApplicationInstance.Context);
               },
               new RawDefinitionOptions()
               );

            controller.AddPage("saml-logout", "samllogout", null, null, "saml-logout", new PageDefinitionOptions() { DefaultPageXml = LoadPageXml("SamlLogout-Social-Site-Page") });
        }
예제 #8
0
        public void RegisterUrls(IUrlController controller)
        {
            const string guidConstraintRegex = @"^[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}";
            object pollIdConstraints = new { PollId = guidConstraintRegex };
            object answerIdConstraints = new { PollId = guidConstraintRegex, PollAnswerId = guidConstraintRegex };

            controller.AddPage("polls_list", "polls", null, null, "polls", new PageDefinitionOptions() { DefaultPageXml = LoadPageXml("polls-Social-Groups-Page") });
            controller.AddPage("polls_create", "polls/create", null, null, "createeditpoll", new PageDefinitionOptions() { DefaultPageXml = LoadPageXml("createeditpoll-Social-Groups-Page") });

            controller.AddPage("polls_view", "polls/{PollId}", null, pollIdConstraints, "poll", new PageDefinitionOptions() { ParseContext = ParsePollContext, DefaultPageXml = LoadPageXml("poll-Social-Groups-Page") });
            controller.AddPage("polls_edit", "polls/edit/{PollId}", null, pollIdConstraints, "createeditpoll", new PageDefinitionOptions() { ParseContext = ParsePollContext, DefaultPageXml = LoadPageXml("createeditpoll-Social-Groups-Page") });

            controller.AddRaw("polls_vote", "polls/{PollId}/vote/{PollAnswerId}", null, answerIdConstraints,
                (a, p) =>
                {
                    HandlePollVote(a.ApplicationInstance.Context);
                }, new RawDefinitionOptions() { ParseContext = ParsePollContext });
        }
 public void RegisterUrls(IUrlController controller)
 {
     controller.AddRaw("bundling", "bundling/{*pathInfo}", null, null, null, new RawDefinitionOptions()
     {
         ForceLowercaseUrl = false
     });
 }