From a5fae5f07fd384f93d4b78fee471075de69c4f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 8 Jan 2020 16:16:49 +0100 Subject: [PATCH] =?UTF-8?q?Lehrauftragsverwaltung=20-=20Berechtigungspr?= =?UTF-8?q?=C3=BCfung=20beim=20Akzeptieren=20von=20Lehrauftr=C3=A4gen=20an?= =?UTF-8?q?gepasst=20wenn=20Lektor=20mehrere=20Accounts=20besitzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lehrauftrag/LehrauftragAkzeptieren.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/application/controllers/lehre/lehrauftrag/LehrauftragAkzeptieren.php b/application/controllers/lehre/lehrauftrag/LehrauftragAkzeptieren.php index 31e2ffb31..cc37eb9ec 100644 --- a/application/controllers/lehre/lehrauftrag/LehrauftragAkzeptieren.php +++ b/application/controllers/lehre/lehrauftrag/LehrauftragAkzeptieren.php @@ -131,7 +131,16 @@ class LehrauftragAkzeptieren extends Auth_Controller if ($result = getData($this->BenutzerModel->getFromPersonId($result[0]->person_id))) { // * finally check uid of contract against the logged in user - if ($result[0]->uid != $this->_uid) + $account_found = false; + foreach($result as $row_accounts) + { + if($row_accounts->uid == $this->_uid) + { + $account_found = true; + } + } + + if (!$account_found) { show_error('Keine Berechtigung für diesen Vertrag'); } @@ -148,7 +157,7 @@ class LehrauftragAkzeptieren extends Auth_Controller // Set status to accepted $result = $this->VertragvertragsstatusModel->setStatus($vertrag_id, $this->_uid, 'akzeptiert'); - + if ($result->retval) { $json []= array( @@ -165,7 +174,7 @@ class LehrauftragAkzeptieren extends Auth_Controller } } } - + /** * Check if lectors latest active Verwendung has inkludierte Lehre * - inkludierte_lehre is null OR 0: freelancer lector -> has NO inkludierte Lehre @@ -175,7 +184,7 @@ class LehrauftragAkzeptieren extends Auth_Controller public function checkInkludierteLehre() { $result = $this->BisverwendungModel->getLast($this->_uid); - + if (hasData($result)) { $this->outputJsonSuccess(!is_null($result->retval[0]->inkludierte_lehre) && $result->retval[0]->inkludierte_lehre != 0);