示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         this.DropFixedPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropFloatPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropMovePosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropPopPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         foreach (ListItem lit in this.radlZonetype.Items)
         {
             lit.Attributes.Add("onclick", "ShowZoenTypePanel()");
         }
         foreach (ListItem li2 in this.RBLDefaultSetting.Items)
         {
             li2.Attributes.Add("onclick", "ShowZoenTypePanel()");
         }
         this.DropAdZoneSize.Attributes.Add("onchange", "Zone_SelectSize(this)");
         string zoneid = base.Request.QueryString["ZoneId"];
         if (string.IsNullOrEmpty(zoneid))
         {
             this.TxtZoneJSName.Text = this.GetJSFileName();
             zoneid = "0";
             this.HdnZoneId.Value = zoneid;
             this.Label1.Text = "添加广告版位";
         }
         else
         {
             this.HdnZoneId.Value = zoneid;
             this.Label1.Text = "修改广告版位";
             adzone = B_ADZone.getAdzoneByZoneId(DataConverter.CLng(zoneid));
             this.TxtZoneName.Text = adzone.ZoneName;
             this.TxtZoneJSName.Text = adzone.ZoneJSName;
             this.TxtZoneIntro.Text = adzone.ZoneIntro;
             this.TxtZoneHeight.Text = adzone.ZoneHeight.ToString();
             this.TxtZoneWidth.Text = adzone.ZoneWidth.ToString();
             this.radlZonetype.SelectedValue = adzone.ZoneType.ToString();
             if (!adzone.DefaultSetting)
             {
                 this.RBLDefaultSetting.SelectedValue = "0";
             }
             else
             {
                 this.RBLDefaultSetting.SelectedValue = "1";
             }
             InitShowPanel(adzone.ZoneType);
             InitSetting(adzone.ZoneSetting, adzone.ZoneType);
             this.RadlShowType.SelectedValue = adzone.ShowType.ToString();
             if (adzone.Active)
                 this.ChkActive.Checked = true;
             else
                 this.ChkActive.Checked = false;
         }
     }
 }
示例#2
0
        public static string ShopUrl(string url)
        {
            B_User  bu        = new B_User();
            B_Admin ba        = new B_Admin();
            string  resultUrl = "";

            if (url == null || url.Trim() == "")
            {
                //function.Alert("禁止非法进入!");
                //return;
            }
            Security objSecurity = new Security();
            string   urlEncrypt  = objSecurity.EncryptQueryString(url.ToString());
            string   userUrl     = "";

            if (ba.CheckLogin())
            {
                userUrl = objSecurity.EncryptQueryString(bu.GetLogin().UserID.ToString() + "_admin");
            }
            else if (bu.CheckLogin())
            {
                userUrl = objSecurity.EncryptQueryString(bu.GetLogin().UserID.ToString() + "_member");
            }
            else
            {
                userUrl = objSecurity.EncryptQueryString("-1_visitor");
            }
            resultUrl = "http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/api/ShopSource.aspx?sus=" + userUrl + "&sur=" + urlEncrypt;

            return(resultUrl);
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                badmin.CheckMulitLogin();
                if (!badmin.ChkPermissions("SpecCateManage"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                string id = base.Request.QueryString["id"];

                if (!string.IsNullOrEmpty(id))
                {
                    M_SpecCate speccate = this.bll.GetCate(DataConverter.CLng(id));
                    if (!speccate.IsNull)
                    {
                        this.TxtSpecCateName.Text = speccate.SpecCateName;
                        this.TxtSpecCateDir.Text = speccate.SpecCateDir;
                        this.TxtSpecCateDesc.Text = speccate.SpecCateDesc;
                        this.RBLOpenType.SelectedValue = DataConverter.CLng(speccate.OpenNew).ToString();
                        this.RBLFileExt.SelectedValue = speccate.FileExt.ToString();
                        this.TxtListTemplate.Text = speccate.ListTemplate;
                    }
                }
                else
                {
                    id = "0";
                }
                this.HdnSpecCateID.Value = id;
            }
        }
示例#4
0
文件: B_Admin.cs 项目: baixue001/IPS
        /// <summary>
        /// admin must safe exit ervery time or cookie live just in brower
        /// </summary>
        public static M_AdminInfo GetLogin(HttpContext ctx)
        {
            string sname = "";

            try
            {
                sname = ctx.Session.GetString(prefix + "name");
            }
            catch { }
            if (string.IsNullOrEmpty(sname))
            {
                //从Cookies中重读
                string name = CookieHelper.Get(ctx, prefix + "name");
                string pwd  = CookieHelper.Get(ctx, prefix + "pwd");
                if (StrHelper.StrNullCheck(name, pwd))
                {
                    return(null);
                }
                return(B_Admin.AuthenticateAdmin(name, pwd));
            }
            else
            {
                return(GetAdminByAdminName(sname));
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                badmin.CheckMulitLogin();
                if (!badmin.ChkPermissions("LabelManage"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                string LabelCateList = this.bll.LabelCateList();
                string[] CateArr = LabelCateList.Split(new char[] { ',' });
                string labellist = "";
                for (int i = 0; i < CateArr.Length; i++)
                {
                    if (!string.IsNullOrEmpty(CateArr[i]))
                        labellist = labellist + "<a href=\"LabelManage.aspx?Cate=" + CateArr[i] + "\">" + CateArr[i] + "</a>&nbsp;|&nbsp;";
                }
                this.lblLabel.Text = labellist;
                string LabelCate = this.Request.QueryString["Cate"];
                int CurrentPage;
                if (string.IsNullOrEmpty(this.Request.QueryString["p"]))
                {
                    CurrentPage = 1;
                }
                else
                    CurrentPage = DataConverter.CLng(this.Request.QueryString["p"]);

                int CountPerPage = 20;
                this.repFile.DataSource = this.bll.LabelList(LabelCate, CountPerPage, CurrentPage);
                this.repFile.DataBind();
                int RecordCount = this.bll.GetLabelListCount(LabelCate);
                this.pager1.InnerHtml = function.ShowPage(RecordCount, CountPerPage, CurrentPage, true, "个");
            }
        }
示例#6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("UserGroup"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string id = base.Request.QueryString["id"];
         if (!string.IsNullOrEmpty(id))
         {
             this.HdnGroupID.Value = id;
         }
         else
         {
             this.HdnGroupID.Value = "0";
             id = "0";
         }
         if (id != "0")
         {
             M_Group info = this.bll.GetByID(DataConverter.CLng(id));
             this.TxtGroupName.Text = info.GroupName;
             this.TxtDescription.Text = info.Description;
             this.RBLReg.SelectedValue = DataConverter.CLng(info.RegSelect).ToString();
         }
     }
 }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                badmin.CheckMulitLogin();
                if (!badmin.ChkPermissions("ContentSpec"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }

                if (string.IsNullOrEmpty(base.Request.QueryString["InfoIDs"]))
                {
                    function.WriteErrMsg("没有选定要添加到其他专题的内容ID!");
                }
                else
                {
                    this.TxtGeneralID.Text = base.Request.QueryString["InfoIDs"].Trim();
                }
                this.LstSpec.DataSource = this.bspec.GetSpecAll();
                this.LstSpec.DataTextField = "SpecName";
                this.LstSpec.DataValueField = "SpecID";
                this.LstSpec.DataBind();
            }
        }
示例#8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin badmin = new B_Admin();
     badmin.CheckMulitLogin();
     this.litUserName.Text = HttpContext.Current.Request.Cookies["ManageState"]["LoginName"].ToString();
     this.litDate.Text = DateTime.Now.ToShortDateString();
 }
