aboutsummaryrefslogtreecommitdiff
path: root/cli/create-user.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-03-19 13:42:12 +0100
committerGravatar GitHub <noreply@github.com> 2024-03-19 13:42:12 +0100
commitb5445e1e56497f8bdc1de35a8325418c44b96d37 (patch)
treeae4aacc07c0d4034d20f9c57a2c7abbe6fa32afb /cli/create-user.php
parent6bd6494ad48c4894befed44e9c3f753c123aca5d (diff)
Fix CLI install regressions (#6214)
* Fix CLI install with prefix It was not possible to pass a blank prefix * Fix regression EXIT_CODE_ALREADY_EXISTS The dedicated exit code was not sent anymore when a user already exists
Diffstat (limited to 'cli/create-user.php')
-rwxr-xr-xcli/create-user.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/create-user.php b/cli/create-user.php
index 61bbc3563..1be604a42 100755
--- a/cli/create-user.php
+++ b/cli/create-user.php
@@ -58,6 +58,10 @@ if (!empty($cliOptions->errors)) {
$username = $cliOptions->user;
+if (preg_grep("/^$username$/i", listUsers())) {
+ fail('FreshRSS warning: username already exists “' . $username . '”', EXIT_CODE_ALREADY_EXISTS);
+}
+
echo 'FreshRSS creating user “', $username, "”…\n";
$values = [