예제 #1
0
    private MailServerData GetNotificationEmailServer()
    {
        IMailServer emailServerApi = ObjectFactory.GetMailServer();
        MailServerData mailServerData = new MailServerData();

        Criteria<MailServerProperty> criteria = new Criteria<MailServerProperty>();
        criteria.AddFilter(MailServerProperty.Type, CriteriaFilterOperator.EqualTo, MailServerType.CommunityEmailNotification);

        List<MailServerData> servers = emailServerApi.GetList(criteria);

        if (servers.Count > 0)
        {
            mailServerData = servers[0];
        }
        return mailServerData;
    }
예제 #2
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);
        Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronJQueryUiDefaultCss);
        FeaturesTodo_CB.Visible = false;

        CommonApi refCommonAPI = new CommonApi();
        if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.SocialNetworking))
        {
            Utilities.ShowError(m_refContentApi.EkMsgRef.GetMessage("feature locked error"));
        }
        m_userId = refCommonAPI.RequestInformationRef.UserId;
        AppPath = m_refContentApi.AppPath;
        lblUpload.Text = m_refMsg.GetMessage("upload txt");
        mailServer = GetNotificationEmailServer();
        lblProperties.Text = m_refMsg.GetMessage("generic properties");
        lblTags.Text = m_refMsg.GetMessage("lbl personal tags");
        lblCategory.Text = m_refMsg.GetMessage("lbl category");
        try
        {
            if (!this.IsCallback)
            {
                RegisterResources();

                //cgae_userselect_done_btn.Attributes.Add("onclick", "GetCommunityMsgObject(\'" + m_uniqueId + "\').MsgSaveMessageTargetUI(); return false;");
                cgae_userselect_done_btn.Attributes.Add("onclick", "AddAdminUsers();return false;");
                cgae_userselect_done_btn.Attributes.Add("class", "EktMsgTargetsDoneBtn");
                cgae_userselect_done_btn.Text = m_refMsg.GetMessage("btn done");
                //cgae_userselect_done_btn.Tooltip = m_refMsg.GetMessage("btn done")

                cgae_userselect_cancel_btn.Attributes.Add("onclick", "GetCommunityMsgObject(\'" + m_uniqueId + "\').MsgCancelMessageTargetUI(); return false;");
                cgae_userselect_cancel_btn.Attributes.Add("class", "EktMsgTargetsCancelBtn");
                cgae_userselect_cancel_btn.Text = m_refMsg.GetMessage("btn cancel");
                //cgae_userselect_cancel_btn.Tooltip = m_refMsg.GetMessage("btn cancel")

                Invite_UsrSel.SingleSelection = true;

                CheckAccess();
                if (!bAccess)
                {
                    throw (new Exception(this.m_iID > 0 ? (this.GetMessage("err communityaddedit no access")) : (this.GetMessage("err no perm add cgroup"))));
                }
                this.GroupAvatar_TB.Attributes.Add("onkeypress", "updateavatar();");
                if (!string.IsNullOrEmpty(Request.QueryString["thickbox"]))
                {
                    bThickBox = true;
                    Ektron.Cms.API.Css.RegisterCss(this, this.AppPath + "csslib/ektron.communitygroup.addedit.tb.ui.css", "EktronCommunityGroupAddEditTbUiCSS");
                }
                int langID = m_refContentApi.DefaultContentLanguage;
                if (Request.QueryString["LangType"] == null && Request.QueryString["LangType"] == "")
                {
                    langID = m_refContentApi.ContentLanguage;
                }
                else
                {
                    langID = Convert.ToInt32(Request.QueryString["LangType"]);
                }
                if (langID == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || langID == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                {
                    langID = int.Parse(refCommonAPI.GetCookieValue("SiteLanguage"));
                }

                m_refContentApi.SetCookieValue("LastValidLanguageID", langID.ToString());
                if (Request.QueryString["thickbox"] != "" && (Request.QueryString["tid"] != null))
                {
                    long.TryParse((string)(Request.QueryString["tid"].ToString()), out TaxonomyId);
                    TaxonomyLanguage = langID;
                }
                if (Request.QueryString["profileTaxonomyId"] != "" && Information.IsNumeric(Request.QueryString["profileTaxonomyId"]) && Convert.ToInt64(Request.QueryString["profileTaxonomyId"]) > 0)
                {
                    profileTaxonomyId = Convert.ToInt64(Request.QueryString["profileTaxonomyId"]);
                }
                if (Page.IsPostBack)
                {
                    if (!Page.IsCallback)
                    {
                        Process_EditGroup();
                    }
                }
                else
                {
                    //Invite_UsrSel.Initialize()
                    switch (this.m_sPageAction)
                    {
                        case "delete":
                            Process_DeleteGroup();
                            break;
                        default:
                            EmitJavascript();
                            RenderRecipientSelect();
                            EditGroup();
                            SetTaxonomy(this.m_iID);
                            SetAlias(this.m_iID);
                            break;
                    }
                }
                SetLabels();
            }
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }