commit - 93ff5b3b4968a9984a652c7fd6aee5ba1663dec5
commit + cfd90730c4ec4e3a108a3bb5d7d40cd7450635c4
blob - 1bf4bcbb5a664039e9298468a2143221891ffa0c
blob + 140bc46a870319fee447ffdbd67b20cc4d0ba767
--- module/Securitx/src/Controller/SecuritxController.php
+++ module/Securitx/src/Controller/SecuritxController.php
$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);
$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) {
'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
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;
$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
'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
<hr class="my-4">
<p>
-<?php if (!$has_admin) { ?>
+<?php
+ if ($has_domain && !$member->is_admin) {
+ if ($member->r_admin && !$member->is_admin) {
+ echo "<span class='a a-pad'>Administrator rights have been requested</span>";
+ } else if (!$member->r_admin && !$member->is_admin) {
+?>
+
<a class="a a-pad" href="/securitx/requestadmin/<?= $member->u_key ?>">Request administration rights</a>
<?php
- if (!$has_editor) {
+ if (!$member->r_editor && !$member->r_admin) {
?>
| <a class="a a-pad" href="/securitx/requesteditor/<?= $member->u_key ?>">Request editor rights</a>
+
<?php
+ } else if ($member->r_editor && !$member->is_editor && !$member->is_admin) {
+ echo "|<span class='a a-pad'>Editor rights have been requested</span>";
+ }
}
- } ?>
+ }
+?>
</p>
</div>