Exemple #1
0
        public void ProcessRequest(global::System.Web.HttpContext context)
        {
            httpContext = context;
            request = context.Request;

            if (request.HttpMethod == "POST")
            {
                AjaxAction = request.Form["ajaxAction"] == null ? "" : request.Form["ajaxAction"].Trim().ToUpper();
                switch (AjaxAction)
                {
                    case "KBB_INV_USERJOIN":
                        DoUserJoin();
                        break;

                    case "KBB_INV_USERLOGIN":
                        DoUserLogin();
                        break;

                    case "KBB_INV_USERGETPWD":
                        DoUserGetPass();
                        break;

                    case "KBB_INV_USERGETNEWPWD":
                        DoUserGetNewPass();
                        break;

                    case "KBB_INV_USERSETPWD":
                        DoUserResetPwd();
                        break;

                    case "KBB_INV_SAVECONTACTINFO":
                        DoSaveContactInfo();
                        break;

                    case "KBB_INV_SENDINVITE":
                        DoSendInvite();
                        break;

                    case "KBB_INV_REQUIREPAYMENT":
                        DoRequirePayment();
                        break;

                    case "KBB_INV_CANCLEPAYMENTREQUIRE":
                        DokCanclePaymentRequire();
                        break;
                }
            }

            context.Response.Clear();
            context.Response.Buffer = true;
            context.Response.Write(Html.ToString());
            context.Response.Flush();
        }
Exemple #2
0
        /// <summary>
        /// 设置应用程序,如在过程中发生异常则重启并提醒!
        /// </summary>
        public static void Init()
        {
            //判断是否已经安装
            FileInfo insLockFile = new FileInfo(String.Format("{0}config/install.lock", Cms.PyhicPath));

            if (!insLockFile.Exists)
            {
                //HttpRuntime.UnloadAppDomain();

                global::System.Web.HttpContext context = global::System.Web.HttpContext.Current;
                string installUrl = "/install/install.html";
                context.Response.Redirect(installUrl, true);
                context.Response.End();
                return;
            }

            //初始化设置
            string   cmsConfigFile = String.Format("{0}config/cms.config", Cms.PyhicPath);
            FileInfo cfgFile       = new FileInfo(cmsConfigFile);

            if (cfgFile.Exists)
            {
                Configuration.Load(cmsConfigFile);
            }
            else
            {
                throw new Exception("CMS配置文件不存在");
            }

            //设置数据库
            CmsDataBase.Initialize(String.Format("{0}://{1}", Settings.DB_TYPE.ToString(), Settings.DB_CONN.ToString()), Settings.DB_PREFIX);

            //获取静态服务器
            //UpdateServerInfo();

            //
            //TODO:
            //
            //检查网站激活状态
            //SoftwareActivator.VerifyActivation();

            //如果不存在模板文件夹,则创建目录
            if (!Directory.Exists(Cms.PyhicPath + "templates/"))
            {
                Directory.CreateDirectory(Cms.PyhicPath + "templates/").Create();

                //暂时网络安装默认模板(后可使用资源代替)
                Updater.InstallTemplate("default", "tpl_default.zip");
            }

            //注册模板
            Template.Register("/templates/", true);


            //清空临时文件
            resetTempFiles();

            PluginConfig.PLUGIN_DIRECTORY         = CmsVariables.PLUGIN_PATH;
            PluginConfig.PLUGIN_TMP_DIRECTORY     = CmsVariables.TEMP_PATH;
            PluginConfig.PLUGIN_LOG_OPENED        = true;
            PluginConfig.PLUGIN_LOG_EXCEPT_FORMAT = "** {time} **:{message}\r\nSource:{source}\r\nAddress:{addr}\r\nStack:{stack}\r\n\r\n";

            //连接插件
            CmsPluginContext.Connect();


            if (OnInit != null)
            {
                Cms.OnInit();
            }
        }
Exemple #3
0
 public void ProcessRequest(global::System.Web.HttpContext context)
 {
     throw new NotImplementedException();
 }