Beispiel #1
0
        public string BindRolesForSecurityGrid(string rootPath)
        {
            StringBuilder sb = new StringBuilder();

            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            foreach (DotNetNuke.Security.Roles.RoleInfo ri in rc.GetPortalRoles(PortalId))
            {
                sb.Append("<option value=\"" + ri.RoleID + "\">" + ri.RoleName + "</option>");
            }

#if !SKU_LITE
            if (System.IO.File.Exists(rootPath + "bin\\active.modules.social.dll"))
            {
                Modules.ActiveForums.Social social = new Modules.ActiveForums.Social();
                using (IDataReader dr = social.ActiveSocialListGroups(PortalId))
                {
                    while (dr.Read())
                    {
                        sb.Append("<optgroup label=\"" + dr["GroupName"].ToString() + "\">");
                        sb.Append("<option value=\"" + dr["GroupId"].ToString() + ":0\">Group Admin</option>");
                        sb.Append("<option value=\"" + dr["GroupId"].ToString() + ":1\">Group Member</option>");
                        sb.Append("</optgroup>");
                    }
                    dr.Close();
                }
            }
#endif

            return(sb.ToString());
        }
        private string GetRoleIds(UserInfo u, int SiteId)
        {
            string RoleIds = "";

            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            foreach (DotNetNuke.Security.Roles.RoleInfo r in rc.GetPortalRoles(SiteId))
            {
                string roleName = r.RoleName;
                foreach (string role in u.Roles)
                {
                    if (role != "" && role != null)
                    {
                        if (roleName == role)
                        {
                            RoleIds += r.RoleID.ToString() + ";";
                            break;
                        }
                    }
                }
            }

            foreach (DotNetNuke.Security.Roles.RoleInfo r in u.Social.Roles)
            {
                RoleIds += r.RoleID.ToString() + ";";
            }

            return(RoleIds);
        }
Beispiel #3
0
		public string BindRolesForSecurityGrid(string rootPath)
		{
			StringBuilder sb = new StringBuilder();

			DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
			foreach (DotNetNuke.Security.Roles.RoleInfo ri in rc.GetPortalRoles(PortalId))
			{
				sb.Append("<option value=\"" + ri.RoleID + "\">" + ri.RoleName + "</option>");
            }

#if !SKU_LITE
            if (System.IO.File.Exists(rootPath + "bin\\active.modules.social.dll"))
			{
				Modules.ActiveForums.Social social = new Modules.ActiveForums.Social();
				using (IDataReader dr = social.ActiveSocialListGroups(PortalId))
				{
					while (dr.Read())
					{
						sb.Append("<optgroup label=\"" + dr["GroupName"].ToString() + "\">");
						sb.Append("<option value=\"" + dr["GroupId"].ToString() + ":0\">Group Admin</option>");
						sb.Append("<option value=\"" + dr["GroupId"].ToString() + ":1\">Group Member</option>");
						sb.Append("</optgroup>");

					}
					dr.Close();
				}
			}
#endif

			return sb.ToString();
		}
