diff --git a/application/config/autoload.php b/application/config/autoload.php index dd66c13b6..cd08eb39b 100755 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -60,7 +60,7 @@ $autoload['packages'] = array(); */ //$autoload['libraries'] = array(); -$autoload['libraries'] = array('Session', 'FHC_Auth'); +$autoload['libraries'] = array('Session', 'Template', 'FHC_Auth'); /* | ------------------------------------------------------------------- diff --git a/application/config/rest.php b/application/config/rest.php index c1d0d6805..f924bda12 100644 --- a/application/config/rest.php +++ b/application/config/rest.php @@ -223,7 +223,7 @@ $config['auth_library_function'] = 'basicAuthentication'; | restrict certain methods to IPs in your whitelist | */ -$config['rest_ip_whitelist_enabled'] = TRUE; +$config['rest_ip_whitelist_enabled'] = FALSE; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/api/Test.php b/application/controllers/api/v1/Test.php similarity index 91% rename from application/controllers/api/Test.php rename to application/controllers/api/v1/Test.php index 8ff7e555a..d575db173 100644 --- a/application/controllers/api/Test.php +++ b/application/controllers/api/v1/Test.php @@ -2,12 +2,12 @@ defined('BASEPATH') || exit('No direct script access allowed'); -require_once APPPATH . '/libraries/REST_Controller.php'; +//require_once APPPATH . '/libraries/REST_Controller.php'; /** * Testing class for REST calls and authentication */ -class Test extends REST_Controller +class Test extends APIv1_Controller { public function __construct() { @@ -47,4 +47,4 @@ class Test extends REST_Controller $httpstatus = REST_Controller::HTTP_OK; $this->response($payload, $httpstatus); } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/studies/Plan.php b/application/controllers/api/v1/lehre/Studiengang.php similarity index 100% rename from application/controllers/api/v1/studies/Plan.php rename to application/controllers/api/v1/lehre/Studiengang.php diff --git a/application/controllers/api/v1/studies/Course.php b/application/controllers/api/v1/lehre/Studienplan.php similarity index 100% rename from application/controllers/api/v1/studies/Course.php rename to application/controllers/api/v1/lehre/Studienplan.php diff --git a/application/controllers/api/v1/person/Kontakt.php b/application/controllers/api/v1/person/Kontakt.php index 68c015804..7f9c05112 100644 --- a/application/controllers/api/v1/person/Kontakt.php +++ b/application/controllers/api/v1/person/Kontakt.php @@ -15,7 +15,7 @@ defined('BASEPATH') || exit('No direct script access allowed'); -class Kontakt extends REST_Controller +class Kontakt extends APIv1_Controller { //public $session; diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index 7c095301d..f73e19d6e 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -14,7 +14,7 @@ if(!defined('BASEPATH')) exit('No direct script access allowed'); -class Person extends REST_Controller +class Person extends APIv1_Controller { /** * Person API constructor. @@ -154,4 +154,4 @@ class Person extends REST_Controller $this->response($payload, $httpstatus); } -} \ No newline at end of file +} diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 656dd4c1e..0e6847cca 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -17,7 +17,7 @@ class APIv1_Controller extends REST_Controller function __construct() { parent::__construct(); - //$this->load->library('session'); -> autoload + //$this->load->library('session'); // -> autoload //$this->load->library('database'); -> autoload } diff --git a/application/core/FHC_Model.php b/application/core/FHC_Model.php index 00f59d210..255957a30 100644 --- a/application/core/FHC_Model.php +++ b/application/core/FHC_Model.php @@ -8,8 +8,9 @@ class FHC_Model extends CI_Model { parent::__construct(); $this->load->helper('language'); - $this->load->helper('fhc_db_acl'); + //$this->load->helper('fhc_db_acl'); $this->lang->load('fhcomplete'); + $this->load->library('FHC_DB_ACL'); } /** --------------------------------------------------------------- @@ -105,4 +106,4 @@ class DB_Model extends FHC_Model { return $this->_addonID; } -} \ No newline at end of file +} diff --git a/tests/codeception/api/BasicLoginCept.php b/tests/codeception/api/BasicLoginCept.php index e4fc46680..9ca76c417 100644 --- a/tests/codeception/api/BasicLoginCept.php +++ b/tests/codeception/api/BasicLoginCept.php @@ -2,7 +2,7 @@ $I = new ApiTester($scenario); $I->wantTo('Test the HTTP basic autentication whith HTTP GET and POST method and the API Keys'); -$I->amHttpAuthenticated("wu11e001", "1Q2W3E4R"); +$I->amHttpAuthenticated("admin", "1q2w3"); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); $I->sendGET('Test/test'); $I->seeResponseCodeIs(200); @@ -16,4 +16,4 @@ $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); $I->seeResponseContainsJson([ 'success' => true, - 'message' => 'API HTTP POST call test succeed']); \ No newline at end of file + 'message' => 'API HTTP POST call test succeed']);