mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
699aca74d1
- Changed language config - Removed never used constants - Changed rest_language in rest config file - Adapted models that where extending FHC_Model - Adapted code to load hlp_return_object - Adapted code to use exit status codes constants
39 lines
831 B
PHP
39 lines
831 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_return_object');
|
|
}
|
|
|
|
/**
|
|
* 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();
|
|
}
|
|
}
|
|
}
|