Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var userInfo = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);

            IsAdmin = userInfo.IsAdmin() || WebItemSecurity.IsProductAdministrator(WebItemManager.PeopleProductID, userInfo.ID);
            Actions = new AllowedActions(userInfo);

            var quota = TenantExtra.GetTenantQuota();

            IsFreeTariff = quota.Free && !quota.Open;

            DisplayPayments = TenantExtra.EnableTarrifSettings && (!CoreContext.Configuration.Standalone || quota.ActiveUsers != LicenseReader.MaxUserCount);

            if (DisplayPayments)
            {
                int notifyCount;
                int.TryParse(ConfigurationManager.AppSettings["web.tariff-notify.user"] ?? "5", out notifyCount);
                DisplayPaymentsFirst = notifyCount > 0 && quota.ActiveUsers - TenantStatisticsProvider.GetUsersCount() < notifyCount;
            }

            var controlEmailChange = (UserEmailChange)LoadControl(UserEmailChange.Location);

            controlEmailChange.UserInfo = userInfo;
            controlEmailChange.RegisterStylesAndScripts = true;
            userEmailChange.Controls.Add(controlEmailChange);

            loaderHolder.Controls.Add(LoadControl(LoaderPage.Location));
            userConfirmationDelete.Controls.Add(LoadControl(ConfirmationDeleteUser.Location));

            if (Actions.AllowEdit)
            {
                userPwdChange.Controls.Add(LoadControl(PwdTool.Location));
            }
            Title = HeaderStringHelper.GetPageTitle(PeopleResource.ProductName);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userInfo = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);
            IsAdmin  = userInfo.IsAdmin();
            Actions  = new AllowedActions(userInfo);

            var quota = TenantExtra.GetTenantQuota();

            IsFreeTariff = quota.Free && !quota.Open;

            DisplayPayments = !CoreContext.Configuration.Standalone || quota.ActiveUsers != LicenseReader.MaxUserCount;

            var controlEmailChange = (UserEmailChange)LoadControl(UserEmailChange.Location);

            controlEmailChange.UserInfo = userInfo;
            userEmailChange.Controls.Add(controlEmailChange);

            loaderHolder.Controls.Add(LoadControl(LoaderPage.Location));
            userConfirmationDelete.Controls.Add(LoadControl(ConfirmationDeleteUser.Location));

            if (Actions.AllowEdit)
            {
                userPwdChange.Controls.Add(LoadControl(PwdTool.Location));
            }
            Title = HeaderStringHelper.GetPageTitle(PeopleResource.ProductName);
        }
Exemplo n.º 3
0
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("SGSettings(");
            bool          __first = true;

            if (Permissions != null && __isset.permissions)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Permissions: ");
                __sb.Append(Permissions.ToDebugString());
            }
            if (AllowedActions != null && __isset.allowedActions)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("AllowedActions: ");
                __sb.Append(AllowedActions.ToDebugString());
            }
            if (Properties != null && __isset.properties)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Properties: ");
                __sb.Append(Properties.ToDebugString());
            }
            if (__isset.isDiscoverable)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("IsDiscoverable: ");
                __sb.Append(IsDiscoverable);
            }
            if (__isset.isPrivate)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("IsPrivate: ");
                __sb.Append(IsPrivate);
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
Exemplo n.º 4
0
        private IAction GetAction(AllowedActions action)
        {
            switch (action)
            {
            case AllowedActions.ToFileName:
                return(new TagToFileNameAction());

            case AllowedActions.ToTag:
                return(new FileNameToTagAction());

            default:
                return(null);
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userInfo = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);
            IsAdmin  = userInfo.IsAdmin();
            Actions  = new AllowedActions(userInfo);

            var quota = TenantExtra.GetTenantQuota();

            IsFreeTariff = quota.Free && !quota.Open;

            _confirmationDeleteDepartmentPanel.Options.IsPopup = true;
            _resendInviteDialog.Options.IsPopup     = true;
            _changeStatusDialog.Options.IsPopup     = true;
            _changeTypeDialog.Options.IsPopup       = true;
            _deleteUsersDialog.Options.IsPopup      = true;
            _deleteProfileContainer.Options.IsPopup = true;

            var emptyContentForPeopleFilter = new EmptyScreenControl
            {
                ID         = "emptyContentForPeopleFilter",
                ImgSrc     = WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png"),
                Header     = PeopleResource.NotFoundTitle,
                Describe   = PeopleResource.NotFoundDescription,
                ButtonHTML = String.Format(@"<a class='clearFilterButton link dotline' href='javascript:void(0);' 
                                            onclick='ASC.People.PeopleController.resetAllFilters();'>{0}</a>",
                                           PeopleResource.ClearButton),
                CssClass = "display-none"
            };

            emptyScreen.Controls.Add(emptyContentForPeopleFilter);


            var controlEmailChange = (UserEmailChange)LoadControl(UserEmailChange.Location);

            controlEmailChange.UserInfo = userInfo;
            userEmailChange.Controls.Add(controlEmailChange);

            loaderHolder.Controls.Add(LoadControl(LoaderPage.Location));
            userConfirmationDelete.Controls.Add(LoadControl(ConfirmationDeleteUser.Location));

            if (Actions.AllowEdit)
            {
                userPwdChange.Controls.Add(LoadControl(PwdTool.Location));
            }
            Title = HeaderStringHelper.GetPageTitle(PeopleResource.ProductName);
        }
Exemplo n.º 6
0
        internal override List <GrabSpot> GetGrabSpots(float scale)
        {
            AllowedActions allows = Allows;             // this is potentially somewhat slow to calculate

            if ((allows & AllowedActions.TransformMove) == 0)
            {
                return(null);
            }
            List <GrabSpot> list = new List <GrabSpot>();

            if ((allows & AllowedActions.TransformRotate) > 0)
            {
                base.AddStandardRotationGrabSpot(list);
            }
            if ((allows & AllowedActions.TransformScale) > 0)
            {
                base.AddBoundingGrabSpots(list, scale);
            }
            return(list);
        }