- π©πͺGermany Anybody Porta Westfalica
Still an issue in 4.x? Then please switch the version and provide a MR for review to speed things up here. Thanks!
Hello.
I have a question.
I just want to know, any easy way to make like
$restrictIp = new RestrictIp();
$restrictIp->setPath('/user/login');
$is_allowed_path = $restrictIp->testForBlock();
I use this module to protect /user/login and /user/register pages and it works well for me.
But user still can login using a custom login form.
So I want to implement in my custom module like
/**
* Implements hook_form_FORM_ID_alter().
*/
function MYMODULE_form_user_login_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$form['#validate'][] = '_MYMODULE_login_form_validate';
}
/**
* Validation form for the login form.
*/
function _MYMODULE_login_form_validate($form, FormStateInterface &$form_state) {
// TODO: Get RestrictIpService() and check userIsBlocked or not.
}
I see RestrictIpService.php but unclear how can I pass a lot of parameters to the constructor.
Thank you in advance.
Postponed: needs info
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Still an issue in 4.x? Then please switch the version and provide a MR for review to speed things up here. Thanks!