本文整理汇总了C#中UserInfo.IsPublic方法的典型用法代码示例。如果您正苦于以下问题:C# UserInfo.IsPublic方法的具体用法?C# UserInfo.IsPublic怎么用?C# UserInfo.IsPublic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo.IsPublic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
userId = QueryHelper.GetInteger("objectid", 0);
// Get user info object and check if UI should be displayed
ui = UserInfoProvider.GetUserInfo(userId);
CheckUserAvaibleOnSite(ui);
EditedObject = ui;
ucUserName.UseDefaultValidationGroup = false;
cultureSelector.DisplayAllCultures = true;
lblResetToken.Text = GetString("mfauthentication.token.reset");
// Register picture delete script
ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "PictDelConfirm",
ScriptHelper.GetScript("function DeleteConfirmation(){ return confirm(" + ScriptHelper.GetString(GetString("MyProfile.PictDeleteConfirm")) + ");}"));
// Check that only global administrator can edit global administrator's accounts
if (!CheckGlobalAdminEdit(ui))
{
plcTable.Visible = false;
ShowError(GetString("Administration-User_List.ErrorGlobalAdmin"));
}
if (!RequestHelper.IsPostBack())
{
LoadData();
}
// Set hide action if user extend validity of his own account
if (ui.UserID == CurrentUser.UserID)
{
btnExtendValidity.OnClientClick = "window.top.HideWarning()";
}
// Register help variable for user is external confirmation
ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "IsExternal", ScriptHelper.GetScript("var isExternal = " + chkIsExternal.Checked.ToString().ToLowerCSafe() + ";"));
// Javascript code for "Is external user" confirmation
string javascript = ScriptHelper.GetScript(
@"function CheckExternal() {
var checkbox = document.getElementById('" + chkIsExternal.ClientID + @"')
if(checkbox.checked && !isExternal) {
if(!confirm('" + GetString("user.confirmexternal") + @"')) {
checkbox.checked = false ;
}
}}");
// Register script to the page
ScriptHelper.RegisterClientScriptBlock(this, typeof(string), ClientID + "CheckExternal", javascript);
// Assign to ok button
if (!chkIsExternal.Checked)
{
btnOk.OnClientClick = "CheckExternal()";
}
// Display impersonation link if current user is global administrator and edited user is not global admin
if (CurrentUser.IsGlobalAdministrator && (ui.UserID != CurrentUser.UserID) && !ui.IsPublic())
{
string message = GetImpersonalMessage(ui);
HeaderAction action = new HeaderAction();
action.Text = GetString("Membership.Impersonate");
action.Tooltip = GetString("Membership.Impersonate");
action.OnClientClick = "if (!confirm('" + message + "')) { return false; }";
action.CommandName = "impersonate";
CurrentMaster.HeaderActions.AddAction(action);
CurrentMaster.HeaderActions.ActionPerformed += HeaderActions_ActionPerformed;
}
}