aboutsummaryrefslogtreecommitdiff
path: root/cli/update-user.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-08-19 16:26:17 +0200
committerGravatar GitHub <noreply@github.com> 2017-08-19 16:26:17 +0200
commitf09039b1da9c49dc616277f47b3deef1ca92f127 (patch)
tree7476dba425a794c516ded6c1a111ea68b8b55967 /cli/update-user.php
parent19df77c249f23f00d247799ca9deaf4fd923e2bf (diff)
parent4a813ff06fc06d1ce6c9cda2d66ff9895152be89 (diff)
Merge pull request #1602 from Alkarex/cli_update_user
CLI update user
Diffstat (limited to 'cli/update-user.php')
-rwxr-xr-xcli/update-user.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/update-user.php b/cli/update-user.php
new file mode 100755
index 000000000..ac674484c
--- /dev/null
+++ b/cli/update-user.php
@@ -0,0 +1,23 @@
+#!/usr/bin/php
+<?php
+$isUpdate = true;
+require('_update-or-create-user.php');
+
+$username = cliInitUser($options['user']);
+
+echo 'FreshRSS updating user “', $username, "”…\n";
+
+$ok = FreshRSS_user_Controller::updateContextUser(
+ empty($options['password']) ? '' : $options['password'],
+ empty($options['api_password']) ? '' : $options['api_password'],
+ $values);
+
+if (!$ok) {
+ fail('FreshRSS could not update user!');
+}
+
+invalidateHttpCache($username);
+
+accessRights();
+
+done($ok);