This commit is contained in:
Paminger
2016-04-25 14:25:09 +02:00
parent f154e6dd5d
commit ecff3747d0
10 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ $autoload['packages'] = array();
*/
//$autoload['libraries'] = array();
$autoload['libraries'] = array('Session', 'FHC_Auth');
$autoload['libraries'] = array('Session', 'Template', 'FHC_Auth');
/*
| -------------------------------------------------------------------
+1 -1
View File
@@ -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;
/*
|--------------------------------------------------------------------------
@@ -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);
}
}
}
@@ -15,7 +15,7 @@
defined('BASEPATH') || exit('No direct script access allowed');
class Kontakt extends REST_Controller
class Kontakt extends APIv1_Controller
{
//public $session;
@@ -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);
}
}
}
+1 -1
View File
@@ -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
}
+3 -2
View File
@@ -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;
}
}
}
+2 -2
View File
@@ -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']);
'message' => 'API HTTP POST call test succeed']);