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