Files
FHC-Core/application/controllers/api/v1/CheckUserAuth.php
T
Paolo 53a0b60ba8 - Removed method getCheckUserAuth form api/v1/CheckUserAuth
- Changed LDAP_Model to a library: LDAPLib
- Removed controller system/Login

AuthLib:
- Added new private method _createAuthObjByPerson
- Moved config load from constructor to _authenticate
- Moved Person_Model load from constructor to _createAuthObjByPerson
- Removed method checkUserAuthByCode
- Removed method checkUserAuthByCodeEmail
- Adapted code to use LDAPLib
2019-03-13 11:57:36 +01:00

39 lines
825 B
PHP

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class CheckUserAuth extends REST_Controller
{
/**
* Course API constructor.
*/
public function __construct()
{
parent::__construct();
// Loads helper message to manage returning messages
// NOTE: loaded here because it does not extend the APIv1_Controller
$this->load->helper('hlp_message');
}
/**
* Checks if username and password of a final user are valid
*/
public function getCheckByUsernamePassword()
{
$username = $this->get('username');
$password = $this->get('password');
if (isset($username) && isset($password))
{
$result = $this->authlib->checkUserAuthByUsernamePassword($username, $password);
$this->response($result, REST_Controller::HTTP_OK);
}
else
{
$this->response();
}
}
}