Skip to content

PlusMagi's Blog By Pitt Phunsanit

Plus emotional magic to the knowledge of logic.

  • About’s Pitt
Close Button

บังคับให้ user loginบังคับให้ user login

2013-01-192013-01-19| phunsanitphunsanit| 0 Comment | 07:00

ใน yii2 สามารถบังคับให้ผู้เข้าเยี่ยมชม ต้องล๊อกอินทุกครั้ง ในทุกหน้าของเว็บหรือ site นั้น ๆ (backend / frontend) โดยเข้าไปที่ site/config/main.php แล้วเพิ่มเข้าไปใน components ตามตัวอย่าง
‘components’ => [
… ‘as beforeRequest’ => [ /* fource login */ ‘class’ => ‘yii\filters\AccessControl’, ‘rules’ => [ [ ‘actions’ => [‘login’, ‘error’], ‘allow’ => true, ], [ ‘allow’ => true, ‘roles’ => [‘@’], ], ], ],
…
]
[/code]

ถ้าใส่ใน common/config.php จะมี error
Read MoreRead More

Posts pagination

ก่อนหน้า 1 … 807 808 809 … 1,069 ถัดไป

Projects

  • Statement Columns Mapping Helper
  • PlusMagi Site Search
  • jQuery Plus Repeater

Recent Posts

  • Markdown: มาเริ่มเขียนกันเถอะ
  • jQuery: TabulatorPlus
  • จัดคิวยังไงดี Redis / RabbitMQ
  • Angular: TabulatorPlus
  • Playwright: Environment

Archives

Categories

  • AI (23)
  • Businesses (15)
  • Design (43)
    • UX/UI (12)
  • Histories (10)
  • Life (93)
    • Books (37)
    • Cartoon (3)
    • Sci-Fi (4)
    • Tips and Tricks (25)
    • พุทธ (5)
  • Network (134)
    • Apache HTTP Server (15)
    • IOT (1)
    • Nginx (29)
    • Stalwart (5)
  • Operating Systems (266)
    • Unix-like (193)
      • Android (15)
        • F-Droid (5)
      • Homebrew (18)
      • iPhone (8)
      • Linux (116)
      • macOS (97)
        • OrbStack (11)
      • Oh My ZSH (4)
      • Shell Script (34)
      • SSH (11)
    • Windows (117)
      • PowerShell (24)
      • WSL (24)
  • Programming (717)
    • .NET (19)
      • .NET Core EF (6)
      • C# (17)
    • API (26)
      • REST (5)
      • Swagger (6)
    • Database (181)
      • DBeaver (3)
      • MariaDB (29)
      • MySql (67)
      • Oracle Database (6)
        • 10g (3)
      • PostgreSQL (8)
      • RDBMS (2)
      • SQL Server (85)
        • SSMS (8)
        • T-SQL (26)
      • SQLite (1)
    • PowerBuilder (10)
    • Python (5)
    • Rust (1)
    • System Analyst (SA) (20)
    • Testing (17)
      • Automated Testing (9)
        • Playwright (6)
    • UML (7)
    • Web (376)
      • Backend (239)
        • Golang (1)
        • Java (46)
          • Spring Boot (14)
        • Node.js (1)
        • PHP (192)
          • Laravel (16)
          • Yii (5)
      • Frontend (129)
        • CSS (17)
          • Tailwind CSS (5)
        • JavaScript (117)
          • Angular (3)
          • jQuery (61)
          • Tabulator (16)
          • Vue.js (5)
      • WordPress (25)
  • Programs (88)
    • Excel (10)
  • SecDevOps (70)
    • CI/CD (4)
    • Docker (36)
    • GIT (25)
  • Security (56)
  • Uncategorized (1)
  • กฎหมาย (7)

Sirat WordPress Theme By VWThemes

Scroll Up