commit cfd90730c4ec4e3a108a3bb5d7d40cd7450635c4 from: Tracey Emery date: Fri May 6 22:48:19 2022 UTC fix up request links for same domain members commit - 93ff5b3b4968a9984a652c7fd6aee5ba1663dec5 commit + cfd90730c4ec4e3a108a3bb5d7d40cd7450635c4 blob - 1bf4bcbb5a664039e9298468a2143221891ffa0c blob + 140bc46a870319fee447ffdbd67b20cc4d0ba767 --- module/Securitx/src/Controller/SecuritxController.php +++ module/Securitx/src/Controller/SecuritxController.php @@ -408,9 +408,6 @@ class SecuritxController extends AbstractActionControl $member->moddate = time(); $this->member_table->saveMember($member); - $has_admin = 1; - $has_editor = 1; - /* check member domain */ $company = $this->company_table->getCompany($member->company_id); @@ -420,12 +417,6 @@ class SecuritxController extends AbstractActionControl $has_domain = 1; else $has_domain = 0; - if ($has_domain) { - if (!$member->is_admin) - $has_admin = 0; - if (!$member->is_editor) - $has_editor = 0; - } $inviter = ""; if ($member->inviter) { @@ -444,9 +435,8 @@ class SecuritxController extends AbstractActionControl 'company' => $company->name, 'c_downloads' => $c_has_downloads, 'inviter' => $inviter, - 'has_admin' => $has_admin, - 'has_editor' => $has_editor, - 'has_downloads' => $has_downloads + 'has_downloads' => $has_downloads, + 'has_domain' => $has_domain ]); } public function indexAction() { blob - f7e5bd1593c6352c640bdeea27c6d6e36062567a blob + 414e95a954bab674ce7e88ebb69d91722cb8fa32 --- module/Securitx/src/Model/Member.php +++ module/Securitx/src/Model/Member.php @@ -20,9 +20,11 @@ class Member implements InputFilterAwareInterface { public $u_key; public $verified; public $moddate; - public $inviter; public $is_admin; public $is_editor; + public $inviter; + public $r_admin; + public $r_editor; public $ip_address; public $company_id; @@ -38,9 +40,11 @@ class Member implements InputFilterAwareInterface { $this->u_key = !empty($data['u_key']) ? $data['u_key'] : null; $this->verified = !empty($data['verified']) ? $data['verified'] : null; $this->moddate = !empty($data['moddate']) ? $data['moddate'] : null; - $this->inviter = !empty($data['inviter']) ? $data['inviter'] : null; $this->is_admin = !empty($data['is_admin']) ? $data['is_admin'] : 0; $this->is_editor = !empty($data['is_editor']) ? $data['is_editor'] : 0; + $this->inviter = !empty($data['inviter']) ? $data['inviter'] : null; + $this->r_admin = !empty($data['r_admin']) ? $data['r_admin'] : 0; + $this->r_editor = !empty($data['r_editor']) ? $data['r_editor'] : 0; $this->ip_address = !empty($data['ip_address']) ? $data['ip_address'] : 0; $this->company_id = !empty($data['company_id']) ? $data['company_id'] : null; } blob - 3c23f2b454a09ad2ab5e3ef30211dae36ed63012 blob + 7a691a00881e86d261706f4df2c7825918a435ad --- module/Securitx/src/Model/MemberTable.php +++ module/Securitx/src/Model/MemberTable.php @@ -68,9 +68,11 @@ class MemberTable { 'u_key' => $member->u_key, 'verified' => $member->verified, 'moddate' => time(), - 'inviter' => $member->inviter, 'is_admin' => $member->is_admin, 'is_editor' => $member->is_editor, + 'inviter' => $member->inviter, + 'r_admin' => $member->r_admin, + 'r_editor' => $member->r_editor, 'ip_address' => $member->ip_address, 'company_id' => intval($member->company_id), ]; blob - 434a32ccba24dbf7401d5f26718f5f266854386f blob + 891c6fa1270a066fc021d6cde5fae1ead4ee69fa --- module/Securitx/view/securitx/home/home.phtml +++ module/Securitx/view/securitx/home/home.phtml @@ -36,14 +36,25 @@

- +is_admin) { + if ($member->r_admin && !$member->is_admin) { + echo "Administrator rights have been requested"; + } else if (!$member->r_admin && !$member->is_admin) { +?> + Request administration rights r_editor && !$member->r_admin) { ?> | Request editor rights + r_editor && !$member->is_editor && !$member->is_admin) { + echo "|Editor rights have been requested"; + } } - } ?> + } +?>