Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show First 20 Lines • Show All 647 Lines • ▼ Show 20 Lines | class User extends Authenticatable implements JWTSubject | ||||
* User LDAP password mutator | * User LDAP password mutator | ||||
* | * | ||||
* @param string $password The password in plain text. | * @param string $password The password in plain text. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function setPasswordLdapAttribute($password) | public function setPasswordLdapAttribute($password) | ||||
{ | { | ||||
if (!empty($password)) { | $this->setPasswordAttribute($password); | ||||
$this->attributes['password'] = bcrypt($password, [ "rounds" => 12 ]); | |||||
$this->attributes['password_ldap'] = '{SSHA512}' . base64_encode( | |||||
pack('H*', hash('sha512', $password)) | |||||
); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
* User status mutator | * User status mutator | ||||
* | * | ||||
* @throws \Exception | * @throws \Exception | ||||
*/ | */ | ||||
public function setStatusAttribute($status) | public function setStatusAttribute($status) | ||||
Show All 26 Lines |