Print error message returned by before_alternc_add_member hook
This commit is contained in:
parent
0b5725cb86
commit
fa8e4a71e0
|
@ -639,11 +639,12 @@ class m_admin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Additional checks before a user is created
|
// Additional checks before a user is created
|
||||||
// Do not create the account if any hook returned false
|
// Do not create the account if any hook has a return value
|
||||||
|
// The returned value should provide additional information
|
||||||
$before_add_hook_data = $hooks->invoke('hook_before_alternc_add_member', [$login]);
|
$before_add_hook_data = $hooks->invoke('hook_before_alternc_add_member', [$login]);
|
||||||
foreach($before_add_hook_data as $create) {
|
foreach($before_add_hook_data as $create) {
|
||||||
if(!$create) {
|
if($create !== null) {
|
||||||
$msg->raise("ERROR", "admin", _("-- I cannot create this account --"));
|
$msg->raise("ERROR", "admin", _("The account '%s' cannot be created. %s"), [$login, $create]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue