From 0beabe0f4acf5fd366f58b6a0f06f616d0f17610 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Wed, 19 Jul 2023 11:11:52 +0200 Subject: [PATCH] spaces to tabs --- application/controllers/dashboard/Api.php | 112 +++++++++++----------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/application/controllers/dashboard/Api.php b/application/controllers/dashboard/Api.php index 8a9d24c4f..c66f181dc 100644 --- a/application/controllers/dashboard/Api.php +++ b/application/controllers/dashboard/Api.php @@ -3,76 +3,76 @@ defined('BASEPATH') || exit('No direct script access allowed'); class Api extends Auth_Controller { - public function __construct() - { - parent::__construct( - array( - 'index' => 'dashboard/admin:rw', - 'getNews' => 'dashboard/benutzer:r', - 'getAmpeln' => 'dashboard/benutzer:r', - ) - ); + public function __construct() + { + parent::__construct( + array( + 'index' => 'dashboard/admin:rw', + 'getNews' => 'dashboard/benutzer:r', + 'getAmpeln' => 'dashboard/benutzer:r', + ) + ); - $this->load->library('AuthLib', null, 'AuthLib'); + $this->load->library('AuthLib', null, 'AuthLib'); - $this->_setAuthUID(); - } + $this->_setAuthUID(); + } - public function index() - { - echo 'Dashboard API Controller'; - } + public function index() + { + echo 'Dashboard API Controller'; + } - /** - * Get News. - */ - public function getNews() - { - $limit = $this->input->get('limit'); + /** + * Get News. + */ + public function getNews() + { + $limit = $this->input->get('limit'); - $this->load->model('content/News_model', 'NewsModel'); + $this->load->model('content/News_model', 'NewsModel'); - $result = $this->NewsModel->getAll($limit); + $result = $this->NewsModel->getAll($limit); - if(hasData($result)) - { + if(hasData($result)) + { - $this->outputJson(getData($result), REST_Controller::HTTP_OK); - } - else - { - $this->terminateWithJsonError('fehler entdeckt'); - } - } + $this->outputJson(getData($result), REST_Controller::HTTP_OK); + } + else + { + $this->terminateWithJsonError('fehler entdeckt'); + } + } - /** - * Get Ampeln. - */ - public function getAmpeln(){ + /** + * Get Ampeln. + */ + public function getAmpeln(){ - $this->load->model('content/Ampel_model', 'AmpelModel'); - $result = $this->AmpelModel->getByUser($this->_uid); + $this->load->model('content/Ampel_model', 'AmpelModel'); + $result = $this->AmpelModel->getByUser($this->_uid); - if(hasData($result)) - { + if(hasData($result)) + { - $this->outputJson(getData($result), REST_Controller::HTTP_OK); - } - else - { - $this->terminateWithJsonError('fehler entdeckt'); - } + $this->outputJson(getData($result), REST_Controller::HTTP_OK); + } + else + { + $this->terminateWithJsonError('fehler entdeckt'); + } - } + } - /** - * Retrieve the UID of the logged user and checks if it is valid - */ - private function _setAuthUID() - { - $this->_uid = getAuthUID(); + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); - if (!$this->_uid) show_error('User authentification failed'); - } + if (!$this->_uid) show_error('User authentification failed'); + } }