aboutsummaryrefslogtreecommitdiff
path: root/cli/create-user.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-24 01:41:09 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-24 01:41:09 +0200
commitab4ece6780cf841f6ce4e89f7b81a1ff1661f615 (patch)
tree61b7f383d2d9749bc19e4154dcb0407f88785314 /cli/create-user.php
parent1f03e8a3aec8ff4b7bbba45bc3fd14a0552c2bc4 (diff)
CLI do-install
https://github.com/FreshRSS/FreshRSS/issues/1095 https://github.com/FreshRSS/FreshRSS/issues/1090
Diffstat (limited to 'cli/create-user.php')
-rwxr-xr-xcli/create-user.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/create-user.php b/cli/create-user.php
index 243e65a35..5e93d4605 100755
--- a/cli/create-user.php
+++ b/cli/create-user.php
@@ -12,8 +12,8 @@ $options = getopt('', array(
));
if (empty($options['user'])) {
- fail('Usage: ' . basename(__FILE__) . " --user username --password 'password' --api-password 'api_password'" .
- " --language en --email user@example.net --token 'longRandomString'");
+ fail('Usage: ' . basename(__FILE__) . " --user username ( --password 'password' --api-password 'api_password'" .
+ " --language en --email user@example.net --token 'longRandomString' )");
}
$username = $options['user'];
if (!ctype_alnum($username)) {
@@ -35,6 +35,12 @@ $ok = FreshRSS_user_Controller::createUser($username,
'token' => empty($options['token']) ? '' : $options['token'],
));
+if (!$ok) {
+ fail('FreshRSS could not create user!');
+}
+
invalidateHttpCache(FreshRSS_Context::$system_conf->default_user);
+accessRights();
+
done($ok);