- Added controller CheckUserAuth to authenticate the end user

- FHC_Auth now extends directly authentication
This commit is contained in:
paolo
2016-06-14 15:19:34 +02:00
parent f5ebe0c42b
commit a8b7be6ad5
3 changed files with 75 additions and 3 deletions
@@ -0,0 +1,44 @@
<?php
/**
* FH-Complete
*
* @package FHC-API
* @author FHC-Team
* @copyright Copyright (c) 2016, fhcomplete.org
* @license GPLv3
* @link http://fhcomplete.org
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
if (!defined('BASEPATH')) exit('No direct script access allowed');
class CheckUserAuth extends APIv1_Controller
{
/**
* Course API constructor.
*/
public function __construct()
{
parent::__construct();
$this->load->model('CheckUserAuth_model', 'CheckUserAuthModel');
}
public function getCheckByUsernamePassword()
{
$username = $this->get("username");
$password = $this->get("password");
if (isset($username) && isset($password))
{
$result = $this->CheckUserAuthModel->checkByUsernamePassword($username, $password);
$this->response($result, REST_Controller::HTTP_OK);
}
else
{
$this->response();
}
}
}