commit 3e92a084b05fdfd65f262c90d428ed390e0a8719 from: Tracey Emery date: Mon May 16 21:45:37 2022 UTC restrict editors to only being able to invite to their company commit - 7bf8fa1d7712b159fcfd53495101288b30d71f1c commit + 3e92a084b05fdfd65f262c90d428ed390e0a8719 blob - c2838de859d2c8508183d476deb78a081d4b9c71 blob + f689396744a085d3e3fb6d0bcb3575572aa42815 --- module/Securitx/src/Controller/SecuritxController.php +++ module/Securitx/src/Controller/SecuritxController.php @@ -485,7 +485,13 @@ ret: $inviter_id = $member->id; $m_key = $member->u_key; $form = new MemberForm('invite', $this->recaptcha); - $companies = $this->company_table->fetchAll(); + if ($member->is_admin) + $companies = $this->company_table->fetchAll(); + else { + $companies = $this->company_table->getCCompany( + $member->company_id + ); + } $request = $this->getRequest(); if (!$request->isPost()) { blob - 2f17095928e078a5206f7637bb099c9a436e15d3 blob + 5cde3614267e29b791eb70b8f9637248f978c2ed --- module/Securitx/src/Model/CompanyTable.php +++ module/Securitx/src/Model/CompanyTable.php @@ -16,6 +16,9 @@ class CompanyTable { public function getCount() { return $this->tableGateway->select()->count(); } + public function getCCompany($id) { + return $this->tableGateway->select(['company_id' => $id]); + } public function getCompany($id) { $id = (int)$id; $rowset = $this->tableGateway->select(['company_id' => $id]);