示例#9
0
 public static void Insert(M_UserExpHis model)
 {
     if (model.UserID == 0)
     {
         M_UserInfo mu = new B_User().GetLogin();
         if (mu != null)
         {
             model.UserID = mu.UserID;
         }
     }
     if (model.Operator == 0)
     {
         M_AdminInfo adminMod = B_Admin.GetLogin();
         if (adminMod != null)
         {
             model.Operator = adminMod.AdminId;
         }
     }
     if (string.IsNullOrEmpty(model.OperatorIP))
     {
         model.OperatorIP = IPScaner.GetUserIP();
     }
     if (string.IsNullOrEmpty(model.Remark) && HttpContext.Current != null)
     {
         model.Remark = HttpContext.Current.Request.RawUrl;
     }
     if (model.HisTime <= DateTime.MinValue)
     {
         model.HisTime = DateTime.Now;
     }
     model.TbName = GetTbName((SType)model.ScoreType);
     DBCenter.Insert(model);
 }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         string templateDir = SiteConfig.SiteOption.TemplateDir;
         string str2 = base.Request.QueryString["FilesDir"];
         string str3 = "";
         if (!string.IsNullOrEmpty(str2))
         {
             str3 = str2.Replace("/", @"\");
         }
         string str4 = "";
         if (!string.IsNullOrEmpty(templateDir))
         {
             str4 = templateDir.Replace("/", @"\");
         }
         this.HdnFileText.Value = str2;
         DirectoryInfo info = new DirectoryInfo(base.Request.PhysicalApplicationPath + str4 + str3);
         if (info.Exists)
         {
             this.BindData(str4 + str3);
         }
     }
 }
示例#11
0
        /// <summary>
        /// 重写管理员信息
        /// </summary>
        public static bool Add(M_AdminInfo madmin)
        {
            string strHostIP = HttpContext.Current.Request.UserHostAddress;

            madmin.AdminPassword        = StringHelper.MD5(madmin.AdminPassword);
            madmin.RoleList             = "1";
            madmin.UserName             = madmin.AdminName;
            madmin.LastLoginIP          = strHostIP;
            madmin.EnableModifyPassword = true;
            madmin.EnableMultiLogin     = true;
            madmin.RandNumber           = "123456";
            madmin.RandNumber           = "123456";
            madmin.AdminType            = 1;
            madmin.PubRole      = 1;
            madmin.DefaultStart = 99;
            if (B_Admin.IsExist(madmin.AdminName))
            {
                madmin.ManageNode = "";
                madmin.AdminId    = B_Admin.GetAdminByAdminName(madmin.AdminName).AdminId;
                return(B_Admin.Update(madmin));
            }
            else
            {
                madmin.Theme                  = "";
                madmin.LastLoginTime          = DateTime.Now;
                madmin.LastLogoutTime         = DateTime.Now;
                madmin.LastModifyPasswordTime = DateTime.Now;
                madmin.ManageNode             = "";
                madmin.AdminTrueName          = madmin.AdminName;
                return(B_Admin.Add(madmin));
            }
        }
示例#12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("UserModel"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string id = base.Request.QueryString["ModelID"];
         if (!string.IsNullOrEmpty(id))
         {
             this.HdnModelId.Value = id;
         }
         else
         {
             this.HdnModelId.Value = "0";
             id = "0";
         }
         if (id != "0")
         {
             M_ModelInfo info = this.bll.GetModelById(DataConverter.CLng(id));
             this.TxtModelName.Text = info.ModelName;
             this.LblTablePrefix.Text = "";
             this.LblTablePrefix.Visible = false;
             this.TxtTableName.Text = info.TableName;
             this.TxtDescription.Text = info.Description;
             this.TxtTableName.Enabled = false;
         }
     }
 }
示例#13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("NodeEdit"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string mParentID = base.Request.QueryString["ParentID"];
         int ParentID;
         if (string.IsNullOrEmpty(mParentID))
             ParentID = 0;
         else
             ParentID = DataConverter.CLng(mParentID);
         if (ParentID == 0)
             this.LblNodeName.Text = "根节点";
         else
         {
             M_Node node = this.bll.GetNode(ParentID);
             if (node.IsNull)
                 this.LblNodeName.Text = "根节点";
             else
                 this.LblNodeName.Text = node.NodeName;
         }
         this.HdnParentId.Value = ParentID.ToString();
         this.HdnDepth.Value = this.bll.GetDepth(ParentID).ToString();
         this.HdnOrderID.Value = this.bll.GetOrder(ParentID).ToString();
     }
 }
示例#14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         bind();
     }
 }
示例#15
0
        /// <summary>
        /// 如非超管,则跳转
        /// </summary>
        public static void IsSuperManage()
        {
            M_AdminInfo model = B_Admin.GetLogin();

            if (model == null || model.AdminId < 1 || !IsSuperManage(model.AdminId))
            {
                throw new Exception("非超级管理员,无权访问该页面");
            }
        }
示例#16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin badmin = new B_Admin();
     badmin.CheckMulitLogin();
     if (!badmin.ChkPermissions("LabelImport"))
     {
         function.WriteErrMsg("没有权限进行此项操作");
     }
 }
示例#17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin badmin = new B_Admin();
     badmin.CheckMulitLogin();
     M_AdminInfo info = B_Admin.GetAdminByAdminName(HttpContext.Current.Request.Cookies["ManageState"]["LoginName"]);
     if (!info.EnableModifyPassword)
     {
         function.WriteErrMsg("您的帐户不允许修改密码!");
     }
 }
示例#18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            B_Admin badmin = new B_Admin();
            badmin.CheckMulitLogin();
            if (!badmin.ChkPermissions("SpecManage"))
            {
                function.WriteErrMsg("没有权限进行此项操作");
            }
            string act = base.Request.QueryString["Action"];
            string id = "0";
            if (string.IsNullOrEmpty(act))
            {
                function.WriteErrMsg("缺少编辑模式!");
            }
            else
            {
                if (act == "Add")
                {
                    id = base.Request.QueryString["CateID"];
                    if (string.IsNullOrEmpty(id))
                    {
                        function.WriteErrMsg("没有指定专题类别ID!");
                    }
                    this.HdnCateID.Value = id;
                    this.HdnSpecID.Value = "0";

                }
                if (act == "Modify")
                {
                    id = base.Request.QueryString["SpecID"];
                    if (string.IsNullOrEmpty(id))
                    {
                        function.WriteErrMsg("没有指定要修改的专题ID!");
                    }
                    M_Spec info = this.bll.GetSpec(DataConverter.CLng(id));
                    if (!info.IsNull)
                    {
                        this.HdnCateID.Value = info.SpecCate.ToString();
                        this.HdnSpecID.Value = info.SpecID.ToString();
                        this.TxtSpecName.Text = info.SpecName;
                        this.TxtSpecDir.Text = info.SpecDir;
                        this.TxtSpecDesc.Text = info.SpecDesc;
                        this.RBLOpenType.SelectedValue = DataConverter.CLng(info.OpenNew).ToString();
                        this.RBLFileExt.SelectedValue = info.ListFileExt.ToString();
                        this.RBLListFileRule.SelectedValue = info.ListFileRule.ToString();
                        this.TxtListTemplate.Text = info.ListTemplate;
                    }
                }
                M_SpecCate cate = this.bspeccate.GetCate(DataConverter.CLng(id));
                this.lblCate.Text = cate.SpecCateName;
            }
        }
    }
示例#19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin badmin = new B_Admin();
     badmin.CheckMulitLogin();
     if (!badmin.ChkPermissions("NodeManage"))
     {
         function.WriteErrMsg("没有权限进行此项操作");
     }
     int NodeID = DataConverter.CLng(base.Request.QueryString["NodeID"]);
     this.bll.DelNode(NodeID);
     Response.Redirect("NodeManage.aspx");
 }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                badmin.CheckMulitLogin();
                if (!badmin.ChkPermissions("ADManage"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                DataTable dt = new DataTable("JSTemplate");
                DataColumn myDataColumn;
                DataRow myDataRow;

                myDataColumn = new DataColumn();
                myDataColumn.DataType = System.Type.GetType("System.Int32");
                myDataColumn.ColumnName = "JSTemplateID";
                dt.Columns.Add(myDataColumn);

                myDataColumn = new DataColumn();
                myDataColumn.DataType = System.Type.GetType("System.String");
                myDataColumn.ColumnName = "JSTemplateName";
                dt.Columns.Add(myDataColumn);

                myDataColumn = new DataColumn();
                myDataColumn.DataType = System.Type.GetType("System.String");
                myDataColumn.ColumnName = "JSTemplatePath";
                dt.Columns.Add(myDataColumn);

                myDataColumn = new DataColumn();
                myDataColumn.DataType = System.Type.GetType("System.String");
                myDataColumn.ColumnName = "JSTemplateSize";
                dt.Columns.Add(myDataColumn);

                int num = 5;
                B_ADZoneJs adjs = new B_ADZoneJs();
                string[] fileSize = adjs.GetFileSize();
                string[] tname=new string[]{"矩形横幅","弹出窗口","随屏移动","固定位置","漂浮移动","文字代码"};
                for (int i = 0; i <= num; i++)
                {
                    myDataRow = dt.NewRow();
                    myDataRow["JSTemplateID"] = i;
                    myDataRow["JSTemplateName"] = tname[i];
                    myDataRow["JSTemplatePath"] = VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.AdvertisementDir) + "ADTemplate/" + adjs.GetTemplateName(i);
                    myDataRow["JSTemplateSize"] = fileSize[i];
                    dt.Rows.Add(myDataRow);
                }

                this.GridView1.DataSource = dt;
                this.GridView1.DataBind();
            }
        }
示例#21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ModelManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         DataBaseList();
     }
 }
示例#22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("UserGroup"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         GdvBind();
     }
 }
示例#23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("EmailManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         this.TxtSenderName.Text = SiteConfig.SiteInfo.Webmaster;
         this.TxtSenderEmail.Text = SiteConfig.SiteInfo.WebmasterEmail;
     }
 }
示例#24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("SpecManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         this.LstSpec.DataSource = this.bll.GetSpecAll();
         this.LstSpec.DataBind();
     }
 }
示例#25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                badmin.CheckMulitLogin();
                if (!badmin.ChkPermissions("CssEdit"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                string strPath = base.Request.QueryString["filepath"];
                string TemplateDir = "/Skin";
                if (string.IsNullOrEmpty(strPath))
                {
                    strPath = "";
                    this.ShowPath = "/";
                }
                else
                {
                    this.ShowPath = strPath;
                }
                strPath = base.Request.PhysicalApplicationPath + TemplateDir + strPath;
                strPath = strPath.Replace("/", @"\");

                this.FilePath = strPath;
                string FileExp = Path.GetExtension(this.FilePath);
                if (!string.IsNullOrEmpty(FileExp))
                {
                    this.FileName = Path.GetFileName(this.FilePath);
                    this.lblFielName.Text = this.FileName;
                    this.TxtFilename.Text = this.FileName;
                    this.TxtFilename.Visible = false;
                    this.textContent.Text = FileSystemObject.ReadFile(this.FilePath);
                    this.ShowPath = this.ShowPath.Replace(this.FileName, "");
                    this.Hdnmethod.Value = "append";
                }
                else
                {
                    this.FileName = "";
                    this.TxtFilename.Text = "";
                    this.TxtFilename.Visible = true;
                    this.lblFielName.Text = "";
                    this.lblFielName.Visible = false;
                    this.Hdnmethod.Value = "add";
                }
                this.HdnFilePath.Value = this.FilePath;
                this.HdnShowPath.Value = this.ShowPath;
            }
        }
示例#26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         int num = DataConverter.CLng(base.Request.QueryString["ZoneType"]);
         this.HdnZoneType.Value = num.ToString();
         this.TxtADTemplate.Text = new B_ADZoneJs().GetADZoneJSTemplateContent(num);
     }
 }
示例#27
0
文件: Install.cs 项目: baixue001/IPS
 /// <summary>
 /// 重写管理员信息
 /// </summary>
 public static bool Add(M_AdminInfo madmin)
 {
     madmin.AdminPassword = StringHelper.MD5(madmin.AdminPassword);
     madmin.UserName      = madmin.AdminName;
     if (B_Admin.IsExist(madmin.AdminName))
     {
         madmin.AdminId = B_Admin.GetAdminByAdminName(madmin.AdminName).AdminId;
         return(B_Admin.Update(madmin));
     }
     else
     {
         madmin.AdminTrueName = madmin.AdminName;
         return((B_Admin.Add(madmin)) > 0);
     }
 }
示例#28
0
        /// <summary>
        /// 获取当前登录用户在节点中所拥有的权限列表,(ZL_NodeRole)RID:角色,NID:节点,look:查看
        /// </summary>
        /// <returns></returns>
        public DataTable GetNodeAuthList(string auth = "")
        {
            SafeSC.CheckDataEx(auth);
            M_AdminInfo m = B_Admin.GetLogin();

            if (m == null || m.AdminId < 1 || string.IsNullOrEmpty(m.RoleList.Replace(",", "")))
            {
                return(null);
            }
            string where = "Rid in (" + m.RoleList.Trim(',') + ")";
            if (!string.IsNullOrEmpty(auth))
            {
                where += " And " + auth + " =1";
            }
            return(DBCenter.Sel("ZL_NodeRole", where));
        }
示例#29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin badmin = new B_Admin();
     badmin.CheckMulitLogin();
     this.m_UserInput = base.Request.QueryString["OpenerText"];
     this.PageSize = 20;
     if (string.IsNullOrEmpty(base.Request.QueryString["p"]))
     {
         this.CurrentPageIndex = 1;
     }
     else
     {
         this.CurrentPageIndex = DataConverter.CLng(base.Request.QueryString["p"]);
     }
     this.CheckKeyword();
 }
示例#30
0
        public static bool CheckEx(Model.ZLEnum.Auth authfield, string code)
        {
            M_AdminInfo adminMod = B_Admin.GetLogin();

            if (adminMod.IsSuperAdmin())
            {
                return(true);
            }
            bool result = Check(adminMod.RoleList, authfield, code);

            if (!result)
            {
                throw new Exception("你无权进行此项操作");
            }
            return(result);
        }
示例#31
0
 private static M_Log EmptyDeal(Model.ZLEnum.Log type, M_Log model)
 {
     if (string.IsNullOrEmpty(model.Action))
     {
         model.Action = type.ToString();
     }
     if (model.CDate <= DateTime.MinValue)
     {
         model.CDate = DateTime.Now;
     }
     try
     {
         if (string.IsNullOrEmpty(model.IP))
         {
             model.IP = IPScaner.GetUserIP();
         }
         if (string.IsNullOrEmpty(model.Source))
         {
             model.Source = HttpContext.Current.Request.RawUrl;
         }
     }
     catch { }
     if (type == Model.ZLEnum.Log.fileup || type == Model.ZLEnum.Log.safe)
     {
         try
         {
             if (string.IsNullOrEmpty(model.UName))
             {
                 M_UserInfo mu = new B_User().GetLogin(); if (mu != null && mu.UserID != 0)
                 {
                     model.UName = mu.UserName;
                 }
             }
             if (string.IsNullOrEmpty(model.AName))
             {
                 M_AdminInfo adminMod = B_Admin.GetLogin(); if (adminMod != null && adminMod.AdminId > 0)
                 {
                     model.AName = adminMod.AdminName;
                 }
             }
         }
         catch { }
     }
     return(model);
 }
