Skip to content

Commit

Permalink
PHPRector
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Oct 16, 2023
1 parent 053aa08 commit 75c0107
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Services/LDAPService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function isUser(string $user = '', string $pass = ''): bool
$this->closeConnection($linkIdentifier);
}
} catch (\Exception $e) {
$this->logger->error(__CLASS__.' ['.__FUNCTION__.'] '.$e->getMessage());
$this->logger->error(self::class.' ['.__FUNCTION__.'] '.$e->getMessage());

throw $e;
}
Expand All @@ -108,7 +108,7 @@ public function getName(string $user): string
$this->closeConnection($linkIdentifier);
}
} catch (\Exception $e) {
$this->logger->error(__CLASS__.' ['.__FUNCTION__.'] '.$e->getMessage());
$this->logger->error(self::class.' ['.__FUNCTION__.'] '.$e->getMessage());

throw $e;
}
Expand All @@ -135,7 +135,7 @@ public function getMail(string $user): string
$this->closeConnection($linkIdentifier);
}
} catch (\Exception $e) {
$this->logger->error(__CLASS__.' ['.__FUNCTION__.'] '.$e->getMessage());
$this->logger->error(self::class.' ['.__FUNCTION__.'] '.$e->getMessage());

throw $e;
}
Expand Down Expand Up @@ -198,7 +198,7 @@ public function getListUsers(string $cn = '', string $mail = ''): array
$this->closeConnection($linkIdentifier);
}
} catch (\Exception $e) {
$this->logger->error(__CLASS__.' ['.__FUNCTION__.'] '.$e->getMessage());
$this->logger->error(self::class.' ['.__FUNCTION__.'] '.$e->getMessage());

throw $e;
}
Expand Down
14 changes: 7 additions & 7 deletions Services/LDAPUserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ protected function updateGroups(array $info, User $user)
$group = $this->getGroup($value, self::EDU_PERSON_AFFILIATION);
$this->userService->addGroup($group, $user, true, false);
$aGroups[] = $group->getKey();
$this->logger->info(__CLASS__.' ['.__FUNCTION__.'] Added Group: '.$group->getName());
$this->logger->info(self::class.' ['.__FUNCTION__.'] Added Group: '.$group->getName());
} catch (\ErrorException $e) {
$this->logger->info(
__CLASS__.' ['.__FUNCTION__.'] Invalid Group '.$value.': '.$e->getMessage()
self::class.' ['.__FUNCTION__.'] Invalid Group '.$value.': '.$e->getMessage()
);
} catch (\Exception $e) {
$this->logger->error(
__CLASS__.' ['.__FUNCTION__.'] Error on adding Group '.$value.': '.$e->getMessage()
self::class.' ['.__FUNCTION__.'] Error on adding Group '.$value.': '.$e->getMessage()
);
}
}
Expand All @@ -206,14 +206,14 @@ protected function updateGroups(array $info, User $user)
$group = $this->getGroup($value, self::IRISCLASSIFCODE);
$this->userService->addGroup($group, $user, true, false);
$aGroups[] = $group->getKey();
$this->logger->info(__CLASS__.' ['.__FUNCTION__.'] Added Group: '.$group->getName());
$this->logger->info(self::class.' ['.__FUNCTION__.'] Added Group: '.$group->getName());
} catch (\ErrorException $e) {
$this->logger->info(
__CLASS__.' ['.__FUNCTION__.'] Invalid Group '.$value.': '.$e->getMessage()
self::class.' ['.__FUNCTION__.'] Invalid Group '.$value.': '.$e->getMessage()
);
} catch (\Exception $e) {
$this->logger->error(
__CLASS__.' ['.__FUNCTION__.'] Error on adding Group '.$value.': '.$e->getMessage()
self::class.' ['.__FUNCTION__.'] Error on adding Group '.$value.': '.$e->getMessage()
);
}
}
Expand All @@ -226,7 +226,7 @@ protected function updateGroups(array $info, User $user)
try {
$this->userService->deleteGroup($group, $user, true, false);
} catch (\Exception $e) {
$this->logger->error(__CLASS__.' ['.__FUNCTION__.'] Delete group '.$group->getKey().' from user : '.$e->getMessage());
$this->logger->error(self::class.' ['.__FUNCTION__.'] Delete group '.$group->getKey().' from user : '.$e->getMessage());
}
}
}
Expand Down

0 comments on commit 75c0107

Please sign in to comment.