mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 00:42:15 +00:00
- Changed the controller components/SearchBar.php constructor to _not_ start the authentication when the AuthLib is loaded and to check if the user is logged
- Added constant ERROR_NOT_AUTH to libraries/SearchBarLib.php
This commit is contained in:
@@ -17,11 +17,15 @@ class SearchBar extends FHC_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the AuthLib and starts the authentication
|
||||
$this->load->library('AuthLib');
|
||||
// Loads the AuthLib _without_ starting the authentication
|
||||
// NOTE: a user must be authenticated via another controller to access this one
|
||||
$this->load->library('AuthLib', array(false));
|
||||
|
||||
// Load the library SearchBarLib
|
||||
$this->load->library('SearchBarLib');
|
||||
|
||||
// Checks if the user is authenticated, otherwise returns an error code in JSON format
|
||||
if (!isLogged()) $this->terminateWithJsonError(SearchBarLib::ERROR_NOT_AUTH);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user