--- title: osTicket description: 安裝 CaptchaLa osTicket 外掛,保護客戶入口網站的開立工單、登入、註冊與密碼重設表單,以及員工登入。 --- # osTicket CaptchaLa 官方 osTicket 外掛。不需撰寫程式碼,即可為客戶入口網站的開立工單、登入、註冊與密碼重設表單,以及員工登入與密碼重設加入驗證碼檢查。 每個元件皆以**伺服端簽發、單次使用的權杖**為後盾,每次送出都會在 osTicket 處理表單之前先於您的伺服器上驗證。 ## 涵蓋範圍 | 表單 | 頁面 | Action | | --- | --- | --- | | 開立新工單 | `open.php` | `generic_form` | | 客戶登入 / 工單存取連結 | `login.php` | `login` | | 客戶註冊 | `account.php` | `register` | | 客戶忘記密碼 | `pwreset.php` | `lost_password` | | 員工登入 | `scp/login.php` | `login` | | 員工忘記密碼 | `scp/pwreset.php` | `lost_password` | 送出被拒絕時,CAPTCHA 訊息會顯示在頁面一般的訊息區域。開立工單表單會保留訪客已輸入的所有內容。 ## 系統需求 - osTicket 1.18 或更新版本 - PHP 8.0+ - 一個 CaptchaLa 帳號 —— 於 [`dash.captcha.la`](https://dash.captcha.la) 取得您的 **App Key** + **App Secret** ## 安裝 1. 從 [GitHub 儲存庫](https://github.com/Captcha-La/osticket-captchala)取得原始碼並執行 `build.sh`。它會將內含 PHP SDK 的 ZIP 輸出至 `release/`。 2. 將 ZIP 解壓縮到您的 osTicket 安裝目錄,讓外掛位於 `include/plugins/captchala/`。 3. 以管理員身分登入,前往 **Admin Panel → Manage → Plugins → Add New Plugin**。按 **CaptchaLa CAPTCHA** 旁的 **Install**。 ## 設定 1. 開啟外掛,前往 **Instances → Add New Instance**,為實例命名,並將狀態設為 **Enabled**。 2. 在 **Config** 分頁貼上您的 **App Key** 與 **App Secret**,視需要調整 **Widget mode** 與 **Widget language**,然後儲存。 3. 回到外掛頁面,將外掛狀態設為 **Active** 並儲存。 | 設定項目 | 預設值 | 說明 | | --- | --- | --- | | App Key | — | 來自 CaptchaLa 控制台的公開金鑰。必填。 | | App Secret | — | 伺服端密鑰,用於簽發與驗證權杖。必填;加密儲存,絕不傳送到瀏覽器。留空即保留已儲存的密鑰。 | | Widget mode | `bind` | `bind`(訪客按下表單送出按鈕時進行驗證)、`popup`、`float` 或 `embed`(表單內的驗證列)。 | | Widget language | `auto` | BCP-47 標籤,例如 `ja` 或 `pt-BR`;或 `auto` 跟隨訪客的瀏覽器。 | ## 螢幕截圖 ![osTicket 管理面板中的 CaptchaLa 實例設定:App Key、App Secret、元件模式與語言](/images/plugins/osticket/instance-config.webp) ![osTicket 開立新工單表單,CaptchaLa 驗證列位於 Create Ticket 上方](/images/plugins/osticket/open-ticket-form.webp) ![osTicket 員工登入,CaptchaLa 驗證列位於 Log In 上方](/images/plugins/osticket/staff-login.webp) ## 注意事項 - **內容安全政策(CSP)。** 外掛會將 CaptchaLa 指令碼主機與 `blob:` worker 加入 osTicket 在受保護頁面上送出的內容安全政策,因此不需要修改 CSP。 - **隱私。** 外掛不儲存任何訪客資料。 ## 疑難排解 - **沒有顯示元件。** 確認實例為 **Enabled**、外掛為 **Active**,且兩組金鑰都已在 **Config** 分頁儲存。 - **每次送出都被拒絕。** 確認 App Key 與 App Secret 屬於同一個應用程式,並已在控制台中為該應用程式允許您服務台的網域。 - **試用。** 使用公開的[測試金鑰](/testing),無需帳號即可檢查完整流程。 ## 連結 - 原始碼與 issue:[github.com/Captcha-La/osticket-captchala](https://github.com/Captcha-La/osticket-captchala) - 支援:[supply@captcha.la](mailto:supply@captcha.la)