From 4b5211a9c6ee4d60240555a5dfb0f12f19598a1f Mon Sep 17 00:00:00 2001 From: Paminger Date: Wed, 13 Apr 2016 07:49:01 +0200 Subject: [PATCH] FHC_Auth --- application/config/rest.php | 2 +- application/controllers/api/v1/APIAuth.php | 4 ++-- application/libraries/{Fhcauth.php => FHC_Auth.php} | 2 +- phpci.yml | 4 +++- .../_support/_generated/AcceptanceTesterActions.php | 2 +- tests/codeception/api/LoginCept.php | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) rename application/libraries/{Fhcauth.php => FHC_Auth.php} (98%) diff --git a/application/config/rest.php b/application/config/rest.php index af3650d87..094cf4a95 100644 --- a/application/config/rest.php +++ b/application/config/rest.php @@ -144,7 +144,7 @@ $config['auth_source'] = 'library'; | e.g: md5('admin:REST API:1234') = '1e957ebc35631ab22d5bd6526bd14ea2' | */ -$config['auth_library_class'] = 'fhcauth'; +$config['auth_library_class'] = 'FHC_Auth'; $config['auth_library_function'] = 'auth'; /* diff --git a/application/controllers/api/v1/APIAuth.php b/application/controllers/api/v1/APIAuth.php index 8f6ed1cf2..162b112d3 100644 --- a/application/controllers/api/v1/APIAuth.php +++ b/application/controllers/api/v1/APIAuth.php @@ -43,7 +43,7 @@ class APIAuth extends APIv1_Controller // Load helper //$this->load->helper('fhcauth'); $this->load->library('session'); - $this->load->library('Fhcauth'); + $this->load->library('FHC_Auth'); } /** @@ -62,7 +62,7 @@ class APIAuth extends APIv1_Controller $username = urldecode($this->get('username')); $password = urldecode($this->get('password')); - $account = $this->fhcauth->auth($username, $password); + $account = $this->fhc_auth->auth($username, $password); // perform login checks if (!$account) diff --git a/application/libraries/Fhcauth.php b/application/libraries/FHC_Auth.php similarity index 98% rename from application/libraries/Fhcauth.php rename to application/libraries/FHC_Auth.php index 3fda76f57..4e715efe3 100644 --- a/application/libraries/Fhcauth.php +++ b/application/libraries/FHC_Auth.php @@ -25,7 +25,7 @@ require_once FCPATH.'include/authentication.class.php'; // ------------------------------------------------------------------------ -class Fhcauth +class FHC_Auth { /** * Auth Username, Password over FH-Complete diff --git a/phpci.yml b/phpci.yml index 39ee8fe54..f77cd4175 100644 --- a/phpci.yml +++ b/phpci.yml @@ -9,8 +9,10 @@ build_settings: pgsql: host: 'localhost;dbname=template1' user: 'fhcomplete' - pass: 'fhcomplete' + pass: 'fhcomplete' setup: + shell: + - "pkill -f fhctest" composer: directory: "" action: "install" diff --git a/tests/codeception/_support/_generated/AcceptanceTesterActions.php b/tests/codeception/_support/_generated/AcceptanceTesterActions.php index ec2d47383..1e89425b9 100644 --- a/tests/codeception/_support/_generated/AcceptanceTesterActions.php +++ b/tests/codeception/_support/_generated/AcceptanceTesterActions.php @@ -1,4 +1,4 @@ -wantTo('test the Login API'); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); @@ -10,4 +10,4 @@ $I->seeResponseContainsJson([ 'success' => true, 'message' => 'User successfully logged in']); -*/ +