Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            InitScripts();

            if (EmptyScreenVisible)
            {
                CreateEmptyPanel();
            }

            if (ModuleName != "crm")
            {
                var projId = Request["prjID"];
                if (!String.IsNullOrEmpty(projId))
                {
                    ProjectId = Convert.ToInt32(projId);
                    InitProjectDocumentsPopup();
                }
                else
                {
                    ProjectId = 0;
                }
            }
            else
            {
                PortalDocUploaderVisible = false;
            }

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Exemplo n.º 2
0
        protected override void PageLoad()
        {
            Master.DisabledSidePanel = true;

            Statuses = EngineFactory.StatusEngine.GetWithDefaults()
                       .OrderBy(t => t.StatusType)
                       .ThenBy(t => t.Order)
                       .ToList();

            _hintPopupTaskRemove.Options.IsPopup       = true;
            _hintPopupMilestoneRemove.Options.IsPopup  = true;
            _hintPopupMilestoneTasks.Options.IsPopup   = true;
            _hintPopupTaskWithSubtasks.Options.IsPopup = true;
            _moveTaskOutMilestone.Options.IsPopup      = true;
            _addNewLinkPopup.Options.IsPopup           = true;

            Page.RegisterStyle("~/Products/Projects/App_Themes/default/css/ganttchart.css");

            HelpLink = CommonLinkUtility.GetHelpLink();

            if (!string.IsNullOrEmpty(HelpLink))
            {
                HelpLink = HelpLink.TrimEnd('/') + "/projects.aspx";
            }

            Title = HeaderStringHelper.GetPageTitle(ProjectResource.GanttGart);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            content.Controls.Add(LoadControl(NamingPeopleSettingsContent.Location));
            Page.RegisterBodyScripts("~/UserControls/Management/NamingPeopleSettings/js/namingpeople.js");

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Exemplo n.º 4
0
        private static List <VideoGuideItem> ParseVideoGuideHtml(string html)
        {
            var data = new List <VideoGuideItem>();

            var doc = new HtmlDocument();

            doc.LoadHtml(html);

            var titles = doc.DocumentNode.SelectNodes("//div[@class='MainHelpCenter PageVideo']//li");

            if (titles == null || titles.Count(a => a.Attributes["id"] != null) != titles.Count() || !titles.Elements("a").Any())
            {
                return(data);
            }

            var helpLinkBlock = CommonLinkUtility.GetHelpLink(false);

            var needTitles = titles.Where(x =>
                                          x.Attributes["data-status"] != null &&
                                          (x.Attributes["data-status"].Value == "new" || x.Attributes["data-status"].Value == "default")).ToList();

            foreach (var needTitle in needTitles)
            {
                var title  = needTitle.SelectSingleNode(".//span[@class='link_to_video']").InnerText;
                var id     = needTitle.Attributes["id"].Value;
                var link   = helpLinkBlock + needTitle.Element("a").Attributes["href"].Value.Substring(1);
                var status = needTitle.Attributes["data-status"].Value;

                data.Add(new VideoGuideItem {
                    Title = title, Id = id, Link = link, Status = status
                });
            }
            return(data);
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var username = Request["user"];

            if (!IsAdmin() || string.IsNullOrEmpty(username))
            {
                Response.Redirect("~/Products/People/", true);
            }

            UserInfo = CoreContext.UserManager.GetUserByUserName(Request["user"]);

            if (UserInfo.Status != EmployeeStatus.Terminated)
            {
                Response.Redirect("~/Products/People/", true);
            }

            RemoveData = string.Equals(Request["remove"], bool.TrueString, StringComparison.InvariantCultureIgnoreCase);

            DeleteProfile = string.Equals(Request["delete"], bool.TrueString, StringComparison.InvariantCultureIgnoreCase);

            PageTitle = UserInfo.DisplayUserName(false) + " - " + (RemoveData ? PeopleResource.RemovingData : PeopleResource.ReassignmentData);

            Title = HeaderStringHelper.GetPageTitle(PageTitle);

            PageTitle = HttpUtility.HtmlEncode(PageTitle);

            HelpLink = CommonLinkUtility.GetHelpLink();

            ProfileLink = CommonLinkUtility.GetUserProfile(UserInfo.ID);

            Page.RegisterInlineScript(string.Format("ASC.People.Reassigns.init(\"{0}\", {1});", UserInfo.ID, RemoveData.ToString().ToLowerInvariant()));
        }
Exemplo n.º 6
0
        public StudioNotifyHelper(
            StudioNotifySource studioNotifySource,
            UserManager userManager,
            SettingsManager settingsManager,
            AdditionalWhiteLabelSettingsHelper additionalWhiteLabelSettingsHelper,
            CommonLinkUtility commonLinkUtility,
            SetupInfo setupInfo,
            TenantManager tenantManager,
            TenantExtra tenantExtra,
            CoreBaseSettings coreBaseSettings,
            WebImageSupplier webImageSupplier,
            IConfiguration configuration,
            IOptionsMonitor <ILog> option)
        {
            Helplink             = commonLinkUtility.GetHelpLink(settingsManager, additionalWhiteLabelSettingsHelper, false);
            NotifySource         = studioNotifySource;
            UserManager          = userManager;
            SettingsManager      = settingsManager;
            CommonLinkUtility    = commonLinkUtility;
            SetupInfo            = setupInfo;
            TenantManager        = tenantManager;
            TenantExtra          = tenantExtra;
            CoreBaseSettings     = coreBaseSettings;
            WebImageSupplier     = webImageSupplier;
            SubscriptionProvider = NotifySource.GetSubscriptionProvider();
            RecipientsProvider   = NotifySource.GetRecipientsProvider();
            Log = option.CurrentValue;

            int.TryParse(configuration["core:notify:countspam"], out CountMailsToNotActivated);
            NotificationImagePath = configuration["web:notification:image:path"];
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //timezone & language
            _timelngHolder.Controls.Add(LoadControl(TimeAndLanguage.Location));

            if (SetupInfo.IsVisibleSettings <PromoCode>() &&
                TenantExtra.GetCurrentTariff().State == ASC.Core.Billing.TariffState.Trial &&
                string.IsNullOrEmpty(CoreContext.TenantManager.GetCurrentTenant().PartnerId))
            {
                promoCodeSettings.Controls.Add(LoadControl(PromoCode.Location));
            }

            //dns
            if (SetupInfo.IsVisibleSettings <DnsSettings.DnsSettings>())
            {
                _dnsSettings.Controls.Add(LoadControl(DnsSettings.DnsSettings.Location));
            }

            //Portal version
            if (SetupInfo.IsVisibleSettings <VersionSettings.VersionSettings>() && 1 < CoreContext.TenantManager.GetTenantVersions().Count())
            {
                _portalVersionSettings.Controls.Add(LoadControl(VersionSettings.VersionSettings.Location));
            }

            //greeting settings
            _greetingSettings.Controls.Add(LoadControl(GreetingSettings.Location));

            //portal rename control
            _portalRename.Controls.Add(LoadControl(PortalRename.Location));

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!SecurityContext.CheckPermissions(Constants.Action_AddRemoveUser))
            {
                Response.Redirect(CommonLinkUtility.GetDefault());
            }

            EnableUsers  = TenantExtra.GetTenantQuota().ActiveUsers - TenantStatisticsProvider.GetUsersCount();
            EnableGuests = Constants.CoefficientOfVisitors * TenantExtra.GetTenantQuota().ActiveUsers - TenantStatisticsProvider.GetVisitorsCount();
            EnableGuests = EnableGuests >= 0 ? EnableGuests : 0;
            IsStandalone = CoreContext.Configuration.Standalone;

            var quota = TenantExtra.GetTenantQuota();

            PeopleLimit = Math.Min(quota.ActiveUsers - TenantStatisticsProvider.GetUsersCount(), 0);
            FreeTariff  = (quota.Free || quota.NonProfit || quota.Trial) && !quota.Open;
            HelpLink    = CommonLinkUtility.GetHelpLink();

            icon.Options.IsPopup = true;
            icon.Options.PopupContainerCssClass = "okcss popupContainerClass";
            icon.Options.OnCancelButtonClick    = "ASC.People.Import.hideInfoWindow('okcss');";

            limitPanel.Options.IsPopup             = true;
            limitPanel.Options.OnCancelButtonClick = "ASC.People.Import.hideImportUserLimitPanel();";

            Utility.RegisterTypeForAjax(GetType());

            RegisterScript();
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!SecurityContext.CheckPermissions(Constants.Action_AddRemoveUser))
            {
                Response.Redirect(CommonLinkUtility.GetDefault());
            }

            var tariff = (ASC.Web.Studio.UserControls.Management.TariffLimitExceed)LoadControl(Studio.UserControls.Management.TariffLimitExceed.Location);

            Tariff.Controls.Add(tariff);
            var quota = TenantExtra.GetTenantQuota();

            PeopleLimit = Math.Min(quota.ActiveUsers - TenantStatisticsProvider.GetUsersCount(), 0);
            FreeTariff  = (quota.Free || quota.NonProfit || quota.Trial) && !quota.Open;
            HelpLink    = CommonLinkUtility.GetHelpLink();

            icon.Options.IsPopup = true;
            icon.Options.PopupContainerCssClass = "okcss popupContainerClass";
            icon.Options.OnCancelButtonClick    = "ASC.People.Import.hideInfoWindow('okcss');";

            limitPanel.Options.IsPopup             = true;
            limitPanel.Options.OnCancelButtonClick = "ASC.People.Import.hideImportUserLimitPanel();";

            Utility.RegisterTypeForAjax(GetType());

            RegisterScript();
        }
 static StudioNotifyHelper()
 {
     Helplink             = CommonLinkUtility.GetHelpLink(false);
     NotifySource         = new StudioNotifySource();
     SubscriptionProvider = NotifySource.GetSubscriptionProvider();
     RecipientsProvider   = NotifySource.GetRecipientsProvider();
 }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ThirdPartyEditorTemp.Options.IsPopup             = true;
            ThirdPartyDeleteTmp.Options.IsPopup              = true;
            ThirdPartyNewAccountTmp.Options.IsPopup          = true;
            ThirPartyConfirmMoveTmp.Options.IsPopup          = true;
            thirdpartyToDocuSignDialog.Options.IsPopup       = true;
            thirdpartyToDocuSignHelperDialog.Options.IsPopup = true;

            EmptyScreenThirdParty.Controls.Add(new EmptyScreenControl
            {
                ID             = "emptyThirdPartyContainer",
                ImgSrc         = PathProvider.GetImagePath("empty_screen_my.png"),
                Header         = FilesUCResource.ThirdPartyConnectAccounts,
                HeaderDescribe = FilesUCResource.EmptyScreenThirdPartyDscr,
                ButtonHTML     = string.Format(@"<div class=""account-connect""><a class=""link dotline plus"">{0}</a></div>", FilesUCResource.AddAccount)
            });

            var docuSignSelectorContainer = (Tree)LoadControl(Tree.Location);

            docuSignSelectorContainer.ID                      = "docuSignFolderSelector";
            docuSignSelectorContainer.WithoutTrash            = true;
            docuSignSelectorContainer.WithoutAdditionalFolder = true;
            DocuSignFolderSelectorHolder.Controls.Add(docuSignSelectorContainer);

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HelpLink = CommonLinkUtility.GetHelpLink();

            SupportLink = CommonLinkUtility.GetFeedbackAndSupportLink();

            var tenant = CoreContext.TenantManager.GetCurrentTenant();

            MappedDomain = tenant.MappedDomain;

            HasMappedDomain = !string.IsNullOrEmpty(MappedDomain);

            if (CoreContext.Configuration.Standalone)
            {
                AjaxPro.Utility.RegisterTypeForAjax(GetType());

                Page.RegisterBodyScripts("~/UserControls/Management/DnsSettings/dnssettings.js");

                AvailableDnsSettings = true;

                CurrentDomain = CoreContext.Configuration.BaseDomain;
            }
            else
            {
                AvailableDnsSettings = TenantExtra.GetTenantQuota().HasDomain;

                CurrentDomain = string.Format("{0}{1}", tenant.TenantAlias, GetTenantBaseDomain());
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var username = Request["user"];

            if (!IsAdmin() || string.IsNullOrEmpty(username))
            {
                Response.Redirect("~/products/people/", true);
            }

            UserInfo = CoreContext.UserManager.GetUserByUserName(Request["user"]);

            if (UserInfo.Status != EmployeeStatus.Terminated)
            {
                Response.Redirect("~/products/people/", true);
            }

            PageTitle = UserInfo.DisplayUserName(false) + " - " + PeopleResource.ReassignmentData;

            Title = HeaderStringHelper.GetPageTitle(PageTitle);

            PageTitle = HttpUtility.HtmlEncode(PageTitle);

            HelpLink = CommonLinkUtility.GetHelpLink();

            ProfileLink = CommonLinkUtility.GetUserProfile(UserInfo.ID);

            Page.RegisterInlineScript(string.Format("ASC.People.Reassigns.init(\"{0}\");", UserInfo.ID));
        }
Exemplo n.º 14
0
        protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context)
        {
            var curQuota = TenantExtra.GetTenantQuota();
            var tenant   = CoreContext.TenantManager.GetCurrentTenant();
            var helpLink = CommonLinkUtility.GetHelpLink();

            var result = new List <KeyValuePair <string, object> >(4)
            {
                RegisterObject(
                    new {
                    ApiPath         = SetupInfo.WebApiBaseUrl,
                    IsAuthenticated = SecurityContext.IsAuthenticated,
                    IsAdmin         = CoreContext.UserManager.IsUserInGroup(SecurityContext.CurrentAccount.ID, Constants.GroupAdmin.ID),
                    IsVisitor       = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsVisitor(),
                    //CurrentTenantId = tenant.TenantId,
                    CurrentTenantCreatedDate      = tenant.CreatedDateTime,
                    CurrentTenantVersion          = tenant.Version,
                    CurrentTenantUtcOffset        = tenant.TimeZone,
                    CurrentTenantUtcHoursOffset   = tenant.TimeZone.BaseUtcOffset.Hours,
                    CurrentTenantUtcMinutesOffset = tenant.TimeZone.BaseUtcOffset.Minutes,
                    TimezoneDisplayName           = tenant.TimeZone.DisplayName,
                    TimezoneOffsetMinutes         = tenant.TimeZone.GetUtcOffset(DateTime.UtcNow).TotalMinutes,
                    TenantIsPremium = curQuota.Trial ? "No" : "Yes",
                    TenantTariff    = curQuota.Id,
                    EmailRegExpr    = @"^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$",
                    GroupSelector_MobileVersionGroup = new { Id = -1, Name = UserControlsCommonResource.LblSelect.HtmlEncode().ReplaceSingleQuote() },
                    GroupSelector_WithGroupEveryone  = new { Id = Constants.GroupEveryone.ID, Name = UserControlsCommonResource.Everyone.HtmlEncode().ReplaceSingleQuote() },
                    GroupSelector_WithGroupAdmin     = new { Id = Constants.GroupAdmin.ID, Name = UserControlsCommonResource.Admin.HtmlEncode().ReplaceSingleQuote() },
                    SetupInfoNotifyAddress           = SetupInfo.NotifyAddress,
                    SetupInfoTipsAddress             = SetupInfo.TipsAddress,
                    CKEDITOR_BASEPATH   = WebPath.GetPath("/usercontrols/common/ckeditor/"),
                    MaxImageFCKWidth    = ConfigurationManager.AppSettings["MaxImageFCKWidth"] ?? "620",
                    UserPhotoHandlerUrl = VirtualPathUtility.ToAbsolute("~/UserPhoto.ashx"),
                    ImageWebPath        = WebImageSupplier.GetImageFolderAbsoluteWebPath(),
                    UrlShareGooglePlus  = SetupInfo.ShareGooglePlusUrl,
                    UrlShareTwitter     = SetupInfo.ShareTwitterUrl,
                    UrlShareFacebook    = SetupInfo.ShareFacebookUrl,
                    LogoDarkUrl         = CommonLinkUtility.GetFullAbsolutePath(TenantLogoManager.GetLogoDark(true)),
                    HelpLink            = helpLink ?? ""
                })
            };

            if (CoreContext.Configuration.Personal)
            {
                result.Add(RegisterObject(new { CoreContext.Configuration.Personal }));
            }

            if (CoreContext.Configuration.Standalone)
            {
                result.Add(RegisterObject(new { CoreContext.Configuration.Standalone }));
            }

            if (!string.IsNullOrEmpty(helpLink))
            {
                result.Add(RegisterObject(new { FilterHelpCenterLink = helpLink.TrimEnd('/') + "/tipstricks/using-search.aspx" }));
            }

            return(result);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType(), Page);
            Page.RegisterBodyScripts("~/UserControls/Management/Monitoring/js/servicehealthchecker.js")
            .RegisterStyle("~/UserControls/Management/Monitoring/css/monitoring.less");

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            Page.RegisterBodyScripts("~/usercontrols/Management/DnsSettings/dnssettings.js");

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType(), Page);
            Page.RegisterBodyScripts("~/usercontrols/management/AuthorizationKeys/js/authorizationkeys.js");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "authorizationkeys_style", "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + WebPath.GetPath("usercontrols/management/authorizationkeys/css/authorizationkeys.css") + "\">", false);

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CoreContext.Configuration.Standalone || !SetupInfo.IsVisibleSettings(ManagementType.SingleSignOnSettings.ToString()))
            {
                Response.Redirect(CommonLinkUtility.GetDefault(), true);
                return;
            }

            AjaxPro.Utility.RegisterTypeForAjax(typeof(SingleSignOnSettings), Page);
            Page.RegisterBodyScripts(
                "~/js/uploader/jquery.fileupload.js",
                "~/UserControls/Management/SingleSignOnSettings/js/singlesignonsettings.js"
                );

            try
            {
                Settings        = SsoSettingsV2.Load();
                DefaultSettings = new SsoSettingsV2().GetDefault() as SsoSettingsV2;
                Constants       = new
                {
                    SsoNameIdFormatType         = new SsoNameIdFormatType(),
                    SsoBindingType              = new SsoBindingType(),
                    SsoSigningAlgorithmType     = new SsoSigningAlgorithmType(),
                    SsoEncryptAlgorithmType     = new SsoEncryptAlgorithmType(),
                    SsoSpCertificateActionType  = new SsoSpCertificateActionType(),
                    SsoIdpCertificateActionType = new SsoIdpCertificateActionType()
                };
                Metadata = new SsoMetadata();

                isSsoPost     = (Settings.IdpSettings.SsoBinding == "" || Settings.IdpSettings.SsoBinding == SsoBindingType.Saml20HttpPost);
                isSsoRedirect = Settings.IdpSettings.SsoBinding == SsoBindingType.Saml20HttpRedirect;

                isSloPost     = (Settings.IdpSettings.SloBinding == "" || Settings.IdpSettings.SloBinding == SsoBindingType.Saml20HttpPost);
                isSloRedirect = (Settings.IdpSettings.SloBinding == SsoBindingType.Saml20HttpRedirect);
            }
            catch (Exception ex)
            {
                ErrorMessage = ex.Message;
            }
            ssoSpCertificatePopupContainer.Options.IsPopup  = true;
            ssoIdpCertificatePopupContainer.Options.IsPopup = true;
            ssoSettingsInviteContainer.Options.IsPopup      = true;
            ssoSettingsTurnOffContainer.Options.IsPopup     = true;

            HelpLink = CommonLinkUtility.GetHelpLink();

            var script = string.Format("SsoSettings.init({0},{1},{2},{3},{4})",
                                       JsonConvert.SerializeObject(Settings),
                                       JsonConvert.SerializeObject(DefaultSettings),
                                       JsonConvert.SerializeObject(Constants),
                                       JsonConvert.SerializeObject(Metadata),
                                       JsonConvert.SerializeObject(ErrorMessage));

            if (isAvailable)
            {
                Page.RegisterInlineScript(script);
            }
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            HelpLink = CommonLinkUtility.GetHelpLink();

            Page.RegisterStyle("~/usercontrols/management/versionsettings/css/versionsettings.less");
            Page.RegisterBodyScripts("~/usercontrols/Management/VersionSettings/js/script.js");
        }
Exemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());
            Page.RegisterBodyScripts("~/usercontrols/Management/SmsControls/js/SmsValidation.js");

            SmsEnable = StudioSmsNotificationSettings.IsVisibleSettings && SmsProviderManager.Enabled();

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            HelpLink = CommonLinkUtility.GetHelpLink();
            InitPermission();

            if (!IsBlogsAvailable && !IsEventsAvailable && !IsBookmarksAvailable && string.IsNullOrEmpty(HelpLink))
            {
                Response.Redirect(ProductStartUrl);
            }
        }
Exemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());
            Page.RegisterStyle(ResolveUrl("~/UserControls/Users/UserProfile/css/userlanguages.less"))
            .RegisterBodyScripts(VirtualPathUtility.ToAbsolute("~/UserControls/Users/UserProfile/js/userlanguage.js"));

            HelpLink = CommonLinkUtility.GetHelpLink();

            ShowHelper = !CoreContext.Configuration.CustomMode && CompanyWhiteLabelSettings.Instance.IsDefault;
        }
Exemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HelpLink = CommonLinkUtility.GetHelpLink();

            Page.RegisterClientScript(new Masters.ClientScripts.OrganisationProfileViewData());

            RegisterScript();

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Exemplo n.º 24
0
        static StudioNotifyHelper()
        {
            Helplink             = CommonLinkUtility.GetHelpLink(false);
            NotifySource         = new StudioNotifySource();
            SubscriptionProvider = NotifySource.GetSubscriptionProvider();
            RecipientsProvider   = NotifySource.GetRecipientsProvider();

            int.TryParse(ConfigurationManagerExtension.AppSettings["core.notify.countspam"], out CountMailsToNotActivated);
            NotificationImagePath = ConfigurationManagerExtension.AppSettings["web.notification.image.path"];
        }
Exemplo n.º 25
0
        private static void BeforeTransferRequest(NotifyEngine sender, NotifyRequest request)
        {
            var aid   = Guid.Empty;
            var aname = string.Empty;

            if (SecurityContext.IsAuthenticated)
            {
                aid = SecurityContext.CurrentAccount.ID;
                if (CoreContext.UserManager.UserExists(aid))
                {
                    aname = CoreContext.UserManager.GetUsers(aid).DisplayUserName(false)
                            .Replace(">", "&#62")
                            .Replace("<", "&#60");
                }
            }

            IProduct product;
            IModule  module;

            CommonLinkUtility.GetLocationByRequest(out product, out module);
            if (product == null && CallContext.GetData("asc.web.product_id") != null)
            {
                product = WebItemManager.Instance[(Guid)CallContext.GetData("asc.web.product_id")] as IProduct;
            }

            var logoText = TenantWhiteLabelSettings.DefaultLogoText;

            if ((TenantExtra.Enterprise || TenantExtra.Hosted || (CoreContext.Configuration.Personal && CoreContext.Configuration.CustomMode)) && !MailWhiteLabelSettings.Instance.IsDefault)
            {
                logoText = TenantLogoManager.GetLogoText();
            }

            request.Arguments.Add(new TagValue(CommonTags.AuthorID, aid));
            request.Arguments.Add(new TagValue(CommonTags.AuthorName, aname));
            request.Arguments.Add(new TagValue(CommonTags.AuthorUrl, CommonLinkUtility.GetFullAbsolutePath(CommonLinkUtility.GetUserProfile(aid))));
            request.Arguments.Add(new TagValue(CommonTags.VirtualRootPath, CommonLinkUtility.GetFullAbsolutePath("~").TrimEnd('/')));
            request.Arguments.Add(new TagValue(CommonTags.ProductID, product != null ? product.ID : Guid.Empty));
            request.Arguments.Add(new TagValue(CommonTags.ModuleID, module != null ? module.ID : Guid.Empty));
            request.Arguments.Add(new TagValue(CommonTags.ProductUrl, CommonLinkUtility.GetFullAbsolutePath(product != null ? product.StartURL : "~")));
            request.Arguments.Add(new TagValue(CommonTags.DateTime, TenantUtil.DateTimeNow()));
            request.Arguments.Add(new TagValue(CommonTags.Helper, new PatternHelper()));
            request.Arguments.Add(new TagValue(CommonTags.RecipientID, Context.SYS_RECIPIENT_ID));
            request.Arguments.Add(new TagValue(CommonTags.RecipientSubscriptionConfigURL, CommonLinkUtility.GetMyStaff()));
            request.Arguments.Add(new TagValue(CommonTags.HelpLink, CommonLinkUtility.GetHelpLink(false)));
            request.Arguments.Add(new TagValue(Constants.LetterLogoText, logoText));
            request.Arguments.Add(new TagValue(Constants.LetterLogoTextTM, logoText));
            request.Arguments.Add(new TagValue(Constants.MailWhiteLabelSettings, MailWhiteLabelSettings.Instance));

            if (!request.Arguments.Any(x => CommonTags.SendFrom.Equals(x.Tag)))
            {
                request.Arguments.Add(new TagValue(CommonTags.SendFrom, CoreContext.TenantManager.GetCurrentTenant().Name));
            }

            AddLetterLogo(request);
        }
Exemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(CommonLinkUtility.GetHelpLink()))
            {
                return;
            }

            Page.RegisterStyle("~/UserControls/Common/HelpCenter/css/help-center.less");

            string module;
            string mainLink;

            if (Page is Studio.Management)
            {
                module   = "configuration.aspx";
                mainLink = CommonLinkUtility.GetAdministration(ManagementType.HelpCenter);
            }
            else
            {
                var currentModule = GetProduct();
                if (currentModule == null || string.IsNullOrEmpty(currentModule.HelpURL))
                {
                    return;
                }

                module   = currentModule.ProductClassName + ".aspx";
                mainLink = VirtualPathUtility.ToAbsolute(currentModule.HelpURL);
            }

            const string index = "#help";

            HelpLink      = mainLink + index;
            HelpLinkBlock = mainLink + index + "=";

            HelpCenterItems = HelpCenterHelper.GetHelpCenter(module, HelpLinkBlock);

            if (IsSideBar)
            {
                var videoGuidesControl = (VideoGuidesControl)LoadControl(VideoGuidesControl.Location);
                if (HelpCenterItems == null)
                {
                    VideoGuides.Controls.Add(videoGuidesControl);
                }
                else
                {
                    videoGuidesControl.IsSubItem = true;
                    VideoGuidesSubItem.Controls.Add(videoGuidesControl);
                }
            }

            if (MediaViewersPlaceHolder != null)
            {
                MediaViewersPlaceHolder.Controls.Add(LoadControl(MediaPlayer.Location));
            }
        }
