blob: b37f390563ea7bb224259aa58165615f139c1c05 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace LdapRecord\Models\OpenLDAP;
4
5use Illuminate\Contracts\Auth\Authenticatable;
6use LdapRecord\Models\Concerns\CanAuthenticate;
7use LdapRecord\Models\Concerns\HasPassword;
8
9class 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}