New hooks in account manage + create

This commit is contained in:
slawkens 2024-09-08 15:03:18 +02:00
parent ea7e808508
commit 93641fc68a
4 changed files with 20 additions and 0 deletions

View File

@ -148,6 +148,10 @@ if($save)
} }
} }
/**
* two hooks for compatibility
*/
$hooks->trigger(HOOK_ACCOUNT_CREATE_AFTER_SUBMIT, $params);
if (!$hooks->trigger(HOOK_ACCOUNT_CREATE_POST, $params)) { if (!$hooks->trigger(HOOK_ACCOUNT_CREATE_POST, $params)) {
return; return;
} }
@ -187,6 +191,8 @@ if($save)
$new_account->setEMail($email); $new_account->setEMail($email);
$new_account->save(); $new_account->save();
$hooks->trigger(HOOK_ACCOUNT_CREATE_AFTER_SAVED, ['account' => $new_account]);
if(USE_ACCOUNT_SALT) if(USE_ACCOUNT_SALT)
$new_account->setCustomField('salt', $salt); $new_account->setCustomField('salt', $salt);

View File

@ -45,6 +45,12 @@ define('HOOK_ACCOUNT_CREATE_AFTER_TOWNS', ++$i);
define('HOOK_ACCOUNT_CREATE_BEFORE_SUBMIT_BUTTON', ++$i); define('HOOK_ACCOUNT_CREATE_BEFORE_SUBMIT_BUTTON', ++$i);
define('HOOK_ACCOUNT_CREATE_AFTER_FORM', ++$i); define('HOOK_ACCOUNT_CREATE_AFTER_FORM', ++$i);
define('HOOK_ACCOUNT_CREATE_POST', ++$i); define('HOOK_ACCOUNT_CREATE_POST', ++$i);
define('HOOK_ACCOUNT_CREATE_AFTER_SUBMIT', ++$i);
define('HOOK_ACCOUNT_CREATE_AFTER_SAVED', ++$i);
define('HOOK_ACCOUNT_MANAGE_BEFORE_GENERAL_INFORMATION', ++$i);
define('HOOK_ACCOUNT_MANAGE_BEFORE_PUBLIC_INFORMATION', ++$i);
define('HOOK_ACCOUNT_MANAGE_BEFORE_ACCOUNT_LOGS', ++$i);
define('HOOK_ACCOUNT_MANAGE_BEFORE_CHARACTERS', ++$i);
define('HOOK_ACCOUNT_LOGIN_BEFORE_PAGE', ++$i); define('HOOK_ACCOUNT_LOGIN_BEFORE_PAGE', ++$i);
define('HOOK_ACCOUNT_LOGIN_BEFORE_ACCOUNT', ++$i); define('HOOK_ACCOUNT_LOGIN_BEFORE_ACCOUNT', ++$i);
define('HOOK_ACCOUNT_LOGIN_AFTER_ACCOUNT', ++$i); define('HOOK_ACCOUNT_LOGIN_AFTER_ACCOUNT', ++$i);

View File

@ -88,6 +88,7 @@
</div> </div>
<br/><br/> <br/><br/>
{% endif %} {% endif %}
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_GENERAL_INFORMATION') }}
<a name="General+Information"></a> <a name="General+Information"></a>
<h2>General Information</h2> <h2>General Information</h2>
<table width="100%"> <table width="100%">
@ -127,6 +128,7 @@
{% endautoescape %} {% endautoescape %}
</table> </table>
<br/> <br/>
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_PUBLIC_INFORMATION') }}
<a name="Public+Information"></a> <a name="Public+Information"></a>
<h2>Public Information</h2> <h2>Public Information</h2>
<table width="100%"> <table width="100%">
@ -145,6 +147,7 @@
{% include('buttons.base.html.twig') %} {% include('buttons.base.html.twig') %}
</form> </form>
<br/> <br/>
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_ACCOUNT_LOGS') }}
<a name="Account+Logs" ></a> <a name="Account+Logs" ></a>
<h2>Action Log</h2> <h2>Action Log</h2>
<table> <table>
@ -164,6 +167,7 @@
{% endautoescape %} {% endautoescape %}
</table> </table>
<br/> <br/>
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_CHARACTERS') }}
<a name="Characters" ></a> <a name="Characters" ></a>
<h2>Character list: {{ players|length }} characters.</h2> <h2>Character list: {{ players|length }} characters.</h2>
<table> <table>

View File

@ -111,6 +111,7 @@
</div> </div>
<br/><br/> <br/><br/>
{% endif %} {% endif %}
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_GENERAL_INFORMATION') }}
<a name="General+Information" ></a> <a name="General+Information" ></a>
<div class="TopButtonContainer"> <div class="TopButtonContainer">
<div class="TopButton"> <div class="TopButton">
@ -221,6 +222,7 @@
{% endset %} {% endset %}
{% include 'tables.headline.html.twig' %} {% include 'tables.headline.html.twig' %}
<br/> <br/>
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_PUBLIC_INFORMATION') }}
<a name="Public+Information"></a> <a name="Public+Information"></a>
<div class="TopButtonContainer"> <div class="TopButtonContainer">
<div class="TopButton"> <div class="TopButton">
@ -280,6 +282,7 @@
{% endset %} {% endset %}
{% include 'tables.headline.html.twig' %} {% include 'tables.headline.html.twig' %}
<br/> <br/>
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_ACCOUNT_LOGS') }}
<a name="Account+Logs" ></a> <a name="Account+Logs" ></a>
<div class="TopButtonContainer"> <div class="TopButtonContainer">
<div class="TopButton"> <div class="TopButton">
@ -333,6 +336,7 @@
{% endset %} {% endset %}
{% include 'tables.headline.html.twig' %} {% include 'tables.headline.html.twig' %}
<br/> <br/>
{{ hook('HOOK_ACCOUNT_MANAGE_BEFORE_CHARACTERS') }}
<a name="Characters" ></a> <a name="Characters" ></a>
<div class="TopButtonContainer"> <div class="TopButtonContainer">
<div class="TopButton" > <div class="TopButton" >