Exemplo n.º 1
0
    private void Add()
    {
        //添加权限
        ManageHelper.CheckAdminPower("system_memberipblockadd");
        Sys.Common.IP.RestrictionIPResult ip = Sys.Common.IP.BlockIP.GenerateIPList(Name);
        if (!ip.IsChecked)
        {
            err.AddErr("*IP访问规则格式错误");
        }

        Sys.BLL.SysIpBlock bll = new Sys.BLL.SysIpBlock();
        if (bll.CheckName(ID, Name, BlockType, BlockModule))
        {
            err.AddErr("*该IP访问规则已经存在");
        }

        err.ChkErr();

        Sys.Model.SysIpBlock model = new Sys.Model.SysIpBlock();
        model.ID          = 0;
        model.IpStart     = ip.StartIP;
        model.IpEnd       = ip.EndIP;
        model.Name        = Name;
        model.BlockType   = BlockType;
        model.BlockModule = BlockModule;
        int NewID = bll.Add(model);

        ManageHelper.AddLog("system_memberipblockadd", "添加了" + BlockModuleName + BlockTypeName + model.Name);//写日志
        Response.Write("<script>window.parent.location.href=\"ipblocklist.aspx?BlockModule=" + BlockModule + "&BlockType=" + BlockType + "&sucmsg=IP访问规则添加成功。\";</script>");
        Response.End();
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //检查登录
        ManageHelper.CheckAdminLogin();
        //权限
        ManageHelper.CheckAdminPower("system_adminipblockblacklist");
        //这是业务层



        switch (act)
        {
        case "searchData":
            searchData();
            break;
        }



        var result = new Hashtable();

        result["data"] = listIp;
        var total = new Common().GetCount("AdminRole", strWhere);

        result["total"] = total;

        //    Response.Write(json);

        var json = PluSoft.Utils.JSON.Encode(listIp);
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();
        ManageHelper.CheckAdminPower("system_databasedellog");
        if (ManageHelper.PageAct() != "del")
        {
            return;
        }
        ManageHelper.CheckAdminPower("system_databasedellog");
        var db = new Sys.BLL.Common();


        try
        {
            db.DatabaseLogDel();
            Response.Write("yes");
            ManageHelper.AddLog("system_databasedellog", "清除数据库日志成功");
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
            ManageHelper.AddLog("system_databasedellog", "清除数据库日志失败");
            Response.End();
        }


        Response.End();
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();
        ManageHelper.CheckAdminPower("system_databasebackup");

        if (ManageHelper.PageAct() != "bak")
        {
            return;
        }
        WebConfig.SetString("DatabaseBackupPath", DatabaseBackupPath);

        var db = new Sys.BLL.Common();

        try
        {
            var bakfile = db.DatabaseBackup(DatabaseBackupPath);
            Response.Write("yes");
            ManageHelper.AddLog("system_databasebackup", "数据库备份成功,路径:" + bakfile);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
            ManageHelper.AddLog("system_databasebackup", "数据库备份失败,路径:" + DatabaseBackupPath);
            Response.End();
        }


        Response.End();
    }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ManageHelper.CheckAdminLogin();
     ManageHelper.CheckAdminPower("system_configsystem");
     if (ManageHelper.PageAct() == "save")
     {
         ConfigSave();
     }
 }
Exemplo n.º 6
0
 private void Add()
 {
     ManageHelper.CheckAdminPower("system_adminroleadd");
     ModelRole.RoleFlag = PageRequest.GetString("RoleFlag");
     ModelRole.RoleName = PageRequest.GetString("RoleName");
     ModelRole.Note     = PageRequest.GetString("Note");
     BllSysRole.Add(ModelRole);
     Response.Write("yes");
     Response.End();
 }
Exemplo n.º 7
0
    private void Delete()
    {
        //删除权限
        ManageHelper.CheckAdminPower("system_memberipblockdelete");
        var bll = new Sys.BLL.SysIpBlock();

        bll.Delete(ID);
        ManageHelper.AddLog("system_memberipblockdelete", "删除了" + ID);
        Response.Redirect("ipblocklist.aspx?BlockModule=" + BlockModule + "&BlockType=" + BlockType + "&sucmsg=IP访问规则删除成功。");
    }
Exemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ManageHelper.CheckAdminLogin();
     ManageHelper.CheckAdminPower("system_toolcache");
     if (ManageHelper.PageAct() == "clear")
     {
         foreach (var entry in base.Cache.Cast <DictionaryEntry>())
         {
             DataCache.RemoveCache(entry.Key.ToString());
         }
         Response.Write("yes");
         Response.End();
     }
 }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();
        ManageHelper.CheckAdminPower("system_databaseview");
        //if (act == "db")
        //{
        //    var db = new Sys.DAL.Common();
        //    ds = db.GetSelect(tbl, "", "", "top 200 *");
        //    return;
        //}

        //var bll = new Sys.BLL.Common();

        //ds = bll.DatabaseTable();
    }
Exemplo n.º 10
0
    private void EditSave()
    {
        ManageHelper.CheckAdminPower("system_adminroleedit");

        Edit();
        if (ModelRole != null)
        {
            ModelRole.RoleFlag = PageRequest.GetString("RoleFlag");
            ModelRole.RoleName = PageRequest.GetString("RoleName");
            ModelRole.Note     = PageRequest.GetString("Note");
            BllSysRole.Update(ModelRole);
            Response.Write("yes");
            Response.End();
        }
    }
Exemplo n.º 11
0
    private void ConfigSave()
    {
        ManageHelper.CheckAdminPower("system_configsystemupdate");

        var bll   = new Sys.BLL.SysConfig();
        var model = new Sys.Model.SysConfig();


        var json = Request["data"];
        var rows = (ArrayList)PluSoft.Utils.JSON.Decode(json);

        foreach (Hashtable row in rows)
        {
            model       = bll.GetModel("WebConfig", "WebsiteName");
            model.Value = row["WebsiteName"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-WebsiteName");

            model       = bll.GetModel("WebConfig", "WebsiteUrl");
            model.Value = row["WebsiteUrl"].ToString();

            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-WebsiteUrl");

            model       = bll.GetModel("WebConfig", "PageHeadTitle");
            model.Value = row["PageHeadTitle"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-PageHeadTitle");

            model       = bll.GetModel("WebConfig", "PageHeadMetaKeywords");
            model.Value = row["PageHeadMetaKeywords"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-PageHeadMetaKeywords");


            model       = bll.GetModel("WebConfig", "PageHeadMetaDescription");
            model.Value = row["PageHeadMetaDescription"].ToString();
            bll.Update(model);
            ManageHelper.AddLog("system_configsystemupdate", "修改了系统配置");
            DataCache.RemoveCache("SysConfigValue-WebConfig-PageHeadMetaDescription");
        }

        Response.Write("yes");
        Response.End();
    }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();
        ManageHelper.CheckAdminPower("system_toolserver");
        CmsInfo += trShow("系统版本号:", Sys.Kernel.Software.Version);
        CmsInfo += trShow("系统数据库:", Sys.Kernel.Software.Database);



        //ManagementObjectSearcher searcher14 = new ManagementObjectSearcher("SELECT * FROM Win32_Processor");
        //foreach (ManagementObject share in searcher14.Get())
        //{
        //    //HardwareInfo += trShow("CPU * " + searcher14.Get().Count + ":", share["Name"].ToString() + " (二级缓存:" + share["L2CacheSize"].ToString() + "KB)");
        //    SoftwareInfo += trShow("服务器CPU * " + searcher14.Get().Count + ":", share["Name"].ToString() + " (二级缓存:" + share["L2CacheSize"].ToString() + "KB)");
        //    break;
        //}

        //ManagementObjectSearcher searcher12 = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");
        //foreach (ManagementObject share in searcher12.Get())
        //{
        //    //HardwareInfo += trShow("操作系统:", share["Caption"].ToString()+ " (版本号:" + share["Version"].ToString()+")");
        //    //HardwareInfo += trShow("制造商:", share["Manufacturer"].ToString());
        //    //HardwareInfo += trShow("计算机名:", share["csname"].ToString());
        //    //HardwareInfo += trShow("Windows目录:", share["WindowsDirectory"].ToString());
        //    SoftwareInfo += trShow("Windows目录:", share["WindowsDirectory"].ToString());

        //}



        SoftwareInfo += trShow("服务器名称:", Server.MachineName.ToString());
        SoftwareInfo += trShow("操作系统:", Environment.OSVersion.ToString());
        SoftwareInfo += trShow("服务器IP:", Request.ServerVariables["LOCAL_ADDR"]);
        SoftwareInfo += trShow("服务器域名:", Request.ServerVariables["SERVER_NAME"]);
        SoftwareInfo += trShow("服务端脚本执行超时:", Server.ScriptTimeout.ToString());
        SoftwareInfo += trShow("服务器现在时间:", DateTime.Now.ToString());
        SoftwareInfo += trShow("Session总数:", Session.Contents.Count.ToString());
        SoftwareInfo += trShow("Application总数:", Application.Contents.Count.ToString());
        SoftwareInfo += trShow(".NET Framework 版本:", Environment.Version.ToString());
        SoftwareInfo += trShow("IIS版本:", Request.ServerVariables["SERVER_SOFTWARE"]);
        SoftwareInfo += trShow("相对路径:", Request.ServerVariables["PATH_INFO"]);
        SoftwareInfo += trShow("物理路径:", Request.ServerVariables["APPL_PHYSICAL_PATH"]);
        SoftwareInfo += trShow("运行时间:", (Math.Round(double.Parse((Environment.TickCount / 600 / 60).ToString())) / 100).ToString() + "小时");
    }
Exemplo n.º 13
0
    public string CurPageFlag = "system_adminipblockconfig";          //当前模块权限
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();

        ManageHelper.CheckAdminPower(CurPageFlag);
        var bll = new Sys.BLL.SysConfig();

        if (ManageHelper.PageAct() == "save")
        {
            ManageHelper.CheckAdminPower("system_memberipblockconfigupdate");//修改权限
            var model = bll.GetModel("WebConfig", "AdminIpBlockType");
            model.Value = PageRequest.GetString("IpBlockType");
            bll.Update(model);
            //添加日志
            ManageHelper.AddLog(CurPageFlag, (BlockModule == 0 ? "后台" : "用户") + "访问限制选项修改为:“" + Sys.BLL.SysConfig.GetNameByCache("IpBlockType", PageRequest.GetString("IpBlockType")) + "”");

            Response.Write("yes");
            Response.End();
        }
    }
Exemplo n.º 14
0
    private void ConfigSave()
    {
        ManageHelper.CheckAdminPower("system_configemailupdate");
        var bll   = new Sys.BLL.SysConfig();
        var model = new Sys.Model.SysConfig();
        var json  = Request["data"];
        var rows  = (ArrayList)PluSoft.Utils.JSON.Decode(json);



        foreach (Hashtable row in rows)
        {
            model       = bll.GetModel("WebConfig", "EmailServer");
            model.Value = row["EmailServer"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailServer");

            model       = bll.GetModel("WebConfig", "EmailPort");
            model.Value = row["EmailPort"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailPort");

            model       = bll.GetModel("WebConfig", "EmailAccount");
            model.Value = row["EmailAccount"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailAccount");

            model       = bll.GetModel("WebConfig", "EmailPassword");
            model.Value = row["EmailPassword"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailPassword");

            model       = bll.GetModel("WebConfig", "EmailSender");
            model.Value = row["EmailSender"].ToString();
            bll.Update(model);
            ManageHelper.AddLog("system_configemailupdate", "修改了邮件设置");
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailSender");
        }
        Response.Write("yes");
        Response.End();
    }
Exemplo n.º 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ManageHelper.CheckAdminLogin();
     ManageHelper.CheckAdminPower("system_adminview");
 }