diff --git a/.gitignore b/.gitignore
index 63e362db..c2acb088 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,4 +28,6 @@ system/logs/*
plugins/*
!plugins/.htaccess
!plugins/example.json
+!plugins/account-create-hint.json
+!plugins/account-create-hint
landing
diff --git a/plugins/account-create-hint.json b/plugins/account-create-hint.json
new file mode 100644
index 00000000..87734108
--- /dev/null
+++ b/plugins/account-create-hint.json
@@ -0,0 +1,17 @@
+{
+ "name": "create-account-hint",
+ "description": "This plugin display text 'To play on Forgotten you need an account. All you have to do to create your new account is to enter an account name, password, country and your email address. Also you have to agree to the terms presented below. If you have done so, your account name will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.' on the create account page. Be careful when uninstalling this!",
+ "version": "1.0",
+ "author": "slawkens",
+ "contact": "slawkens@gmail.com",
+ "hooks": {
+ "create-account-hint": {
+ "type": "ACCOUNT_CREATE_BEFORE_FORM",
+ "file": "plugins/account-create-hint/hint.php"
+ }
+ },
+ "uninstall": [
+ "plugins/account-create-hint.json",
+ "plugins/account-create-hint"
+ ]
+}
diff --git a/plugins/account-create-hint/hint.html.twig b/plugins/account-create-hint/hint.html.twig
new file mode 100644
index 00000000..d6069d56
--- /dev/null
+++ b/plugins/account-create-hint/hint.html.twig
@@ -0,0 +1,3 @@
+To play on {{ config.lua.serverName }} you need an account.
+All you have to do to create your new account is to enter an account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}, password{% if config.recaptcha_enabled %}, confirm reCAPTCHA{% endif %}{% if config.account_country %}, country{% endif %} and your email address.
+Also you have to agree to the terms presented below. If you have done so, your account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %} will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.
diff --git a/plugins/account-create-hint/hint.php b/plugins/account-create-hint/hint.php
new file mode 100644
index 00000000..b88af30a
--- /dev/null
+++ b/plugins/account-create-hint/hint.php
@@ -0,0 +1,15 @@
+
+ * @copyright 2020 MyAAC
+ * @link https://my-aac.org
+ */
+defined('MYAAC') or die('Direct access not allowed!');
+
+global $twig_loader;
+$twig_loader->prependPath(BASE . 'plugins/account-create');
+
+$twig->display('hint.html.twig');
diff --git a/system/hooks.php b/system/hooks.php
index a937ec79..c84e5e30 100644
--- a/system/hooks.php
+++ b/system/hooks.php
@@ -24,8 +24,27 @@ define('HOOK_CHARACTERS_AFTER_CHARACTERS', 12);
define('HOOK_LOGIN', 13);
define('HOOK_LOGIN_ATTEMPT', 14);
define('HOOK_LOGOUT', 15);
+define('HOOK_ACCOUNT_CREATE_BEFORE_FORM', 16);
+define('HOOK_ACCOUNT_CREATE_BEFORE_BOXES', 17);
+define('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_1', 18);
+define('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_2', 19);
+define('HOOK_ACCOUNT_CREATE_AFTER_BOXES', 20);
+define('HOOK_ACCOUNT_CREATE_BEFORE_ACCOUNT', 21);
+define('HOOK_ACCOUNT_CREATE_AFTER_ACCOUNT', 22);
+define('HOOK_ACCOUNT_CREATE_AFTER_EMAIL', 23);
+define('HOOK_ACCOUNT_CREATE_AFTER_COUNTRY', 24);
+define('HOOK_ACCOUNT_CREATE_AFTER_PASSWORDS', 25);
+define('HOOK_ACCOUNT_CREATE_AFTER_RECAPTCHA', 26);
+define('HOOK_ACCOUNT_CREATE_BEFORE_CHARACTER_NAME', 27);
+define('HOOK_ACCOUNT_CREATE_AFTER_CHARACTER_NAME', 28);
+define('HOOK_ACCOUNT_CREATE_AFTER_SEX', 29);
+define('HOOK_ACCOUNT_CREATE_AFTER_VOCATION', 30);
+define('HOOK_ACCOUNT_CREATE_AFTER_TOWNS', 31);
+define('HOOK_ACCOUNT_CREATE_BEFORE_SUBMIT_BUTTON', 32);
+define('HOOK_ACCOUNT_CREATE_AFTER_FORM', 33);
+define('HOOK_ACCOUNT_CREATE_AFTER_SUBMIT', 34);
define('HOOK_FIRST', HOOK_STARTUP);
-define('HOOK_LAST', HOOK_LOGOUT);
+define('HOOK_LAST', HOOK_ACCOUNT_CREATE_AFTER_SUBMIT);
require_once LIBS . 'plugins.php';
class Hook
diff --git a/system/pages/createaccount.php b/system/pages/createaccount.php
index a2e8c464..0b94a2cc 100644
--- a/system/pages/createaccount.php
+++ b/system/pages/createaccount.php
@@ -121,6 +121,24 @@ if($save)
if(!isset($_POST['accept_rules']) || $_POST['accept_rules'] !== 'true')
$errors['accept_rules'] = 'You have to agree to the ' . $config['lua']['serverName'] . ' Rules in order to create an account!';
+ $params = array(
+ 'account' => $account_db,
+ 'email' => $email,
+ 'country' => $country,
+ 'password' => $password,
+ 'password2' => $password2,
+ 'accept_rules' => isset($_POST['accept_rules']) ? $_POST['accept_rules'] === 'true' : false,
+ );
+
+ if(USE_ACCOUNT_NAME) {
+ $params['account_name'] = $_POST['account'];
+ }
+ else {
+ $params['account_id'] = $_POST['account'];
+ }
+
+ $hooks->trigger(HOOK_ACCOUNT_CREATE_AFTER_SUBMIT, $params);
+
if(config('account_create_character_create')) {
$character_name = isset($_POST['name']) ? stripslashes(ucwords(strtolower($_POST['name']))) : null;
$character_sex = isset($_POST['sex']) ? (int)$_POST['sex'] : null;
@@ -313,4 +331,4 @@ if($save && config('account_create_character_create')) {
));
}
-$twig->display('account.create.html.twig', $params);
\ No newline at end of file
+$twig->display('account.create.html.twig', $params);
diff --git a/system/templates/account.create.html.twig b/system/templates/account.create.html.twig
index 21f04e8d..b3a889a5 100644
--- a/system/templates/account.create.html.twig
+++ b/system/templates/account.create.html.twig
@@ -1,6 +1,4 @@
-To play on {{ config.lua.serverName }} you need an account.
-All you have to do to create your new account is to enter an account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}, password{% if config.recaptcha_enabled %}, confirm reCAPTCHA{% endif %}{% if config.account_country %}, country{% endif %} and your email address.
-Also you have to agree to the terms presented below. If you have done so, your account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %} will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.
+{{ hook('HOOK_ACCOUNT_CREATE_BEFORE_FORM') }}