Add method to check, whether a user must confirm his email on change
authorjoshuaruesweg <ruesweg@woltlab.com>
Sat, 13 Jun 2020 14:50:52 +0000 (16:50 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Sat, 13 Jun 2020 14:50:52 +0000 (16:50 +0200)
com.woltlab.wcf/templates/accountManagement.tpl
wcfsetup/install/files/lib/data/user/User.class.php

index bf7285df53de93bd0cde8adc37ed8f8e874dd5f8..1d9084349773b9991944cc4880bb5142a6284d40 100644 (file)
                        
                        {event name='changeEmailFields'}
                        
-                       {if REGISTER_ACTIVATION_METHOD & 1 && $__wcf->getUser()->reactivationCode != 0}
+                       {if $__wcf->user->mustSelfEmailConfirm() && $__wcf->getUser()->reactivationCode != 0}
                                <dl>
                                        <dt></dt>
                                        <dd>
index 9bbc5284d172cabc9e7e35efebfb1eef59029d5e..b5a3583c4f4cb0a85a5dbd384528467abab22af0 100644 (file)
@@ -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;
+       }
 }