SiteFinity如果用户登录 [英] SiteFinity if user logged in

查看:190
本文介绍了SiteFinity如果用户登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来SiteFinity。这是我所见过它的第一次。

I am new to SiteFinity. This is the first time I have ever seen it.

我试图找出如何检查用户是否登录,如果是这样,不加载某些JavaScript文件(我们是造成问题sitefinity的页面编辑冲突)

I am trying to find out how to check to see if the user is logged in and if they are, do not load certain javascript files (we have a conflict that is causing problems with sitefinity's page editor)

因此​​,在头我想要做这样的事情。

So in the header I want to do something like

如果(user_logged_in())
     ...这里装载的js文件

if(user_logged_in()) ... load js file here

另外,我想这样做在主模板文件。

Also I am trying to do this in the master template files.

6.1版FYI

推荐答案

您可以试试:

ClaimsManager.GetCurrentIdentity().IsAuthenticated

这将返回该用户是否登录,但它听起来就像你需要知道,如果他们是一个后台用户,所以也许尝试:

This will return whether or not the user is logged in but it sounds like you need to know if they are a backend user so maybe try:

ClaimsManager.GetCurrentIdentity().IsBackendUser

您需要使用这个指令:

using Telerik.Sitefinity.Security.Claims;

这篇关于SiteFinity如果用户登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