我可以强制SSL来保护Dotnetnuke模块编辑页面吗?(Can I force SSL to secure a Dotnetnuke Module Edit Page?)

编程入门 行业动态 更新时间:2024-10-24 08:23:29
我可以强制SSL来保护Dotnetnuke模块编辑页面吗?(Can I force SSL to secure a Dotnetnuke Module Edit Page?)

我有一个DNN模块,如果VIEW页面不使用SSL ,我不在乎。

但是,当模块编辑器在管理模板中加载模块的EDIT页面 (我的模块是页面上唯一的模块)时,如果站点具有SSL功能,我想使用SSL安全地加载页面。

这可能吗?

I have a DNN modules where I don't care if the VIEW page does not use SSL.

However, when a module editor loads my modules' EDIT page in the admin template (my module is the only module on the page) I want to load the page securely using SSL, if the site has SSL capability.

Is this possible?

最满意答案

是的,只需将以下内容放在模块代码的开头即可。

// Force Page to use SSL if it can. if (PortalSettings.SSLEnabled && !Request.IsSecureConnection) { DotNetNuke.Security.PortalSecurity.ForceSecureConnection(); }

Yes, just put the following at the start of the modules's code behind.

// Force Page to use SSL if it can. if (PortalSettings.SSLEnabled && !Request.IsSecureConnection) { DotNetNuke.Security.PortalSecurity.ForceSecureConnection(); }

更多推荐

本文发布于:2023-07-08 19:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1080216.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   编辑   页面   Dotnetnuke   SSL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!