Skip to content

Commit

Permalink
YunoHost username should be in lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
PatBriPerso committed Jul 15, 2024
1 parent 98b61c0 commit 56fb418
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion app/Models/YnhServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ private function sshCreateUserProfile(SshConnection2 $ssh, string $fullname, str
}

$fullname = preg_replace("/[^A-Za-z0-9 ,.'-]/", '', $fullname);
$fullname = Str::lower($fullname);
$password = Str::replace('!', '\!', $password); // history substitution
$ssh->newTrace(SshTraceStateEnum::IN_PROGRESS, 'Creating user profile...');
$isOk = $ssh->executeCommand("sudo yunohost user create {$username} -F \"{$fullname}\" -p \"{$password}\" -d {$domain->name}", $output);
Expand Down
2 changes: 1 addition & 1 deletion app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function canUseAdversaryMeter(): bool

public function ynhUsername(): string
{
return Str::before(Str::before($this->email, '@'), '+');
return Str::lower(Str::before(Str::before($this->email, '@'), '+'));
}

public function ynhPassword(): string
Expand Down

0 comments on commit 56fb418

Please sign in to comment.