예제 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            //da stigne da se ucita sa harda
            MainStorage ms = MainStorage.Instanca;

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStatusCodePagesWithReExecute("/");

            app.UseMvc();

            app.UseDefaultFiles();
            app.UseStaticFiles();
        }
예제 #2
0
        public static Tuple <bool, Korisnik> IsLoginValid(string username, string password)
        {
            MainStorage ms = MainStorage.Instanca;

            Korisnik k = ms.NadjiKorisnikaPoUsernameu(username);

            if (k != null && password == k.Password && k.AktivanNalog)
            {
                //da moze login sa vise browsera :D
                if (!Authorize.PotvrdjeniNalozi.ContainsKey(k.ID))
                {
                    Authorize.PotvrdjeniNalozi.Add(k.ID, k.TipNaloga);
                }
                return(new Tuple <bool, Korisnik>(true, k));
            }
            else
            {
                return(new Tuple <bool, Korisnik>(false, null));
            }
        }