本文整理汇总了C#中CurrentUserInfo类的典型用法代码示例。如果您正苦于以下问题:C# CurrentUserInfo类的具体用法?C# CurrentUserInfo怎么用?C# CurrentUserInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CurrentUserInfo类属于命名空间,在下文中一共展示了CurrentUserInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
currentUser = CMSContext.CurrentUser;
string imagePath = URLHelper.ResolveUrl(GetImageUrl("Objects/CMS_Friend/"));
ScriptHelper.RegisterDialogScript(this);
FriendsList.UserID = currentUser.UserID;
FriendsList.OnCheckPermissions += CheckPermissions;
FriendsList.ZeroRowsText = GetString("friends.nofriends");
// Request friend link
string script =
"function displayRequest(){ \n" +
"modalDialog('" + CMSContext.ResolveDialogUrl("~/CMSModules/Friends/Dialogs/Friends_Request.aspx") + "?userid=" + currentUser.UserID + "', 'rejectDialog', 480, 350);}";
ScriptHelper.RegisterStartupScript(this, GetType(), "displayModalRequest", ScriptHelper.GetScript(script));
string[,] actions = new string[1, 6];
actions[0, 0] = HeaderActions.TYPE_HYPERLINK;
actions[0, 1] = GetString("Friends_List.NewItemCaption");
actions[0, 2] = null;
actions[0, 3] = "javascript:displayRequest();";
actions[0, 4] = null;
actions[0, 5] = imagePath + "add.png";
CurrentMaster.HeaderActions.Actions = actions;
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
userId = QueryHelper.GetInteger("userId", 0);
currentUser = CMSContext.CurrentUser;
// Check 'read' permissions
if (!currentUser.IsAuthorizedPerResource("CMS.Friends", "Read") && (currentUser.UserID != userId))
{
RedirectToAccessDenied("CMS.Friends", "Read");
}
// Check license
if (DataHelper.GetNotEmpty(URLHelper.GetCurrentDomain(), string.Empty) != string.Empty)
{
LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetCurrentDomain(), FeatureEnum.Friends);
}
// initializes breadcrumbs
string[,] pageTitleTabs = new string[1, 3];
pageTitleTabs[0, 0] = GetString("friends.friends");
pageTitleTabs[0, 1] = "";
pageTitleTabs[0, 2] = "";
CurrentMaster.Title.Breadcrumbs = pageTitleTabs;
CurrentMaster.Title.HelpTopicName = "friends_myfriends";
CurrentMaster.Title.HelpName = "helpTopic";
if (!RequestHelper.IsPostBack())
{
InitalizeMenu();
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
currentUser = CMSContext.CurrentUser;
currentObject = (ContactRoleInfo)EditedObject;
// Check read permission
currentObjectSiteId = currentObject != null ? currentObject.ContactRoleSiteID : siteID;
this.CheckReadPermission(currentObjectSiteId);
// Preserve site info passed in query
CurrentMaster.Title.Breadcrumbs[0, 1] = AddSiteQuery(CurrentMaster.Title.Breadcrumbs[0, 1], siteID);
EditForm.RedirectUrlAfterSave = AddSiteQuery(EditForm.RedirectUrlAfterSave, siteID);
// Set new site ID for new object
if (EditedObject == null)
{
if ((siteID == UniSelector.US_GLOBAL_RECORD) && ModifyGlobalConfiguration)
{
EditForm.Data["ContactRoleSiteID"] = DBNull.Value;
}
else if (this.IsSiteManager && currentUser.UserSiteManagerAdmin)
{
EditForm.Data["ContactRoleSiteID"] = siteID;
}
else
{
EditForm.Data["ContactRoleSiteID"] = CMSContext.CurrentSiteID;
}
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
currentUser = CMSContext.CurrentUser;
if (currentUser == null)
{
return;
}
// Page title
CurrentMaster.Title.TitleText = GetString("avat.title");
CurrentMaster.Title.TitleImage = GetImageUrl("Objects/CMS_Avatar/object.png");
CurrentMaster.Title.HelpTopicName = "avatars_list";
CurrentMaster.Title.HelpName = "helpTopic";
// New item link
string[,] actions = new string[1,6];
actions[0, 0] = HeaderActions.TYPE_HYPERLINK;
actions[0, 1] = GetString("avat.newavatar");
actions[0, 2] = null;
actions[0, 3] = ResolveUrl("Avatar_Edit.aspx");
actions[0, 4] = null;
actions[0, 5] = GetImageUrl("Objects/CMS_Avatar/add.png");
CurrentMaster.HeaderActions.Actions = actions;
// Set up unigrid options
unigridAvatarList.OrderBy = "AvatarName";
unigridAvatarList.OnExternalDataBound += unigridAvatarList_OnExternalDataBound;
unigridAvatarList.OnAction += unigridAvatarList_OnAction;
unigridAvatarList.GridView.PageSize = 10;
unigridAvatarList.ZeroRowsText = GetString("general.nodatafound");
unigridAvatarList.HideFilterButton = true;
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// Check license
if (DataHelper.GetNotEmpty(URLHelper.GetCurrentDomain(), string.Empty) != string.Empty)
{
LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetCurrentDomain(), FeatureEnum.Friends);
}
userId = QueryHelper.GetInteger("userid", 0);
currentUser = CMSContext.CurrentUser;
int requestedUserId = QueryHelper.GetInteger("requestid", 0);
CurrentMaster.Title.TitleText = GetString("friends.addnewfriend");
CurrentMaster.Title.TitleImage = GetImageUrl("CMSModules/CMS_Friends/request.png");
FriendsRequest.UserID = userId;
FriendsRequest.RequestedUserID = requestedUserId;
FriendsRequest.OnCheckPermissions += FriendsRequest_OnCheckPermissions;
FriendsRequest.IsLiveSite = true;
if (requestedUserId != 0)
{
string fullUserName = String.Empty;
UserInfo requestedUser = UserInfoProvider.GetFullUserInfo(requestedUserId);
if (requestedUser != null)
{
fullUserName = Functions.GetFormattedUserName(requestedUser.UserName, requestedUser.FullName, requestedUser.UserNickName, true);
}
Page.Title = string.Format(GetString("friends.requestfriendshipwith"), HTMLHelper.HTMLEncode(fullUserName));
CurrentMaster.Title.TitleText = Page.Title;
}
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
currentUser = MembershipContext.AuthenticatedUser;
currentObject = (ContactRoleInfo)EditedObject;
// Check read permission
currentObjectSiteId = currentObject.ContactRoleID != 0 ? currentObject.ContactRoleSiteID : siteID;
CheckReadPermission(currentObjectSiteId);
// Preserve site info passed in query
PageBreadcrumbs.Items[0].RedirectUrl = AddSiteQuery(PageBreadcrumbs.Items[0].RedirectUrl, siteID);
EditForm.RedirectUrlAfterSave = AddSiteQuery(EditForm.RedirectUrlAfterSave, siteID);
ContactRoleInfo contactRole = EditForm.EditedObject as ContactRoleInfo;
// Set new site ID for new object
if ((contactRole == null) || (contactRole.ContactRoleID < 1))
{
if ((siteID == UniSelector.US_GLOBAL_RECORD) && ModifyGlobalConfiguration)
{
EditForm.Data["ContactRoleSiteID"] = null;
}
else if (IsSiteManager && currentUser.CheckPrivilegeLevel(UserPrivilegeLevelEnum.GlobalAdmin))
{
EditForm.Data["ContactRoleSiteID"] = siteID;
}
else
{
EditForm.Data["ContactRoleSiteID"] = SiteContext.CurrentSiteID;
}
}
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
userId = QueryHelper.GetInteger("userid", 0);
currentUser = MembershipContext.AuthenticatedUser;
// Check license
if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, string.Empty) != string.Empty)
{
LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Friends);
}
int requestedUserId = QueryHelper.GetInteger("requestid", 0);
Page.Title = GetString("friends.addnewfriend");
PageTitle.TitleText = Page.Title;
FriendsRequest.UserID = userId;
FriendsRequest.RequestedUserID = requestedUserId;
FriendsRequest.OnCheckPermissions += FriendsRequest_OnCheckPermissions;
if (requestedUserId != 0)
{
UserInfo requestedUser = UserInfoProvider.GetUserInfo(requestedUserId);
string fullUserName = Functions.GetFormattedUserName(requestedUser.UserName, requestedUser.FullName, requestedUser.UserNickName, false);
Page.Title = string.Format(GetString("friends.requestfriendshipwith"), HTMLHelper.HTMLEncode(fullUserName));
PageTitle.TitleText = Page.Title;
}
}
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
currentUser = MembershipContext.AuthenticatedUser;
if (currentUser == null)
{
return;
}
// Check 'ReadForm' permission
if (!currentUser.IsAuthorizedPerResource("cms.form", "ReadForm"))
{
RedirectToAccessDenied("cms.form", "ReadForm");
}
UniGridBizForms.OnAction += UniGridBizForms_OnAction;
UniGridBizForms.OnAfterRetrieveData += uniGrid_OnAfterRetrieveData;
UniGridBizForms.HideControlForZeroRows = false;
UniGridBizForms.ZeroRowsText = GetString("general.nodatafound");
UniGridBizForms.WhereCondition = "FormSiteID = " + SiteContext.CurrentSiteID;
PageTitle.TitleText = GetString("BizFormList.TitleText");
InitHeaderActions();
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:25,代码来源:BizForm_List.aspx.cs
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
cu = MembershipContext.AuthenticatedUser;
// Check 'Manage' permission
if (!cu.IsGroupAdministrator(mGroupId) && !MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.groups", CMSAdminControl.PERMISSION_MANAGE))
{
RedirectToAccessDenied("cms.groups", CMSAdminControl.PERMISSION_MANAGE);
}
messageEditElem.AdvancedMode = true;
messageEditElem.MessageID = mMessageId;
messageEditElem.MessageBoardID = mBoardId;
messageEditElem.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(messageEditElem_OnCheckPermissions);
messageEditElem.OnBeforeMessageSaved += new OnBeforeMessageSavedEventHandler(messageEditElem_OnBeforeMessageSaved);
messageEditElem.OnAfterMessageSaved += new OnAfterMessageSavedEventHandler(messageEditElem_OnAfterMessageSaved);
// initializes page title control
if (mMessageId > 0)
{
PageTitle.TitleText = GetString("Board.MessageEdit.title");
}
else
{
PageTitle.TitleText = GetString("Board.MessageNew.title");
}
if (!URLHelper.IsPostback())
{
messageEditElem.ReloadData();
}
}
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// Check hash
if (!QueryHelper.ValidateHash("hash"))
{
RedirectToAccessDenied(ResHelper.GetString("dialogs.badhashtitle"));
}
userId = QueryHelper.GetInteger("userId", 0);
currentUser = CMSContext.CurrentUser;
// Check 'read' permissions
if (!currentUser.IsAuthorizedPerResource("CMS.Friends", "Read") && (currentUser.UserID != userId))
{
RedirectToAccessDenied("CMS.Friends", "Read");
}
// Check license
if (DataHelper.GetNotEmpty(URLHelper.GetCurrentDomain(), string.Empty) != string.Empty)
{
LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetCurrentDomain(), FeatureEnum.Friends);
}
if (userId > 0)
{
// Check that only global administrator can edit global administrator's accounts
UserInfo ui = UserInfoProvider.GetUserInfo(userId);
EditedObject = ui;
if (!CheckGlobalAdminEdit(ui))
{
plcTable.Visible = false;
lblError.Text = GetString("Administration-User_List.ErrorGlobalAdmin");
lblError.Visible = true;
}
else
{
string imagePath = GetImageUrl("Objects/CMS_Friend/");
ScriptHelper.RegisterDialogScript(this);
FriendsListRequested.UserID = userId;
FriendsListRequested.OnCheckPermissions += CheckPermissions;
FriendsListRequested.ZeroRowsText = GetString("friends.nouserrequestedfriends");
// Request friend link
string script =
"function displayRequest(){ \n" +
"modalDialog('" + CMSContext.ResolveDialogUrl("~/CMSModules/Friends/Dialogs/Friends_Request.aspx") + "?userid=" + userId + "&siteid=" + SiteID + "', 'rejectDialog', 480, 350);}";
ScriptHelper.RegisterStartupScript(this, GetType(), "displayModalRequest", ScriptHelper.GetScript(script));
string[,] actions = new string[1, 6];
actions[0, 0] = HeaderActions.TYPE_HYPERLINK;
actions[0, 1] = GetString("Friends_List.NewItemCaption");
actions[0, 2] = null;
actions[0, 3] = "javascript:displayRequest();";
actions[0, 4] = null;
actions[0, 5] = imagePath + "add.png";
CurrentMaster.HeaderActions.Actions = actions;
}
}
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// Check 'Read' permission
if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.groups", CMSAdminControl.PERMISSION_READ))
{
RedirectToAccessDenied("cms.groups", CMSAdminControl.PERMISSION_READ);
}
cu = MembershipContext.AuthenticatedUser;
messageEditElem.IsLiveSite = false;
messageEditElem.AdvancedMode = true;
messageEditElem.MessageID = mMessageId;
messageEditElem.MessageBoardID = mBoardId;
messageEditElem.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(messageEditElem_OnCheckPermissions);
messageEditElem.OnBeforeMessageSaved += new OnBeforeMessageSavedEventHandler(messageEditElem_OnBeforeMessageSaved);
messageEditElem.OnAfterMessageSaved += new OnAfterMessageSavedEventHandler(messageEditElem_OnAfterMessageSaved);
// initializes page title control
if (mMessageId > 0)
{
PageTitle.TitleText = GetString("Board.MessageEdit.title");
}
else
{
PageTitle.TitleText = GetString("Board.MessageNew.title");
}
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:30,代码来源:Message_Edit.aspx.cs
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
currentUser = CMSContext.CurrentUser;
if (currentUser == null)
{
return;
}
// Check 'ReadForm' permission
if (!currentUser.IsAuthorizedPerResource("cms.form", "ReadForm"))
{
RedirectToCMSDeskAccessDenied("cms.form", "ReadForm");
}
UniGridBizForms.OnAction += new OnActionEventHandler(UniGridBizForms_OnAction);
UniGridBizForms.OnAfterRetrieveData += new OnAfterRetrieveData(uniGrid_OnAfterRetrieveData);
UniGridBizForms.HideControlForZeroRows = false;
UniGridBizForms.ZeroRowsText = GetString("general.nodatafound");
UniGridBizForms.WhereCondition = "FormSiteID = " + CMSContext.CurrentSiteID;
// New item link
string[,] actions = new string[1,6];
actions[0, 0] = HeaderActions.TYPE_HYPERLINK;
actions[0, 1] = GetString("BizFormList.lnkNewBizForm");
actions[0, 2] = null;
actions[0, 3] = ResolveUrl("BizForm_New.aspx");
actions[0, 4] = null;
actions[0, 5] = GetImageUrl("Objects/CMS_Form/add.png");
CurrentMaster.HeaderActions.Actions = actions;
CurrentMaster.Title.TitleText = GetString("BizFormList.TitleText");
CurrentMaster.Title.TitleImage = GetImageUrl("Objects/CMS_Form/object.png");
CurrentMaster.Title.HelpTopicName = "bizforms";
}
示例13: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// Check 'Read' permission
if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.groups", CMSAdminControl.PERMISSION_READ))
{
RedirectToCMSDeskAccessDenied("cms.groups", CMSAdminControl.PERMISSION_READ);
}
cu = CMSContext.CurrentUser;
this.messageEditElem.IsLiveSite = false;
this.messageEditElem.AdvancedMode = true;
this.messageEditElem.MessageID = mMessageId;
this.messageEditElem.MessageBoardID = mBoardId;
this.messageEditElem.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(messageEditElem_OnCheckPermissions);
this.messageEditElem.OnBeforeMessageSaved += new OnBeforeMessageSavedEventHandler(messageEditElem_OnBeforeMessageSaved);
this.messageEditElem.OnAfterMessageSaved += new OnAfterMessageSavedEventHandler(messageEditElem_OnAfterMessageSaved);
// initializes page title control
if (this.mMessageId > 0)
{
this.CurrentMaster.Title.TitleText = GetString("Board.MessageEdit.title");
this.CurrentMaster.Title.TitleImage = GetImageUrl("Objects/Board_Message/object.png");
}
else
{
this.CurrentMaster.Title.TitleText = GetString("Board.MessageNew.title");
this.CurrentMaster.Title.TitleImage = GetImageUrl("Objects/Board_Message/new.png");
}
this.CurrentMaster.Title.HelpTopicName = "messages_edit";
this.CurrentMaster.Title.HelpName = "helpTopic";
}
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
userId = QueryHelper.GetInteger("userId", 0);
currentUser = MembershipContext.AuthenticatedUser;
if (userId <= 0 && currentUser != null)
{
userId = currentUser.UserID;
}
// Check 'read' permissions
if (!currentUser.IsAuthorizedPerResource("CMS.Friends", "Read") && (currentUser.UserID != userId))
{
RedirectToAccessDenied("CMS.Friends", "Read");
}
// Check 'manage' permission
bool friendsManagePermission = currentUser.IsAuthorizedPerResource("CMS.Friends", "Manage") || (currentUser.UserID == userId);
// Check license
if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, string.Empty) != string.Empty)
{
LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Friends);
}
// Check that only global administrator can edit global administrator's accounts
if (userId > 0)
{
UserInfo ui = UserInfoProvider.GetUserInfo(userId);
EditedObject = ui;
if (!CheckGlobalAdminEdit(ui))
{
plcTable.Visible = false;
lblError.Text = GetString("Administration-User_List.ErrorGlobalAdmin");
lblError.Visible = true;
}
else
{
ScriptHelper.RegisterDialogScript(this);
FriendsList.UserID = userId;
FriendsList.OnCheckPermissions += CheckPermissions;
FriendsList.ZeroRowsText = GetString("friends.nouserfriends");
// Request friend link
string script =
"function displayRequest(){ \n" +
"modalDialog('" + AuthenticationHelper.ResolveDialogUrl("~/CMSModules/Friends/Dialogs/Friends_Request.aspx") + "?userid=" + userId + "&siteid=" + SiteID + "', 'rejectDialog', 810, 460);}";
ScriptHelper.RegisterStartupScript(this, GetType(), "displayModalRequest", ScriptHelper.GetScript(script));
HeaderAction action = new HeaderAction();
action.Text = GetString("Friends_List.NewItemCaption");
action.OnClientClick = "displayRequest();";
action.RedirectUrl = null;
action.Enabled = friendsManagePermission;
CurrentMaster.HeaderActions.AddAction(action);
}
}
}
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
currentUser = MembershipContext.AuthenticatedUser;
ScriptHelper.RegisterDialogScript(this);
FriendsListToApprove.UserID = currentUser.UserID;
FriendsListToApprove.OnCheckPermissions += CheckPermissions;
FriendsListToApprove.ZeroRowsText = GetString("friends.nowaitingfriends");
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:8,代码来源:MyFriends_ToApprove.aspx.cs