mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
HTTP digest authentication
This commit is contained in:
@@ -110,7 +110,7 @@ $config['rest_realm'] = 'FHC REST API';
|
||||
| authorization key
|
||||
|
|
||||
*/
|
||||
$config['rest_auth'] = 'basic';
|
||||
$config['rest_auth'] = 'digest';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -145,7 +145,8 @@ $config['auth_source'] = 'library';
|
||||
|
|
||||
*/
|
||||
$config['auth_library_class'] = 'fhcauth';
|
||||
$config['auth_library_function'] = 'auth';
|
||||
//$config['auth_library_function'] = 'auth';
|
||||
$config['auth_library_function'] = 'auth_digest';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -202,7 +203,7 @@ $config['auth_library_function'] = 'auth';
|
||||
| Array of usernames and passwords for login, if ldap (even library) is configured this is ignored
|
||||
|
|
||||
*/
|
||||
$config['rest_valid_logins'] = ['admin' => '1234', 'test' => 'test'];
|
||||
//$config['rest_valid_logins'] = ['admin' => '1234', 'test' => 'test'];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -528,7 +528,7 @@ abstract class REST_Controller extends CI_Controller {
|
||||
{
|
||||
$this->_allow = $this->_detect_api_key();
|
||||
}
|
||||
|
||||
|
||||
// Only allow ajax requests
|
||||
if ($this->input->is_ajax_request() === FALSE && $this->config->item('rest_ajax_only'))
|
||||
{
|
||||
@@ -540,7 +540,7 @@ abstract class REST_Controller extends CI_Controller {
|
||||
}
|
||||
|
||||
// When there is no specific override for the current class/method, use the default auth value set in the config
|
||||
if ($this->auth_override === FALSE && !($this->config->item('rest_enable_keys') && $this->_allow === TRUE))
|
||||
if ($this->auth_override === FALSE && ($this->config->item('rest_enable_keys') && $this->_allow === TRUE))
|
||||
{
|
||||
$rest_auth = strtolower($this->config->item('rest_auth'));
|
||||
switch ($rest_auth)
|
||||
|
||||
@@ -65,7 +65,8 @@ class authentication extends auth
|
||||
|| $username=='gl2'
|
||||
|| $username=='lektor1'
|
||||
|| $username=='lektor2'
|
||||
|| $username=='lektor3'))
|
||||
|| $username=='lektor3'
|
||||
|| $username == 'aufname'))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user