optimize logic
这个提交包含在:
父节点
92187a26ac
当前提交
bdb6cc028d
|
@ -219,15 +219,25 @@ class PermissionsHook implements
|
|||
|
||||
// Adjust user groups
|
||||
if ($rnrsHashVerified) {
|
||||
// If hash verified, and not in the confirmed group, add to confirmed group
|
||||
if ($rnrsEnabledConfirmedGroup && !$rnrsInConfirmedGroup) {
|
||||
$this->addGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = true;
|
||||
// If hash verified, and not in the confirmed group,
|
||||
// add to confirmed group
|
||||
if (!$rnrsInConfirmedGroup) {
|
||||
if ($rnrsEnabledConfirmedGroup) {
|
||||
$this->addGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = true;
|
||||
} else if ($rnrsEnabledExemptGroup) {
|
||||
$this->addGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = true;
|
||||
}
|
||||
}
|
||||
} else if ($rnrsInExemptGroup || $rnrsInOtherExemptedGroups) {
|
||||
if ($rnrsEnabledConfirmedGroup && !$rnrsInConfirmedGroup) {
|
||||
$this->removeGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = false;
|
||||
// If verify exempted, hash not verified, but in the confirmed group,
|
||||
// remove from confirmed group
|
||||
if ($rnrsInConfirmedGroup) {
|
||||
if ($rnrsEnabledConfirmedGroup) {
|
||||
$this->removeGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -291,15 +301,25 @@ class PermissionsHook implements
|
|||
|
||||
// Adjust user groups
|
||||
if ($rnrsHashVerified) {
|
||||
// If hash verified, and not in the confirmed group, add to confirmed group
|
||||
if ($rnrsEnabledConfirmedGroup && !$rnrsInConfirmedGroup) {
|
||||
$this->addGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = true;
|
||||
// If hash verified, and not in the confirmed group,
|
||||
// add to confirmed group
|
||||
if (!$rnrsInConfirmedGroup) {
|
||||
if ($rnrsEnabledConfirmedGroup) {
|
||||
$this->addGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = true;
|
||||
} else if ($rnrsEnabledExemptGroup) {
|
||||
$this->addGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = true;
|
||||
}
|
||||
}
|
||||
} else if ($rnrsInExemptGroup || $rnrsInOtherExemptedGroups) {
|
||||
if ($rnrsEnabledConfirmedGroup && !$rnrsInConfirmedGroup) {
|
||||
$this->removeGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = false;
|
||||
// If verify exempted, hash not verified, but in the confirmed group,
|
||||
// remove from confirmed group
|
||||
if ($rnrsInConfirmedGroup) {
|
||||
if ($rnrsEnabledConfirmedGroup) {
|
||||
$this->removeGroup($user, $this->config->get('RNRSConfirmedGroup'));
|
||||
$rnrsInConfirmedGroup = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
正在加载...
在新工单中引用