Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump nextcloud/coding-standard from 1.1.1 to 1.2.1 #848

Merged
merged 2 commits into from
May 13, 2024
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
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/GroupBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0): arra
return $users;
}

public function createGroup(string $gid, string $samlGid = null): bool {
public function createGroup(string $gid, ?string $samlGid = null): bool {
try {
// Add group
$builder = $this->dbc->getQueryBuilder();
Expand Down
6 changes: 3 additions & 3 deletions lib/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ protected function assignUserToGroup(IUser $user, string $gid): void {

protected function createGroupInBackend(string $gid, ?string $originalGid = null): ?IGroup {
if ($this->groupManager instanceof PublicEmitter) {
$this->groupManager->emit('\OC\Group', 'preCreate', array($gid));
$this->groupManager->emit('\OC\Group', 'preCreate', [$gid]);
}
if (!$this->ownGroupBackend->createGroup($gid, $originalGid ?? $gid)) {
return null;
}

$group = $this->groupManager->get($gid);
if ($this->groupManager instanceof PublicEmitter) {
$this->groupManager->emit('\OC\Group', 'postCreate', array($group));
$this->groupManager->emit('\OC\Group', 'postCreate', [$group]);
}

return $group;
Expand All @@ -218,7 +218,7 @@ protected function findGroup(string $gid): IGroup {
GroupManager::LOCAL_GROUPS_CHECK_FOR_MIGRATION,
''
);
$strictBackendCheck = '' === $migrationAllowListRaw;
$strictBackendCheck = $migrationAllowListRaw === '';

$migrationAllowList = null;
if ($migrationAllowListRaw !== '') {
Expand Down
4 changes: 2 additions & 2 deletions lib/SAMLSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ public function delete(int $id): void {
* @throws Exception
*/
protected function ensureConfigurationsLoaded(int $idp = -1): void {
if (self::LOADED_ALL === $this->configurationsLoadedState
|| (self::LOADED_CHOSEN === $this->configurationsLoadedState
if ($this->configurationsLoadedState === self::LOADED_ALL
|| ($this->configurationsLoadedState === self::LOADED_CHOSEN
&& isset($this->configurations[$idp])
)
) {
Expand Down
6 changes: 3 additions & 3 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ public function createUserIfNotExists(string $uid, array $attributes = []): void
if ($home !== '') {
//if attribute's value is an absolute path take this, otherwise append it to data dir
//check for / at the beginning or pattern c:\ resp. c:/
if ('/' !== $home[0]
&& !(3 < strlen($home) && ctype_alpha($home[0])
&& $home[1] === ':' && ('\\' === $home[2] || '/' === $home[2]))
if ($home[0] !== '/'
&& !(strlen($home) > 3 && ctype_alpha($home[0])
&& $home[1] === ':' && ($home[2] === '\\' || $home[2] === '/'))
) {
$home = $this->config->getSystemValue('datadirectory',
\OC::$SERVERROOT.'/data') . '/' . $home;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/GroupBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
*/

use \OCA\User_SAML\GroupBackend;
use OCA\User_SAML\GroupBackend;
use OCP\IDBConnection;
use Psr\Log\LoggerInterface;
use Test\TestCase;
Expand Down
Loading