示例#32
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("NodeEdit"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string mNodeID = base.Request.QueryString["NodeID"];
         if (string.IsNullOrEmpty(mNodeID))
         {
             AdminPage.WriteErrMsg("没有指定要编辑的节点ID");
         }
         M_Node node = this.bll.GetNode(DataConverter.CLng(mNodeID));
         if (node.IsNull)
         {
             AdminPage.WriteErrMsg("指定要编辑的节点不存在");
         }
         else
         {
             if (node.ParentID == 0)
                 this.LblNodeName.Text = "根节点";
             else
             {
                 M_Node node1 = this.bll.GetNode(node.ParentID);
                 this.LblNodeName.Text = node1.NodeName;
             }
             this.HdnNodeID.Value = mNodeID;
             this.HdnDepth.Value = node.Depth.ToString();
             this.HdnParentId.Value = node.ParentID.ToString();
             this.HdnOrderID.Value = node.OrderID.ToString();
             this.TxtNodeName.Text = node.NodeName;
             this.TxtNodeDir.Text = node.NodeDir;
             this.TxtNodePicUrl.Text = node.NodePic;
             this.TxtTips.Text = node.Tips;
             this.TxtMetaKeywords.Text = node.Meta_Keywords;
             this.TxtMetaDescription.Text = node.Meta_Description;
             this.RBLOpenType.SelectedValue = DataConverter.CLng(node.OpenNew).ToString();
             this.TxtTemplate.Text = node.ListTemplateFile;
             this.RBLListEx.SelectedValue = node.ListPageHtmlEx.ToString();
         }
     }
 }
示例#33
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ViewState["MsgID"] = Request.QueryString["id"].ToString();
     if (!Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("MessManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         M_Message messInfo = B_Message.GetMessByID(DataConverter.CLng(ViewState["MsgID"].ToString()));
         this.LblSender.Text = messInfo.Sender.ToString();
         this.LblIncept.Text = messInfo.Incept.ToString();
         this.LblSendTime.Text = messInfo.PostDate.ToString();
         this.LblTitle.Text = messInfo.Title;
         this.LblContent.Text = messInfo.Content;
     }
 }
示例#34
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("UserModelField"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string mid = base.Request.QueryString["ModelID"];
         if (string.IsNullOrEmpty(mid))
         {
             function.WriteErrMsg("没有指定模块ID");
         }
         this.ViewState["ModelID"] = mid;
         DataBindList();
     }
 }
示例#35
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin badmin = new B_Admin();
     badmin.CheckMulitLogin();
     if (!badmin.ChkPermissions("ContentEdit"))
     {
         function.WriteErrMsg("没有权限进行此项操作");
     }
     TreeNode tmpNd;
     tmpNd = new TreeNode();
     tmpNd.Value = "0";
     tmpNd.Text = "网站专题";
     tmpNd.NavigateUrl = "";
     tmpNd.Target = "";
     tvNav.Nodes.Add(tmpNd);
     B_SpecCate bll = new B_SpecCate();
     bll.InitTreeNode(tmpNd.ChildNodes);
     tvNav.ExpandAll();
 }
示例#36
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin badmin = new B_Admin();
     badmin.CheckMulitLogin();
     if (!badmin.ChkPermissions("NodeManage"))
     {
         function.WriteErrMsg("没有权限进行此项操作");
     }
     string pid = base.Request.QueryString["ParentID"];
     if (string.IsNullOrEmpty(pid))
     {
         pid = "0";
     }
     this.ViewState["ParentID"] = pid;
     if (!this.Page.IsPostBack)
     {
         DataBindList();
     }
 }
示例#37
0
        public static bool CheckIsLogged(string url = "")
        {
            string loginUrl = "~/" + SiteConfig.SiteOption.ManageDir + "/Login.aspx?r=" + url;

            if (HttpContext.Current.Session["M_LoginName"] != null && HttpContext.Current.Session["M_Password"] != null)
            {
                return(true);
            }
            if (HttpContext.Current.Request.Cookies["ManageState"] == null)
            {
                HttpContext.Current.Response.Redirect(loginUrl); return(false);
            }
            else
            {
                string loginName = HttpContext.Current.Request.Cookies["ManageState"]["LoginName"];
                string password  = HttpContext.Current.Request.Cookies["ManageState"]["Password"];
                if (!string.IsNullOrEmpty(loginName))
                {
                    loginName = StringHelper.Base64StringDecode(loginName);
                }
                M_AdminInfo adminMod = new B_Admin().GetLoginAdmin(loginName, password);
                if (adminMod == null)
                {
                    HttpContext.Current.Response.Redirect(loginUrl); return(false);
                }
                else if (adminMod.IsLock)
                {
                    throw new Exception("该管理员账户已被锁定");
                }
                else if (adminMod.IsNull)
                {
                    throw new Exception("管理员不存在");
                }
                else
                {
                    HttpContext.Current.Session["M_LoginName"] = loginName;
                    HttpContext.Current.Session["M_Password"]  = password;
                    return(true);
                }
            }
        }
