REST_Controller::_perform_library_auth PHP Метод

_perform_library_auth() защищенный Метод

Perform Library Authentication - Override this function to change the way the library is called
protected _perform_library_auth ( string $username = '', string $password = NULL ) : boolean
$username string The username to validate
$password string The password to validate
Результат boolean
    protected function _perform_library_auth($username = '', $password = NULL)
    {
        if (empty($username)) {
            log_message('error', 'Library Auth: Failure, empty username');
            return FALSE;
        }
        $auth_library_class = strtolower($this->config->item('auth_library_class'));
        $auth_library_function = strtolower($this->config->item('auth_library_function'));
        if (empty($auth_library_class)) {
            log_message('debug', 'Library Auth: Failure, empty auth_library_class');
            return FALSE;
        }
        if (empty($auth_library_function)) {
            log_message('debug', 'Library Auth: Failure, empty auth_library_function');
            return FALSE;
        }
        if (is_callable([$auth_library_class, $auth_library_function]) === FALSE) {
            $this->load->library($auth_library_class);
        }
        return $this->{$auth_library_class}->{$auth_library_function}($username, $password);
    }