Files
FreshRSS/cli/update-user.php
Alexandre Alapetite bb9b166eb1 Fix CLI api_password (#3179)
* Fix CLI api_password

#fix https://github.com/FreshRSS/FreshRSS/issues/3177
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/2675

* Update cli/_update-or-create-user.php

Co-authored-by: oupala <oupala@users.noreply.github.com>

Co-authored-by: oupala <oupala@users.noreply.github.com>
2020-09-17 09:43:39 +02:00

32 lines
659 B
PHP
Executable File

#!/usr/bin/env php
<?php
$isUpdate = true;
require(__DIR__ . '/_update-or-create-user.php');
$username = cliInitUser($options['user']);
echo 'FreshRSS updating user “', $username, "”…\n";
$ok = FreshRSS_user_Controller::updateUser(
$username,
empty($options['mail_login']) ? null : $options['mail_login'],
empty($options['password']) ? '' : $options['password'],
$values);
if (!$ok) {
fail('FreshRSS could not update user!');
}
if (!empty($options['api_password'])) {
$error = FreshRSS_api_Controller::updatePassword($options['api_password']);
if ($error) {
fail($error);
}
}
invalidateHttpCache($username);
accessRights();
done($ok);