- Implement AuthController with login/logout functionality - Create UsersModel with bcrypt password hashing - Add AuthFilter to protect all application routes - Create login page with error handling - Add users database migration with email/username fields - Rename ResultComments to TestComments for consistency - Update all routes to require authentication filter - Enhance EntryApiController with comment deletion and better error handling - Update seeder to include demo users and improved test data - Fix BaseController to handle auth sessions properly - Update entry views (daily/monthly) with new API endpoints - Update layout with logout button and user info display - Refactor control test index view for better organization
24 lines
627 B
PHP
24 lines
627 B
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use CodeIgniter\Controller;
|
|
use CodeIgniter\API\ResponseTrait;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
abstract class BaseController extends Controller
|
|
{
|
|
use ResponseTrait;
|
|
|
|
protected $session;
|
|
protected $helpers = ['form', 'url', 'cookie', 'json', 'stringcase'];
|
|
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->session = \Config\Services::session();
|
|
}
|
|
}
|