diff options
author | Matt Friedman <maf675@gmail.com> | 2016-03-21 13:54:50 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2016-03-21 13:54:50 -0700 |
commit | 5b3b0edd8010ccd4735d4000d284d7717bced897 (patch) | |
tree | 11c428e8a5d10eb08791009a20a59e74cf54f76a | |
parent | 00c2efca605b4dbd323221a3dab2110c81ae3dcd (diff) | |
download | forums-5b3b0edd8010ccd4735d4000d284d7717bced897.tar forums-5b3b0edd8010ccd4735d4000d284d7717bced897.tar.gz forums-5b3b0edd8010ccd4735d4000d284d7717bced897.tar.bz2 forums-5b3b0edd8010ccd4735d4000d284d7717bced897.tar.xz forums-5b3b0edd8010ccd4735d4000d284d7717bced897.zip |
[ticket/12684] Use a switch statement for readability
PHPBB3-12684
-rw-r--r-- | phpBB/phpbb/console/command/user/add.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/phpBB/phpbb/console/command/user/add.php b/phpBB/phpbb/console/command/user/add.php index 3df0473acf..df1f4aa54a 100644 --- a/phpBB/phpbb/console/command/user/add.php +++ b/phpBB/phpbb/console/command/user/add.php @@ -280,20 +280,20 @@ class add extends \phpbb\console\command\command */ protected function send_activation_email($user_id) { - if ($this->config['require_activation'] == USER_ACTIVATION_SELF) + switch ($this->config['require_activation']) { - $email_template = 'user_welcome_inactive'; - $user_actkey = gen_rand_string(mt_rand(6, 10)); - } - else if ($this->config['require_activation'] == USER_ACTIVATION_ADMIN) - { - $email_template = 'admin_welcome_inactive'; - $user_actkey = gen_rand_string(mt_rand(6, 10)); - } - else - { - $email_template = 'user_welcome'; - $user_actkey = ''; + case USER_ACTIVATION_SELF: + $email_template = 'user_welcome_inactive'; + $user_actkey = gen_rand_string(mt_rand(6, 10)); + break; + case USER_ACTIVATION_ADMIN: + $email_template = 'admin_welcome_inactive'; + $user_actkey = gen_rand_string(mt_rand(6, 10)); + break; + default: + $email_template = 'user_welcome'; + $user_actkey = ''; + break; } if (!class_exists('messenger')) |