2020-09-13 13:41:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ldap;
|
|
|
|
|
|
|
|
use Laravel\Passport\HasApiTokens;
|
|
|
|
use LdapRecord\Models\OpenLDAP\User as Model;
|
|
|
|
|
2024-01-08 01:54:58 +00:00
|
|
|
use App\Ldap\Rules\LoginObjectclassRule;
|
|
|
|
|
2020-09-13 13:41:26 +00:00
|
|
|
class User extends Model
|
|
|
|
{
|
|
|
|
use HasApiTokens;
|
|
|
|
|
2024-01-08 01:28:11 +00:00
|
|
|
/**
|
|
|
|
* The object classes of the LDAP model.
|
2024-01-08 01:54:58 +00:00
|
|
|
*
|
|
|
|
* @note We set this to an empty array so that any objectclass can login
|
|
|
|
* @see LoginObjectclassRule::class
|
2024-01-08 01:28:11 +00:00
|
|
|
*/
|
|
|
|
public static array $objectClasses = [
|
2020-09-13 13:41:26 +00:00
|
|
|
];
|
2023-01-27 08:59:31 +00:00
|
|
|
|
|
|
|
/* METHODS */
|
|
|
|
|
|
|
|
public function getDn(): string
|
|
|
|
{
|
|
|
|
return $this->exists ? parent::getDn() : 'Anonymous';
|
|
|
|
}
|
|
|
|
}
|