Exemplo n.º 27
0
        protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context)
        {
            yield return(RegisterObject("ApiPath", SetupInfo.WebApiBaseUrl));

            yield return(RegisterObject("IsAuthenticated", SecurityContext.IsAuthenticated));

            yield return(RegisterObject("IsAdmin", CoreContext.UserManager.IsUserInGroup(SecurityContext.CurrentAccount.ID, ASC.Core.Users.Constants.GroupAdmin.ID)));

            yield return(RegisterObject("CurrentTenantVersion", CoreContext.TenantManager.GetCurrentTenant().Version));

            yield return(RegisterObject("CurrentTenantUtcOffset", CoreContext.TenantManager.GetCurrentTenant().TimeZone));

            yield return(RegisterObject("CurrentTenantUtcHoursOffset", CoreContext.TenantManager.GetCurrentTenant().TimeZone.GetUtcOffset(DateTime.UtcNow).Hours));

            yield return(RegisterObject("CurrentTenantUtcMinutesOffset", CoreContext.TenantManager.GetCurrentTenant().TimeZone.GetUtcOffset(DateTime.UtcNow).Minutes));

            var curQuota = TenantExtra.GetTenantQuota();

            yield return(RegisterObject("TenantIsPremium", curQuota.Trial ? "No" : "Yes"));

            yield return(RegisterObject("TenantTariff", curQuota.Id));

            yield return(RegisterObject("TenantTariffDocsEdition", curQuota.DocsEdition));

            if (CoreContext.Configuration.Personal)
            {
                yield return(RegisterObject("Personal", CoreContext.Configuration.Personal));
            }

            yield return(RegisterObject("ShowPromotions", SettingsManager.Instance.LoadSettings <StudioNotifyBarSettings>(TenantProvider.CurrentTenantID).ShowPromotions));

            yield return(RegisterObject("EmailRegExpr", @"^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$"));

            yield return(RegisterObject("GroupSelector_MobileVersionGroup", new { Id = -1, Name = UserControlsCommonResource.LblSelect.HtmlEncode().ReplaceSingleQuote() }));

            yield return(RegisterObject("GroupSelector_WithGroupEveryone", new { Id = ASC.Core.Users.Constants.GroupEveryone.ID, Name = UserControlsCommonResource.Everyone.HtmlEncode().ReplaceSingleQuote() }));

            yield return(RegisterObject("GroupSelector_WithGroupAdmin", new { Id = ASC.Core.Users.Constants.GroupAdmin.ID, Name = UserControlsCommonResource.Admin.HtmlEncode().ReplaceSingleQuote() }));

            yield return(RegisterObject("FilterHelpCenterLink", CommonLinkUtility.GetHelpLink(true) + "/tipstricks/using-search.aspx"));

            yield return(RegisterObject("SetupInfoNotifyAddress", SetupInfo.NotifyAddress));

            yield return(RegisterObject("CKEDITOR_BASEPATH", WebPath.GetPath("/usercontrols/common/ckeditor/")));

            yield return(RegisterObject("MaxImageFCKWidth", ConfigurationManager.AppSettings["MaxImageFCKWidth"] ?? "620"));

            yield return(RegisterObject("UserPhotoHandlerUrl", VirtualPathUtility.ToAbsolute("~/UserPhoto.ashx")));

            yield return(RegisterObject("ImageWebPath", WebImageSupplier.GetImageFolderAbsoluteWebPath()));

            yield return(RegisterObject("UploadFlashUrl", FileUploaderFlashParams.GetFlashUrl));

            yield return(RegisterObject("UploadDefaultRuntimes", FileUploaderFlashParams.DefaultRuntimes));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.RegisterBodyScripts("~/UserControls/Management/TimeAndLanguage/js/timeandlanguage.js")
            .RegisterStyle("~/UserControls/Management/TimeAndLanguage/css/timeandlanguage.less");

            _currentTenant = CoreContext.TenantManager.GetCurrentTenant();

            HelpLink = CommonLinkUtility.GetHelpLink();

            ShowHelper = !(CoreContext.Configuration.Standalone && !CompanyWhiteLabelSettings.Instance.IsDefault);
        }
Exemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(BackupAjaxHandler), Page);

            HelpLink = CommonLinkUtility.GetHelpLink();

            Page.RegisterBodyScripts("~/UserControls/Management/TransferPortal/js/transferportal.js")
            .RegisterStyle("~/UserControls/Management/TransferPortal/css/transferportal.less");

            PopupTransferStartContainer.Options.IsPopup = true;
        }
Exemplo n.º 30
0
        private static string GetHelpLink()
        {
            var baseHelpLink = CommonLinkUtility.GetHelpLink();

            if (string.IsNullOrEmpty(baseHelpLink))
            {
                baseHelpLink = WebConfigurationManager.AppSettings["web.faq-url"] ?? string.Empty;
            }

            return(baseHelpLink.TrimEnd('/'));
        }