Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

No handle method exists for the given handler class [mail] #560

Closed
aleex1848 opened this issue Jun 21, 2018 · 4 comments
Closed

No handle method exists for the given handler class [mail] #560

aleex1848 opened this issue Jun 21, 2018 · 4 comments

Comments

@aleex1848
Copy link

aleex1848 commented Jun 21, 2018

  • Laravel Version: 5.5.40
  • Adldap2-Laravel Version: 3.0.9
  • PHP Version: 7.1.12
  • LDAP Type: ActiveDirectory

Description:

I'm trying to import LDAP users using the artisan command "adldap:import".
Doing it manually with command "php artisan adldap:import user1234 --no-interaction" is successfull.

But i want to import automatically inside my code so i do this:
\Artisan::call('adldap:import', ['user' => 'user1234' ,'--no-interaction'] );
which is not successful.

The logged error is:
local.ERROR: Unable to import user Wurst Hans. No handle method exists for the given handler class [mail]

When i put a dd(get_class($handler)) in here:

throw new AdldapException("No handle method exists for the given handler class [$adField]");

it shows "Illuminate\Support\Facades\Mail" when calling from code.

Wenn i run Artisan:.call manually from Tinker, the dd is not calling, so i guess my problem i related to this "If the AD Field is a class, we'll assume it's an attribute handler."
The "mail"-Attribute is recognised as having a handler, but it' not a handler. It's Illuminate\Support\Facades\Mail.

Any hints on this?

Thanks !

Steps To Reproduce:

@aleex1848
Copy link
Author

I've no idea what i am doing, but as a workaround i changed

if (class_exists($adField) && $handler = app($adField)) {

to
if (class_exists($adField) && $handler = app($adField) and $adField != 'mail') {

to get it working.

@stevebauman
Copy link
Member

Hi @aleex1848, can you post your sync_attributes array in your adldap_auth.php configuration file?

@aleex1848
Copy link
Author

Hi @stevebauman. Sure:
` 'sync_attributes' => [

    'username' => 'samaccountname',
    'vorname' => 'givenname',
    'nachname' => 'sn',
    'email' => 'mail',
    'telefon' => 'telephonenumber',
    'fax' => 'facsimiletelephonenumber',
    'extension1' => 'extensionattribute1',
    'extension2' => 'extensionattribute2',
    'extension3' => 'extensionattribute3',
    'title' => 'title',
    'ort' => 'l',
    'adresse' => 'streetaddress',
    'plz' => 'postalcode',
    'raum' => 'physicaldeliveryofficename',
    'personalnr' => 'employeenumber',


],

`

stevebauman added a commit that referenced this issue Sep 11, 2018
stevebauman added a commit that referenced this issue Sep 11, 2018
- #560

(cherry picked from commit f5ff704)
@stevebauman
Copy link
Member

Fixed in v4.0.8.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants