Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Service/Stackiq/ContactPersonHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ private function addUserToGroup(\OCP\IUser $user, string $groupName, string $typ
}
}

if ($group !== false && $group->inGroup($user) === false) {
if ($group !== null && $group->inGroup($user) === false) {
$group->addUser($user);
$this->_logger->info(
'Added user to group',
Expand Down Expand Up @@ -913,7 +913,7 @@ public function updateUserGroupsFromContactData(\OCP\IUser $user, array $contact
foreach ($allPossibleRoleGroups as $roleGroup) {
if ($roleGroup !== $newRoleGroup) {
$group = $this->_groupManager->get($roleGroup);
if ($group !== false && $group->inGroup($user) === true) {
if ($group !== null && $group->inGroup($user) === true) {
$group->removeUser($user);
$this->_logger->info(
'Removed user from old organization type role group',
Expand Down Expand Up @@ -1414,7 +1414,7 @@ public function assignBeheerderRole(object $contactPersonObject, string $usernam

if (empty($maintainerGroup) === false) {
$user = $this->_userManager->get($username);
if ($user !== false && $maintainerGroup->inGroup($user) === false) {
if ($user !== null && $maintainerGroup->inGroup($user) === false) {
$maintainerGroup->addUser($user);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/Stackiq/OrganizationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,15 +699,15 @@ function ($a, $b) {
$timeA = 0;
if ($userA !== null) {
$lastLoginA = $userA->getLastLogin();
if ($lastLoginA !== 0 && $lastLoginA !== null && $lastLoginA !== false) {
if ($lastLoginA !== 0) {
$timeA = (int)$lastLoginA;
}
}

$timeB = 0;
if ($userB !== null) {
$lastLoginB = $userB->getLastLogin();
if ($lastLoginB !== 0 && $lastLoginB !== null && $lastLoginB !== false) {
if ($lastLoginB !== 0) {
$timeB = (int)$lastLoginB;
}
}
Expand Down
12 changes: 6 additions & 6 deletions lib/Service/StackiqService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,7 @@ private function activateUsersForOrganization(string $organizationUuid): void {

if (empty($username) === false) {
$user = $userManager->get($username);
if ($user !== false && $user->isEnabled() === false) {
if ($user !== null && $user->isEnabled() === false) {
$user->setEnabled(true);
$activatedCount++;

Expand Down Expand Up @@ -2184,7 +2184,7 @@ private function deactivateUsersForOrganization(string $organizationUuid): void

if (empty($username) === false) {
$user = $userManager->get($username);
if ($user !== false && $user->isEnabled() === true) {
if ($user !== null && $user->isEnabled() === true) {
$user->setEnabled(false);
$deactivatedCount++;

Expand Down Expand Up @@ -2268,7 +2268,7 @@ private function activateStackiqUsersForOrganization(string $organizationUuid):
foreach ($softwareCatalogUsers as $username) {
try {
$user = $userManager->get($username);
if ($user !== false && $user->isEnabled() === false) {
if ($user !== null && $user->isEnabled() === false) {
$user->setEnabled(true);
$activatedUsers[] = $username;
$this->_logger->debug(
Expand All @@ -2278,7 +2278,7 @@ private function activateStackiqUsersForOrganization(string $organizationUuid):
'username' => $username,
]
);
} elseif ($user !== false && $user->isEnabled() === true) {
} elseif ($user !== null && $user->isEnabled() === true) {
$this->_logger->debug(
'StackiqService: Stackiq user already active',
[
Expand Down Expand Up @@ -2376,7 +2376,7 @@ private function deactivateStackiqUsersForOrganization(string $organizationUuid)
foreach ($softwareCatalogUsers as $username) {
try {
$user = $userManager->get($username);
if ($user !== false && $user->isEnabled() === true) {
if ($user !== null && $user->isEnabled() === true) {
$user->setEnabled(false);
$deactivatedUsers[] = $username;
$this->_logger->debug(
Expand All @@ -2386,7 +2386,7 @@ private function deactivateStackiqUsersForOrganization(string $organizationUuid)
'username' => $username,
]
);
} elseif ($user !== false && $user->isEnabled() === false) {
} elseif ($user !== null && $user->isEnabled() === false) {
$this->_logger->debug(
'StackiqService: Stackiq user already inactive',
[
Expand Down
Loading
Loading