Commit Graph

5 Commits

Author SHA1 Message Date
712e9a1222 Lisää data-tiedostot gittiin + dynaaminen SITE_URL
- companies.json, users.json, config.json gitin seurantaan
- SITE_URL dynaaminen HTTP_HOST:in mukaan
- MAIL_FROM vaihdettu noreply@noxus.fi
- CuituNet Intra → Noxus Intra sähköposteissa

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:18:23 +02:00
ab03eb7e61 Fix data loss: remove data files from git, add gitignore, auto-recover
- Remove data/companies.json and data/companies/cuitunet/config.json from git
  (tracked data files get overwritten on every deploy, causing data loss)
- Add data/companies/*/ and data/tickets.json to .gitignore
- Migration now auto-recovers companies.json and config.json if missing
  (handles case where git clean removes untracked data files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:25:36 +02:00
c34b5a2c26 Add multi-tenant support with per-company data isolation
Implement full multi-company architecture:
- Per-company directory structure (data/companies/{id}/)
- Automatic migration from single-tenant to multi-tenant
- Company management admin tab (create, edit, delete companies)
- Per-company IMAP mailbox configuration (multiple mailboxes per company)
- User access control per company (companies array on users)
- Company switcher in header (shown when user has access to >1 company)
- Session-based company context with check_auth fallback for old sessions
- Ticket list shows mailbox name instead of sender
- IMAP settings moved from global config to company-specific config
- All data endpoints protected with requireCompany() guard

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:04:24 +02:00
8a07689a1f Add security hardening, captcha login, and password reset via email
- .htaccess: HTTPS enforcement, security headers, block sensitive files
- data/.htaccess: deny all direct access to data directory
- Secure session settings (httponly, secure, strict mode, samesite)
- Rate limiting on login (10 attempts per 15 min per IP)
- Math captcha on login form (server-side validated)
- Password reset via email with token (1 hour expiry)
- Forgot password UI with reset link flow
- Email field added to user management
- Updated .gitignore for reset_tokens.json and login_attempts.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 01:00:19 +02:00
297ba39c4f Add CuituNet Intra customer management CMS
Password-protected intranet for managing fiber internet customers:
- Customer table (company, address, speed, price)
- Click row to view full details (contact & billing info)
- Add, edit, delete customers
- Search and sortable columns
- Total billing summary
- PHP + vanilla JS + JSON storage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:50:11 +02:00