From: joshuaruesweg Date: Sat, 13 Jun 2020 14:50:52 +0000 (+0200) Subject: Add method to check, whether a user must confirm his email on change X-Git-Tag: 5.3.0_Alpha_1~182^2~9 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40ca7e1e36b409353d2b2ffb3c39ed27a93621b9;p=GitHub%2FWoltLab%2FWCF.git Add method to check, whether a user must confirm his email on change --- diff --git a/com.woltlab.wcf/templates/accountManagement.tpl b/com.woltlab.wcf/templates/accountManagement.tpl index bf7285df53..1d90843497 100644 --- a/com.woltlab.wcf/templates/accountManagement.tpl +++ b/com.woltlab.wcf/templates/accountManagement.tpl @@ -137,7 +137,7 @@ {event name='changeEmailFields'} - {if REGISTER_ACTIVATION_METHOD & 1 && $__wcf->getUser()->reactivationCode != 0} + {if $__wcf->user->mustSelfEmailConfirm() && $__wcf->getUser()->reactivationCode != 0}
diff --git a/wcfsetup/install/files/lib/data/user/User.class.php b/wcfsetup/install/files/lib/data/user/User.class.php index 9bbc5284d1..b5a3583c4f 100644 --- a/wcfsetup/install/files/lib/data/user/User.class.php +++ b/wcfsetup/install/files/lib/data/user/User.class.php @@ -684,4 +684,14 @@ final class User extends DatabaseObject implements IRouteController, IUserConten public function canEmailConfirm() { return REGISTER_ACTIVATION_METHOD & self::REGISTER_ACTIVATION_USER && !$this->isEmailConfirmed(); } + + /** + * Returns true, if the user must confirm his email by themself. + * + * @return boolean + * @since 5.3 + */ + public function mustSelfEmailConfirm() { + return REGISTER_ACTIVATION_METHOD & self::REGISTER_ACTIVATION_USER; + } }