yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Added user autocomplete from ldap in create view and a parameter to enable it

Open AndreScara11 opened this issue 1 year ago • 7 comments

Implemented the possibility to autocomplete email and username from ldap when create a new user

AndreScara11 avatar Mar 06 '24 08:03 AndreScara11

@schmunk42 @eluhr since you use LDAP extension, do you mind having a look as well? thank you

maxxer avatar Mar 08 '24 07:03 maxxer

In the last commit I adjusted the following things:

  • Added parameters with explanations in the docs folder
  • Added how to install typeahead if you want to use it, in the docs folder
  • Fixed translations
  • Run php-cs-fixer

AndreScara11 avatar Mar 27 '24 17:03 AndreScara11

First, thank you for contributing!

I am not a fan of how the Typeahead is being used here.

The typeahead original repo seems to be dead?

Also, the similar functionality here is used via 2amigos/yii2-selectize-widget. The latter is also abandoned, but using the already used dependency we will not be introducing a new "old/outdated" dependency here. In v2 branch bootstrap5 version select2 replaces yii2-selectize-widget.

We are generally dealing in v2 with the issue of how to get past old dependencies (bootstrap3), in this light adding something "old" on top of existing seems like going the wrong way.

I would suggest either use something alive and up to date, or go with using the already used selectize-widget here.

edit: or use kartik/select2 for this (replaces selectize-widget in v2). both select2 and selectize seem to have ajax quering options

TonisOrmisson avatar Mar 27 '24 18:03 TonisOrmisson

Last changes:

  • Used Selectizetextinput instead of Typeahead
  • Added property ldapUid to User model to handle the ldap users without the username
  • Changed ldap params names
  • Updated docs

AndreScara11 avatar Mar 29 '24 10:03 AndreScara11

Done, sorry for the misunderstanding.

AndreScara11 avatar Apr 02 '24 07:04 AndreScara11

Have you had a chance to review?

AndreScara11 avatar Apr 17 '24 08:04 AndreScara11

@schmunk42 @eluhr since you use LDAP extension, do you mind having a look as well? thank you

@maxxer since you asked for my opinion on this, here is my assessment. I find it somewhat critical to wire the LDAP so closely to the package. I think the whole thing would be better off in a separate package, which overwrites the required views and controller actions or works with the existing events at this point.

eluhr avatar Apr 17 '24 08:04 eluhr