Beispiel #4
0
        /// <summary>
        /// 绑定左边项
        /// </summary>
        private void BindDataItem()
        {
            Playngo_ClientZone_Jurisdiction item = CategoryItem;


            txtName.Text        = item.Name;
            txtContentText.Text = item.ContentText;

            //增加权限用户
            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            WebHelper.BindList(cblPermissionsRoles, rc.GetPortalRoles(PortalId), "RoleName", "RoleName");
            WebHelper.SelectedListMultiByValue(cblPermissionsRoles, item.Per_Roles);

            cbPermissionsAllUsers.Checked = item.Per_AllUsers == 0;

            if (CategoryID > 0)
            {
                cmdDelete.Visible = true;
                cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
            }
            else
            {
                //新增界面
                cmdDelete.Visible = false;
            }


            DotNetNuke.UI.Utilities.ClientAPI.RegisterKeyCapture(txtSearch, btnSearch, 13);
        }
        /// <Description>
        /// 绑定页面项
        /// </Description>
        private void BindPageItem()
        {
            EffectDBEntity EffectDB = Setting_EffectDB;


            hlAddGroups.NavigateUrl = xUrl("Groups");
            hlAddGroups.Attributes.Add("onclick", String.Format("return confirm('{0}');", Localization.GetString("hlAddGroups.Confirm", this.LocalResourceFile)));
            divGroups.Visible       = EffectDB.Groups;
            divCustomModels.Visible = EffectDB.CustomModels;
            divNumbers.Visible      = EffectDB.Downloads;

            //增加权限用户
            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            WebHelper.BindList(cblPermissionsRoles, rc.GetPortalRoles(PortalId), "RoleName", "RoleName");


            //构造增加按钮
            if (EffectDB.Layers && SliderID > 0)
            {
                liTitle_Layers.Text = String.Format("{0} List", EffectDB.LayerName);


                StringBuilder AddNewBuilder = new StringBuilder();
                //通用按钮
                AddNewBuilder.Append(AddNewLayerHtml(""));

                if (!String.IsNullOrEmpty(EffectDB.LayerType))
                {
                    List <String> AddNewList = Common.GetList(EffectDB.LayerType);
                    foreach (String AddNew in AddNewList)
                    {
                        if (!String.IsNullOrEmpty(AddNew))
                        {
                            AddNewBuilder.Append(AddNewLayerHtml(AddNew));
                        }
                    }
                }

                liAddNewLink_List.Text = AddNewBuilder.ToString();

                div_Layers.Visible = true;
            }
            else
            {
                div_Layers.Visible = false;
            }



            ////插入用户按钮的连接
            //hlCreateUser.NavigateUrl = String.Format("{0}Resource_UserList.aspx?ModuleId={1}&PortalId={2}&UserId={3}&HomeDirectory={4}&TB_iframe=true&keepThis=true&height=400&width=600", ModulePath, ModuleId, PortalId, UserId, HttpUtility.UrlEncode(PortalSettings.HomeDirectory));

            //绑定状态代码
            WebHelper.BindList(ddlArticleStatus, typeof(EnumStatus));
        }
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindDataToPage()
        {
            Playngo_ClientZone_DynamicModule Dynamic = DynamicModule;


            txtTitle.Text            = Dynamic.Title;
            cbIncludeTabLink.Checked = Dynamic.IncludeTabLink == 1;
            cbPDFGenerator.Checked   = Dynamic.PDFGenerator == 1;



            //增加权限用户
            cbPermissionsAllUsers.Checked = Dynamic.Per_AllUsers == 0;

            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            WebHelper.BindList(cblPermissionsRoles, rc.GetPortalRoles(PortalId), "RoleName", "RoleName");
            WebHelper.SelectedListMultiByValue(cblPermissionsRoles, Dynamic.Per_Roles);
        }
Beispiel #7
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindDataToPage()
        {
            //发件人邮箱
            txtSenderEmail.Text = Settings["PowerForms_SenderEmail"] != null && !string.IsNullOrEmpty(Settings["PowerForms_SenderEmail"].ToString()) ? Convert.ToString(Settings["PowerForms_SenderEmail"]) : Host.HostEmail;

            #region "邮件设置"
            txtAdminEmail.Text         = Settings["PowerForms_AdminEmail"] != null && !string.IsNullOrEmpty(Settings["PowerForms_AdminEmail"].ToString()) ? Convert.ToString(Settings["PowerForms_AdminEmail"]) : Host.HostEmail;
            cbSendToAdmin.Checked      = Settings["PowerForms_SendToAdmin"] != null && !string.IsNullOrEmpty(Settings["PowerForms_SendToAdmin"].ToString()) ? Convert.ToBoolean(Settings["PowerForms_SendToAdmin"]) : true;
            cbSendToSubmitUser.Checked = Settings["PowerForms_SendToSubmitUser"] != null && !string.IsNullOrEmpty(Settings["PowerForms_SendToSubmitUser"].ToString()) ? Convert.ToBoolean(Settings["PowerForms_SendToSubmitUser"]) : true;
            //cbReplaceSender.Checked = Settings["PowerForms_ReplaceSender"] != null && !string.IsNullOrEmpty(Settings["PowerForms_ReplaceSender"].ToString()) ? Convert.ToBoolean(Settings["PowerForms_ReplaceSender"]) : false;
            cbReplyTo.Checked = Settings["PowerForms_ReplyTo"] != null?Convert.ToBoolean(Settings["PowerForms_ReplyTo"]) : true;

            WebHelper.BindList <DNNGo_PowerForms_Field>(ddlSubmitUserEmail, DNNGo_PowerForms_Field.FindAllByView(ModuleId, EnumVerification.email), DNNGo_PowerForms_Field._.Alias, DNNGo_PowerForms_Field._.Name);
            WebHelper.SelectedListByValue(ddlSubmitUserEmail, Settings["PowerForms_SubmitUserEmail"] != null && !string.IsNullOrEmpty(Settings["PowerForms_SubmitUserEmail"].ToString()) ? Convert.ToString(Settings["PowerForms_SubmitUserEmail"]) : "Email");


            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            WebHelper.BindList(cblAdminEmailRoles, rc.GetPortalRoles(PortalId), "RoleName", "RoleName");
            WebHelper.SelectedListMultiByValue(cblAdminEmailRoles, Settings["PowerForms_AdminEmailRoles"] != null ? Convert.ToString(Settings["PowerForms_AdminEmailRoles"]) : "");


            //需要读取模版的设置
            DNNGo_PowerForms_Template Template = DNNGo_PowerForms_Template.FindByModuleId(ModuleId);

            txtSendAdminTitle.Text        = !String.IsNullOrEmpty(Template.ReceiversSubject) ? Template.ReceiversSubject : Localization.GetString("PowerForms_ReceiversSubject", this.LocalResourceFile);
            txtSendAdminContent.Text      = !String.IsNullOrEmpty(Template.ReceiversTemplate) ? Server.HtmlDecode(Template.ReceiversTemplate) : Localization.GetString("PowerForms_ReceiversTemplate", this.LocalResourceFile);
            txtSendSubmitUserTitle.Text   = !String.IsNullOrEmpty(Template.ReplySubject) ? Template.ReplySubject : Localization.GetString("PowerForms_ReplySubject", this.LocalResourceFile);
            txtSendSubmitUserContent.Text = !String.IsNullOrEmpty(Template.ReplyTemplate) ? Server.HtmlDecode(Template.ReplyTemplate) : Localization.GetString("PowerForms_ReplyTemplate", this.LocalResourceFile);
            #endregion

            #region "定时邮件设置"
            DNNGo_PowerForms_Scheduler SchedulerItem = DNNGo_PowerForms_Scheduler.FindSettings(this);
            txtScheduleSenderEmail.Text = !String.IsNullOrEmpty(SchedulerItem.SenderEmail) ? SchedulerItem.SenderEmail: Host.HostEmail;
            txtExcelName.Text           = !String.IsNullOrEmpty(SchedulerItem.ExcelName) ? SchedulerItem.ExcelName : "Bulk_{yyyy}_{mm}_{dd}_{time}_{ModuleID}";
            cbScheduleEnable.Checked    = SchedulerItem.Enable != 0;

            #endregion
        }
		private string GetRoleIds(string[] Roles, int SiteId)
		{
			string RoleIds = "";
			DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
			foreach (DotNetNuke.Security.Roles.RoleInfo r in rc.GetPortalRoles(SiteId))
			{
				string roleName = r.RoleName;
				foreach (string role in Roles)
				{
					if (role != "" && role != null)
					{
						if (roleName == role)
						{
							RoleIds += r.RoleID.ToString() + ";";
							break;
						}
					}
				}
			}
			return RoleIds;
		}
