protected void Page_Load(object sender, EventArgs e)
        {
            //BindServerTime();

            // set display preferences
            gvSchedules.PageSize = UsersHelper.GetDisplayItemsPerPage();

            if (!IsPostBack)
            {
                chkRecursive.Visible = (PanelSecurity.EffectiveUser.Role != UserRole.User);
                // toggle controls
                //btnAddItem.Enabled = PackagesHelper.CheckGroupQuotaEnabled(
                //   PanelSecurity.PackageId, ResourceGroups.Statistics, Quotas.STATS_SITES);

                searchBox.AddCriteria("ScheduleName", GetLocalizedString("Text.ScheduleName"));
                searchBox.AddCriteria("Username", GetLocalizedString("Text.Username"));
                searchBox.AddCriteria("FullName", GetLocalizedString("Text.FullName"));
                searchBox.AddCriteria("Email", GetLocalizedString("Text.Email"));

                bool isUser = PanelSecurity.SelectedUser.Role == UserRole.User;
                gvSchedules.Columns[gvSchedules.Columns.Count - 1].Visible = !isUser;
                gvSchedules.Columns[gvSchedules.Columns.Count - 2].Visible = !isUser;
            }
            searchBox.AjaxData = this.GetSearchBoxAjaxData();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // check for user
            bool isUser = PanelSecurity.SelectedUser.Role == UserRole.User;

            // load icons data
            xmlIcons = this.Module.SelectNodes("Icon");

            if (isUser && xmlIcons != null)
            {
                // USER
                UserPackagesPanel.Visible = true;
                PackagesList.DataSource   = new PackagesHelper().GetMyPackages();
                PackagesList.DataBind();

                if (PackagesList.Items.Count == 0)
                {
                    litEmptyList.Text         = GetLocalizedString("gvPackages.Empty");
                    EmptyPackagesList.Visible = true;
                }
            }
            else
            {
                // ADMINS, RESELLERS
                ResellerPackagesPanel.Visible = true;
                gvPackages.PageSize           = UsersHelper.GetDisplayItemsPerPage();
                gvPackages.Columns[1].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
            }

            // toggle button
            ButtonsPanel.Visible = (PanelSecurity.SelectedUserId != PanelSecurity.EffectiveUserId);
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // set display preferences
            gvPackages.PageSize = UsersHelper.GetDisplayItemsPerPage();

            if (!IsPostBack)
            {
                searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
                searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.Name"));
                searchBox.AddCriteria("Email", GetLocalizedString("SearchField.EMail"));

                // set inital controls state from request
                if (Request["FilterColumn"] != null)
                {
                    searchBox.FilterColumn = Request["FilterColumn"];
                }
                if (Request["FilterValue"] != null)
                {
                    searchBox.FilterValue = Request["FilterValue"];
                }
                if (Request["StatusID"] != null)
                {
                    Utils.SelectListItem(ddlStatus, Request["StatusID"]);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClientScriptManager cs = Page.ClientScript;

            cs.RegisterClientScriptInclude("jquery", ResolveUrl("~/JavaScript/jquery-1.4.4.min.js"));

            // Maintains appearance settings corresponding to user's display preferences
            gvApplications.PageSize = UsersHelper.GetDisplayItemsPerPage();

            try
            {
                GalleryCategoriesResult result = ES.Services.WebApplicationGallery.GetGalleryCategories(PanelSecurity.PackageId);
                //
                if (!result.IsSuccess)
                {
                    rbsCategory.Visible = false;
                    messageBox.ShowMessage(result, "WAG_NOT_AVAILABLE", "ModuleWAG");
                    return;
                }

                if (!IsPostBack)
                {
                    //
                    SetLanguage();
                    BindLanguages();
                    BindCategories();
                    BindApplications();
                    ViewState["IsSearchResults"] = false;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("GET_WEB_GALLERY_CATEGORIES", ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // set display preferences
            gvReport.PageSize = UsersHelper.GetDisplayItemsPerPage();

            if (!IsPostBack)
            {
                // set start date
                if (Request["StartDate"] != null)
                {
                    calStartDate.SelectedDate = new DateTime(Int64.Parse(Request["StartDate"]));
                    calEndDate.SelectedDate   = new DateTime(Int64.Parse(Request["EndDate"]));
                }
                else
                {
                    DateTime dt = DateTime.Now;
                    calStartDate.SelectedDate = new DateTime(dt.Year, dt.Month, 1);
                    calEndDate.SelectedDate   = new DateTime(dt.Year, dt.Month,
                                                             DateTime.DaysInMonth(dt.Year, dt.Month));
                }

                // apply to the report
                DisplayReport();
            }
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Maintains appearance settings corresponding to user's display preferences
            gvApplications.PageSize = UsersHelper.GetDisplayItemsPerPage();

            try
            {
                GalleryCategoriesResult result = ES.Services.WebApplicationGallery.GetGalleryCategories(PanelSecurity.PackageId);
                //
                if (!result.IsSuccess)
                {
                    ddlCategory.Visible = false;
                    messageBox.ShowMessage(result, "WAG_NOT_AVAILABLE", "ModuleWAG");
                    return;
                }

                if (!IsPostBack)
                {
                    BindCategories();
                    BindApplications();
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("GET_WEB_GALLERY_CATEGORIES", ex);
            }
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClientScriptManager cs = Page.ClientScript;

            cs.RegisterClientScriptInclude("jquery", ResolveUrl("~/JavaScript/jquery-1.4.4.min.js"));

            dnsRecords = new Dictionary <int, string>();

            gvDomains.PageSize = UsersHelper.GetDisplayItemsPerPage();

            // visibility
            chkRecursive.Visible         = (PanelSecurity.SelectedUser.Role != UserRole.User);
            gvDomains.Columns[5].Visible = gvDomains.Columns[6].Visible =
                (PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
            gvDomains.Columns[7].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
            gvDomains.Columns[8].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);

            if (!IsPostBack)
            {
                // toggle controls
                btnAddDomain.Enabled = PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Os, Quotas.OS_DOMAINS) ||
                                       PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Os, Quotas.OS_SUBDOMAINS) ||
                                       PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Os, Quotas.OS_DOMAINPOINTERS);

                searchBox.AddCriteria("DomainName", GetLocalizedString("SearchField.DomainName"));
                if ((PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked)
                {
                    searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
                    searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.FullName"));
                    searchBox.AddCriteria("Email", GetLocalizedString("SearchField.Email"));
                }
            }
            searchBox.AjaxData = this.GetSearchBoxAjaxData();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Localization for JS
            RegisterJsLocalizedMessages();
            //
            gvFilesID.Text = gvFiles.ClientID;

            string downloadFile = Request["DownloadFile"];

            if (downloadFile != null)
            {
                // download file
                Response.Clear();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(downloadFile));
                Response.ContentType = "application/octet-stream";

                int    FILE_BUFFER_LENGTH = 5000000;
                byte[] buffer             = null;
                int    offset             = 0;
                do
                {
                    try
                    {
                        // read remote content
                        buffer = ES.Services.Files.GetFileBinaryChunk(PanelSecurity.PackageId, downloadFile, offset, FILE_BUFFER_LENGTH);
                    }
                    catch (Exception ex)
                    {
                        messageBox.ShowErrorMessage("FILES_READ_FILE", ex);
                        break;
                    }

                    // write to stream
                    Response.BinaryWrite(buffer);

                    offset += FILE_BUFFER_LENGTH;
                }while (buffer.Length == FILE_BUFFER_LENGTH);
                Response.End();
            }

            // set display preferences
            gvFiles.PageSize = UsersHelper.GetDisplayItemsPerPage();
            if (!IsPostBack)
            {
                BindPath();
                BindEncodings();
            }
            //Make sure text boxes in popup screens are focussed
            SetModalPopupFocus();
        }
        private void BindUser()
        {
            UserInfo user = ES.Services.Users.GetUserById(PanelSecurity.LoggedUserId);

            if (user != null)
            {
                userPassword.SetUserPolicy(user.UserId, UserSettings.WEBSITEPANEL_POLICY, "PasswordPolicy");

                // account info
                txtFirstName.Text           = PortalAntiXSS.DecodeOld(user.FirstName);
                txtLastName.Text            = PortalAntiXSS.DecodeOld(user.LastName);
                txtEmail.Text               = user.Email;
                txtSecondaryEmail.Text      = user.SecondaryEmail;
                lblUsername.Text            = user.Username;
                ddlMailFormat.SelectedIndex = user.HtmlMail ? 1 : 0;

                // contact info
                contact.CompanyName    = user.CompanyName;
                contact.Address        = user.Address;
                contact.City           = user.City;
                contact.Country        = user.Country;
                contact.State          = user.State;
                contact.Zip            = user.Zip;
                contact.PrimaryPhone   = user.PrimaryPhone;
                contact.SecondaryPhone = user.SecondaryPhone;
                contact.Fax            = user.Fax;
                contact.MessengerId    = user.InstantMessenger;

                // bind language

                /*DotNetNuke.Entities.Users.UserInfo dnnUser =
                 *  DnnUsers.GetUserByName(PortalSettings.PortalId, user.Username, false);
                 *
                 * if (dnnUser != null)
                 *  Utils.SelectListItem(ddlLanguage, dnnUser.Profile.PreferredLocale);*/

                // bind items per page

                txtItemsPerPage.Text = UsersHelper.GetDisplayItemsPerPage().ToString();
            }
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // set display preferences
            if (!IsPostBack)
            {
                // page size
                gvIPAddresses.PageSize        = UsersHelper.GetDisplayItemsPerPage();
                ddlItemsPerPage.SelectedValue = gvIPAddresses.PageSize.ToString();

                gvIPAddresses.PageIndex = PageIndex;

                // pool
                if (!String.IsNullOrEmpty(PanelRequest.PoolId))
                {
                    ddlPools.SelectedValue = PanelRequest.PoolId;
                }
            }
            else
            {
                gvIPAddresses.PageSize = Utils.ParseInt(ddlItemsPerPage.SelectedValue, 10);
            }


            if (!IsPostBack)
            {
                searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP"));
                searchBox.AddCriteria("InternalIP", GetLocalizedString("SearchField.InternalIP"));
                searchBox.AddCriteria("DefaultGateway", GetLocalizedString("SearchField.DefaultGateway"));
                searchBox.AddCriteria("ServerName", GetLocalizedString("SearchField.Server"));
                searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName"));
                searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
            }
            searchBox.AjaxData = this.GetSearchBoxAjaxData();

            // toggle columns
            bool vps = ddlPools.SelectedIndex > 1;

            gvIPAddresses.Columns[3].Visible = vps;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // set display preferences
            gvUsers.PageSize = UsersHelper.GetDisplayItemsPerPage();

            if (!IsPostBack)
            {
                searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
                searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.Name"));
                searchBox.AddCriteria("Email", GetLocalizedString("SearchField.EMail"));
                searchBox.AddCriteria("CompanyName", GetLocalizedString("SearchField.CompanyName"));

                // set inital controls state from request
                if (Request["FilterColumn"] != null)
                {
                    searchBox.FilterColumn = Request["FilterColumn"];
                }
                if (Request["FilterValue"] != null)
                {
                    searchBox.FilterValue = Request["FilterValue"];
                }
                if (Request["StatusID"] != null)
                {
                    Utils.SelectListItem(ddlStatus, Request["StatusID"]);
                }
                if (Request["RoleID"] != null)
                {
                    Utils.SelectListItem(ddlRole, Request["RoleID"]);
                }


                gvUsers.Sort("Username", System.Web.UI.WebControls.SortDirection.Ascending);
            }
            searchBox.AjaxData = this.GetSearchBoxAjaxData();

            searchBox.Focus();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // set display preferences
            if (!IsPostBack)
            {
                // page size
                gvIPAddresses.PageSize        = UsersHelper.GetDisplayItemsPerPage();
                ddlItemsPerPage.SelectedValue = gvIPAddresses.PageSize.ToString();
            }
            else
            {
                gvIPAddresses.PageSize = Utils.ParseInt(ddlItemsPerPage.SelectedValue, 10);
            }


            if (!IsPostBack)
            {
                searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP"));
                searchBox.AddCriteria("ServerName", GetLocalizedString("SearchField.Server"));
                searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName"));
                searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
            }
            searchBox.AjaxData = this.GetSearchBoxAjaxData();
        }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            gvDomains.PageSize = UsersHelper.GetDisplayItemsPerPage();

            // visibility
            chkRecursive.Visible         = (PanelSecurity.SelectedUser.Role != UserRole.User);
            gvDomains.Columns[2].Visible = gvDomains.Columns[3].Visible =
                (PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
            gvDomains.Columns[4].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
            gvDomains.Columns[5].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);

            if (!IsPostBack)
            {
                // toggle controls
                btnAddDomain.Enabled = PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Os, Quotas.OS_DOMAINS) ||
                                       PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Os, Quotas.OS_SUBDOMAINS) ||
                                       PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Os, Quotas.OS_DOMAINPOINTERS);

                searchBox.AddCriteria("DomainName", GetLocalizedString("SearchField.DomainName"));
                searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
                searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.FullName"));
                searchBox.AddCriteria("Email", GetLocalizedString("SearchField.Email"));
            }
        }
