You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
638 B
28 lines
638 B
<?php
|
|
|
|
namespace model;
|
|
|
|
use gateway\UserGateway;
|
|
|
|
class MdlUser extends AbsModel {
|
|
|
|
public function modifyNickname(int $id, string $newNickname): void{
|
|
$gtw = new UserGateway();
|
|
$gtw->modifyNickname($id, $newNickname);
|
|
}
|
|
|
|
public function ModifyPassword(int $id, string $newPassword): void {
|
|
$gtw = new UserGateway();
|
|
$gtw->modifyPassword($id, $newPassword);
|
|
}
|
|
|
|
public function is(string $login, array $roles)
|
|
{
|
|
$gtw = new UserGateway();
|
|
$user = $gtw->findUserByEmail($login);
|
|
|
|
if (!empty($user->getRoles())) return $user;
|
|
else return false;
|
|
}
|
|
}
|