Files
firefly-iii/app/Ldap/AttributeHandler.php

45 lines
1.2 KiB
PHP
Raw Normal View History

2021-06-12 08:40:35 +02:00
<?php
2021-08-10 19:31:55 +02:00
2021-06-12 08:40:35 +02:00
/*
* AttributeHandler.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2021-08-10 19:31:55 +02:00
declare(strict_types=1);
2021-06-12 08:40:35 +02:00
namespace FireflyIII\Ldap;
use FireflyIII\User as DatabaseUser;
2021-11-13 15:38:11 +01:00
use LdapRecord\Models\Entry;
2021-06-12 08:40:35 +02:00
/**
* Class AttributeHandler
*/
class AttributeHandler
{
/**
2021-11-13 15:38:11 +01:00
* @param Entry $ldapUser
2021-06-12 08:40:35 +02:00
* @param DatabaseUser $database
*/
2021-11-13 15:38:11 +01:00
public function handle(Entry $ldapUser, DatabaseUser $database)
2021-06-12 08:40:35 +02:00
{
2021-11-13 15:38:11 +01:00
$database->email = $ldapUser->getFirstAttribute('mail');
2021-06-12 08:40:35 +02:00
$database->save();
}
2021-07-03 12:32:02 +02:00
}