示例#38
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ModelEdit"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         foreach (DataRow row in FileSystemObject.GetDirectoryInfos(HttpContext.Current.Server.MapPath("~/Images/ModelIcon/"), FsoMethod.File).Rows)
         {
             this.DrpItemIcon.Items.Add(new ListItem(row["name"].ToString(), row["name"].ToString()));
         }
         this.DrpItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);ChangeTxtItemIcon(this.value);");
         this.TxtItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);");
         string id = base.Request.QueryString["ModelID"];
         if (!string.IsNullOrEmpty(id))
         {
             this.HdnModelId.Value = id;
             this.LNav.Text = "修改内容模型";
             this.LTitle.Text = "修改内容模型";
             M_ModelInfo info = this.bll.GetModelById(int.Parse(id));
             this.TxtModelName.Text = info.ModelName;
             this.LblTablePrefix.Visible = false;
             this.TxtTableName.Text = info.TableName;
             this.TxtTableName.Enabled = false;
             this.TxtItemName.Text = info.ItemName;
             this.TxtItemUnit.Text = info.ItemUnit;
             string selectValue = string.IsNullOrEmpty(info.ItemIcon) ? "Default.gif" : info.ItemIcon;
             this.ImgItemIcon.ImageUrl = "~/Images/ModelIcon/" + selectValue;
             this.DrpItemIcon.SelectedValue = selectValue;
             this.TxtItemIcon.Text = info.ItemIcon;
             this.TxtDescription.Text = info.Description;
         }
         else
         {
             this.HdnModelId.Value = "0";
         }
     }
 }
示例#39
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         M_Adzone adZoneById = B_ADZone.getAdzoneByZoneId(DataConverter.CLng(base.Request.QueryString["ZoneId"]));
         if ((adZoneById.IsNull) || string.IsNullOrEmpty(adZoneById.ZoneJSName))
         {
             this.TxtZoneCode.Text = "版位调用代码不存在!";
         }
         else
         {
             this.TxtZoneCode.Text = "<script type=\"text/javascript\" src=\"{$AdDir/}/" + adZoneById.ZoneJSName + "\"></script>";
         }
     }
 }
示例#40
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ContentMange"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string id = base.Request.QueryString["id"];
         if (string.IsNullOrEmpty(id))
             function.WriteErrMsg("没有指定要移动的内容ID", "../Content/ContentManage.aspx");
         else
             this.TxtContentID.Text = id.Trim();
         this.DDLNode.DataSource = this.bnode.GetNodeListContain(0);
         this.DDLNode.DataTextField = "NodeName";
         this.DDLNode.DataValueField = "NodeID";
         this.DDLNode.DataBind();
     }
 }
示例#41
0
        public static bool Check(Model.ZLEnum.Auth authfield, string code)
        {
            M_AdminInfo adminMod = B_Admin.GetLogin();

            return(Check(adminMod.RoleList, authfield, code));
        }
示例#42
0
 public M_AdminInfo GetAdminLogin()
 {
     B_Admin.CheckIsLogged();
     return(B_Admin.GetLogin());
 }
示例#43
0
        //---------------------Ignore
        /// <summary>
        /// 检测二级密码
        /// </summary>
        public bool CheckSPwd(string pwd)
        {
            M_AdminInfo admin = B_Admin.GetLogin();

            return(CheckSPwd(admin, pwd));
        }