protected void Page_Load(object sender, EventArgs e)
        {
            Actions    = new AllowedActions(ProfileHelper.UserInfo);
            MyStaff    = ProfileHelper.UserInfo.IsMe();
            HasActions = Actions.AllowEdit || Actions.AllowAddOrDelete;

            var currentUser = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);

            IsAdmin = currentUser.IsAdmin();

            SubscribeBtnText =
                StudioNotifyHelper.IsSubscribedToNotify(currentUser, Core.Notify.Actions.PeriodicNotify)
                    ? ResourceJS.TipsAndTricksUnsubscribeBtn
                    : ResourceJS.TipsAndTricksSubscribeBtn;

            if (HasActions && Actions.AllowAddOrDelete)
            {
                _phConfirmationDeleteUser.Controls.Add(LoadControl(ConfirmationDeleteUser.Location));
            }

            ProfileEditLink =
                Page is MyStaff
                    ? "/my.aspx?action=edit"
                    : "profileaction.aspx?action=edit&user="******"reassigns.aspx?user="******"email_change"] == "success")
            {
                Page.RegisterInlineScript(string.Format("toastr.success(\"{0}\");", Resource.ChangeEmailSuccess));
            }
        }
Пример #2
0
        public AjaxResponse SubscribeToAdminNotify()
        {
            var resp = new AjaxResponse {
                rs1 = "0"
            };

            try
            {
                var recipient = StudioNotifyHelper.ToRecipient(SecurityContext.CurrentAccount.ID);

                var isSubscribe = StudioNotifyHelper.IsSubscribedToNotify(recipient, Actions.AdminNotify);

                StudioNotifyHelper.SubscribeToNotify(recipient, Actions.AdminNotify, !isSubscribe);

                resp.rs2 = RenderAdminNotifySubscriptionState(!isSubscribe);

                resp.rs1 = "1";
            }
            catch (Exception e)
            {
                resp.rs2 = e.Message.HtmlEncode();
            }

            return(resp);
        }
Пример #3
0
 protected string RenderTipsAndTricksSubscriptionState()
 {
     return(RenderTipsAndTricksSubscriptionState(StudioNotifyHelper.IsSubscribedToNotify(CurrentUser, Actions.PeriodicNotify)));
 }
Пример #4
0
 protected string RenderAdminNotifySubscriptionState()
 {
     return(RenderAdminNotifySubscriptionState(StudioNotifyHelper.IsSubscribedToNotify(CurrentUser, Actions.AdminNotify)));
 }
Пример #5
0
 protected string RenderWhatsNewSubscriptionState()
 {
     return(RenderWhatsNewSubscriptionState(StudioNotifyHelper.IsSubscribedToNotify(CurrentUser, Actions.SendWhatsNew)));
 }