[英]Can I force SSL to secure a Dotnetnuke Module Edit Page?
I have a DNN modules where I don't care if the VIEW page does not use SSL . 我有一个DNN模块,不在乎VIEW页面是否不使用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. 但是,当模块编辑器在管理模板中加载我模块的EDIT页面时(我的模块是页面上的唯一模块),如果站点具有SSL功能,我想使用SSL安全地加载页面。
Is this possible? 这可能吗?
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();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.