*/
protected $userIsNotBanned = 0;
+ /**
+ * true if the the user is be email confirmed
+ *
+ * @var integer
+ */
+ protected $userIsEmailConfirmed = 0;
+
+ /**
+ * true if the the user is not be email confirmed
+ * @var integer
+ */
+ protected $userIsNotEmailConfirmed = 0;
+
/**
* @inheritDoc
*/
$objectList->getConditionBuilder()->add('user_table.activationCode <> ?', [0]);
}
}
+
+ if (isset($conditionData['userIsEmailConfirmed'])) {
+ if ($conditionData['userIsEmailConfirmed']) {
+ $objectList->getConditionBuilder()->add('user_table.emailConfirmed IS NULL');
+ }
+ else {
+ $objectList->getConditionBuilder()->add('user_table.emailConfirmed IS NOT NULL');
+ }
+ }
}
/**
}
}
+ /** @noinspection PhpUndefinedFieldInspection */
+ $userIsEmailConfirmed = $condition->userIsEmailConfirmed;
+ if ($userIsEmailConfirmed !== null) {
+ if ($userIsEmailConfirmed && !$user->isEmailConfirmed()) {
+ return false;
+ }
+ else if (!$userIsEmailConfirmed && $user->isEmailConfirmed()) {
+ return false;
+ }
+ }
+
return true;
}
else if ($this->userIsDisabled) {
$data['userIsEnabled'] = 0;
}
+ if ($this->userIsEmailConfirmed) {
+ $data['userIsEmailConfirmed'] = 1;
+ }
+ else if ($this->userIsNotEmailConfirmed) {
+ $data['userIsEmailConfirmed'] = 0;
+ }
if (!empty($data)) {
return $data;
$userIsBanned = WCF::getLanguage()->get('wcf.user.condition.state.isBanned');
$userIsDisabled = WCF::getLanguage()->get('wcf.user.condition.state.isDisabled');
$userIsEnabled = WCF::getLanguage()->get('wcf.user.condition.state.isEnabled');
+ $userIsEmailConfirmed = WCF::getLanguage()->get('wcf.user.condition.state.isEmailConfirmed');
+ $userIsNotEmailConfirmed = WCF::getLanguage()->get('wcf.user.condition.state.isNotEmailConfirmed');
return <<<HTML
<label><input type="checkbox" name="userIsBanned" value="1"{$this->getCheckedAttribute('userIsBanned')}> {$userIsBanned}</label>
<label><input type="checkbox" name="userIsNotBanned" value="1"{$this->getCheckedAttribute('userIsNotBanned')}> {$userIsNotBanned}</label>
<label><input type="checkbox" name="userIsEnabled" value="1"{$this->getCheckedAttribute('userIsEnabled')}> {$userIsEnabled}</label>
<label><input type="checkbox" name="userIsDisabled" value="1"{$this->getCheckedAttribute('userIsDisabled')}> {$userIsDisabled}</label>
+<label><input type="checkbox" name="userIsEmailConfirmed" value="1"{$this->getCheckedAttribute('userIsEmailConfirmed')}> {$userIsEmailConfirmed}</label>
+<label><input type="checkbox" name="userIsNotEmailConfirmed" value="1"{$this->getCheckedAttribute('userIsNotEmailConfirmed')}> {$userIsNotEmailConfirmed}</label>
HTML;
}
if (isset($_POST['userIsDisabled'])) $this->userIsDisabled = 1;
if (isset($_POST['userIsEnabled'])) $this->userIsEnabled = 1;
if (isset($_POST['userIsNotBanned'])) $this->userIsNotBanned = 1;
+ if (isset($_POST['userIsEmailConfirmed'])) $this->userIsEmailConfirmed = 1;
+ if (isset($_POST['userIsNotEmailConfirmed'])) $this->userIsNotEmailConfirmed = 1;
}
/**
$this->userIsDisabled = 0;
$this->userIsEnabled = 0;
$this->userIsNotBanned = 0;
+ $this->userIsEmailConfirmed = 0;
+ $this->userIsNotEmailConfirmed = 0;
}
/**
$this->userIsEnabled = $userIsEnabled;
$this->userIsDisabled = !$userIsEnabled;
}
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $userIsEmailConfirmed = $condition->userIsEmailConfirmed;
+ if ($condition->userIsEmailConfirmed !== null) {
+ $this->userIsEmailConfirmed = $userIsEmailConfirmed;
+ $this->userIsNotEmailConfirmed = !$userIsEmailConfirmed;
+ }
}
/**
throw new UserInputException('userIsEnabled', 'conflict');
}
+
+ if ($this->userIsEmailConfirmed && $this->userIsNotEmailConfirmed) {
+ $this->errorMessage = 'wcf.user.condition.state.isEmailConfirmed.error.conflict';
+
+ throw new UserInputException('userIsEmailConfirmed', 'conflict');
+ }
}
/**
<item name="wcf.user.condition.state.isEnabled"><![CDATA[Aktiviert]]></item>
<item name="wcf.user.condition.state.isEnabled.error.conflict"><![CDATA[„Aktiviert“ und „Nicht aktiviert“ können nicht gleichzeitig ausgewählt werden.]]></item>
<item name="wcf.user.condition.state.isNotBanned"><![CDATA[Nicht gesperrt]]></item>
+ <item name="wcf.user.condition.state.isEmailConfirmed"><![CDATA[Hat eine bestätigte E-Mail-Adresse]]></item>
+ <item name="wcf.user.condition.state.isEmailConfirmed.error.conflict"><![CDATA[„Hat eine bestätigte E-Mail-Adresse“ und „Hat keine bestätigte E-Mail-Adresse“ können nicht gleichzeitig ausgewählt werden.]]></item>
+ <item name="wcf.user.condition.state.isNotEmailConfirmed"><![CDATA[Hat keine bestätigte E-Mail-Adresse]]></item>
<item name="wcf.user.condition.userTrophyIDs"><![CDATA[hat Trophäe]]></item>
<item name="wcf.user.condition.userTrophyIDs.description"><![CDATA[Benutzer müssen alle ausgewählten Trophäen mindestens einmal erhalten haben.]]></item>
<item name="wcf.user.condition.notUserTrophyIDs"><![CDATA[hat nicht Trophäe]]></item>
<item name="wcf.user.condition.state.isEnabled"><![CDATA[Approved]]></item>
<item name="wcf.user.condition.state.isEnabled.error.conflict"><![CDATA[You cannot simultaneously select “Approved” and “Awaiting Approval”.]]></item>
<item name="wcf.user.condition.state.isNotBanned"><![CDATA[Not Banned]]></item>
+ <item name="wcf.user.condition.state.isEmailConfirmed"><![CDATA[Has a confirmed email address]]></item>
+ <item name="wcf.user.condition.state.isEmailConfirmed.error.conflict"><![CDATA[You cannot simultaneously select “Has a confirmed email address” and “Has not a confirmed email address”.]]></item>
+ <item name="wcf.user.condition.state.isNotEmailConfirmed"><![CDATA[Has not a confirmed email address]]></item>
<item name="wcf.user.condition.userTrophyIDs"><![CDATA[User has Trophy]]></item>
<item name="wcf.user.condition.userTrophyIDs.description"><![CDATA[User has received the selected trophies.]]></item>
<item name="wcf.user.condition.notUserTrophyIDs"><![CDATA[User does not have Trophy]]></item>