예제 #1
0
 public void Deconstruct(out UserManager userManager, out StudioNotifyHelper studioNotifyHelper, out StudioNotifySource studioNotifySource, out DisplayUserSettingsHelper displayUserSettingsHelper)
 {
     userManager               = UserManager;
     studioNotifyHelper        = StudioNotifyHelper;
     studioNotifySource        = StudioNotifySource;
     displayUserSettingsHelper = DisplayUserSettingsHelper;
 }
        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));
            }
        }
예제 #3
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);
        }
예제 #4
0
 public NotifyHelperScope(UserManager userManager, StudioNotifyHelper studioNotifyHelper, StudioNotifySource studioNotifySource, DisplayUserSettingsHelper displayUserSettingsHelper)
 {
     UserManager               = userManager;
     StudioNotifyHelper        = studioNotifyHelper;
     StudioNotifySource        = studioNotifySource;
     DisplayUserSettingsHelper = displayUserSettingsHelper;
 }
예제 #5
0
 public StudioNotifyServiceHelper(StudioNotifyHelper studioNotifyHelper, AuthContext authContext, TenantManager tenantManager, ICacheNotify <NotifyItem> cache)
 {
     StudioNotifyHelper = studioNotifyHelper;
     AuthContext        = authContext;
     TenantManager      = tenantManager;
     Cache = cache;
 }
예제 #6
0
 public StudioNotifyServiceHelper(
     StudioNotifyHelper studioNotifyHelper,
     AuthContext authContext,
     TenantManager tenantManager,
     CommonLinkUtility commonLinkUtility,
     ICacheNotify <NotifyItem> cache)
 {
     StudioNotifyHelper = studioNotifyHelper;
     AuthContext        = authContext;
     TenantManager      = tenantManager;
     CommonLinkUtility  = commonLinkUtility;
     Cache = cache;
 }
예제 #7
0
 protected string RenderAdminNotifySubscriptionState()
 {
     return(RenderAdminNotifySubscriptionState(StudioNotifyHelper.IsSubscribedToNotify(CurrentUser, Actions.AdminNotify)));
 }
예제 #8
0
 protected string RenderTipsAndTricksSubscriptionState()
 {
     return(RenderTipsAndTricksSubscriptionState(StudioNotifyHelper.IsSubscribedToNotify(CurrentUser, Actions.PeriodicNotify)));
 }
예제 #9
0
 protected string RenderWhatsNewSubscriptionState()
 {
     return(RenderWhatsNewSubscriptionState(StudioNotifyHelper.IsSubscribedToNotify(CurrentUser, Actions.SendWhatsNew)));
 }