From 34f7d335ed0d60e0b1b2d20f89cd0460ef331064 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 16 Mar 2018 15:18:19 +0100 Subject: [PATCH 01/48] Added a check of the user permissions in the FHC_Controller - FHC_Controller includes PermissionLib - Added new method _isAllowed to FHC_Controller - Added permission _checkPermissions to FHC_Controller - Added new constants to PermissionLib --- application/core/FHC_Controller.php | 120 +++++++++++++++++++++++- application/libraries/PermissionLib.php | 15 ++- 2 files changed, 128 insertions(+), 7 deletions(-) diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 5e252998e..a8e0cb820 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -4,13 +4,129 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class FHC_Controller extends CI_Controller { + // Conversion from HTTP method to access type method + const READ_HTTP_METHOD = 'GET'; + const WRITE_HTTP_METHOD = 'POST'; + /** * Standard construct for all the controllers, loads the authentication system + * Checks the caller permissions */ - public function __construct() + public function __construct($requiredPermissions) { parent::__construct(); - + $this->load->helper('fhcauth'); + + $this->load->library('PermissionLib'); + + $this->_isAllowed($requiredPermissions); + } + + /** + * Checks if the caller is allowed to access to this content with the given permissions + * If it is not allowed will set the HTTP header with code 401 + * Wrapper for _checkPermissions + */ + private function _isAllowed($requiredPermissions) + { + if (!$this->_checkPermissions($requiredPermissions)) + { + header('HTTP/1.0 401 Unauthorized'); + echo 'You are not allowed to access to this content'; + exit; + } + } + + /** + * Checks if the caller is allowed to access to this content with the given permissions + * - checks if the parameter $requiredPermissions is set, is an array and contains at least one element + * - checks if the given $requiredPermissions parameter contains the called method of the controller + * - checks if the HTTP method used to call is GET or POST + * - convert the required permissions to an array if needed + * - loops through the required permissions + * - checks if the permission is well formatted + * - retrives permission and required access type from the $requiredPermissions array + * - checks if the required access type is compliant with the HTTP method (GET => r, POST => w) + * - if the user has one of the permissions than exit the loop + * - checks if the user has the same required permissiond with the same required access type + * - returns true if all the checks are ok, otherwise false + */ + private function _checkPermissions($requiredPermissions) + { + $checkPermissions = false; + $method = $this->router->method; + $requestMethod = $_SERVER['REQUEST_METHOD']; + + // Checks if the parameter $requiredPermissions is set, is an array and contains at least one element + if (isset($requiredPermissions) && is_array($requiredPermissions) && count($requiredPermissions) > 0) + { + // Checks if the given $requiredPermissions parameter contains the called method of the controller + if (isset($requiredPermissions[$method])) + { + // Checks if the HTTP method used to call is GET or POST + if ($requestMethod == self::READ_HTTP_METHOD || $requestMethod == self::WRITE_HTTP_METHOD) + { + $permissions = $requiredPermissions[$method]; + // Convert the required permissions to an array if needed + if (!is_array($permissions)) + { + $permissions = array($requiredPermissions[$method]); + } + + // Loops through the required permissions + for ($pCounter = 0; $pCounter < count($permissions); $pCounter++) + { + // Checks if the permission is well formatted + if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false) + { + // Retrives permission and required access type from the $requiredPermissions array + list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]); + + $accessType = null; + + // Checks if the required access type is compliant with the HTTP method (GET => r, POST => w) + if ($requestMethod == self::READ_HTTP_METHOD + && strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) + { + $accessType = PermissionLib::SELECT_RIGHT; // S + } + elseif ($requestMethod == self::WRITE_HTTP_METHOD + && strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) + { + $accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID + } + + if ($accessType != null) // if compliant + { + // Checks if the user has the same required permissiond with the same required access type + $checkPermissions = $this->permissionlib->isBerechtigt($permission, $accessType); + + // If the user has one of the permissionsm than exit the loop + if ($checkPermissions === true) break; + } + } + else + { + show_error('The given permission does not use the correct format'); + } + } + } + else + { + show_error('Your are trying to access to this content with a not valid HTTP method'); + } + } + else + { + show_error('The given permission array does not contain the called method'); + } + } + else + { + show_error('You must give the permissions array as parameter to the constructor of the controller'); + } + + return $checkPermissions; } } diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index 3000aceea..8d23842fe 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -23,13 +23,20 @@ require_once(FHCPATH.'include/benutzerberechtigung.class.php'); class PermissionLib { - // Available rights + // Available rights in the DB const SELECT_RIGHT = 's'; const UPDATE_RIGHT = 'u'; const INSERT_RIGHT = 'i'; const DELETE_RIGHT = 'd'; const REPLACE_RIGHT = 'ui'; + // Available rights to access a controller + const READ_RIGHT = 'r'; + const WRITE_RIGHT = 'w'; + const READ_WRITE_RIGHT = 'rw'; + + const PERMISSION_SEPARATOR = ':'; // used as separator berween permission and right + private $acl; // conversion array from a source to a permission private static $bb; // benutzerberechtigung @@ -42,9 +49,6 @@ class PermissionLib // Loads CI instance $this->ci =& get_instance(); - // Loads the library to manage the rights system - //$this->ci->load->library('FHC_DB_ACL'); - // Loads the auth helper $this->ci->load->helper('fhcauth'); @@ -69,7 +73,8 @@ class PermissionLib { $isEntitled = false; - if(!is_cli()) + // If it's called from command line than it's trusted + if (!is_cli()) { // If the resource exists if (isset($this->acl[$sourceName])) From 15c4c1af24d6f1763352954992d3d85ff0d025dc Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 16 Mar 2018 15:22:34 +0100 Subject: [PATCH 02/48] - Removed application/core/VileSci_Controller.php - Controllers now don't extend VileSci_Controller but FHC_Controller --- application/controllers/crm/Statusgrund.php | 2 +- .../controllers/organisation/Studiengang2.php | 167 ------------------ .../controllers/organisation/Studienjahr.php | 2 +- .../organisation/Studiensemester.php | 2 +- application/controllers/system/Filters.php | 2 +- application/controllers/system/Login.php | 2 +- application/controllers/system/Messages.php | 2 +- application/controllers/system/Navigation.php | 2 +- application/controllers/system/UDF.php | 2 +- application/controllers/system/Vorlage.php | 2 +- .../system/aufnahme/PrestudentMultiAssign.php | 2 +- .../controllers/system/extensions/Manager.php | 2 +- .../system/infocenter/InfoCenter.php | 2 +- application/core/VileSci_Controller.php | 14 -- 14 files changed, 12 insertions(+), 193 deletions(-) delete mode 100644 application/controllers/organisation/Studiengang2.php delete mode 100644 application/core/VileSci_Controller.php diff --git a/application/controllers/crm/Statusgrund.php b/application/controllers/crm/Statusgrund.php index c751d24d4..0557fde9a 100644 --- a/application/controllers/crm/Statusgrund.php +++ b/application/controllers/crm/Statusgrund.php @@ -2,7 +2,7 @@ if (! defined("BASEPATH")) exit("No direct script access allowed"); -class Statusgrund extends VileSci_Controller +class Statusgrund extends FHC_Controller { public function __construct() { diff --git a/application/controllers/organisation/Studiengang2.php b/application/controllers/organisation/Studiengang2.php deleted file mode 100644 index 600a1d17b..000000000 --- a/application/controllers/organisation/Studiengang2.php +++ /dev/null @@ -1,167 +0,0 @@ -load->model('organisation/studiengang_model'); - $this->load->library('form_validation'); - } - - public function index() - { - $keyword = ''; - $this->load->library('pagination'); - - $config['base_url'] = base_url() . 'studiengang/index/'; - $config['total_rows'] = $this->studiengang_model->total_rows(); - $config['per_page'] = 10; - $config['uri_segment'] = 3; - $config['suffix'] = '.html'; - $config['first_url'] = base_url() . 'studiengang.html'; - $this->pagination->initialize($config); - - $start = $this->uri->segment(3, 0); - $studiengang = $this->studiengang_model->index_limit($config['per_page'], $start); - - $data = array( - 'studiengang_data' => $studiengang, - 'keyword' => $keyword, - 'pagination' => $this->pagination->create_links(), - 'total_rows' => $config['total_rows'], - 'start' => $start, - ); - - $this->load->view('tbl_studiengang_list', $data); - } - - public function search() - { - $keyword = $this->uri->segment(3, $this->input->post('keyword', TRUE)); - $this->load->library('pagination'); - - if ($this->uri->segment(2)=='search') { - $config['base_url'] = base_url() . 'studiengang/search/' . $keyword; - } else { - $config['base_url'] = base_url() . 'studiengang/index/'; - } - - $config['total_rows'] = $this->studiengang_model->search_total_rows($keyword); - $config['per_page'] = 10; - $config['uri_segment'] = 4; - $config['suffix'] = '.html'; - $config['first_url'] = base_url() . 'studiengang/search/'.$keyword.'.html'; - $this->pagination->initialize($config); - - $start = $this->uri->segment(4, 0); - $studiengang = $this->studiengang_model->search_index_limit($config['per_page'], $start, $keyword); - - $data = array( - 'studiengang_data' => $studiengang, - 'keyword' => $keyword, - 'pagination' => $this->pagination->create_links(), - 'total_rows' => $config['total_rows'], - 'start' => $start, - ); - $this->load->view('tbl_studiengang_list', $data); - } - - public function read($id) - { - $row = $this->studiengang_model->get_by_id($id); - if ($row) { - $data = array( - ); - $this->load->view('tbl_studiengang_read', $data); - } else { - $this->session->set_flashdata('message', 'Record Not Found'); - redirect(site_url('studiengang')); - } - } - - public function create() - { - $data = array( - 'button' => 'Create', - 'action' => site_url('studiengang/create_action'), - ); - $this->load->view('tbl_studiengang_form', $data); - } - - public function create_action() - { - $this->_rules(); - - if ($this->form_validation->run() == FALSE) { - $this->create(); - } else { - $data = array( - ); - - $this->studiengang_model->insert($data); - $this->session->set_flashdata('message', 'Create Record Success'); - redirect(site_url('studiengang')); - } - } - - public function update($id) - { - $row = $this->studiengang_model->get_by_id($id); - - if ($row) { - $data = array( - 'button' => 'Update', - 'action' => site_url('studiengang/update_action'), - ); - $this->load->view('tbl_studiengang_form', $data); - } else { - $this->session->set_flashdata('message', 'Record Not Found'); - redirect(site_url('studiengang')); - } - } - - public function update_action() - { - $this->_rules(); - - if ($this->form_validation->run() == FALSE) { - $this->update($this->input->post('', TRUE)); - } else { - $data = array( - ); - - $this->studiengang_model->update($this->input->post('', TRUE), $data); - $this->session->set_flashdata('message', 'Update Record Success'); - redirect(site_url('studiengang')); - } - } - - public function delete($id) - { - $row = $this->studiengang_model->get_by_id($id); - - if ($row) { - $this->studiengang_model->delete($id); - $this->session->set_flashdata('message', 'Delete Record Success'); - redirect(site_url('studiengang')); - } else { - $this->session->set_flashdata('message', 'Record Not Found'); - redirect(site_url('studiengang')); - } - } - - public function _rules() - { - - $this->form_validation->set_rules('', '', 'trim'); - $this->form_validation->set_error_delimiters('', ''); - } - -}; - -/* End of file Studiengang.php */ -/* Location: ./application/controllers/Studiengang.php */ diff --git a/application/controllers/organisation/Studienjahr.php b/application/controllers/organisation/Studienjahr.php index 8c98a4c8b..027c0bf8f 100644 --- a/application/controllers/organisation/Studienjahr.php +++ b/application/controllers/organisation/Studienjahr.php @@ -5,7 +5,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); /** * Studienjahr controller for listing, editing and removing a Studienjahr */ -class Studienjahr extends VileSci_Controller +class Studienjahr extends FHC_Controller { /** diff --git a/application/controllers/organisation/Studiensemester.php b/application/controllers/organisation/Studiensemester.php index 5707bba4a..7b48dbbc4 100644 --- a/application/controllers/organisation/Studiensemester.php +++ b/application/controllers/organisation/Studiensemester.php @@ -5,7 +5,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); /** * Studiensemester controller for listing, editing and removing a Studiensemester */ -class Studiensemester extends VileSci_Controller +class Studiensemester extends FHC_Controller { /** diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index cda080a46..759f9c56b 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); /** * */ -class Filters extends VileSci_Controller +class Filters extends FHC_Controller { const SESSION_NAME = 'FILTER'; diff --git a/application/controllers/system/Login.php b/application/controllers/system/Login.php index c6da0de0b..27e8ea409 100644 --- a/application/controllers/system/Login.php +++ b/application/controllers/system/Login.php @@ -1,7 +1,7 @@ Date: Tue, 20 Mar 2018 13:00:35 +0100 Subject: [PATCH 03/48] - Moved _checkPermissions from FHC_Controller to PermissionLib (now is public and it's renamed checkPermissions) - Added include of PermissionLib in APIv1_Controller - Added method _isAllowed to APIv1_Controller to call checkPermissions from PermissionLib - Now the APIv1_Controller constructor requires an array of permissions as parameter --- application/core/APIv1_Controller.php | 24 +++++- application/core/FHC_Controller.php | 100 +----------------------- application/libraries/PermissionLib.php | 98 +++++++++++++++++++++++ 3 files changed, 122 insertions(+), 100 deletions(-) diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 5303bf02d..43790c080 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -7,13 +7,31 @@ class APIv1_Controller extends REST_Controller /** * Standard constructor for all the RESTful resources */ - public function __construct() + public function __construct($requiredPermissions) { parent::__construct(); - + // Loads return messages $this->load->helper('message'); - + + // Loads permission lib + $this->load->library('PermissionLib'); + log_message('debug', 'Called API: '.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); + + $this->_isAllowed($requiredPermissions); } + + /** + * Checks if the caller is allowed to access to this content with the given permissions + * If it is not allowed will set the HTTP header with code 401 + * Wrapper for _checkPermissions + */ + private function _isAllowed($requiredPermissions) + { + if (!$this->permissionlib->checkPermissions($requiredPermissions, $this->router->method)) + { + $this->response(error('You are not allowed to access to this content'), REST_Controller::HTTP_UNAUTHORIZED); + } + } } diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index a8e0cb820..fab8aea32 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -4,10 +4,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class FHC_Controller extends CI_Controller { - // Conversion from HTTP method to access type method - const READ_HTTP_METHOD = 'GET'; - const WRITE_HTTP_METHOD = 'POST'; - /** * Standard construct for all the controllers, loads the authentication system * Checks the caller permissions @@ -16,8 +12,10 @@ class FHC_Controller extends CI_Controller { parent::__construct(); + // Loads authentication helper $this->load->helper('fhcauth'); + // Loads permission lib $this->load->library('PermissionLib'); $this->_isAllowed($requiredPermissions); @@ -30,103 +28,11 @@ class FHC_Controller extends CI_Controller */ private function _isAllowed($requiredPermissions) { - if (!$this->_checkPermissions($requiredPermissions)) + if (!$this->permissionlib->checkPermissions($requiredPermissions, $this->router->method)) { header('HTTP/1.0 401 Unauthorized'); echo 'You are not allowed to access to this content'; exit; } } - - /** - * Checks if the caller is allowed to access to this content with the given permissions - * - checks if the parameter $requiredPermissions is set, is an array and contains at least one element - * - checks if the given $requiredPermissions parameter contains the called method of the controller - * - checks if the HTTP method used to call is GET or POST - * - convert the required permissions to an array if needed - * - loops through the required permissions - * - checks if the permission is well formatted - * - retrives permission and required access type from the $requiredPermissions array - * - checks if the required access type is compliant with the HTTP method (GET => r, POST => w) - * - if the user has one of the permissions than exit the loop - * - checks if the user has the same required permissiond with the same required access type - * - returns true if all the checks are ok, otherwise false - */ - private function _checkPermissions($requiredPermissions) - { - $checkPermissions = false; - $method = $this->router->method; - $requestMethod = $_SERVER['REQUEST_METHOD']; - - // Checks if the parameter $requiredPermissions is set, is an array and contains at least one element - if (isset($requiredPermissions) && is_array($requiredPermissions) && count($requiredPermissions) > 0) - { - // Checks if the given $requiredPermissions parameter contains the called method of the controller - if (isset($requiredPermissions[$method])) - { - // Checks if the HTTP method used to call is GET or POST - if ($requestMethod == self::READ_HTTP_METHOD || $requestMethod == self::WRITE_HTTP_METHOD) - { - $permissions = $requiredPermissions[$method]; - // Convert the required permissions to an array if needed - if (!is_array($permissions)) - { - $permissions = array($requiredPermissions[$method]); - } - - // Loops through the required permissions - for ($pCounter = 0; $pCounter < count($permissions); $pCounter++) - { - // Checks if the permission is well formatted - if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false) - { - // Retrives permission and required access type from the $requiredPermissions array - list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]); - - $accessType = null; - - // Checks if the required access type is compliant with the HTTP method (GET => r, POST => w) - if ($requestMethod == self::READ_HTTP_METHOD - && strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) - { - $accessType = PermissionLib::SELECT_RIGHT; // S - } - elseif ($requestMethod == self::WRITE_HTTP_METHOD - && strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) - { - $accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID - } - - if ($accessType != null) // if compliant - { - // Checks if the user has the same required permissiond with the same required access type - $checkPermissions = $this->permissionlib->isBerechtigt($permission, $accessType); - - // If the user has one of the permissionsm than exit the loop - if ($checkPermissions === true) break; - } - } - else - { - show_error('The given permission does not use the correct format'); - } - } - } - else - { - show_error('Your are trying to access to this content with a not valid HTTP method'); - } - } - else - { - show_error('The given permission array does not contain the called method'); - } - } - else - { - show_error('You must give the permissions array as parameter to the constructor of the controller'); - } - - return $checkPermissions; - } } diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index 8d23842fe..c43f6dec0 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -37,6 +37,10 @@ class PermissionLib const PERMISSION_SEPARATOR = ':'; // used as separator berween permission and right + // Conversion from HTTP method to access type method + const READ_HTTP_METHOD = 'GET'; + const WRITE_HTTP_METHOD = 'POST'; + private $acl; // conversion array from a source to a permission private static $bb; // benutzerberechtigung @@ -123,4 +127,98 @@ class PermissionLib return $isBerechtigt; } + + /** + * Checks if the caller is allowed to access to this content with the given permissions + * - checks if the parameter $requiredPermissions is set, is an array and contains at least one element + * - checks if the given $requiredPermissions parameter contains the called method of the controller + * - checks if the HTTP method used to call is GET or POST + * - convert the required permissions to an array if needed + * - loops through the required permissions + * - checks if the permission is well formatted + * - retrives permission and required access type from the $requiredPermissions array + * - checks if the required access type is compliant with the HTTP method (GET => r, POST => w) + * - if the user has one of the permissions than exit the loop + * - checks if the user has the same required permissiond with the same required access type + * - returns true if all the checks are ok, otherwise false + * + * NOTE: the displayed error messages are used to warn the developer about any issues that could occur, + * they are not intended for the final user! + */ + public function checkPermissions($requiredPermissions, $calledMethod) + { + $checkPermissions = false; + $requestMethod = $_SERVER['REQUEST_METHOD']; + + // Checks if the parameter $requiredPermissions is set, is an array and contains at least one element + if (isset($requiredPermissions) && is_array($requiredPermissions) && count($requiredPermissions) > 0) + { + // Checks if the given $requiredPermissions parameter contains the called method of the controller + if (isset($requiredPermissions[$calledMethod])) + { + // Checks if the HTTP method used to call is GET or POST + if ($requestMethod == self::READ_HTTP_METHOD || $requestMethod == self::WRITE_HTTP_METHOD) + { + $permissions = $requiredPermissions[$calledMethod]; + // Convert the required permissions to an array if needed + if (!is_array($permissions)) + { + $permissions = array($requiredPermissions[$calledMethod]); + } + + // Loops through the required permissions + for ($pCounter = 0; $pCounter < count($permissions); $pCounter++) + { + // Checks if the permission is well formatted + if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false) + { + // Retrives permission and required access type from the $requiredPermissions array + list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]); + + $accessType = null; + + // Checks if the required access type is compliant with the HTTP method (GET => r, POST => w) + if ($requestMethod == self::READ_HTTP_METHOD + && strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) + { + $accessType = PermissionLib::SELECT_RIGHT; // S + } + elseif ($requestMethod == self::WRITE_HTTP_METHOD + && strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) + { + $accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID + } + + if ($accessType != null) // if compliant + { + // Checks if the user has the same required permissiond with the same required access type + $checkPermissions = $this->isBerechtigt($permission, $accessType); + + // If the user has one of the permissionsm than exit the loop + if ($checkPermissions === true) break; + } + } + else + { + show_error('The given permission does not use the correct format'); + } + } + } + else + { + show_error('Your are trying to access to this content with a not valid HTTP method'); + } + } + else + { + show_error('The given permission array does not contain the called method'); + } + } + else + { + show_error('You must give the permissions array as parameter to the constructor of the controller'); + } + + return $checkPermissions; + } } From e8bec1ebf5cf22c1158a680716eb2fdb8d8ca279 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 21 Mar 2018 15:33:39 +0100 Subject: [PATCH 04/48] Added a permissions array to all the controllers that extends FHC_Controller --- application/controllers/DBTools.php | 3 +- application/controllers/MailJob.php | 9 +- application/controllers/Redirect.php | 2 +- application/controllers/Vilesci.php | 6 +- application/controllers/crm/Statusgrund.php | 15 +- .../controllers/jobs/Prestudentstatus.php | 3 +- .../controllers/organisation/Studienjahr.php | 14 +- .../organisation/Studiensemester.php | 12 +- application/controllers/system/Login.php | 16 -- application/controllers/system/Messages.php | 10 +- application/controllers/system/Navigation.php | 7 +- application/controllers/system/Phrases.php | 37 ++-- application/controllers/system/UDF.php | 57 +++--- application/controllers/system/Vorlage.php | 163 ++++++++++-------- .../system/aufnahme/PrestudentMultiAssign.php | 64 +++---- .../controllers/system/extensions/Manager.php | 9 +- .../system/infocenter/InfoCenter.php | 17 +- 17 files changed, 272 insertions(+), 172 deletions(-) delete mode 100644 application/controllers/system/Login.php diff --git a/application/controllers/DBTools.php b/application/controllers/DBTools.php index 8590c2285..ef532532f 100644 --- a/application/controllers/DBTools.php +++ b/application/controllers/DBTools.php @@ -32,7 +32,8 @@ class DBTools extends FHC_Controller */ public function __construct() { - parent::__construct(); + // An empty array as parameter will ensure that this controller is ONLY callable from command line + parent::__construct(array()); $this->seed_path = APPPATH.'seeds/'; diff --git a/application/controllers/MailJob.php b/application/controllers/MailJob.php index 8da4ef95d..70fb754f2 100644 --- a/application/controllers/MailJob.php +++ b/application/controllers/MailJob.php @@ -21,14 +21,15 @@ class MailJob extends FHC_Controller */ public function __construct() { - parent::__construct(); - + // An empty array as parameter will ensure that this controller is ONLY callable from command line + parent::__construct(array()); + // Loads MessageLib $this->load->library("MessageLib"); } - + public function sendMessages($numberToSent = null, $numberPerTimeRange = null, $email_time_range = null, $email_from_system = null) { $this->messagelib->sendAll($numberToSent, $numberPerTimeRange, $email_time_range, $email_from_system); } -} \ No newline at end of file +} diff --git a/application/controllers/Redirect.php b/application/controllers/Redirect.php index 660709b6f..c3ba110ca 100644 --- a/application/controllers/Redirect.php +++ b/application/controllers/Redirect.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Redirect extends FHC_Controller +class Redirect extends CI_Controller { /** * API constructor diff --git a/application/controllers/Vilesci.php b/application/controllers/Vilesci.php index abfad4dd1..e4af6d2b8 100644 --- a/application/controllers/Vilesci.php +++ b/application/controllers/Vilesci.php @@ -6,7 +6,11 @@ class Vilesci extends FHC_Controller public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'basis/vilesci:r' + ) + ); $this->load->library('WidgetLib'); } diff --git a/application/controllers/crm/Statusgrund.php b/application/controllers/crm/Statusgrund.php index 0557fde9a..7a399b4aa 100644 --- a/application/controllers/crm/Statusgrund.php +++ b/application/controllers/crm/Statusgrund.php @@ -6,7 +6,20 @@ class Statusgrund extends FHC_Controller { public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'basis/status:r', + 'listStatus' => 'basis/status:r', + 'listGrund' => 'basis/status:r', + 'editGrund' => 'basis/status:w', + 'editStatus' => 'basis/status:w', + 'newGrund' => 'basis/status:w', + 'saveGrund' => 'basis/status:w', + 'insGrund' => 'basis/status:w', + 'saveStatus' => 'basis/status:w' + ) + ); + $this->load->model("crm/Status_model", "StatusModel"); $this->load->model("crm/Statusgrund_model", "StatusgrundModel"); $this->load->model("system/Sprache_model", "SpracheModel"); diff --git a/application/controllers/jobs/Prestudentstatus.php b/application/controllers/jobs/Prestudentstatus.php index 2f3e3aa95..a1e1901cb 100644 --- a/application/controllers/jobs/Prestudentstatus.php +++ b/application/controllers/jobs/Prestudentstatus.php @@ -17,7 +17,8 @@ class Prestudentstatus extends FHC_Controller */ public function __construct() { - parent::__construct(); + // An empty array as parameter will ensure that this controller is ONLY callable from command line + parent::__construct(array()); if ($this->input->is_cli_request()) { diff --git a/application/controllers/organisation/Studienjahr.php b/application/controllers/organisation/Studienjahr.php index 027c0bf8f..899271960 100644 --- a/application/controllers/organisation/Studienjahr.php +++ b/application/controllers/organisation/Studienjahr.php @@ -14,7 +14,17 @@ class Studienjahr extends FHC_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'listStudienjahr' => 'basis/studiensemester:r', + 'editStudienjahr' => 'basis/studiensemester:w', + 'newStudienjahr' => 'basis/studiensemester:w', + 'insStudienjahr' => 'basis/studiensemester:w', + 'saveStudienjahr' => 'basis/studiensemester:w', + 'deleteStudienjahr' => 'basis/studiensemester:w' + ) + ); + $this->load->model("organisation/Studienjahr_model", "StudienjahrModel"); } @@ -200,4 +210,4 @@ class Studienjahr extends FHC_Controller } -} \ No newline at end of file +} diff --git a/application/controllers/organisation/Studiensemester.php b/application/controllers/organisation/Studiensemester.php index 7b48dbbc4..0021a6d9b 100644 --- a/application/controllers/organisation/Studiensemester.php +++ b/application/controllers/organisation/Studiensemester.php @@ -14,7 +14,17 @@ class Studiensemester extends FHC_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'listStudiensemester' => 'basis/studiensemester:r', + 'editStudiensemester' => 'basis/studiensemester:w', + 'newStudiensemester' => 'basis/studiensemester:w', + 'insStudiensemester' => 'basis/studiensemester:w', + 'saveStudiensemester' => 'basis/studiensemester:w', + 'deleteStudiensemester' => 'basis/studiensemester:w' + ) + ); + $this->load->model("organisation/Studiensemester_model", "StudiensemesterModel"); $this->load->model("organisation/Studienjahr_model", "StudienjahrModel"); } diff --git a/application/controllers/system/Login.php b/application/controllers/system/Login.php deleted file mode 100644 index 27e8ea409..000000000 --- a/application/controllers/system/Login.php +++ /dev/null @@ -1,16 +0,0 @@ -load->view('test.php'); - } -} diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index 5d5a145a3..11f7e5a2f 100644 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -11,7 +11,15 @@ class Messages extends FHC_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'write' => array('basis/message:w', 'infocenter:w'), + 'send' => array('basis/message:w', 'infocenter:w'), + 'getVorlage' => array('basis/message:r', 'infocenter:r'), + 'parseMessageText' => array('basis/message:r', 'infocenter:r'), + 'getMessageFromIds' => array('basis/message:r', 'infocenter:r') + ) + ); // Loads the message library $this->load->library('MessageLib'); diff --git a/application/controllers/system/Navigation.php b/application/controllers/system/Navigation.php index 8f91dd733..65dfe7901 100644 --- a/application/controllers/system/Navigation.php +++ b/application/controllers/system/Navigation.php @@ -14,7 +14,12 @@ class Navigation extends FHC_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'menu' => 'basis/vilesci:r', + 'header' => 'basis/vilesci:r' + ) + ); $this->config->load('navigation'); diff --git a/application/controllers/system/Phrases.php b/application/controllers/system/Phrases.php index 7c85de9bf..e4262ae3d 100644 --- a/application/controllers/system/Phrases.php +++ b/application/controllers/system/Phrases.php @@ -6,14 +6,27 @@ class Phrases extends FHC_Controller public function __construct() { - parent::__construct(); - + parent::__construct( + array( + 'index' => 'system/phrase:r', + 'table' => 'system/phrase:r', + 'view' => 'system/phrase:r', + 'deltext' => 'system/phrase:w', + 'edit' => 'system/phrase:w', + 'write' => 'system/phrase:w', + 'save' => 'system/phrase:w', + 'newText' => 'system/phrase:w', + 'editText' => 'system/phrase:w', + 'saveText' => 'system/phrase:w' + ) + ); + // Loads the phrases library $this->load->library('PhrasesLib'); - + // Loads the widget library $this->load->library('WidgetLib'); - + // Loads helper message to manage returning messages $this->load->helper('message'); } @@ -113,19 +126,19 @@ class Phrases extends FHC_Controller public function newText() { $phrase_id = $this->input->post('phrase_id'); - + $this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel'); $this->OrganisationseinheitModel->addLimit(1); $this->OrganisationseinheitModel->addOrder('oe_kurzbz'); $resultOE = $this->OrganisationseinheitModel->loadWhere(array('aktiv' => true, 'oe_parent_kurzbz' => null)); - + if ($resultOE->error) show_error($resultOE->retval); - + if (hasData($resultOE)) { $orgeinheit_kurzbz = $resultOE->retval[0]->oe_kurzbz; - + $data = array ( 'phrase_id' => $phrase_id, 'sprache' => 'German', @@ -133,13 +146,13 @@ class Phrases extends FHC_Controller 'description' => '', 'orgeinheit_kurzbz' => $orgeinheit_kurzbz ); - + $phrase_inhalt = $this->phraseslib->insertPhraseinhalt($data); if ($phrase_inhalt->error) show_error($phrase_inhalt->retval); - + $phrase_inhalt_id = $phrase_inhalt->retval; - + redirect('/system/Phrases/editText/'.$phrase_inhalt_id); } else @@ -174,4 +187,4 @@ class Phrases extends FHC_Controller //$this->load->view('system/templatetextEdit', $data); } -} \ No newline at end of file +} diff --git a/application/controllers/system/UDF.php b/application/controllers/system/UDF.php index 5749290f8..c86c00505 100644 --- a/application/controllers/system/UDF.php +++ b/application/controllers/system/UDF.php @@ -2,25 +2,30 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class UDF extends FHC_Controller +class UDF extends FHC_Controller { public function __construct() { - parent::__construct(); - + parent::__construct( + array( + 'index' => 'basis/person:r', + 'saveUDF' => 'basis/person:w' + ) + ); + // Load session library $this->load->library('session'); - + // Loads the UDF library $this->load->library('UDFLib'); - - // + + // $this->load->model('person/Person_model', 'PersonModel'); $this->load->model('crm/Prestudent_model', 'PrestudentModel'); } - + /** - * + * */ public function index() { @@ -33,7 +38,7 @@ class UDF extends FHC_Controller } unset($this->session->person_id); } - + $prestudent_id = $this->input->get('prestudent_id'); if (isset($this->session->prestudent_id)) { @@ -43,16 +48,16 @@ class UDF extends FHC_Controller } unset($this->session->prestudent_id); } - + $result = null; if (isset($this->session->result)) { $result = clone $this->session->result; $this->session->set_userdata('result', null); } - + $data = array('result' => $result); - + if (isset($person_id) && is_numeric($person_id)) { if ($this->PersonModel->hasUDF()) @@ -62,7 +67,7 @@ class UDF extends FHC_Controller $data['personUdfs'] = $personUdfs; } } - + if (isset($prestudent_id) && is_numeric($prestudent_id)) { if ($this->PrestudentModel->hasUDF()) @@ -72,54 +77,54 @@ class UDF extends FHC_Controller $data['prestudentUdfs'] = $prestudentUdfs; } } - + $this->load->view('system/udf', $data); } - + /** - * + * */ public function saveUDF() { $udfs = $this->input->post(); $validation = $this->_validate($udfs); - + $userdata = array( 'person_id' => $udfs['person_id'], 'prestudent_id' => $udfs['prestudent_id'] ); - + if (isSuccess($validation)) { // Load model UDF_model $this->load->model('system/UDF_model', 'UDFModel'); - + $result = $this->UDFModel->saveUDFs($udfs); - + $userdata['result'] = $result; } else { $userdata['result'] = $validation; } - + $this->session->set_userdata($userdata); redirect('system/UDF'); } - + /** - * + * */ private function _validate($udfs) { $validation = error('person_id or prestudent_id is missing'); - + if((isset($udfs['person_id']) && !(is_null($udfs['person_id'])) && ($udfs['person_id'] != '')) || (isset($udfs['prestudent_id']) && !(is_null($udfs['prestudent_id'])) && ($udfs['prestudent_id'] != ''))) { $validation = success(true); } - + return $validation; } -} \ No newline at end of file +} diff --git a/application/controllers/system/Vorlage.php b/application/controllers/system/Vorlage.php index 500316fd1..a25d8c3bc 100644 --- a/application/controllers/system/Vorlage.php +++ b/application/controllers/system/Vorlage.php @@ -2,79 +2,96 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class Vorlage extends FHC_Controller +class Vorlage extends FHC_Controller { public function __construct() { - parent::__construct(); - + parent::__construct( + array( + 'index' => 'system/vorlage:r', + 'table' => 'system/vorlage:r', + 'view' => 'system/vorlage:r', + 'edit' => 'system/vorlage:w', + 'write' => 'system/vorlage:w', + 'save' => 'system/vorlage:w', + 'newText' => 'system/vorlage:w', + 'editText' => 'system/vorlage:w', + 'newText' => 'system/vorlage:w', + 'linkDocuments' => 'system/vorlage:r', + 'saveDocuments' => 'system/vorlage:w', + 'deleteDocumentLink' => 'system/vorlage:w', + 'saveText' => 'system/vorlage:w', + 'preview' => 'system/vorlage:r' + ) + ); + // Loads the vorlage library $this->load->library('VorlageLib'); - + // Loads the widget library $this->load->library('WidgetLib'); } - + public function index() { $this->load->view('system/vorlage/templates.php'); } - + public function table() { $mimetype = $this->input->post('mimetype'); - + if (is_null($mimetype)) $mimetype = 'text/html'; if ($mimetype == '') $mimetype = null; - + $vorlage = $this->vorlagelib->getVorlageByMimetype($mimetype); - + if ($vorlage->error) show_error($vorlage->retval); - + $data = array ( 'mimetype' => $mimetype, 'vorlage' => $vorlage->retval ); - + $v = $this->load->view('system/vorlage/templatesList.php', $data); } - + public function view($vorlage_kurzbz = null) { if (empty($vorlage_kurzbz)) exit; - + $vorlagentext = $this->vorlagelib->getVorlagetextByVorlage($vorlage_kurzbz); - + if ($vorlagentext->error) show_error($vorlagentext->retval); - + $data = array ( 'vorlage_kurzbz' => $vorlage_kurzbz, 'vorlagentext' => $vorlagentext->retval ); - + $v = $this->load->view('system/vorlage/templatetextList.php', $data); } - + public function edit($vorlage_kurzbz = null) { if (empty($vorlage_kurzbz)) exit; - + $vorlage = $this->vorlagelib->getVorlage($vorlage_kurzbz); - + if ($vorlage->error) show_error($vorlage->retval); - + if (count($vorlage->retval) != 1) show_error('Nachricht nicht vorhanden! ID: '.$vorlage_kurzbz); - + $data = array ( 'vorlage' => $vorlage->retval[0] ); - + $v = $this->load->view('system/vorlage/templatesEdit', $data); } @@ -84,62 +101,62 @@ class Vorlage extends FHC_Controller 'subject' => 'TestSubject', 'body' => 'TestDevelopmentBodyText' ); - + $v = $this->load->view('system/vorlage/messageWrite', $data); } - + public function save() { $vorlage_kurzbz = $this->input->post('vorlage_kurzbz'); - + $data = array( 'bezeichnung' => $this->input->post('bezeichnung'), 'anmerkung' => $this->input->post('anmerkung'), 'mimetype' => $this->input->post('mimetype'), 'attribute' => $this->input->post('attribute') ); - + $vorlage = $this->vorlagelib->saveVorlage($vorlage_kurzbz, $data); - + if ($vorlage->error) show_error($vorlage->retval); - + $vorlage_kurzbz = $vorlage->retval; - + redirect('/system/vorlage/edit/'.$vorlage_kurzbz); } - + public function newText() { $vorlage_kurzbz = $this->input->post('vorlage_kurzbz'); - + $this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel'); $this->OrganisationseinheitModel->addLimit(1); $this->OrganisationseinheitModel->addOrder('oe_kurzbz'); - + $resultOE = $this->OrganisationseinheitModel->loadWhere(array('aktiv' => true, 'oe_parent_kurzbz' => null)); - + if ($resultOE->error) show_error($resultOE->retval); - + if (hasData($resultOE)) { $orgeinheit_kurzbz = $resultOE->retval[0]->oe_kurzbz; - + $data = array ( 'vorlage_kurzbz' => $vorlage_kurzbz, 'studiengang_kz' => 0, 'version' => 1, 'oe_kurzbz' => $orgeinheit_kurzbz ); - + $vorlagetext = $this->vorlagelib->insertVorlagetext($data); - + if ($vorlagetext->error) show_error($vorlagetext->retval); - + $vorlagestudiengang_id = $vorlagetext->retval; - + redirect('/system/vorlage/editText/'.$vorlagestudiengang_id); } else @@ -147,72 +164,72 @@ class Vorlage extends FHC_Controller show_error('No valid organisation unit found'); } } - + public function editText($vorlagestudiengang_id) { $vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id); - + if ($vorlagetext->error) show_error($vorlagetext->retval); - + $data = $vorlagetext->retval[0]; - + // Preview-Data $schema = $this->vorlagelib->getVorlage($data->vorlage_kurzbz); - + $data->schema = $schema->retval[0]->attribute; - + $this->load->view('system/vorlage/templatetextEdit', $data); } - + public function linkDocuments($vorlagestudiengang_id) { $data = array(); - + $this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel'); - + $return = $this->VorlagedokumentModel->loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id); - + $data['documents'] = $return->retval; - + $this->load->model('system/Dokument_model', 'DokumentModel'); $this->DokumentModel->addOrder('bezeichnung'); - + $return = $this->DokumentModel->load(); - + $data['allDocuments'] = $return->retval; $data['vorlagestudiengang_id'] = $vorlagestudiengang_id; - + $this->load->view('system/vorlage/templateLinkDocuments', $data); } - + public function saveDocuments($vorlagestudiengang_id, $dokument_kurzbz, $sort) { $insert = array(); - + $insert['vorlagestudiengang_id'] = $vorlagestudiengang_id; $insert['dokument_kurzbz'] = $dokument_kurzbz; $insert['sort'] = $sort; - + $this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel'); - + $this->VorlagedokumentModel->insert($insert); } - + public function deleteDocumentLink($vorlagestudiengang_id) { $this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel'); - + $this->VorlagedokumentModel->delete($vorlagestudiengang_id); } - + public function changeSort($vorlagestudiengang_id, $sort) { $this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel'); - + $this->VorlagedokumentModel->update($vorlagestudiengang_id, array('sort' => $sort)); } - + public function saveText() { $data = array( @@ -223,38 +240,38 @@ class Vorlage extends FHC_Controller 'text' => $this->input->post('text'), 'vorlagestudiengang_id' => $this->input->post('vorlagestudiengang_id') ); - + if ($this->input->post('sprache') == '') $data['sprache'] = null; else $data['sprache'] = $this->input->post('sprache'); - + if ($this->input->post('orgform_kurzbz') == '') $data['orgform_kurzbz'] = null; else $data['orgform_kurzbz'] = $this->input->post('orgform_kurzbz'); - + $vorlagetext = $this->vorlagelib->updateVorlagetext($data['vorlagestudiengang_id'], $data); - + if ($vorlagetext->error) show_error($vorlagetext->retval); - + redirect('/system/vorlage/editText/'.$data['vorlagestudiengang_id']); } - + public function preview($vorlagestudiengang_id) { $jsonDecodedForm = json_decode($this->input->post('formdata'), true); - + $vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id); - + if ($vorlagetext->error) show_error($vorlagetext->retval); - + $data = array( 'text' => $this->vorlagelib->parseVorlagetext($vorlagetext->retval[0]->text, $jsonDecodedForm) ); - + $this->load->view('system/vorlage/templatetextPreview', $data); } -} \ No newline at end of file +} diff --git a/application/controllers/system/aufnahme/PrestudentMultiAssign.php b/application/controllers/system/aufnahme/PrestudentMultiAssign.php index 8307f6098..08a74bb0a 100644 --- a/application/controllers/system/aufnahme/PrestudentMultiAssign.php +++ b/application/controllers/system/aufnahme/PrestudentMultiAssign.php @@ -6,15 +6,21 @@ class PrestudentMultiAssign extends FHC_Controller { public function __construct() { - parent::__construct(); - + parent::__construct( + array( + 'index' => 'basis/student:r', + 'linkToStufe' => 'basis/student:w', + 'linkToAufnahmegruppe' => 'basis/student:w' + ) + ); + // Loads helper message to manage returning messages $this->load->helper('message'); - + // Loads the widget library $this->load->library('WidgetLib'); } - + public function index() { $studiengang = $this->input->post('studiengang'); @@ -22,27 +28,27 @@ class PrestudentMultiAssign extends FHC_Controller $aufnahmegruppe = $this->input->post('aufnahmegruppe'); $reihungstest = $this->input->post('reihungstest'); $stufe = $this->input->post('stufe'); - + // Converts string 'null' to a null value $stufe = ($stufe == 'null' ? null : $stufe); $studiengang = ($studiengang == 'null' ? null : $studiengang); $reihungstest = ($reihungstest == 'null' ? null : $reihungstest); $aufnahmegruppe = ($aufnahmegruppe == 'null' ? null : $aufnahmegruppe); $studiensemester = ($studiensemester == 'null' ? null : $studiensemester); - + $returnUsers = null; if ($studiengang != null || $studiensemester != null || $aufnahmegruppe!= null || $reihungstest != null || $stufe != null) { $returnUsers = $this->_getPrestudents($studiengang, $studiensemester, $aufnahmegruppe, $reihungstest, $stufe); } - + $users = null; if (hasData($returnUsers)) { $users = $returnUsers->retval; } - + if ($returnUsers == null || isSuccess($returnUsers)) { $viewData = array( @@ -53,7 +59,7 @@ class PrestudentMultiAssign extends FHC_Controller 'stufe' => $stufe, 'users' => $users ); - + $this->load->view('system/aufnahme/prestudentMultiAssign', $viewData); } else if (isError($returnUsers)) @@ -61,7 +67,7 @@ class PrestudentMultiAssign extends FHC_Controller show_error($returnUsers->retval); } } - + /** * To assign a stufe to one or more prestudents */ @@ -69,16 +75,16 @@ class PrestudentMultiAssign extends FHC_Controller { $prestudentIdArray = $this->input->post('prestudent_id'); $stufe = $this->input->post('stufe'); - + // Converts string 'null' to a null value $stufe = ($stufe == 'null' ? null : $stufe); - + // Load model PrestudentstatusModel $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); - + // Set the HTTP header $this->output->set_header('Content-Type: application/json; charset=utf-8'); - + $result = error("No valid parameters"); if (isset($stufe) && isset($prestudentIdArray) @@ -86,7 +92,7 @@ class PrestudentMultiAssign extends FHC_Controller && count($prestudentIdArray) > 0) { $result = $this->PrestudentstatusModel->updateStufe($prestudentIdArray, $stufe); - + if (isSuccess($result)) { echo '{"msg": "Data correctly saved"}'; @@ -101,7 +107,7 @@ class PrestudentMultiAssign extends FHC_Controller echo '{"msg": "'.$result->retval.'"}'; } } - + /** * To assign one or more prestudents to a gruppe */ @@ -109,16 +115,16 @@ class PrestudentMultiAssign extends FHC_Controller { $prestudentIdArray = $this->input->post('prestudent_id'); $aufnahmegruppe = $this->input->post('aufnahmegruppe'); - + // Converts string 'null' to a null value $aufnahmegruppe = ($aufnahmegruppe == 'null' ? null : $aufnahmegruppe); - + // Load model PrestudentstatusModel $this->load->model('crm/Prestudent_model', 'PrestudentModel'); - + // Set the HTTP header $this->output->set_header('Content-Type: application/json; charset=utf-8'); - + $result = error("No valid parameters"); if (isset($aufnahmegruppe) && isset($prestudentIdArray) @@ -126,7 +132,7 @@ class PrestudentMultiAssign extends FHC_Controller && count($prestudentIdArray) > 0) { $result = $this->PrestudentModel->updateAufnahmegruppe($prestudentIdArray, $aufnahmegruppe); - + if (isSuccess($result)) { echo '{"msg": "Data correctly saved"}'; @@ -141,7 +147,7 @@ class PrestudentMultiAssign extends FHC_Controller echo '{"msg": "'.$result->retval.'"}'; } } - + /** * Get the prestudents using search parameters */ @@ -149,32 +155,32 @@ class PrestudentMultiAssign extends FHC_Controller { // Load model prestudentm_model $this->load->model('crm/Prestudent_model', 'PrestudentModel'); - + if ($studiengang == '' || empty($studiengang)) { $studiengang = null; } - + if ($studiensemester == '' || empty($studiensemester)) { $studiensemester = null; } - + if ($aufnahmegruppe == '' || empty($aufnahmegruppe)) { $aufnahmegruppe = null; } - + if ($reihungstest == '' || empty($reihungstest)) { $reihungstest = null; } - + if ($stufe == '' || empty($stufe)) { $stufe = null; } - + return $this->PrestudentModel->getPrestudentMultiAssign( $studiengang, $studiensemester, @@ -183,4 +189,4 @@ class PrestudentMultiAssign extends FHC_Controller $stufe ); } -} \ No newline at end of file +} diff --git a/application/controllers/system/extensions/Manager.php b/application/controllers/system/extensions/Manager.php index cdd88b26e..9cc076c4b 100644 --- a/application/controllers/system/extensions/Manager.php +++ b/application/controllers/system/extensions/Manager.php @@ -12,7 +12,14 @@ class Manager extends FHC_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'system/extensions:r', + 'toggleExtension' => 'system/extensions:w', + 'delExtension' => 'system/extensions:w', + 'uploadExtension' => 'system/extensions:w' + ) + ); // Load helpers to upload files $this->load->helper(array('form', 'url')); diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index bd7678fb6..96f423b7d 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -51,7 +51,22 @@ class InfoCenter extends FHC_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'infocenter:r', + 'showDetails' => 'infocenter:r', + 'unlockPerson' => 'infocenter:w', + 'saveFormalGeprueft' => 'infocenter:w', + 'getLastPrestudentWithZgvJson' => 'infocenter:r', + 'saveZgvPruefung' => 'infocenter:w', + 'saveAbsage' => 'infocenter:w', + 'saveFreigabe' => 'infocenter:w', + 'saveNotiz' => 'infocenter:w', + 'reloadNotizen' => 'infocenter:r', + 'reloadLogs' => 'infocenter:r', + 'outputAkteContent' => 'infocenter:r' + ) + ); // Loads models $this->load->model('crm/akte_model', 'AkteModel'); From e4a254a284c2f3152c12b59a333a977470858604 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 22 Mar 2018 17:13:12 +0100 Subject: [PATCH 05/48] Fixed permissions: now all the controllers that extend FHC_Controller and need the write permission, have added the read permission It it a workaroud for GET/POST checks --- application/controllers/crm/Statusgrund.php | 12 ++++++------ .../controllers/organisation/Studienjahr.php | 10 +++++----- .../organisation/Studiensemester.php | 10 +++++----- application/controllers/system/Messages.php | 4 ++-- application/controllers/system/Phrases.php | 14 +++++++------- application/controllers/system/UDF.php | 2 +- application/controllers/system/Vorlage.php | 18 +++++++++--------- .../system/aufnahme/PrestudentMultiAssign.php | 4 ++-- .../controllers/system/extensions/Manager.php | 6 +++--- .../system/infocenter/InfoCenter.php | 12 ++++++------ application/views/system/phrasesinhaltList.php | 6 +++--- .../views/system/vorlage/templatetextList.php | 6 +++--- 12 files changed, 52 insertions(+), 52 deletions(-) diff --git a/application/controllers/crm/Statusgrund.php b/application/controllers/crm/Statusgrund.php index 7a399b4aa..ade052252 100644 --- a/application/controllers/crm/Statusgrund.php +++ b/application/controllers/crm/Statusgrund.php @@ -11,12 +11,12 @@ class Statusgrund extends FHC_Controller 'index' => 'basis/status:r', 'listStatus' => 'basis/status:r', 'listGrund' => 'basis/status:r', - 'editGrund' => 'basis/status:w', - 'editStatus' => 'basis/status:w', - 'newGrund' => 'basis/status:w', - 'saveGrund' => 'basis/status:w', - 'insGrund' => 'basis/status:w', - 'saveStatus' => 'basis/status:w' + 'editGrund' => 'basis/status:rw', + 'editStatus' => 'basis/status:rw', + 'newGrund' => 'basis/status:rw', + 'saveGrund' => 'basis/status:rw', + 'insGrund' => 'basis/status:rw', + 'saveStatus' => 'basis/status:rw' ) ); diff --git a/application/controllers/organisation/Studienjahr.php b/application/controllers/organisation/Studienjahr.php index 899271960..7d5d752cb 100644 --- a/application/controllers/organisation/Studienjahr.php +++ b/application/controllers/organisation/Studienjahr.php @@ -17,11 +17,11 @@ class Studienjahr extends FHC_Controller parent::__construct( array( 'listStudienjahr' => 'basis/studiensemester:r', - 'editStudienjahr' => 'basis/studiensemester:w', - 'newStudienjahr' => 'basis/studiensemester:w', - 'insStudienjahr' => 'basis/studiensemester:w', - 'saveStudienjahr' => 'basis/studiensemester:w', - 'deleteStudienjahr' => 'basis/studiensemester:w' + 'editStudienjahr' => 'basis/studiensemester:rw', + 'newStudienjahr' => 'basis/studiensemester:rw', + 'insStudienjahr' => 'basis/studiensemester:rw', + 'saveStudienjahr' => 'basis/studiensemester:rw', + 'deleteStudienjahr' => 'basis/studiensemester:rw' ) ); diff --git a/application/controllers/organisation/Studiensemester.php b/application/controllers/organisation/Studiensemester.php index 0021a6d9b..8d8eeae64 100644 --- a/application/controllers/organisation/Studiensemester.php +++ b/application/controllers/organisation/Studiensemester.php @@ -17,11 +17,11 @@ class Studiensemester extends FHC_Controller parent::__construct( array( 'listStudiensemester' => 'basis/studiensemester:r', - 'editStudiensemester' => 'basis/studiensemester:w', - 'newStudiensemester' => 'basis/studiensemester:w', - 'insStudiensemester' => 'basis/studiensemester:w', - 'saveStudiensemester' => 'basis/studiensemester:w', - 'deleteStudiensemester' => 'basis/studiensemester:w' + 'editStudiensemester' => 'basis/studiensemester:rw', + 'newStudiensemester' => 'basis/studiensemester:rw', + 'insStudiensemester' => 'basis/studiensemester:rw', + 'saveStudiensemester' => 'basis/studiensemester:rw', + 'deleteStudiensemester' => 'basis/studiensemester:rw' ) ); diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index 11f7e5a2f..8af20368c 100644 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -13,8 +13,8 @@ class Messages extends FHC_Controller { parent::__construct( array( - 'write' => array('basis/message:w', 'infocenter:w'), - 'send' => array('basis/message:w', 'infocenter:w'), + 'write' => array('basis/message:rw', 'infocenter:rw'), + 'send' => array('basis/message:rw', 'infocenter:rw'), 'getVorlage' => array('basis/message:r', 'infocenter:r'), 'parseMessageText' => array('basis/message:r', 'infocenter:r'), 'getMessageFromIds' => array('basis/message:r', 'infocenter:r') diff --git a/application/controllers/system/Phrases.php b/application/controllers/system/Phrases.php index e4262ae3d..1dfbcab52 100644 --- a/application/controllers/system/Phrases.php +++ b/application/controllers/system/Phrases.php @@ -11,13 +11,13 @@ class Phrases extends FHC_Controller 'index' => 'system/phrase:r', 'table' => 'system/phrase:r', 'view' => 'system/phrase:r', - 'deltext' => 'system/phrase:w', - 'edit' => 'system/phrase:w', - 'write' => 'system/phrase:w', - 'save' => 'system/phrase:w', - 'newText' => 'system/phrase:w', - 'editText' => 'system/phrase:w', - 'saveText' => 'system/phrase:w' + 'deltext' => 'system/phrase:rw', + 'edit' => 'system/phrase:rw', + 'write' => 'system/phrase:rw', + 'save' => 'system/phrase:rw', + 'newText' => 'system/phrase:rw', + 'editText' => 'system/phrase:rw', + 'saveText' => 'system/phrase:rw' ) ); diff --git a/application/controllers/system/UDF.php b/application/controllers/system/UDF.php index c86c00505..304ca166b 100644 --- a/application/controllers/system/UDF.php +++ b/application/controllers/system/UDF.php @@ -9,7 +9,7 @@ class UDF extends FHC_Controller parent::__construct( array( 'index' => 'basis/person:r', - 'saveUDF' => 'basis/person:w' + 'saveUDF' => 'basis/person:rw' ) ); diff --git a/application/controllers/system/Vorlage.php b/application/controllers/system/Vorlage.php index a25d8c3bc..9e53474df 100644 --- a/application/controllers/system/Vorlage.php +++ b/application/controllers/system/Vorlage.php @@ -11,16 +11,16 @@ class Vorlage extends FHC_Controller 'index' => 'system/vorlage:r', 'table' => 'system/vorlage:r', 'view' => 'system/vorlage:r', - 'edit' => 'system/vorlage:w', - 'write' => 'system/vorlage:w', - 'save' => 'system/vorlage:w', - 'newText' => 'system/vorlage:w', - 'editText' => 'system/vorlage:w', - 'newText' => 'system/vorlage:w', + 'edit' => 'system/vorlage:rw', + 'write' => 'system/vorlage:rw', + 'save' => 'system/vorlage:rw', + 'newText' => 'system/vorlage:rw', + 'editText' => 'system/vorlage:rw', + 'newText' => 'system/vorlage:rw', 'linkDocuments' => 'system/vorlage:r', - 'saveDocuments' => 'system/vorlage:w', - 'deleteDocumentLink' => 'system/vorlage:w', - 'saveText' => 'system/vorlage:w', + 'saveDocuments' => 'system/vorlage:rw', + 'deleteDocumentLink' => 'system/vorlage:rw', + 'saveText' => 'system/vorlage:rw', 'preview' => 'system/vorlage:r' ) ); diff --git a/application/controllers/system/aufnahme/PrestudentMultiAssign.php b/application/controllers/system/aufnahme/PrestudentMultiAssign.php index 08a74bb0a..addde4d6a 100644 --- a/application/controllers/system/aufnahme/PrestudentMultiAssign.php +++ b/application/controllers/system/aufnahme/PrestudentMultiAssign.php @@ -9,8 +9,8 @@ class PrestudentMultiAssign extends FHC_Controller parent::__construct( array( 'index' => 'basis/student:r', - 'linkToStufe' => 'basis/student:w', - 'linkToAufnahmegruppe' => 'basis/student:w' + 'linkToStufe' => 'basis/student:rw', + 'linkToAufnahmegruppe' => 'basis/student:rw' ) ); diff --git a/application/controllers/system/extensions/Manager.php b/application/controllers/system/extensions/Manager.php index 9cc076c4b..f13040918 100644 --- a/application/controllers/system/extensions/Manager.php +++ b/application/controllers/system/extensions/Manager.php @@ -15,9 +15,9 @@ class Manager extends FHC_Controller parent::__construct( array( 'index' => 'system/extensions:r', - 'toggleExtension' => 'system/extensions:w', - 'delExtension' => 'system/extensions:w', - 'uploadExtension' => 'system/extensions:w' + 'toggleExtension' => 'system/extensions:rw', + 'delExtension' => 'system/extensions:rw', + 'uploadExtension' => 'system/extensions:rw' ) ); diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 96f423b7d..c034c8942 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -55,13 +55,13 @@ class InfoCenter extends FHC_Controller array( 'index' => 'infocenter:r', 'showDetails' => 'infocenter:r', - 'unlockPerson' => 'infocenter:w', - 'saveFormalGeprueft' => 'infocenter:w', + 'unlockPerson' => 'infocenter:rw', + 'saveFormalGeprueft' => 'infocenter:rw', 'getLastPrestudentWithZgvJson' => 'infocenter:r', - 'saveZgvPruefung' => 'infocenter:w', - 'saveAbsage' => 'infocenter:w', - 'saveFreigabe' => 'infocenter:w', - 'saveNotiz' => 'infocenter:w', + 'saveZgvPruefung' => 'infocenter:rw', + 'saveAbsage' => 'infocenter:rw', + 'saveFreigabe' => 'infocenter:rw', + 'saveNotiz' => 'infocenter:rw', 'reloadNotizen' => 'infocenter:r', 'reloadLogs' => 'infocenter:r', 'outputAkteContent' => 'infocenter:r' diff --git a/application/views/system/phrasesinhaltList.php b/application/views/system/phrasesinhaltList.php index 5938fcc94..f212d440f 100644 --- a/application/views/system/phrasesinhaltList.php +++ b/application/views/system/phrasesinhaltList.php @@ -5,7 +5,7 @@

Phrase Inhalt -

-
+
@@ -24,13 +24,13 @@ - phrasentext_id; ?> + phrasentext_id; ?> sprache; ?> orgeinheit_kurzbz; ?> orgform_kurzbz; ?> text; ?> description; ?> - edit + edit delete diff --git a/application/views/system/vorlage/templatetextList.php b/application/views/system/vorlage/templatetextList.php index 7eb2b84e3..8736b36ee 100644 --- a/application/views/system/vorlage/templatetextList.php +++ b/application/views/system/vorlage/templatetextList.php @@ -5,7 +5,7 @@

Vorlagentext -

-
+
@@ -28,8 +28,8 @@ - vorlagestudiengang_id; ?> - vorlage_kurzbz; ?> + vorlagestudiengang_id; ?> + vorlage_kurzbz; ?> version; ?> oe_kurzbz; ?> From 1fcc878cb51eadf2527e601bd1024cba332e54aa Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 28 Mar 2018 12:09:54 +0200 Subject: [PATCH 06/48] Added permissions array to every controller that extends APIv1_Controller CheckUserAuth and Test controllers now extends directly the REST_Controller --- .../controllers/api/v1/CheckUserAuth.php | 4 +- application/controllers/api/v1/Test.php | 7 +- .../api/v1/accounting/Aufteilung.php | 12 +-- .../api/v1/accounting/Bestelldetail.php | 12 +-- .../api/v1/accounting/Bestelldetailtag.php | 12 +-- .../api/v1/accounting/Bestellstatus.php | 12 +-- .../api/v1/accounting/Bestellung.php | 12 +-- .../api/v1/accounting/Bestellungtag.php | 12 +-- .../controllers/api/v1/accounting/Buchung.php | 12 +-- .../api/v1/accounting/Buchungstyp.php | 12 +-- .../controllers/api/v1/accounting/Budget.php | 12 +-- .../controllers/api/v1/accounting/Konto.php | 12 +-- .../api/v1/accounting/Kostenstelle.php | 12 +-- .../api/v1/accounting/Rechnung.php | 12 +-- .../api/v1/accounting/Rechnungsbetrag.php | 12 +-- .../api/v1/accounting/Rechnungstyp.php | 12 +-- .../controllers/api/v1/accounting/Vertrag.php | 12 +-- .../api/v1/accounting/Vertragsstatus.php | 12 +-- .../api/v1/accounting/Vertragstyp.php | 12 +-- .../api/v1/accounting/Zahlungstyp.php | 12 +-- .../controllers/api/v1/codex/Akadgrad.php | 12 +-- .../controllers/api/v1/codex/Archiv.php | 12 +-- .../api/v1/codex/Aufmerksamdurch.php | 12 +-- .../controllers/api/v1/codex/Ausbildung.php | 12 +-- .../api/v1/codex/Berufstaetigkeit.php | 12 +-- .../api/v1/codex/Beschaeftigungsausmass.php | 12 +-- .../controllers/api/v1/codex/Besqual.php | 12 +-- .../controllers/api/v1/codex/Bisfunktion.php | 12 +-- .../controllers/api/v1/codex/Bisio.php | 12 +-- .../controllers/api/v1/codex/Bisorgform.php | 12 +-- .../api/v1/codex/Bisverwendung.php | 12 +-- .../controllers/api/v1/codex/Bundesland.php | 2 +- .../api/v1/codex/Entwicklungsteam.php | 12 +-- .../controllers/api/v1/codex/Gemeinde.php | 18 ++-- .../controllers/api/v1/codex/Hauptberuf.php | 12 +-- .../controllers/api/v1/codex/Lehrform.php | 12 +-- .../controllers/api/v1/codex/Lgartcode.php | 12 +-- .../api/v1/codex/Mobilitaetsprogramm.php | 12 +-- .../controllers/api/v1/codex/Nation.php | 2 +- application/controllers/api/v1/codex/Note.php | 12 +-- .../controllers/api/v1/codex/Orgform.php | 20 ++-- .../controllers/api/v1/codex/Verwendung.php | 12 +-- application/controllers/api/v1/codex/Zgv.php | 12 +-- .../controllers/api/v1/codex/Zgvdoktor.php | 12 +-- .../controllers/api/v1/codex/Zgvgruppe.php | 12 +-- .../controllers/api/v1/codex/Zgvmaster.php | 12 +-- .../controllers/api/v1/codex/Zweck.php | 12 +-- .../controllers/api/v1/content/Ampel.php | 12 +-- .../controllers/api/v1/content/Content.php | 12 +-- .../api/v1/content/Contentchild.php | 12 +-- .../api/v1/content/Contentgruppe.php | 12 +-- .../controllers/api/v1/content/Contentlog.php | 12 +-- .../api/v1/content/Contentsprache.php | 12 +-- .../controllers/api/v1/content/Dms.php | 44 ++++----- .../controllers/api/v1/content/Infoscreen.php | 12 +-- .../controllers/api/v1/content/News.php | 12 +-- .../controllers/api/v1/content/Template.php | 12 +-- .../api/v1/content/Veranstaltung.php | 12 +-- .../v1/content/Veranstaltungskategorie.php | 12 +-- application/controllers/api/v1/crm/Akte.php | 30 +++--- .../api/v1/crm/Aufnahmeschluessel.php | 16 +-- .../controllers/api/v1/crm/Aufnahmetermin.php | 16 +-- .../api/v1/crm/Aufnahmetermintyp.php | 16 +-- .../api/v1/crm/Bewerbungstermine.php | 11 ++- .../controllers/api/v1/crm/Buchungstyp.php | 16 +-- .../controllers/api/v1/crm/Dokument.php | 12 +-- .../api/v1/crm/Dokumentprestudent.php | 26 +++-- .../api/v1/crm/Dokumentstudiengang.php | 23 +++-- application/controllers/api/v1/crm/Konto.php | 16 +-- .../controllers/api/v1/crm/Preincoming.php | 16 +-- .../controllers/api/v1/crm/Preinteressent.php | 26 ++--- .../api/v1/crm/Preinteressentstudiengang.php | 16 +-- .../controllers/api/v1/crm/Preoutgoing.php | 16 +-- .../controllers/api/v1/crm/Prestudent.php | 13 ++- .../api/v1/crm/Prestudentstatus.php | 8 +- .../controllers/api/v1/crm/Reihungstest.php | 39 +++++--- .../controllers/api/v1/crm/RtPerson.php | 12 +-- application/controllers/api/v1/crm/Status.php | 16 +-- .../controllers/api/v1/crm/Statusgrund.php | 12 +-- .../controllers/api/v1/crm/Student.php | 16 +-- .../controllers/api/v1/education/Abgabe.php | 12 +-- .../api/v1/education/Abschlussbeurteilung.php | 12 +-- .../api/v1/education/Abschlusspruefung.php | 12 +-- .../api/v1/education/Anrechnung.php | 12 +-- .../api/v1/education/Anwesenheit.php | 12 +-- .../controllers/api/v1/education/Beispiel.php | 12 +-- .../api/v1/education/Betreuerart.php | 12 +-- .../controllers/api/v1/education/Feedback.php | 12 +-- .../api/v1/education/Legesamtnote.php | 12 +-- .../api/v1/education/Lehreinheit.php | 12 +-- .../api/v1/education/Lehreinheitgruppe.php | 12 +-- .../v1/education/Lehreinheitmitarbeiter.php | 12 +-- .../controllers/api/v1/education/Lehrfach.php | 12 +-- .../api/v1/education/Lehrfunktion.php | 12 +-- .../controllers/api/v1/education/Lehrtyp.php | 12 +-- .../api/v1/education/Lehrveranstaltung.php | 12 +-- .../api/v1/education/Lenotenschluessel.php | 16 +-- .../api/v1/education/Lepruefung.php | 12 +-- .../api/v1/education/Lvangebot.php | 12 +-- .../api/v1/education/Lvgesamtnote.php | 14 +-- .../controllers/api/v1/education/Lvinfo.php | 12 +-- .../controllers/api/v1/education/Lvregel.php | 12 +-- .../api/v1/education/Lvregeltyp.php | 12 +-- .../api/v1/education/Notenschluessel.php | 12 +-- .../education/Notenschluesselaufteilung.php | 12 +-- .../v1/education/Notenschluesseluebung.php | 12 +-- .../v1/education/Notenschluesselzuordnung.php | 12 +-- .../controllers/api/v1/education/Paabgabe.php | 12 +-- .../api/v1/education/Paabgabetyp.php | 12 +-- .../api/v1/education/Projektarbeit.php | 12 +-- .../api/v1/education/Projektbetreuer.php | 14 +-- .../api/v1/education/Projekttyp.php | 12 +-- .../controllers/api/v1/education/Pruefung.php | 12 +-- .../api/v1/education/Pruefungsanmeldung.php | 12 +-- .../api/v1/education/Pruefungsfenster.php | 12 +-- .../api/v1/education/Pruefungsstatus.php | 12 +-- .../api/v1/education/Pruefungstermin.php | 12 +-- .../api/v1/education/Pruefungstyp.php | 12 +-- .../api/v1/education/Studentbeispiel.php | 12 +-- .../api/v1/education/Studentlehrverband.php | 12 +-- .../api/v1/education/Studentuebung.php | 12 +-- .../controllers/api/v1/education/Uebung.php | 12 +-- .../controllers/api/v1/education/Zeugnis.php | 12 +-- .../api/v1/education/Zeugnisnote.php | 14 +-- .../api/v1/organisation/Erhalter.php | 16 +-- .../api/v1/organisation/Fachbereich2.php | 16 +-- .../api/v1/organisation/Ferien.php | 16 +-- .../api/v1/organisation/Geschaeftsjahr2.php | 16 +-- .../api/v1/organisation/Gruppe.php | 16 +-- .../api/v1/organisation/Lehrverband.php | 18 ++-- .../v1/organisation/Organisationseinheit2.php | 16 +-- .../organisation/Organisationseinheittyp.php | 16 +-- .../api/v1/organisation/Semesterwochen.php | 16 +-- .../api/v1/organisation/Service.php | 16 +-- .../api/v1/organisation/Standort.php | 16 +-- .../api/v1/organisation/Statistik.php | 34 ++++--- .../api/v1/organisation/Studiengang2.php | 12 ++- .../api/v1/organisation/Studiengangstyp.php | 16 +-- .../api/v1/organisation/Studienjahr.php | 16 +-- .../api/v1/organisation/Studienordnung.php | 16 +-- .../v1/organisation/Studienordnungstatus.php | 16 +-- .../api/v1/organisation/Studienplan.php | 28 +++--- .../api/v1/organisation/Studienplatz.php | 16 +-- .../api/v1/organisation/Studiensemester.php | 98 +++++++++++-------- .../controllers/api/v1/person/Adresse.php | 18 ++-- .../api/v1/person/Bankverbindung.php | 16 +-- .../controllers/api/v1/person/Benutzer.php | 16 +-- .../api/v1/person/Benutzerfunktion.php | 16 +-- .../api/v1/person/Benutzergruppe.php | 16 +-- .../controllers/api/v1/person/Fotostatus.php | 16 +-- .../controllers/api/v1/person/Freebusy.php | 16 +-- .../controllers/api/v1/person/Freebusytyp.php | 16 +-- .../controllers/api/v1/person/Kontakt.php | 48 +++++---- .../api/v1/person/Kontaktmedium.php | 16 +-- .../controllers/api/v1/person/Kontakttyp.php | 16 +-- .../controllers/api/v1/person/Notiz.php | 16 +-- .../api/v1/person/Notizzuordnung.php | 16 +-- .../controllers/api/v1/person/Person.php | 36 +++---- .../controllers/api/v1/project/Aktivitaet.php | 16 +-- .../api/v1/project/Aufwandstyp.php | 16 +-- .../controllers/api/v1/project/Projekt.php | 16 +-- .../api/v1/project/Projekt_ressource.php | 16 +-- .../api/v1/project/Projektphase.php | 16 +-- .../api/v1/project/Projekttask.php | 16 +-- .../controllers/api/v1/project/Ressource.php | 16 +-- .../api/v1/project/Scrumsprint.php | 16 +-- .../api/v1/ressource/Betriebsmittel.php | 16 +-- .../v1/ressource/Betriebsmittelperson2.php | 16 +-- .../api/v1/ressource/Betriebsmittelstatus.php | 16 +-- .../api/v1/ressource/Betriebsmitteltyp.php | 16 +-- .../controllers/api/v1/ressource/Coodle.php | 16 +-- .../api/v1/ressource/Erreichbarkeit.php | 16 +-- .../controllers/api/v1/ressource/Firma.php | 16 +-- .../controllers/api/v1/ressource/Firmatag.php | 16 +-- .../api/v1/ressource/Firmentyp.php | 16 +-- .../controllers/api/v1/ressource/Funktion.php | 16 +-- .../api/v1/ressource/Lehrmittel.php | 16 +-- .../api/v1/ressource/Mitarbeiter.php | 16 +-- .../controllers/api/v1/ressource/Ort.php | 16 +-- .../api/v1/ressource/Ortraumtyp.php | 16 +-- .../v1/ressource/Personfunktionstandort.php | 16 +-- .../controllers/api/v1/ressource/Raumtyp.php | 16 +-- .../api/v1/ressource/Reservierung.php | 16 +-- .../controllers/api/v1/ressource/Stunde.php | 16 +-- .../api/v1/ressource/Stundenplan.php | 16 +-- .../api/v1/ressource/Stundenplandev.php | 16 +-- .../api/v1/ressource/Zeitaufzeichnung.php | 16 +-- .../api/v1/ressource/Zeitfenster.php | 18 ++-- .../api/v1/ressource/Zeitsperre.php | 16 +-- .../api/v1/ressource/Zeitsperretyp.php | 16 +-- .../api/v1/ressource/Zeitwunsch.php | 18 ++-- .../controllers/api/v1/system/Appdaten.php | 12 +-- .../api/v1/system/Benutzerrolle.php | 16 +-- .../api/v1/system/Berechtigung.php | 16 +-- .../api/v1/system/CallerLibrary.php | 10 +- .../controllers/api/v1/system/CallerModel.php | 10 +- .../controllers/api/v1/system/Cronjob.php | 16 +-- .../controllers/api/v1/system/Filter.php | 16 +-- application/controllers/api/v1/system/Log.php | 16 +-- .../controllers/api/v1/system/Message.php | 13 ++- .../controllers/api/v1/system/Phrase.php | 18 ++-- .../controllers/api/v1/system/Rolle.php | 16 +-- .../api/v1/system/Rolleberechtigung.php | 16 +-- .../controllers/api/v1/system/Server.php | 16 +-- .../controllers/api/v1/system/Sprache2.php | 14 +-- application/controllers/api/v1/system/Tag.php | 16 +-- application/controllers/api/v1/system/UDF.php | 36 +++---- .../controllers/api/v1/system/Variable.php | 16 +-- .../controllers/api/v1/system/Vorlage.php | 16 +-- .../api/v1/system/Vorlagestudiengang.php | 16 +-- .../api/v1/system/Webservicelog.php | 16 +-- .../api/v1/system/Webservicerecht.php | 16 +-- .../api/v1/system/Webservicetyp.php | 16 +-- .../controllers/api/v1/testtool/Ablauf.php | 16 +-- .../controllers/api/v1/testtool/Antwort.php | 16 +-- .../controllers/api/v1/testtool/Frage.php | 16 +-- .../controllers/api/v1/testtool/Gebiet.php | 16 +-- .../controllers/api/v1/testtool/Kategorie.php | 16 +-- .../controllers/api/v1/testtool/Kriterien.php | 16 +-- .../controllers/api/v1/testtool/Pruefling.php | 16 +-- .../controllers/api/v1/testtool/Vorschlag.php | 16 +-- 221 files changed, 1728 insertions(+), 1624 deletions(-) diff --git a/application/controllers/api/v1/CheckUserAuth.php b/application/controllers/api/v1/CheckUserAuth.php index ac4195808..1221e6765 100644 --- a/application/controllers/api/v1/CheckUserAuth.php +++ b/application/controllers/api/v1/CheckUserAuth.php @@ -14,7 +14,9 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class CheckUserAuth extends APIv1_Controller +require_once APPPATH.'/libraries/REST_Controller.php'; + +class CheckUserAuth extends REST_Controller { /** * Course API constructor. diff --git a/application/controllers/api/v1/Test.php b/application/controllers/api/v1/Test.php index fd1896560..b9eacd5f9 100644 --- a/application/controllers/api/v1/Test.php +++ b/application/controllers/api/v1/Test.php @@ -2,14 +2,19 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); +require_once APPPATH.'/libraries/REST_Controller.php'; + /** * Testing class for REST calls and authentication */ -class Test extends APIv1_Controller +class Test extends REST_Controller { public function __construct() { parent::__construct(); + + // Loads return messages + $this->load->helper('message'); } /** diff --git a/application/controllers/api/v1/accounting/Aufteilung.php b/application/controllers/api/v1/accounting/Aufteilung.php index 6c374ba17..cc9c2826f 100644 --- a/application/controllers/api/v1/accounting/Aufteilung.php +++ b/application/controllers/api/v1/accounting/Aufteilung.php @@ -21,7 +21,7 @@ class Aufteilung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufteilung' => 'basis/aufteilung:rw')); // Load model AufteilungModel $this->load->model('accounting/aufteilung_model', 'AufteilungModel'); } @@ -32,11 +32,11 @@ class Aufteilung extends APIv1_Controller public function getAufteilung() { $aufteilungID = $this->get('aufteilung_id'); - + if (isset($aufteilungID)) { $result = $this->AufteilungModel->load($aufteilungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Aufteilung extends APIv1_Controller { $result = $this->AufteilungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Aufteilung extends APIv1_Controller $this->response(); } } - + private function _validate($aufteilung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Bestelldetail.php b/application/controllers/api/v1/accounting/Bestelldetail.php index 6cc7d8767..191ba95a0 100644 --- a/application/controllers/api/v1/accounting/Bestelldetail.php +++ b/application/controllers/api/v1/accounting/Bestelldetail.php @@ -21,7 +21,7 @@ class Bestelldetail extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestelldetail' => 'basis/bestelldetail:rw')); // Load model BestelldetailModel $this->load->model('accounting/bestelldetail_model', 'BestelldetailModel'); } @@ -32,11 +32,11 @@ class Bestelldetail extends APIv1_Controller public function getBestelldetail() { $bestelldetailID = $this->get('bestelldetail_id'); - + if (isset($bestelldetailID)) { $result = $this->BestelldetailModel->load($bestelldetailID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bestelldetail extends APIv1_Controller { $result = $this->BestelldetailModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bestelldetail extends APIv1_Controller $this->response(); } } - + private function _validate($bestelldetail = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Bestelldetailtag.php b/application/controllers/api/v1/accounting/Bestelldetailtag.php index 064594f39..36229d47c 100644 --- a/application/controllers/api/v1/accounting/Bestelldetailtag.php +++ b/application/controllers/api/v1/accounting/Bestelldetailtag.php @@ -21,7 +21,7 @@ class Bestelldetailtag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestelldetailtag' => 'basis/bestelldetailtag:rw')); // Load model BestelldetailtagModel $this->load->model('accounting/bestelldetailtag_model', 'BestelldetailtagModel'); } @@ -33,11 +33,11 @@ class Bestelldetailtag extends APIv1_Controller { $bestelldetail_id = $this->get('bestelldetail_id'); $tag = $this->get('tag'); - + if (isset($bestelldetail_id) && isset($tag)) { $result = $this->BestelldetailtagModel->load(array($bestelldetail_id, $tag)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Bestelldetailtag extends APIv1_Controller { $result = $this->BestelldetailtagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Bestelldetailtag extends APIv1_Controller $this->response(); } } - + private function _validate($bestelldetailtag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Bestellstatus.php b/application/controllers/api/v1/accounting/Bestellstatus.php index 85408c820..dc3695ff2 100644 --- a/application/controllers/api/v1/accounting/Bestellstatus.php +++ b/application/controllers/api/v1/accounting/Bestellstatus.php @@ -21,7 +21,7 @@ class Bestellstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestellstatus' => 'basis/bestellstatus:rw')); // Load model BestellstatusModel $this->load->model('accounting/bestellstatus_model', 'BestellstatusModel'); } @@ -32,11 +32,11 @@ class Bestellstatus extends APIv1_Controller public function getBestellstatus() { $bestellstatus_kurzbz = $this->get('bestellstatus_kurzbz'); - + if (isset($bestellstatus_kurzbz)) { $result = $this->BestellstatusModel->load($bestellstatus_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bestellstatus extends APIv1_Controller { $result = $this->BestellstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bestellstatus extends APIv1_Controller $this->response(); } } - + private function _validate($bestellstatus = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Bestellung.php b/application/controllers/api/v1/accounting/Bestellung.php index 984b5b89b..018b77180 100644 --- a/application/controllers/api/v1/accounting/Bestellung.php +++ b/application/controllers/api/v1/accounting/Bestellung.php @@ -21,7 +21,7 @@ class Bestellung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestellung' => 'basis/bestellung:rw')); // Load model BestellungModel $this->load->model('accounting/bestellung_model', 'BestellungModel'); } @@ -32,11 +32,11 @@ class Bestellung extends APIv1_Controller public function getBestellung() { $bestellungID = $this->get('bestellung_id'); - + if (isset($bestellungID)) { $result = $this->BestellungModel->load($bestellungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bestellung extends APIv1_Controller { $result = $this->BestellungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bestellung extends APIv1_Controller $this->response(); } } - + private function _validate($bestellung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Bestellungtag.php b/application/controllers/api/v1/accounting/Bestellungtag.php index c8d715a5b..7b404fa05 100644 --- a/application/controllers/api/v1/accounting/Bestellungtag.php +++ b/application/controllers/api/v1/accounting/Bestellungtag.php @@ -21,7 +21,7 @@ class Bestellungtag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestellungtag' => 'basis/bestellungtag:rw')); // Load model BestellungtagModel $this->load->model('accounting/bestellungtag_model', 'BestellungtagModel'); } @@ -33,11 +33,11 @@ class Bestellungtag extends APIv1_Controller { $bestellung_id = $this->get('bestellung_id'); $tag = $this->get('tag'); - + if (isset($bestellung_id) && isset($tag)) { $result = $this->BestellungtagModel->load(array($bestellung_id, $tag)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Bestellungtag extends APIv1_Controller { $result = $this->BestellungtagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Bestellungtag extends APIv1_Controller $this->response(); } } - + private function _validate($bestellungtag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Buchung.php b/application/controllers/api/v1/accounting/Buchung.php index d40974a88..12fa02c33 100644 --- a/application/controllers/api/v1/accounting/Buchung.php +++ b/application/controllers/api/v1/accounting/Buchung.php @@ -21,7 +21,7 @@ class Buchung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Buchung' => 'basis/buchung:r')); // Load model BuchungModel $this->load->model('accounting/buchung_model', 'BuchungModel'); } @@ -32,11 +32,11 @@ class Buchung extends APIv1_Controller public function getBuchung() { $buchungID = $this->get('buchung_id'); - + if (isset($buchungID)) { $result = $this->BuchungModel->load($buchungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Buchung extends APIv1_Controller { $result = $this->BuchungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Buchung extends APIv1_Controller $this->response(); } } - + private function _validate($buchung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Buchungstyp.php b/application/controllers/api/v1/accounting/Buchungstyp.php index 50efa179f..3e9718469 100644 --- a/application/controllers/api/v1/accounting/Buchungstyp.php +++ b/application/controllers/api/v1/accounting/Buchungstyp.php @@ -21,7 +21,7 @@ class Buchungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Buchungstyp' => 'basis/buchungstyp:rw')); // Load model BuchungstypModel $this->load->model('accounting/buchungstyp_model', 'BuchungstypModel'); } @@ -32,11 +32,11 @@ class Buchungstyp extends APIv1_Controller public function getBuchungstyp() { $buchungstyp_kurzbz = $this->get('buchungstyp_kurzbz'); - + if (isset($buchungstyp_kurzbz)) { $result = $this->BuchungstypModel->load($buchungstyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Buchungstyp extends APIv1_Controller { $result = $this->BuchungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Buchungstyp extends APIv1_Controller $this->response(); } } - + private function _validate($buchungstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Budget.php b/application/controllers/api/v1/accounting/Budget.php index 2af229a5f..31ee3ef1c 100644 --- a/application/controllers/api/v1/accounting/Budget.php +++ b/application/controllers/api/v1/accounting/Budget.php @@ -21,7 +21,7 @@ class Budget extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Budget' => 'basis/budget:rw')); // Load model BudgetModel $this->load->model('accounting/budget_model', 'BudgetModel'); } @@ -33,11 +33,11 @@ class Budget extends APIv1_Controller { $kostenstelle_id = $this->get('kostenstelle_id'); $geschaeftsjahr_kurzbz = $this->get('geschaeftsjahr_kurzbz'); - + if (isset($kostenstelle_id) && isset($geschaeftsjahr_kurzbz)) { $result = $this->BudgetModel->load(array($kostenstelle_id, $geschaeftsjahr_kurzbz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Budget extends APIv1_Controller { $result = $this->BudgetModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Budget extends APIv1_Controller $this->response(); } } - + private function _validate($budget = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Konto.php b/application/controllers/api/v1/accounting/Konto.php index e56a9b0d6..0b78ff98f 100644 --- a/application/controllers/api/v1/accounting/Konto.php +++ b/application/controllers/api/v1/accounting/Konto.php @@ -21,7 +21,7 @@ class Konto extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Konto' => 'basis/konto:rw')); // Load model KontoModel $this->load->model('accounting/konto_model', 'KontoModel'); } @@ -32,11 +32,11 @@ class Konto extends APIv1_Controller public function getKonto() { $kontoID = $this->get('konto_id'); - + if (isset($kontoID)) { $result = $this->KontoModel->load($kontoID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Konto extends APIv1_Controller { $result = $this->KontoModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Konto extends APIv1_Controller $this->response(); } } - + private function _validate($konto = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Kostenstelle.php b/application/controllers/api/v1/accounting/Kostenstelle.php index 813039245..2ebf554c0 100644 --- a/application/controllers/api/v1/accounting/Kostenstelle.php +++ b/application/controllers/api/v1/accounting/Kostenstelle.php @@ -21,7 +21,7 @@ class Kostenstelle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kostenstelle' => 'basis/kostenstelle:rw')); // Load model KostenstelleModel $this->load->model('accounting/kostenstelle_model', 'KostenstelleModel'); } @@ -32,11 +32,11 @@ class Kostenstelle extends APIv1_Controller public function getKostenstelle() { $kostenstelleID = $this->get('kostenstelle_id'); - + if (isset($kostenstelleID)) { $result = $this->KostenstelleModel->load($kostenstelleID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Kostenstelle extends APIv1_Controller { $result = $this->KostenstelleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Kostenstelle extends APIv1_Controller $this->response(); } } - + private function _validate($kostenstelle = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Rechnung.php b/application/controllers/api/v1/accounting/Rechnung.php index 015c8ac57..5ac77b36b 100644 --- a/application/controllers/api/v1/accounting/Rechnung.php +++ b/application/controllers/api/v1/accounting/Rechnung.php @@ -21,7 +21,7 @@ class Rechnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rechnung' => 'basis/rechnung:rw')); // Load model RechnungModel $this->load->model('accounting/rechnung_model', 'RechnungModel'); } @@ -32,11 +32,11 @@ class Rechnung extends APIv1_Controller public function getRechnung() { $rechnungID = $this->get('rechnung_id'); - + if (isset($rechnungID)) { $result = $this->RechnungModel->load($rechnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Rechnung extends APIv1_Controller { $result = $this->RechnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Rechnung extends APIv1_Controller $this->response(); } } - + private function _validate($rechnung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Rechnungsbetrag.php b/application/controllers/api/v1/accounting/Rechnungsbetrag.php index 7ed6e46a5..2f02c794d 100644 --- a/application/controllers/api/v1/accounting/Rechnungsbetrag.php +++ b/application/controllers/api/v1/accounting/Rechnungsbetrag.php @@ -21,7 +21,7 @@ class Rechnungsbetrag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rechnungsbetrag' => 'basis/rechnungsbetrag:rw')); // Load model RechnungsbetragModel $this->load->model('accounting/rechnungsbetrag_model', 'RechnungsbetragModel'); } @@ -32,11 +32,11 @@ class Rechnungsbetrag extends APIv1_Controller public function getRechnungsbetrag() { $rechnungsbetragID = $this->get('rechnungsbetrag_id'); - + if (isset($rechnungsbetragID)) { $result = $this->RechnungsbetragModel->load($rechnungsbetragID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Rechnungsbetrag extends APIv1_Controller { $result = $this->RechnungsbetragModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Rechnungsbetrag extends APIv1_Controller $this->response(); } } - + private function _validate($rechnungsbetrag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Rechnungstyp.php b/application/controllers/api/v1/accounting/Rechnungstyp.php index 507d4c074..f85dae43e 100644 --- a/application/controllers/api/v1/accounting/Rechnungstyp.php +++ b/application/controllers/api/v1/accounting/Rechnungstyp.php @@ -21,7 +21,7 @@ class Rechnungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rechnungstyp' => 'basis/rechnungstyp:rw')); // Load model RechnungstypModel $this->load->model('accounting/rechnungstyp_model', 'RechnungstypModel'); } @@ -32,11 +32,11 @@ class Rechnungstyp extends APIv1_Controller public function getRechnungstyp() { $rechnungstyp_kurzbz = $this->get('rechnungstyp_kurzbz'); - + if (isset($rechnungstyp_kurzbz)) { $result = $this->RechnungstypModel->load($rechnungstyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Rechnungstyp extends APIv1_Controller { $result = $this->RechnungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Rechnungstyp extends APIv1_Controller $this->response(); } } - + private function _validate($rechnungstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Vertrag.php b/application/controllers/api/v1/accounting/Vertrag.php index f627db74a..3b3d3fac2 100644 --- a/application/controllers/api/v1/accounting/Vertrag.php +++ b/application/controllers/api/v1/accounting/Vertrag.php @@ -21,7 +21,7 @@ class Vertrag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vertrag' => 'basis/vertrag:rw')); // Load model VertragModel $this->load->model('accounting/vertrag_model', 'VertragModel'); } @@ -32,11 +32,11 @@ class Vertrag extends APIv1_Controller public function getVertrag() { $vertragID = $this->get('vertrag_id'); - + if (isset($vertragID)) { $result = $this->VertragModel->load($vertragID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Vertrag extends APIv1_Controller { $result = $this->VertragModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Vertrag extends APIv1_Controller $this->response(); } } - + private function _validate($vertrag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Vertragsstatus.php b/application/controllers/api/v1/accounting/Vertragsstatus.php index bfe3a5f3f..c6125e609 100644 --- a/application/controllers/api/v1/accounting/Vertragsstatus.php +++ b/application/controllers/api/v1/accounting/Vertragsstatus.php @@ -21,7 +21,7 @@ class Vertragsstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vertragsstatus' => 'basis/vertragsstatus:rw')); // Load model VertragsstatusModel $this->load->model('accounting/vertragsstatus_model', 'VertragsstatusModel'); } @@ -32,11 +32,11 @@ class Vertragsstatus extends APIv1_Controller public function getVertragsstatus() { $vertragsstatus_kurzbz = $this->get('vertragsstatus_kurzbz'); - + if (isset($vertragsstatus_kurzbz)) { $result = $this->VertragsstatusModel->load($vertragsstatus_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Vertragsstatus extends APIv1_Controller { $result = $this->VertragsstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Vertragsstatus extends APIv1_Controller $this->response(); } } - + private function _validate($vertragsstatus = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Vertragstyp.php b/application/controllers/api/v1/accounting/Vertragstyp.php index 025d39c16..69b0907dd 100644 --- a/application/controllers/api/v1/accounting/Vertragstyp.php +++ b/application/controllers/api/v1/accounting/Vertragstyp.php @@ -21,7 +21,7 @@ class Vertragstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vertragstyp' => 'basis/vertragstyp:rw')); // Load model VertragstypModel $this->load->model('accounting/vertragstyp_model', 'VertragstypModel'); } @@ -32,11 +32,11 @@ class Vertragstyp extends APIv1_Controller public function getVertragstyp() { $vertragstyp_kurzbz = $this->get('vertragstyp_kurzbz'); - + if (isset($vertragstyp_kurzbz)) { $result = $this->VertragstypModel->load($vertragstyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Vertragstyp extends APIv1_Controller { $result = $this->VertragstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Vertragstyp extends APIv1_Controller $this->response(); } } - + private function _validate($vertragstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/accounting/Zahlungstyp.php b/application/controllers/api/v1/accounting/Zahlungstyp.php index dad2c9edb..e7abf74df 100644 --- a/application/controllers/api/v1/accounting/Zahlungstyp.php +++ b/application/controllers/api/v1/accounting/Zahlungstyp.php @@ -21,7 +21,7 @@ class Zahlungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zahlungstyp' => 'basis/zahlungstyp:rw')); // Load model ZahlungstypModel $this->load->model('accounting/zahlungstyp_model', 'ZahlungstypModel'); } @@ -32,11 +32,11 @@ class Zahlungstyp extends APIv1_Controller public function getZahlungstyp() { $zahlungstyp_kurzbz = $this->get('zahlungstyp_kurzbz'); - + if (isset($zahlungstyp_kurzbz)) { $result = $this->ZahlungstypModel->load($zahlungstyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Zahlungstyp extends APIv1_Controller { $result = $this->ZahlungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zahlungstyp extends APIv1_Controller $this->response(); } } - + private function _validate($zahlungstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Akadgrad.php b/application/controllers/api/v1/codex/Akadgrad.php index 5ee160709..2aeb01e59 100644 --- a/application/controllers/api/v1/codex/Akadgrad.php +++ b/application/controllers/api/v1/codex/Akadgrad.php @@ -21,7 +21,7 @@ class Akadgrad extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Akadgrad' => 'basis/akadgrad:rw')); // Load model AkadgradModel $this->load->model('codex/akadgrad_model', 'AkadgradModel'); } @@ -32,11 +32,11 @@ class Akadgrad extends APIv1_Controller public function getAkadgrad() { $akadgradID = $this->get('akadgrad_id'); - + if (isset($akadgradID)) { $result = $this->AkadgradModel->load($akadgradID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Akadgrad extends APIv1_Controller { $result = $this->AkadgradModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Akadgrad extends APIv1_Controller $this->response(); } } - + private function _validate($akadgrad = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Archiv.php b/application/controllers/api/v1/codex/Archiv.php index 8acc38af9..b35ec840d 100644 --- a/application/controllers/api/v1/codex/Archiv.php +++ b/application/controllers/api/v1/codex/Archiv.php @@ -21,7 +21,7 @@ class Archiv extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Archiv' => 'basis/archiv:rw')); // Load model ArchivModel $this->load->model('codex/archiv_model', 'ArchivModel'); } @@ -32,11 +32,11 @@ class Archiv extends APIv1_Controller public function getArchiv() { $archivID = $this->get('archiv_id'); - + if (isset($archivID)) { $result = $this->ArchivModel->load($archivID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Archiv extends APIv1_Controller { $result = $this->ArchivModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Archiv extends APIv1_Controller $this->response(); } } - + private function _validate($archiv = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Aufmerksamdurch.php b/application/controllers/api/v1/codex/Aufmerksamdurch.php index 7ba8269cd..dc27d4dd8 100644 --- a/application/controllers/api/v1/codex/Aufmerksamdurch.php +++ b/application/controllers/api/v1/codex/Aufmerksamdurch.php @@ -21,7 +21,7 @@ class Aufmerksamdurch extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufmerksamdurch' => 'basis/aufmerksamdurch:rw')); // Load model AufmerksamdurchModel $this->load->model('codex/aufmerksamdurch_model', 'AufmerksamdurchModel'); } @@ -32,11 +32,11 @@ class Aufmerksamdurch extends APIv1_Controller public function getAufmerksamdurch() { $aufmerksamdurch_kurzbz = $this->get('aufmerksamdurch_kurzbz'); - + if (isset($aufmerksamdurch_kurzbz)) { $result = $this->AufmerksamdurchModel->load($aufmerksamdurch_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Aufmerksamdurch extends APIv1_Controller { $result = $this->AufmerksamdurchModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Aufmerksamdurch extends APIv1_Controller $this->response(); } } - + private function _validate($aufmerksamdurch = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Ausbildung.php b/application/controllers/api/v1/codex/Ausbildung.php index 277f12e59..4fea8add4 100644 --- a/application/controllers/api/v1/codex/Ausbildung.php +++ b/application/controllers/api/v1/codex/Ausbildung.php @@ -21,7 +21,7 @@ class Ausbildung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ausbildung' => 'basis/ausbildung:rw')); // Load model AusbildungModel $this->load->model('codex/ausbildung_model', 'AusbildungModel'); } @@ -32,11 +32,11 @@ class Ausbildung extends APIv1_Controller public function getAusbildung() { $ausbildungcode = $this->get('ausbildungcode'); - + if (isset($ausbildungcode)) { $result = $this->AusbildungModel->load($ausbildungcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Ausbildung extends APIv1_Controller { $result = $this->AusbildungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Ausbildung extends APIv1_Controller $this->response(); } } - + private function _validate($ausbildung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Berufstaetigkeit.php b/application/controllers/api/v1/codex/Berufstaetigkeit.php index 7618932e4..0941eba9e 100644 --- a/application/controllers/api/v1/codex/Berufstaetigkeit.php +++ b/application/controllers/api/v1/codex/Berufstaetigkeit.php @@ -21,7 +21,7 @@ class Berufstaetigkeit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Berufstaetigkeit' => 'basis/berufstaetigkeit:rw')); // Load model BerufstaetigkeitModel $this->load->model('codex/berufstaetigkeit_model', 'BerufstaetigkeitModel'); } @@ -32,11 +32,11 @@ class Berufstaetigkeit extends APIv1_Controller public function getBerufstaetigkeit() { $berufstaetigkeit_code = $this->get('berufstaetigkeit_code'); - + if (isset($berufstaetigkeit_code)) { $result = $this->BerufstaetigkeitModel->load($berufstaetigkeit_code); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Berufstaetigkeit extends APIv1_Controller { $result = $this->BerufstaetigkeitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Berufstaetigkeit extends APIv1_Controller $this->response(); } } - + private function _validate($berufstaetigkeit = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php index 63eba5ce1..115aa37fd 100644 --- a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php +++ b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php @@ -21,7 +21,7 @@ class Beschaeftigungsausmass extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Beschaeftigungsausmass' => 'basis/beschaeftigungsausmass:rw')); // Load model BeschaeftigungsausmassModel $this->load->model('codex/beschaeftigungsausmass_model', 'BeschaeftigungsausmassModel'); } @@ -32,11 +32,11 @@ class Beschaeftigungsausmass extends APIv1_Controller public function getBeschaeftigungsausmass() { $beschausmasscode = $this->get('beschausmasscode'); - + if (isset($beschausmasscode)) { $result = $this->BeschaeftigungsausmassModel->load($beschausmasscode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Beschaeftigungsausmass extends APIv1_Controller { $result = $this->BeschaeftigungsausmassModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Beschaeftigungsausmass extends APIv1_Controller $this->response(); } } - + private function _validate($beschaeftigungsausmass = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Besqual.php b/application/controllers/api/v1/codex/Besqual.php index 419fab89a..6bad18ff7 100644 --- a/application/controllers/api/v1/codex/Besqual.php +++ b/application/controllers/api/v1/codex/Besqual.php @@ -21,7 +21,7 @@ class Besqual extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Besqual' => 'basis/besqual:rw')); // Load model BesqualModel $this->load->model('codex/besqual_model', 'BesqualModel'); } @@ -32,11 +32,11 @@ class Besqual extends APIv1_Controller public function getBesqual() { $besqualcode = $this->get('besqualcode'); - + if (isset($besqualcode)) { $result = $this->BesqualModel->load($besqualcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Besqual extends APIv1_Controller { $result = $this->BesqualModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Besqual extends APIv1_Controller $this->response(); } } - + private function _validate($besqual = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Bisfunktion.php b/application/controllers/api/v1/codex/Bisfunktion.php index 80d3ffbf6..85a7fca7b 100644 --- a/application/controllers/api/v1/codex/Bisfunktion.php +++ b/application/controllers/api/v1/codex/Bisfunktion.php @@ -21,7 +21,7 @@ class Bisfunktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisfunktion' => 'basis/bisfunktion:rw')); // Load model BisfunktionModel $this->load->model('codex/bisfunktion_model', 'BisfunktionModel'); } @@ -33,11 +33,11 @@ class Bisfunktion extends APIv1_Controller { $studiengang_kz = $this->get('studiengang_kz'); $bisverwendung_id = $this->get('bisverwendung_id'); - + if (isset($studiengang_kz) && isset($bisverwendung_id)) { $result = $this->BisfunktionModel->load(array($studiengang_kz, $bisverwendung_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Bisfunktion extends APIv1_Controller { $result = $this->BisfunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Bisfunktion extends APIv1_Controller $this->response(); } } - + private function _validate($bisfunktion = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Bisio.php b/application/controllers/api/v1/codex/Bisio.php index 3fe5171b1..1b0999bb1 100644 --- a/application/controllers/api/v1/codex/Bisio.php +++ b/application/controllers/api/v1/codex/Bisio.php @@ -21,7 +21,7 @@ class Bisio extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisio' => 'basis/bisio:rw')); // Load model BisioModel $this->load->model('codex/bisio_model', 'BisioModel'); } @@ -32,11 +32,11 @@ class Bisio extends APIv1_Controller public function getBisio() { $bisioID = $this->get('bisio_id'); - + if (isset($bisioID)) { $result = $this->BisioModel->load($bisioID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bisio extends APIv1_Controller { $result = $this->BisioModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bisio extends APIv1_Controller $this->response(); } } - + private function _validate($bisio = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Bisorgform.php b/application/controllers/api/v1/codex/Bisorgform.php index 54bf7aa66..af72644c8 100644 --- a/application/controllers/api/v1/codex/Bisorgform.php +++ b/application/controllers/api/v1/codex/Bisorgform.php @@ -21,7 +21,7 @@ class Bisorgform extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisorgform' => 'basis/bisorgform:rw')); // Load model BisorgformModel $this->load->model('codex/bisorgform_model', 'BisorgformModel'); } @@ -32,11 +32,11 @@ class Bisorgform extends APIv1_Controller public function getBisorgform() { $bisorgform_kurzbz = $this->get('bisorgform_kurzbz'); - + if (isset($bisorgform_kurzbz)) { $result = $this->BisorgformModel->load($bisorgform_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bisorgform extends APIv1_Controller { $result = $this->BisorgformModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bisorgform extends APIv1_Controller $this->response(); } } - + private function _validate($bisorgform = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Bisverwendung.php b/application/controllers/api/v1/codex/Bisverwendung.php index 2139ada3b..ee2b0d5ca 100644 --- a/application/controllers/api/v1/codex/Bisverwendung.php +++ b/application/controllers/api/v1/codex/Bisverwendung.php @@ -21,7 +21,7 @@ class Bisverwendung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisverwendung' => 'basis/bisverwendung:rw')); // Load model BisverwendungModel $this->load->model('codex/bisverwendung_model', 'BisverwendungModel'); } @@ -32,11 +32,11 @@ class Bisverwendung extends APIv1_Controller public function getBisverwendung() { $bisverwendungID = $this->get('bisverwendung_id'); - + if (isset($bisverwendungID)) { $result = $this->BisverwendungModel->load($bisverwendungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bisverwendung extends APIv1_Controller { $result = $this->BisverwendungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bisverwendung extends APIv1_Controller $this->response(); } } - + private function _validate($bisverwendung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Bundesland.php b/application/controllers/api/v1/codex/Bundesland.php index 68d44f130..ccff4f047 100644 --- a/application/controllers/api/v1/codex/Bundesland.php +++ b/application/controllers/api/v1/codex/Bundesland.php @@ -21,7 +21,7 @@ class Bundesland extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('All' => 'basis/bundesland:r')); // Load model PersonModel $this->load->model('codex/bundesland_model', 'BundeslandModel'); } diff --git a/application/controllers/api/v1/codex/Entwicklungsteam.php b/application/controllers/api/v1/codex/Entwicklungsteam.php index 21b4dda91..bf376a842 100644 --- a/application/controllers/api/v1/codex/Entwicklungsteam.php +++ b/application/controllers/api/v1/codex/Entwicklungsteam.php @@ -21,7 +21,7 @@ class Entwicklungsteam extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Entwicklungsteam' => 'basis/entwicklungsteam:rw')); // Load model EntwicklungsteamModel $this->load->model('codex/entwicklungsteam_model', 'EntwicklungsteamModel'); } @@ -33,11 +33,11 @@ class Entwicklungsteam extends APIv1_Controller { $studiengang_kz = $this->get('studiengang_kz'); $mitarbeiter_uid = $this->get('mitarbeiter_uid'); - + if (isset($studiengang_kz) && isset($mitarbeiter_uid)) { $result = $this->EntwicklungsteamModel->load(array($studiengang_kz, $mitarbeiter_uid)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Entwicklungsteam extends APIv1_Controller { $result = $this->EntwicklungsteamModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Entwicklungsteam extends APIv1_Controller $this->response(); } } - + private function _validate($entwicklungsteam = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Gemeinde.php b/application/controllers/api/v1/codex/Gemeinde.php index 52b879598..255498b4b 100644 --- a/application/controllers/api/v1/codex/Gemeinde.php +++ b/application/controllers/api/v1/codex/Gemeinde.php @@ -21,7 +21,7 @@ class Gemeinde extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Gemeinde' => 'basis/gemeinde:rw', 'GemeindeByPlz' => 'basis/gemeinde:r')); // Load model GemeindeModel $this->load->model("codex/gemeinde_model", "GemeindeModel"); } @@ -32,7 +32,7 @@ class Gemeinde extends APIv1_Controller public function getGemeinde() { $gemeindeID = $this->get("gemeinde_id"); - + $this->GemeindeModel->addOrder("plz"); if (isset($gemeindeID)) { @@ -42,21 +42,21 @@ class Gemeinde extends APIv1_Controller { $result = $this->GemeindeModel->load(); } - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getGemeindeByPlz() { $plz = $this->get("plz"); - + if (is_numeric($plz)) { $result = $this->GemeindeModel->getGemeindeByPlz($plz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -80,7 +80,7 @@ class Gemeinde extends APIv1_Controller { $result = $this->GemeindeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -88,9 +88,9 @@ class Gemeinde extends APIv1_Controller $this->response(); } } - + private function _validate($gemeinde = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Hauptberuf.php b/application/controllers/api/v1/codex/Hauptberuf.php index bdce2872d..05396c473 100644 --- a/application/controllers/api/v1/codex/Hauptberuf.php +++ b/application/controllers/api/v1/codex/Hauptberuf.php @@ -21,7 +21,7 @@ class Hauptberuf extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Hauptberuf' => 'basis/hauptberuf:rw')); // Load model HauptberufModel $this->load->model('codex/hauptberuf_model', 'HauptberufModel'); } @@ -32,11 +32,11 @@ class Hauptberuf extends APIv1_Controller public function getHauptberuf() { $hauptberufcode = $this->get('hauptberufcode'); - + if (isset($hauptberufcode)) { $result = $this->HauptberufModel->load($hauptberufcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Hauptberuf extends APIv1_Controller { $result = $this->HauptberufModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Hauptberuf extends APIv1_Controller $this->response(); } } - + private function _validate($hauptberuf = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Lehrform.php b/application/controllers/api/v1/codex/Lehrform.php index 4cd48cecc..e789e76ec 100644 --- a/application/controllers/api/v1/codex/Lehrform.php +++ b/application/controllers/api/v1/codex/Lehrform.php @@ -21,7 +21,7 @@ class Lehrform extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrform' => 'basis/lehrform:rw')); // Load model LehrformModel $this->load->model('codex/lehrform_model', 'LehrformModel'); } @@ -32,11 +32,11 @@ class Lehrform extends APIv1_Controller public function getLehrform() { $lehrform_kurzbz = $this->get('lehrform_kurzbz'); - + if (isset($lehrform_kurzbz)) { $result = $this->LehrformModel->load($lehrform_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lehrform extends APIv1_Controller { $result = $this->LehrformModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrform extends APIv1_Controller $this->response(); } } - + private function _validate($lehrform = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Lgartcode.php b/application/controllers/api/v1/codex/Lgartcode.php index 14dadb1c1..5be7cab59 100644 --- a/application/controllers/api/v1/codex/Lgartcode.php +++ b/application/controllers/api/v1/codex/Lgartcode.php @@ -21,7 +21,7 @@ class Lgartcode extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lgartcode' => 'basis/lgartcode:rw')); // Load model LgartcodeModel $this->load->model('codex/lgartcode_model', 'LgartcodeModel'); } @@ -32,11 +32,11 @@ class Lgartcode extends APIv1_Controller public function getLgartcode() { $lgartcode = $this->get('lgartcode'); - + if (isset($lgartcode)) { $result = $this->LgartcodeModel->load($lgartcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lgartcode extends APIv1_Controller { $result = $this->LgartcodeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lgartcode extends APIv1_Controller $this->response(); } } - + private function _validate($lgartcode = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php index b182a6f00..70f0c3dc6 100644 --- a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php +++ b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php @@ -21,7 +21,7 @@ class Mobilitaetsprogramm extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Mobilitaetsprogramm' => 'basis/mobilitaetsprogramm:rw')); // Load model MobilitaetsprogrammModel $this->load->model('codex/mobilitaetsprogramm_model', 'MobilitaetsprogrammModel'); } @@ -32,11 +32,11 @@ class Mobilitaetsprogramm extends APIv1_Controller public function getMobilitaetsprogramm() { $mobilitaetsprogramm_code = $this->get('mobilitaetsprogramm_code'); - + if (isset($mobilitaetsprogramm_code)) { $result = $this->MobilitaetsprogrammModel->load($mobilitaetsprogramm_code); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Mobilitaetsprogramm extends APIv1_Controller { $result = $this->MobilitaetsprogrammModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Mobilitaetsprogramm extends APIv1_Controller $this->response(); } } - + private function _validate($mobilitaetsprogramm = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Nation.php b/application/controllers/api/v1/codex/Nation.php index 2bf8f8dd5..a8074bd82 100644 --- a/application/controllers/api/v1/codex/Nation.php +++ b/application/controllers/api/v1/codex/Nation.php @@ -21,7 +21,7 @@ class Nation extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Nation' => 'basis/nation:r', 'All' => 'basis/nation:r')); // Load model NationModel $this->load->model('codex/nation_model', 'NationModel'); } diff --git a/application/controllers/api/v1/codex/Note.php b/application/controllers/api/v1/codex/Note.php index a6ddc6741..f42032fe5 100644 --- a/application/controllers/api/v1/codex/Note.php +++ b/application/controllers/api/v1/codex/Note.php @@ -21,7 +21,7 @@ class Note extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Note' => 'basis/note:rw')); // Load model NoteModel $this->load->model('codex/note_model', 'NoteModel'); } @@ -32,11 +32,11 @@ class Note extends APIv1_Controller public function getNote() { $note = $this->get('note'); - + if (isset($note)) { $result = $this->NoteModel->load($note); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Note extends APIv1_Controller { $result = $this->NoteModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Note extends APIv1_Controller $this->response(); } } - + private function _validate($note = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Orgform.php b/application/controllers/api/v1/codex/Orgform.php index d41214275..ad5d94185 100644 --- a/application/controllers/api/v1/codex/Orgform.php +++ b/application/controllers/api/v1/codex/Orgform.php @@ -21,7 +21,7 @@ class Orgform extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Orgform' => 'basis/orgform:rw', 'All' => 'basis/orgform:r', 'OrgformLV' => 'basis/orgform:r')); // Load model OrgformModel $this->load->model('codex/orgform_model', 'OrgformModel'); } @@ -32,11 +32,11 @@ class Orgform extends APIv1_Controller public function getOrgform() { $orgform_kurzbz = $this->get('orgform_kurzbz'); - + if (isset($orgform_kurzbz)) { $result = $this->OrgformModel->load($orgform_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -44,24 +44,24 @@ class Orgform extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getAll() { $result = $this->OrgformModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getOrgformLV() { $result = $this->OrgformModel->getOrgformLV(); - + $this->response($result, REST_Controller::HTTP_OK); } @@ -80,7 +80,7 @@ class Orgform extends APIv1_Controller { $result = $this->OrgformModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -88,9 +88,9 @@ class Orgform extends APIv1_Controller $this->response(); } } - + private function _validate($orgform = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Verwendung.php b/application/controllers/api/v1/codex/Verwendung.php index 21b2182db..9823d3915 100644 --- a/application/controllers/api/v1/codex/Verwendung.php +++ b/application/controllers/api/v1/codex/Verwendung.php @@ -21,7 +21,7 @@ class Verwendung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Verwendung' => 'basis/verwendung:rw')); // Load model VerwendungModel $this->load->model('codex/verwendung_model', 'VerwendungModel'); } @@ -32,11 +32,11 @@ class Verwendung extends APIv1_Controller public function getVerwendung() { $verwendung_code = $this->get('verwendung_code'); - + if (isset($verwendung_code)) { $result = $this->VerwendungModel->load($verwendung_code); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Verwendung extends APIv1_Controller { $result = $this->VerwendungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Verwendung extends APIv1_Controller $this->response(); } } - + private function _validate($verwendung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Zgv.php b/application/controllers/api/v1/codex/Zgv.php index b7992aab4..d042b2b56 100644 --- a/application/controllers/api/v1/codex/Zgv.php +++ b/application/controllers/api/v1/codex/Zgv.php @@ -21,7 +21,7 @@ class Zgv extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgv' => 'basis/zgv:rw')); // Load model ZgvModel $this->load->model('codex/zgv_model', 'ZgvModel'); } @@ -32,11 +32,11 @@ class Zgv extends APIv1_Controller public function getZgv() { $zgv_code = $this->get('zgv_code'); - + if (isset($zgv_code)) { $result = $this->ZgvModel->load($zgv_code); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Zgv extends APIv1_Controller { $result = $this->ZgvModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgv extends APIv1_Controller $this->response(); } } - + private function _validate($zgv = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Zgvdoktor.php b/application/controllers/api/v1/codex/Zgvdoktor.php index 50ca5cacb..aeaf56463 100644 --- a/application/controllers/api/v1/codex/Zgvdoktor.php +++ b/application/controllers/api/v1/codex/Zgvdoktor.php @@ -21,7 +21,7 @@ class Zgvdoktor extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgvdoktor' => 'basis/zgvdoktor:rw')); // Load model ZgvdoktorModel $this->load->model('codex/zgvdoktor_model', 'ZgvdoktorModel'); } @@ -32,11 +32,11 @@ class Zgvdoktor extends APIv1_Controller public function getZgvdoktor() { $zgvdoktor_code = $this->get('zgvdoktor_code'); - + if (isset($zgvdoktor_code)) { $result = $this->ZgvdoktorModel->load($zgvdoktor_code); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Zgvdoktor extends APIv1_Controller { $result = $this->ZgvdoktorModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgvdoktor extends APIv1_Controller $this->response(); } } - + private function _validate($zgvdoktor = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Zgvgruppe.php b/application/controllers/api/v1/codex/Zgvgruppe.php index 805dbdb30..38b1fe520 100644 --- a/application/controllers/api/v1/codex/Zgvgruppe.php +++ b/application/controllers/api/v1/codex/Zgvgruppe.php @@ -21,7 +21,7 @@ class Zgvgruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgvgruppe' => 'basis/zgvgruppe:rw')); // Load model ZgvgruppeModel $this->load->model('codex/zgvgruppe_model', 'ZgvgruppeModel'); } @@ -32,11 +32,11 @@ class Zgvgruppe extends APIv1_Controller public function getZgvgruppe() { $gruppe_kurzbz = $this->get('gruppe_kurzbz'); - + if (isset($gruppe_kurzbz)) { $result = $this->ZgvgruppeModel->load($gruppe_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Zgvgruppe extends APIv1_Controller { $result = $this->ZgvgruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgvgruppe extends APIv1_Controller $this->response(); } } - + private function _validate($zgvgruppe = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Zgvmaster.php b/application/controllers/api/v1/codex/Zgvmaster.php index e813073c1..b8e7ee86d 100644 --- a/application/controllers/api/v1/codex/Zgvmaster.php +++ b/application/controllers/api/v1/codex/Zgvmaster.php @@ -21,7 +21,7 @@ class Zgvmaster extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgvmaster' => 'basis/zgvmaster:rw')); // Load model ZgvmasterModel $this->load->model('codex/zgvmaster_model', 'ZgvmasterModel'); } @@ -32,11 +32,11 @@ class Zgvmaster extends APIv1_Controller public function getZgvmaster() { $zgvmas_code = $this->get('zgvmas_code'); - + if (isset($zgvmas_code)) { $result = $this->ZgvmasterModel->load($zgvmas_code); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Zgvmaster extends APIv1_Controller { $result = $this->ZgvmasterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgvmaster extends APIv1_Controller $this->response(); } } - + private function _validate($zgvmaster = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Zweck.php b/application/controllers/api/v1/codex/Zweck.php index 7e0c3f70a..c5710c7a5 100644 --- a/application/controllers/api/v1/codex/Zweck.php +++ b/application/controllers/api/v1/codex/Zweck.php @@ -21,7 +21,7 @@ class Zweck extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zweck' => 'basis/zweck:rw')); // Load model ZweckModel $this->load->model('codex/zweck_model', 'ZweckModel'); } @@ -32,11 +32,11 @@ class Zweck extends APIv1_Controller public function getZweck() { $zweck_code = $this->get('zweck_code'); - + if (isset($zweck_code)) { $result = $this->ZweckModel->load($zweck_code); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Zweck extends APIv1_Controller { $result = $this->ZweckModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zweck extends APIv1_Controller $this->response(); } } - + private function _validate($zweck = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Ampel.php b/application/controllers/api/v1/content/Ampel.php index 1bf6aae9c..f550eafdd 100644 --- a/application/controllers/api/v1/content/Ampel.php +++ b/application/controllers/api/v1/content/Ampel.php @@ -21,7 +21,7 @@ class Ampel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ampel' => 'basis/ampel:rw')); // Load model AmpelModel $this->load->model('content/ampel_model', 'AmpelModel'); } @@ -32,11 +32,11 @@ class Ampel extends APIv1_Controller public function getAmpel() { $ampelID = $this->get('ampel_id'); - + if (isset($ampelID)) { $result = $this->AmpelModel->load($ampelID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Ampel extends APIv1_Controller { $result = $this->AmpelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Ampel extends APIv1_Controller $this->response(); } } - + private function _validate($ampel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Content.php b/application/controllers/api/v1/content/Content.php index 2fd638e24..5d0854c2e 100644 --- a/application/controllers/api/v1/content/Content.php +++ b/application/controllers/api/v1/content/Content.php @@ -21,7 +21,7 @@ class Content extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Content' => 'basis/content:rw')); // Load model ContentModel $this->load->model('content/content_model', 'ContentModel'); } @@ -32,11 +32,11 @@ class Content extends APIv1_Controller public function getContent() { $contentID = $this->get('content_id'); - + if (isset($contentID)) { $result = $this->ContentModel->load($contentID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Content extends APIv1_Controller { $result = $this->ContentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Content extends APIv1_Controller $this->response(); } } - + private function _validate($content = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Contentchild.php b/application/controllers/api/v1/content/Contentchild.php index 5f1a28917..95dbc4ab0 100644 --- a/application/controllers/api/v1/content/Contentchild.php +++ b/application/controllers/api/v1/content/Contentchild.php @@ -21,7 +21,7 @@ class Contentchild extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentchild' => 'basis/contentchild:rw')); // Load model ContentchildModel $this->load->model('content/contentchild_model', 'ContentchildModel'); } @@ -32,11 +32,11 @@ class Contentchild extends APIv1_Controller public function getContentchild() { $contentchildID = $this->get('contentchild_id'); - + if (isset($contentchildID)) { $result = $this->ContentchildModel->load($contentchildID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Contentchild extends APIv1_Controller { $result = $this->ContentchildModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Contentchild extends APIv1_Controller $this->response(); } } - + private function _validate($contentchild = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Contentgruppe.php b/application/controllers/api/v1/content/Contentgruppe.php index 420dd51f5..794400dc1 100644 --- a/application/controllers/api/v1/content/Contentgruppe.php +++ b/application/controllers/api/v1/content/Contentgruppe.php @@ -21,7 +21,7 @@ class Contentgruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentgruppe' => 'basis/contentgruppe:rw')); // Load model ContentgruppeModel $this->load->model('content/contentgruppe_model', 'ContentgruppeModel'); } @@ -33,11 +33,11 @@ class Contentgruppe extends APIv1_Controller { $gruppe_kurzbz = $this->get('gruppe_kurzbz'); $content_id = $this->get('content_id'); - + if (isset($gruppe_kurzbz) && isset($content_id)) { $result = $this->ContentgruppeModel->load(array($gruppe_kurzbz, $content_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Contentgruppe extends APIv1_Controller { $result = $this->ContentgruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Contentgruppe extends APIv1_Controller $this->response(); } } - + private function _validate($contentgruppe = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Contentlog.php b/application/controllers/api/v1/content/Contentlog.php index b5b3aba68..ef4738828 100644 --- a/application/controllers/api/v1/content/Contentlog.php +++ b/application/controllers/api/v1/content/Contentlog.php @@ -21,7 +21,7 @@ class Contentlog extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentlog' => 'basis/contentlog:rw')); // Load model ContentlogModel $this->load->model('content/contentlog_model', 'ContentlogModel'); } @@ -32,11 +32,11 @@ class Contentlog extends APIv1_Controller public function getContentlog() { $contentlogID = $this->get('contentlog_id'); - + if (isset($contentlogID)) { $result = $this->ContentlogModel->load($contentlogID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Contentlog extends APIv1_Controller { $result = $this->ContentlogModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Contentlog extends APIv1_Controller $this->response(); } } - + private function _validate($contentlog = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Contentsprache.php b/application/controllers/api/v1/content/Contentsprache.php index 78c67c6c3..f3696d2ad 100644 --- a/application/controllers/api/v1/content/Contentsprache.php +++ b/application/controllers/api/v1/content/Contentsprache.php @@ -21,7 +21,7 @@ class Contentsprache extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentsprache' => 'basis/contentsprache:rw')); // Load model ContentspracheModel $this->load->model('content/contentsprache_model', 'ContentspracheModel'); } @@ -32,11 +32,11 @@ class Contentsprache extends APIv1_Controller public function getContentsprache() { $contentspracheID = $this->get('contentsprache_id'); - + if (isset($contentspracheID)) { $result = $this->ContentspracheModel->load($contentspracheID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Contentsprache extends APIv1_Controller { $result = $this->ContentspracheModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Contentsprache extends APIv1_Controller $this->response(); } } - + private function _validate($contentsprache = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Dms.php b/application/controllers/api/v1/content/Dms.php index dd1156273..e73254888 100644 --- a/application/controllers/api/v1/content/Dms.php +++ b/application/controllers/api/v1/content/Dms.php @@ -17,27 +17,27 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); class Dms extends APIv1_Controller { /** - * + * */ public function __construct() { - parent::__construct(); + parent::__construct(array('Dms' => 'basis/dms:rw', 'AktenAcceptedDms' => 'basis/dms:r', 'DelDms' => 'basis/dms:w')); // Load library DmsLib $this->load->library('DmsLib'); } - + /** - * + * */ public function getDms() { $dms_id = $this->get('dms_id'); $version = $this->get('version'); - + if (isset($dms_id)) { $result = $this->dmslib->read($dms_id, $version); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -45,20 +45,20 @@ class Dms extends APIv1_Controller $this->response(); } } - + /** - * + * */ public function getAktenAcceptedDms() { $person_id = $this->get('person_id'); $dokument_kurzbz = $this->get('dokument_kurzbz'); $no_file = $this->get('no_file'); - + if (isset($person_id)) { $result = $this->dmslib->getAktenAcceptedDms($person_id, $dokument_kurzbz, $no_file); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -66,18 +66,18 @@ class Dms extends APIv1_Controller $this->response(); } } - + /** - * + * */ public function postDms() { $dms = $this->post(); - + if ($this->_validatePost($dms)) { $result = $this->dmslib->save($dms); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -85,18 +85,18 @@ class Dms extends APIv1_Controller $this->response(); } } - + /** - * + * */ public function postDelDms() { $dms = $this->post(); - + if ($this->_validateDelete($this->post())) { $result = $this->dmslib->delete($dms['person_id'], $dms['dms_id']); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -104,7 +104,7 @@ class Dms extends APIv1_Controller $this->response(); } } - + private function _validatePost($dms = null) { if (!isset($dms)) @@ -119,10 +119,10 @@ class Dms extends APIv1_Controller { return false; } - + return true; } - + private function _validateDelete($dms = null) { if (!isset($dms)) @@ -137,7 +137,7 @@ class Dms extends APIv1_Controller { return false; } - + return true; } } diff --git a/application/controllers/api/v1/content/Infoscreen.php b/application/controllers/api/v1/content/Infoscreen.php index e7dc12d81..3012af304 100644 --- a/application/controllers/api/v1/content/Infoscreen.php +++ b/application/controllers/api/v1/content/Infoscreen.php @@ -21,7 +21,7 @@ class Infoscreen extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Infoscreen' => 'basis/infoscreen:rw')); // Load model InfoscreenModel $this->load->model('content/infoscreen_model', 'InfoscreenModel'); } @@ -32,11 +32,11 @@ class Infoscreen extends APIv1_Controller public function getInfoscreen() { $infoscreenID = $this->get('infoscreen_id'); - + if (isset($infoscreenID)) { $result = $this->InfoscreenModel->load($infoscreenID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Infoscreen extends APIv1_Controller { $result = $this->InfoscreenModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Infoscreen extends APIv1_Controller $this->response(); } } - + private function _validate($infoscreen = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/News.php b/application/controllers/api/v1/content/News.php index f8dd80008..b085afb7d 100644 --- a/application/controllers/api/v1/content/News.php +++ b/application/controllers/api/v1/content/News.php @@ -21,7 +21,7 @@ class News extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('News' => 'basis/news:rw')); // Load model NewsModel $this->load->model('content/news_model', 'NewsModel'); } @@ -32,11 +32,11 @@ class News extends APIv1_Controller public function getNews() { $newsID = $this->get('news_id'); - + if (isset($newsID)) { $result = $this->NewsModel->load($newsID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class News extends APIv1_Controller { $result = $this->NewsModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class News extends APIv1_Controller $this->response(); } } - + private function _validate($news = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Template.php b/application/controllers/api/v1/content/Template.php index 41a54af72..e15156b14 100644 --- a/application/controllers/api/v1/content/Template.php +++ b/application/controllers/api/v1/content/Template.php @@ -21,7 +21,7 @@ class Template extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Template' => 'basis/template:rw')); // Load model TemplateModel $this->load->model('content/template_model', 'TemplateModel'); } @@ -32,11 +32,11 @@ class Template extends APIv1_Controller public function getTemplate() { $template_kurzbz = $this->get('template_kurzbz'); - + if (isset($template_kurzbz)) { $result = $this->TemplateModel->load($template_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Template extends APIv1_Controller { $result = $this->TemplateModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Template extends APIv1_Controller $this->response(); } } - + private function _validate($template = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Veranstaltung.php b/application/controllers/api/v1/content/Veranstaltung.php index c21febf8d..5f922e65a 100644 --- a/application/controllers/api/v1/content/Veranstaltung.php +++ b/application/controllers/api/v1/content/Veranstaltung.php @@ -21,7 +21,7 @@ class Veranstaltung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Veranstaltung' => 'basis/veranstaltung:rw')); // Load model VeranstaltungModel $this->load->model('content/veranstaltung_model', 'VeranstaltungModel'); } @@ -32,11 +32,11 @@ class Veranstaltung extends APIv1_Controller public function getVeranstaltung() { $veranstaltungID = $this->get('veranstaltung_id'); - + if (isset($veranstaltungID)) { $result = $this->VeranstaltungModel->load($veranstaltungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Veranstaltung extends APIv1_Controller { $result = $this->VeranstaltungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Veranstaltung extends APIv1_Controller $this->response(); } } - + private function _validate($veranstaltung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/content/Veranstaltungskategorie.php b/application/controllers/api/v1/content/Veranstaltungskategorie.php index dd867b4db..20af408c5 100644 --- a/application/controllers/api/v1/content/Veranstaltungskategorie.php +++ b/application/controllers/api/v1/content/Veranstaltungskategorie.php @@ -21,7 +21,7 @@ class Veranstaltungskategorie extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Veranstaltungskategorie' => 'basis/veranstaltungskategorie:rw')); // Load model VeranstaltungskategorieModel $this->load->model('content/veranstaltungskategorie_model', 'VeranstaltungskategorieModel'); } @@ -32,11 +32,11 @@ class Veranstaltungskategorie extends APIv1_Controller public function getVeranstaltungskategorie() { $veranstaltungskategorie_kurzbz = $this->get('veranstaltungskategorie_kurzbz'); - + if (isset($veranstaltungskategorie_kurzbz)) { $result = $this->VeranstaltungskategorieModel->load($veranstaltungskategorie_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Veranstaltungskategorie extends APIv1_Controller { $result = $this->VeranstaltungskategorieModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Veranstaltungskategorie extends APIv1_Controller $this->response(); } } - + private function _validate($veranstaltungskategorie = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Akte.php b/application/controllers/api/v1/crm/Akte.php index 20b5ac22f..e9c892da5 100644 --- a/application/controllers/api/v1/crm/Akte.php +++ b/application/controllers/api/v1/crm/Akte.php @@ -21,11 +21,11 @@ class Akte extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Akte' => 'basis/akte:rw', 'Akten' => 'basis/akte:r', 'AktenAccepted' => 'basis/akte:r')); // Load model AkteModel $this->load->model('crm/akte_model', 'AkteModel'); - - + + } /** @@ -34,11 +34,11 @@ class Akte extends APIv1_Controller public function getAkte() { $akteID = $this->get('akte_id'); - + if (isset($akteID)) { $result = $this->AkteModel->load($akteID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -46,7 +46,7 @@ class Akte extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -56,11 +56,11 @@ class Akte extends APIv1_Controller $dokument_kurzbz = $this->get('dokument_kurzbz'); $stg_kz = $this->get('stg_kz'); $prestudent_id = $this->get('prestudent_id'); - + if (isset($person_id)) { $result = $this->AkteModel->getAkten($person_id, $dokument_kurzbz, $stg_kz, $prestudent_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,7 +68,7 @@ class Akte extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -76,11 +76,11 @@ class Akte extends APIv1_Controller { $person_id = $this->get('person_id'); $dokument_kurzbz = $this->get('dokument_kurzbz'); - + if (isset($person_id)) { $result = $this->AkteModel->getAktenAccepted($person_id, $dokument_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -104,7 +104,7 @@ class Akte extends APIv1_Controller { $result = $this->AkteModel->insert($akte); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -112,11 +112,11 @@ class Akte extends APIv1_Controller $this->response(); } } - + private function _validate($akte = null) { unset($akte['accepted']); - + return $akte; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Aufnahmeschluessel.php b/application/controllers/api/v1/crm/Aufnahmeschluessel.php index a746e2bdf..f2724481c 100644 --- a/application/controllers/api/v1/crm/Aufnahmeschluessel.php +++ b/application/controllers/api/v1/crm/Aufnahmeschluessel.php @@ -21,11 +21,11 @@ class Aufnahmeschluessel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufnahmeschluessel' => 'basis/aufnahmeschluessel:rw')); // Load model AufnahmeschluesselModel $this->load->model('crm/aufnahmeschluessel_model', 'AufnahmeschluesselModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufnahmeschluessel extends APIv1_Controller public function getAufnahmeschluessel() { $aufnahmeschluessel = $this->get('aufnahmeschluessel'); - + if (isset($aufnahmeschluessel)) { $result = $this->AufnahmeschluesselModel->load($aufnahmeschluessel); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Aufnahmeschluessel extends APIv1_Controller { $result = $this->AufnahmeschluesselModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufnahmeschluessel extends APIv1_Controller $this->response(); } } - + private function _validate($aufnahmeschluessel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Aufnahmetermin.php b/application/controllers/api/v1/crm/Aufnahmetermin.php index 798eac728..e199adbf8 100644 --- a/application/controllers/api/v1/crm/Aufnahmetermin.php +++ b/application/controllers/api/v1/crm/Aufnahmetermin.php @@ -21,11 +21,11 @@ class Aufnahmetermin extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufnahmetermin' => 'basis/aufnahmetermin:rw')); // Load model AufnahmeterminModel $this->load->model('crm/aufnahmetermin_model', 'AufnahmeterminModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufnahmetermin extends APIv1_Controller public function getAufnahmetermin() { $aufnahmeterminID = $this->get('aufnahmetermin_id'); - + if (isset($aufnahmeterminID)) { $result = $this->AufnahmeterminModel->load($aufnahmeterminID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Aufnahmetermin extends APIv1_Controller { $result = $this->AufnahmeterminModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufnahmetermin extends APIv1_Controller $this->response(); } } - + private function _validate($aufnahmetermin = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Aufnahmetermintyp.php b/application/controllers/api/v1/crm/Aufnahmetermintyp.php index dab29d678..7219598bf 100644 --- a/application/controllers/api/v1/crm/Aufnahmetermintyp.php +++ b/application/controllers/api/v1/crm/Aufnahmetermintyp.php @@ -21,11 +21,11 @@ class Aufnahmetermintyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufnahmetermintyp' => 'basis/aufnahmetermintyp:rw')); // Load model AufnahmetermintypModel $this->load->model('crm/aufnahmetermintyp_model', 'AufnahmetermintypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufnahmetermintyp extends APIv1_Controller public function getAufnahmetermintyp() { $aufnahmetermintyp_kurzbz = $this->get('aufnahmetermintyp_kurzbz'); - + if (isset($aufnahmetermintyp_kurzbz)) { $result = $this->AufnahmetermintypModel->load($aufnahmetermintyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Aufnahmetermintyp extends APIv1_Controller { $result = $this->AufnahmetermintypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufnahmetermintyp extends APIv1_Controller $this->response(); } } - + private function _validate($aufnahmetermintyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Bewerbungstermine.php b/application/controllers/api/v1/crm/Bewerbungstermine.php index 7fecceae3..8d3c8b774 100644 --- a/application/controllers/api/v1/crm/Bewerbungstermine.php +++ b/application/controllers/api/v1/crm/Bewerbungstermine.php @@ -21,7 +21,14 @@ class Bewerbungstermine extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Bewerbungstermine' => 'basis/bewerbungstermine:rw', + 'ByStudiengangStudiensemester' => 'basis/bewerbungstermine:r', + 'ByStudienplan' => 'basis/bewerbungstermine:r', + 'Current' => 'basis/bewerbungstermine:r' + ) + ); // Load model BewerbungstermineModel $this->load->model('crm/bewerbungstermine_model', 'BewerbungstermineModel'); @@ -132,4 +139,4 @@ class Bewerbungstermine extends APIv1_Controller { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Buchungstyp.php b/application/controllers/api/v1/crm/Buchungstyp.php index bb3fa3e6b..a5bf44dfc 100644 --- a/application/controllers/api/v1/crm/Buchungstyp.php +++ b/application/controllers/api/v1/crm/Buchungstyp.php @@ -21,11 +21,11 @@ class Buchungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Buchungstyp' => 'basis/buchungstyp:rw'); // Load model BuchungstypModel $this->load->model('crm/buchungstyp_model', 'BuchungstypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Buchungstyp extends APIv1_Controller public function getBuchungstyp() { $buchungstyp_kurzbz = $this->get('buchungstyp_kurzbz'); - + if (isset($buchungstyp_kurzbz)) { $result = $this->BuchungstypModel->load($buchungstyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Buchungstyp extends APIv1_Controller { $result = $this->BuchungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Buchungstyp extends APIv1_Controller $this->response(); } } - + private function _validate($buchungstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Dokument.php b/application/controllers/api/v1/crm/Dokument.php index 21c364cb6..11a603496 100644 --- a/application/controllers/api/v1/crm/Dokument.php +++ b/application/controllers/api/v1/crm/Dokument.php @@ -21,7 +21,7 @@ class Dokument extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Dokument' => 'basis/dokument:rw')); // Load model DokumentModel $this->load->model('crm/dokument_model', 'DokumentModel'); } @@ -32,11 +32,11 @@ class Dokument extends APIv1_Controller public function getDokument() { $dokument_kurzbz = $this->get('dokument_kurzbz'); - + if (isset($dokument_kurzbz)) { $result = $this->DokumentModel->load($dokument_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Dokument extends APIv1_Controller { $result = $this->DokumentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Dokument extends APIv1_Controller $this->response(); } } - + private function _validate($dokument = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Dokumentprestudent.php b/application/controllers/api/v1/crm/Dokumentprestudent.php index 9b7977ab0..020a876cd 100644 --- a/application/controllers/api/v1/crm/Dokumentprestudent.php +++ b/application/controllers/api/v1/crm/Dokumentprestudent.php @@ -21,7 +21,13 @@ class Dokumentprestudent extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Dokumentprestudent' => 'basis/dokumentprestudent:rw', + 'SetAccepted' => 'basis/dokumentprestudent:w', + 'SetAcceptedDocuments' => 'basis/dokumentprestudent:w' + ) + ); // Load model DokumentprestudentModel $this->load->model('crm/dokumentprestudent_model', 'DokumentprestudentModel'); } @@ -33,11 +39,11 @@ class Dokumentprestudent extends APIv1_Controller { $prestudent_id = $this->get('prestudent_id'); $dokument_kurzbz = $this->get('dokument_kurzbz'); - + if (isset($prestudent_id) && isset($dokument_kurzbz)) { $result = $this->DokumentprestudentModel->load(array($prestudent_id, $dokument_kurzbz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +67,7 @@ class Dokumentprestudent extends APIv1_Controller { $result = $this->DokumentprestudentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,7 +75,7 @@ class Dokumentprestudent extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -78,7 +84,7 @@ class Dokumentprestudent extends APIv1_Controller if (isset($this->post()['prestudent_id']) && isset($this->post()['studiengang_kz'])) { $result = $this->DokumentprestudentModel->setAccepted($this->post()['prestudent_id'], $this->post()['studiengang_kz']); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -86,7 +92,7 @@ class Dokumentprestudent extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -95,7 +101,7 @@ class Dokumentprestudent extends APIv1_Controller if (isset($this->post()['prestudent_id']) && is_array($this->post()['dokument_kurzbz'])) { $result = $this->DokumentprestudentModel->setAcceptedDocuments($this->post()['prestudent_id'], $this->post()['dokument_kurzbz']); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -103,9 +109,9 @@ class Dokumentprestudent extends APIv1_Controller $this->response(); } } - + private function _validate($dokumentprestudent = null) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Dokumentstudiengang.php b/application/controllers/api/v1/crm/Dokumentstudiengang.php index 09989198b..3e908d455 100644 --- a/application/controllers/api/v1/crm/Dokumentstudiengang.php +++ b/application/controllers/api/v1/crm/Dokumentstudiengang.php @@ -21,7 +21,12 @@ class Dokumentstudiengang extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Dokumentstudiengang' => 'basis/dokumentstudiengang:rw', + 'DokumentstudiengangByStudiengang_kz' => 'basis/dokumentstudiengang:r' + ) + ); // Load model DokumentstudiengangModel $this->load->model('crm/Dokumentstudiengang_model', 'DokumentstudiengangModel'); } @@ -33,11 +38,11 @@ class Dokumentstudiengang extends APIv1_Controller { $studiengang_kz = $this->get('studiengang_kz'); $dokument_kurzbz = $this->get('dokument_kurzbz'); - + if (isset($studiengang_kz) && isset($dokument_kurzbz)) { $result = $this->DokumentstudiengangModel->load(array($studiengang_kz, $dokument_kurzbz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -45,7 +50,7 @@ class Dokumentstudiengang extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -55,7 +60,7 @@ class Dokumentstudiengang extends APIv1_Controller $onlinebewerbung = $this->get('onlinebewerbung'); $pflicht = $this->get('pflicht'); $nachreichbar = $this->get('nachreichbar'); - + if (isset($studiengang_kz)) { $result = $this->DokumentstudiengangModel->getDokumentstudiengangByStudiengang_kz( @@ -64,7 +69,7 @@ class Dokumentstudiengang extends APIv1_Controller $pflicht, $nachreichbar ); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -92,7 +97,7 @@ class Dokumentstudiengang extends APIv1_Controller { $result = $this->DokumentstudiengangModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -100,9 +105,9 @@ class Dokumentstudiengang extends APIv1_Controller $this->response(); } } - + private function _validate($dokumentstudiengang = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Konto.php b/application/controllers/api/v1/crm/Konto.php index cbff97753..5a2cdafe2 100644 --- a/application/controllers/api/v1/crm/Konto.php +++ b/application/controllers/api/v1/crm/Konto.php @@ -21,11 +21,11 @@ class Konto extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Konto' => 'basis/konto:rw')); // Load model KontoModel $this->load->model('crm/konto_model', 'KontoModel'); - - + + } /** @@ -34,11 +34,11 @@ class Konto extends APIv1_Controller public function getKonto() { $buchungsnr = $this->get('buchungsnr'); - + if (isset($buchungsnr)) { $result = $this->KontoModel->load($buchungsnr); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Konto extends APIv1_Controller { $result = $this->KontoModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Konto extends APIv1_Controller $this->response(); } } - + private function _validate($konto = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Preincoming.php b/application/controllers/api/v1/crm/Preincoming.php index 42f305a57..14da2b9c3 100644 --- a/application/controllers/api/v1/crm/Preincoming.php +++ b/application/controllers/api/v1/crm/Preincoming.php @@ -21,11 +21,11 @@ class Preincoming extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preincoming' => 'basis/preincoming:rw')); // Load model PreincomingModel $this->load->model('crm/preincoming_model', 'PreincomingModel'); - - + + } /** @@ -34,11 +34,11 @@ class Preincoming extends APIv1_Controller public function getPreincoming() { $preincomingID = $this->get('preincoming_id'); - + if (isset($preincomingID)) { $result = $this->PreincomingModel->load($preincomingID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Preincoming extends APIv1_Controller { $result = $this->PreincomingModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Preincoming extends APIv1_Controller $this->response(); } } - + private function _validate($preincoming = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Preinteressent.php b/application/controllers/api/v1/crm/Preinteressent.php index 39f897df3..62c29dfda 100644 --- a/application/controllers/api/v1/crm/Preinteressent.php +++ b/application/controllers/api/v1/crm/Preinteressent.php @@ -21,11 +21,11 @@ class Preinteressent extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preinteressent' => 'basis/preinteressent:rw', 'PreinteressentByPersonID' => 'basis/preinteressent:r')); // Load model PersonModel $this->load->model('crm/preinteressent_model', 'PreinteressentModel'); - - + + } /** @@ -34,11 +34,11 @@ class Preinteressent extends APIv1_Controller public function getPreinteressent() { $preinteressent_id = $this->get('preinteressent_id'); - + if (isset($preinteressent_id)) { $result = $this->PreinteressentModel->load($preinteressent_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -46,18 +46,18 @@ class Preinteressent extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getPreinteressentByPersonID() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $result = $this->PreinteressentModel->load(array('person_id' => $person_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -81,7 +81,7 @@ class Preinteressent extends APIv1_Controller { $result = $this->PreinteressentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -89,7 +89,7 @@ class Preinteressent extends APIv1_Controller $this->response(); } } - + private function _validate($preinteressent) { if ($preinteressent['person_id'] == '') @@ -97,13 +97,13 @@ class Preinteressent extends APIv1_Controller //$this->errormsg = 'Person_id muss angegeben werden'; return false; } - + if ($preinteressent['aufmerksamdurch_kurzbz'] == '') { //$this->errormsg = 'Aufmerksamdurch muss angegeben werden'; return false; } - + return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Preinteressentstudiengang.php b/application/controllers/api/v1/crm/Preinteressentstudiengang.php index b4de9b3ab..e4e834ef9 100644 --- a/application/controllers/api/v1/crm/Preinteressentstudiengang.php +++ b/application/controllers/api/v1/crm/Preinteressentstudiengang.php @@ -21,11 +21,11 @@ class Preinteressentstudiengang extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preinteressentstudiengang' => 'basis/preinteressentstudiengang:rw')); // Load model PreinteressentstudiengangModel $this->load->model('crm/preinteressentstudiengang_model', 'PreinteressentstudiengangModel'); - - + + } /** @@ -35,11 +35,11 @@ class Preinteressentstudiengang extends APIv1_Controller { $preinteressent_id = $this->get('preinteressent_id'); $studiengang_kz = $this->get('studiengang_kz'); - + if (isset($preinteressent_id) && isset($studiengang_kz)) { $result = $this->PreinteressentstudiengangModel->load(array($preinteressent_id, $studiengang_kz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Preinteressentstudiengang extends APIv1_Controller { $result = $this->PreinteressentstudiengangModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Preinteressentstudiengang extends APIv1_Controller $this->response(); } } - + private function _validate($preinteressentstudiengang = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Preoutgoing.php b/application/controllers/api/v1/crm/Preoutgoing.php index 821befb91..733bd2eb9 100644 --- a/application/controllers/api/v1/crm/Preoutgoing.php +++ b/application/controllers/api/v1/crm/Preoutgoing.php @@ -21,11 +21,11 @@ class Preoutgoing extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preoutgoing' => 'basis/preoutgoing:rw')); // Load model PreoutgoingModel $this->load->model('crm/preoutgoing_model', 'PreoutgoingModel'); - - + + } /** @@ -34,11 +34,11 @@ class Preoutgoing extends APIv1_Controller public function getPreoutgoing() { $preoutgoingID = $this->get('preoutgoing_id'); - + if (isset($preoutgoingID)) { $result = $this->PreoutgoingModel->load($preoutgoingID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Preoutgoing extends APIv1_Controller { $result = $this->PreoutgoingModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Preoutgoing extends APIv1_Controller $this->response(); } } - + private function _validate($preoutgoing = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Prestudent.php b/application/controllers/api/v1/crm/Prestudent.php index 5d5ff063b..072ba3eea 100644 --- a/application/controllers/api/v1/crm/Prestudent.php +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -21,7 +21,18 @@ class Prestudent extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Prestudent' => 'basis/prestudent:rw', + 'PrestudentByPersonID' => 'basis/prestudent:r', + 'Specialization' => 'basis/prestudent:rw', + 'LastStatuses' => 'basis/prestudent:r', + 'PrestudentsPerStatus' => 'basis/prestudent:r', + 'RmSpecialization' => 'basis/prestudent:w', + 'AddReihungstest' => 'basis/prestudent:w', + 'DelReihungstest' => 'basis/prestudent:w' + ) + ); // Load model PrestudentModel $this->load->model('crm/prestudent_model', 'PrestudentModel'); // Load library ReihungstestLib diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php index 814bf0617..b72ac2fe9 100644 --- a/application/controllers/api/v1/crm/Prestudentstatus.php +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -21,7 +21,13 @@ class Prestudentstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Prestudentstatus' => 'basis/prestudentstatus:rw', + 'LastStatus' => 'basis/prestudentstatus:r', + 'StatusByFilter' => 'basis/prestudentstatus:r' + ) + ); // Load model PrestudentstatusModel $this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel'); } diff --git a/application/controllers/api/v1/crm/Reihungstest.php b/application/controllers/api/v1/crm/Reihungstest.php index 9062105e7..e9012d740 100644 --- a/application/controllers/api/v1/crm/Reihungstest.php +++ b/application/controllers/api/v1/crm/Reihungstest.php @@ -21,7 +21,14 @@ class Reihungstest extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Reihungstest' => 'basis/reihungstest:rw', + 'ByStudiengangStudiensemester' => 'basis/reihungstest:r', + 'ReihungstestByPersonID' => 'basis/reihungstest:r', + 'AvailableReihungstestByPersonId' => 'basis/reihungstest:r' + ) + ); // Load model ReihungstestModel $this->load->model('crm/Reihungstest_model', 'ReihungstestModel'); // Load library ReihungstestLib @@ -34,11 +41,11 @@ class Reihungstest extends APIv1_Controller public function getReihungstest() { $reihungstestID = $this->get('reihungstest_id'); - + if (isset($reihungstestID)) { $result = $this->ReihungstestModel->load($reihungstestID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -46,7 +53,7 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -55,7 +62,7 @@ class Reihungstest extends APIv1_Controller $studiengang_kz = $this->get('studiengang_kz'); $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); $available = $this->get('available'); - + if (isset($studiengang_kz)) { $parametersArray = array('studiengang_kz' => $studiengang_kz); @@ -68,7 +75,7 @@ class Reihungstest extends APIv1_Controller $parametersArray['anmeldefrist >='] = 'NOW()'; } $result = $this->ReihungstestModel->loadWhere($parametersArray); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -76,7 +83,7 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -84,11 +91,11 @@ class Reihungstest extends APIv1_Controller { $person_id = $this->get('person_id'); $available = $this->get('available'); - + if (isset($person_id)) { $result = $this->reihungstestlib->getReihungstestByPersonID($person_id, $available); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -96,20 +103,20 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getAvailableReihungstestByPersonId() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); - + $result = $this->StudiengangModel->getAvailableReihungstestByPersonId($person_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -133,7 +140,7 @@ class Reihungstest extends APIv1_Controller { $result = $this->ReihungstestModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -141,9 +148,9 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + private function _validate($reihungstest = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/RtPerson.php b/application/controllers/api/v1/crm/RtPerson.php index a7478ae5f..9f251052f 100644 --- a/application/controllers/api/v1/crm/RtPerson.php +++ b/application/controllers/api/v1/crm/RtPerson.php @@ -21,7 +21,7 @@ class RtPerson extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('RtPerson' => 'basis/rtperson:rw')); // Load model StatusModel $this->load->model("crm/RtPerson_model", "RtPersonModel"); } @@ -32,11 +32,11 @@ class RtPerson extends APIv1_Controller public function getRtPerson() { $rt_person_id = $this->get("rt_person_id"); - + if (isset($rt_person_id)) { $result = $this->RtPersonModel->load($rt_person_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class RtPerson extends APIv1_Controller { $result = $this->RtPersonModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class RtPerson extends APIv1_Controller $this->response(); } } - + private function _validate($rtPerson = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Status.php b/application/controllers/api/v1/crm/Status.php index 4eb1b1834..37a8fbd11 100644 --- a/application/controllers/api/v1/crm/Status.php +++ b/application/controllers/api/v1/crm/Status.php @@ -21,11 +21,11 @@ class Status extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Status' => 'basis/status:rw')); // Load model StatusModel $this->load->model('crm/status_model', 'StatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Status extends APIv1_Controller public function getStatus() { $status_kurzbz = $this->get('status_kurzbz'); - + if (isset($status_kurzbz)) { $result = $this->StatusModel->load($status_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Status extends APIv1_Controller { $result = $this->StatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Status extends APIv1_Controller $this->response(); } } - + private function _validate($status = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Statusgrund.php b/application/controllers/api/v1/crm/Statusgrund.php index 55241ed16..3f19f2f82 100644 --- a/application/controllers/api/v1/crm/Statusgrund.php +++ b/application/controllers/api/v1/crm/Statusgrund.php @@ -21,7 +21,7 @@ class Statusgrund extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Statusgrund' => 'basis/statusgrund:rw')); // Load model StatusModel $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); } @@ -32,11 +32,11 @@ class Statusgrund extends APIv1_Controller public function getStatusgrund() { $statusgrund_kurzbz = $this->get('statusgrund_kurzbz'); - + if (isset($statusgrund_kurzbz)) { $result = $this->StatusgrundModel->load($statusgrund_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Statusgrund extends APIv1_Controller { $result = $this->StatusgrundModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Statusgrund extends APIv1_Controller $this->response(); } } - + private function _validate($statusgrund = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Student.php b/application/controllers/api/v1/crm/Student.php index c95e4b16f..6227cb6e3 100644 --- a/application/controllers/api/v1/crm/Student.php +++ b/application/controllers/api/v1/crm/Student.php @@ -21,11 +21,11 @@ class Student extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Student' => 'basis/student:rw')); // Load model StudentModel $this->load->model('crm/student_model', 'StudentModel'); - - + + } /** @@ -34,11 +34,11 @@ class Student extends APIv1_Controller public function getStudent() { $studentID = $this->get('student_id'); - + if (isset($studentID)) { $result = $this->StudentModel->load($studentID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Student extends APIv1_Controller { $result = $this->StudentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Student extends APIv1_Controller $this->response(); } } - + private function _validate($student = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Abgabe.php b/application/controllers/api/v1/education/Abgabe.php index 6215b43ed..e3fd64530 100644 --- a/application/controllers/api/v1/education/Abgabe.php +++ b/application/controllers/api/v1/education/Abgabe.php @@ -21,7 +21,7 @@ class Abgabe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Abgabe' => 'basis/abgabe:rw')); // Load model AbgabeModel $this->load->model('education/Abgabe_model', 'AbgabeModel'); } @@ -32,11 +32,11 @@ class Abgabe extends APIv1_Controller public function getAbgabe() { $abgabe_id = $this->get('abgabe_id'); - + if (isset($abgabe_id)) { $result = $this->AbgabeModel->load($abgabe_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Abgabe extends APIv1_Controller { $result = $this->AbgabeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Abgabe extends APIv1_Controller $this->response(); } } - + private function _validate($abgabe = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Abschlussbeurteilung.php b/application/controllers/api/v1/education/Abschlussbeurteilung.php index 1ca830e41..1987e276f 100644 --- a/application/controllers/api/v1/education/Abschlussbeurteilung.php +++ b/application/controllers/api/v1/education/Abschlussbeurteilung.php @@ -21,7 +21,7 @@ class Abschlussbeurteilung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Abschlussbeurteilung' => 'basis/abschlussbeurteilung:rw')); // Load model AbschlussbeurteilungModel $this->load->model('education/Abschlussbeurteilung_model', 'AbschlussbeurteilungModel'); } @@ -32,11 +32,11 @@ class Abschlussbeurteilung extends APIv1_Controller public function getAbschlussbeurteilung() { $abschlussbeurteilung_kurzbz = $this->get('abschlussbeurteilung_kurzbz'); - + if (isset($abschlussbeurteilung_kurzbz)) { $result = $this->AbschlussbeurteilungModel->load($abschlussbeurteilung_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Abschlussbeurteilung extends APIv1_Controller { $result = $this->AbschlussbeurteilungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Abschlussbeurteilung extends APIv1_Controller $this->response(); } } - + private function _validate($abschlussbeurteilung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Abschlusspruefung.php b/application/controllers/api/v1/education/Abschlusspruefung.php index e46ce14e7..cadea53ca 100644 --- a/application/controllers/api/v1/education/Abschlusspruefung.php +++ b/application/controllers/api/v1/education/Abschlusspruefung.php @@ -21,7 +21,7 @@ class Abschlusspruefung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Abschlusspruefung' => 'basis/abschlusspruefung:rw')); // Load model AbschlusspruefungModel $this->load->model('education/Abschlusspruefung_model', 'AbschlusspruefungModel'); } @@ -32,11 +32,11 @@ class Abschlusspruefung extends APIv1_Controller public function getAbschlusspruefung() { $abschlusspruefung_id = $this->get('abschlusspruefung_id'); - + if (isset($abschlusspruefung_id)) { $result = $this->AbschlusspruefungModel->load($abschlusspruefung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Abschlusspruefung extends APIv1_Controller { $result = $this->AbschlusspruefungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Abschlusspruefung extends APIv1_Controller $this->response(); } } - + private function _validate($abschlusspruefung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Anrechnung.php b/application/controllers/api/v1/education/Anrechnung.php index abf469da8..5a99b08ab 100644 --- a/application/controllers/api/v1/education/Anrechnung.php +++ b/application/controllers/api/v1/education/Anrechnung.php @@ -21,7 +21,7 @@ class Anrechnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Anrechnung' => 'basis/anrechnung:rw')); // Load model AnrechnungModel $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); } @@ -32,11 +32,11 @@ class Anrechnung extends APIv1_Controller public function getAnrechnung() { $anrechnung_id = $this->get('anrechnung_id'); - + if (isset($anrechnung_id)) { $result = $this->AnrechnungModel->load($anrechnung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Anrechnung extends APIv1_Controller { $result = $this->AnrechnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Anrechnung extends APIv1_Controller $this->response(); } } - + private function _validate($anrechnung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Anwesenheit.php b/application/controllers/api/v1/education/Anwesenheit.php index e74101ee0..2e915f071 100644 --- a/application/controllers/api/v1/education/Anwesenheit.php +++ b/application/controllers/api/v1/education/Anwesenheit.php @@ -21,7 +21,7 @@ class Anwesenheit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Anwesenheit' => 'basis/anwesenheit:rw')); // Load model AnwesenheitModel $this->load->model('education/Anwesenheit_model', 'AnwesenheitModel'); } @@ -32,11 +32,11 @@ class Anwesenheit extends APIv1_Controller public function getAnwesenheit() { $anwesenheit_id = $this->get('anwesenheit_id'); - + if (isset($anwesenheit_id)) { $result = $this->AnwesenheitModel->load($anwesenheit_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Anwesenheit extends APIv1_Controller { $result = $this->AnwesenheitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Anwesenheit extends APIv1_Controller $this->response(); } } - + private function _validate($anwesenheit = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Beispiel.php b/application/controllers/api/v1/education/Beispiel.php index b0fecfea6..b2c06047b 100644 --- a/application/controllers/api/v1/education/Beispiel.php +++ b/application/controllers/api/v1/education/Beispiel.php @@ -21,7 +21,7 @@ class Beispiel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Beispiel' => 'basis/beispiel:rw')); // Load model BeispielModel $this->load->model('education/Beispiel_model', 'BeispielModel'); } @@ -32,11 +32,11 @@ class Beispiel extends APIv1_Controller public function getBeispiel() { $beispiel_id = $this->get('beispiel_id'); - + if (isset($beispiel_id)) { $result = $this->BeispielModel->load($beispiel_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Beispiel extends APIv1_Controller { $result = $this->BeispielModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Beispiel extends APIv1_Controller $this->response(); } } - + private function _validate($beispiel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Betreuerart.php b/application/controllers/api/v1/education/Betreuerart.php index a076bf5fd..43b4c51f6 100644 --- a/application/controllers/api/v1/education/Betreuerart.php +++ b/application/controllers/api/v1/education/Betreuerart.php @@ -21,7 +21,7 @@ class Betreuerart extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betreuerart' => 'basis/betreuerart:rw')); // Load model BetreuerartModel $this->load->model('education/Betreuerart_model', 'BetreuerartModel'); } @@ -32,11 +32,11 @@ class Betreuerart extends APIv1_Controller public function getBetreuerart() { $betreuerart_id = $this->get('betreuerart_kurzbz'); - + if (isset($betreuerart_id)) { $result = $this->BetreuerartModel->load($betreuerart_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Betreuerart extends APIv1_Controller { $result = $this->BetreuerartModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Betreuerart extends APIv1_Controller $this->response(); } } - + private function _validate($betreuerart = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Feedback.php b/application/controllers/api/v1/education/Feedback.php index 0d205d3b0..abef22d77 100644 --- a/application/controllers/api/v1/education/Feedback.php +++ b/application/controllers/api/v1/education/Feedback.php @@ -21,7 +21,7 @@ class Feedback extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Feedback' => 'basis/feedback:rw')); // Load model FeedbackModel $this->load->model('education/Feedback_model', 'FeedbackModel'); } @@ -32,11 +32,11 @@ class Feedback extends APIv1_Controller public function getFeedback() { $feedback_id = $this->get('feedback_id'); - + if (isset($feedback_id)) { $result = $this->FeedbackModel->load($feedback_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Feedback extends APIv1_Controller { $result = $this->FeedbackModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Feedback extends APIv1_Controller $this->response(); } } - + private function _validate($feedback = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Legesamtnote.php b/application/controllers/api/v1/education/Legesamtnote.php index adc4af365..96ff25c4f 100644 --- a/application/controllers/api/v1/education/Legesamtnote.php +++ b/application/controllers/api/v1/education/Legesamtnote.php @@ -21,7 +21,7 @@ class Legesamtnote extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Legesamtnote' => 'basis/legesamtnote:rw')); // Load model LegesamtnoteModel $this->load->model('education/Legesamtnote_model', 'LegesamtnoteModel'); } @@ -33,11 +33,11 @@ class Legesamtnote extends APIv1_Controller { $lehreinheit_id = $this->get('lehreinheit_id'); $student_uid = $this->get('student_uid'); - + if (isset($lehreinheit_id) && isset($student_uid)) { $result = $this->LegesamtnoteModel->load(array($lehreinheit_id, $student_uid)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Legesamtnote extends APIv1_Controller { $result = $this->LegesamtnoteModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Legesamtnote extends APIv1_Controller $this->response(); } } - + private function _validate($legesamtnote = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lehreinheit.php b/application/controllers/api/v1/education/Lehreinheit.php index 7fe1a8e44..f229de846 100644 --- a/application/controllers/api/v1/education/Lehreinheit.php +++ b/application/controllers/api/v1/education/Lehreinheit.php @@ -21,7 +21,7 @@ class Lehreinheit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehreinheit' => 'basis/lehreinheit:rw')); // Load model LehreinheitModel $this->load->model('education/Lehreinheit_model', 'LehreinheitModel'); } @@ -32,11 +32,11 @@ class Lehreinheit extends APIv1_Controller public function getLehreinheit() { $lehreinheit_id = $this->get('lehreinheit_id'); - + if (isset($lehreinheit_id)) { $result = $this->LehreinheitModel->load($lehreinheit_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lehreinheit extends APIv1_Controller { $result = $this->LehreinheitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehreinheit extends APIv1_Controller $this->response(); } } - + private function _validate($lehreinheit = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lehreinheitgruppe.php b/application/controllers/api/v1/education/Lehreinheitgruppe.php index cc2a41242..6ef949d3e 100644 --- a/application/controllers/api/v1/education/Lehreinheitgruppe.php +++ b/application/controllers/api/v1/education/Lehreinheitgruppe.php @@ -21,7 +21,7 @@ class Lehreinheitgruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehreinheitgruppe' => 'basis/lehreinheitgruppe:rw')); // Load model LehreinheitgruppeModel $this->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel'); } @@ -32,11 +32,11 @@ class Lehreinheitgruppe extends APIv1_Controller public function getLehreinheitgruppe() { $lehreinheitgruppe_id = $this->get('lehreinheitgruppe_id'); - + if (isset($lehreinheitgruppe_id)) { $result = $this->LehreinheitgruppeModel->load($lehreinheitgruppe_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lehreinheitgruppe extends APIv1_Controller { $result = $this->LehreinheitgruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehreinheitgruppe extends APIv1_Controller $this->response(); } } - + private function _validate($lehreinheitgruppe = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php b/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php index e3cd51018..5237ca849 100644 --- a/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php +++ b/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php @@ -21,7 +21,7 @@ class Lehreinheitmitarbeiter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehreinheitmitarbeiter' => 'basis/lehreinheitmitarbeiter:rw')); // Load model LehreinheitmitarbeiterModel $this->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel'); } @@ -33,11 +33,11 @@ class Lehreinheitmitarbeiter extends APIv1_Controller { $mitarbeiter_uid = $this->get('mitarbeiter_uid'); $lehreinheit_id = $this->get('lehreinheit_id'); - + if (isset($mitarbeiter_uid) && isset($lehreinheit_id)) { $result = $this->LehreinheitmitarbeiterModel->load(array($mitarbeiter_uid, $lehreinheit_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Lehreinheitmitarbeiter extends APIv1_Controller { $result = $this->LehreinheitmitarbeiterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Lehreinheitmitarbeiter extends APIv1_Controller $this->response(); } } - + private function _validate($lehreinheitmitarbeiter = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lehrfach.php b/application/controllers/api/v1/education/Lehrfach.php index 8fca6fc61..81ce519e1 100644 --- a/application/controllers/api/v1/education/Lehrfach.php +++ b/application/controllers/api/v1/education/Lehrfach.php @@ -21,7 +21,7 @@ class Lehrfach extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrfach' => 'basis/lehrfach:rw')); // Load model LehrfachModel $this->load->model('education/Lehrfach_model', 'LehrfachModel'); } @@ -32,11 +32,11 @@ class Lehrfach extends APIv1_Controller public function getLehrfach() { $lehrfach_id = $this->get('lehrfach_id'); - + if (isset($lehrfach_id)) { $result = $this->LehrfachModel->load($lehrfach_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lehrfach extends APIv1_Controller { $result = $this->LehrfachModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrfach extends APIv1_Controller $this->response(); } } - + private function _validate($lehrfach = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lehrfunktion.php b/application/controllers/api/v1/education/Lehrfunktion.php index 227526d8a..e29f1227d 100644 --- a/application/controllers/api/v1/education/Lehrfunktion.php +++ b/application/controllers/api/v1/education/Lehrfunktion.php @@ -21,7 +21,7 @@ class Lehrfunktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrfunktion' => 'basis/lehrfunktion:rw')); // Load model LehrfunktionModel $this->load->model('education/Lehrfunktion_model', 'LehrfunktionModel'); } @@ -32,11 +32,11 @@ class Lehrfunktion extends APIv1_Controller public function getLehrfunktion() { $lehrfunktion_kurzbz = $this->get('lehrfunktion_kurzbz'); - + if (isset($lehrfunktion_kurzbz)) { $result = $this->LehrfunktionModel->load($lehrfunktion_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lehrfunktion extends APIv1_Controller { $result = $this->LehrfunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrfunktion extends APIv1_Controller $this->response(); } } - + private function _validate($lehrfunktion = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lehrtyp.php b/application/controllers/api/v1/education/Lehrtyp.php index 210f9ffc6..dfcfd3033 100644 --- a/application/controllers/api/v1/education/Lehrtyp.php +++ b/application/controllers/api/v1/education/Lehrtyp.php @@ -21,7 +21,7 @@ class Lehrtyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrtyp' => 'basis/lehrtyp:rw')); // Load model LehrtypModel $this->load->model('education/Lehrtyp_model', 'LehrtypModel'); } @@ -32,11 +32,11 @@ class Lehrtyp extends APIv1_Controller public function getLehrtyp() { $lehrtyp_kurzbz = $this->get('lehrtyp_kurzbz'); - + if (isset($lehrtyp_kurzbz)) { $result = $this->LehrtypModel->load($lehrtyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lehrtyp extends APIv1_Controller { $result = $this->LehrtypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrtyp extends APIv1_Controller $this->response(); } } - + private function _validate($lehrtyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lehrveranstaltung.php b/application/controllers/api/v1/education/Lehrveranstaltung.php index 6604600df..2e2fffb66 100644 --- a/application/controllers/api/v1/education/Lehrveranstaltung.php +++ b/application/controllers/api/v1/education/Lehrveranstaltung.php @@ -21,7 +21,7 @@ class Lehrveranstaltung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrveranstaltung' => 'basis/lehrveranstaltung:rw')); // Load model LehrveranstaltungModel $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); } @@ -32,11 +32,11 @@ class Lehrveranstaltung extends APIv1_Controller public function getLehrveranstaltung() { $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); - + if (isset($lehrveranstaltung_id)) { $result = $this->LehrveranstaltungModel->load($lehrveranstaltung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lehrveranstaltung extends APIv1_Controller { $result = $this->LehrveranstaltungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrveranstaltung extends APIv1_Controller $this->response(); } } - + private function _validate($lehrveranstaltung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lenotenschluessel.php b/application/controllers/api/v1/education/Lenotenschluessel.php index 235328ed7..9477172a3 100644 --- a/application/controllers/api/v1/education/Lenotenschluessel.php +++ b/application/controllers/api/v1/education/Lenotenschluessel.php @@ -21,11 +21,11 @@ class Lenotenschluessel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('LeNotenschluessel' => 'basis/lenotenschluessel:rw')); // Load model LeNotenschluesselModel $this->load->model('education/LeNotenschluessel_model', 'LeNotenschluesselModel'); - - + + } /** @@ -35,11 +35,11 @@ class Lenotenschluessel extends APIv1_Controller { $note = $this->get('note'); $lehreinheit_id = $this->get('lehreinheit_id'); - + if (isset($note) && isset($lehreinheit_id)) { $result = $this->LeNotenschluesselModel->load(array($note, $lehreinheit_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Lenotenschluessel extends APIv1_Controller { $result = $this->LeNotenschluesselModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Lenotenschluessel extends APIv1_Controller $this->response(); } } - + private function _validate($lenotenschluessel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lepruefung.php b/application/controllers/api/v1/education/Lepruefung.php index 283987d49..52e1d81b6 100644 --- a/application/controllers/api/v1/education/Lepruefung.php +++ b/application/controllers/api/v1/education/Lepruefung.php @@ -21,7 +21,7 @@ class Lepruefung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('LePruefung' => 'basis/lepruefung:rw')); // Load model LePruefungModel $this->load->model('education/LePruefung_model', 'LePruefungModel'); } @@ -32,11 +32,11 @@ class Lepruefung extends APIv1_Controller public function getLePruefung() { $lepruefung_id = $this->get('lepruefung_id'); - + if (isset($lepruefung_id)) { $result = $this->LePruefungModel->load($lepruefung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lepruefung extends APIv1_Controller { $result = $this->LePruefungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lepruefung extends APIv1_Controller $this->response(); } } - + private function _validate($lepruefung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lvangebot.php b/application/controllers/api/v1/education/Lvangebot.php index ec464abf3..ecd917233 100644 --- a/application/controllers/api/v1/education/Lvangebot.php +++ b/application/controllers/api/v1/education/Lvangebot.php @@ -21,7 +21,7 @@ class Lvangebot extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvangebot' => 'basis/lvangebot:rw')); // Load model LvangebotModel $this->load->model('education/Lvangebot_model', 'LvangebotModel'); } @@ -32,11 +32,11 @@ class Lvangebot extends APIv1_Controller public function getLvangebot() { $lvangebot_id = $this->get('lvangebot_id'); - + if (isset($lvangebot_id)) { $result = $this->LvangebotModel->load($lvangebot_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lvangebot extends APIv1_Controller { $result = $this->LvangebotModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lvangebot extends APIv1_Controller $this->response(); } } - + private function _validate($lvangebot = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lvgesamtnote.php b/application/controllers/api/v1/education/Lvgesamtnote.php index a0813add8..464ef99a9 100644 --- a/application/controllers/api/v1/education/Lvgesamtnote.php +++ b/application/controllers/api/v1/education/Lvgesamtnote.php @@ -21,7 +21,7 @@ class Lvgesamtnote extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvgesamtnote' => 'basis/lvgesamtnote:rw')); // Load model LvgesamtnoteModel $this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel'); } @@ -34,11 +34,11 @@ class Lvgesamtnote extends APIv1_Controller $student_uid = $this->get('student_uid'); $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); - + if (isset($student_uid) && isset($studiensemester_kurzbz) && isset($lehrveranstaltung_id)) { $result = $this->LvgesamtnoteModel->load(array($student_uid, $studiensemester_kurzbz, $lehrveranstaltung_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,14 +60,14 @@ class Lvgesamtnote extends APIv1_Controller $this->post()['studiensemester_kurzbz'], $this->post()['lehrveranstaltung_id'] ); - + $result = $this->LvgesamtnoteModel->update($pksArray, $this->post()); } else { $result = $this->LvgesamtnoteModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -75,9 +75,9 @@ class Lvgesamtnote extends APIv1_Controller $this->response(); } } - + private function _validate($lvgesamtnote = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lvinfo.php b/application/controllers/api/v1/education/Lvinfo.php index 0b7a3c827..8631583b9 100644 --- a/application/controllers/api/v1/education/Lvinfo.php +++ b/application/controllers/api/v1/education/Lvinfo.php @@ -21,7 +21,7 @@ class Lvinfo extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvinfo' => 'basis/lvinfo:rw')); // Load model LvinfoModel $this->load->model('education/Lvinfo_model', 'LvinfoModel'); } @@ -33,11 +33,11 @@ class Lvinfo extends APIv1_Controller { $sprache = $this->get('sprache'); $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); - + if (isset($sprache) && isset($lehrveranstaltung_id)) { $result = $this->LvinfoModel->load(array($sprache, $lehrveranstaltung_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Lvinfo extends APIv1_Controller { $result = $this->LvinfoModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Lvinfo extends APIv1_Controller $this->response(); } } - + private function _validate($lvinfo = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lvregel.php b/application/controllers/api/v1/education/Lvregel.php index 8766add07..33410cb88 100644 --- a/application/controllers/api/v1/education/Lvregel.php +++ b/application/controllers/api/v1/education/Lvregel.php @@ -21,7 +21,7 @@ class Lvregel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvregel' => 'basis/lvregel:rw')); // Load model LvregelModel $this->load->model('education/Lvregel_model', 'LvregelModel'); } @@ -32,11 +32,11 @@ class Lvregel extends APIv1_Controller public function getLvregel() { $lvregel_id = $this->get('lvregel_id'); - + if (isset($lvregel_id)) { $result = $this->LvregelModel->load($lvregel_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lvregel extends APIv1_Controller { $result = $this->LvregelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lvregel extends APIv1_Controller $this->response(); } } - + private function _validate($lvregel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Lvregeltyp.php b/application/controllers/api/v1/education/Lvregeltyp.php index 912cb3e11..22fe0a9ff 100644 --- a/application/controllers/api/v1/education/Lvregeltyp.php +++ b/application/controllers/api/v1/education/Lvregeltyp.php @@ -21,7 +21,7 @@ class Lvregeltyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvregeltyp' => 'basis/lvregeltyp:rw')); // Load model LvregeltypModel $this->load->model('education/Lvregeltyp_model', 'LvregeltypModel'); } @@ -32,11 +32,11 @@ class Lvregeltyp extends APIv1_Controller public function getLvregeltyp() { $lvregeltyp_kurzbz = $this->get('lvregeltyp_kurzbz'); - + if (isset($lvregeltyp_kurzbz)) { $result = $this->LvregeltypModel->load($lvregeltyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lvregeltyp extends APIv1_Controller { $result = $this->LvregeltypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lvregeltyp extends APIv1_Controller $this->response(); } } - + private function _validate($lvregeltyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Notenschluessel.php b/application/controllers/api/v1/education/Notenschluessel.php index 62ac99afb..91c7c513e 100644 --- a/application/controllers/api/v1/education/Notenschluessel.php +++ b/application/controllers/api/v1/education/Notenschluessel.php @@ -21,7 +21,7 @@ class Notenschluessel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluessel' => 'basis/notenschluessel:rw')); // Load model NotenschluesselModel $this->load->model('education/Notenschluessel_model', 'NotenschluesselModel'); } @@ -32,11 +32,11 @@ class Notenschluessel extends APIv1_Controller public function getNotenschluessel() { $notenschluessel_kurzbz = $this->get('notenschluessel_kurzbz'); - + if (isset($notenschluessel_kurzbz)) { $result = $this->NotenschluesselModel->load($notenschluessel_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Notenschluessel extends APIv1_Controller { $result = $this->NotenschluesselModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Notenschluessel extends APIv1_Controller $this->response(); } } - + private function _validate($notenschluessel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Notenschluesselaufteilung.php b/application/controllers/api/v1/education/Notenschluesselaufteilung.php index eb9e1c848..1e4b168ef 100644 --- a/application/controllers/api/v1/education/Notenschluesselaufteilung.php +++ b/application/controllers/api/v1/education/Notenschluesselaufteilung.php @@ -21,7 +21,7 @@ class Notenschluesselaufteilung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluesselaufteilung' => 'basis/notenschluesselaufteilung:rw')); // Load model NotenschluesselaufteilungModel $this->load->model('education/Notenschluesselaufteilung_model', 'NotenschluesselaufteilungModel'); } @@ -32,11 +32,11 @@ class Notenschluesselaufteilung extends APIv1_Controller public function getNotenschluesselaufteilung() { $notenschluesselaufteilung_id = $this->get('notenschluesselaufteilung_id'); - + if (isset($notenschluesselaufteilung_id)) { $result = $this->NotenschluesselaufteilungModel->load($notenschluesselaufteilung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Notenschluesselaufteilung extends APIv1_Controller { $result = $this->NotenschluesselaufteilungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Notenschluesselaufteilung extends APIv1_Controller $this->response(); } } - + private function _validate($notenschluesselaufteilung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Notenschluesseluebung.php b/application/controllers/api/v1/education/Notenschluesseluebung.php index e50319c2b..bb907f4ff 100644 --- a/application/controllers/api/v1/education/Notenschluesseluebung.php +++ b/application/controllers/api/v1/education/Notenschluesseluebung.php @@ -21,7 +21,7 @@ class Notenschluesseluebung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluesseluebung' => 'basis/notenschluesseluebung:rw')); // Load model NotenschluesseluebungModel $this->load->model('education/Notenschluesseluebung_model', 'NotenschluesseluebungModel'); } @@ -33,11 +33,11 @@ class Notenschluesseluebung extends APIv1_Controller { $note = $this->get('note'); $uebung_id = $this->get('uebung_id'); - + if (isset($note) && isset($uebung_id)) { $result = $this->NotenschluesseluebungModel->load(array($note, $uebung_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Notenschluesseluebung extends APIv1_Controller { $result = $this->NotenschluesseluebungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Notenschluesseluebung extends APIv1_Controller $this->response(); } } - + private function _validate($notenschluesseluebung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Notenschluesselzuordnung.php b/application/controllers/api/v1/education/Notenschluesselzuordnung.php index 18efc95d7..a4e7d757a 100644 --- a/application/controllers/api/v1/education/Notenschluesselzuordnung.php +++ b/application/controllers/api/v1/education/Notenschluesselzuordnung.php @@ -21,7 +21,7 @@ class Notenschluesselzuordnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluesselzuordnung' => 'basis/notenschluesselzuordnung:rw')); // Load model NotenschluesselzuordnungModel $this->load->model('education/Notenschluesselzuordnung_model', 'NotenschluesselzuordnungModel'); } @@ -32,11 +32,11 @@ class Notenschluesselzuordnung extends APIv1_Controller public function getNotenschluesselzuordnung() { $notenschluesselzuordnung_id = $this->get('notenschluesselzuordnung_id'); - + if (isset($notenschluesselzuordnung_id)) { $result = $this->NotenschluesselzuordnungModel->load($notenschluesselzuordnung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Notenschluesselzuordnung extends APIv1_Controller { $result = $this->NotenschluesselzuordnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Notenschluesselzuordnung extends APIv1_Controller $this->response(); } } - + private function _validate($notenschluesselzuordnung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Paabgabe.php b/application/controllers/api/v1/education/Paabgabe.php index 4f81ca9d1..87e9c2ec7 100644 --- a/application/controllers/api/v1/education/Paabgabe.php +++ b/application/controllers/api/v1/education/Paabgabe.php @@ -21,7 +21,7 @@ class Paabgabe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Paabgabe' => 'basis/paabgabe:rw')); // Load model PaabgabeModel $this->load->model('education/Paabgabe_model', 'PaabgabeModel'); } @@ -32,11 +32,11 @@ class Paabgabe extends APIv1_Controller public function getPaabgabe() { $paabgabe_id = $this->get('paabgabe_id'); - + if (isset($paabgabe_id)) { $result = $this->PaabgabeModel->load($paabgabe_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Paabgabe extends APIv1_Controller { $result = $this->PaabgabeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Paabgabe extends APIv1_Controller $this->response(); } } - + private function _validate($paabgabe = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Paabgabetyp.php b/application/controllers/api/v1/education/Paabgabetyp.php index 248c609d9..999cbd57b 100644 --- a/application/controllers/api/v1/education/Paabgabetyp.php +++ b/application/controllers/api/v1/education/Paabgabetyp.php @@ -21,7 +21,7 @@ class Paabgabetyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Paabgabetyp' => 'basis/paabgabetyp:rw')); // Load model PaabgabetypModel $this->load->model('education/Paabgabetyp_model', 'PaabgabetypModel'); } @@ -32,11 +32,11 @@ class Paabgabetyp extends APIv1_Controller public function getPaabgabetyp() { $paabgabetyp_kurzbz = $this->get('paabgabetyp_kurzbz'); - + if (isset($paabgabetyp_kurzbz)) { $result = $this->PaabgabetypModel->load($paabgabetyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Paabgabetyp extends APIv1_Controller { $result = $this->PaabgabetypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Paabgabetyp extends APIv1_Controller $this->response(); } } - + private function _validate($paabgabetyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Projektarbeit.php b/application/controllers/api/v1/education/Projektarbeit.php index 7a6b32123..1b09fa4e7 100644 --- a/application/controllers/api/v1/education/Projektarbeit.php +++ b/application/controllers/api/v1/education/Projektarbeit.php @@ -21,7 +21,7 @@ class Projektarbeit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projektarbeit' => 'basis/projektarbeit:rw')); // Load model ProjektarbeitModel $this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel'); } @@ -32,11 +32,11 @@ class Projektarbeit extends APIv1_Controller public function getProjektarbeit() { $projektarbeit_id = $this->get('projektarbeit_id'); - + if (isset($projektarbeit_id)) { $result = $this->ProjektarbeitModel->load($projektarbeit_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Projektarbeit extends APIv1_Controller { $result = $this->ProjektarbeitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Projektarbeit extends APIv1_Controller $this->response(); } } - + private function _validate($projektarbeit = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Projektbetreuer.php b/application/controllers/api/v1/education/Projektbetreuer.php index d4d211137..b395b7e5f 100644 --- a/application/controllers/api/v1/education/Projektbetreuer.php +++ b/application/controllers/api/v1/education/Projektbetreuer.php @@ -21,7 +21,7 @@ class Projektbetreuer extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projektbetreuer' => 'basis/projektbetreuer:rw')); // Load model ProjektbetreuerModel $this->load->model('education/Projektbetreuer_model', 'ProjektbetreuerModel'); } @@ -34,11 +34,11 @@ class Projektbetreuer extends APIv1_Controller $betreuerart_kurzbz = $this->get('betreuerart_kurzbz'); $projektarbeit_id = $this->get('projektarbeit_id'); $person_id = $this->get('person_id'); - + if (isset($betreuerart_kurzbz) && isset($projektarbeit_id) && isset($person_id)) { $result = $this->ProjektbetreuerModel->load(array($betreuerart_kurzbz, $projektarbeit_id, $person_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,14 +60,14 @@ class Projektbetreuer extends APIv1_Controller $this->post()['projektarbeit_id'], $this->post()['person_id'] ); - + $result = $this->ProjektbetreuerModel->update($pksArray, $this->post()); } else { $result = $this->ProjektbetreuerModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -75,9 +75,9 @@ class Projektbetreuer extends APIv1_Controller $this->response(); } } - + private function _validate($projektbetreuer = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Projekttyp.php b/application/controllers/api/v1/education/Projekttyp.php index a0d70fec1..bf4c5d73a 100644 --- a/application/controllers/api/v1/education/Projekttyp.php +++ b/application/controllers/api/v1/education/Projekttyp.php @@ -21,7 +21,7 @@ class Projekttyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekttyp' => 'basis/projekttyp:rw')); // Load model ProjekttypModel $this->load->model('education/Projekttyp_model', 'ProjekttypModel'); } @@ -32,11 +32,11 @@ class Projekttyp extends APIv1_Controller public function getProjekttyp() { $projekttyp_kurzbz = $this->get('projekttyp_kurzbz'); - + if (isset($projekttyp_kurzbz)) { $result = $this->ProjekttypModel->load($projekttyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Projekttyp extends APIv1_Controller { $result = $this->ProjekttypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Projekttyp extends APIv1_Controller $this->response(); } } - + private function _validate($projekttyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Pruefung.php b/application/controllers/api/v1/education/Pruefung.php index f402f035e..23fc97c8d 100644 --- a/application/controllers/api/v1/education/Pruefung.php +++ b/application/controllers/api/v1/education/Pruefung.php @@ -21,7 +21,7 @@ class Pruefung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefung' => 'basis/pruefung:rw')); // Load model PruefungModel $this->load->model('education/Pruefung_model', 'PruefungModel'); } @@ -32,11 +32,11 @@ class Pruefung extends APIv1_Controller public function getPruefung() { $pruefung_id = $this->get('pruefung_id'); - + if (isset($pruefung_id)) { $result = $this->PruefungModel->load($pruefung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Pruefung extends APIv1_Controller { $result = $this->PruefungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefung extends APIv1_Controller $this->response(); } } - + private function _validate($pruefung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Pruefungsanmeldung.php b/application/controllers/api/v1/education/Pruefungsanmeldung.php index 286a77c1e..d65ded0b4 100644 --- a/application/controllers/api/v1/education/Pruefungsanmeldung.php +++ b/application/controllers/api/v1/education/Pruefungsanmeldung.php @@ -21,7 +21,7 @@ class Pruefungsanmeldung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungsanmeldung' => 'basis/pruefungsanmeldung:rw')); // Load model PruefungsanmeldungModel $this->load->model('education/Pruefungsanmeldung_model', 'PruefungsanmeldungModel'); } @@ -32,11 +32,11 @@ class Pruefungsanmeldung extends APIv1_Controller public function getPruefungsanmeldung() { $pruefungsanmeldung_id = $this->get('pruefungsanmeldung_id'); - + if (isset($pruefungsanmeldung_id)) { $result = $this->PruefungsanmeldungModel->load($pruefungsanmeldung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Pruefungsanmeldung extends APIv1_Controller { $result = $this->PruefungsanmeldungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungsanmeldung extends APIv1_Controller $this->response(); } } - + private function _validate($pruefungsanmeldung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Pruefungsfenster.php b/application/controllers/api/v1/education/Pruefungsfenster.php index ddaa03aa1..50d13cff5 100644 --- a/application/controllers/api/v1/education/Pruefungsfenster.php +++ b/application/controllers/api/v1/education/Pruefungsfenster.php @@ -21,7 +21,7 @@ class Pruefungsfenster extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungsfenster' => 'basis/pruefungsfenster:rw')); // Load model PruefungsfensterModel $this->load->model('education/Pruefungsfenster_model', 'PruefungsfensterModel'); } @@ -32,11 +32,11 @@ class Pruefungsfenster extends APIv1_Controller public function getPruefungsfenster() { $pruefungsfenster_id = $this->get('pruefungsfenster_id'); - + if (isset($pruefungsfenster_id)) { $result = $this->PruefungsfensterModel->load($pruefungsfenster_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Pruefungsfenster extends APIv1_Controller { $result = $this->PruefungsfensterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungsfenster extends APIv1_Controller $this->response(); } } - + private function _validate($pruefungsfenster = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Pruefungsstatus.php b/application/controllers/api/v1/education/Pruefungsstatus.php index da2c5adee..cbfbfb044 100644 --- a/application/controllers/api/v1/education/Pruefungsstatus.php +++ b/application/controllers/api/v1/education/Pruefungsstatus.php @@ -21,7 +21,7 @@ class Pruefungsstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungsstatus' => 'basis/pruefungsstatus:rw')); // Load model PruefungsstatusModel $this->load->model('education/Pruefungsstatus_model', 'PruefungsstatusModel'); } @@ -32,11 +32,11 @@ class Pruefungsstatus extends APIv1_Controller public function getPruefungsstatus() { $status_kurzbz = $this->get('status_kurzbz'); - + if (isset($status_kurzbz)) { $result = $this->PruefungsstatusModel->load($status_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Pruefungsstatus extends APIv1_Controller { $result = $this->PruefungsstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungsstatus extends APIv1_Controller $this->response(); } } - + private function _validate($pruefungsstatus = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Pruefungstermin.php b/application/controllers/api/v1/education/Pruefungstermin.php index 59effc99e..fd16159dc 100644 --- a/application/controllers/api/v1/education/Pruefungstermin.php +++ b/application/controllers/api/v1/education/Pruefungstermin.php @@ -21,7 +21,7 @@ class Pruefungstermin extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungstermin' => 'basis/pruefungstermin:rw')); // Load model PruefungsterminModel $this->load->model('education/Pruefungstermin_model', 'PruefungsterminModel'); } @@ -32,11 +32,11 @@ class Pruefungstermin extends APIv1_Controller public function getPruefungstermin() { $pruefungstermin_id = $this->get('pruefungstermin_id'); - + if (isset($pruefungstermin_id)) { $result = $this->PruefungsterminModel->load($pruefungstermin_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Pruefungstermin extends APIv1_Controller { $result = $this->PruefungsterminModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungstermin extends APIv1_Controller $this->response(); } } - + private function _validate($pruefungstermin = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Pruefungstyp.php b/application/controllers/api/v1/education/Pruefungstyp.php index 91820a853..4c460d5cd 100644 --- a/application/controllers/api/v1/education/Pruefungstyp.php +++ b/application/controllers/api/v1/education/Pruefungstyp.php @@ -21,7 +21,7 @@ class Pruefungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungstyp' => 'basis/pruefungstyp:rw')); // Load model PruefungstypModel $this->load->model('education/Pruefungstyp_model', 'PruefungstypModel'); } @@ -32,11 +32,11 @@ class Pruefungstyp extends APIv1_Controller public function getPruefungstyp() { $pruefungstyp_kurzbz = $this->get('pruefungstyp_kurzbz'); - + if (isset($pruefungstyp_kurzbz)) { $result = $this->PruefungstypModel->load($pruefungstyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Pruefungstyp extends APIv1_Controller { $result = $this->PruefungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungstyp extends APIv1_Controller $this->response(); } } - + private function _validate($pruefungstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Studentbeispiel.php b/application/controllers/api/v1/education/Studentbeispiel.php index a1dfa9fa9..45012231a 100644 --- a/application/controllers/api/v1/education/Studentbeispiel.php +++ b/application/controllers/api/v1/education/Studentbeispiel.php @@ -21,7 +21,7 @@ class Studentbeispiel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studentbeispiel' => 'basis/studentbeispiel:rw')); // Load model StudentbeispielModel $this->load->model('education/Studentbeispiel_model', 'StudentbeispielModel'); } @@ -33,11 +33,11 @@ class Studentbeispiel extends APIv1_Controller { $beispiel_id = $this->get('beispiel_id'); $student_uid = $this->get('student_uid'); - + if (isset($beispiel_id) && isset($student_uid)) { $result = $this->StudentbeispielModel->load(array($beispiel_id, $student_uid)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Studentbeispiel extends APIv1_Controller { $result = $this->StudentbeispielModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Studentbeispiel extends APIv1_Controller $this->response(); } } - + private function _validate($studentbeispiel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Studentlehrverband.php b/application/controllers/api/v1/education/Studentlehrverband.php index 3dccddae6..4793b0b1b 100644 --- a/application/controllers/api/v1/education/Studentlehrverband.php +++ b/application/controllers/api/v1/education/Studentlehrverband.php @@ -21,7 +21,7 @@ class Studentlehrverband extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studentlehrverband' => 'basis/studentlehrverband:rw')); // Load model StudentlehrverbandModel $this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel'); } @@ -33,11 +33,11 @@ class Studentlehrverband extends APIv1_Controller { $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); $student_uid = $this->get('student_uid'); - + if (isset($studiensemester_kurzbz) && isset($student_uid)) { $result = $this->StudentlehrverbandModel->load(array($studiensemester_kurzbz, $student_uid)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Studentlehrverband extends APIv1_Controller { $result = $this->StudentlehrverbandModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Studentlehrverband extends APIv1_Controller $this->response(); } } - + private function _validate($studentlehrverband = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Studentuebung.php b/application/controllers/api/v1/education/Studentuebung.php index e069661ec..2a086610c 100644 --- a/application/controllers/api/v1/education/Studentuebung.php +++ b/application/controllers/api/v1/education/Studentuebung.php @@ -21,7 +21,7 @@ class Studentuebung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studentuebung' => 'basis/studentuebung:rw')); // Load model StudentuebungModel $this->load->model('education/Studentuebung_model', 'StudentuebungModel'); } @@ -33,11 +33,11 @@ class Studentuebung extends APIv1_Controller { $uebung_id = $this->get('uebung_id'); $student_uid = $this->get('student_uid'); - + if (isset($uebung_id) && isset($student_uid)) { $result = $this->StudentuebungModel->load(array($uebung_id, $student_uid)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -61,7 +61,7 @@ class Studentuebung extends APIv1_Controller { $result = $this->StudentuebungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Studentuebung extends APIv1_Controller $this->response(); } } - + private function _validate($studentuebung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Uebung.php b/application/controllers/api/v1/education/Uebung.php index 8cb394cf2..41d8f8448 100644 --- a/application/controllers/api/v1/education/Uebung.php +++ b/application/controllers/api/v1/education/Uebung.php @@ -21,7 +21,7 @@ class Uebung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Uebung' => 'basis/uebung:rw')); // Load model UebungModel $this->load->model('education/uebung_model', 'UebungModel'); } @@ -32,11 +32,11 @@ class Uebung extends APIv1_Controller public function getUebung() { $uebung_id = $this->get('uebung_id'); - + if (isset($uebung_id)) { $result = $this->UebungModel->load($uebung_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Uebung extends APIv1_Controller { $result = $this->UebungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Uebung extends APIv1_Controller $this->response(); } } - + private function _validate($uebung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Zeugnis.php b/application/controllers/api/v1/education/Zeugnis.php index f94d56768..86af07284 100644 --- a/application/controllers/api/v1/education/Zeugnis.php +++ b/application/controllers/api/v1/education/Zeugnis.php @@ -21,7 +21,7 @@ class Zeugnis extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeugnis' => 'basis/zeugnis:rw')); // Load model ZeugnisModel $this->load->model('education/Zeugnis_model', 'ZeugnisModel'); } @@ -32,11 +32,11 @@ class Zeugnis extends APIv1_Controller public function getZeugnis() { $zeugnis_id = $this->get('zeugnis_id'); - + if (isset($zeugnis_id)) { $result = $this->ZeugnisModel->load($zeugnis_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Zeugnis extends APIv1_Controller { $result = $this->ZeugnisModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zeugnis extends APIv1_Controller $this->response(); } } - + private function _validate($zeugnis = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/education/Zeugnisnote.php b/application/controllers/api/v1/education/Zeugnisnote.php index ffeb56486..10083865e 100644 --- a/application/controllers/api/v1/education/Zeugnisnote.php +++ b/application/controllers/api/v1/education/Zeugnisnote.php @@ -21,7 +21,7 @@ class Zeugnisnote extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeugnisnote' => 'basis/zeugnisnote:rw')); // Load model ZeugnisnoteModel $this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel'); } @@ -34,11 +34,11 @@ class Zeugnisnote extends APIv1_Controller $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); $student_uid = $this->get('student_uid'); $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); - + if (isset($studiensemester_kurzbz) && isset($student_uid) && isset($lehrveranstaltung_id)) { $result = $this->ZeugnisnoteModel->load(array($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,14 +60,14 @@ class Zeugnisnote extends APIv1_Controller $this->post()['student_uid'], $this->post()['lehrveranstaltung_id'] ); - + $result = $this->ZeugnisnoteModel->update($pksArray, $this->post()); } else { $result = $this->ZeugnisnoteModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -75,9 +75,9 @@ class Zeugnisnote extends APIv1_Controller $this->response(); } } - + private function _validate($zeugnisnote = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Erhalter.php b/application/controllers/api/v1/organisation/Erhalter.php index fdfb836a3..0098f7fcc 100644 --- a/application/controllers/api/v1/organisation/Erhalter.php +++ b/application/controllers/api/v1/organisation/Erhalter.php @@ -21,11 +21,11 @@ class Erhalter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Erhalter' => 'basis/erhalter:rw')); // Load model ErhalterModel $this->load->model('organisation/erhalter_model', 'ErhalterModel'); - - + + } /** @@ -34,11 +34,11 @@ class Erhalter extends APIv1_Controller public function getErhalter() { $erhalter_kz = $this->get('erhalter_kz'); - + if (isset($erhalter_kz)) { $result = $this->ErhalterModel->load($erhalter_kz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Erhalter extends APIv1_Controller { $result = $this->ErhalterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Erhalter extends APIv1_Controller $this->response(); } } - + private function _validate($erhalter = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Fachbereich2.php b/application/controllers/api/v1/organisation/Fachbereich2.php index dfe9e18c8..a2d3d3838 100644 --- a/application/controllers/api/v1/organisation/Fachbereich2.php +++ b/application/controllers/api/v1/organisation/Fachbereich2.php @@ -21,11 +21,11 @@ class Fachbereich2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Fachbereich' => 'basis/fachbereich:rw')); // Load model FachbereichModel $this->load->model('organisation/fachbereich_model', 'FachbereichModel'); - - + + } /** @@ -34,11 +34,11 @@ class Fachbereich2 extends APIv1_Controller public function getFachbereich() { $fachbereich_kurzbz = $this->get('fachbereich_kurzbz'); - + if (isset($fachbereich_kurzbz)) { $result = $this->FachbereichModel->load($fachbereich_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Fachbereich2 extends APIv1_Controller { $result = $this->FachbereichModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Fachbereich2 extends APIv1_Controller $this->response(); } } - + private function _validate($fachbereich = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Ferien.php b/application/controllers/api/v1/organisation/Ferien.php index e4e027da8..e943a7e66 100644 --- a/application/controllers/api/v1/organisation/Ferien.php +++ b/application/controllers/api/v1/organisation/Ferien.php @@ -21,11 +21,11 @@ class Ferien extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ferien' => 'basis/ferien:rw')); // Load model FerienModel $this->load->model('organisation/ferien_model', 'FerienModel'); - - + + } /** @@ -35,11 +35,11 @@ class Ferien extends APIv1_Controller { $studiengang_kz = $this->get('studiengang_kz'); $bezeichnung = $this->get('bezeichnung'); - + if (isset($studiengang_kz) && isset($bezeichnung)) { $result = $this->FerienModel->load(array($studiengang_kz, $bezeichnung)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Ferien extends APIv1_Controller { $result = $this->FerienModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Ferien extends APIv1_Controller $this->response(); } } - + private function _validate($ferien = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Geschaeftsjahr2.php b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php index dc8fd1d0b..2dfa9f400 100644 --- a/application/controllers/api/v1/organisation/Geschaeftsjahr2.php +++ b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php @@ -21,11 +21,11 @@ class Geschaeftsjahr2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Geschaeftsjahr' => 'basis/geschaeftsjahr:rw')); // Load model GeschaeftsjahrModel $this->load->model('organisation/geschaeftsjahr_model', 'GeschaeftsjahrModel'); - - + + } /** @@ -34,11 +34,11 @@ class Geschaeftsjahr2 extends APIv1_Controller public function getGeschaeftsjahr() { $geschaeftsjahr_kurzbz = $this->get('geschaeftsjahr_kurzbz'); - + if (isset($geschaeftsjahr_kurzbz)) { $result = $this->GeschaeftsjahrModel->load($geschaeftsjahr_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Geschaeftsjahr2 extends APIv1_Controller { $result = $this->GeschaeftsjahrModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Geschaeftsjahr2 extends APIv1_Controller $this->response(); } } - + private function _validate($geschaeftsjahr = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Gruppe.php b/application/controllers/api/v1/organisation/Gruppe.php index 21a9965b8..e3ef92fa4 100644 --- a/application/controllers/api/v1/organisation/Gruppe.php +++ b/application/controllers/api/v1/organisation/Gruppe.php @@ -21,11 +21,11 @@ class Gruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Gruppe' => 'basis/gruppe:rw')); // Load model GruppeModel $this->load->model('organisation/gruppe_model', 'GruppeModel'); - - + + } /** @@ -34,11 +34,11 @@ class Gruppe extends APIv1_Controller public function getGruppe() { $gruppe_kurzbz = $this->get('gruppe_kurzbz'); - + if (isset($gruppe_kurzbz)) { $result = $this->GruppeModel->load($gruppe_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Gruppe extends APIv1_Controller { $result = $this->GruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Gruppe extends APIv1_Controller $this->response(); } } - + private function _validate($gruppe = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Lehrverband.php b/application/controllers/api/v1/organisation/Lehrverband.php index 3173f025b..9b12dcf90 100644 --- a/application/controllers/api/v1/organisation/Lehrverband.php +++ b/application/controllers/api/v1/organisation/Lehrverband.php @@ -21,11 +21,11 @@ class Lehrverband extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrverband' => 'basis/lehrverband:rw')); // Load model LehrverbandModel $this->load->model('organisation/lehrverband_model', 'LehrverbandModel'); - - + + } /** @@ -37,11 +37,11 @@ class Lehrverband extends APIv1_Controller $verband = $this->get('verband'); $semester = $this->get('semester'); $studiengang_kz = $this->get('studiengang_kz'); - + if (isset($gruppe) && isset($verband) && isset($semester) && isset($studiengang_kz)) { $result = $this->LehrverbandModel->load(array($gruppe, $verband, $semester, $studiengang_kz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -65,14 +65,14 @@ class Lehrverband extends APIv1_Controller $this->post()['semester'], $this->post()['studiengang_kz'] ); - + $result = $this->LehrverbandModel->update($pksArray, $this->post()); } else { $result = $this->LehrverbandModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -80,9 +80,9 @@ class Lehrverband extends APIv1_Controller $this->response(); } } - + private function _validate($lehrverband = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Organisationseinheit2.php b/application/controllers/api/v1/organisation/Organisationseinheit2.php index 0d46839f0..3f62bbdf1 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheit2.php +++ b/application/controllers/api/v1/organisation/Organisationseinheit2.php @@ -21,11 +21,11 @@ class Organisationseinheit2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Organisationseinheit' => 'basis/organisationseinheit:rw')); // Load model OrganisationseinheitModel $this->load->model('organisation/organisationseinheit_model', 'OrganisationseinheitModel'); - - + + } /** @@ -34,11 +34,11 @@ class Organisationseinheit2 extends APIv1_Controller public function getOrganisationseinheit() { $oe_kurzbz = $this->get('oe_kurzbz'); - + if (isset($oe_kurzbz)) { $result = $this->OrganisationseinheitModel->load($oe_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Organisationseinheit2 extends APIv1_Controller { $result = $this->OrganisationseinheitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Organisationseinheit2 extends APIv1_Controller $this->response(); } } - + private function _validate($organisationseinheit = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Organisationseinheittyp.php b/application/controllers/api/v1/organisation/Organisationseinheittyp.php index 2998c652d..62a723b1e 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheittyp.php +++ b/application/controllers/api/v1/organisation/Organisationseinheittyp.php @@ -21,11 +21,11 @@ class Organisationseinheittyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Organisationseinheittyp' => 'basis/organisationseinheittyp:rw')); // Load model OrganisationseinheittypModel $this->load->model('organisation/organisationseinheittyp_model', 'OrganisationseinheittypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Organisationseinheittyp extends APIv1_Controller public function getOrganisationseinheittyp() { $organisationseinheittyp_kurzbz = $this->get('organisationseinheittyp_kurzbz'); - + if (isset($organisationseinheittyp_kurzbz)) { $result = $this->OrganisationseinheittypModel->load($organisationseinheittyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Organisationseinheittyp extends APIv1_Controller { $result = $this->OrganisationseinheittypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Organisationseinheittyp extends APIv1_Controller $this->response(); } } - + private function _validate($organisationseinheittyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Semesterwochen.php b/application/controllers/api/v1/organisation/Semesterwochen.php index 8ba837a64..2dbd26ab0 100644 --- a/application/controllers/api/v1/organisation/Semesterwochen.php +++ b/application/controllers/api/v1/organisation/Semesterwochen.php @@ -21,11 +21,11 @@ class Semesterwochen extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Semesterwochen' => 'basis/semesterwochen:rw')); // Load model SemesterwochenModel $this->load->model('organisation/semesterwochen_model', 'SemesterwochenModel'); - - + + } /** @@ -35,11 +35,11 @@ class Semesterwochen extends APIv1_Controller { $studiengang_kz = $this->get('studiengang_kz'); $semester = $this->get('semester'); - + if (isset($studiengang_kz) && isset($semester)) { $result = $this->SemesterwochenModel->load(array($studiengang_kz, $semester)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Semesterwochen extends APIv1_Controller { $result = $this->SemesterwochenModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Semesterwochen extends APIv1_Controller $this->response(); } } - + private function _validate($semesterwochen = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Service.php b/application/controllers/api/v1/organisation/Service.php index e49b92122..4d1988430 100644 --- a/application/controllers/api/v1/organisation/Service.php +++ b/application/controllers/api/v1/organisation/Service.php @@ -21,11 +21,11 @@ class Service extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Service' => 'basis/service:rw')); // Load model ServiceModel $this->load->model('organisation/service_model', 'ServiceModel'); - - + + } /** @@ -34,11 +34,11 @@ class Service extends APIv1_Controller public function getService() { $serviceID = $this->get('service_id'); - + if (isset($serviceID)) { $result = $this->ServiceModel->load($serviceID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Service extends APIv1_Controller { $result = $this->ServiceModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Service extends APIv1_Controller $this->response(); } } - + private function _validate($service = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Standort.php b/application/controllers/api/v1/organisation/Standort.php index c2537c592..16c206401 100644 --- a/application/controllers/api/v1/organisation/Standort.php +++ b/application/controllers/api/v1/organisation/Standort.php @@ -21,11 +21,11 @@ class Standort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Standort' => 'basis/standort:rw')); // Load model StandortModel $this->load->model('organisation/standort_model', 'StandortModel'); - - + + } /** @@ -34,11 +34,11 @@ class Standort extends APIv1_Controller public function getStandort() { $standortID = $this->get('standort_id'); - + if (isset($standortID)) { $result = $this->StandortModel->load($standortID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Standort extends APIv1_Controller { $result = $this->StandortModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Standort extends APIv1_Controller $this->response(); } } - + private function _validate($standort = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Statistik.php b/application/controllers/api/v1/organisation/Statistik.php index 5e69a53d5..b85c27f42 100644 --- a/application/controllers/api/v1/organisation/Statistik.php +++ b/application/controllers/api/v1/organisation/Statistik.php @@ -21,11 +21,17 @@ class Statistik extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Statistik' => 'basis/statistik:rw', + 'All' => 'basis/statistik:r', + 'MenueArray' => 'basis/statistik:r' + ) + ); // Load model StatistikModel $this->load->model('organisation/statistik_model', 'StatistikModel'); - - + + } /** @@ -34,11 +40,11 @@ class Statistik extends APIv1_Controller public function getStatistik() { $statistik_kurzbz = $this->get('statistik_kurzbz'); - + if (isset($statistik_kurzbz)) { $result = $this->StatistikModel->load($statistik_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -46,19 +52,19 @@ class Statistik extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getAll() { $this->StatistikModel->addOrder($this->get('order')); - + $result = $this->StatistikModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -67,9 +73,9 @@ class Statistik extends APIv1_Controller $this->StatistikModel->addOrder('gruppe'); $this->StatistikModel->addOrder('bezeichnung'); $this->StatistikModel->addOrder('statistik_kurzbz'); - + $result = $this->StatistikModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } @@ -88,7 +94,7 @@ class Statistik extends APIv1_Controller { $result = $this->StatistikModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -96,9 +102,9 @@ class Statistik extends APIv1_Controller $this->response(); } } - + private function _validate($statistik = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studiengang2.php b/application/controllers/api/v1/organisation/Studiengang2.php index bea2f218e..2e1b549ff 100644 --- a/application/controllers/api/v1/organisation/Studiengang2.php +++ b/application/controllers/api/v1/organisation/Studiengang2.php @@ -20,7 +20,17 @@ class Studiengang2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Studiengang' => 'basis/studiengang:r', + 'AllForBewerbung' => 'basis/studiengang:r', + 'StudiengangStudienplan' => 'basis/studiengang:r', + 'StudiengangBewerbung' => 'basis/studiengang:r', + 'AppliedStudiengang' => 'basis/studiengang:r', + 'AppliedStudiengangFromNow' => 'basis/studiengang:r', + 'AppliedStudiengangFromNowOE' => 'basis/studiengang:r' + ) + ); // Load model PersonModel $this->load->model('organisation/studiengang_model', 'StudiengangModel'); diff --git a/application/controllers/api/v1/organisation/Studiengangstyp.php b/application/controllers/api/v1/organisation/Studiengangstyp.php index a0293c229..b10811636 100644 --- a/application/controllers/api/v1/organisation/Studiengangstyp.php +++ b/application/controllers/api/v1/organisation/Studiengangstyp.php @@ -21,11 +21,11 @@ class Studiengangstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studiengangstyp' => 'basis/studiengangstyp:rw')); // Load model StudiengangstypModel $this->load->model('organisation/studiengangstyp_model', 'StudiengangstypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studiengangstyp extends APIv1_Controller public function getStudiengangstyp() { $typ = $this->get('typ'); - + if (isset($typ)) { $result = $this->StudiengangstypModel->load($typ); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studiengangstyp extends APIv1_Controller { $result = $this->StudiengangstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studiengangstyp extends APIv1_Controller $this->response(); } } - + private function _validate($studiengangstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studienjahr.php b/application/controllers/api/v1/organisation/Studienjahr.php index 8860dbd39..eb7c38847 100644 --- a/application/controllers/api/v1/organisation/Studienjahr.php +++ b/application/controllers/api/v1/organisation/Studienjahr.php @@ -21,11 +21,11 @@ class Studienjahr extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienjahr' => 'basis/studienjahr:rw')); // Load model StudienjahrModel $this->load->model('organisation/studienjahr_model', 'StudienjahrModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienjahr extends APIv1_Controller public function getStudienjahr() { $studienjahr_kurzbz = $this->get('studienjahr_kurzbz'); - + if (isset($studienjahr_kurzbz)) { $result = $this->StudienjahrModel->load($studienjahr_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studienjahr extends APIv1_Controller { $result = $this->StudienjahrModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienjahr extends APIv1_Controller $this->response(); } } - + private function _validate($studienjahr = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studienordnung.php b/application/controllers/api/v1/organisation/Studienordnung.php index c791898c9..122c8f099 100644 --- a/application/controllers/api/v1/organisation/Studienordnung.php +++ b/application/controllers/api/v1/organisation/Studienordnung.php @@ -21,11 +21,11 @@ class Studienordnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienordnung' => 'lehre/studienordnung:rw')); // Load model StudienordnungModel $this->load->model('organisation/studienordnung_model', 'StudienordnungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienordnung extends APIv1_Controller public function getStudienordnung() { $studienordnungID = $this->get('studienordnung_id'); - + if (isset($studienordnungID)) { $result = $this->StudienordnungModel->load($studienordnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studienordnung extends APIv1_Controller { $result = $this->StudienordnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienordnung extends APIv1_Controller $this->response(); } } - + private function _validate($studienordnung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studienordnungstatus.php b/application/controllers/api/v1/organisation/Studienordnungstatus.php index 52d292850..30d38c4ad 100644 --- a/application/controllers/api/v1/organisation/Studienordnungstatus.php +++ b/application/controllers/api/v1/organisation/Studienordnungstatus.php @@ -21,11 +21,11 @@ class Studienordnungstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienordnungstatus' => 'lehre/studienordnungstatus:rw')); // Load model StudienordnungstatusModel $this->load->model('organisation/studienordnungstatus_model', 'StudienordnungstatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienordnungstatus extends APIv1_Controller public function getStudienordnungstatus() { $status_kurzbz = $this->get('status_kurzbz'); - + if (isset($status_kurzbz)) { $result = $this->StudienordnungstatusModel->load($status_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studienordnungstatus extends APIv1_Controller { $result = $this->StudienordnungstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienordnungstatus extends APIv1_Controller $this->response(); } } - + private function _validate($studienordnungstatus = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studienplan.php b/application/controllers/api/v1/organisation/Studienplan.php index 68a0a2095..0c1db0af7 100644 --- a/application/controllers/api/v1/organisation/Studienplan.php +++ b/application/controllers/api/v1/organisation/Studienplan.php @@ -21,19 +21,25 @@ class Studienplan extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Studienplan' => 'lehre/studienplan:r', + 'Studienplaene' => 'lehre/studienplan:r', + 'StudienplaeneFromSem' => 'lehre/studienplan:r' + ) + ); // Load model PersonModel $this->load->model("organisation/studienplan_model", "StudienplanModel"); } - + public function getStudienplan() { $studienplan_id = $this->get("studienplan_id"); - + if (isset($studienplan_id)) { $result = $this->StudienplanModel->load($studienplan_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -41,15 +47,15 @@ class Studienplan extends APIv1_Controller $this->response(); } } - + public function getStudienplaene() { $studiengang_kz = $this->get("studiengang_kz"); - + if (isset($studiengang_kz)) { $result = $this->StudienplanModel->getStudienplaene($studiengang_kz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -57,14 +63,14 @@ class Studienplan extends APIv1_Controller $this->response(); } } - + public function getStudienplaeneFromSem() { $studiengang_kz = $this->get("studiengang_kz"); $studiensemester_kurzbz = $this->get("studiensemester_kurzbz"); $ausbildungssemester = $this->get("ausbildungssemester"); $orgform_kurzbz = $this->get("orgform_kurzbz"); - + if (isset($studiengang_kz) && isset($studiensemester_kurzbz)) { $result = $this->StudienplanModel->getStudienplaeneBySemester( @@ -73,7 +79,7 @@ class Studienplan extends APIv1_Controller $ausbildungssemester, $orgform_kurzbz ); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -81,4 +87,4 @@ class Studienplan extends APIv1_Controller $this->response(); } } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studienplatz.php b/application/controllers/api/v1/organisation/Studienplatz.php index bb0dc5e12..88ce6a12d 100644 --- a/application/controllers/api/v1/organisation/Studienplatz.php +++ b/application/controllers/api/v1/organisation/Studienplatz.php @@ -21,11 +21,11 @@ class Studienplatz extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienplatz' => 'basis/studienplatz:rw')); // Load model StudienplatzModel $this->load->model('organisation/studienplatz_model', 'StudienplatzModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienplatz extends APIv1_Controller public function getStudienplatz() { $studienplatzID = $this->get('studienplatz_id'); - + if (isset($studienplatzID)) { $result = $this->StudienplatzModel->load($studienplatzID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studienplatz extends APIv1_Controller { $result = $this->StudienplatzModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienplatz extends APIv1_Controller $this->response(); } } - + private function _validate($studienplatz = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studiensemester.php b/application/controllers/api/v1/organisation/Studiensemester.php index 398ccfa58..f714214d9 100644 --- a/application/controllers/api/v1/organisation/Studiensemester.php +++ b/application/controllers/api/v1/organisation/Studiensemester.php @@ -21,11 +21,25 @@ class Studiensemester extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Studiensemester' => 'basis/studiensemester:rw', + 'NextStudiensemester' => 'basis/studiensemester:r', + 'All' => 'basis/studiensemester:r', + 'Akt' => 'basis/studiensemester:r', + 'AktNext' => 'basis/studiensemester:r', + 'LastOrAktSemester' => 'basis/studiensemester:r', + 'NextFrom' => 'basis/studiensemester:r', + 'Previous' => 'basis/studiensemester:r', + 'Nearest' => 'basis/studiensemester:r', + 'Finished' => 'basis/studiensemester:r', + 'Timestamp' => 'basis/studiensemester:r' + ) + ); // Load model StudiensemesterModel $this->load->model('organisation/studiensemester_model', 'StudiensemesterModel'); - - + + } /** @@ -34,11 +48,11 @@ class Studiensemester extends APIv1_Controller public function getStudiensemester() { $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); - + if (isset($studiensemester_kurzbz)) { $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -46,17 +60,17 @@ class Studiensemester extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getNextStudiensemester() { $art = $this->get('art'); - + $this->StudiensemesterModel->addOrder('start'); $this->StudiensemesterModel->addLimit(1); - + if (isset($art)) { $result = $this->StudiensemesterModel->loadWhere( @@ -72,14 +86,14 @@ class Studiensemester extends APIv1_Controller $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getAll() { $order = $this->get('order'); - + if (strcasecmp($order, 'DESC') == 0) { $this->StudiensemesterModel->addOrder('ende', 'DESC'); @@ -88,12 +102,12 @@ class Studiensemester extends APIv1_Controller { $this->StudiensemesterModel->addOrder('ende', 'ASC'); } - + $result = $this->StudiensemesterModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -103,28 +117,28 @@ class Studiensemester extends APIv1_Controller $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getAktNext() { $semester = $this->get('semester'); - + $result = null; - + if (!is_numeric($semester)) { $result = $this->StudiensemesterModel->loadWhere(array('start <=' => 'NOW()', 'ende >=' => 'NOW()')); } - + if (!hasData($result)) { $this->StudiensemesterModel->addOrder('ende'); $this->StudiensemesterModel->addLimit(1); - + $whereArray = array('ende >=' => 'NOW()'); - + if (is_numeric($semester)) { if ($semester % 2 == 0) @@ -138,33 +152,33 @@ class Studiensemester extends APIv1_Controller $whereArray['SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) ='] = $ss; } - + $result = $this->StudiensemesterModel->loadWhere($whereArray); } - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getLastOrAktSemester() { $result = $this->StudiensemesterModel->getLastOrAktSemester($this->get('days')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getNextFrom() { $result = $this->StudiensemesterModel->getNextFrom($this->get('studiensemester_kurzbz')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -172,12 +186,12 @@ class Studiensemester extends APIv1_Controller { $this->StudiensemesterModel->addOrder('ende', 'DESC'); $this->StudiensemesterModel->addLimit(1); - + $result = $this->StudiensemesterModel->loadWhere(array('ende <' => 'NOW()')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -187,37 +201,37 @@ class Studiensemester extends APIv1_Controller $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getFinished() { $limit = $this->get('limit'); - + $this->StudiensemesterModel->addOrder('ende', 'DESC'); $this->StudiensemesterModel->addLimit($limit); - + $result = $this->StudiensemesterModel->loadWhere(array('start <=' => 'NOW()')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getTimestamp() { $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); - + if (isset($studiensemester_kurzbz)) { $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); - + if (is_array($result->retval) && count($result->retval) > 0) { $studiensemester = $result->retval[0]; - + if (is_object($studiensemester)) { $start = ""; @@ -239,7 +253,7 @@ class Studiensemester extends APIv1_Controller mb_substr($studiensemester->ende, 0, 4) ); } - + $result->retval = array( 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'start' => $start, @@ -247,7 +261,7 @@ class Studiensemester extends APIv1_Controller ); } } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -271,7 +285,7 @@ class Studiensemester extends APIv1_Controller { $result = $this->StudiensemesterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -279,9 +293,9 @@ class Studiensemester extends APIv1_Controller $this->response(); } } - + private function _validate($studiensemester = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Adresse.php b/application/controllers/api/v1/person/Adresse.php index 04c8de722..ddbbfe554 100644 --- a/application/controllers/api/v1/person/Adresse.php +++ b/application/controllers/api/v1/person/Adresse.php @@ -22,21 +22,21 @@ class Adresse extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Adresse' => 'basis/adresse:rw')); // Load model PersonModel $this->load->model('person/Adresse_model', 'AdresseModel'); - - + + } public function getAdresse() { $personID = $this->get("person_id"); - + if (isset($personID)) { $result = $this->AdresseModel->loadWhere(array('person_id' => $personID)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -44,11 +44,11 @@ class Adresse extends APIv1_Controller $this->response(); } } - + public function postAdresse() { $adresse = $this->post(); - + if (is_array($adresse)) { if (isset($adresse['adresse_id'])) @@ -59,7 +59,7 @@ class Adresse extends APIv1_Controller { $result = $this->AdresseModel->insert($adresse); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -67,4 +67,4 @@ class Adresse extends APIv1_Controller $this->response(); } } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Bankverbindung.php b/application/controllers/api/v1/person/Bankverbindung.php index 42a1f5c15..06f6b040d 100644 --- a/application/controllers/api/v1/person/Bankverbindung.php +++ b/application/controllers/api/v1/person/Bankverbindung.php @@ -21,11 +21,11 @@ class Bankverbindung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bankverbindung' => 'basis/bankverbindung:rw')); // Load model BankverbindungModel $this->load->model('person/bankverbindung_model', 'BankverbindungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Bankverbindung extends APIv1_Controller public function getBankverbindung() { $bankverbindungID = $this->get('bankverbindung_id'); - + if (isset($bankverbindungID)) { $result = $this->BankverbindungModel->load($bankverbindungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Bankverbindung extends APIv1_Controller { $result = $this->BankverbindungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Bankverbindung extends APIv1_Controller $this->response(); } } - + private function _validate($bankverbindung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Benutzer.php b/application/controllers/api/v1/person/Benutzer.php index 33687f6f0..23fcdadac 100644 --- a/application/controllers/api/v1/person/Benutzer.php +++ b/application/controllers/api/v1/person/Benutzer.php @@ -21,11 +21,11 @@ class Benutzer extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzer' => 'basis/benutzer:rw')); // Load model BenutzerModel $this->load->model('person/benutzer_model', 'BenutzerModel'); - - + + } /** @@ -34,11 +34,11 @@ class Benutzer extends APIv1_Controller public function getBenutzer() { $uid = $this->get('uid'); - + if (isset($uid)) { $result = $this->BenutzerModel->load($uid); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Benutzer extends APIv1_Controller { $result = $this->BenutzerModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Benutzer extends APIv1_Controller $this->response(); } } - + private function _validate($benutzer = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Benutzerfunktion.php b/application/controllers/api/v1/person/Benutzerfunktion.php index 93b793287..98fd8654a 100644 --- a/application/controllers/api/v1/person/Benutzerfunktion.php +++ b/application/controllers/api/v1/person/Benutzerfunktion.php @@ -21,11 +21,11 @@ class Benutzerfunktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzerfunktion' => 'basis/benutzerfunktion:rw')); // Load model BenutzerfunktionModel $this->load->model('person/benutzerfunktion_model', 'BenutzerfunktionModel'); - - + + } /** @@ -34,11 +34,11 @@ class Benutzerfunktion extends APIv1_Controller public function getBenutzerfunktion() { $benutzerfunktionID = $this->get('benutzerfunktion_id'); - + if (isset($benutzerfunktionID)) { $result = $this->BenutzerfunktionModel->load($benutzerfunktionID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Benutzerfunktion extends APIv1_Controller { $result = $this->BenutzerfunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Benutzerfunktion extends APIv1_Controller $this->response(); } } - + private function _validate($benutzerfunktion = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Benutzergruppe.php b/application/controllers/api/v1/person/Benutzergruppe.php index b70e08014..0adc8c73a 100644 --- a/application/controllers/api/v1/person/Benutzergruppe.php +++ b/application/controllers/api/v1/person/Benutzergruppe.php @@ -21,11 +21,11 @@ class Benutzergruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzergruppe' => 'basis/benutzergruppe:rw')); // Load model BenutzergruppeModel $this->load->model('person/benutzergruppe_model', 'BenutzergruppeModel'); - - + + } /** @@ -35,11 +35,11 @@ class Benutzergruppe extends APIv1_Controller { $gruppe_kurzbz = $this->get('gruppe_kurzbz'); $uid = $this->get('uid'); - + if (isset($gruppe_kurzbz) && isset($uid)) { $result = $this->BenutzergruppeModel->load(array($gruppe_kurzbz, $uid)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Benutzergruppe extends APIv1_Controller { $result = $this->BenutzergruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Benutzergruppe extends APIv1_Controller $this->response(); } } - + private function _validate($benutzergruppe = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Fotostatus.php b/application/controllers/api/v1/person/Fotostatus.php index ea74649da..acd1ef5b6 100644 --- a/application/controllers/api/v1/person/Fotostatus.php +++ b/application/controllers/api/v1/person/Fotostatus.php @@ -21,11 +21,11 @@ class Fotostatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Fotostatus' => 'basis/fotostatus:rw')); // Load model FotostatusModel $this->load->model('person/fotostatus_model', 'FotostatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Fotostatus extends APIv1_Controller public function getFotostatus() { $fotostatus_kurzbz = $this->get('fotostatus_kurzbz'); - + if (isset($fotostatus_kurzbz)) { $result = $this->FotostatusModel->load($fotostatus_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Fotostatus extends APIv1_Controller { $result = $this->FotostatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Fotostatus extends APIv1_Controller $this->response(); } } - + private function _validate($fotostatus = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Freebusy.php b/application/controllers/api/v1/person/Freebusy.php index c8ca32b36..eb1651c00 100644 --- a/application/controllers/api/v1/person/Freebusy.php +++ b/application/controllers/api/v1/person/Freebusy.php @@ -21,11 +21,11 @@ class Freebusy extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Freebusy' => 'basis/freebusy:rw')); // Load model FreebusyModel $this->load->model('person/freebusy_model', 'FreebusyModel'); - - + + } /** @@ -34,11 +34,11 @@ class Freebusy extends APIv1_Controller public function getFreebusy() { $freebusyID = $this->get('freebusy_id'); - + if (isset($freebusyID)) { $result = $this->FreebusyModel->load($freebusyID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Freebusy extends APIv1_Controller { $result = $this->FreebusyModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Freebusy extends APIv1_Controller $this->response(); } } - + private function _validate($freebusy = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Freebusytyp.php b/application/controllers/api/v1/person/Freebusytyp.php index f3dac4792..0187035d1 100644 --- a/application/controllers/api/v1/person/Freebusytyp.php +++ b/application/controllers/api/v1/person/Freebusytyp.php @@ -21,11 +21,11 @@ class Freebusytyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Freebusytyp' => 'basis/freebusytyp:rw')); // Load model FreebusytypModel $this->load->model('person/freebusytyp_model', 'FreebusytypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Freebusytyp extends APIv1_Controller public function getFreebusytyp() { $freebusytyp_kurzbz = $this->get('freebusytyp_kurzbz'); - + if (isset($freebusytyp_kurzbz)) { $result = $this->FreebusytypModel->load($freebusytyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Freebusytyp extends APIv1_Controller { $result = $this->FreebusytypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Freebusytyp extends APIv1_Controller $this->response(); } } - + private function _validate($freebusytyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Kontakt.php b/application/controllers/api/v1/person/Kontakt.php index 00d5db5fd..fceeaaeaf 100644 --- a/application/controllers/api/v1/person/Kontakt.php +++ b/application/controllers/api/v1/person/Kontakt.php @@ -22,8 +22,16 @@ class Kontakt extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct( + array( + 'Kontakt' => 'basis/kontakt:rw', + 'OnlyKontakt' => 'basis/kontakt:r', + 'KontaktByPersonID' => 'basis/kontakt:r', + 'OnlyKontaktByPersonID' => 'basis/kontakt:r', + 'KontaktByPersonIDKontaktTyp' => 'basis/kontakt:r' + ) + ); + // Load model PersonModel $this->load->model('person/kontakt_model', 'KontaktModel'); } @@ -31,11 +39,11 @@ class Kontakt extends APIv1_Controller public function getKontakt() { $kontakt_id = $this->get('kontakt_id'); - + if (isset($kontakt_id)) { $result = $this->KontaktModel->getWholeKontakt($kontakt_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -43,15 +51,15 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getOnlyKontakt() { $kontakt_id = $this->get('kontakt_id'); - + if (isset($kontakt_id)) { $result = $this->KontaktModel->load($kontakt_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -59,15 +67,15 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getKontaktByPersonID() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $result = $this->KontaktModel->getWholeKontakt(null, $person_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -75,15 +83,15 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getOnlyKontaktByPersonID() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $result = $this->KontaktModel->loadWhere(array('person_id' => $person_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -91,16 +99,16 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getKontaktByPersonIDKontaktTyp() { $person_id = $this->get('person_id'); $kontakttyp = $this->get('kontakttyp'); - + if (isset($person_id) && isset($kontakttyp)) { $result = $this->KontaktModel->getWholeKontakt(null, $person_id, $kontakttyp); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -108,11 +116,11 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function postKontakt() { $kontakt = $this->post(); - + if (is_array($kontakt)) { if (isset($kontakt['kontakt_id'])) @@ -123,7 +131,7 @@ class Kontakt extends APIv1_Controller { $result = $this->KontaktModel->insert($kontakt); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -131,4 +139,4 @@ class Kontakt extends APIv1_Controller $this->response(); } } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Kontaktmedium.php b/application/controllers/api/v1/person/Kontaktmedium.php index e435bc0de..b732d6eee 100644 --- a/application/controllers/api/v1/person/Kontaktmedium.php +++ b/application/controllers/api/v1/person/Kontaktmedium.php @@ -21,11 +21,11 @@ class Kontaktmedium extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kontaktmedium' => 'basis/kontaktmedium:rw')); // Load model KontaktmediumModel $this->load->model('person/kontaktmedium_model', 'KontaktmediumModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kontaktmedium extends APIv1_Controller public function getKontaktmedium() { $kontaktmedium_kurzbz = $this->get('kontaktmedium_kurzbz'); - + if (isset($kontaktmedium_kurzbz)) { $result = $this->KontaktmediumModel->load($kontaktmedium_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Kontaktmedium extends APIv1_Controller { $result = $this->KontaktmediumModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kontaktmedium extends APIv1_Controller $this->response(); } } - + private function _validate($kontaktmedium = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Kontakttyp.php b/application/controllers/api/v1/person/Kontakttyp.php index bceab7b36..c3d2b6e94 100644 --- a/application/controllers/api/v1/person/Kontakttyp.php +++ b/application/controllers/api/v1/person/Kontakttyp.php @@ -21,11 +21,11 @@ class Kontakttyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kontakttyp' => 'basis/kontakttyp:rw')); // Load model KontakttypModel $this->load->model('person/kontakttyp_model', 'KontakttypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kontakttyp extends APIv1_Controller public function getKontakttyp() { $kontakttyp = $this->get('kontakttyp'); - + if (isset($kontakttyp)) { $result = $this->KontakttypModel->load($kontakttyp); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Kontakttyp extends APIv1_Controller { $result = $this->KontakttypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kontakttyp extends APIv1_Controller $this->response(); } } - + private function _validate($kontakttyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Notiz.php b/application/controllers/api/v1/person/Notiz.php index d4c88b4e2..29755d7d3 100644 --- a/application/controllers/api/v1/person/Notiz.php +++ b/application/controllers/api/v1/person/Notiz.php @@ -21,11 +21,11 @@ class Notiz extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notiz' => 'basis/notiz:rw')); // Load model NotizModel $this->load->model('person/notiz_model', 'NotizModel'); - - + + } /** @@ -34,11 +34,11 @@ class Notiz extends APIv1_Controller public function getNotiz() { $notizID = $this->get('notiz_id'); - + if (isset($notizID)) { $result = $this->NotizModel->load($notizID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Notiz extends APIv1_Controller { $result = $this->NotizModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Notiz extends APIv1_Controller $this->response(); } } - + private function _validate($notiz = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Notizzuordnung.php b/application/controllers/api/v1/person/Notizzuordnung.php index d83370037..c5dab8cbe 100644 --- a/application/controllers/api/v1/person/Notizzuordnung.php +++ b/application/controllers/api/v1/person/Notizzuordnung.php @@ -21,11 +21,11 @@ class Notizzuordnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notizzuordnung' => 'basis/notizzuordnung:rw')); // Load model NotizzuordnungModel $this->load->model('person/notizzuordnung_model', 'NotizzuordnungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Notizzuordnung extends APIv1_Controller public function getNotizzuordnung() { $notizzuordnungID = $this->get('notizzuordnung_id'); - + if (isset($notizzuordnungID)) { $result = $this->NotizzuordnungModel->load($notizzuordnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Notizzuordnung extends APIv1_Controller { $result = $this->NotizzuordnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Notizzuordnung extends APIv1_Controller $this->response(); } } - + private function _validate($notizzuordnung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index c5d78ccdd..c8c95ae06 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -21,7 +21,7 @@ class Person extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Person' => 'basis/person:rw', 'CheckBewerbung' => 'basis/person:r')); // Load model PersonModel $this->load->model('person/person_model', 'PersonModel'); } @@ -34,7 +34,7 @@ class Person extends APIv1_Controller $person_id = $this->get('person_id'); $code = $this->get('code'); $email = $this->get('email'); - + if (isset($code) || isset($email) || isset($person_id)) { if (isset($code) && isset($email)) @@ -44,7 +44,7 @@ class Person extends APIv1_Controller else { $parametersArray = array(); - + if (isset($code)) { $parametersArray['zugangscode'] = $code; @@ -53,10 +53,10 @@ class Person extends APIv1_Controller { $parametersArray['person_id'] = $person_id; } - + $result = $this->PersonModel->loadWhere($parametersArray); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -64,7 +64,7 @@ class Person extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -72,11 +72,11 @@ class Person extends APIv1_Controller { $email = $this->get('email'); $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); - + if (isset($email)) { $result = $this->PersonModel->checkBewerbung($email, $studiensemester_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -92,7 +92,7 @@ class Person extends APIv1_Controller { $person = $this->post(); $validation = $this->_validate($person); - + if (isSuccess($validation)) { if(isset($person['person_id']) && !(is_null($person['person_id'])) && ($person['person_id'] != '')) @@ -103,7 +103,7 @@ class Person extends APIv1_Controller { $result = $this->PersonModel->insert($person); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -111,7 +111,7 @@ class Person extends APIv1_Controller $this->response($validation, REST_Controller::HTTP_OK); } } - + private function _validate($person) { // If $person is consistent @@ -119,7 +119,7 @@ class Person extends APIv1_Controller { return error('Any parameters posted'); } - + // Trim all the values foreach($person as $key => $value) { @@ -128,7 +128,7 @@ class Person extends APIv1_Controller $person[$key] = trim($value); } } - + if (isset($person['sprache']) && mb_strlen($person['sprache']) > 16) { return error('Sprache darf nicht laenger als 16 Zeichen sein'); @@ -213,7 +213,7 @@ class Person extends APIv1_Controller { return error('Geschlecht muss w, m oder u sein!'); } - + if (isset($person['svnr'])) { if ($person['svnr'] != '' && mb_strlen($person['svnr']) != 16 @@ -240,7 +240,7 @@ class Person extends APIv1_Controller { return error('SVNR ist ungueltig'); } - + if (mb_strlen($person['svnr']) == 12) { $last = substr($person['svnr'], 10, 12); @@ -250,7 +250,7 @@ class Person extends APIv1_Controller } } } - + //Pruefen ob das Geburtsdatum mit der SVNR uebereinstimmt. if (isset($person['gebdatum']) && $person['svnr'] != '' && $person['gebdatum'] != '') { @@ -261,7 +261,7 @@ class Person extends APIv1_Controller } } } - + return success('Input data are valid'); } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Aktivitaet.php b/application/controllers/api/v1/project/Aktivitaet.php index 878738804..7aa647058 100644 --- a/application/controllers/api/v1/project/Aktivitaet.php +++ b/application/controllers/api/v1/project/Aktivitaet.php @@ -21,11 +21,11 @@ class Aktivitaet extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aktivitaet' => 'basis/aktivitaet:rw')); // Load model AktivitaetModel $this->load->model('project/aktivitaet_model', 'AktivitaetModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aktivitaet extends APIv1_Controller public function getAktivitaet() { $aktivitaet_kurzbz = $this->get('aktivitaet_kurzbz'); - + if (isset($aktivitaet_kurzbz)) { $result = $this->AktivitaetModel->load($aktivitaet_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Aktivitaet extends APIv1_Controller { $result = $this->AktivitaetModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aktivitaet extends APIv1_Controller $this->response(); } } - + private function _validate($aktivitaet = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Aufwandstyp.php b/application/controllers/api/v1/project/Aufwandstyp.php index f9d9ce58c..96be6ab55 100644 --- a/application/controllers/api/v1/project/Aufwandstyp.php +++ b/application/controllers/api/v1/project/Aufwandstyp.php @@ -21,11 +21,11 @@ class Aufwandstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufwandstyp' => 'basis/aufwandstyp:rw')); // Load model AufwandstypModel $this->load->model('project/aufwandstyp_model', 'AufwandstypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufwandstyp extends APIv1_Controller public function getAufwandstyp() { $aufwandstyp_kurzbz = $this->get('aufwandstyp_kurzbz'); - + if (isset($aufwandstyp_kurzbz)) { $result = $this->AufwandstypModel->load($aufwandstyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Aufwandstyp extends APIv1_Controller { $result = $this->AufwandstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufwandstyp extends APIv1_Controller $this->response(); } } - + private function _validate($aufwandstyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Projekt.php b/application/controllers/api/v1/project/Projekt.php index 6340ca81b..64533f36f 100644 --- a/application/controllers/api/v1/project/Projekt.php +++ b/application/controllers/api/v1/project/Projekt.php @@ -21,11 +21,11 @@ class Projekt extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekt' => 'basis/projekt:rw')); // Load model ProjektModel $this->load->model('project/projekt_model', 'ProjektModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projekt extends APIv1_Controller public function getProjekt() { $projekt_kurzbz = $this->get('projekt_kurzbz'); - + if (isset($projekt_kurzbz)) { $result = $this->ProjektModel->load($projekt_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Projekt extends APIv1_Controller { $result = $this->ProjektModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projekt extends APIv1_Controller $this->response(); } } - + private function _validate($projekt = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Projekt_ressource.php b/application/controllers/api/v1/project/Projekt_ressource.php index 6ff0748f5..2869f935a 100644 --- a/application/controllers/api/v1/project/Projekt_ressource.php +++ b/application/controllers/api/v1/project/Projekt_ressource.php @@ -21,11 +21,11 @@ class Projekt_ressource extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekt_ressource' => 'basis/projekt_ressource:rw')); // Load model Projekt_ressourceModel $this->load->model('project/projekt_ressource_model', 'Projekt_ressourceModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projekt_ressource extends APIv1_Controller public function getProjekt_ressource() { $projekt_ressourceID = $this->get('projekt_ressource_id'); - + if (isset($projekt_ressourceID)) { $result = $this->Projekt_ressourceModel->load($projekt_ressourceID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Projekt_ressource extends APIv1_Controller { $result = $this->Projekt_ressourceModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projekt_ressource extends APIv1_Controller $this->response(); } } - + private function _validate($projekt_ressource = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Projektphase.php b/application/controllers/api/v1/project/Projektphase.php index b59a0aed3..c48893948 100644 --- a/application/controllers/api/v1/project/Projektphase.php +++ b/application/controllers/api/v1/project/Projektphase.php @@ -21,11 +21,11 @@ class Projektphase extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projektphase' => 'basis/projektphase:rw')); // Load model ProjektphaseModel $this->load->model('project/projektphase_model', 'ProjektphaseModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projektphase extends APIv1_Controller public function getProjektphase() { $projektphaseID = $this->get('projektphase_id'); - + if (isset($projektphaseID)) { $result = $this->ProjektphaseModel->load($projektphaseID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Projektphase extends APIv1_Controller { $result = $this->ProjektphaseModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projektphase extends APIv1_Controller $this->response(); } } - + private function _validate($projektphase = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Projekttask.php b/application/controllers/api/v1/project/Projekttask.php index ae89c45b3..5793c85a1 100644 --- a/application/controllers/api/v1/project/Projekttask.php +++ b/application/controllers/api/v1/project/Projekttask.php @@ -21,11 +21,11 @@ class Projekttask extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekttask' => 'basis/projekttask:rw')); // Load model ProjekttaskModel $this->load->model('project/projekttask_model', 'ProjekttaskModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projekttask extends APIv1_Controller public function getProjekttask() { $projekttaskID = $this->get('projekttask_id'); - + if (isset($projekttaskID)) { $result = $this->ProjekttaskModel->load($projekttaskID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Projekttask extends APIv1_Controller { $result = $this->ProjekttaskModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projekttask extends APIv1_Controller $this->response(); } } - + private function _validate($projekttask = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Ressource.php b/application/controllers/api/v1/project/Ressource.php index 0e70c86ac..fddf77c57 100644 --- a/application/controllers/api/v1/project/Ressource.php +++ b/application/controllers/api/v1/project/Ressource.php @@ -21,11 +21,11 @@ class Ressource extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ressource' => 'basis/ressource:rw')); // Load model RessourceModel $this->load->model('project/ressource_model', 'RessourceModel'); - - + + } /** @@ -34,11 +34,11 @@ class Ressource extends APIv1_Controller public function getRessource() { $ressourceID = $this->get('ressource_id'); - + if (isset($ressourceID)) { $result = $this->RessourceModel->load($ressourceID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Ressource extends APIv1_Controller { $result = $this->RessourceModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Ressource extends APIv1_Controller $this->response(); } } - + private function _validate($ressource = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Scrumsprint.php b/application/controllers/api/v1/project/Scrumsprint.php index db81c319f..ff0e75b09 100644 --- a/application/controllers/api/v1/project/Scrumsprint.php +++ b/application/controllers/api/v1/project/Scrumsprint.php @@ -21,11 +21,11 @@ class Scrumsprint extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Scrumsprint' => 'basis/scrumsprint:rw')); // Load model ScrumsprintModel $this->load->model('project/scrumsprint_model', 'ScrumsprintModel'); - - + + } /** @@ -34,11 +34,11 @@ class Scrumsprint extends APIv1_Controller public function getScrumsprint() { $scrumsprintID = $this->get('scrumsprint_id'); - + if (isset($scrumsprintID)) { $result = $this->ScrumsprintModel->load($scrumsprintID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Scrumsprint extends APIv1_Controller { $result = $this->ScrumsprintModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Scrumsprint extends APIv1_Controller $this->response(); } } - + private function _validate($scrumsprint = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Betriebsmittel.php b/application/controllers/api/v1/ressource/Betriebsmittel.php index 2d1da9d22..63e003cfd 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittel.php +++ b/application/controllers/api/v1/ressource/Betriebsmittel.php @@ -21,11 +21,11 @@ class Betriebsmittel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmittel' => 'basis/betriebsmittel:rw')); // Load model BetriebsmittelModel $this->load->model('ressource/betriebsmittel_model', 'BetriebsmittelModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmittel extends APIv1_Controller public function getBetriebsmittel() { $betriebsmittelID = $this->get('betriebsmittel_id'); - + if (isset($betriebsmittelID)) { $result = $this->BetriebsmittelModel->load($betriebsmittelID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Betriebsmittel extends APIv1_Controller { $result = $this->BetriebsmittelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmittel extends APIv1_Controller $this->response(); } } - + private function _validate($betriebsmittel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Betriebsmittelperson2.php b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php index 8ed7a9a7d..71b5af77a 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelperson2.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php @@ -21,11 +21,11 @@ class Betriebsmittelperson2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmittelperson' => 'basis/betriebsmittelperson:rw')); // Load model BetriebsmittelpersonModel $this->load->model('ressource/betriebsmittelperson_model', 'BetriebsmittelpersonModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmittelperson2 extends APIv1_Controller public function getBetriebsmittelperson() { $betriebsmittelpersonID = $this->get('betriebsmittelperson_id'); - + if (isset($betriebsmittelpersonID)) { $result = $this->BetriebsmittelpersonModel->load($betriebsmittelpersonID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Betriebsmittelperson2 extends APIv1_Controller { $result = $this->BetriebsmittelpersonModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmittelperson2 extends APIv1_Controller $this->response(); } } - + private function _validate($betriebsmittelperson = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php index c25c6991e..8dcfad8c6 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php @@ -21,11 +21,11 @@ class Betriebsmittelstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmittelstatus' => 'basis/betriebsmittelstatus:rw')); // Load model BetriebsmittelstatusModel $this->load->model('ressource/betriebsmittelstatus_model', 'BetriebsmittelstatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmittelstatus extends APIv1_Controller public function getBetriebsmittelstatus() { $betriebsmittelstatus_kurzbz = $this->get('betriebsmittelstatus_kurzbz'); - + if (isset($betriebsmittelstatus_kurzbz)) { $result = $this->BetriebsmittelstatusModel->load($betriebsmittelstatus_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Betriebsmittelstatus extends APIv1_Controller { $result = $this->BetriebsmittelstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmittelstatus extends APIv1_Controller $this->response(); } } - + private function _validate($betriebsmittelstatus = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php index 1aef7153b..9902ec032 100644 --- a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php +++ b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php @@ -21,11 +21,11 @@ class Betriebsmitteltyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmitteltyp' => 'basis/betriebsmitteltyp:rw')); // Load model BetriebsmitteltypModel $this->load->model('ressource/betriebsmitteltyp_model', 'BetriebsmitteltypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmitteltyp extends APIv1_Controller public function getBetriebsmitteltyp() { $betriebsmitteltyp = $this->get('betriebsmitteltyp'); - + if (isset($betriebsmitteltyp)) { $result = $this->BetriebsmitteltypModel->load($betriebsmitteltyp); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Betriebsmitteltyp extends APIv1_Controller { $result = $this->BetriebsmitteltypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmitteltyp extends APIv1_Controller $this->response(); } } - + private function _validate($betriebsmitteltyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Coodle.php b/application/controllers/api/v1/ressource/Coodle.php index 3799aae26..bd7cfcf7f 100644 --- a/application/controllers/api/v1/ressource/Coodle.php +++ b/application/controllers/api/v1/ressource/Coodle.php @@ -21,11 +21,11 @@ class Coodle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Coodle' => 'basis/coodle:rw')); // Load model CoodleModel $this->load->model('ressource/coodle_model', 'CoodleModel'); - - + + } /** @@ -34,11 +34,11 @@ class Coodle extends APIv1_Controller public function getCoodle() { $coodleID = $this->get('coodle_id'); - + if (isset($coodleID)) { $result = $this->CoodleModel->load($coodleID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Coodle extends APIv1_Controller { $result = $this->CoodleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Coodle extends APIv1_Controller $this->response(); } } - + private function _validate($coodle = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Erreichbarkeit.php b/application/controllers/api/v1/ressource/Erreichbarkeit.php index 545501a77..291451faf 100644 --- a/application/controllers/api/v1/ressource/Erreichbarkeit.php +++ b/application/controllers/api/v1/ressource/Erreichbarkeit.php @@ -21,11 +21,11 @@ class Erreichbarkeit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Erreichbarkeit' => 'basis/erreichbarkeit:rw')); // Load model ErreichbarkeitModel $this->load->model('ressource/erreichbarkeit_model', 'ErreichbarkeitModel'); - - + + } /** @@ -34,11 +34,11 @@ class Erreichbarkeit extends APIv1_Controller public function getErreichbarkeit() { $erreichbarkeit_kurzbz = $this->get('erreichbarkeit_kurzbz'); - + if (isset($erreichbarkeit_kurzbz)) { $result = $this->ErreichbarkeitModel->load($erreichbarkeit_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Erreichbarkeit extends APIv1_Controller { $result = $this->ErreichbarkeitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Erreichbarkeit extends APIv1_Controller $this->response(); } } - + private function _validate($erreichbarkeit = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Firma.php b/application/controllers/api/v1/ressource/Firma.php index 5bcfb1173..159d63642 100644 --- a/application/controllers/api/v1/ressource/Firma.php +++ b/application/controllers/api/v1/ressource/Firma.php @@ -21,11 +21,11 @@ class Firma extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Firma' => 'basis/firma:rw')); // Load model FirmaModel $this->load->model('ressource/firma_model', 'FirmaModel'); - - + + } /** @@ -34,11 +34,11 @@ class Firma extends APIv1_Controller public function getFirma() { $firmaID = $this->get('firma_id'); - + if (isset($firmaID)) { $result = $this->FirmaModel->load($firmaID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Firma extends APIv1_Controller { $result = $this->FirmaModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Firma extends APIv1_Controller $this->response(); } } - + private function _validate($firma = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Firmatag.php b/application/controllers/api/v1/ressource/Firmatag.php index c2c4f7533..b9df31896 100644 --- a/application/controllers/api/v1/ressource/Firmatag.php +++ b/application/controllers/api/v1/ressource/Firmatag.php @@ -21,11 +21,11 @@ class Firmatag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Firmatag' => 'basis/firmatag:rw')); // Load model FirmatagModel $this->load->model('ressource/firmatag_model', 'FirmatagModel'); - - + + } /** @@ -35,11 +35,11 @@ class Firmatag extends APIv1_Controller { $tag = $this->get('tag'); $firma_id = $this->get('firma_id'); - + if (isset($tag) && isset($firma_id)) { $result = $this->FirmatagModel->load(array($tag, $firma_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Firmatag extends APIv1_Controller { $result = $this->FirmatagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Firmatag extends APIv1_Controller $this->response(); } } - + private function _validate($firmatag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Firmentyp.php b/application/controllers/api/v1/ressource/Firmentyp.php index c5c2d6fed..2d13ae845 100644 --- a/application/controllers/api/v1/ressource/Firmentyp.php +++ b/application/controllers/api/v1/ressource/Firmentyp.php @@ -21,11 +21,11 @@ class Firmentyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Firmentyp' => 'basis/firmentyp:rw')); // Load model FirmentypModel $this->load->model('ressource/firmentyp_model', 'FirmentypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Firmentyp extends APIv1_Controller public function getFirmentyp() { $firmentyp_kurzbz = $this->get('firmentyp_kurzbz'); - + if (isset($firmentyp_kurzbz)) { $result = $this->FirmentypModel->load($firmentyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Firmentyp extends APIv1_Controller { $result = $this->FirmentypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Firmentyp extends APIv1_Controller $this->response(); } } - + private function _validate($firmentyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Funktion.php b/application/controllers/api/v1/ressource/Funktion.php index 191394da8..0ff059d2a 100644 --- a/application/controllers/api/v1/ressource/Funktion.php +++ b/application/controllers/api/v1/ressource/Funktion.php @@ -21,11 +21,11 @@ class Funktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Funktion' => 'basis/funktion:rw')); // Load model FunktionModel $this->load->model('ressource/funktion_model', 'FunktionModel'); - - + + } /** @@ -34,11 +34,11 @@ class Funktion extends APIv1_Controller public function getFunktion() { $funktion_kurzbz = $this->get('funktion_kurzbz'); - + if (isset($funktion_kurzbz)) { $result = $this->FunktionModel->load($funktion_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Funktion extends APIv1_Controller { $result = $this->FunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Funktion extends APIv1_Controller $this->response(); } } - + private function _validate($funktion = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Lehrmittel.php b/application/controllers/api/v1/ressource/Lehrmittel.php index b28c7eb15..36d0d7a2f 100644 --- a/application/controllers/api/v1/ressource/Lehrmittel.php +++ b/application/controllers/api/v1/ressource/Lehrmittel.php @@ -21,11 +21,11 @@ class Lehrmittel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrmittel' => 'basis/lehrmittel:rw')); // Load model LehrmittelModel $this->load->model('ressource/lehrmittel_model', 'LehrmittelModel'); - - + + } /** @@ -34,11 +34,11 @@ class Lehrmittel extends APIv1_Controller public function getLehrmittel() { $lehrmittel_kurzbz = $this->get('lehrmittel_kurzbz'); - + if (isset($lehrmittel_kurzbz)) { $result = $this->LehrmittelModel->load($lehrmittel_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Lehrmittel extends APIv1_Controller { $result = $this->LehrmittelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Lehrmittel extends APIv1_Controller $this->response(); } } - + private function _validate($lehrmittel = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Mitarbeiter.php b/application/controllers/api/v1/ressource/Mitarbeiter.php index e550d005b..89ead5681 100644 --- a/application/controllers/api/v1/ressource/Mitarbeiter.php +++ b/application/controllers/api/v1/ressource/Mitarbeiter.php @@ -21,11 +21,11 @@ class Mitarbeiter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Mitarbeiter' => 'basis/mitarbeiter:rw')); // Load model MitarbeiterModel $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); - - + + } /** @@ -34,11 +34,11 @@ class Mitarbeiter extends APIv1_Controller public function getMitarbeiter() { $mitarbeiter_uid = $this->get('mitarbeiter_uid'); - + if (isset($mitarbeiter_uid)) { $result = $this->MitarbeiterModel->load($mitarbeiter_uid); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Mitarbeiter extends APIv1_Controller { $result = $this->MitarbeiterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Mitarbeiter extends APIv1_Controller $this->response(); } } - + private function _validate($mitarbeiter = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Ort.php b/application/controllers/api/v1/ressource/Ort.php index bdc695ab0..1610c7d0f 100644 --- a/application/controllers/api/v1/ressource/Ort.php +++ b/application/controllers/api/v1/ressource/Ort.php @@ -21,7 +21,7 @@ class Ort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ort' => 'basis/ort:rw', 'All' => 'basis/ort:r')); // Load model OrtModel $this->load->model("ressource/ort_model", "OrtModel"); } @@ -32,11 +32,11 @@ class Ort extends APIv1_Controller public function getOrt() { $ort_kurzbz = $this->get("ort_kurzbz"); - + if (isset($ort_kurzbz)) { $result = $this->OrtModel->load(trim($ort_kurzbz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -44,7 +44,7 @@ class Ort extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -60,7 +60,7 @@ class Ort extends APIv1_Controller { $result = $this->OrtModel->load(); } - + $this->response($result, REST_Controller::HTTP_OK); } @@ -79,7 +79,7 @@ class Ort extends APIv1_Controller { $result = $this->OrtModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -87,9 +87,9 @@ class Ort extends APIv1_Controller $this->response(); } } - + private function _validate($ort = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Ortraumtyp.php b/application/controllers/api/v1/ressource/Ortraumtyp.php index 7452805ee..cbf9c3d9b 100644 --- a/application/controllers/api/v1/ressource/Ortraumtyp.php +++ b/application/controllers/api/v1/ressource/Ortraumtyp.php @@ -21,11 +21,11 @@ class Ortraumtyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ortraumtyp' => 'basis/ortraumtyp:rw')); // Load model OrtraumtypModel $this->load->model('ressource/ortraumtyp_model', 'OrtraumtypModel'); - - + + } /** @@ -35,11 +35,11 @@ class Ortraumtyp extends APIv1_Controller { $hierarchie = $this->get('hierarchie'); $ort_kurzbz = $this->get('ort_kurzbz'); - + if (isset($hierarchie) && isset($ort_kurzbz)) { $result = $this->OrtraumtypModel->load(array($hierarchie, $ort_kurzbz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Ortraumtyp extends APIv1_Controller { $result = $this->OrtraumtypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Ortraumtyp extends APIv1_Controller $this->response(); } } - + private function _validate($ortraumtyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Personfunktionstandort.php b/application/controllers/api/v1/ressource/Personfunktionstandort.php index 7d75b80ce..1c7551984 100644 --- a/application/controllers/api/v1/ressource/Personfunktionstandort.php +++ b/application/controllers/api/v1/ressource/Personfunktionstandort.php @@ -21,11 +21,11 @@ class Personfunktionstandort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Personfunktionstandort' => 'basis/personfunktionstandort:rw')); // Load model PersonfunktionstandortModel $this->load->model('ressource/personfunktionstandort_model', 'PersonfunktionstandortModel'); - - + + } /** @@ -34,11 +34,11 @@ class Personfunktionstandort extends APIv1_Controller public function getPersonfunktionstandort() { $personfunktionstandortID = $this->get('personfunktionstandort_id'); - + if (isset($personfunktionstandortID)) { $result = $this->PersonfunktionstandortModel->load($personfunktionstandortID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Personfunktionstandort extends APIv1_Controller { $result = $this->PersonfunktionstandortModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Personfunktionstandort extends APIv1_Controller $this->response(); } } - + private function _validate($personfunktionstandort = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Raumtyp.php b/application/controllers/api/v1/ressource/Raumtyp.php index 10d05e108..71b7bf5d8 100644 --- a/application/controllers/api/v1/ressource/Raumtyp.php +++ b/application/controllers/api/v1/ressource/Raumtyp.php @@ -21,11 +21,11 @@ class Raumtyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Raumtyp' => 'basis/raumtyp:rw')); // Load model RaumtypModel $this->load->model('ressource/raumtyp_model', 'RaumtypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Raumtyp extends APIv1_Controller public function getRaumtyp() { $raumtyp_kurzbz = $this->get('raumtyp_kurzbz'); - + if (isset($raumtyp_kurzbz)) { $result = $this->RaumtypModel->load($raumtyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Raumtyp extends APIv1_Controller { $result = $this->RaumtypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Raumtyp extends APIv1_Controller $this->response(); } } - + private function _validate($raumtyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Reservierung.php b/application/controllers/api/v1/ressource/Reservierung.php index 48370708d..633f61036 100644 --- a/application/controllers/api/v1/ressource/Reservierung.php +++ b/application/controllers/api/v1/ressource/Reservierung.php @@ -21,11 +21,11 @@ class Reservierung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Reservierung' => 'basis/reservierung:rw')); // Load model ReservierungModel $this->load->model('ressource/reservierung_model', 'ReservierungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Reservierung extends APIv1_Controller public function getReservierung() { $reservierungID = $this->get('reservierung_id'); - + if (isset($reservierungID)) { $result = $this->ReservierungModel->load($reservierungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Reservierung extends APIv1_Controller { $result = $this->ReservierungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Reservierung extends APIv1_Controller $this->response(); } } - + private function _validate($reservierung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Stunde.php b/application/controllers/api/v1/ressource/Stunde.php index 23711453a..5d2f37049 100644 --- a/application/controllers/api/v1/ressource/Stunde.php +++ b/application/controllers/api/v1/ressource/Stunde.php @@ -21,11 +21,11 @@ class Stunde extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Stunde' => 'basis/stunde:rw')); // Load model StundeModel $this->load->model('ressource/stunde_model', 'StundeModel'); - - + + } /** @@ -34,11 +34,11 @@ class Stunde extends APIv1_Controller public function getStunde() { $stunde = $this->get('stunde'); - + if (isset($stunde)) { $result = $this->StundeModel->load($stunde); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Stunde extends APIv1_Controller { $result = $this->StundeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Stunde extends APIv1_Controller $this->response(); } } - + private function _validate($stunde = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Stundenplan.php b/application/controllers/api/v1/ressource/Stundenplan.php index 37932cf1f..2d4b3c705 100644 --- a/application/controllers/api/v1/ressource/Stundenplan.php +++ b/application/controllers/api/v1/ressource/Stundenplan.php @@ -21,11 +21,11 @@ class Stundenplan extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Stundenplan' => 'basis/stundenplan:rw')); // Load model StundenplanModel $this->load->model('ressource/stundenplan_model', 'StundenplanModel'); - - + + } /** @@ -34,11 +34,11 @@ class Stundenplan extends APIv1_Controller public function getStundenplan() { $stundenplanID = $this->get('stundenplan_id'); - + if (isset($stundenplanID)) { $result = $this->StundenplanModel->load($stundenplanID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Stundenplan extends APIv1_Controller { $result = $this->StundenplanModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Stundenplan extends APIv1_Controller $this->response(); } } - + private function _validate($stundenplan = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Stundenplandev.php b/application/controllers/api/v1/ressource/Stundenplandev.php index 429999321..385f2bf9e 100644 --- a/application/controllers/api/v1/ressource/Stundenplandev.php +++ b/application/controllers/api/v1/ressource/Stundenplandev.php @@ -21,11 +21,11 @@ class Stundenplandev extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Stundenplandev' => 'basis/stundenplandev:rw')); // Load model StundenplandevModel $this->load->model('ressource/stundenplandev_model', 'StundenplandevModel'); - - + + } /** @@ -34,11 +34,11 @@ class Stundenplandev extends APIv1_Controller public function getStundenplandev() { $stundenplandevID = $this->get('stundenplandev_id'); - + if (isset($stundenplandevID)) { $result = $this->StundenplandevModel->load($stundenplandevID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Stundenplandev extends APIv1_Controller { $result = $this->StundenplandevModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Stundenplandev extends APIv1_Controller $this->response(); } } - + private function _validate($stundenplandev = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Zeitaufzeichnung.php b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php index 367d7e12e..8c30390e6 100644 --- a/application/controllers/api/v1/ressource/Zeitaufzeichnung.php +++ b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php @@ -21,11 +21,11 @@ class Zeitaufzeichnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitaufzeichnung' => 'basis/zeitaufzeichnung:rw')); // Load model ZeitaufzeichnungModel $this->load->model('ressource/zeitaufzeichnung_model', 'ZeitaufzeichnungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Zeitaufzeichnung extends APIv1_Controller public function getZeitaufzeichnung() { $zeitaufzeichnungID = $this->get('zeitaufzeichnung_id'); - + if (isset($zeitaufzeichnungID)) { $result = $this->ZeitaufzeichnungModel->load($zeitaufzeichnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Zeitaufzeichnung extends APIv1_Controller { $result = $this->ZeitaufzeichnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Zeitaufzeichnung extends APIv1_Controller $this->response(); } } - + private function _validate($zeitaufzeichnung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Zeitfenster.php b/application/controllers/api/v1/ressource/Zeitfenster.php index f65b3ad7c..e180d0d75 100644 --- a/application/controllers/api/v1/ressource/Zeitfenster.php +++ b/application/controllers/api/v1/ressource/Zeitfenster.php @@ -21,11 +21,11 @@ class Zeitfenster extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitfenster' => 'basis/zeitfenster:rw')); // Load model ZeitfensterModel $this->load->model('ressource/zeitfenster_model', 'ZeitfensterModel'); - - + + } /** @@ -37,11 +37,11 @@ class Zeitfenster extends APIv1_Controller $studiengang_kz = $this->get('studiengang_kz'); $ort_kurzbz = $this->get('ort_kurzbz'); $stunde = $this->get('stunde'); - + if (isset($wochentag) && isset($studiengang_kz) && isset($ort_kurzbz) && isset($stunde)) { $result = $this->ZeitfensterModel->load(array($wochentag, $studiengang_kz, $ort_kurzbz, $stunde)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -65,14 +65,14 @@ class Zeitfenster extends APIv1_Controller $this->post()['ort_kurzbz'], $this->post()['stunde'] ); - + $result = $this->ZeitfensterModel->update($pksArray, $this->post()); } else { $result = $this->ZeitfensterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -80,9 +80,9 @@ class Zeitfenster extends APIv1_Controller $this->response(); } } - + private function _validate($zeitfenster = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Zeitsperre.php b/application/controllers/api/v1/ressource/Zeitsperre.php index c0d9c0cbc..626a88d79 100644 --- a/application/controllers/api/v1/ressource/Zeitsperre.php +++ b/application/controllers/api/v1/ressource/Zeitsperre.php @@ -21,11 +21,11 @@ class Zeitsperre extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitsperre' => 'basis/zeitsperre:rw')); // Load model ZeitsperreModel $this->load->model('ressource/zeitsperre_model', 'ZeitsperreModel'); - - + + } /** @@ -34,11 +34,11 @@ class Zeitsperre extends APIv1_Controller public function getZeitsperre() { $zeitsperreID = $this->get('zeitsperre_id'); - + if (isset($zeitsperreID)) { $result = $this->ZeitsperreModel->load($zeitsperreID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Zeitsperre extends APIv1_Controller { $result = $this->ZeitsperreModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Zeitsperre extends APIv1_Controller $this->response(); } } - + private function _validate($zeitsperre = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Zeitsperretyp.php b/application/controllers/api/v1/ressource/Zeitsperretyp.php index b131f81e7..c70a9b2f4 100644 --- a/application/controllers/api/v1/ressource/Zeitsperretyp.php +++ b/application/controllers/api/v1/ressource/Zeitsperretyp.php @@ -21,11 +21,11 @@ class Zeitsperretyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitsperretyp' => 'basis/zeitsperretyp:rw')); // Load model ZeitsperretypModel $this->load->model('ressource/zeitsperretyp_model', 'ZeitsperretypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Zeitsperretyp extends APIv1_Controller public function getZeitsperretyp() { $zeitsperretyp_kurzbz = $this->get('zeitsperretyp_kurzbz'); - + if (isset($zeitsperretyp_kurzbz)) { $result = $this->ZeitsperretypModel->load($zeitsperretyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Zeitsperretyp extends APIv1_Controller { $result = $this->ZeitsperretypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Zeitsperretyp extends APIv1_Controller $this->response(); } } - + private function _validate($zeitsperretyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/ressource/Zeitwunsch.php b/application/controllers/api/v1/ressource/Zeitwunsch.php index ed479ff86..8d9646edc 100644 --- a/application/controllers/api/v1/ressource/Zeitwunsch.php +++ b/application/controllers/api/v1/ressource/Zeitwunsch.php @@ -21,11 +21,11 @@ class Zeitwunsch extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitwunsch' => 'basis/zeitwunsch:rw')); // Load model ZeitwunschModel $this->load->model('ressource/zeitwunsch_model', 'ZeitwunschModel'); - - + + } /** @@ -36,11 +36,11 @@ class Zeitwunsch extends APIv1_Controller $tag = $this->get('tag'); $mitarbeiter_uid = $this->get('mitarbeiter_uid'); $stunde = $this->get('stunde'); - + if (isset($tag) && isset($mitarbeiter_uid) && isset($stunde)) { $result = $this->ZeitwunschModel->load(array($tag, $mitarbeiter_uid, $stunde)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,14 +62,14 @@ class Zeitwunsch extends APIv1_Controller $this->post()['mitarbeiter_uid'], $this->post()['stunde'] ); - + $result = $this->ZeitwunschModel->update($pksArray, $this->post()); } else { $result = $this->ZeitwunschModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -77,9 +77,9 @@ class Zeitwunsch extends APIv1_Controller $this->response(); } } - + private function _validate($zeitwunsch = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Appdaten.php b/application/controllers/api/v1/system/Appdaten.php index 6c71a8825..3395ec9b6 100644 --- a/application/controllers/api/v1/system/Appdaten.php +++ b/application/controllers/api/v1/system/Appdaten.php @@ -21,7 +21,7 @@ class Appdaten extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Appdaten' => 'system/appdaten:rw')); // Load model AppdatenModel $this->load->model('system/Appdaten_model', 'AppdatenModel'); } @@ -32,11 +32,11 @@ class Appdaten extends APIv1_Controller public function getAppdaten() { $appdatenID = $this->get('appdaten_id'); - + if (isset($appdatenID)) { $result = $this->AppdatenModel->load($appdatenID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Appdaten extends APIv1_Controller { $result = $this->AppdatenModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Appdaten extends APIv1_Controller $this->response(); } } - + private function _validate($appdaten = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Benutzerrolle.php b/application/controllers/api/v1/system/Benutzerrolle.php index b34551746..99ec3d79e 100644 --- a/application/controllers/api/v1/system/Benutzerrolle.php +++ b/application/controllers/api/v1/system/Benutzerrolle.php @@ -21,11 +21,11 @@ class Benutzerrolle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzerrolle' => 'basis/benutzerrolle:rw')); // Load model BenutzerrolleModel $this->load->model('system/benutzerrolle_model', 'BenutzerrolleModel'); - - + + } /** @@ -34,11 +34,11 @@ class Benutzerrolle extends APIv1_Controller public function getBenutzerrolle() { $benutzerrolleID = $this->get('benutzerrolle_id'); - + if (isset($benutzerrolleID)) { $result = $this->BenutzerrolleModel->load($benutzerrolleID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Benutzerrolle extends APIv1_Controller { $result = $this->BenutzerrolleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Benutzerrolle extends APIv1_Controller $this->response(); } } - + private function _validate($benutzerrolle = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Berechtigung.php b/application/controllers/api/v1/system/Berechtigung.php index 52f9cde59..e94bf30f3 100644 --- a/application/controllers/api/v1/system/Berechtigung.php +++ b/application/controllers/api/v1/system/Berechtigung.php @@ -21,11 +21,11 @@ class Berechtigung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Berechtigung' => 'basis/berechtigung:rw')); // Load model BerechtigungModel $this->load->model('system/berechtigung_model', 'BerechtigungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Berechtigung extends APIv1_Controller public function getBerechtigung() { $berechtigung_kurzbz = $this->get('berechtigung_kurzbz'); - + if (isset($berechtigung_kurzbz)) { $result = $this->BerechtigungModel->load($berechtigung_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Berechtigung extends APIv1_Controller { $result = $this->BerechtigungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Berechtigung extends APIv1_Controller $this->response(); } } - + private function _validate($berechtigung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/CallerLibrary.php b/application/controllers/api/v1/system/CallerLibrary.php index 42f2e785e..903973b8c 100644 --- a/application/controllers/api/v1/system/CallerLibrary.php +++ b/application/controllers/api/v1/system/CallerLibrary.php @@ -21,8 +21,8 @@ class CallerLibrary extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct(array('Call' => 'basis/callerlibrary:rw')); + // Loads the CallerLib $this->load->library('CallerLib'); } @@ -50,7 +50,7 @@ class CallerLibrary extends APIv1_Controller // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -62,7 +62,7 @@ class CallerLibrary extends APIv1_Controller // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -74,4 +74,4 @@ class CallerLibrary extends APIv1_Controller // Print the result $this->response($result, REST_Controller::HTTP_OK); } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/CallerModel.php b/application/controllers/api/v1/system/CallerModel.php index 9c3ee8815..3ea1dc326 100644 --- a/application/controllers/api/v1/system/CallerModel.php +++ b/application/controllers/api/v1/system/CallerModel.php @@ -21,8 +21,8 @@ class CallerModel extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct(array('Call' => 'basis/callermodel:rw')); + // Loads the CallerLib $this->load->library('CallerLib'); } @@ -50,7 +50,7 @@ class CallerModel extends APIv1_Controller // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -62,7 +62,7 @@ class CallerModel extends APIv1_Controller // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -74,4 +74,4 @@ class CallerModel extends APIv1_Controller // Print the result $this->response($result, REST_Controller::HTTP_OK); } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Cronjob.php b/application/controllers/api/v1/system/Cronjob.php index 3f625389a..4b3bcba82 100644 --- a/application/controllers/api/v1/system/Cronjob.php +++ b/application/controllers/api/v1/system/Cronjob.php @@ -21,11 +21,11 @@ class Cronjob extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Cronjob' => 'basis/cronjob:rw')); // Load model CronjobModel $this->load->model('system/cronjob_model', 'CronjobModel'); - - + + } /** @@ -34,11 +34,11 @@ class Cronjob extends APIv1_Controller public function getCronjob() { $cronjobID = $this->get('cronjob_id'); - + if (isset($cronjobID)) { $result = $this->CronjobModel->load($cronjobID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Cronjob extends APIv1_Controller { $result = $this->CronjobModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Cronjob extends APIv1_Controller $this->response(); } } - + private function _validate($cronjob = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Filter.php b/application/controllers/api/v1/system/Filter.php index b6e3027bd..bc217d385 100644 --- a/application/controllers/api/v1/system/Filter.php +++ b/application/controllers/api/v1/system/Filter.php @@ -21,11 +21,11 @@ class Filter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Filter' => 'basis/filter:rw')); // Load model FilterModel $this->load->model('system/filter_model', 'FilterModel'); - - + + } /** @@ -34,11 +34,11 @@ class Filter extends APIv1_Controller public function getFilter() { $filterID = $this->get('filter_id'); - + if (isset($filterID)) { $result = $this->FilterModel->load($filterID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Filter extends APIv1_Controller { $result = $this->FilterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Filter extends APIv1_Controller $this->response(); } } - + private function _validate($filter = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Log.php b/application/controllers/api/v1/system/Log.php index 653731f02..c270922c5 100644 --- a/application/controllers/api/v1/system/Log.php +++ b/application/controllers/api/v1/system/Log.php @@ -21,11 +21,11 @@ class Log extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Log' => 'basis/log:rw')); // Load model LogModel $this->load->model('system/log_model', 'LogModel'); - - + + } /** @@ -34,11 +34,11 @@ class Log extends APIv1_Controller public function getLog() { $logID = $this->get('log_id'); - + if (isset($logID)) { $result = $this->LogModel->load($logID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Log extends APIv1_Controller { $result = $this->LogModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Log extends APIv1_Controller $this->response(); } } - + private function _validate($log = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Message.php b/application/controllers/api/v1/system/Message.php index 0f3f79855..be87526ed 100644 --- a/application/controllers/api/v1/system/Message.php +++ b/application/controllers/api/v1/system/Message.php @@ -21,7 +21,18 @@ class Message extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'MessagesByPersonID' => 'basis/message:r', + 'MessagesByUID' => 'basis/message:r', + 'MessagesByToken' => 'basis/message:r', + 'SentMessagesByPerson' => 'basis/message:r', + 'CountUnreadMessages' => 'basis/message:r', + 'Message' => 'basis/message:w', + 'MessageVorlage' => 'basis/message:w', + 'ChangeStatus' => 'basis/message:w' + ) + ); // Load library MessageLib $this->load->library('MessageLib'); } diff --git a/application/controllers/api/v1/system/Phrase.php b/application/controllers/api/v1/system/Phrase.php index 31decf540..ca5620bf8 100644 --- a/application/controllers/api/v1/system/Phrase.php +++ b/application/controllers/api/v1/system/Phrase.php @@ -21,7 +21,7 @@ class Phrase extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Phrase' => 'system/phrase:rw', 'Phrases' => 'system/phrase:r')); $this->load->library('PhrasesLib'); } @@ -31,11 +31,11 @@ class Phrase extends APIv1_Controller public function getPhrase() { $phrase_id = $this->get('phrase_id'); - + if (isset($phrase_id)) { $result = $this->phraseslib->getPhrase($phrase_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -43,7 +43,7 @@ class Phrase extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -55,11 +55,11 @@ class Phrase extends APIv1_Controller $orgeinheit_kurzbz = $this->get('orgeinheit_kurzbz'); $orgform_kurzbz = $this->get('orgform_kurzbz'); $blockTags = $this->get('blockTags'); - + if (isset($app) && isset($sprache)) { $result = $this->phraseslib->getPhrases($app, $sprache, $phrase, $orgeinheit_kurzbz, $orgform_kurzbz, $blockTags); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -83,7 +83,7 @@ class Phrase extends APIv1_Controller { $result = $this->PhraseModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -91,9 +91,9 @@ class Phrase extends APIv1_Controller $this->response(); } } - + private function _validate($phrase = null) { return false; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Rolle.php b/application/controllers/api/v1/system/Rolle.php index 9bf3a229e..ba257145f 100644 --- a/application/controllers/api/v1/system/Rolle.php +++ b/application/controllers/api/v1/system/Rolle.php @@ -21,11 +21,11 @@ class Rolle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rolle' => 'basis/rolle:rw')); // Load model RolleModel $this->load->model('system/rolle_model', 'RolleModel'); - - + + } /** @@ -34,11 +34,11 @@ class Rolle extends APIv1_Controller public function getRolle() { $rolle_kurzbz = $this->get('rolle_kurzbz'); - + if (isset($rolle_kurzbz)) { $result = $this->RolleModel->load($rolle_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Rolle extends APIv1_Controller { $result = $this->RolleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Rolle extends APIv1_Controller $this->response(); } } - + private function _validate($rolle = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Rolleberechtigung.php b/application/controllers/api/v1/system/Rolleberechtigung.php index f4c0b11a5..3838dc6de 100644 --- a/application/controllers/api/v1/system/Rolleberechtigung.php +++ b/application/controllers/api/v1/system/Rolleberechtigung.php @@ -21,11 +21,11 @@ class Rolleberechtigung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rolleberechtigung' => 'basis/rolleberechtigung:rw')); // Load model RolleberechtigungModel $this->load->model('system/rolleberechtigung_model', 'RolleberechtigungModel'); - - + + } /** @@ -35,11 +35,11 @@ class Rolleberechtigung extends APIv1_Controller { $rolle_kurzbz = $this->get('rolle_kurzbz'); $berechtigung_kurzbz = $this->get('berechtigung_kurzbz'); - + if (isset($rolle_kurzbz) && isset($berechtigung_kurzbz)) { $result = $this->RolleberechtigungModel->load(array($rolle_kurzbz, $berechtigung_kurzbz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Rolleberechtigung extends APIv1_Controller { $result = $this->RolleberechtigungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Rolleberechtigung extends APIv1_Controller $this->response(); } } - + private function _validate($rolleberechtigung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Server.php b/application/controllers/api/v1/system/Server.php index 8bd2bffa1..0f3c76655 100644 --- a/application/controllers/api/v1/system/Server.php +++ b/application/controllers/api/v1/system/Server.php @@ -21,11 +21,11 @@ class Server extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Server' => 'basis/server:rw')); // Load model ServerModel $this->load->model('system/server_model', 'ServerModel'); - - + + } /** @@ -34,11 +34,11 @@ class Server extends APIv1_Controller public function getServer() { $server_kurzbz = $this->get('server_kurzbz'); - + if (isset($server_kurzbz)) { $result = $this->ServerModel->load($server_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Server extends APIv1_Controller { $result = $this->ServerModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Server extends APIv1_Controller $this->response(); } } - + private function _validate($server = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Sprache2.php b/application/controllers/api/v1/system/Sprache2.php index 86304fc70..3a3b7e6de 100644 --- a/application/controllers/api/v1/system/Sprache2.php +++ b/application/controllers/api/v1/system/Sprache2.php @@ -21,11 +21,11 @@ class Sprache2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Sprache' => 'basis/sprache:rw')); // Load model SpracheModel $this->load->model('system/sprache_model', 'SpracheModel'); - - + + } /** @@ -34,9 +34,9 @@ class Sprache2 extends APIv1_Controller public function getSprache() { $sprache = $this->get('sprache'); - + $result = $this->SpracheModel->load($sprache); - + $this->response($result, REST_Controller::HTTP_OK); } @@ -55,7 +55,7 @@ class Sprache2 extends APIv1_Controller { $result = $this->SpracheModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Sprache2 extends APIv1_Controller $this->response(); } } - + private function _validate($sprache = NULL) { return true; diff --git a/application/controllers/api/v1/system/Tag.php b/application/controllers/api/v1/system/Tag.php index 12ce7b3ac..2bcb2dec2 100644 --- a/application/controllers/api/v1/system/Tag.php +++ b/application/controllers/api/v1/system/Tag.php @@ -21,11 +21,11 @@ class Tag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Tag' => 'basis/tag:rw')); // Load model TagModel $this->load->model('system/tag_model', 'TagModel'); - - + + } /** @@ -34,11 +34,11 @@ class Tag extends APIv1_Controller public function getTag() { $tag = $this->get('tag'); - + if (isset($tag)) { $result = $this->TagModel->load($tag); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Tag extends APIv1_Controller { $result = $this->TagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Tag extends APIv1_Controller $this->response(); } } - + private function _validate($tag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/UDF.php b/application/controllers/api/v1/system/UDF.php index 252332cce..57d22600c 100644 --- a/application/controllers/api/v1/system/UDF.php +++ b/application/controllers/api/v1/system/UDF.php @@ -21,8 +21,8 @@ class UDF extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct(array('UDF' => 'system/udf:rw')); + // Load model UDF_model $this->load->model('system/UDF_model', 'UDFModel'); } @@ -35,9 +35,9 @@ class UDF extends APIv1_Controller $decode = $this->get('decode'); $schema = $this->get('schema'); $table = $this->get('table'); - + $result = error(); - + if (isset($schema) || isset($table)) { $result = $this->UDFModel->loadWhere( @@ -51,23 +51,23 @@ class UDF extends APIv1_Controller { $result = $this->UDFModel->load(); } - + if ($decode) { $this->_jsonDecodeResult($result); } - + $this->response($result, REST_Controller::HTTP_OK); } - + /** - * + * */ public function postUDF() { $udfs = $this->post(); $validation = $this->_validate($udfs); - + if (isSuccess($validation)) { $caller = null; @@ -76,9 +76,9 @@ class UDF extends APIv1_Controller $caller = $udfs['caller']; unset($udfs['caller']); } - + $result = $this->UDFModel->saveUDFs($udfs); - + if ($caller != null) { $res = 'ERR'; @@ -86,7 +86,7 @@ class UDF extends APIv1_Controller { $res = 'OK'; } - + redirect($caller.'&res='.$res); } else @@ -99,23 +99,23 @@ class UDF extends APIv1_Controller $this->response($validation, REST_Controller::HTTP_OK); } } - + /** - * + * */ private function _validate($udfs) { $validation = error('person_id or prestudent_id is missing'); - + if((isset($udfs['person_id']) && !(is_null($udfs['person_id'])) && ($udfs['person_id'] != '')) || (isset($udfs['prestudent_id']) && !(is_null($udfs['prestudent_id'])) && ($udfs['prestudent_id'] != ''))) { $validation = success(true); } - + return $validation; } - + /** * Decode to json the column jsons for every result set */ @@ -130,4 +130,4 @@ class UDF extends APIv1_Controller } } } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Variable.php b/application/controllers/api/v1/system/Variable.php index d97fefdf7..8a4e196dc 100644 --- a/application/controllers/api/v1/system/Variable.php +++ b/application/controllers/api/v1/system/Variable.php @@ -21,11 +21,11 @@ class Variable extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Variable' => 'basis/variable:rw')); // Load model VariableModel $this->load->model('system/variable_model', 'VariableModel'); - - + + } /** @@ -35,11 +35,11 @@ class Variable extends APIv1_Controller { $uid = $this->get('uid'); $name = $this->get('name'); - + if (isset($uid) && isset($name)) { $result = $this->VariableModel->load(array($uid, $name)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Variable extends APIv1_Controller { $result = $this->VariableModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Variable extends APIv1_Controller $this->response(); } } - + private function _validate($variable = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Vorlage.php b/application/controllers/api/v1/system/Vorlage.php index 304471971..48a73ac4f 100644 --- a/application/controllers/api/v1/system/Vorlage.php +++ b/application/controllers/api/v1/system/Vorlage.php @@ -21,11 +21,11 @@ class Vorlage extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vorlage' => 'system/vorlage:rw')); // Load model VorlageModel $this->load->model('system/vorlage_model', 'VorlageModel'); - - + + } /** @@ -34,11 +34,11 @@ class Vorlage extends APIv1_Controller public function getVorlage() { $vorlage_kurzbz = $this->get('vorlage_kurzbz'); - + if (isset($vorlage_kurzbz)) { $result = $this->VorlageModel->load($vorlage_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Vorlage extends APIv1_Controller { $result = $this->VorlageModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Vorlage extends APIv1_Controller $this->response(); } } - + private function _validate($vorlage = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Vorlagestudiengang.php b/application/controllers/api/v1/system/Vorlagestudiengang.php index efa8963d1..dbbe23e1e 100644 --- a/application/controllers/api/v1/system/Vorlagestudiengang.php +++ b/application/controllers/api/v1/system/Vorlagestudiengang.php @@ -21,11 +21,11 @@ class Vorlagestudiengang extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vorlagestudiengang' => 'system/vorlagestudiengang:rw')); // Load model VorlagestudiengangModel $this->load->model('system/vorlagestudiengang_model', 'VorlagestudiengangModel'); - - + + } /** @@ -34,11 +34,11 @@ class Vorlagestudiengang extends APIv1_Controller public function getVorlagestudiengang() { $vorlagestudiengangID = $this->get('vorlagestudiengang_id'); - + if (isset($vorlagestudiengangID)) { $result = $this->VorlagestudiengangModel->load($vorlagestudiengangID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Vorlagestudiengang extends APIv1_Controller { $result = $this->VorlagestudiengangModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Vorlagestudiengang extends APIv1_Controller $this->response(); } } - + private function _validate($vorlagestudiengang = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Webservicelog.php b/application/controllers/api/v1/system/Webservicelog.php index d9e2597c4..ece2e2ff6 100644 --- a/application/controllers/api/v1/system/Webservicelog.php +++ b/application/controllers/api/v1/system/Webservicelog.php @@ -21,11 +21,11 @@ class Webservicelog extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Webservicelog' => 'basis/webservicelog:rw')); // Load model WebservicelogModel $this->load->model('system/webservicelog_model', 'WebservicelogModel'); - - + + } /** @@ -34,11 +34,11 @@ class Webservicelog extends APIv1_Controller public function getWebservicelog() { $webservicelogID = $this->get('webservicelog_id'); - + if (isset($webservicelogID)) { $result = $this->WebservicelogModel->load($webservicelogID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Webservicelog extends APIv1_Controller { $result = $this->WebservicelogModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Webservicelog extends APIv1_Controller $this->response(); } } - + private function _validate($webservicelog = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Webservicerecht.php b/application/controllers/api/v1/system/Webservicerecht.php index 7e1adcc58..4f281edaa 100644 --- a/application/controllers/api/v1/system/Webservicerecht.php +++ b/application/controllers/api/v1/system/Webservicerecht.php @@ -21,11 +21,11 @@ class Webservicerecht extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Webservicerecht' => 'basis/webservicerecht:rw')); // Load model WebservicerechtModel $this->load->model('system/webservicerecht_model', 'WebservicerechtModel'); - - + + } /** @@ -34,11 +34,11 @@ class Webservicerecht extends APIv1_Controller public function getWebservicerecht() { $webservicerechtID = $this->get('webservicerecht_id'); - + if (isset($webservicerechtID)) { $result = $this->WebservicerechtModel->load($webservicerechtID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Webservicerecht extends APIv1_Controller { $result = $this->WebservicerechtModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Webservicerecht extends APIv1_Controller $this->response(); } } - + private function _validate($webservicerecht = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Webservicetyp.php b/application/controllers/api/v1/system/Webservicetyp.php index 60c2d5b7c..09303c87c 100644 --- a/application/controllers/api/v1/system/Webservicetyp.php +++ b/application/controllers/api/v1/system/Webservicetyp.php @@ -21,11 +21,11 @@ class Webservicetyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Webservicetyp' => 'basis/webservicetyp:rw')); // Load model WebservicetypModel $this->load->model('system/webservicetyp_model', 'WebservicetypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Webservicetyp extends APIv1_Controller public function getWebservicetyp() { $webservicetyp_kurzbz = $this->get('webservicetyp_kurzbz'); - + if (isset($webservicetyp_kurzbz)) { $result = $this->WebservicetypModel->load($webservicetyp_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Webservicetyp extends APIv1_Controller { $result = $this->WebservicetypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Webservicetyp extends APIv1_Controller $this->response(); } } - + private function _validate($webservicetyp = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Ablauf.php b/application/controllers/api/v1/testtool/Ablauf.php index 1ce2d8fef..f2e7d9d63 100644 --- a/application/controllers/api/v1/testtool/Ablauf.php +++ b/application/controllers/api/v1/testtool/Ablauf.php @@ -21,11 +21,11 @@ class Ablauf extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ablauf' => 'basis/ablauf:rw')); // Load model AblaufModel $this->load->model('testtool/ablauf_model', 'AblaufModel'); - - + + } /** @@ -34,11 +34,11 @@ class Ablauf extends APIv1_Controller public function getAblauf() { $ablaufID = $this->get('ablauf_id'); - + if (isset($ablaufID)) { $result = $this->AblaufModel->load($ablaufID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Ablauf extends APIv1_Controller { $result = $this->AblaufModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Ablauf extends APIv1_Controller $this->response(); } } - + private function _validate($ablauf = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Antwort.php b/application/controllers/api/v1/testtool/Antwort.php index 7ae8e5293..7730dd3e9 100644 --- a/application/controllers/api/v1/testtool/Antwort.php +++ b/application/controllers/api/v1/testtool/Antwort.php @@ -21,11 +21,11 @@ class Antwort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Antwort' => 'basis/antwort:rw')); // Load model AntwortModel $this->load->model('testtool/antwort_model', 'AntwortModel'); - - + + } /** @@ -34,11 +34,11 @@ class Antwort extends APIv1_Controller public function getAntwort() { $antwortID = $this->get('antwort_id'); - + if (isset($antwortID)) { $result = $this->AntwortModel->load($antwortID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Antwort extends APIv1_Controller { $result = $this->AntwortModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Antwort extends APIv1_Controller $this->response(); } } - + private function _validate($antwort = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Frage.php b/application/controllers/api/v1/testtool/Frage.php index ec27b2435..83989956a 100644 --- a/application/controllers/api/v1/testtool/Frage.php +++ b/application/controllers/api/v1/testtool/Frage.php @@ -21,11 +21,11 @@ class Frage extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Frage' => 'basis/frage:rw')); // Load model FrageModel $this->load->model('testtool/frage_model', 'FrageModel'); - - + + } /** @@ -34,11 +34,11 @@ class Frage extends APIv1_Controller public function getFrage() { $frageID = $this->get('frage_id'); - + if (isset($frageID)) { $result = $this->FrageModel->load($frageID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Frage extends APIv1_Controller { $result = $this->FrageModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Frage extends APIv1_Controller $this->response(); } } - + private function _validate($frage = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Gebiet.php b/application/controllers/api/v1/testtool/Gebiet.php index 2814f14a2..12cba24ab 100644 --- a/application/controllers/api/v1/testtool/Gebiet.php +++ b/application/controllers/api/v1/testtool/Gebiet.php @@ -21,11 +21,11 @@ class Gebiet extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Gebiet' => 'basis/gebiet:rw')); // Load model GebietModel $this->load->model('testtool/gebiet_model', 'GebietModel'); - - + + } /** @@ -34,11 +34,11 @@ class Gebiet extends APIv1_Controller public function getGebiet() { $gebietID = $this->get('gebiet_id'); - + if (isset($gebietID)) { $result = $this->GebietModel->load($gebietID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Gebiet extends APIv1_Controller { $result = $this->GebietModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Gebiet extends APIv1_Controller $this->response(); } } - + private function _validate($gebiet = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Kategorie.php b/application/controllers/api/v1/testtool/Kategorie.php index 0cd5075e5..5058ac76d 100644 --- a/application/controllers/api/v1/testtool/Kategorie.php +++ b/application/controllers/api/v1/testtool/Kategorie.php @@ -21,11 +21,11 @@ class Kategorie extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kategorie' => 'basis/kategorie:rw')); // Load model KategorieModel $this->load->model('testtool/kategorie_model', 'KategorieModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kategorie extends APIv1_Controller public function getKategorie() { $kategorie_kurzbz = $this->get('kategorie_kurzbz'); - + if (isset($kategorie_kurzbz)) { $result = $this->KategorieModel->load($kategorie_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Kategorie extends APIv1_Controller { $result = $this->KategorieModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kategorie extends APIv1_Controller $this->response(); } } - + private function _validate($kategorie = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Kriterien.php b/application/controllers/api/v1/testtool/Kriterien.php index acb546790..2420dcb62 100644 --- a/application/controllers/api/v1/testtool/Kriterien.php +++ b/application/controllers/api/v1/testtool/Kriterien.php @@ -21,11 +21,11 @@ class Kriterien extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kriterien' => 'basis/kriterien:rw')); // Load model KriterienModel $this->load->model('testtool/kriterien_model', 'KriterienModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kriterien extends APIv1_Controller public function getKriterien() { $kriterienID = $this->get('kriterien_id'); - + if (isset($kriterienID)) { $result = $this->KriterienModel->load($kriterienID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Kriterien extends APIv1_Controller { $result = $this->KriterienModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kriterien extends APIv1_Controller $this->response(); } } - + private function _validate($kriterien = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Pruefling.php b/application/controllers/api/v1/testtool/Pruefling.php index 65671120f..3a471035e 100644 --- a/application/controllers/api/v1/testtool/Pruefling.php +++ b/application/controllers/api/v1/testtool/Pruefling.php @@ -21,11 +21,11 @@ class Pruefling extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefling' => 'basis/pruefling:rw')); // Load model PrueflingModel $this->load->model('testtool/pruefling_model', 'PrueflingModel'); - - + + } /** @@ -34,11 +34,11 @@ class Pruefling extends APIv1_Controller public function getPruefling() { $prueflingID = $this->get('pruefling_id'); - + if (isset($prueflingID)) { $result = $this->PrueflingModel->load($prueflingID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Pruefling extends APIv1_Controller { $result = $this->PrueflingModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Pruefling extends APIv1_Controller $this->response(); } } - + private function _validate($pruefling = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/testtool/Vorschlag.php b/application/controllers/api/v1/testtool/Vorschlag.php index 0f7f0b76c..0874b384a 100644 --- a/application/controllers/api/v1/testtool/Vorschlag.php +++ b/application/controllers/api/v1/testtool/Vorschlag.php @@ -21,11 +21,11 @@ class Vorschlag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vorschlag' => 'basis/vorschlag:rw')); // Load model VorschlagModel $this->load->model('testtool/vorschlag_model', 'VorschlagModel'); - - + + } /** @@ -34,11 +34,11 @@ class Vorschlag extends APIv1_Controller public function getVorschlag() { $vorschlagID = $this->get('vorschlag_id'); - + if (isset($vorschlagID)) { $result = $this->VorschlagModel->load($vorschlagID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Vorschlag extends APIv1_Controller { $result = $this->VorschlagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Vorschlag extends APIv1_Controller $this->response(); } } - + private function _validate($vorschlag = NULL) { return true; } -} \ No newline at end of file +} From e8bf6ad74715e6d430539e5ae964557011d1db13 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 28 Mar 2018 18:41:38 +0200 Subject: [PATCH 07/48] Changed the required permission to controllers CallerLibrary and CallerModel. --- application/controllers/api/v1/system/CallerLibrary.php | 2 +- application/controllers/api/v1/system/CallerModel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/api/v1/system/CallerLibrary.php b/application/controllers/api/v1/system/CallerLibrary.php index 903973b8c..8d7c44677 100644 --- a/application/controllers/api/v1/system/CallerLibrary.php +++ b/application/controllers/api/v1/system/CallerLibrary.php @@ -21,7 +21,7 @@ class CallerLibrary extends APIv1_Controller */ public function __construct() { - parent::__construct(array('Call' => 'basis/callerlibrary:rw')); + parent::__construct(array('Call' => 'admin:rw')); // Loads the CallerLib $this->load->library('CallerLib'); diff --git a/application/controllers/api/v1/system/CallerModel.php b/application/controllers/api/v1/system/CallerModel.php index 3ea1dc326..9caa7ee2f 100644 --- a/application/controllers/api/v1/system/CallerModel.php +++ b/application/controllers/api/v1/system/CallerModel.php @@ -21,7 +21,7 @@ class CallerModel extends APIv1_Controller */ public function __construct() { - parent::__construct(array('Call' => 'basis/callermodel:rw')); + parent::__construct(array('Call' => 'admin:rw')); // Loads the CallerLib $this->load->library('CallerLib'); From 0906f5bc85d79164865966d9e6c9b28822df7087 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Mar 2018 11:52:41 +0200 Subject: [PATCH 08/48] - No permission type is needed anymore in controllers CallerLibrary and CallerModel - No permission type is anymore given as parameter to library CallerLib - Removed method checkLibraryPermission from library CallerLib - Adapted code in library CallerLib --- .../api/v1/system/CallerLibrary.php | 8 +-- .../controllers/api/v1/system/CallerModel.php | 8 +-- application/libraries/CallerLib.php | 61 +++---------------- 3 files changed, 17 insertions(+), 60 deletions(-) diff --git a/application/controllers/api/v1/system/CallerLibrary.php b/application/controllers/api/v1/system/CallerLibrary.php index 8d7c44677..594786384 100644 --- a/application/controllers/api/v1/system/CallerLibrary.php +++ b/application/controllers/api/v1/system/CallerLibrary.php @@ -33,7 +33,7 @@ class CallerLibrary extends APIv1_Controller public function getCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->get(), PermissionLib::SELECT_RIGHT); + $result = $this->callerlib->callLibrary($this->get()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -45,7 +45,7 @@ class CallerLibrary extends APIv1_Controller public function postCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->post(), PermissionLib::UPDATE_RIGHT); + $result = $this->callerlib->callLibrary($this->post()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -57,7 +57,7 @@ class CallerLibrary extends APIv1_Controller public function putCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->put(), PermissionLib::INSERT_RIGHT); + $result = $this->callerlib->callLibrary($this->put()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -69,7 +69,7 @@ class CallerLibrary extends APIv1_Controller public function deleteCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->delete(), PermissionLib::DELETE_RIGHT); + $result = $this->callerlib->callLibrary($this->delete()); // Print the result $this->response($result, REST_Controller::HTTP_OK); diff --git a/application/controllers/api/v1/system/CallerModel.php b/application/controllers/api/v1/system/CallerModel.php index 9caa7ee2f..68296aff8 100644 --- a/application/controllers/api/v1/system/CallerModel.php +++ b/application/controllers/api/v1/system/CallerModel.php @@ -33,7 +33,7 @@ class CallerModel extends APIv1_Controller public function getCall() { // Start me up! - $result = $this->callerlib->callModel($this->get(), PermissionLib::SELECT_RIGHT); + $result = $this->callerlib->callModel($this->get()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -45,7 +45,7 @@ class CallerModel extends APIv1_Controller public function postCall() { // Start me up! - $result = $this->callerlib->callModel($this->post(), PermissionLib::UPDATE_RIGHT); + $result = $this->callerlib->callModel($this->post()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -57,7 +57,7 @@ class CallerModel extends APIv1_Controller public function putCall() { // Start me up! - $result = $this->callerlib->callModel($this->put(), PermissionLib::INSERT_RIGHT); + $result = $this->callerlib->callModel($this->put()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -69,7 +69,7 @@ class CallerModel extends APIv1_Controller public function deleteCall() { // Start me up! - $result = $this->callerlib->callModel($this->delete(), PermissionLib::DELETE_RIGHT); + $result = $this->callerlib->callModel($this->delete()); // Print the result $this->response($result, REST_Controller::HTTP_OK); diff --git a/application/libraries/CallerLib.php b/application/libraries/CallerLib.php index d2387a723..287740d55 100644 --- a/application/libraries/CallerLib.php +++ b/application/libraries/CallerLib.php @@ -43,23 +43,23 @@ class CallerLib /** * Wrapper method for _call */ - public function callLibrary($callParameters, $permissionType) + public function callLibrary($callParameters) { - return $this->_call($callParameters, $permissionType); + return $this->_call($callParameters); } /** * Wrapper method for _call */ - public function callModel($callParameters, $permissionType) + public function callModel($callParameters) { - return $this->_call($callParameters, $permissionType); + return $this->_call($callParameters); } /** * Everything starts here... */ - private function _call($callParameters, $permissionType) + private function _call($callParameters) { $result = null; $parameters = $this->_getParameters($callParameters); @@ -87,26 +87,11 @@ class CallerLib // If not loaded then load it if ($isLoaded === false) { - // Checks if the operation is permitted by the API caller - // Only for libraries, permissions are automatically handled by models - $result = $this->checkLibraryPermission( - $parameters->resourcePath, - $parameters->resourceName, - $parameters->function, - $permissionType - ); - if (isError($result)) + // Try to load the library + $result = $this->_loadLibrary($parameters->resourcePath, $parameters->resourceName); + if (isSuccess($result)) { - $loaded = null; - } - else - { - // Try to load the library - $result = $this->_loadLibrary($parameters->resourcePath, $parameters->resourceName); - if (isSuccess($result)) - { - $loaded = $result->retval; - } + $loaded = $result->retval; } } // If it is already loaded $isLoaded contains the instance of the library @@ -244,34 +229,6 @@ class CallerLib return $result; } - /** - * Search for a valid permission for this library that should be present with this format: - * '..' => '' - */ - private function checkLibraryPermission($resourcePath, $resourceName, $function, $permissionType) - { - $result = null; - $permissionPath = ''; - - if ($resourcePath != '') - { - $permissionPath = $resourcePath; - } - - $permissionPath .= $resourceName.'.'.$function; - - if ($this->ci->permissionlib->isEntitled($permissionPath, $permissionType) === false) - { - $result = error(FHC_NORIGHT, FHC_NORIGHT); - } - else - { - $result = success('Has permission'); - } - - return $result; - } - /** * Loads a library using the given path and name * From d9b80b790d5ea0576f4df0be2bae10d38d7f4bff Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Mar 2018 12:13:08 +0200 Subject: [PATCH 09/48] Removed permission system from models --- application/models/codex/Orgform_model.php | 7 +-- application/models/crm/Akte_model.php | 40 +++++-------- .../models/crm/Dokumentprestudent_model.php | 22 +++---- .../models/crm/Dokumentstudiengang_model.php | 13 ++--- application/models/crm/Prestudent_model.php | 8 --- .../models/crm/Prestudentstatus_model.php | 12 ---- .../models/organisation/Studiengang_model.php | 26 --------- .../organisation/Studiensemester_model.php | 28 +++------ application/models/person/Person_model.php | 17 ------ .../models/system/Extensions_model.php | 4 -- application/models/system/Message_model.php | 20 +------ application/models/system/PersonLog_model.php | 10 ---- application/models/system/Phrase_model.php | 10 +--- application/models/system/Recipient_model.php | 57 ------------------- application/models/system/Vorlage_model.php | 5 +- .../models/system/Vorlagedokument_model.php | 5 +- 16 files changed, 43 insertions(+), 241 deletions(-) diff --git a/application/models/codex/Orgform_model.php b/application/models/codex/Orgform_model.php index 69a9d6b0d..0de30f1db 100644 --- a/application/models/codex/Orgform_model.php +++ b/application/models/codex/Orgform_model.php @@ -11,20 +11,17 @@ class Orgform_model extends DB_Model $this->dbTable = 'bis.tbl_orgform'; $this->pk = 'orgform_kurzbz'; } - + /** * Returns all the orgform except VBB and ZGS */ public function getOrgformLV() { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = "SELECT * FROM bis.tbl_orgform WHERE orgform_kurzbz NOT IN ('VBB', 'ZGS') ORDER BY orgform_kurzbz"; - + return $this->execQuery($query); } } diff --git a/application/models/crm/Akte_model.php b/application/models/crm/Akte_model.php index 8eba43521..a0df680de 100644 --- a/application/models/crm/Akte_model.php +++ b/application/models/crm/Akte_model.php @@ -11,15 +11,12 @@ class Akte_model extends DB_Model $this->dbTable = 'public.tbl_akte'; $this->pk = 'akte_id'; } - + /** * getAkten */ public function getAkten($person_id, $dokument_kurzbz = null, $stg_kz = null, $prestudent_id = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT akte_id, person_id, dokument_kurzbz, @@ -41,15 +38,15 @@ class Akte_model extends DB_Model CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden FROM public.tbl_akte WHERE person_id = ?'; - + $parametersArray = array($person_id); - + if (!is_null($dokument_kurzbz)) { $query .= ' AND dokument_kurzbz = ?'; array_push($parametersArray, $dokument_kurzbz); } - + if (!is_null($stg_kz) && !is_null($prestudent_id)) { $query .= ' AND dokument_kurzbz NOT IN ( @@ -65,9 +62,9 @@ class Akte_model extends DB_Model )'; array_push($parametersArray, $stg_kz, $prestudent_id); } - + $query .= ' ORDER BY erstelltam'; - + return $this->execQuery($query, $parametersArray); } @@ -76,9 +73,6 @@ class Akte_model extends DB_Model */ public function getAktenAccepted($person_id, $dokument_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT a.akte_id, a.person_id, a.dokument_kurzbz, @@ -103,17 +97,17 @@ class Akte_model extends DB_Model INNER JOIN public.tbl_prestudent p USING(person_id) LEFT JOIN public.tbl_dokumentprestudent dp USING(prestudent_id, dokument_kurzbz) WHERE a.person_id = ?'; - + $parametersArray = array($person_id); - + if (!empty($dokument_kurzbz)) { $query .= ' AND a.dokument_kurzbz = ?'; array_push($parametersArray, $dokument_kurzbz); } - + $query .= ' GROUP BY a.akte_id ORDER BY a.erstelltam'; - + return $this->execQuery($query, $parametersArray); } @@ -122,10 +116,6 @@ class Akte_model extends DB_Model */ public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('campus.tbl_dms', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT a.akte_id, a.person_id, a.dokument_kurzbz, @@ -160,17 +150,17 @@ class Akte_model extends DB_Model INNER JOIN (SELECT dms_id, MAX(version) AS version FROM campus.tbl_dms_version GROUP BY dms_id) dvv ON (d.dms_id = dvv.dms_id) INNER JOIN campus.tbl_dms_version dv ON (dv.dms_id = dvv.dms_id AND dv.version = dvv.version) WHERE a.person_id = ?'; - + $parametersArray = array($person_id); - + if (!empty($dokument_kurzbz)) { $query .= ' AND a.dokument_kurzbz = ?'; array_push($parametersArray, $dokument_kurzbz); } - + $query .= ' GROUP BY a.akte_id, d.dms_id, dv.dms_id, dv.version ORDER BY a.erstelltam'; - + return $this->execQuery($query, $parametersArray); } @@ -183,8 +173,6 @@ class Akte_model extends DB_Model */ public function getAktenWithDokInfo($person_id, $dokument_kurzbz = null, $nachgereicht = null) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $this->addSelect('public.tbl_akte.*, bezeichnung_mehrsprachig, dokumentbeschreibung_mehrsprachig, public.tbl_dokument.bezeichnung as dokument_bezeichnung, bis.tbl_nation.*, ausstellungsdetails'); $this->addJoin('public.tbl_dokument', 'dokument_kurzbz'); $this->addJoin('bis.tbl_nation', 'ausstellungsnation = nation_code', 'LEFT'); diff --git a/application/models/crm/Dokumentprestudent_model.php b/application/models/crm/Dokumentprestudent_model.php index 001df404b..ab4764479 100644 --- a/application/models/crm/Dokumentprestudent_model.php +++ b/application/models/crm/Dokumentprestudent_model.php @@ -11,17 +11,14 @@ class Dokumentprestudent_model extends DB_Model $this->dbTable = 'public.tbl_dokumentprestudent'; $this->pk = array('prestudent_id', 'dokument_kurzbz'); } - + /** * setAccepted */ public function setAccepted($prestudent_id, $studiengang_kz) { - if (isError($ent = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $result = null; - + if (is_numeric($prestudent_id) && is_numeric($studiengang_kz)) { $query = 'INSERT INTO public.tbl_dokumentprestudent (dokument_kurzbz, prestudent_id, insertamum) ( @@ -37,23 +34,20 @@ class Dokumentprestudent_model extends DB_Model AND p.prestudent_id = ? AND ds.studiengang_kz = ? )'; - + $result = $this->execQuery($query, array($prestudent_id, $studiengang_kz)); } - + return $result; } - + /** * setAcceptedDocuments */ public function setAcceptedDocuments($prestudent_id, $dokument_kurzbz) { - if (isError($ent = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $result = null; - + if (is_numeric($prestudent_id) && is_array($dokument_kurzbz) && count($dokument_kurzbz) > 0) { $query = 'INSERT INTO public.tbl_dokumentprestudent (dokument_kurzbz, prestudent_id, insertamum) ( @@ -68,10 +62,10 @@ class Dokumentprestudent_model extends DB_Model WHERE prestudent_id = ? ) )'; - + $result = $this->execQuery($query, array($prestudent_id, $dokument_kurzbz, $prestudent_id)); } - + return $result; } } diff --git a/application/models/crm/Dokumentstudiengang_model.php b/application/models/crm/Dokumentstudiengang_model.php index 697920409..67b546811 100644 --- a/application/models/crm/Dokumentstudiengang_model.php +++ b/application/models/crm/Dokumentstudiengang_model.php @@ -11,19 +11,16 @@ class Dokumentstudiengang_model extends DB_Model $this->dbTable = 'public.tbl_dokumentstudiengang'; $this->pk = array('studiengang_kz', 'dokument_kurzbz'); } - + /** * getDokumentstudiengangByStudiengang_kz */ public function getDokumentstudiengangByStudiengang_kz($studiengang_kz, $onlinebewerbung = null, $pflicht = null, $nachreichbar = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_dokument', 's', FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $this->addJoin('public.tbl_dokument', 'dokument_kurzbz'); - + $parameterArray = array('studiengang_kz' => $studiengang_kz); - + if( isset($onlinebewerbung)) { $parameterArray['onlinebewerbung'] = $onlinebewerbung; @@ -33,12 +30,12 @@ class Dokumentstudiengang_model extends DB_Model { $parameterArray['pflicht'] = $pflicht; } - + if( isset($nachreichbar)) { $parameterArray['nachreichbar'] = $nachreichbar; } - + return $this->loadWhere($parameterArray); } } diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2051c1666..d7a46e7c5 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -17,12 +17,6 @@ class Prestudent_model extends DB_Model */ public function getLastStatuses($person_id, $studiensemester_kurzbz = null, $studiengang_kz = null, $status_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT * FROM public.tbl_prestudent p JOIN ( @@ -87,8 +81,6 @@ class Prestudent_model extends DB_Model $studiengang = null, $studiensemester = null, $gruppe = null, $reihungstest = null, $stufe = null ) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $this->addSelect( 'p.person_id, prestudent_id, diff --git a/application/models/crm/Prestudentstatus_model.php b/application/models/crm/Prestudentstatus_model.php index 27f09289a..9948b3509 100644 --- a/application/models/crm/Prestudentstatus_model.php +++ b/application/models/crm/Prestudentstatus_model.php @@ -18,12 +18,6 @@ class Prestudentstatus_model extends DB_Model */ public function getLastStatus($prestudent_id, $studiensemester_kurzbz = '', $status_kurzbz = '') { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT tbl_prestudentstatus.*, bezeichnung AS studienplan_bezeichnung, tbl_studienplan.orgform_kurzbz as orgform, @@ -59,8 +53,6 @@ class Prestudentstatus_model extends DB_Model */ public function updateStufe($prestudentIdArray, $stufe) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - return $this->execQuery( 'UPDATE public.tbl_prestudentstatus SET rt_stufe = ? @@ -85,10 +77,6 @@ class Prestudentstatus_model extends DB_Model */ public function getStatusByFilter($prestudent_id, $status_kurzbz = '', $ausbildungssemester = '', $studiensemester_kurzbz = '') { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = ' SELECT tbl_prestudentstatus.* diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index a091c9059..af790c831 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -17,11 +17,6 @@ class Studiengang_model extends DB_Model */ public function getAllForBewerbung() { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('bis.tbl_lgartcode', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('lehre.vw_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $allForBewerbungQuery = 'SELECT DISTINCT studiengang_kz, typ, organisationseinheittyp_kurzbz, @@ -103,8 +98,6 @@ class Studiengang_model extends DB_Model */ public function getStudienplan($studiensemester_kurzbz, $ausbildungssemester, $aktiv, $onlinebewerbung) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Join table public.tbl_studiengang with table lehre.tbl_studienordnung on column studiengang_kz $this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz'); // Then join with table lehre.tbl_studienplan on column studienordnung_id @@ -140,8 +133,6 @@ class Studiengang_model extends DB_Model */ public function getStudiengangBewerbung($oe_kurzbz = null) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Join table public.tbl_studiengang with table lehre.tbl_studienordnung on column studiengang_kz $this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz'); // Join table lehre.tbl_studienordnung with table lehre.tbl_akadgrad on column akadgrad_id @@ -213,8 +204,6 @@ class Studiengang_model extends DB_Model */ public function getAppliedStudiengang($person_id, $studiensemester_kurzbz, $titel) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Then join with table public.tbl_prestudent $this->addJoin('public.tbl_prestudent', 'studiengang_kz'); // Join table public.tbl_prestudentstatus @@ -262,8 +251,6 @@ class Studiengang_model extends DB_Model */ public function getAppliedStudiengangFromNow($person_id, $titel) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Then join with table public.tbl_prestudent $this->addJoin('public.tbl_prestudent', 'studiengang_kz'); // Join table public.tbl_prestudentstatus @@ -315,8 +302,6 @@ class Studiengang_model extends DB_Model */ public function getAppliedStudiengangFromNowOE($person_id, $titel, $oe_kurzbz) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Then join with table public.tbl_prestudent $this->addJoin('public.tbl_prestudent', 'studiengang_kz'); // Join table public.tbl_prestudentstatus @@ -381,17 +366,6 @@ class Studiengang_model extends DB_Model */ public function getAvailableReihungstestByPersonId($person_id) { - if (isError($ent = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_reihungstest', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('lehre.tbl_studienordnung', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz'); $this->addJoin('lehre.tbl_studienplan', 'studienordnung_id'); diff --git a/application/models/organisation/Studiensemester_model.php b/application/models/organisation/Studiensemester_model.php index e3c1261ca..cb693144d 100644 --- a/application/models/organisation/Studiensemester_model.php +++ b/application/models/organisation/Studiensemester_model.php @@ -12,37 +12,31 @@ class Studiensemester_model extends DB_Model $this->pk = 'studiensemester_kurzbz'; $this->hasSequence = false; } - + /** * getLastOrAktSemester */ public function getLastOrAktSemester($days = 60) { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (!is_numeric($days)) { $days = 60; } - + $query = 'SELECT studiensemester_kurzbz FROM public.tbl_studiensemester WHERE start < NOW() - \'' . $days . ' DAYS\'::INTERVAL ORDER BY start DESC LIMIT 1'; - + return $this->execQuery($query); } - + /** * getNextFrom */ public function getNextFrom($studiensemester_kurzbz) { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT studiensemester_kurzbz, start, ende @@ -54,24 +48,20 @@ class Studiensemester_model extends DB_Model ) ORDER BY start LIMIT 1'; - + return $this->execQuery($query, array($studiensemester_kurzbz)); } - + /** * getNearest */ public function getNearest($semester = '') { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.vw_studiensemester', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT studiensemester_kurzbz, start, ende FROM public.vw_studiensemester'; - + if (is_numeric($semester)) { if ($semester % 2 == 0) @@ -85,9 +75,9 @@ class Studiensemester_model extends DB_Model $query .= ' WHERE SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) = \'' . $ss . '\''; } - + $query .= ' ORDER BY delta LIMIT 1'; - + return $this->execQuery($query); } } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 0c7c169bb..3ec1ccd1c 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -27,17 +27,6 @@ class Person_model extends DB_Model */ public function checkBewerbung($email, $studiensemester_kurzbz = null) { - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_benutzer', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $checkBewerbungQuery = ''; $parametersArray = array($email, $email, $email); @@ -103,12 +92,6 @@ class Person_model extends DB_Model */ public function getPersonFromStatus($status_kurzbz, $von, $bis) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $this->addJoin('public.tbl_prestudent', 'person_id'); $result = $this->loadTree( diff --git a/application/models/system/Extensions_model.php b/application/models/system/Extensions_model.php index c93817040..bdcbfa4d6 100644 --- a/application/models/system/Extensions_model.php +++ b/application/models/system/Extensions_model.php @@ -17,8 +17,6 @@ class Extensions_model extends DB_Model */ public function getDependencies($dependencies) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - return $this->execQuery( 'SELECT * FROM '.$this->dbTable.' @@ -49,8 +47,6 @@ class Extensions_model extends DB_Model */ public function executeQuery($sql) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - return $this->execQuery($sql); } } diff --git a/application/models/system/Message_model.php b/application/models/system/Message_model.php index 80a2b35ad..764c3ae14 100644 --- a/application/models/system/Message_model.php +++ b/application/models/system/Message_model.php @@ -19,14 +19,6 @@ class Message_model extends DB_Model */ public function getMessagesByPerson($person_id, $oe_kurzbz, $all) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT m.message_id, m.person_id, m.subject, @@ -93,16 +85,6 @@ class Message_model extends DB_Model */ public function getMessagesOfPerson($person_id, $status = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT m.message_id, m.person_id, m.subject, @@ -129,7 +111,7 @@ class Message_model extends DB_Model s.statusinfo, s.insertamum AS statusamum FROM public.tbl_msg_message m - JOIN public.tbl_msg_recipient r ON m.message_id = r.message_id + JOIN public.tbl_msg_recipient r ON m.message_id = r.message_id JOIN public.tbl_person se ON (m.person_id = se.person_id) JOIN public.tbl_person re ON (r.person_id = re.person_id) LEFT JOIN ( diff --git a/application/models/system/PersonLog_model.php b/application/models/system/PersonLog_model.php index 02f52008c..95863ea57 100644 --- a/application/models/system/PersonLog_model.php +++ b/application/models/system/PersonLog_model.php @@ -42,11 +42,6 @@ class PersonLog_model extends CI_Model */ public function getLastLog($person_id, $taetigkeit_kurzbz = null, $app = null, $oe_kurzbz = null) { - // Check Permissions - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isEntitled('system.tbl_log',PermissionLib::SELECT_RIGHT)) - show_error('Permission denied - You need Access to system.tbl_log'); - $this->db->order_by('zeitpunkt', 'DESC'); $this->db->order_by('log_id', 'DESC'); $this->db->limit(1); @@ -72,11 +67,6 @@ class PersonLog_model extends CI_Model */ public function filterLog($person_id, $taetigkeit_kurzbz = null, $app = null, $oe_kurzbz = null) { - // Check Permissions - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isEntitled('system.tbl_log',PermissionLib::SELECT_RIGHT)) - show_error('Permission denied - You need Access to system.tbl_log'); - $this->db->order_by('zeitpunkt', 'DESC'); $this->db->order_by('log_id', 'DESC'); if (!is_null($taetigkeit_kurzbz)) diff --git a/application/models/system/Phrase_model.php b/application/models/system/Phrase_model.php index 775940a0c..d79539995 100644 --- a/application/models/system/Phrase_model.php +++ b/application/models/system/Phrase_model.php @@ -17,12 +17,6 @@ class Phrase_model extends DB_Model */ public function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('system.tbl_phrase', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('system.tbl_phrasentext', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $parametersArray = array('app' => $app, 'sprache' => $sprache); $query = 'SELECT phrase, @@ -36,7 +30,7 @@ class Phrase_model extends DB_Model if (isset($phrase)) { $parametersArray['phrase'] = $phrase; - + if (is_array($phrase)) { $query .= ' AND phrase IN ?'; @@ -57,7 +51,7 @@ class Phrase_model extends DB_Model $parametersArray['orgform_kurzbz'] = $orgform_kurzbz; $query .= ' AND orgform_kurzbz = ?'; } - + return $this->execQuery($query, $parametersArray); } } diff --git a/application/models/system/Recipient_model.php b/application/models/system/Recipient_model.php index b9e170fbf..7289c3055 100644 --- a/application/models/system/Recipient_model.php +++ b/application/models/system/Recipient_model.php @@ -18,16 +18,6 @@ class Recipient_model extends DB_Model */ public function getMessage($message_id, $person_id) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT mr.message_id, mr.person_id, mm.subject, @@ -55,14 +45,6 @@ class Recipient_model extends DB_Model */ public function getMessageByToken($token) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT r.message_id, m.person_id as sender_id, r.person_id as receiver_id, @@ -89,16 +71,6 @@ class Recipient_model extends DB_Model */ public function getMessagesByPerson($person_id, $oe_kurzbz, $all) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT DISTINCT ON (r.message_id) r.message_id, m.person_id, m.subject, @@ -166,21 +138,6 @@ class Recipient_model extends DB_Model */ public function getMessagesByUID($uid, $oe_kurzbz, $all) { - // Checks if the operation is permitted by the API caller - // TODO: Define the special right for reading own messages 'basis/message:own' - // if same user - if ($uid === getAuthUID()) - { - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - } - // if different user, for reading messages from other users - else - { - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - } - // get Data $sql = 'SELECT DISTINCT ON (r.message_id) r.message_id, m.person_id, @@ -249,14 +206,6 @@ class Recipient_model extends DB_Model */ public function getMessages($kontaktType, $sent, $limit = null, $message_id = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT mm.message_id, ks.kontakt as sender, kr.kontakt as receiver, @@ -321,12 +270,6 @@ class Recipient_model extends DB_Model */ public function getCountUnreadMessages($person_id, $oe_kurzbz) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT COUNT(r.message_id) AS unreadMessages FROM public.tbl_msg_recipient r JOIN public.tbl_msg_status s ON (r.message_id = s.message_id AND r.person_id = s.person_id) diff --git a/application/models/system/Vorlage_model.php b/application/models/system/Vorlage_model.php index 380f26b99..8022e71fc 100644 --- a/application/models/system/Vorlage_model.php +++ b/application/models/system/Vorlage_model.php @@ -17,11 +17,8 @@ class Vorlage_model extends DB_Model */ public function getMimeTypes() { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT DISTINCT mimetype FROM public.tbl_vorlage ORDER BY mimetype'; - + return $this->execQuery($query); } } diff --git a/application/models/system/Vorlagedokument_model.php b/application/models/system/Vorlagedokument_model.php index e557d6e4d..1a61cf8c7 100644 --- a/application/models/system/Vorlagedokument_model.php +++ b/application/models/system/Vorlagedokument_model.php @@ -17,9 +17,6 @@ class Vorlagedokument_model extends DB_Model */ public function loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id) { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $qry = 'SELECT vorlagedokument_id, sort, vorlagestudiengang_id, @@ -29,7 +26,7 @@ class Vorlagedokument_model extends DB_Model JOIN public.tbl_dokument USING(dokument_kurzbz) WHERE vorlagestudiengang_id = ? ORDER BY sort ASC'; - + return $this->execQuery($qry, array($vorlagestudiengang_id)); } } From 4152a67d8fb8f7d00fe4738709de9a08b5983605 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Mar 2018 12:15:12 +0200 Subject: [PATCH 10/48] - Removed permission system from DB_Model and FHC_Model - Removed method _isEntitled from DB_Model - Removed method isEntitled from DHC_Model --- application/core/DB_Model.php | 37 ---------------------------------- application/core/FHC_Model.php | 35 -------------------------------- 2 files changed, 72 deletions(-) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index be9e39082..e8c01bca0 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -60,9 +60,6 @@ class DB_Model extends FHC_Model // Check class properties if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::INSERT_RIGHT))) return $ent; - // If this table has UDF and the validation of them is ok if (isError($validate = $this->_manageUDFs($data, $this->dbTable))) return $validate; @@ -110,9 +107,6 @@ class DB_Model extends FHC_Model if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK); if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::UPDATE_RIGHT))) return $ent; - // If this table has UDF and the validation of them is ok if (isError($validate = $this->_manageUDFs($data, $this->dbTable, $id))) return $validate; @@ -156,9 +150,6 @@ class DB_Model extends FHC_Model if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::DELETE_RIGHT))) return $ent; - $tmpId = $id; // Check for composite Primary Key @@ -197,9 +188,6 @@ class DB_Model extends FHC_Model if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK); if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent; - $tmpId = $id; // Check for composite Primary Key @@ -236,9 +224,6 @@ class DB_Model extends FHC_Model // Check class properties if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent; - // Execute query if ($result = $this->db->get_where($this->dbTable, $where)) { @@ -267,9 +252,6 @@ class DB_Model extends FHC_Model // Check class properties if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent; - // List of tables on which it will work $tables = array_merge(array($mainTable), $sideTables); // Array that will contain the number of columns of each table @@ -813,25 +795,6 @@ class DB_Model extends FHC_Model return array_combine($idexes, $values); } - /** - * Checks if the caller is entitled to perform this operation with this right - */ - private function _isEntitled($permission) - { - $ent = success(true); - - $ent = $this->isEntitled($this->dbTable, $permission, FHC_NORIGHT, FHC_MODEL_ERROR); - // If true is not returned, then an error has occurred - if (isError($ent)) - { - // Before returning the object containing the error, reset the build query - // This is for preventing that other parts of the query will be built before of the next execution - $this->resetQuery(); - } - - return $ent; - } - /** * Wrapper method for UDFLib->manageUDFs */ diff --git a/application/core/FHC_Model.php b/application/core/FHC_Model.php index d880fc5b8..8ee6b4aba 100644 --- a/application/core/FHC_Model.php +++ b/application/core/FHC_Model.php @@ -19,40 +19,5 @@ class FHC_Model extends CI_Model // Load return message helper $this->load->helper('message'); - - // Loads the permission library - $this->load->library('PermissionLib'); - } - - /** - * Check if the user is entitled to get access to a source with the given access type - * This is a wrapper for the same method present in the PermissionLib - */ - public function isEntitled($sourceName, $accessType, $languageMessageCode, $msgErrorCode) - { - $isEntitled = success(true); - - // If script is not called from Commandline - // or the caller is _not_ a model _and_ tries to read data, then avoids to check permissions - // Otherwise checks always the permissions - if (!is_cli() || - ($accessType == PermissionLib::SELECT_RIGHT - && substr(get_called_class(), -6) == DB_Model::MODEL_POSTFIX) - || $accessType != PermissionLib::SELECT_RIGHT) - { - if ($this->permissionlib->isEntitled($sourceName, $accessType) === false) - { - $retval = sprintf( - '%s -> %s:%s', - lang('fhc_'.$languageMessageCode), - $this->permissionlib->getBerechtigungKurzbz($sourceName), - $accessType - ); - - $isEntitled = error($retval, $msgErrorCode); - } - } - - return $isEntitled; } } From bdafffbb1f116d9c2545cab589e5ced0c80775c8 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Mar 2018 12:18:55 +0200 Subject: [PATCH 11/48] Removed permission system from application/core/FS_Model.php --- application/core/FS_Model.php | 37 +++++++++++------------------------ 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/application/core/FS_Model.php b/application/core/FS_Model.php index 8b006e91a..00cf03720 100644 --- a/application/core/FS_Model.php +++ b/application/core/FS_Model.php @@ -10,16 +10,16 @@ class FS_Model extends FHC_Model public function __construct($filepath = null) { parent::__construct(); - + // Load the filesystem library $this->load->library('FilesystemLib'); - + // Load return message helper $this->load->helper('message'); - + $this->filepath = $filepath; } - + /** --------------------------------------------------------------- * Read data from file system * @@ -29,13 +29,10 @@ class FS_Model extends FHC_Model { // Check Class-Attributes if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR); - + // Check method parameters if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (!is_null($data = $this->filesystemlib->read($this->filepath, $filename))) { return success(base64_encode($data)); @@ -45,7 +42,7 @@ class FS_Model extends FHC_Model return error(FHC_MODEL_ERROR, FHC_ERROR); } } - + /** --------------------------------------------------------------- * Writing data to file system * @@ -56,14 +53,11 @@ class FS_Model extends FHC_Model { // Check Class-Attributes if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR); - + // Check method parameters if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError(($ent = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))) return $ent; - if ($this->filesystemlib->write($this->filepath, $filename, base64_decode($content)) === true) { return success(FHC_SUCCESS); @@ -84,14 +78,11 @@ class FS_Model extends FHC_Model { // Check Class-Attributes if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR); - + // Check method parameters if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR); if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if ($this->filesystemlib->append($this->filepath, $filename, base64_decode($content)) === true) { return success(FHC_SUCCESS); @@ -112,13 +103,10 @@ class FS_Model extends FHC_Model { // Check Class-Attributes if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR); - + // Check method parameters if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::DELETE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if ($this->filesystemlib->remove($this->filepath, $filename) === true) { return success(FHC_SUCCESS); @@ -128,7 +116,7 @@ class FS_Model extends FHC_Model return error(FHC_MODEL_ERROR, FHC_ERROR); } } - + /** --------------------------------------------------------------- * Rename a file * @@ -139,13 +127,10 @@ class FS_Model extends FHC_Model { // Check Class-Attributes if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR); - + // Check method parameters if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); if (is_null($newFilename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::UPDATE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; if ($this->filesystemlib->rename($this->filepath, $filename, $this->filepath, $newFilename) === true) { From 042f18781837ce5d774a114dd6af6b694f1cfb9a Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Mar 2018 12:19:53 +0200 Subject: [PATCH 12/48] Removed config entry fhc_acl from application/config/fhcomplete.php --- application/config/fhcomplete.php | 237 ------------------------------ 1 file changed, 237 deletions(-) diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index b680d6f5d..8ee6047c3 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -4,243 +4,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); $config['fhc_version'] = '3.2'; -$config['fhc_acl'] = array -( - 'bis.tbl_archiv' => 'basis/archiv', - 'bis.tbl_ausbildung' => 'basis/ausbildung', - 'bis.tbl_berufstaetigkeit' => 'basis/berufstaetigkeit', - 'bis.tbl_beschaeftigungsausmass' => 'basis/beschaeftigungsausmass', - 'bis.tbl_besqual' => 'basis/besqual', - 'bis.tbl_bisfunktion' => 'basis/bisfunktion', - 'bis.tbl_bisio' => 'basis/bisio', - 'bis.tbl_bisorgform' => 'basis/bisorgform', - 'bis.tbl_bisverwendung' => 'basis/bisverwendung', - 'bis.tbl_bundesland' => 'basis/bundesland', - 'bis.tbl_entwicklungsteam' => 'basis/entwicklungsteam', - 'bis.tbl_gemeinde' => 'basis/gemeinde', - 'bis.tbl_hauptberuf' => 'basis/hauptberuf', - 'bis.tbl_lgartcode' => 'basis/lgartcode', - 'bis.tbl_mobilitaetsprogramm' => 'basis/mobilitaetsprogramm', - 'bis.tbl_nation' => 'basis/nation', - 'bis.tbl_orgform' => 'basis/orgform', - 'bis.tbl_verwendung' => 'basis/verwendung', - 'bis.tbl_zgv' => 'basis/zgv', - 'bis.tbl_zgvdoktor' => 'basis/zgvdoktor', - 'bis.tbl_zgvgruppe' => 'basis/zgvgruppe', - 'bis.tbl_zgvmaster' => 'basis/zgvmaster', - 'bis.tbl_zweck' => 'basis/zweck', - 'campus.tbl_abgabe' => 'basis/abgabe', - 'campus.tbl_anwesenheit' => 'basis/anwesenheit', - 'campus.tbl_beispiel' => 'basis/beispiel', - 'campus.tbl_content' => 'basis/content', - 'campus.tbl_contentchild' => 'basis/contentchild', - 'campus.tbl_contentgruppe' => 'basis/contentgruppe', - 'campus.tbl_contentlog' => 'basis/contentlog', - 'campus.tbl_contentsprache' => 'basis/contentsprache', - 'campus.tbl_coodle' => 'basis/coodle', - 'campus.tbl_dms' => 'basis/dms', - 'campus.tbl_dms_version' => 'basis/dms_version', - 'campus.tbl_erreichbarkeit' => 'basis/erreichbarkeit', - 'campus.tbl_feedback' => 'basis/feedback', - 'campus.tbl_freebusy' => 'basis/freebusy', - 'campus.tbl_freebusytyp' => 'basis/freebusytyp', - 'campus.tbl_infoscreen' => 'basis/infoscreen', - 'campus.tbl_legesamtnote' => 'basis/legesamtnote', - 'campus.tbl_lvgesamtnote' => 'basis/lvgesamtnote', - 'campus.tbl_lvinfo' => 'basis/lvinfo', - 'campus.tbl_news' => 'basis/news', - 'campus.tbl_notenschluessel' => 'basis/notenschluessel', - 'campus.tbl_notenschluesseluebung' => 'basis/notenschluesseluebung', - 'campus.tbl_paabgabe' => 'basis/paabgabe', - 'campus.tbl_paabgabetyp' => 'basis/paabgabetyp', - 'campus.tbl_pruefung' => 'basis/pruefung', - 'campus.tbl_pruefungsanmeldung' => 'basis/pruefungsanmeldung', - 'campus.tbl_pruefungsfenster' => 'basis/pruefungsfenster', - 'campus.tbl_pruefungsstatus' => 'basis/pruefungsstatus', - 'campus.tbl_pruefungstermin' => 'basis/pruefungstermin', - 'campus.tbl_reservierung' => 'basis/reservierung', - 'campus.tbl_studentbeispiel' => 'basis/studentbeispiel', - 'campus.tbl_studentuebung' => 'basis/studentuebung', - 'campus.tbl_template' => 'basis/template', - 'campus.tbl_uebung' => 'basis/uebung', - 'campus.tbl_veranstaltung' => 'basis/veranstaltung', - 'campus.tbl_veranstaltungskategorie' => 'basis/veranstaltungskategorie', - 'campus.tbl_zeitaufzeichnung' => 'basis/zeitaufzeichnung', - 'campus.tbl_zeitsperre' => 'basis/zeitsperre', - 'campus.tbl_zeitsperretyp' => 'basis/zeitsperretyp', - 'campus.tbl_zeitwunsch' => 'basis/zeitwunsch', - 'fue.tbl_aktivitaet' => 'basis/aktivitaet', - 'fue.tbl_aufwandstyp' => 'basis/aufwandstyp', - 'fue.tbl_projekt' => 'basis/projekt', - 'fue.tbl_projekt_ressource' => 'basis/projekt_ressource', - 'fue.tbl_projektphase' => 'basis/projektphase', - 'fue.tbl_projekttask' => 'basis/projekttask', - 'fue.tbl_ressource' => 'basis/ressource', - 'fue.tbl_scrumsprint' => 'basis/scrumsprint', - 'fue.tbl_scrumteam' => 'basis/scrumteam', - 'lehre.tbl_abschlussbeurteilung' => 'basis/abschlussbeurteilung', - 'lehre.tbl_abschlusspruefung' => 'basis/abschlusspruefung', - 'lehre.tbl_akadgrad' => 'basis/akadgrad', - 'lehre.tbl_anrechnung' => 'basis/anrechnung', - 'lehre.tbl_betreuerart' => 'basis/betreuerart', - 'lehre.tbl_ferien' => 'basis/ferien', - 'lehre.tbl_lehreinheit' => 'basis/lehreinheit', - 'lehre.tbl_lehreinheitgruppe' => 'basis/lehreinheitgruppe', - 'lehre.tbl_lehreinheitmitarbeiter' => 'basis/lehreinheitmitarbeiter', - 'lehre.tbl_lehrfach' => 'basis/lehrfach', - 'lehre.tbl_lehrform' => 'basis/lehrform', - 'lehre.tbl_lehrfunktion' => 'basis/lehrfunktion', - 'lehre.tbl_lehrmittel' => 'basis/lehrmittel', - 'lehre.tbl_lehrtyp' => 'basis/lehrtyp', - 'lehre.tbl_lehrveranstaltung' => 'basis/lehrveranstaltung', - 'lehre.tbl_lvangebot' => 'basis/lvangebot', - 'lehre.tbl_lvregel' => 'basis/lvregel', - 'lehre.tbl_lvregeltyp' => 'basis/lvregeltyp', - 'lehre.tbl_note' => 'basis/note', - 'lehre.tbl_notenschluessel' => 'basis/notenschluessel', - 'lehre.tbl_notenschluesselaufteilung' => 'basis/notenschluesselaufteilung', - 'lehre.tbl_notenschluesselzuordnung' => 'basis/notenschluesselzuordnung', - 'lehre.tbl_projektarbeit' => 'basis/projektarbeit', - 'lehre.tbl_projektbetreuer' => 'basis/projektbetreuer', - 'lehre.tbl_projekttyp' => 'basis/projekttyp', - 'lehre.tbl_pruefung' => 'basis/pruefung', - 'lehre.tbl_pruefungstyp' => 'basis/pruefungstyp', - 'lehre.tbl_studienordnung' => 'lehre/studienordnung', - 'lehre.tbl_studienordnungstatus' => 'lehre/studienordnungstatus', - 'lehre.tbl_studienplan' => 'lehre/studienplan', - 'lehre.tbl_studienplatz' => 'basis/studienplatz', - 'lehre.tbl_studienplan_semester' => 'lehre/studienplan_semester', - 'lehre.tbl_stunde' => 'basis/stunde', - 'lehre.tbl_stundenplan' => 'basis/stundenplan', - 'lehre.tbl_stundenplandev' => 'basis/stundenplandev', - 'lehre.tbl_vertrag' => 'basis/vertrag', - 'lehre.tbl_vertragsstatus' => 'basis/vertragsstatus', - 'lehre.tbl_vertragstyp' => 'basis/vertragstyp', - 'lehre.tbl_zeugnis' => 'basis/zeugnis', - 'lehre.tbl_zeugnisnote' => 'basis/zeugnisnote', - 'lehre.vw_studienplan' => 'lehre/studienplan', - 'public.tbl_adresse' => 'basis/adresse', - 'public.tbl_akte' => 'basis/akte', - 'public.tbl_ampel' => 'basis/ampel', - 'public.tbl_aufmerksamdurch' => 'basis/aufmerksamdurch', - 'public.tbl_aufnahmeschluessel' => 'basis/aufnahmeschluessel', - 'public.tbl_bankverbindung' => 'basis/bankverbindung', - 'public.tbl_benutzer' => 'basis/benutzer', - 'public.tbl_benutzerfunktion' => 'basis/benutzerfunktion', - 'public.tbl_benutzergruppe' => 'basis/benutzergruppe', - 'public.tbl_bewerbungstermine' => 'basis/bewerbungstermine', - 'public.tbl_buchungstyp' => 'basis/buchungstyp', - 'public.tbl_dokument' => 'basis/dokument', - 'public.tbl_dokumentprestudent' => 'basis/dokumentprestudent', - 'public.tbl_dokumentstudiengang' => 'basis/dokumentstudiengang', - 'public.tbl_erhalter' => 'basis/erhalter', - 'public.tbl_fachbereich' => 'basis/fachbereich', - 'public.tbl_filter' => 'basis/filter', - 'public.tbl_firma' => 'basis/firma', - 'public.tbl_firmatag' => 'basis/firmatag', - 'public.tbl_firmentyp' => 'basis/firmentyp', - 'public.tbl_fotostatus' => 'basis/fotostatus', - 'public.tbl_funktion' => 'basis/funktion', - 'public.tbl_geschaeftsjahr' => 'basis/geschaeftsjahr', - 'public.tbl_gruppe' => 'basis/gruppe', - 'public.tbl_kontakt' => 'basis/kontakt', - 'public.tbl_kontaktmedium' => 'basis/kontaktmedium', - 'public.tbl_kontakttyp' => 'basis/kontakttyp', - 'public.tbl_konto' => 'basis/konto', - 'public.tbl_lehrverband' => 'basis/lehrverband', - 'public.tbl_log' => 'basis/log', - 'public.tbl_mitarbeiter' => 'basis/mitarbeiter', - 'public.tbl_msg_message' => 'basis/message', - 'public.tbl_msg_recipient' => 'basis/message', - 'public.tbl_msg_status' => 'basis/message', - 'public.tbl_msg_attachment' => 'basis/message', - 'public.tbl_notiz' => 'basis/notiz', - 'public.tbl_notizzuordnung' => 'basis/notizzuordnung', - 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', - 'public.tbl_organisationseinheittyp' => 'basis/organisationseinheittyp', - 'public.tbl_ort' => 'basis/ort', - 'public.tbl_ortraumtyp' => 'basis/ortraumtyp', - 'public.tbl_person' => 'basis/person', - 'public.tbl_personfunktionstandort' => 'basis/personfunktionstandort', - 'public.tbl_preincoming' => 'basis/preincoming', - 'public.tbl_preinteressent' => 'basis/preinteressent', - 'public.tbl_preinteressentstudiengang' => 'basis/preinteressentstudiengang', - 'public.tbl_preoutgoing' => 'basis/preoutgoing', - 'public.tbl_prestudent' => 'basis/prestudent', - 'public.tbl_prestudentstatus' => 'basis/prestudentstatus', - 'public.tbl_raumtyp' => 'basis/raumtyp', - 'public.tbl_reihungstest' => 'basis/reihungstest', - 'public.tbl_semesterwochen' => 'basis/semesterwochen', - 'public.tbl_service' => 'basis/service', - 'public.tbl_sprache' => 'basis/sprache', - 'public.tbl_standort' => 'basis/standort', - 'public.tbl_statistik' => 'basis/statistik', - 'public.tbl_status' => 'basis/status', - 'public.tbl_status_grund' => 'basis/status', - 'public.tbl_student' => 'basis/student', - 'public.tbl_studentlehrverband' => 'basis/studentlehrverband', - 'public.tbl_studiengang' => 'basis/studiengang', - 'public.tbl_studiengangstyp' => 'basis/studiengangstyp', - 'public.tbl_studienjahr' => 'basis/studienjahr', - 'public.tbl_studiensemester' => 'basis/studiensemester', - 'public.tbl_tag' => 'basis/tag', - 'public.tbl_variable' => 'basis/variable', - 'public.tbl_vorlage' => 'system/vorlage', - 'public.tbl_vorlagedokument' => 'system/vorlagestudiengang', - 'public.tbl_vorlagestudiengang' => 'system/vorlagestudiengang', - 'public.tbl_rt_person' => 'basis/person', - 'public.vw_studiensemester' => 'basis/studiensemester', - 'system.tbl_app' => 'system/app', - 'system.tbl_appdaten' => 'system/appdaten', - 'system.tbl_benutzerrolle' => 'basis/benutzerrolle', - 'system.tbl_berechtigung' => 'basis/berechtigung', - 'system.tbl_filters' => 'system/filters', - 'system.tbl_cronjob' => 'basis/cronjob', - 'system.tbl_phrase' => 'system/phrase', - 'system.tbl_phrasentext' => 'system/phrase', - 'system.tbl_rolle' => 'basis/rolle', - 'system.tbl_rolleberechtigung' => 'basis/rolleberechtigung', - 'system.tbl_server' => 'basis/server', - 'system.tbl_webservicelog' => 'basis/webservicelog', - 'system.tbl_webservicerecht' => 'basis/webservicerecht', - 'system.tbl_webservicetyp' => 'basis/webservicetyp', - 'system.tbl_udf' => 'system/udf', - 'system.tbl_extensions' => 'system/extensions', - 'system.tbl_log' => 'basis/log', - 'system.tbl_person_lock' => 'system/personlock', - 'testtool.tbl_ablauf' => 'basis/ablauf', - 'testtool.tbl_antwort' => 'basis/antwort', - 'testtool.tbl_frage' => 'basis/frage', - 'testtool.tbl_gebiet' => 'basis/gebiet', - 'testtool.tbl_kategorie' => 'basis/kategorie', - 'testtool.tbl_kriterien' => 'basis/kriterien', - 'testtool.tbl_pruefling' => 'basis/pruefling', - 'testtool.tbl_vorschlag' => 'basis/vorschlag', - 'wawi.tbl_aufteilung' => 'basis/aufteilung', - 'wawi.tbl_bestelldetail' => 'basis/bestelldetail', - 'wawi.tbl_bestelldetailtag' => 'basis/bestelldetailtag', - 'wawi.tbl_bestellstatus' => 'basis/bestellstatus', - 'wawi.tbl_bestellung' => 'basis/bestellung', - 'wawi.tbl_bestellungtag' => 'basis/bestellungtag', - 'wawi.tbl_betriebsmittel' => 'basis/betriebsmittel', - 'wawi.tbl_betriebsmittelperson' => 'basis/betriebsmittelperson', - 'wawi.tbl_betriebsmittelstatus' => 'basis/betriebsmittelstatus', - 'wawi.tbl_betriebsmitteltyp' => 'basis/betriebsmitteltyp', - 'wawi.tbl_buchung' => 'basis/buchung', - 'wawi.tbl_buchungstyp' => 'basis/buchungstyp', - 'wawi.tbl_budget' => 'basis/budget', - 'wawi.tbl_konto' => 'basis/konto', - 'wawi.tbl_kostenstelle' => 'basis/kostenstelle', - 'wawi.tbl_rechnung' => 'basis/rechnung', - 'wawi.tbl_rechnungsbetrag' => 'basis/rechnungsbetrag', - 'wawi.tbl_rechnungstyp' => 'basis/rechnungstyp', - 'wawi.tbl_zahlungstyp' => 'basis/zahlungstyp', - - DMS_PATH => 'fs/dms', - - 'PhrasesLib.getPhrase' => 'system/PhrasesLib' -); - // $config['addons_aufnahme_url'] = array(); $config['addons_aufnahme_url']['OE_ROOT'] = 'http://debian.dev/addons/aufnahme/OE_ROOT/cis/index.php'; From dda27c7d6e1657c002b40604e652b4f502d7f5b1 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Mar 2018 12:23:05 +0200 Subject: [PATCH 13/48] - Removed method isEntitled from PermissionLib - Renamed method checkPermissions to isEntitled - isEntitled: if the controller is called from the command line, then is always trusted - Adapted controllers application/core/APIv1_Controller.php and application/core/FHC_Controller.php --- application/core/APIv1_Controller.php | 2 +- application/core/FHC_Controller.php | 2 +- application/libraries/PermissionLib.php | 34 ++++--------------------- 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 43790c080..97f8d43d8 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -29,7 +29,7 @@ class APIv1_Controller extends REST_Controller */ private function _isAllowed($requiredPermissions) { - if (!$this->permissionlib->checkPermissions($requiredPermissions, $this->router->method)) + if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) { $this->response(error('You are not allowed to access to this content'), REST_Controller::HTTP_UNAUTHORIZED); } diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index fab8aea32..316e56425 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -28,7 +28,7 @@ class FHC_Controller extends CI_Controller */ private function _isAllowed($requiredPermissions) { - if (!$this->permissionlib->checkPermissions($requiredPermissions, $this->router->method)) + if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) { header('HTTP/1.0 401 Unauthorized'); echo 'You are not allowed to access to this content'; diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index c43f6dec0..4757b8643 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -67,34 +67,6 @@ class PermissionLib } } - /** - * Check if the user is entitled to get access to a source with the given access type - * - * @return bool true if a user has the right to access to the specified - * resource with a specified permission type, false otherwise - */ - public function isEntitled($sourceName, $permissionType) - { - $isEntitled = false; - - // If it's called from command line than it's trusted - if (!is_cli()) - { - // If the resource exists - if (isset($this->acl[$sourceName])) - { - // Checks permission - $isEntitled = $this->isBerechtigt($this->acl[$sourceName], $permissionType); - } - } - else - { - $isEntitled = true; - } - - return $isEntitled; - } - /** * Get a permission by a given source */ @@ -130,6 +102,7 @@ class PermissionLib /** * Checks if the caller is allowed to access to this content with the given permissions + * - if it's called from command line than it's trusted * - checks if the parameter $requiredPermissions is set, is an array and contains at least one element * - checks if the given $requiredPermissions parameter contains the called method of the controller * - checks if the HTTP method used to call is GET or POST @@ -145,11 +118,14 @@ class PermissionLib * NOTE: the displayed error messages are used to warn the developer about any issues that could occur, * they are not intended for the final user! */ - public function checkPermissions($requiredPermissions, $calledMethod) + public function isEntitled($requiredPermissions, $calledMethod) { $checkPermissions = false; $requestMethod = $_SERVER['REQUEST_METHOD']; + // If it's called from command line than it's trusted + if (is_cli()) return true; + // Checks if the parameter $requiredPermissions is set, is an array and contains at least one element if (isset($requiredPermissions) && is_array($requiredPermissions) && count($requiredPermissions) > 0) { From 49e24b0431daca44afa236b568eb4715285792de Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Mar 2018 16:53:38 +0200 Subject: [PATCH 14/48] - Controller system/Filters now extends CI_Controller - Added private method _isAllowed to controller system/Filters - The method _isAllowed is called in the controller constructor and checks if the caller has the permission to read data with this instance of the FilterWidget - The permission is given as parameter when calling the FilterWidget, the parameter is called requiredPermissions - Updated the view system/infocenter/infocenterData to give the infocenter permission to the FilterWidget - Changed the logic into the FilterWidget to manage the requiredPermissions parameter --- application/controllers/system/Filters.php | 36 ++++++++++++++++++- .../system/infocenter/infocenterData.php | 9 ++--- application/widgets/FilterWidget.php | 14 ++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index 759f9c56b..73ffc0d27 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); /** * */ -class Filters extends FHC_Controller +class Filters extends CI_Controller { const SESSION_NAME = 'FILTER'; @@ -25,9 +25,13 @@ class Filters extends FHC_Controller // Load session library $this->load->library('session'); + // Load permission library + $this->load->library('PermissionLib'); $this->load->model('system/Filters_model', 'FiltersModel'); $this->load->model('person/Benutzer_model', 'BenutzerModel'); + + $this->_isAllowed(); } /** @@ -469,4 +473,34 @@ class Filters extends FHC_Controller $this->output->set_content_type('application/json')->set_output(json_encode($json)); } + + /** + * Cheks + */ + private function _isAllowed() + { + if (isset($_SESSION[self::SESSION_NAME]['requiredPermissions'])) + { + $requiredPermissions = array( + 'filters' => $_SESSION[self::SESSION_NAME]['requiredPermissions'].':rw' + ); + + if (!$this->permissionlib->isEntitled($requiredPermissions, 'filters')) + { + header('Content-Type: application/json'); + + echo json_encode('You are not allowed to access to this content'); + + exit(1); + } + } + else + { + header('Content-Type: application/json'); + + echo json_encode('You are not allowed to access to this content'); + + exit(1); + } + } } diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 663e69ca6..9c2024510 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -137,12 +137,13 @@ ) ORDER BY "LastAction" ASC ', - 'hideHeader' => false, - 'hideSave' => false, + 'requiredPermissions' => 'infocenter', 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), - 'columnsAliases' => array('PersonID','Vorname','Nachname','GebDatum','Letzte Aktion','Letzter Bearbeiter', - 'StSem','GesendetAm','NumAbgeschickt','Studiengänge','Sperrdatum','GesperrtVon'), + 'columnsAliases' => array( + 'PersonID','Vorname','Nachname','GebDatum','Letzte Aktion','Letzter Bearbeiter', + 'StSem','GesendetAm','NumAbgeschickt','Studiengänge','Sperrdatum','GesperrtVon' + ), 'formatRaw' => function($datasetRaw) { $datasetRaw->{'Details'} = sprintf( diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 925126a43..68e204f5c 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -18,6 +18,7 @@ class FilterWidget extends Widget const HIDE_HEADER = 'hideHeader'; const HIDE_SAVE = 'hideSave'; const COLUMNS_ALIASES = 'columnsAliases'; + const REQUIRED_PERMISSIONS = 'requiredPermissions'; const DATASET_PARAMETER = 'dataset'; const METADATA_PARAMETER = 'metaData'; @@ -78,6 +79,7 @@ class FilterWidget extends Widget private $checkboxes; private $columnsAliases; private $filterName; + private $requiredPermissions; private $dataset; private $metaData; @@ -164,6 +166,7 @@ class FilterWidget extends Widget $filterSessionArray[self::COLUMNS_ALIASES] = $this->_getColumnAliasesFromPost(); $filterSessionArray[self::CHECKBOXES] = $this->checkboxes; + $filterSessionArray[self::REQUIRED_PERMISSIONS] = $this->requiredPermissions; if ($this->app != null) { @@ -482,6 +485,11 @@ class FilterWidget extends Widget $filterSessionArray[self::DATASET_NAME_PARAMETER] = null; } + if (!isset($filterSessionArray[self::REQUIRED_PERMISSIONS])) + { + $filterSessionArray[self::REQUIRED_PERMISSIONS] = null; + } + $this->session->set_userdata(self::SESSION_NAME, $filterSessionArray); } @@ -503,6 +511,7 @@ class FilterWidget extends Widget $this->hideSave = false; $this->columnsAliases = null; $this->filterName = null; + $this->requiredPermissions = null; if (!is_array($args) || (is_array($args) && count($args) == 0)) { @@ -589,6 +598,11 @@ class FilterWidget extends Widget { $this->columnsAliases = $args[self::COLUMNS_ALIASES]; } + + if (isset($args[self::REQUIRED_PERMISSIONS])) + { + $this->requiredPermissions = $args[self::REQUIRED_PERMISSIONS]; + } } } From 88a7228555741cc1de0d110fc0d88d27aed7aa8c Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 6 Apr 2018 17:47:17 +0200 Subject: [PATCH 15/48] - Parameter requiredPermissions of FilterWidget now can be also an array - All the permissions of this array will be checked until a valid one is found --- application/controllers/system/Filters.php | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index 73ffc0d27..1e98abe07 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -475,17 +475,34 @@ class Filters extends CI_Controller } /** - * Cheks + * Checks */ private function _isAllowed() { + $isAllowed = false; + if (isset($_SESSION[self::SESSION_NAME]['requiredPermissions'])) { - $requiredPermissions = array( - 'filters' => $_SESSION[self::SESSION_NAME]['requiredPermissions'].':rw' - ); + $tmpRequiredPermissions = $_SESSION[self::SESSION_NAME]['requiredPermissions']; + if (!is_array($tmpRequiredPermissions)) + { + $tmpRequiredPermissions = array($_SESSION[self::SESSION_NAME]['requiredPermissions']); + } - if (!$this->permissionlib->isEntitled($requiredPermissions, 'filters')) + for ($i = 0; $i < count($tmpRequiredPermissions); $i++) + { + $requiredPermissions = array( + 'filters' => $tmpRequiredPermissions[$i].':rw' + ); + + if ($this->permissionlib->isEntitled($requiredPermissions, 'filters')) + { + $isAllowed = true; + break; + } + } + + if (!$isAllowed) { header('Content-Type: application/json'); From 95e18e1ef1b10ccbe21223512f72bd9d8dfea83a Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 18 May 2018 19:28:27 +0200 Subject: [PATCH 16/48] possible to answer to messages with token without login --- application/config/fhcomplete.php | 1 + application/controllers/Redirect.php | 11 ++ application/controllers/ViewMessage.php | 127 ++++++++++++++++++ application/controllers/system/Messages.php | 4 +- .../models/system/MessageToken_model.php | 29 ++++ application/models/system/Recipient_model.php | 1 + application/views/system/messageForm.php | 81 +++++++++++ application/views/system/messageHTML.php | 2 + application/views/system/messageWrite.php | 119 +++------------- .../views/system/messageWriteReply.php | 91 +++++++++++++ public/css/messageWrite.css | 10 ++ 11 files changed, 374 insertions(+), 102 deletions(-) create mode 100644 application/views/system/messageForm.php create mode 100644 application/views/system/messageWriteReply.php create mode 100644 public/css/messageWrite.css diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 0f7f1e94a..427270550 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -5,4 +5,5 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); $config['fhc_version'] = '3.3'; $config['addons_aufnahme_url'] = array(); +$config['addons_aufnahme_url']['fallback'] = 'https://localhost/fhcomplete/index.ci.php/ViewMessage/writeReply/'; $config['addons_aufnahme_url']['OE_ROOT'] = 'https://SERVER-NAME/addons/aufnahme/OE_ROOT/cis/index.php'; diff --git a/application/controllers/Redirect.php b/application/controllers/Redirect.php index c3ba110ca..6f3d457a8 100644 --- a/application/controllers/Redirect.php +++ b/application/controllers/Redirect.php @@ -75,5 +75,16 @@ class Redirect extends CI_Controller redirect($addonAufnahmeUrls[$organisationRoot] . '?token=' . $token); } } + else + { + $addonAufnahmeUrls = $this->config->item('addons_aufnahme_url'); + if (isset($token) + && hasData($msg) + && is_array($addonAufnahmeUrls) + && isset($addonAufnahmeUrls['fallback'])) + { + redirect($addonAufnahmeUrls['fallback'] . '?token=' . $token); + } + } } } diff --git a/application/controllers/ViewMessage.php b/application/controllers/ViewMessage.php index 48c0a09f1..1d510d9a3 100644 --- a/application/controllers/ViewMessage.php +++ b/application/controllers/ViewMessage.php @@ -15,6 +15,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); /** + * Handles sending messages with token * NOTE: in this controller is not possible to include/call everything * that automatically call the authentication system, like the most of models or libraries */ @@ -83,4 +84,130 @@ class ViewMessage extends CI_Controller $this->load->view('system/messageHTML.php', $data); } } + + /** + * write the reply + */ + public function writeReply() + { + $token = $this->input->get('token'); + + if (empty($token)) + { + show_error('no token supplied'); + } + + $msg = null; + + // Get message data if possible + $msg = $this->MessageTokenModel->getMessageByToken($token); + + if (!hasData($msg)) + { + show_error('no message found'); + } + + $msg = $msg->retval[0]; + + // Get variables + $receiverData = $this->MessageTokenModel->getPersonData($msg->sender_id); + + if (!hasData($receiverData)) + { + show_error('no sender found'); + } + + $data = array ( + 'receivers' => $receiverData->retval, + 'message' => $msg, + 'token' => $token + ); + + $v = $this->load->view('system/messageWriteReply', $data); + } + + /** + * send reply + */ + public function sendReply() + { + $this->load->model('system/Message_model', 'MessageModel'); + $this->load->library('MessageLib'); + + $error = false; + + $subject = $this->input->post('subject'); + $body = $this->input->post('body'); + $persons = $this->input->post('persons'); + $relationmessage_id = $this->input->post('relationmessage_id'); + $token = $this->input->post('token'); + + if (!isset($relationmessage_id) || $relationmessage_id == '' || !isset($token) || $token == '') + { + show_error('Error while sending reply'); + $error = true; + } + + $relationmsg = $this->MessageTokenModel->getMessageByToken($token); + + // check if correct message + if (!hasData($relationmsg) || $relationmessage_id !== $relationmsg->retval[0]->message_id) + { + show_error('Error while sending reply'); + $error = true; + } + + // get sender (receiver of previous msg) + $sender_id = $relationmsg->retval[0]->receiver_id; + + // get message data of persons + $data = $this->MessageTokenModel->getPersonData($persons); + + // send message(s) + if (hasData($data)) + { + for ($i = 0; $i < count($data->retval); $i++) + { + $dataArray = (array)$data->retval[$i]; + + $msg = $this->messagelib->sendMessage($sender_id, $dataArray['person_id'], $subject, $body, PRIORITY_NORMAL, $relationmessage_id, null); + if ($msg->error) + { + show_error($msg->retval); + $error = true; + break; + } + + // Loads the person log library + $this->load->library('PersonLogLib'); + + // Write log entry for sender + $logtype_kurzbz = 'Action'; + $logdata = array( + 'name' => 'Message sent', + 'message' => 'Message sent from person '.$sender_id.' to '.$dataArray['person_id'].', messageid '.$msg->retval, + 'success' => 'true' + ); + $taetigkeit_kurzbz = 'kommunikation'; + $app = 'core'; + $oe_kurzbz = null; + $insertvon = 'online'; + + $this->personloglib->log( + $sender_id, + $logtype_kurzbz, + $logdata, + $taetigkeit_kurzbz, + $app, + $oe_kurzbz, + $insertvon + ); + } + } + + if (!$error) + { + echo "Messages sent successfully"; + } + } } diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index 8af20368c..ace825832 100644 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -185,9 +185,9 @@ class Messages extends FHC_Controller { $user_person = $this->PersonModel->getByUid($this->uid); - if (isError($user_person)) + if (!hasData($user_person)) { - show_error($user_person->retval); + show_error('no sender'); } $sender_id = $user_person->retval[0]->person_id; } diff --git a/application/models/system/MessageToken_model.php b/application/models/system/MessageToken_model.php index fb7f81a0a..1f847a36f 100644 --- a/application/models/system/MessageToken_model.php +++ b/application/models/system/MessageToken_model.php @@ -31,6 +31,7 @@ class MessageToken_model extends CI_Model $sql = 'SELECT r.message_id, m.person_id as sender_id, r.person_id as receiver_id, + r.sent, m.subject, m.body, m.insertamum, @@ -174,6 +175,34 @@ class MessageToken_model extends CI_Model } } + /** + * Get data of a person + */ + public function getPersonData($person_id) + { + $sql = 'SELECT person_id, + vorname as "Vorname", + nachname as "Nachname", + anrede as "Anrede", + titelpost as "TitelPost", + titelpre as "TitelPre", + vornamen as "Vornamen" + FROM public.tbl_person + WHERE person_id %s ?'; + + $result = $this->db->query(sprintf($sql, is_array($person_id) ? 'IN' : '='), array($person_id)); + + // If no errors occurred + if ($result) + { + return success($result->result()); + } + else + { + return error($this->db->error()); + } + } + /** * */ diff --git a/application/models/system/Recipient_model.php b/application/models/system/Recipient_model.php index 7289c3055..654a9a883 100644 --- a/application/models/system/Recipient_model.php +++ b/application/models/system/Recipient_model.php @@ -48,6 +48,7 @@ class Recipient_model extends DB_Model $sql = 'SELECT r.message_id, m.person_id as sender_id, r.person_id as receiver_id, + r.sent, m.subject, m.body, m.insertamum, diff --git a/application/views/system/messageForm.php b/application/views/system/messageForm.php new file mode 100644 index 000000000..8e48e082b --- /dev/null +++ b/application/views/system/messageForm.php @@ -0,0 +1,81 @@ +
+
+
+ +
+
+ 1 && $i % 10 == 0) + { + echo '
'; + } + echo $receiver->Vorname." ".$receiver->Nachname."; "; + } + ?> +
+
+
+
+
+
+ +
  + subject; + } + ?> +
+ +
+
+
+
+
+
+ +

On '.date_format(date_create($message->sent), 'd.m.Y H:i').' '.$receivers[0]->Vorname.' '.$receivers[0]->Nachname.' wrote:'.'
'; + $body .= '
'; + $body .= $message->body.'
'; + } + ?> + +
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
\ No newline at end of file diff --git a/application/views/system/messageHTML.php b/application/views/system/messageHTML.php index 6a1d509ba..b99389188 100644 --- a/application/views/system/messageHTML.php +++ b/application/views/system/messageHTML.php @@ -42,6 +42,8 @@ if ($isEmployee === false && $href != '') { ?> +   +   Reply diff --git a/application/views/system/messageWrite.php b/application/views/system/messageWrite.php index 3f9ed5254..89c408687 100644 --- a/application/views/system/messageWrite.php +++ b/application/views/system/messageWrite.php @@ -8,24 +8,14 @@ $this->load->view( 'fontawesome' => true, 'tinymce' => true, 'sbadmintemplate' => true, - 'customCSSs' => 'public/css/sbadmin2/admintemplate_contentonly.css', - 'customJSs' => 'public/js/bootstrapper.js' + 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messageWrite.css'), + 'customJSs' => array('public/js/bootstrapper.js') ) ); ?> -
@@ -36,78 +26,7 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[
-
-
-
- -
-
- 1 && $i % 10 == 0) - { - echo '
'; - } - echo $receiver->Vorname." ".$receiver->Nachname."; "; - } - ?> -
-
-
-
-
-
- -
  - subject; - } - ?> -
- -
-
-
-
-
-
- - body; - } - ?> - -
- -
-
- - -
-
- -
+ load->view('system/messageForm.php'); ?>
@@ -119,9 +38,6 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[ ); ?>
-
- -
0): ?>
@@ -196,18 +112,25 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[
+ + + +load->view("templates/FHC-Footer"); ?> diff --git a/public/css/messageWrite.css b/public/css/messageWrite.css new file mode 100644 index 000000000..d929f656c --- /dev/null +++ b/public/css/messageWrite.css @@ -0,0 +1,10 @@ +/*smaller subject field*/ +input[type=text] { + height: 28px; + padding: 0px; +} + +.msgfield label { + margin-bottom: 0px !important; + margin-top: 3px; +} \ No newline at end of file From 27e9b55d352ee4ae9d3ba6a815a0d9bce0d44d36 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 23 May 2018 17:49:56 +0200 Subject: [PATCH 17/48] fixed bootstrap responsive problems with messagefields --- application/views/system/messageForm.php | 8 ++++---- public/css/messageWrite.css | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/application/views/system/messageForm.php b/application/views/system/messageForm.php index 8e48e082b..5267c3f27 100644 --- a/application/views/system/messageForm.php +++ b/application/views/system/messageForm.php @@ -1,9 +1,9 @@
-
+
-
+
-
+
 
-
diff --git a/public/css/messageWrite.css b/public/css/messageWrite.css index d929f656c..bfc2a5d2b 100644 --- a/public/css/messageWrite.css +++ b/public/css/messageWrite.css @@ -7,4 +7,14 @@ input[type=text] { .msgfield label { margin-bottom: 0px !important; margin-top: 3px; +} + +@media screen and (min-width: 1200px) { + .col-lg-1.msgfieldcol-left { + width: 13%; + } + + .col-lg-11.msgfieldcol-right { + width: 87%; + } } \ No newline at end of file From abcdd37e9020ae39419bc35dacb5faed2a502118 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 8 Jun 2018 18:28:40 +0200 Subject: [PATCH 18/48] - Now the FilterWidget always store the required permissions into the session to let the Filters controller to provide data even if the dataset is empty - Now the _renderDropDown method of the FilterWidget.js checks the parameter to avoid errors --- application/widgets/FilterWidget.php | 7 ++-- public/js/FilterWidget.js | 50 +++++++++++++++------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 2d00a9bf4..e57799840 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -263,6 +263,9 @@ class FilterWidget extends Widget // Read the all session for this filter widget $session = $this->filterslib->getSession(); + // To be always stored in the session, otherwise is not possible to load data from Filters controller + $this->filterslib->setElementSession(FiltersLib::REQUIRED_PERMISSIONS_PARAMETER, $this->_requiredPermissions); + // If session is NOT empty -> a filter was already loaded if ($session != null) { @@ -339,14 +342,10 @@ class FilterWidget extends Widget // Stores an array that contains all the data useful for $this->filterslib->setSession( array( - FiltersLib::REQUIRED_PERMISSIONS_PARAMETER => $this->_requiredPermissions, // required permissions - FiltersLib::FILTER_ID => $this->_filterId, // the current filter id FiltersLib::APP_PARAMETER => $this->_app, // the current app parameter FiltersLib::DATASET_NAME_PARAMETER => $this->_datasetName, // the carrent dataset name - FiltersLib::SESSION_FILTER_NAME => $filterName, // the current filter name - FiltersLib::SESSION_FIELDS => $this->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset FiltersLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields FiltersLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 17136d3e0..fb4ad0452 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -160,6 +160,8 @@ var FHC_FilterWidget = { */ _renderFilterWidget: function(data) { + console.log(data); + FHC_FilterWidget._initSessionStorage(); // initialize the session storage FHC_FilterWidget._turnOffEvents(); // turns all the events off FHC_FilterWidget._resetGUI(); // Reset the entire GUI @@ -545,10 +547,7 @@ var FHC_FilterWidget = { */ _renderDropDownFields: function(data) { - if (data.hasOwnProperty("fields") && $.isArray(data.fields)) - { - FHC_FilterWidget._renderDropDown(data, data.selectedFields, 'addField'); - } + FHC_FilterWidget._renderDropDown(data, data.selectedFields, 'addField'); }, /** @@ -557,34 +556,37 @@ var FHC_FilterWidget = { */ _renderDropDown: function(data, elements, ddElementId) { - for (var i = 0; i < data.fields.length; i++) + if (data.hasOwnProperty("fields") && $.isArray(data.fields)) { - var toBeDisplayed = true; - - for (var j = 0; j < elements.length; j++) + for (var i = 0; i < data.fields.length; i++) { - var elementName = elements[j].hasOwnProperty("name") ? elements[j].name : elements[j]; + var toBeDisplayed = true; - if (data.fields[i] == elementName) + for (var j = 0; j < elements.length; j++) { - toBeDisplayed = false; - break; - } - } + var elementName = elements[j].hasOwnProperty("name") ? elements[j].name : elements[j]; - if (toBeDisplayed == true) - { - var fieldName = data.fields[i]; - var fieldToDisplay = data.fields[i]; - - if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) - { - fieldToDisplay = data.columnsAliases[i]; + if (data.fields[i] == elementName) + { + toBeDisplayed = false; + break; + } } - if ($("#" + ddElementId).length) // checks if the element exists + if (toBeDisplayed == true) { - $("#" + ddElementId).append(""); + var fieldName = data.fields[i]; + var fieldToDisplay = data.fields[i]; + + if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) + { + fieldToDisplay = data.columnsAliases[i]; + } + + if ($("#" + ddElementId).length) // checks if the element exists + { + $("#" + ddElementId).append(""); + } } } } From 9f7dd9d3943974681dfa1f61cac7446bb6b85d56 Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 11 Jun 2018 14:07:21 +0200 Subject: [PATCH 19/48] FilterWidget: fixed authentication failure because the required permission was missing in the session --- application/widgets/FilterWidget.php | 7 +++--- public/js/AjaxLib.js | 2 +- public/js/FilterWidget.js | 36 +++++++++++++--------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index e57799840..55b79bedd 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -263,9 +263,6 @@ class FilterWidget extends Widget // Read the all session for this filter widget $session = $this->filterslib->getSession(); - // To be always stored in the session, otherwise is not possible to load data from Filters controller - $this->filterslib->setElementSession(FiltersLib::REQUIRED_PERMISSIONS_PARAMETER, $this->_requiredPermissions); - // If session is NOT empty -> a filter was already loaded if ($session != null) { @@ -361,6 +358,10 @@ class FilterWidget extends Widget } } } + + // To be always stored in the session, otherwise is not possible to load data from Filters controller + // NOTE: must the latest operation to be performed in the session to be shure that is always present + $this->filterslib->setElementSession(FiltersLib::REQUIRED_PERMISSIONS_PARAMETER, $this->_requiredPermissions); } /** diff --git a/public/js/AjaxLib.js b/public/js/AjaxLib.js index bd2b22689..431d251b6 100644 --- a/public/js/AjaxLib.js +++ b/public/js/AjaxLib.js @@ -186,7 +186,7 @@ var FHC_AjaxClient = { sParameterName, i; - for (i = 0; i < sURLVariables.length; i++) + for (var i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index fb4ad0452..f47481ee2 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -160,8 +160,6 @@ var FHC_FilterWidget = { */ _renderFilterWidget: function(data) { - console.log(data); - FHC_FilterWidget._initSessionStorage(); // initialize the session storage FHC_FilterWidget._turnOffEvents(); // turns all the events off FHC_FilterWidget._resetGUI(); // Reset the entire GUI @@ -558,15 +556,15 @@ var FHC_FilterWidget = { if (data.hasOwnProperty("fields") && $.isArray(data.fields)) { - for (var i = 0; i < data.fields.length; i++) + for (var fc = 0; fc < data.fields.length; fc++) { var toBeDisplayed = true; - for (var j = 0; j < elements.length; j++) + for (var ec = 0; ec < elements.length; ec++) { - var elementName = elements[j].hasOwnProperty("name") ? elements[j].name : elements[j]; + var elementName = elements[ec].hasOwnProperty("name") ? elements[ec].name : elements[ec]; - if (data.fields[i] == elementName) + if (data.fields[fc] == elementName) { toBeDisplayed = false; break; @@ -575,12 +573,12 @@ var FHC_FilterWidget = { if (toBeDisplayed == true) { - var fieldName = data.fields[i]; - var fieldToDisplay = data.fields[i]; + var fieldName = data.fields[fc]; + var fieldToDisplay = data.fields[fc]; if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) { - fieldToDisplay = data.columnsAliases[i]; + fieldToDisplay = data.columnsAliases[fc]; } if ($("#" + ddElementId).length) // checks if the element exists @@ -601,11 +599,11 @@ var FHC_FilterWidget = { if (data.hasOwnProperty("datasetMetadata") && $.isArray(data.datasetMetadata) && data.hasOwnProperty("filters") && $.isArray(data.filters)) { - for (var i = 0; i < data.filters.length; i++) + for (var fc = 0; fc < data.filters.length; fc++) { - for (var j = 0; j < data.datasetMetadata.length; j++) + for (var dmc = 0; dmc < data.datasetMetadata.length; dmc++) { - if (data.filters[i].name == data.datasetMetadata[j].name) + if (data.filters[fc].name == data.datasetMetadata[dmc].name) { var appliedFilters = "
"; @@ -613,17 +611,17 @@ var FHC_FilterWidget = { if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) { - fieldToDisplay = data.columnsAliases[j]; + fieldToDisplay = data.columnsAliases[dmc]; } else { - fieldToDisplay = data.datasetMetadata[j].name; + fieldToDisplay = data.datasetMetadata[dmc].name; } appliedFilters += fieldToDisplay; appliedFilters += ""; - appliedFilters += FHC_FilterWidget._renderSingleAppliedFilter(data.filters[i], data.datasetMetadata[j]); + appliedFilters += FHC_FilterWidget._renderSingleAppliedFilter(data.filters[fc], data.datasetMetadata[dmc]); appliedFilters += "
"; @@ -856,13 +854,13 @@ var FHC_FilterWidget = { { if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) { - for (var i = 0; i < data.selectedFields.length; i++) + for (var sfc = 0; sfc < data.selectedFields.length; sfc++) { - for (var j = 0; j < data.fields.length; j++) + for (var fc = 0; fc < data.fields.length; fc++) { - if (data.selectedFields[i] == data.fields[j]) + if (data.selectedFields[sfc] == data.fields[fc]) { - arrayFieldsToDisplay[i] = data.columnsAliases[j]; + arrayFieldsToDisplay[sfc] = data.columnsAliases[fc]; } } } From 249f273091077f1042afa604cebb5c8d59c21bbd Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 12 Jun 2018 17:24:24 +0200 Subject: [PATCH 20/48] - beautified reply page - added bootstrap "messageSent" page - layout changes in messageWrite views --- application/controllers/ViewMessage.php | 4 +- application/views/system/messageForm.php | 8 +- application/views/system/messageHTML.php | 131 ++++++++++-------- application/views/system/messageSent.php | 107 ++++++++++++++ application/views/system/messageWrite.php | 20 +-- .../views/system/messageWriteReply.php | 6 +- application/views/templates/FHC-Header.php | 2 +- public/css/messaging/messageReply.css | 17 +++ public/css/messaging/messageSent.css | 25 ++++ public/css/{ => messaging}/messageWrite.css | 8 +- 10 files changed, 247 insertions(+), 81 deletions(-) create mode 100644 application/views/system/messageSent.php create mode 100644 public/css/messaging/messageReply.css create mode 100644 public/css/messaging/messageSent.css rename public/css/{ => messaging}/messageWrite.css (76%) diff --git a/application/controllers/ViewMessage.php b/application/controllers/ViewMessage.php index 019c1013e..c88a83889 100644 --- a/application/controllers/ViewMessage.php +++ b/application/controllers/ViewMessage.php @@ -123,7 +123,7 @@ class ViewMessage extends FHC_Controller 'token' => $token ); - $v = $this->load->view('system/messageWriteReply', $data); + $this->load->view('system/messageWriteReply', $data); } /** @@ -207,7 +207,7 @@ class ViewMessage extends FHC_Controller if (!$error) { - echo "Messages sent successfully"; + $this->load->view('system/messageSent'); } } } diff --git a/application/views/system/messageForm.php b/application/views/system/messageForm.php index 5267c3f27..d1436a492 100644 --- a/application/views/system/messageForm.php +++ b/application/views/system/messageForm.php @@ -1,7 +1,7 @@
- +
Message:

On '.date_format(date_create($message->sent), 'd.m.Y H:i').' '.$receivers[0]->Vorname.' '.$receivers[0]->Nachname.' wrote:'.'
'; + $body .= '

On '.date_format(date_create($message->sent), 'd.m.Y H:i').' '.$receivers[0]->Vorname.' '.$receivers[0]->Nachname.' wrote:'.'
'; $body .= '
'; $body .= $message->body.'
'; } @@ -58,7 +58,7 @@ ?>
- + + name="subject">
@@ -100,7 +100,7 @@ $href = site_url().'/system/Messages/send/';

-
+
widgetlib->widget( 'Vorlage_widget', @@ -109,7 +109,7 @@ $href = site_url().'/system/Messages/send/'; ); ?>
-
+
diff --git a/application/views/system/messageWriteReply.php b/application/views/system/messageWriteReply.php index 89be989e1..0987b6226 100644 --- a/application/views/system/messageWriteReply.php +++ b/application/views/system/messageWriteReply.php @@ -8,7 +8,7 @@ $this->load->view( 'fontawesome' => true, 'tinymce' => true, 'sbadmintemplate' => true, - 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messageWrite.css'), + 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageWrite.css'), 'customJSs' => array('public/js/bootstrapper.js') ) ); @@ -22,7 +22,7 @@ $href = site_url().'/ViewMessage/sendReply';
- +
@@ -85,7 +85,5 @@ $href = site_url().'/ViewMessage/sendReply'; } }); - - load->view("templates/FHC-Footer"); ?> diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 81cbc9dcd..0fa0c8478 100755 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -206,7 +206,7 @@ function _generateAddonsJSsInclude($calledFrom) // Generates the global object to pass phrases to javascripts // NOTE: must be called before including the PhrasesLib.js - _generateJSPhrasesStorageObject($phrases); + if ($phrases != null) _generateJSPhrasesStorageObject($phrases); // JQuery V3 if ($jquery === true) _generateJSsInclude('vendor/components/jquery/jquery.min.js'); diff --git a/public/css/messaging/messageReply.css b/public/css/messaging/messageReply.css new file mode 100644 index 000000000..17f978ecc --- /dev/null +++ b/public/css/messaging/messageReply.css @@ -0,0 +1,17 @@ +.panel-heading { + font-size: 16px; +} + +@media screen and (min-width: 1500px) { + #msgtable { + width: 70%; + } +} + +#msgtable td { + border: none !important; +} + +#replybutton { + width: 120px; +} diff --git a/public/css/messaging/messageSent.css b/public/css/messaging/messageSent.css new file mode 100644 index 000000000..96403d797 --- /dev/null +++ b/public/css/messaging/messageSent.css @@ -0,0 +1,25 @@ +.panel-heading { + font-size: 16px; +} + +.signatureblock { + color: grey; +} + +.signatureblocklink { + color: grey; +} + +.signatureblocklink:hover { + color: #337ab7; +} + +.rwd-line { + display: block; +} + +@media screen and (min-width: 1831px) { + .rwd-line { + display: inline; + } +} diff --git a/public/css/messageWrite.css b/public/css/messaging/messageWrite.css similarity index 76% rename from public/css/messageWrite.css rename to public/css/messaging/messageWrite.css index bfc2a5d2b..91b20729f 100644 --- a/public/css/messageWrite.css +++ b/public/css/messaging/messageWrite.css @@ -1,11 +1,11 @@ /*smaller subject field*/ input[type=text] { height: 28px; - padding: 0px; + padding: 0; } .msgfield label { - margin-bottom: 0px !important; + margin-bottom: 0 !important; margin-top: 3px; } @@ -17,4 +17,8 @@ input[type=text] { .col-lg-11.msgfieldcol-right { width: 87%; } +} + +#sendButton { + width: 120px; } \ No newline at end of file From c5cce4d0a0a1bef715f134374346dc497cdd767d Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 15 Jun 2018 11:33:13 +0200 Subject: [PATCH 21/48] Fixed missing permissions on controller InfoCenter --- application/controllers/system/infocenter/InfoCenter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 0380a150b..4c4aa32e6 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -73,7 +73,11 @@ class InfoCenter extends Auth_Controller 'saveNotiz' => 'infocenter:rw', 'reloadNotizen' => 'infocenter:r', 'reloadLogs' => 'infocenter:r', - 'outputAkteContent' => 'infocenter:r' + 'outputAkteContent' => 'infocenter:r', + 'getZgvInfoForPrestudent' => 'infocenter:r', + 'getParkedDate' => 'infocenter:r', + 'getStudienjahrEnd' => 'infocenter:r', + 'updateNotiz' => 'infocenter:rw' ) ); From 079ee7bfbddc81ccee99d6cd3ee6e4f6b879df5f Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 15 Jun 2018 11:50:06 +0200 Subject: [PATCH 22/48] Removed unnecessary permissions check from the InfoCenter controller --- application/controllers/system/infocenter/InfoCenter.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 4c4aa32e6..e2bed9ea3 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -109,10 +109,6 @@ class InfoCenter extends Auth_Controller $this->_setAuthUID(); // sets property uid - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isBerechtigt('basis/person')) - show_error('You have no Permission! You need Infocenter Role'); - $this->setControllerId(); // sets the controller id } From 08efaf840ce0a2cfe30f64e64fd5628e67e2546f Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 18 Jun 2018 10:49:34 +0200 Subject: [PATCH 23/48] - Missing permissions in the InforCenter controller - If filters are not present for the Freigegeben page, now the page does not crash --- application/controllers/system/infocenter/InfoCenter.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index e2bed9ea3..59a471591 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -67,17 +67,20 @@ class InfoCenter extends Auth_Controller 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', 'getLastPrestudentWithZgvJson' => 'infocenter:r', + 'getZgvInfoForPrestudent' => 'infocenter:r', 'saveZgvPruefung' => 'infocenter:rw', 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', 'saveNotiz' => 'infocenter:rw', + 'updateNotiz' => 'infocenter:rw', 'reloadNotizen' => 'infocenter:r', 'reloadLogs' => 'infocenter:r', 'outputAkteContent' => 'infocenter:r', - 'getZgvInfoForPrestudent' => 'infocenter:r', 'getParkedDate' => 'infocenter:r', + 'park' => 'infocenter:rw', + 'unpark' => 'infocenter:rw', 'getStudienjahrEnd' => 'infocenter:r', - 'updateNotiz' => 'infocenter:rw' + 'setNavigationMenuArrayJson' => 'infocenter:r' ) ); @@ -798,6 +801,7 @@ class InfoCenter extends Auth_Controller } $filtersArray = array(); + $filtersArray['children'] = array(); $this->_fillFiltersFreigegeben($listFilters, $filtersArray); From 84a0db4483c466f661c0259b7fdfbed57a7d39fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 18 Jun 2018 11:27:10 +0200 Subject: [PATCH 24/48] Fixed PHP Version compatibility --- .../system/infocenter/InfoCenter.php | 6 +-- application/libraries/FiltersLib.php | 47 +++++++++++-------- application/libraries/NavigationLib.php | 3 +- application/libraries/PhrasesLib.php | 3 +- .../system/infocenter/infocenterData.php | 7 +-- .../infocenter/infocenterFreigegebenData.php | 5 +- 6 files changed, 41 insertions(+), 30 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 59a471591..5119600b9 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -758,10 +758,10 @@ class InfoCenter extends Auth_Controller $this->navigationlib->setSessionMenu( array( 'back' => $this->navigationlib->oneLevel( - '<< Züruck', // description + 'Zurück', // description $link, // link array(), // children - '', // icon + 'angle-left', // icon true // expand ) ) @@ -823,7 +823,7 @@ class InfoCenter extends Auth_Controller 'filters' => $this->navigationlib->oneLevel( 'Filter', // description '#', // link - $filtersArray['children'], // children + (isset($filtersArray['children'])?$filtersArray['children']:''), // children '', // icon true // expand ) diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 24ca0e27d..8a143f7c9 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -288,9 +288,10 @@ class FiltersLib public function generateDatasetQuery($query, $filters) { $datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS; + $trimedval = trim($query); // If the given query is valid and the parameter filters is an array - if (!empty(trim($query)) && $filters != null && is_array($filters)) + if (!empty($trimedval) && $filters != null && is_array($filters)) { $where = ''; // starts building the SQL where clause @@ -299,9 +300,11 @@ class FiltersLib { $filterDefinition = $filters[$filtersCounter]; // definition of one filter - if ($filtersCounter > 0) $where .= ' AND '; // if it's NOT the last one + if ($filtersCounter > 0) + $where .= ' AND '; // if it's NOT the last one - if (!empty(trim($filterDefinition->name))) // if the name of the applied filter is valid + $trimedname = trim($filterDefinition->name); + if (!empty($trimedname)) // if the name of the applied filter is valid { // ...build the condition $where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition); @@ -341,15 +344,16 @@ class FiltersLib public function getFilterName($filterJson) { $filterName = $filterJson->name; // always present, used as default - + $trimedname = (isset($filterJson->namePhrase)?trim($filterJson->namePhrase):''); // Filter name from phrases system - if (isset($filterJson->namePhrase) && !empty(trim($filterJson->namePhrase))) + if (isset($filterJson->namePhrase) && !empty($trimedname)) { // Loads the library to use the phrases system $this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY)); $tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase); - if (isset($tmpFilterNamePhrase) && !empty(trim($tmpFilterNamePhrase))) // if is not null or an empty string + $trimedphrase = (isset($tmpFilterNamePhrase)?trim($tmpFilterNamePhrase):''); + if (isset($tmpFilterNamePhrase) && !empty($trimedphrase)) // if is not null or an empty string { $filterName = $tmpFilterNamePhrase; } @@ -389,9 +393,9 @@ class FiltersLib public function removeSelectedField($selectedField) { $removeSelectedField = false; - + $trimedval = (isset($selectedField)?trim($selectedField):''); // Checks the parameter selectedField - if (isset($selectedField) && !empty(trim($selectedField))) + if (isset($selectedField) && !empty($trimedval)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -423,9 +427,9 @@ class FiltersLib public function addSelectedField($selectedField) { $removeSelectedField = false; - + $trimedval = (isset($selectedField)?trim($selectedField):''); // Checks the parameter selectedField - if (isset($selectedField) && !empty(trim($selectedField))) + if (isset($selectedField) && !empty($trimedval)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -452,9 +456,9 @@ class FiltersLib public function removeAppliedFilter($appliedFilter) { $removeAppliedFilter = false; - + $trimedval = (isset($appliedFilter)?trim($appliedFilter):''); // Checks the parameter appliedFilter - if (isset($appliedFilter) && !empty(trim($appliedFilter))) + if (isset($appliedFilter) && !empty($trimedval)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -540,9 +544,9 @@ class FiltersLib public function addFilter($filter) { $addFilter = false; - + $trimedval = (isset($filter)?trim($filter):''); // Checks the parameter filter - if (isset($filter) && !empty(trim($filter))) + if (isset($filter) && !empty($trimedval)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -583,9 +587,9 @@ class FiltersLib public function saveCustomFilter($customFilterDescription) { $saveCustomFilter = false; // by default returns a failure - + $trimedval = (isset($customFilterDescription)?trim($customFilterDescription):''); // Checks parameter customFilterDescription if not valid stop the execution - if (!isset($customFilterDescription) || empty(trim($customFilterDescription))) + if (!isset($customFilterDescription) || empty($trimedval)) { return $saveCustomFilter; } @@ -702,11 +706,11 @@ class FiltersLib */ private function _getFilterUniqueId($params) { - // + $trimedval = (isset($params[self::FILTER_PAGE_PARAM])?trim($params[self::FILTER_PAGE_PARAM]):''); if ($params != null && is_array($params) && isset($params[self::FILTER_PAGE_PARAM]) - && !empty(trim($params[self::FILTER_PAGE_PARAM]))) + && !empty($trimedval)) { $filterUniqueId = $params[self::FILTER_PAGE_PARAM]; } @@ -738,7 +742,8 @@ class FiltersLib $condition = ''; // starts building the condition // "operation" is a required property for the applied filter definition - if (!empty(trim($filterDefinition->operation))) + $trimedval = trim($filterDefinition->operation); + if (!empty($trimedval)) { // Checks what operation is required switch ($filterDefinition->operation) @@ -813,7 +818,9 @@ class FiltersLib } // if the condition is valid - if (!empty(trim($condition))) $condition = ' '.$condition; // add a white space before + $trimedval = trim($condition); + if (!empty($trimedval)) + $condition = ' '.$condition; // add a white space before return $condition; } diff --git a/application/libraries/NavigationLib.php b/application/libraries/NavigationLib.php index 4d2187e04..80b2aa5a2 100644 --- a/application/libraries/NavigationLib.php +++ b/application/libraries/NavigationLib.php @@ -334,11 +334,12 @@ class NavigationLib */ private function _getNavigationtPage($params) { + $trimedval = trim($params[self::NAVIGATION_PAGE_PARAM]); // if ($params != null && is_array($params) && isset($params[self::NAVIGATION_PAGE_PARAM]) - && !empty(trim($params[self::NAVIGATION_PAGE_PARAM]))) + && !empty($trimedval)) { $navigationPage = $params[self::NAVIGATION_PAGE_PARAM]; } diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index f895cf637..0c983c399 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -197,12 +197,13 @@ class PhrasesLib { $_phrase = $this->_phrases[$i]; // single phrase + $trimedval = trim($_phrase->text); // If the single phrase match the given parameters and is not an empty string if ($_phrase->category == $category && $_phrase->phrase == $phrase && $_phrase->orgeinheit_kurzbz == $orgeinheit_kurzbz && $_phrase->orgform_kurzbz == $orgform_kurzbz - && (!empty(trim($_phrase->text)))) + && (!empty($trimedval))) { if (!is_array($parameters)) $parameters = array(); // if params is not an array diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 9211fe29b..384486c0f 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -2,7 +2,7 @@ $APP = 'infocenter'; $NOTBEFORE = '2018-03-01 18:00:00'; - + $filterWidgetArray = array( 'query' => ' SELECT @@ -219,12 +219,13 @@ ), 'formatRow' => function($datasetRaw) { + /* NOTE: Dont use $this here for PHP Version compatibility */ $datasetRaw->{'Details'} = sprintf( 'Details', site_url('system/infocenter/InfoCenter/showDetails'), $datasetRaw->{'PersonId'}, - $this->router->method, - $this->input->get('fhc_controller_id') + 'index', + (isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'') ); if ($datasetRaw->{'SendDate'} == null) diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 717a4dc1e..8a282ccda 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -153,12 +153,13 @@ ), 'formatRow' => function($datasetRaw) { + /* NOTE: Dont use $this here for PHP Version compatibility */ $datasetRaw->{'Details'} = sprintf( 'Details', site_url('system/infocenter/InfoCenter/showDetails'), $datasetRaw->{'PersonId'}, - $this->router->method, - $this->input->get('fhc_controller_id') + 'freigegeben', + (isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'') ); if ($datasetRaw->{'SendDate'} == null) From 8f566e04991b841069d24857c1cbe16b21a279ba Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 28 Jun 2018 16:09:12 +0200 Subject: [PATCH 25/48] Auth_Controller is now able to display a better message if the user is unauthorized This message contains: - the name of the called controller - the name of the called method of the called controller - all the possible permissions and related modes needed to acces to this content --- application/core/APIv1_Controller.php | 2 +- application/core/Auth_Controller.php | 45 ++++++++++++++-- application/libraries/PermissionLib.php | 69 ++++++++++++++----------- 3 files changed, 80 insertions(+), 36 deletions(-) diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 927265346..e3ffcb533 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -25,7 +25,7 @@ class APIv1_Controller extends REST_Controller /** * Checks if the caller is allowed to access to this content with the given permissions * If it is not allowed will set the HTTP header with code 401 - * Wrapper for _checkPermissions + * Wrapper for permissionlib->isEntitled */ private function _isAllowed($requiredPermissions) { diff --git a/application/core/Auth_Controller.php b/application/core/Auth_Controller.php index fe661f1e3..1af83ba2c 100644 --- a/application/core/Auth_Controller.php +++ b/application/core/Auth_Controller.php @@ -21,18 +21,55 @@ class Auth_Controller extends FHC_Controller /** * Checks if the caller is allowed to access to this content with the given permissions * If it is not allowed will set the HTTP header with code 401 - * Wrapper for _checkPermissions + * Wrapper for permissionlib->isEntitled */ private function _isAllowed($requiredPermissions) { // Loads permission lib $this->load->library('PermissionLib'); + // Checks if this user is entitled to access to this content if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) { - header('HTTP/1.0 401 Unauthorized'); - echo 'You are not allowed to access to this content'; - exit; + header('HTTP/1.0 401 Unauthorized'); // set the HTTP header as unauthorized + + $this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output + + // Prints the main error message + $this->eprintflib->printError('You are not allowed to access to this content'); + // Prints the called controller name + $this->eprintflib->printInfo('Controller name: '.$this->router->class); + // Prints the called controller method name + $this->eprintflib->printInfo('Method name: '.$this->router->method); + // Prints the required permissions needed to access to this method + $this->eprintflib->printInfo('Required permissions: '.$this->_rpsToString($requiredPermissions, $this->router->method)); + + exit; // immediately terminate the execution } } + + private function _rpsToString($requiredPermissions, $method) + { + $strRequiredPermissions = ''; // string that contains all the required permissions needed to access to this method + + if (isset($requiredPermissions[$method])) // if the called method is present in the permissions array + { + // If it is NOT then convert it into an array + $rpsMethod = $requiredPermissions[$method]; + if (!is_array($rpsMethod)) + { + $rpsMethod = array($rpsMethod); + } + + // Copy all the permissions into $strRequiredPermissions separated by a comma + for ($i = 0; $i < count($rpsMethod); $i++) + { + $strRequiredPermissions .= $rpsMethod[$i].', '; + } + + $strRequiredPermissions = rtrim($strRequiredPermissions, ', '); + } + + return $strRequiredPermissions; + } } diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index 34744ef3a..dbfd2a018 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -144,52 +144,59 @@ class PermissionLib $permissions = array($requiredPermissions[$calledMethod]); } - // Loops through the required permissions - for ($pCounter = 0; $pCounter < count($permissions); $pCounter++) + if (!isEmptyArray($permissions)) { - // Checks if the permission is well formatted - if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false) + // Loops through the required permissions + for ($pCounter = 0; $pCounter < count($permissions); $pCounter++) { - // Retrives permission and required access type from the $requiredPermissions array - list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]); - - $accessType = null; - - // Checks if the required access type is compliant with the HTTP method (GET => r, POST => w) - if ($requestMethod == self::READ_HTTP_METHOD - && strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) + // Checks if the permission is well formatted + if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false) { - $accessType = PermissionLib::SELECT_RIGHT; // S + // Retrives permission and required access type from the $requiredPermissions array + list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]); + + $accessType = null; + + // Checks if the required access type is compliant with the HTTP method (GET => r, POST => w) + if ($requestMethod == self::READ_HTTP_METHOD + && strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) + { + $accessType = PermissionLib::SELECT_RIGHT; // S + } + elseif ($requestMethod == self::WRITE_HTTP_METHOD + && strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) + { + $accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID + } + + if ($accessType != null) // if compliant + { + // Checks if the user has the same required permissiond with the same required access type + $checkPermissions = $this->isBerechtigt($permission, $accessType); + + // If the user has one of the permissionsm than exit the loop + if ($checkPermissions === true) break; + } } - elseif ($requestMethod == self::WRITE_HTTP_METHOD - && strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) + else { - $accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID - } - - if ($accessType != null) // if compliant - { - // Checks if the user has the same required permissiond with the same required access type - $checkPermissions = $this->isBerechtigt($permission, $accessType); - - // If the user has one of the permissionsm than exit the loop - if ($checkPermissions === true) break; + show_error('The given permission does not use the correct format'); } } - else - { - show_error('The given permission does not use the correct format'); - } + } + else + { + show_error('No permissions are set for this method, an empty array is given'); } } else { - show_error('Your are trying to access to this content with a not valid HTTP method'); + show_error('You are trying to access to this content with a not valid HTTP method'); } } else { - show_error('The given permission array does not contain the called method'); + show_error('The given permission array does not contain the called method or is not correctly set'); } } else From 99292f93a7568e8822fe43ac34a965f626cfb93e Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 28 Jun 2018 16:34:26 +0200 Subject: [PATCH 26/48] PermissionLib->isEntitled is NOT checking anymore if the HTTP method to access to the controller method is POST or GET to define what permission type (RW/SUID) is needed --- application/libraries/PermissionLib.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index dbfd2a018..8b10678da 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -155,21 +155,19 @@ class PermissionLib // Retrives permission and required access type from the $requiredPermissions array list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]); - $accessType = null; + $accessType = ''; // Checks if the required access type is compliant with the HTTP method (GET => r, POST => w) - if ($requestMethod == self::READ_HTTP_METHOD - && strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) + if (strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) { $accessType = PermissionLib::SELECT_RIGHT; // S } - elseif ($requestMethod == self::WRITE_HTTP_METHOD - && strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) + if (strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) { - $accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID + $accessType .= PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID } - if ($accessType != null) // if compliant + if (!isEmptyString($accessType)) // if compliant { // Checks if the user has the same required permissiond with the same required access type $checkPermissions = $this->isBerechtigt($permission, $accessType); From 2b15c88410bd6ebc0919917e7e31c83591466d83 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 29 Jun 2018 11:24:50 +0200 Subject: [PATCH 27/48] - Moved the loading of the fhcauth from Filters controller to the library FiltersLib - Added comments --- application/controllers/system/Filters.php | 4 ---- application/libraries/CallerLib.php | 18 ++++++++---------- application/libraries/FiltersLib.php | 4 ++++ application/libraries/PhrasesLib.php | 2 ++ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index 1b43e82e1..64626f8db 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -21,10 +21,6 @@ class Filters extends FHC_Controller { parent::__construct(); - // Loads authentication helper - // NOTE: needed to load custom filters do not remove! - $this->load->helper('fhcauth'); - // Loads the FiltersLib with HTTP GET/POST parameters $this->_loadFiltersLib(); diff --git a/application/libraries/CallerLib.php b/application/libraries/CallerLib.php index 9024c0f09..0b46cf0c6 100644 --- a/application/libraries/CallerLib.php +++ b/application/libraries/CallerLib.php @@ -25,16 +25,14 @@ class CallerLib 'PersonLogLib' ); + private $_ci; // CI instance + /** - * Object initialization + * Library initialization */ public function __construct() { - // Gets CI instance - $this->ci =& get_instance(); - - // Loads permission library - $this->ci->load->library('PermissionLib'); + $this->_ci =& get_instance(); // Gets CI instance } /** @@ -80,7 +78,7 @@ class CallerLib elseif (strpos($parameters->resourceName, CallerLib::LIB_PREFIX) !== false) { // Check if the resource is already loaded, it works only with libraries and drivers - $isLoaded = $this->ci->load->is_loaded($parameters->resourceName); + $isLoaded = $this->_ci->load->is_loaded($parameters->resourceName); // If not loaded then load it if ($isLoaded === false) { @@ -210,7 +208,7 @@ class CallerLib try { - $loaded = $this->ci->load->model($resourcePath.$resourceName); + $loaded = $this->_ci->load->model($resourcePath.$resourceName); } catch (Exception $e) { @@ -245,7 +243,7 @@ class CallerLib try { // Gets all the configured resources paths - $packagePaths = $this->ci->load->get_package_paths(); + $packagePaths = $this->_ci->load->get_package_paths(); // Looking for a file in every paths with the same name of the resource $found = null; for ($i = 0; $i < count($packagePaths) && is_null($found); $i++) @@ -262,7 +260,7 @@ class CallerLib if (!is_null($found)) { // Load the file - $loaded = $this->ci->load->file($found); + $loaded = $this->_ci->load->file($found); // If the resource is not present inside the file if (!class_exists($resourceName)) { diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 263956e18..32bb82538 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -86,6 +86,9 @@ class FiltersLib { $this->_ci =& get_instance(); // get code igniter instance + // Loads authentication helper + $this->_ci->load->helper('fhcauth'); // NOTE: needed to load custom filters do not remove! + $this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget } @@ -96,6 +99,7 @@ class FiltersLib * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs * to the authenticated user, if confirmed then is allowed to use this FilterWidget. * If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget + * NOTE: PermissionLib is loaded hedere */ public function isAllowed($requiredPermissions = null) { diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index e8582f65b..93250379b 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -249,6 +249,8 @@ class PhrasesLib $language = $parameters[1]; } // Checks if the user is authenticated to retrive the users's language + // NOTE: this library could be called when the user is not logged in the system + // so this is why is checked if the function getAuthUID exists elseif (function_exists('getAuthUID')) { $this->_ci->load->model('person/Person_model', 'PersonModel'); From 2cba129076e0b822dd31bfe5fa56203065a3702e Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 29 Jun 2018 11:51:16 +0200 Subject: [PATCH 28/48] - Added method hasAtLeastOne to the library PermissionLib - Adapted the method isAllowed of the library FiltersLib to use hasAtLeastOne - Corrected/added comments --- application/libraries/FiltersLib.php | 32 +++-------------- application/libraries/PermissionLib.php | 34 +++++++++++++++++++ .../system/infocenter/infocenterData.php | 2 +- application/widgets/FilterWidget.php | 2 +- 4 files changed, 40 insertions(+), 30 deletions(-) diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 32bb82538..0288e37d5 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -98,43 +98,19 @@ class FiltersLib /** * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs * to the authenticated user, if confirmed then is allowed to use this FilterWidget. - * If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget - * NOTE: PermissionLib is loaded hedere + * If the parameter requiredPermissions is NOT given or is not present in the session, + * then NO one is allow to use this FilterWidget + * Wrapper method to permissionlib->hasAtLeastOne */ public function isAllowed($requiredPermissions = null) { $this->_ci->load->library('PermissionLib'); // Load permission library - $isAllowed = false; // by default is not allowed - // Gets the required permissions from the session if they are not provided as parameter $rq = $requiredPermissions; if ($rq == null) $rq = $this->getElementSession(self::REQUIRED_PERMISSIONS_PARAMETER); - // If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget - if ($rq != null) - { - // If requiredPermissions is NOT an array then converts it to an array - if (!is_array($rq)) - { - $rq = array($rq); - } - - // Checks if at least one of the permissions given as parameter belongs to the authenticated user... - for ($p = 0; $p < count($rq); $p++) - { - $isAllowed = $this->_ci->permissionlib->isEntitled( - array( - self::PERMISSION_FILTER_METHOD => $rq[$p].':'.self::PERMISSION_TYPE - ), - self::PERMISSION_FILTER_METHOD - ); - - if ($isAllowed) break; // ...if confirmed then is allowed to use this FilterWidget - } - } - - return $isAllowed; + return $this->_ci->permissionlib->hasAtLeastOne($rq, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE); } /** diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index 8b10678da..11002d9a9 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -204,4 +204,38 @@ class PermissionLib return $checkPermissions; } + + /** + * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs to the authenticated user + * It checks the given permissions against a given method (controller method name) and a given permission type (R and/or W) + */ + public function hasAtLeastOne($requiredPermissions, $method, $permissionType) + { + $isAllowed = false; // by default is NOT allowed + + // If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget + if ($requiredPermissions != null) + { + // If requiredPermissions is NOT an array then converts it to an array + if (!is_array($requiredPermissions)) + { + $requiredPermissions = array($requiredPermissions); + } + + // Checks if at least one of the permissions given as parameter belongs to the authenticated user... + for ($p = 0; $p < count($requiredPermissions); $p++) + { + $isAllowed = $this->_ci->permissionlib->isEntitled( + array( + $method => $requiredPermissions[$p].':'.$permissionType + ), + $method + ); + + if ($isAllowed === true) break; // ...if confirmed then is allowed to use this FilterWidget + } + } + + return $isAllowed; + } } diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 384486c0f..52a56e140 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -2,7 +2,7 @@ $APP = 'infocenter'; $NOTBEFORE = '2018-03-01 18:00:00'; - + $filterWidgetArray = array( 'query' => ' SELECT diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 55b79bedd..219c5a103 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -59,7 +59,7 @@ class FilterWidget extends Widget $this->_initFilterWidget($args); // checks parameters and initialize properties // Let's start if it's allowed - // NOTE: If it is NOT allowed then no date are loaded + // NOTE: If it is NOT allowed then no data are loaded if ($this->filterslib->isAllowed($this->_requiredPermissions)) $this->_startFilterWidget(); } From 845975ebfe506c4e262a45cfe1e87317c70e428a Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 29 Jun 2018 12:02:05 +0200 Subject: [PATCH 29/48] Method hasAtLeastOne of PermissionLib can check permissions with a fixed given permission type or retrive the permission type from each element of the requiredPermissions array --- application/libraries/PermissionLib.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index 11002d9a9..fa7363710 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -208,8 +208,9 @@ class PermissionLib /** * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs to the authenticated user * It checks the given permissions against a given method (controller method name) and a given permission type (R and/or W) + * If the $permissionType is not given then it is assumed that is already present inside requiredPermissions */ - public function hasAtLeastOne($requiredPermissions, $method, $permissionType) + public function hasAtLeastOne($requiredPermissions, $method, $permissionType = null) { $isAllowed = false; // by default is NOT allowed @@ -225,9 +226,15 @@ class PermissionLib // Checks if at least one of the permissions given as parameter belongs to the authenticated user... for ($p = 0; $p < count($requiredPermissions); $p++) { + $pt = ''; // by default the permission is alredy present in $requiredPermissions[$p] + if ($permissionType != null) // if is it given as parameter + { + $pt = self::PERMISSION_SEPARATOR.$permissionType; // then build the permission type string + } + $isAllowed = $this->_ci->permissionlib->isEntitled( array( - $method => $requiredPermissions[$p].':'.$permissionType + $method => $requiredPermissions[$p].$pt ), $method ); From 9ff3eeff75fe63c48789fe4e710349036cf309c1 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 29 Jun 2018 12:31:45 +0200 Subject: [PATCH 30/48] - PermissionLib uses isEmptyArray, added comments - Added requiredPermissions property to the navigation array in the config navigation.php - Added constant PERMISSION_NAVIGATION_METHOD to NavigationLib - Added parameter and array element requiredPermissions to method oneLevel of NavigationLib - Renamed method _sortArray to _sortNavigationArray in NavigationLib - Added private method _rmNotAllowedEntries to NavigationLib to remove menu entries that the logged user is not allow to use --- application/config/navigation.php | 12 +++-- application/libraries/NavigationLib.php | 70 +++++++++++++++++++++---- application/libraries/PermissionLib.php | 3 +- 3 files changed, 70 insertions(+), 15 deletions(-) diff --git a/application/config/navigation.php b/application/config/navigation.php index 485f8a3d9..7f1b29932 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -15,7 +15,8 @@ $config['navigation_header'] = array( 'link' => base_url('vilesci'), 'icon' => '', 'description' => 'Vilesci', - 'sort' => 2 + 'sort' => 2, + 'requiredPermissions' => 'basis/vilesci:r' ), 'cis' => array( 'link' => CIS_ROOT, @@ -57,7 +58,8 @@ $config['navigation_menu']['Vilesci/index'] = array( 'icon' => 'info', 'description' => 'Infocenter', 'expand' => true, - 'sort' => 2 + 'sort' => 2, + 'requiredPermissions' => 'infocenter:r' ), ) ), @@ -73,14 +75,16 @@ $config['navigation_menu']['Vilesci/index'] = array( 'icon' => '', 'description' => 'Vilesci', 'expand' => true, - 'sort' => 1 + 'sort' => 1, + 'requiredPermissions' => 'basis/vilesci:r' ), 'extensions' => array( 'link' => site_url('system/extensions/Manager'), 'icon' => 'cubes', 'description' => 'Extensions Manager', 'expand' => true, - 'sort' => 2 + 'sort' => 2, + 'requiredPermissions' => 'admin:r' ) ) ) diff --git a/application/libraries/NavigationLib.php b/application/libraries/NavigationLib.php index ceeddca52..1b15943ea 100644 --- a/application/libraries/NavigationLib.php +++ b/application/libraries/NavigationLib.php @@ -19,6 +19,8 @@ class NavigationLib const NAVIGATION_PAGE_PARAM = 'navigation_page'; // Navigation page parameter name + const PERMISSION_NAVIGATION_METHOD = 'NavigationWidget'; // Name for fake method to be checked by the PermissionLib + private $_ci; // Code igniter instance private $_navigationPage; // unique id for this navigation widget @@ -67,7 +69,7 @@ class NavigationLib public function oneLevel( $description, $link = '#', $children = null, $icon = '', $expand = false, $subscriptDescription = null, $subscriptLinkClass = null, $subscriptLinkValue = null, $target = '', - $sort = null) + $sort = null, $requiredPermissions = null) { return array( 'description' => $description, @@ -79,7 +81,8 @@ class NavigationLib 'subscriptDescription' => $subscriptDescription, 'subscriptLinkClass' => $subscriptLinkClass, 'subscriptLinkValue' => $subscriptLinkValue, - 'sort' => $sort + 'sort' => $sort, + 'requiredPermissions' => $requiredPermissions ); } @@ -208,7 +211,7 @@ class NavigationLib { $navigationArray = array(); - if (isset($navigationPage)) + if (isset($navigationPage)) // if the current page name is given { // Load Header Entries of Core $configArray = $this->_ci->config->item($configName); @@ -219,6 +222,7 @@ class NavigationLib if (hasData($extensions)) { $extensionArray = array(); + foreach ($extensions->retval as $ext) { $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME; @@ -226,6 +230,7 @@ class NavigationLib { unset($config); include($filename); + if (isset($config[$configName]) && is_array($config[$configName])) { $extensionArray = array_merge_recursive( @@ -236,6 +241,7 @@ class NavigationLib } } } + $navigationArray = array_merge_recursive($navigationArray, $extensionArray); } @@ -246,7 +252,9 @@ class NavigationLib } } - $this->_sortArray($navigationArray); + $this->_rmNotAllowedEntries($navigationArray); // remove not allowed menu entries + + $this->_sortNavigationArray($navigationArray); // sort menu entries return $navigationArray; } @@ -319,9 +327,9 @@ class NavigationLib /** * Sorts using the sort element present in the array */ - private function _sortArray(&$array) + private function _sortNavigationArray(&$navigationArray) { - uasort($array, function($a, $b) { + uasort($navigationArray, function($a, $b) { // If the element sort is not present then the default value is 999 $sortA = 999; @@ -335,13 +343,55 @@ class NavigationLib }); // Sort also the children - foreach ($array as $key => $value) + foreach ($navigationArray as $menuName => $singleMenu) { - if (isset($value['children']) && is_array($value['children']) && count($value['children']) > 0) + if (isset($singleMenu['children']) && !isEmptyArray($singleMenu['children'])) { - // NOTE: keep this way to give the element by reference, $value has a different reference! + // NOTE: keep this way to give the element by reference, $singleMenu has a different reference! // otherwise the children will not be sorted - $this->_sortArray($array[$key]['children']); // recursive call + $this->_sortNavigationArray($navigationArray[$menuName]['children']); // recursive call + } + } + } + + /** + * Remove menu entries that the logged user is not allow to use + */ + private function _rmNotAllowedEntries(&$navigationArray) + { + $this->_ci->load->library('PermissionLib'); // Load permission library + + if (isset($navigationArray)) // to avoid error in the foreach + { + // Loops through the navigation array + foreach ($navigationArray as $menuName => $singleMenu) + { + // If the property requiredPermissions is present is checked + if (isset($singleMenu['requiredPermissions'])) + { + // Checks if the logged uses has at least one of required permissions + $isAllowed = $this->_ci->permissionlib->hasAtLeastOne( + $singleMenu['requiredPermissions'], + self::PERMISSION_NAVIGATION_METHOD + ); + + // If the user is not allowed then this menu entry and its children (sub menus) are removed and not displayed + if (!$isAllowed) + { + unset($navigationArray[$menuName]); + } + } + // Otherwise this menu entry is displayed + + // If the menu entry was NOT removed, then checks if it has children (sub menus) to check them for permissions + // NOTE: used $navigationArray[$menuName] because could be removed by the previous unset command + // therefore $singleMenu is still set + if (isset($navigationArray[$menuName]) && isset($singleMenu['children']) && !isEmptyArray($singleMenu['children'])) + { + // NOTE: keep this way to give the element by reference, $value has a different reference! + // otherwise the children will not be checked correctly + $this->_rmNotAllowedEntries($navigationArray[$menuName]['children']); // recursive call + } } } } diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index fa7363710..980598d9b 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -129,7 +129,7 @@ class PermissionLib if (is_cli()) return true; // Checks if the parameter $requiredPermissions is set, is an array and contains at least one element - if (isset($requiredPermissions) && is_array($requiredPermissions) && count($requiredPermissions) > 0) + if (isset($requiredPermissions) && !isEmptyArray($requiredPermissions)) { // Checks if the given $requiredPermissions parameter contains the called method of the controller if (isset($requiredPermissions[$calledMethod])) @@ -209,6 +209,7 @@ class PermissionLib * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs to the authenticated user * It checks the given permissions against a given method (controller method name) and a given permission type (R and/or W) * If the $permissionType is not given then it is assumed that is already present inside requiredPermissions + * Wrapper method for isEntitled, it uses method to build an associative array of permissions having as key the method itself */ public function hasAtLeastOne($requiredPermissions, $method, $permissionType = null) { From 419e53a65682249b814e28003d18080925737efb Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 2 Jul 2018 17:40:22 +0200 Subject: [PATCH 31/48] - Changed filtersupdate to better divide filters for infocenter overview and freigegeben - Changed infocenterData to retrive overview filters - Changed infocenterFreigegebenData to retrive freigegeben filters - Changed InfoCenter controller to load overview and freigegeben filter's names into the left menu --- .../controllers/system/infocenter/InfoCenter.php | 10 +++++----- application/core/FHC_Controller.php | 2 +- application/libraries/FiltersLib.php | 12 ++++++------ application/models/content/Ampel_model.php | 2 +- .../views/system/infocenter/infocenterData.php | 2 +- .../infocenter/infocenterFreigegebenData.php | 2 +- system/filtersupdate.php | 16 ++++++++-------- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 25561c795..7a759f615 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -652,7 +652,7 @@ class InfoCenter extends FHC_Controller $listFiltersNotSent = array(); $listCustomFilters = array(); - $filtersSent = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterSentApplication%'); + $filtersSent = $this->FiltersModel->getFilterList('infocenter', 'overview', '%InfoCenterSentApplication%'); if (hasData($filtersSent)) { for ($filtersCounter = 0; $filtersCounter < count($filtersSent->retval); $filtersCounter++) @@ -663,7 +663,7 @@ class InfoCenter extends FHC_Controller } } - $filtersNotSent = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterNotSentApplication%'); + $filtersNotSent = $this->FiltersModel->getFilterList('infocenter', 'overview', '%InfoCenterNotSentApplication%'); if (hasData($filtersNotSent)) { for ($filtersCounter = 0; $filtersCounter < count($filtersNotSent->retval); $filtersCounter++) @@ -674,7 +674,7 @@ class InfoCenter extends FHC_Controller } } - $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'PersonActions', $this->_uid); + $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'overview', $this->_uid); if (hasData($customFilters)) { for ($filtersCounter = 0; $filtersCounter < count($customFilters->retval); $filtersCounter++) @@ -795,7 +795,7 @@ class InfoCenter extends FHC_Controller $listFilters = array(); $listCustomFilters = array(); - $filters = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterFreigegeben%'); + $filters = $this->FiltersModel->getFilterList('infocenter', 'freigegeben', '%InfoCenterFreigegeben%'); if (hasData($filters)) { for ($filtersCounter = 0; $filtersCounter < count($filters->retval); $filtersCounter++) @@ -806,7 +806,7 @@ class InfoCenter extends FHC_Controller } } - $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'PersonActions', $this->_uid); + $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'freigegeben', $this->_uid); if (hasData($customFilters)) { for ($filtersCounter = 0; $filtersCounter < count($customFilters->retval); $filtersCounter++) diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index e3bf558e1..f09df48f3 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -61,7 +61,7 @@ class FHC_Controller extends CI_Controller { $this->_controllerId = $this->input->get(self::FHC_CONTROLLER_ID); - if (!isset($this->_controllerId) || isEmptyString($this->_controllerId)) + if (isEmptyString($this->_controllerId)) { $this->_controllerId = uniqid(); // generate a unique id // Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 1cd7e7691..9e7e769eb 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -297,7 +297,7 @@ class FiltersLib $this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY)); $tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase); - if (isset($tmpFilterNamePhrase) && !isEmptyString($tmpFilterNamePhrase)) // if is not null or an empty string + if (!isEmptyString($tmpFilterNamePhrase)) // if is not null or an empty string { $filterName = $tmpFilterNamePhrase; } @@ -339,7 +339,7 @@ class FiltersLib $removeSelectedField = false; // Checks the parameter selectedField - if (isset($selectedField) && !isEmptyString($selectedField)) + if (!isEmptyString($selectedField)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -373,7 +373,7 @@ class FiltersLib $removeSelectedField = false; // Checks the parameter selectedField - if (isset($selectedField) && !isEmptyString($selectedField)) + if (!isEmptyString($selectedField)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -402,7 +402,7 @@ class FiltersLib $removeAppliedFilter = false; // Checks the parameter appliedFilter - if (isset($appliedFilter) && !isEmptyString($appliedFilter)) + if (!isEmptyString($appliedFilter)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -490,7 +490,7 @@ class FiltersLib $addFilter = false; // Checks the parameter filter - if (isset($filter) && !isEmptyString($filter)) + if (!isEmptyString($filter)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -533,7 +533,7 @@ class FiltersLib $saveCustomFilter = false; // by default returns a failure // Checks parameter customFilterDescription if not valid stop the execution - if (!isset($customFilterDescription) || isEmptyString($customFilterDescription)) + if (isEmptyString($customFilterDescription)) { return $saveCustomFilter; } diff --git a/application/models/content/Ampel_model.php b/application/models/content/Ampel_model.php index 4b8fab15a..c50025a12 100644 --- a/application/models/content/Ampel_model.php +++ b/application/models/content/Ampel_model.php @@ -50,7 +50,7 @@ class Ampel_model extends DB_Model */ public function execBenutzerSelect($benutzer_select) { - if (isset($benutzer_select) && !isEmptyString($benutzer_select)) + if (!isEmptyString($benutzer_select)) { return $this->execQuery($benutzer_select); } diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 06e29a44f..265b56cc2 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -306,7 +306,7 @@ ); $filterWidgetArray['app'] = $APP; - $filterWidgetArray['datasetName'] = 'PersonActions'; + $filterWidgetArray['datasetName'] = 'overview'; $filterWidgetArray['filterKurzbz'] = 'InfoCenterSentApplicationAll'; $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 145c2e323..4979d60bd 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -215,7 +215,7 @@ ); $filterWidgetArray['app'] = $APP; - $filterWidgetArray['datasetName'] = 'PersonActions'; + $filterWidgetArray['datasetName'] = 'freigegeben'; $filterWidgetArray['filterKurzbz'] = 'InfoCenterFreigegeben5days'; $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 7134b16bf..9166e9154 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -21,7 +21,7 @@ $filters = array( array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'overview', 'filter_kurzbz' => 'InfoCenterSentApplicationAll', 'description' => '{Alle}', 'sort' => 1, @@ -52,7 +52,7 @@ $filters = array( ), array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'overview', 'filter_kurzbz' => 'InfoCenterSentApplication3days', 'description' => '{"3 Tage keine Aktion"}', 'sort' => 2, @@ -89,7 +89,7 @@ $filters = array( ), array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'overview', 'filter_kurzbz' => 'InfoCenterNotSentApplicationAll', 'description' => '{Alle}', 'sort' => 1, @@ -124,7 +124,7 @@ $filters = array( ), array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'overview', 'filter_kurzbz' => 'InfoCenterNotSentApplication14Days', 'description' => '{"14 Tage keine Aktion"}', 'sort' => 3, @@ -164,7 +164,7 @@ $filters = array( ), array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'overview', 'filter_kurzbz' => 'InfoCenterSentApplicationLt3days', 'description' => '{"< 3 Tage"}', 'sort' => 3, @@ -201,7 +201,7 @@ $filters = array( ), array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'overview', 'filter_kurzbz' => 'InfoCenterNotSentApplication5DaysOnline', 'description' => '{"5 Tage keine BewAktion"}', 'sort' => 2, @@ -247,7 +247,7 @@ $filters = array( ), array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'freigegeben', 'filter_kurzbz' => 'InfoCenterFreigegeben5days', 'description' => '{"5 Tage Letzte Aktion"}', 'sort' => 1, @@ -277,7 +277,7 @@ $filters = array( ), array( 'app' => 'infocenter', - 'dataset_name' => 'PersonActions', + 'dataset_name' => 'freigegeben', 'filter_kurzbz' => 'InfoCenterFreigegebenAlle', 'description' => '{Alle}', 'sort' => 2, From 83f262f1709b100d9d9241dbede87887ac786bc7 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 5 Jul 2018 12:10:00 +0200 Subject: [PATCH 32/48] - Added helper language_helper to retrive the language of the logged user - FHC_Controller now loads also the language_helper - Added missing comments to Auth_Controller - Fixed comments of session_helper --- application/core/Auth_Controller.php | 4 +++ application/core/FHC_Controller.php | 3 ++ application/helpers/language_helper.php | 42 +++++++++++++++++++++++++ application/helpers/session_helper.php | 7 ----- 4 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 application/helpers/language_helper.php diff --git a/application/core/Auth_Controller.php b/application/core/Auth_Controller.php index 1af83ba2c..c3be8b4d9 100644 --- a/application/core/Auth_Controller.php +++ b/application/core/Auth_Controller.php @@ -48,6 +48,10 @@ class Auth_Controller extends FHC_Controller } } + /** + * Converts an array of permissions to a string that contains them as a comma separated list + * Ex: ", , " + */ private function _rpsToString($requiredPermissions, $method) { $strRequiredPermissions = ''; // string that contains all the required permissions needed to access to this method diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 1f51a72d7..b62d3f9b8 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -28,6 +28,9 @@ class FHC_Controller extends CI_Controller // Loads helper session to manage the php session $this->load->helper('session'); + + // Loads language helper + $this->load->helper('language'); } //------------------------------------------------------------------------------------------------------------------ diff --git a/application/helpers/language_helper.php b/application/helpers/language_helper.php new file mode 100644 index 000000000..cf6b94fe5 --- /dev/null +++ b/application/helpers/language_helper.php @@ -0,0 +1,42 @@ +load->model('person/Person_model', 'PersonModelLanguage'); + + $language = $ci->PersonModelLanguage->getLanguage(getAuthUID()); + } + + return $language; +} diff --git a/application/helpers/session_helper.php b/application/helpers/session_helper.php index e74468896..a0a8a60b9 100644 --- a/application/helpers/session_helper.php +++ b/application/helpers/session_helper.php @@ -10,13 +10,6 @@ * @since Version 1.0.0 */ -/** - * Message Helper - * - * @subpackage Helpers - * @category Helpers - */ - if (! defined('BASEPATH')) exit('No direct script access allowed'); // ------------------------------------------------------------------------------------------------------- From d08eb75b5a2129899c6db8ed25e508fb9c1c1a73 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 5 Jul 2018 12:13:02 +0200 Subject: [PATCH 33/48] Adapted MessageLib, PhrasesLib and UDFLib to use the function getUserLanguage from language_helper --- application/libraries/MessageLib.php | 12 ++++-------- application/libraries/PhrasesLib.php | 17 ++--------------- application/libraries/UDFLib.php | 8 ++++---- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/application/libraries/MessageLib.php b/application/libraries/MessageLib.php index 8d04b9824..ce03fe6dc 100644 --- a/application/libraries/MessageLib.php +++ b/application/libraries/MessageLib.php @@ -268,7 +268,7 @@ class MessageLib } /** - * sendMessageVorlage() - sends new internal message using a template + * Sends new internal message using a template */ public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true) { @@ -298,16 +298,12 @@ class MessageLib { $receiver_id = $receivers->retval[$i]->person_id; + // Checks if the receiver exists $result = $this->ci->PersonModel->load($receiver_id); if (hasData($result)) { - // Set the language with the global value - $sprache = DEFAULT_LANGUAGE; - // If the receiver has a prefered language use this - if (isset($result->retval[0]->sprache) && $result->retval[0]->sprache != '') - { - $sprache = $result->retval[0]->sprache; - } + // Retrives the language of the logged user + $sprache = getUserLanguage(); // Loads template data $result = $this->ci->vorlagelib->loadVorlagetext($vorlage_kurzbz, $oe_kurzbz, $orgform_kurzbz, $sprache); diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index 93250379b..88e79b467 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -242,21 +242,8 @@ class PhrasesLib $categories = array($categories); } - // Use the given language if present, otherwise retrives the language for the logged user - $language = DEFAULT_LANGUAGE; - if (count($parameters) == 2 && !isEmptyString($parameters[1]) && is_string($parameters[1])) - { - $language = $parameters[1]; - } - // Checks if the user is authenticated to retrive the users's language - // NOTE: this library could be called when the user is not logged in the system - // so this is why is checked if the function getAuthUID exists - elseif (function_exists('getAuthUID')) - { - $this->_ci->load->model('person/Person_model', 'PersonModel'); - - $language = $this->_ci->PersonModel->getLanguage(getAuthUID()); - } + // Retrives the language of the logged user + $language = getUserLanguage(count($parameters) == 2 ? $parameters[1] : null); // If only categories is not an empty array then loads phrases if (count($categories) > 0) $this->_setPhrases($categories, $language); diff --git a/application/libraries/UDFLib.php b/application/libraries/UDFLib.php index eeb546ae3..1e46eaade 100644 --- a/application/libraries/UDFLib.php +++ b/application/libraries/UDFLib.php @@ -711,7 +711,7 @@ class UDFLib || isset($jsonSchema->{UDFLib::TITLE}) || isset($jsonSchema->{UDFLib::PLACEHOLDER})) { - // Loads PhrasesLib + // Loads phrases library $this->_ci->load->library('PhrasesLib'); // If is set the label property in the json schema @@ -720,7 +720,7 @@ class UDFLib // Load the related phrase $tmpResult = $this->_ci->phraseslib->getPhrases( UDFLib::PHRASES_APP_NAME, - DEFAULT_LANGUAGE, + getUserLanguage(), $jsonSchema->{UDFLib::LABEL}, null, null, @@ -738,7 +738,7 @@ class UDFLib // Load the related phrase $tmpResult = $this->_ci->phraseslib->getPhrases( UDFLib::PHRASES_APP_NAME, - DEFAULT_LANGUAGE, + getUserLanguage(), $jsonSchema->{UDFLib::TITLE}, null, null, @@ -756,7 +756,7 @@ class UDFLib // Load the related phrase $tmpResult = $this->_ci->phraseslib->getPhrases( UDFLib::PHRASES_APP_NAME, - DEFAULT_LANGUAGE, + getUserLanguage(), $jsonSchema->{UDFLib::PLACEHOLDER}, null, null, From c6f1b7beca54b0ad2a9555c9281012f91be75e06 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 5 Jul 2018 17:14:29 +0200 Subject: [PATCH 34/48] 't' method of FHC_PhrasesLib now replace '{}' with '' --- public/js/PhrasesLib.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/public/js/PhrasesLib.js b/public/js/PhrasesLib.js index d8c67d4f8..64b10759d 100644 --- a/public/js/PhrasesLib.js +++ b/public/js/PhrasesLib.js @@ -19,12 +19,13 @@ var FHC_PhrasesLib = { /** * Returns the phrase-text in the user's language + * NOTE: the parameter params is an object since associative arrays are NOT supported in JS * @param {String} category : phrase-category * @param {String} phrase : phrase-name - * @param {array} params : String-parameters to be set in variables in phrasentext + * @param {Object} params : parameters to be replaced instead of {} in phraseObj.text * @returns {String} : phrase-text */ - t: function (category, phrase, params = []) { + t: function(category, phrase, params = {}) { // Checks if FHC_JS_PHRASES_STORAGE_OBJECT is an array if ($.isArray(FHC_JS_PHRASES_STORAGE_OBJECT)) @@ -41,11 +42,11 @@ var FHC_PhrasesLib = { && phraseObj.text.trim() != '') { // If params is null or not an array - if (params == null || (params != null && !$.isArray(params))) + if (params == null) { - params = []; + params = {}; } - + return FHC_PhrasesLib._replacePhraseVariable(phraseObj.text, params); // parsing } } @@ -59,15 +60,21 @@ var FHC_PhrasesLib = { /** * Returns phrase with variables being replaced + * NOTE: params is an object but here is treat as an associative array, not that much orthodox but it works fine ;) * @param {String} phrase : phrasen-text (with one ore more variables) - * @param {array} replaceStringArr : String-array to be set in variables in phrasentext (order matters) + * @param {Object} params : parameters to be replaced instead of {} in phrase * @returns {String} : replaced phrasen-text */ - _replacePhraseVariable: function (phrase, replaceStringArr) { - for (var i = 0; i < replaceStringArr.length; i++) + _replacePhraseVariable: function(phrase, params) { + + // Loops + for (var paramName in params) { - phrase = phrase.replace(/\{(.*?)\}/, replaceStringArr[i]); + var paramValue = params[paramName]; + + phrase = phrase.replace('{' + paramName + '}', paramValue); } + return phrase; } }; From 6791f58cb2b79ca9dae65acf4aa88e06537e65cf Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 6 Jul 2018 13:30:19 +0200 Subject: [PATCH 35/48] - Renamed the class veil to fhc-ajaxclient-veil in AjaxLib.css - Added new classes to AjaxLib.css to configure the new error dialog box - Adapted AjaxLib.js to use the class fhc-ajaxclient-veil - Added a new private method _defaultErrorCallback to AjaxLib.js - Now if an errorCallback function is not given when AjaxLib.js is used, then _defaultErrorCallback is used as fallback --- public/css/AjaxLib.css | 25 +++++++++++++++- public/js/AjaxLib.js | 66 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 85 insertions(+), 6 deletions(-) diff --git a/public/css/AjaxLib.css b/public/css/AjaxLib.css index 61c9f9234..46711a2d9 100644 --- a/public/css/AjaxLib.css +++ b/public/css/AjaxLib.css @@ -1,4 +1,4 @@ -.veil { +.fhc-ajaxclient-veil { position: absolute; z-index: 9999; top: 0; @@ -11,3 +11,26 @@ background-repeat: no-repeat; background-position: center; } + +.fhc-ajaxclient-error-td { + padding-right: 10px; +} + +.no-close .ui-dialog-titlebar-close { + display: none; +} + +.ui-dialog-buttonset { + padding-top: 10px; + width: 100%; + text-align: center; +} + +.ui-dialog-buttonset button { + width: 50%; + font-weight: bold; +} + +.ui-front { + z-index: 9999; +} diff --git a/public/js/AjaxLib.js b/public/js/AjaxLib.js index bd2b22689..ae5edbc5b 100644 --- a/public/js/AjaxLib.js +++ b/public/js/AjaxLib.js @@ -128,7 +128,7 @@ var FHC_AjaxClient = { * Retrives error message from response object */ getError: function(response) { - var error = 'Generic error'; + var error = "Generic error"; if (jQuery.type(response) == "object" && !jQuery.isEmptyObject(response) && response.hasOwnProperty(RESPONSE)) { @@ -182,13 +182,13 @@ var FHC_AjaxClient = { */ getUrlParameter: function(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), - sURLVariables = sPageURL.split('&'), + sURLVariables = sPageURL.split("&"), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { - sParameterName = sURLVariables[i].split('='); + sParameterName = sURLVariables[i].split("="); if (sParameterName[0] === sParam) { @@ -265,6 +265,57 @@ var FHC_AjaxClient = { this._errorCallback(jqXHR, textStatus, errorThrown); }, + /** + * If an error callback is not given, this is the default error callback that is used + * to display useful info about the occurred error. It uses the JQuery UI dialog + */ + _defaultErrorCallback: function(jqXHR, textStatus, errorThrown) { + + // Row table format + var tableRowFormat = "%1s: %2s"; + var strDivDialog = "
"; // dialog div and open the error table + + // If textStatus is usable then place it in the table + if (textStatus != null) strDivDialog += tableRowFormat.replace(/%1s/g, "Error").replace(/%2s/g, textStatus); + + // If errorThrown is usable then place it in the table + if (errorThrown != null) strDivDialog += tableRowFormat.replace(/%1s/g, "Error text").replace(/%2s/g, errorThrown); + + // If jqXHR.status is usable then place it in the table + if (jqXHR != null && jqXHR.hasOwnProperty("status")) + { + strDivDialog += tableRowFormat.replace(/%1s/g, "HTTP status").replace(/%2s/g, jqXHR.status); + } + + // If jqXHR.responseText is usable then place it in the table + if (jqXHR != null && jqXHR.hasOwnProperty("responseText")) + { + strDivDialog += tableRowFormat.replace(/%1s/g, "HTTP response").replace(/%2s/g, jqXHR.responseText); + } + + strDivDialog += "
"; // close table and div + + $(strDivDialog).appendTo("body"); // append the dialog div to the body + + // Dialog definition + $("#fhc-ajaxclient-dialog").dialog({ + title: "Error occurred", + dialogClass: "no-close", + autoOpen: true, + modal: true, + resizable: false, + height: "auto", + width: 700, + closeOnEscape: false, + buttons: [{ + text: "Ok", + click: function() { + $(this).dialog("close"); + } + }] + }); + }, + /** * Instantiate a new object and copy in it the properties from the parameter */ @@ -285,7 +336,7 @@ var FHC_AjaxClient = { _showVeil: function() { if (FHC_AjaxClient._veilCallersCounter == 0) { - $("
").appendTo('body'); + $("
").appendTo("body"); } FHC_AjaxClient._veilCallersCounter++; @@ -305,7 +356,7 @@ var FHC_AjaxClient = { if (FHC_AjaxClient._veilCallersCounter == 0) { - $(".veil").remove(); + $(".fhc-ajaxclient-veil").remove(); } } }, @@ -388,6 +439,11 @@ var FHC_AjaxClient = { valid = false; } } + else // if is not given then call the default errorCallback + { + ajaxParameters._errorCallback = FHC_AjaxClient._defaultErrorCallback; // save as property the callback error + ajaxParameters.error = FHC_AjaxClient._onError; // function to call if an error occurred + } // If present, successCallback must be a function if (ajaxCallParameters.hasOwnProperty("successCallback")) From 4a29c03c399407b02e6fd1f5497e83d738a067bf Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 9 Jul 2018 11:24:01 +0200 Subject: [PATCH 36/48] - Added private _onComplete method to AjaxLib that calls the eventually given completeCallback and hides the veil - Changed method _checkAndGenerateAjaxParams to add the possibility to give a completeCallback function as parameter of the Ajax call --- public/js/AjaxLib.js | 48 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/public/js/AjaxLib.js b/public/js/AjaxLib.js index ae5edbc5b..0759f1f60 100644 --- a/public/js/AjaxLib.js +++ b/public/js/AjaxLib.js @@ -260,11 +260,30 @@ var FHC_AjaxClient = { FHC_AjaxClient._printDebug(this._data, null, errorThrown); // debug time! - // Call the error callback saved in _errorCallback property - // NOTE: this is not referred to FHC_AjaxClient but to the ajax object + // Call the error callback saved in _errorCallback property + // NOTE: this is not referred to FHC_AjaxClient but to the ajax object this._errorCallback(jqXHR, textStatus, errorThrown); }, + /** + * Method to call after the ajax call has ended + */ + _onComplete: function(jqXHR, textStatus) { + + FHC_AjaxClient._printDebug(this._data, null, jqXHR.responseJSON); // debug time! + + // Call the complete callback if it was saved in the _completeCallback property + // NOTE: this is not referred to FHC_AjaxClient but to the ajax object. + // It's known that it's a function because it was already checked before in the + // _checkAndGenerateAjaxParams method + if (this.hasOwnProperty("_completeCallback")) + { + this._completeCallback(jqXHR, textStatus); + } + + FHC_AjaxClient._hideVeil(); // finally hide the veil + }, + /** * If an error callback is not given, this is the default error callback that is used * to display useful info about the occurred error. It uses the JQuery UI dialog @@ -460,14 +479,27 @@ var FHC_AjaxClient = { } } - // If present, veilTimeout must be a number and cannot be less then 0 or greater then 60000 - if (ajaxCallParameters.hasOwnProperty("veilTimeout") && typeof ajaxCallParameters.veilTimeout == "number") + // If present, completeCallback must be a function + if (ajaxCallParameters.hasOwnProperty("completeCallback")) { + if (typeof ajaxCallParameters.completeCallback == "function") + { + ajaxParameters._completeCallback = ajaxCallParameters.completeCallback; // save as property the callback complete + } + else + { + console.error("Invalid completeCallback, it must be a function"); + valid = false; + } + } + + // If present, veilTimeout must be a number and cannot be less then 0 or greater then 60000 + if (ajaxCallParameters.hasOwnProperty("veilTimeout") && typeof ajaxCallParameters.veilTimeout == "number") + { if (ajaxCallParameters.veilTimeout > 0 && ajaxCallParameters.veilTimeout < 60000) { ajaxParameters._veilTimeout = ajaxCallParameters.veilTimeout; ajaxParameters.beforeSend = FHC_AjaxClient._showVeil; - ajaxParameters.complete = FHC_AjaxClient._hideVeil; } else if(ajaxCallParameters.veilTimeout == 0) { @@ -478,13 +510,15 @@ var FHC_AjaxClient = { console.error("Invalid veilTimeout parameter, must be a number >= 0 and <= 60000"); valid = false; } - } + } else // is not present or the value is invalid { ajaxParameters._veilTimeout = VEIL_TIMEOUT; ajaxParameters.beforeSend = FHC_AjaxClient._showVeil; - ajaxParameters.complete = FHC_AjaxClient._hideVeil; } + + // Function to call after the ajax call is ended, is it here because it must be always called + ajaxParameters.complete = FHC_AjaxClient._onComplete; } if (valid === false) From 5b1d801a325a8df07c1c9772da959c3fc20b2be9 Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 9 Jul 2018 12:15:19 +0200 Subject: [PATCH 37/48] NavigationWidget: implemented drop down menu in the header menu --- public/css/NavigationWidget.css | 1 - public/js/NavigationWidget.js | 78 +++++++++++++++++++++++---------- 2 files changed, 55 insertions(+), 24 deletions(-) diff --git a/public/css/NavigationWidget.css b/public/css/NavigationWidget.css index b6d6c800e..0baaa684a 100644 --- a/public/css/NavigationWidget.css +++ b/public/css/NavigationWidget.css @@ -41,7 +41,6 @@ padding-right: 20px; padding-left: 7px; font-size: 18px; - line-height: 20px; } .navbar-brand-icon { diff --git a/public/js/NavigationWidget.js b/public/js/NavigationWidget.js index ee9adb83d..4e388db23 100644 --- a/public/js/NavigationWidget.js +++ b/public/js/NavigationWidget.js @@ -32,7 +32,7 @@ var FHC_NavigationWidget = { if (FHC_AjaxClient.hasData(data)) { - var strHeaderMenu = ''; + var strHeaderMenu = ""; jQuery.each(FHC_AjaxClient.getData(data), function(i, e) { if (e != null) strHeaderMenu += FHC_NavigationWidget._buildHeaderMenuStructure(e); @@ -63,7 +63,7 @@ var FHC_NavigationWidget = { { FHC_NavigationWidget._printCollapseIcon(); // Applies bootstrap SB Admin 2 theme elements to the left menu - var strLeftMenu = ''; + var strLeftMenu = ""; // Builds left menu jQuery.each(FHC_AjaxClient.getData(data), function(i, e) { @@ -140,17 +140,49 @@ var FHC_NavigationWidget = { */ _buildHeaderMenuStructure: function(item) { - var strHeaderMenu = ''; + var strHeaderMenu = ""; - if (item['icon'] != 'undefined' && item['icon'] != '') + if (item["icon"] != "undefined" && item["icon"] != "") { - strHeaderMenu += ''; + strHeaderMenu += ''; } - var target = ''; - if (item['target'] != null) target = item['target']; + if (item["children"] != null && Object.keys(item["children"]).length > 0) + { + strHeaderMenu += '' + item['description'] + ''; + var target = ""; + if (item["target"] != null) target = item["target"]; + + if (item["children"] != null && Object.keys(item["children"]).length > 0) + { + strHeaderMenu += item["description"] + " "; + strHeaderMenu += ''; + strHeaderMenu += ''; + } + else + { + strHeaderMenu += '' + item["description"] + ''; + } return strHeaderMenu; }, @@ -161,45 +193,45 @@ var FHC_NavigationWidget = { _buildLeftMenuStructure: function(item, depth = 1) { strLeftMenu = ""; - var expanded = item['expand'] != null && item['expand'] === true ? ' active' : ''; + var expanded = item["expand"] != null && item["expand"] === true ? ' active' : ""; strLeftMenu += '
  • '; - if (item['subscriptLinkClass'] != null && item['subscriptDescription'] != null) + if (item["subscriptLinkClass"] != null && item["subscriptDescription"] != null) { strLeftMenu += ''; } - var target = ''; - if (item['target'] != null) target = item['target']; + var target = ""; + if (item["target"] != null) target = item["target"]; - strLeftMenu += ''; + strLeftMenu += ''; - if (item['icon'] != 'undefined') + if (item["icon"] != "undefined") { - strLeftMenu += ' '; + strLeftMenu += ' '; } - strLeftMenu += item['description']; + strLeftMenu += item["description"]; - if (item['children'] != null && Object.keys(item['children']).length > 0) + if (item["children"] != null && Object.keys(item["children"]).length > 0) { strLeftMenu += ''; } strLeftMenu += ''; - if (item['subscriptLinkClass'] != null && item['subscriptDescription'] != null) + if (item["subscriptLinkClass"] != null && item["subscriptDescription"] != null) { - strLeftMenu += '' + - ' (' + item['subscriptDescription'] + ')' + + strLeftMenu += '' + + ' (' + item["subscriptDescription"] + ')' + ''; strLeftMenu += ''; } - if (item['children'] != null && Object.keys(item['children']).length > 0) + if (item["children"] != null && Object.keys(item["children"]).length > 0) { - var level = ''; + var level = ""; if (depth === 1) { level = 'second'; @@ -211,7 +243,7 @@ var FHC_NavigationWidget = { strLeftMenu += '