Exemple #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // set display preferences
     gvPlans.PageSize           = UsersHelper.GetDisplayItemsPerPage();
     gvPlans.Columns[2].Visible = (PanelSecurity.EffectiveUser.Role == WebsitePanel.EnterpriseServer.UserRole.Administrator);
 }
Exemple #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // set display preferences
     usersList.PageSize = UsersHelper.GetDisplayItemsPerPage();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClientScriptManager cs = Page.ClientScript;

            cs.RegisterClientScriptInclude("jquery", ResolveUrl("~/JavaScript/jquery-1.4.4.min.js"));
            // check for user
            bool isUser = PanelSecurity.SelectedUser.Role == UserRole.User;

            // load icons data
            xmlIcons = this.Module.SelectNodes("Group");

            if (isUser && xmlIcons != null)
            {
                if (!IsPostBack)
                {
                    myPackages = new PackagesHelper().GetMyPackages();
                    myPackages.Tables[0].DefaultView.Sort = "DefaultTopPackage DESC, PackageId ASC";
                    ddlPackageSelect.DataSource           = myPackages.Tables[0].DefaultView;
                    ddlPackageSelect.DataTextField        = myPackages.Tables[0].Columns[2].ColumnName;
                    ddlPackageSelect.DataValueField       = myPackages.Tables[0].Columns[0].ColumnName;
                    ddlPackageSelect.DataBind();
                    if (Session["currentPackage"] == null || ((int)Session["currentUser"]) != PanelSecurity.SelectedUserId)
                    {
                        if (ddlPackageSelect.Items.Count > 0)
                        {
                            Session["currentPackage"] = ddlPackageSelect.Items[0].Value;
                            Session["currentUser"]    = PanelSecurity.SelectedUserId;
                        }
                    }
                    else
                    {
                        currentPackage = int.Parse(Session["currentPackage"].ToString());
                        currentUser    = int.Parse(Session["currentUser"].ToString());
                        ddlPackageSelect.SelectedValue = currentPackage.ToString();
                    }
                }
                // USER
                UserPackagesPanel.Visible = true;
                if (ddlPackageSelect.UniqueID != Page.Request.Params["__EVENTTARGET"])
                {
                    if (ddlPackageSelect.Items.Count == 0)
                    {
                        litEmptyList.Text         = GetLocalizedString("gvPackages.Empty");
                        EmptyPackagesList.Visible = true;
                    }
                    else
                    {
                        ddlPackageSelect.Visible = true;
                        myPackages = new PackagesHelper().GetMyPackage(int.Parse(Session["currentPackage"].ToString()));
                        PackagesList.DataSource = myPackages;
                        PackagesList.DataBind();
                    }
                }
            }
            else
            {
                // ADMINS, RESELLERS
                ResellerPackagesPanel.Visible = true;
                gvPackages.PageSize           = UsersHelper.GetDisplayItemsPerPage();
                gvPackages.Columns[1].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
            }

            // toggle button
            ButtonsPanel.Visible = (PanelSecurity.SelectedUserId != PanelSecurity.EffectiveUserId);
        }