diff --git a/config.php b/config.php
index 2fc8b52a8b..a175bf22f7 100644
--- a/config.php
+++ b/config.php
@@ -97,13 +97,14 @@
'account_create_auto_login' => false, // auto login after creating account?
'account_create_character_create' => true, // allow directly to create character on create account page?
'account_mail_verify' => false, // force users to confirm their email addresses when registering account
- 'account_mail_confirmed_reward' => [ // reward users for confirming their E-Mails
- // account_mail_verify needs to be enabled too
- 'premium_days' => 0,
- 'coins_transferable' => 0,
- 'coins' => 0,
- 'message' => 'You received %d %s for confirming your E-Mail address.' // example: You received 20 coins for confirming your E-Mail address.
- ],
+ 'account_verified_only' => false, // force users to confirm their email to login in game
+ 'account_mail_confirmed_reward' => [ // reward users for confirming their E-Mails
+ // account_mail_verify needs to be enabled too
+ 'premium_days' => 0,
+ 'coins_transferable' => 0,
+ 'coins' => 0,
+ 'message' => 'You received %d %s for confirming your E-Mail address.' // example: You received 20 coins for confirming your E-Mail address.
+ ],
'account_mail_unique' => true, // email addresses cannot be duplicated? (one account = one email)
'account_premium_days' => 0, // default premium days on new account
'account_premium_coins' => 0, // default coins on new account
diff --git a/index.php b/index.php
index 65a64c69c8..b174fd7a12 100644
--- a/index.php
+++ b/index.php
@@ -92,6 +92,7 @@
'/^account\/password\/?$/' => array('subtopic' => 'accountmanagement', 'action' => 'change_password'),
'/^account\/register\/?$/' => array('subtopic' => 'accountmanagement', 'action' => 'register'),
'/^account\/register\/new\/?$/' => array('subtopic' => 'accountmanagement', 'action' => 'register_new'),
+ '/^account\/resend\/verify\/?$/' => array('subtopic' => 'accountmanagement', 'action' => 'resend_verify'),
'/^account\/email\/?$/' => array('subtopic' => 'accountmanagement', 'action' => 'change_email'),
'/^account\/info\/?$/' => array('subtopic' => 'accountmanagement', 'action' => 'change_info'),
'/^account\/character\/create\/?$/' => array('subtopic' => 'accountmanagement', 'action' => 'create_character'),
diff --git a/login.php b/login.php
index d1a3e9f919..1c6a671d1b 100644
--- a/login.php
+++ b/login.php
@@ -116,6 +116,10 @@ function parseEvent($table1, $date, $table2)
sendError('Email or password is not correct.');
}
+ if ($config['account_verified_only'] && $config['mail_enabled'] && $config['account_mail_verify'] && $account->getCustomField('email_verified') != '1') {
+ sendError('You need to verify your account, enter in our site and resend verify e-mail!');
+ }
+
// common columns
$columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, lastlogin, isreward, istutorial, ismain, hidden';
$players = $db->query("SELECT {$columns} FROM players WHERE account_id = {$account->getId()} AND deletion = 0");
diff --git a/system/pages/account/resend_verify.php b/system/pages/account/resend_verify.php
new file mode 100644
index 0000000000..71e8ae7b94
--- /dev/null
+++ b/system/pages/account/resend_verify.php
@@ -0,0 +1,58 @@
+getName();
+ $accEmail = $account_logged->getEMail();
+
+ if ($account_logged->getCustomField('email_verified') == '1') {
+ echo "You account is already verified!";
+ return;
+ }
+
+ if (isset($_POST['confirmresend']) && $_POST['confirmresend'] == '1') {
+ $hash = md5(generateRandomString(16, true, true) . $accEmail);
+ $account_logged->setCustomField('email_hash', $hash);
+
+ $verify_url = getLink('account/confirm_email/' . $hash);
+ $body_html = $twig->render('mail.account.verify.html.twig', array(
+ 'account' => $accName,
+ 'verify_url' => generateLink($verify_url, $verify_url, true)
+ ));
+
+ if (_mail($accEmail, configLua('serverName') . ' - Verify Account', $body_html)) {
+ $message = "
Your request was sent on email address {$accEmail}";
+ $show_form = false;
+ } else {
+ $message = "
An error occurred while sending email ( {$accEmail} )! Try again later. For Admin: More info can be found in system/logs/mailer-error.log
"; + } + + $twig->display('success.html.twig', array( + 'title' => 'Verify Email Sent', + 'description' => "