發表文章

目前顯示的是 12月 5, 2018的文章

How to use Session thru Login, Authorization,Authentication?

圖片
up vote 0 down vote favorite First of all i am a newbie when it comes to programming and i am only self-learning and would like to ask for solutions that i have encountered and can't be solved by my own I Can't make it work. i would like Session["userlevel"] == "Admin" to be the only one to access the view how can i make this to work please help.. public ActionResult Authorize(Test user) { using (TableEntities db = new TableEntities()) { var loginUserAdmin = db.Employees.Where(x => x.Username == user.Username && x.UserPassword == user.UserPassword && x.AccountStatus == "Active" && x.AccountType == "Admin").FirstOrDefault(); if (loginUserAdmin == null || loginUserAdmin != loginUserAdmin) else ViewBag.Messageko = "Admin"; Session["userid"] = loginUserAdmin.EmployeeID; Session["firstName"] = loginUserAdmin.FirstName; Session["lastName"] = loginUserAdmi

Weser

圖片
For other uses, see Weser (disambiguation). Weser Werser (Low German) The Weser near Bad Oeynhausen Watershed of the Weser Etymology *weis , Germanic, meaning to flow Location Country Germany Bundesland Bremen, Lower Saxony, North Rhine-Westphalia, Thuringia, Hessen Cities Bremerhaven, Bremen, Minden, Hamelin, Hann. Münden, Kassel, Fulda Physical characteristics Source    - location Confluence of the Fulda and Werra Rivers in Hann. Münden  - coordinates 51°25′17″N 9°38′53″E  /  51.42139°N 9.64806°E  / 51.42139; 9.64806  - elevation 116 m (381 ft) Mouth Wadden Sea/North Sea  - location Bremerhaven/Nordenham  - coordinates 53°32′8″N 8°33′56″E  /  53.53556°N 8.56556°E  / 53.53556; 8.56556 Coordinates: 53°32′8″N 8°33′56″E  /  53.53556°N 8.56556°E  / 53.53556; 8.56556  - elevation 0 m (0 ft) Length 452 km (281 mi) Basin size 46,306 km 2 (17,879 sq mi) Discharge    - average 327 m 3 /s (11,500 cu ft/s) Basin features Tributaries    - left Diemel, Emmer, Werre, Große Aue, Hunte  

PhpStorm + Docker + Xdebug + DB SSH tunnel

圖片
up vote 1 down vote favorite Locally I have following docker-compose configuration: nginx: build: context: ./nginx ports: - "80:80" volumes: - ./../logs:/home/web/logs/ - ./../:/home/web/my-website.com/ depends_on: - php php: build: context: ./php volumes: - ./../:/home/web/my-website.com/ working_dir: /home/web/my-website.com/ expose: - "8123" php container has Xdebug installed into it, I can easily connect to it from PhpStorm. I have remote ClickHouse database which is connected via SSH Tunnel. When I start my container I just go into my container and execute: ssh -4 login@host.com -p 2211 -L 8123:localhost:8123 -oStrictHostKeyChecking=no -Nf After this, my site is able to use this connection, but when I execute console command ./yii analysis/start-charts 003b56fe-db47-11e8-bcc0-52540010e5bc 205 from PhpStorm, I'm getting an exception: Failed to connect to 127.0.0.1 port 8123: Connection refused If I jump into the container and lau