Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // check for valid user
            TOpenPetraOrgSessionManager myServer = new TOpenPetraOrgSessionManager();

            if (!myServer.IsUserLoggedIn())
            {
                // we need the absolute path
                this.Response.Redirect("/Default.aspx");
                return;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // check for valid user
            TOpenPetraOrgSessionManager myServer = new TOpenPetraOrgSessionManager();

            if (!myServer.IsUserLoggedIn())
            {
                // we need the absolute path
                this.Response.Redirect(this.Request.Url.AbsolutePath.Replace("Main", "Default"));
                return;
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string ConfigFileName;

            // make sure the correct config file is used
            if (Environment.CommandLine.Contains("/appconfigfile="))
            {
                // this happens when we use fastcgi-mono-server4
                ConfigFileName = Environment.CommandLine.Substring(
                    Environment.CommandLine.IndexOf("/appconfigfile=") + "/appconfigfile=".Length);

                if (ConfigFileName.IndexOf(" ") != -1)
                {
                    ConfigFileName = ConfigFileName.Substring(0, ConfigFileName.IndexOf(" "));
                }
            }
            else
            {
                // this is the normal behaviour when running with local http server
                ConfigFileName = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "web.config";
            }

            new TAppSettingsManager(ConfigFileName);
            this.ServerUrl = TAppSettingsManager.GetValue("Server.Url", "demo.openpetra.org");

            // check for valid user
            TOpenPetraOrgSessionManager myServer = new TOpenPetraOrgSessionManager();

            if (myServer.IsUserLoggedIn())
            {
                // redirect to the main application
                this.Response.Redirect("/Main.aspx");
                return;
            }

            this.Filename = GetDownloadFile();
            this.Filename = this.Filename.Replace("-", "-" + ServerUrl + "-");

            if (Request["download"] == this.Filename)
            {
                DownloadFile();
                return;
            }

            this.Language = "en";
            if ((Request.UserLanguages.Length > 1) &&
                Request.UserLanguages[0].StartsWith("de"))
            {
                this.Language = "de";
            }
        }