Beispiel #9
0
        /// <summary>
        /// 绑定数据项
        /// </summary>
        private void BindDataItem()
        {
            Playngo_ClientZone_DownloadFile Event = EventItem;

            //验证文章是否存在
            if (DownloadID > 0 && (Event == null || DownloadID != Event.ID))
            {
                //需要给出提示,载入文章错误
                mTips.LoadMessage("LoadingEventError", EnumTips.Error, this, new String[] { "" });
                Response.Redirect(xUrl("Downloads"), false);
            }

            if (Event == null)
            {
                Event = new Playngo_ClientZone_DownloadFile();
            }



            //这里需要验证一下权限,当作者进入到别人的文章时,需要跳到列表页面
            if (Event != null && Event.ID > 0 && (!IsAdministrator && !IsAdmin) && Event.CreateUser != UserId)
            {
                //需要给出提示,你无权编辑其他作者的文章
                mTips.LoadMessage("NoPermissionEventAlert", EnumTips.Warning, this, new String[] { Event.Title });
                Response.Redirect(xUrl("Downloads"), false);
            }

            if (Event != null && Event.ID > 0)
            {
                liLastUpdated.Text = Event.LastTime.ToString("MM/dd/yyyy hh:mm tt", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            }



            txtTitle.Text = Common.RestoreEscape(Event.Title);
            //txtGameID.Text = Event.GameID;
            txtVersion.Text = Event.Version;


            cbIncludeNotification.Checked = Event.NotifyInclude == 1;
            WebHelper.SelectedListByValue(ddlNotificationStatus, Event.NotifyStatus);
            cbNotifySubscribers.Checked = Event.NotifySubscribers == 1;


            txtStartDate.Text = Event.StartTime.ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            txtStartTime.Text = Event.StartTime.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo);

            txtReleaseDate.Text = Event.ReleaseDate.ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            txtReleaseTime.Text = Event.ReleaseDate.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo);

            txtDisableDate.Text = Event.EndTime.ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            txtDisableTime.Text = Event.EndTime.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo);


            //角色
            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            WebHelper.BindList(cblPermissionsRoles, rc.GetPortalRoles(PortalId), "RoleName", "RoleName");
            WebHelper.SelectedListMultiByValue(cblPermissionsRoles, Event.Per_Roles);
            cbPermissionsAllUsers.Checked = Event.Per_AllUsers == 0;



            //区域
            cbAllJurisdictions.Checked = Event.Per_AllJurisdictions == 0;
            WebHelper.BindList(cblJurisdictions, Playngo_ClientZone_Jurisdiction.GetAllCheckList(ModuleId), "Name", "ID");
            WebHelper.SelectedListMultiByValue(cblJurisdictions, Event.Per_Jurisdictions);

            //Game Categorys
            WebHelper.BindList(cblGameCategory, Playngo_ClientZone_GameCategory.GetAllCheckList(ModuleId), "Name", "ID");
            WebHelper.SelectedListMultiByValue(cblGameCategory, Event.GameCategories);

            //File Types
            WebHelper.BindList(cblFileType, Playngo_ClientZone_FileType.GetAllCheckList(ModuleId), "Name", "ID");
            WebHelper.SelectedListMultiByValue(cblFileType, Event.FileTypes);



            Event.CreateUser = Event.CreateUser == 0 ? UserId : Event.CreateUser;
            UserInfo CreateUserInfo = UserController.GetUserById(PortalId, Event.CreateUser);

            hfEventAuthor.Value     = Event.CreateUser.ToString();
            lbEventAuthor.Text      = CreateUserInfo != null && CreateUserInfo.UserID > 0 ? CreateUserInfo.DisplayName : "None";
            imgEventAuthor.ImageUrl = ViewUserPic(CreateUserInfo);

            WebHelper.SelectedListByValue(ddlEventStatus, Event.Status);//管理员看到的文章状态
        }
        /// <summary>
        /// 绑定方案项
        /// </summary>
        private void BindDataItem()
        {
            //取出当前的方案实体,并绑定到相应的控件上
            DNNGo_PowerForms_Field fieldItem = FieldItem;

            if (fieldItem == null)
            {
                fieldItem = new DNNGo_PowerForms_Field();
            }

            if (fieldItem.ID > 0)
            {
                //更新方案
                //需要将几个控件设置为不可操作状态
                txtName.Enabled        = false;
                ddlControlType.Enabled = false;
            }
            else
            {
                //新增方案
            }

            //绑定字段类型
            //BindFieldTypeView(fieldItem.FieldType);


            EffectDB EffectDB = Setting_EffectDB;

            divGroup.Visible = EffectDB.Group;
            if (EffectDB.Group)
            {
                BindTreeGroups(fieldItem);
            }

            //增加权限用户
            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            WebHelper.BindList(cblPermissionsRoles, rc.GetPortalRoles(PortalId), "RoleName", "RoleName");
            WebHelper.SelectedListMultiByValue(cblPermissionsRoles, fieldItem.Per_Roles);

            cbPermissionsAllUsers.Checked = fieldItem.Per_AllUsers == 0 ? true : false;

            WebHelper.BindList(ddlControlType, typeof(EnumViewControlType));
            WebHelper.SelectedListByValue(ddlControlType, fieldItem.FieldType);

            WebHelper.BindList(ddlVerification, typeof(EnumVerification));
            WebHelper.SelectedListByValue(ddlVerification, fieldItem.Verification);

            WebHelper.BindList(rblFTDirection, typeof(EnumControlDirection));
            WebHelper.SelectedListByValue(rblFTDirection, fieldItem.Direction);



            List <DNNGo_PowerForms_Field> FieldControls = DNNGo_PowerForms_Field.FindAllByModuleId(ModuleId);

            WebHelper.BindList <DNNGo_PowerForms_Field>(ddlFTEqualsControl, FieldControls, "Name", "ID");
            WebHelper.BindItem(ddlFTEqualsControl, ViewResourceText("lblDDRSelect", "==Please select=="), "0");
            WebHelper.SelectedListByValue(ddlFTEqualsControl, fieldItem.EqualsControl);

            WebHelper.BindList <DNNGo_PowerForms_Field>(ddlFTAssociatedControl, FieldControls.FindAll(r => r.FieldType == (Int32)EnumViewControlType.DropDownList_Country), "Name", "ID");
            WebHelper.BindItem(ddlFTAssociatedControl, ViewResourceText("lblDDRSelect", "==Please select=="), "0");
            WebHelper.SelectedListByValue(ddlFTAssociatedControl, fieldItem.AssociatedControl);


            txtName.Text                = fieldItem.Name;
            txtDescription.Text         = fieldItem.Description;
            txtAlias.Text               = fieldItem.Alias;
            txtToolTip.Text             = fieldItem.ToolTip;
            txtFTDefaultValue.Text      = fieldItem.DefaultValue;
            txtTinymceDefaultValue.Text = fieldItem.DefaultValue;
            txtFTListCollection.Text    = fieldItem.FiledList;
            txtFTRows.Text              = fieldItem.Rows.ToString();
            WebHelper.SelectedListByValue(rblFTDirection, fieldItem.Direction);
            txtFTListColumn.Text = fieldItem.ListColumn.ToString();

            txtFTInputLength.Text = fieldItem.InputLength.ToString();

            txtFTWidth.Text = fieldItem.Width.ToString();
            WebHelper.BindList(ddlFTWidth, typeof(EnumWidthSuffix));
            WebHelper.SelectedListByValue(ddlFTWidth, fieldItem.WidthSuffix);



            //文章状态
            cbStatus.Checked = fieldItem.Status == (Int32)EnumStatus.Activation;
            //是否必填
            cbRequired.Checked = fieldItem.Required == 1;

            //发布时间和结束时间
            if (FieldID > 0 && fieldItem != null && fieldItem.ID > 0)
            {
                liStartDateTime.Text   = fieldItem.StartTime.ToString("MM/dd/yyyy hh:mm tt", new CultureInfo("en-US", false)); //Thread.CurrentThread.CurrentCulture
                liDisableDateTime.Text = fieldItem.EndTime.ToString("MM/dd/yyyy hh:mm tt", new CultureInfo("en-US", false));   //Thread.CurrentThread.CurrentCulture
            }
            txtStartDate.Text = fieldItem.StartTime.ToString("MM/dd/yyyy", new CultureInfo("en-US", false));
            txtStartTime.Text = fieldItem.StartTime.ToString("hh:mm tt", new CultureInfo("en-US", false));

            txtDisableDate.Text = fieldItem.EndTime.ToString("MM/dd/yyyy", new CultureInfo("en-US", false));
            txtDisableTime.Text = fieldItem.EndTime.ToString("hh:mm tt", new CultureInfo("en-US", false));
        }