From e8bec1ebf5cf22c1158a680716eb2fdb8d8ca279 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 21 Mar 2018 15:33:39 +0100 Subject: [PATCH] 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');