Print error message returned by before_alternc_add_member hook
This commit is contained in:
parent
0b5725cb86
commit
fa8e4a71e0
|
@ -639,13 +639,14 @@ class m_admin {
|
|||
return false;
|
||||
}
|
||||
// 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]);
|
||||
foreach($before_add_hook_data as $create) {
|
||||
if(!$create) {
|
||||
$msg->raise("ERROR", "admin", _("-- I cannot create this account --"));
|
||||
return false;
|
||||
}
|
||||
if($create !== null) {
|
||||
$msg->raise("ERROR", "admin", _("The account '%s' cannot be created. %s"), [$login, $create]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$pass = password_hash($pass, PASSWORD_BCRYPT);
|
||||
|
|
Loading…
Reference in New Issue