Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace LdapRecord\Models\OpenLDAP; |
| 4 | |
| 5 | use Illuminate\Contracts\Auth\Authenticatable; |
| 6 | use LdapRecord\Models\Concerns\CanAuthenticate; |
| 7 | use LdapRecord\Models\Concerns\HasPassword; |
| 8 | |
| 9 | class User extends Entry implements Authenticatable |
| 10 | { |
| 11 | use HasPassword; |
| 12 | use CanAuthenticate; |
| 13 | |
| 14 | /** |
| 15 | * The password's attribute name. |
| 16 | * |
| 17 | * @var string |
| 18 | */ |
| 19 | protected $passwordAttribute = 'userpassword'; |
| 20 | |
| 21 | /** |
| 22 | * The password's hash method. |
| 23 | * |
| 24 | * @var string |
| 25 | */ |
| 26 | protected $passwordHashMethod = 'ssha'; |
| 27 | |
| 28 | /** |
| 29 | * The object classes of the LDAP model. |
| 30 | * |
| 31 | * @var array |
| 32 | */ |
| 33 | public static $objectClasses = [ |
| 34 | 'top', |
| 35 | 'person', |
| 36 | 'organizationalperson', |
| 37 | 'inetorgperson', |
| 38 | ]; |
| 39 | |
| 40 | /** |
| 41 | * The groups relationship. |
| 42 | * |
| 43 | * Retrieves groups that the user is apart of. |
| 44 | * |
| 45 | * @return \LdapRecord\Models\Relations\HasMany |
| 46 | */ |
| 47 | public function groups() |
| 48 | { |
| 49 | return $this->hasMany(Group::class, 'memberuid', 'uid'); |
| 50 | } |
| 51 | } |