mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-10 00:29:27 +00:00
RestAuth
This commit is contained in:
@@ -110,7 +110,7 @@ $config['rest_realm'] = 'FHC REST API';
|
||||
| authorization key
|
||||
|
|
||||
*/
|
||||
$config['rest_auth'] = 'session';
|
||||
$config['rest_auth'] = ' basic';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -38,6 +38,8 @@ class Person extends API_Controller
|
||||
|
||||
if (!is_null($code))
|
||||
$result = $this->person_model->getPersonByCode($code);
|
||||
else
|
||||
$result = $this->person_model->getPersonen();
|
||||
// var_dump($result[0]);
|
||||
|
||||
if (empty($result))
|
||||
@@ -50,12 +52,12 @@ class Person extends API_Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
// return all available locations
|
||||
// return all available persons
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Person with code found',
|
||||
'person_id' => $result[0]->person_id
|
||||
'message' => 'Persons found'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ class Person extends MY_Controller {
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('person_model');
|
||||
$this->load->model('person/person_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['person'] = $this->person_model->get_personen();
|
||||
$data['person'] = $this->person_model->getPersonen();
|
||||
$data['title'] = 'Personen Archiv';
|
||||
|
||||
$this->load->view('templates/header', $data);
|
||||
@@ -19,7 +19,7 @@ class Person extends MY_Controller {
|
||||
|
||||
public function view($slug = NULL)
|
||||
{
|
||||
$data['person_item'] = $this->person_model->get_personen($slug);
|
||||
$data['person_item'] = $this->person_model->getPersonen($slug);
|
||||
if (empty($data['person_item']))
|
||||
{
|
||||
show_404();
|
||||
@@ -1,6 +1,14 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class MY_Controller extends CI_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
||||
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
|
||||
require APPPATH . '/libraries/REST_Controller.php';
|
||||
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class DB_Model extends CI_Model
|
||||
class MY_Model extends CI_Model
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('database');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class DB_Model extends MY_Model
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->database();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user