User active column
This commit is contained in:
@@ -278,6 +278,14 @@ final class UserBackend extends Backend
|
||||
$password, $user->password
|
||||
);
|
||||
|
||||
if ($user->active == false) {
|
||||
$this->logger->info(
|
||||
"User account is inactive for user: $uid",
|
||||
["app" => $this->appName]
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($isCorrect !== true) {
|
||||
$this->logger->info(
|
||||
"Invalid password attempt for user: $uid",
|
||||
|
||||
@@ -45,6 +45,7 @@ final class DB
|
||||
const USER_GROUP_GID_COLUMN = "db.table.user_group.column.gid";
|
||||
const USER_GROUP_UID_COLUMN = "db.table.user_group.column.uid";
|
||||
|
||||
const USER_ACTIVE_COLUMN = "db.table.user.column.active";
|
||||
const USER_AVATAR_COLUMN = "db.table.user.column.avatar";
|
||||
const USER_EMAIL_COLUMN = "db.table.user.column.email";
|
||||
const USER_HOME_COLUMN = "db.table.user.column.home";
|
||||
|
||||
@@ -48,6 +48,10 @@ class User
|
||||
* @var string The user's home location.
|
||||
*/
|
||||
public $home;
|
||||
/**
|
||||
* @var bool Is user account active.
|
||||
*/
|
||||
public $active;
|
||||
/**
|
||||
* @var bool Can user change its avatar.
|
||||
*/
|
||||
|
||||
@@ -65,6 +65,7 @@ class QueryProvider implements \ArrayAccess
|
||||
$gGID = $this->properties[DB::GROUP_GID_COLUMN];
|
||||
$gName = $this->properties[DB::GROUP_NAME_COLUMN];
|
||||
|
||||
$uActive = $this->properties[DB::USER_ACTIVE_COLUMN];
|
||||
$uAvatar = $this->properties[DB::USER_AVATAR_COLUMN];
|
||||
$uEmail = $this->properties[DB::USER_EMAIL_COLUMN];
|
||||
$uHome = $this->properties[DB::USER_HOME_COLUMN];
|
||||
@@ -90,6 +91,7 @@ class QueryProvider implements \ArrayAccess
|
||||
(empty($uName) ? "null" : $uName) . " AS name, " .
|
||||
(empty($uEmail) ? "null" : $uEmail) . " AS email, " .
|
||||
(empty($uHome) ? "null" : $uHome) . " AS home, " .
|
||||
(empty($uActive) ? "true" : $uActive) . " AS active, " .
|
||||
(empty($uAvatar) ? "false" : $uAvatar) . " AS avatar";
|
||||
|
||||
$this->queries = [
|
||||
|
||||
Reference in New Issue
Block a user